/* Panel ShoofMe : la même identité que l'application (nuit, safran, Plus Jakarta Sans). */
:root {
  --nuit: #0b0c0f;
  --encre: #16171a;
  --brume: #24262c;
  --ligne: #2e3037;
  --sable: #a9abb3;
  --ivoire: #f3efe6;
  --safran: #ffb627;
  --lagune: #3fd0c9;
  --corail: #ff6b5a;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--nuit); color: var(--ivoire); font: 15px/1.5 "Plus Jakarta Sans", system-ui, sans-serif; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
a { color: inherit; }
.muted { color: var(--sable); }
.error { color: var(--corail); margin: 0; }

input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
  width: 100%; background: var(--nuit); border: 1px solid var(--ligne); border-radius: 10px; padding: 10px 12px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--safran); }
label { display: grid; gap: 6px; font-size: 13px; color: var(--sable); font-weight: 600; }
button { cursor: pointer; border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 700; background: var(--brume); }
button:hover { filter: brightness(1.12); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--safran); outline-offset: 2px; }
button.primary { background: var(--safran); color: #14110a; }
button.danger { background: transparent; color: var(--corail); box-shadow: inset 0 0 0 1px var(--corail); }
button.ghost { background: transparent; color: var(--sable); padding: 8px 12px; }
button:disabled { opacity: .5; cursor: default; }

/* Connexion */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1200px 600px at 20% -10%, #2a2108 0%, transparent 60%), var(--nuit); }
.login-card { width: min(380px, 100%); background: var(--encre); border-radius: 22px; padding: 32px; display: grid; gap: 16px; }
.login-logo { width: 52px; height: 52px; }
.login-card h1 { font-size: 26px; font-weight: 800; }

/* Structure */
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--encre); padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; padding: 0 10px 18px; }
.brand img { width: 32px; height: 32px; }
.side a { text-decoration: none; padding: 10px 12px; border-radius: 10px; color: var(--sable); font-weight: 600; }
.side a.active { background: var(--brume); color: var(--ivoire); box-shadow: inset 3px 0 0 var(--safran); }
.side a:hover { color: var(--ivoire); }
.side-foot { margin-top: auto; display: grid; gap: 6px; padding: 0 10px; }
.me { font-size: 13px; color: var(--sable); }
.content { padding: 26px 32px 60px; min-width: 0; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.top h1 { font-size: 28px; font-weight: 800; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--brume); white-space: nowrap; }
.pill.credits { background: #2a2108; color: var(--safran); }
.pill.active { background: rgba(63, 208, 201, .14); color: var(--lagune); }
.pill.trial { background: rgba(255, 182, 39, .14); color: var(--safran); }
.pill.expired { background: rgba(255, 107, 90, .14); color: var(--corail); }
.pill.blocked, .pill.unknown { background: var(--brume); color: var(--sable); }

/* Cartes et tableaux */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 26px; }
.card { background: var(--encre); border-radius: var(--radius); padding: 18px; }
.card .n { font-size: 32px; font-weight: 800; }
.card .l { color: var(--sable); font-size: 13px; font-weight: 600; }
.panel { background: var(--encre); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.panel h2 { font-size: 17px; font-weight: 700; margin-bottom: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row > label { flex: 1 1 180px; }
.row > button { flex: 0 0 auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--sable); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--ligne); }
td { padding: 11px 10px; border-bottom: 1px solid var(--ligne); vertical-align: middle; }
tbody tr { cursor: default; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: rgba(255, 255, 255, .03); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .02em; }
.empty { color: var(--sable); padding: 18px 4px; }
.table-wrap { overflow-x: auto; }
.plus { color: var(--lagune); font-weight: 700; }
.minus { color: var(--corail); font-weight: 700; }

/* Fiche d'un client */
.drawer { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); display: flex; justify-content: flex-end; z-index: 10; }
.drawer-card { width: min(520px, 100%); height: 100%; overflow-y: auto; background: var(--encre); padding: 26px; display: grid; align-content: start; gap: 18px; }
.close { justify-self: end; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 14px; }
.facts dt { color: var(--sable); }
.facts dd { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.list { display: grid; gap: 8px; }
.list .item { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--nuit); border-radius: 10px; padding: 10px 12px; }
.item .sub { color: var(--sable); font-size: 12px; word-break: break-all; }
.tabs { display: flex; gap: 6px; }
.tabs button { padding: 6px 14px; font-size: 13px; }
.tabs button.on { background: var(--safran); color: #14110a; }
.stack { display: grid; gap: 10px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ivoire); color: #14110a; padding: 10px 18px; border-radius: 999px; font-weight: 700; z-index: 20; }
.toast.bad { background: var(--corail); color: #14110a; }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .brand { padding: 0 8px 0 0; }
  .side-foot { margin: 0 0 0 auto; display: flex; }
  .content { padding: 18px 16px 48px; }
}
