/* ============ Police (auto-hébergée) ============ */
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(fonts/inter-latin-wght-normal.woff2) format('woff2-variations'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(fonts/inter-latin-ext-wght-normal.woff2) format('woff2-variations'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ============ Jetons ============ */
:root {
  --font: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --r-sm: 8px; --r: 11px; --r-lg: 18px; --r-xl: 22px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
}
:root, [data-theme="light"] {
  --bg: #F5F5F7;
  --side: #FBFBFD;
  --surface: #FFFFFF;
  --surface-2: #F5F5F7;
  --hover: #F0F0F2;
  --seg: #EAEAED;
  --text: #0A0A0A;
  --text-2: #3A3A3C;
  --muted: #6E6E73;
  --line: rgba(0,0,0,.06);
  --line-2: rgba(0,0,0,.10);
  --line-3: rgba(0,0,0,.16);
  --inv: #0A0A0A;
  --inv-text: #FFFFFF;
  --bar: #D8D8DD;
  --sh-card: 0 0 0 1px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.04);
  --sh-pop: 0 0 0 1px rgba(0,0,0,.05), 0 8px 16px rgba(0,0,0,.04), 0 24px 48px rgba(0,0,0,.08), 0 48px 96px rgba(0,0,0,.08);
  --sh-btn: 0 1px 2px rgba(0,0,0,.16), 0 6px 16px rgba(0,0,0,.12);
  --sh-seg: 0 1px 2px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
  --scrim: rgba(245,245,247,.55);
  --ok: #1F7A3A; --ok-bg: #E8F5EC; --ok-dot: #1F9D48;
  --warn: #9A4D00; --warn-bg: #FFF1E0;
  --bad: #B42318; --bad-bg: #FDECEA;
  --neutral-bg: #F0F0F2;
  --focus: 0 0 0 4px rgba(10,10,10,.08);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #000000;
  --side: #0A0A0B;
  --surface: #121214;
  --surface-2: #19191B;
  --hover: #1C1C1F;
  --seg: #1C1C1F;
  --text: #F5F5F7;
  --text-2: #D1D1D6;
  --muted: #8E8E93;
  --line: rgba(255,255,255,.07);
  --line-2: rgba(255,255,255,.11);
  --line-3: rgba(255,255,255,.18);
  --inv: #F5F5F7;
  --inv-text: #000000;
  --bar: #2C2C2E;
  --sh-card: 0 0 0 1px rgba(255,255,255,.05), 0 12px 32px rgba(0,0,0,.5);
  --sh-pop: 0 0 0 1px rgba(255,255,255,.08), 0 24px 64px rgba(0,0,0,.7);
  --sh-btn: 0 0 0 1px rgba(255,255,255,.06), 0 8px 24px rgba(255,255,255,.06);
  --sh-seg: 0 0 0 1px rgba(255,255,255,.06), 0 2px 6px rgba(0,0,0,.4);
  --scrim: rgba(0,0,0,.55);
  --ok: #30D158; --ok-bg: rgba(48,209,88,.12); --ok-dot: #30D158;
  --warn: #FFB340; --warn-bg: rgba(255,159,10,.14);
  --bad: #FF6961; --bad-bg: rgba(255,69,58,.14);
  --neutral-bg: #1C1C1F;
  --focus: 0 0 0 4px rgba(255,255,255,.10);
  color-scheme: dark;
}

/* ============ Base ============ */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-feature-settings: 'cv11', 'ss01';
  background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  transition: background .3s var(--ease), color .3s var(--ease);
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.num { font-feature-settings: 'tnum'; }
.mono { font-feature-settings: 'tnum', 'zero'; letter-spacing: .06em; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ============ Boutons ============ */
.btn {
  height: 40px; padding: 0 16px; border-radius: var(--r); border: 1px solid var(--line-2);
  background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; text-decoration: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  transition: transform .15s var(--ease), background .2s, box-shadow .2s, opacity .2s;
}
.btn:hover { background: var(--hover); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--inv); color: var(--inv-text); border-color: transparent; font-weight: 600; box-shadow: var(--sh-btn); }
.btn.primary:hover { opacity: .88; }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.lg { height: 50px; font-size: 15px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.round { border-radius: 50%; background: var(--hover); color: var(--text-2); width: 34px; height: 34px; }

/* ============ Champs ============ */
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label, .field > .lbl { font-size: 13px; font-weight: 500; }
.field .hint { font-size: 12px; color: var(--muted); }
.input {
  height: 44px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--line-2);
  background: var(--surface); font-size: 14px; outline: none; width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
textarea.input { height: auto; padding: 12px 14px; resize: vertical; min-height: 84px; }
.input:focus { border-color: var(--text); box-shadow: var(--focus); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .input { padding-right: 48px; }
.input-wrap .icon-btn { position: absolute; right: 6px; }
.search {
  height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--muted);
}
.search input { border: 0; background: transparent; outline: none; flex: 1; min-width: 0; font-size: 13px; color: var(--text); }

/* Segmenté */
.seg { display: inline-flex; flex-wrap: wrap; padding: 3px; border-radius: 11px; background: var(--seg); gap: 2px; }
.seg button {
  height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px;
  transition: background .2s var(--ease), color .2s, box-shadow .2s;
}
.seg button .c { font-size: 12px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--sh-seg); }
.seg.full { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; }
.seg.full button { justify-content: center; height: 34px; }

/* Interrupteur */
.switch { width: 38px; height: 22px; flex: 0 0 38px; border-radius: 11px; background: var(--line-3); position: relative; transition: background .25s var(--ease); }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .3s var(--spring); }
[aria-checked="true"] > .switch { background: var(--inv); }
[aria-checked="true"] > .switch::after { transform: translateX(16px); }
[data-theme="dark"] [aria-checked="true"] > .switch::after { background: #000; }
.toggle-row {
  display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 12px; width: 100%;
  border: 1px solid var(--line); background: var(--surface-2); text-align: left;
}
.toggle-row .t { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.toggle-row .t b { font-size: 14px; font-weight: 500; }
.toggle-row .t span { font-size: 12px; color: var(--muted); }

.stepper { height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 4px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); }
.stepper button { width: 36px; height: 36px; border: 0; border-radius: 8px; background: var(--surface-2); font-size: 18px; }
.stepper button:hover { background: var(--hover); }
.stepper input { width: 70px; text-align: center; border: 0; background: transparent; font-size: 15px; font-weight: 600; outline: none; font-feature-settings: 'tnum'; }

/* Pastilles */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.pill.ok { color: var(--ok); background: var(--ok-bg); }
.pill.warn { color: var(--warn); background: var(--warn-bg); }
.pill.bad { color: var(--bad); background: var(--bad-bg); }
.pill.neutral { color: var(--text-2); background: var(--neutral-bg); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.dot.on { background: var(--ok-dot); box-shadow: 0 0 0 3px var(--ok-bg); }
.kbd { font-size: 11px; font-weight: 500; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--muted); }

/* ============ Connexion ============ */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 48px 16px; }
.auth-card {
  width: 100%; max-width: 400px; padding: 40px; border-radius: var(--r-xl); background: var(--surface);
  box-shadow: 0 0 0 1px rgba(0,0,0,.04), 0 2px 4px rgba(0,0,0,.03), 0 12px 24px rgba(0,0,0,.05), 0 40px 80px rgba(0,0,0,.06);
  display: flex; flex-direction: column; animation: rise .5s var(--ease) both;
}
[data-theme="dark"] .auth-card { box-shadow: var(--sh-pop); }
.auth-card h1 { margin: 32px 0 8px; font-size: 28px; line-height: 1.15; font-weight: 600; letter-spacing: -.03em; }
.auth-card p.sub { margin: 0 0 28px; color: var(--muted); }
.auth-card .field + .field { margin-top: 18px; }
.auth-card .btn { margin-top: 28px; }
.auth-error { margin-top: 14px; font-size: 13px; color: var(--bad); min-height: 18px; }
.auth-foot { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; font-size: 12px; color: var(--muted); }
.auth-foot span { display: inline-flex; align-items: center; gap: 6px; }

/* Marque */
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand .mark { width: 28px; height: 28px; border-radius: 8px; flex: 0 0 28px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.brand .mark img { width: 100%; height: 100%; object-fit: contain; }
.brand b { font-size: 15px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 3px 7px; border-radius: 6px; background: var(--hover); }

/* ============ Structure ============ */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 248px; flex: 0 0 248px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 20px 14px; display: flex; flex-direction: column; gap: 22px;
  background: var(--side); border-right: 1px solid var(--line);
}
.side .brand { padding: 4px 8px; }
.side .brand .tag { margin-left: auto; }
.side .search-btn {
  height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); font-size: 13px; text-align: left;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.side .search-btn span:first-of-type { flex: 1; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group > span { padding: 0 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.nav-item {
  height: 36px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border-radius: 9px;
  text-decoration: none; font-size: 14px; font-weight: 500; color: var(--text-2);
  transition: background .2s var(--ease), color .2s;
}
.nav-item:hover { background: var(--hover); }
.nav-item[aria-current="page"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(0,0,0,.05), 0 4px 10px rgba(0,0,0,.04); }
.nav-item .i { width: 17px; height: 17px; }
.nav-item .c { margin-left: auto; font-size: 12px; color: var(--muted); font-feature-settings: 'tnum'; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 14px; }
.who { display: flex; align-items: center; gap: 10px; padding: 8px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--inv); color: var(--inv-text); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; text-transform: uppercase; }
.who .n { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.who .n b { font-size: 13px; }
.who .n span { font-size: 12px; color: var(--muted); }

.main { flex: 1; min-width: 0; padding: 32px clamp(16px, 3vw, 40px) 64px; display: flex; flex-direction: column; gap: 24px; animation: fade .35s var(--ease) both; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.head p { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.head h1 { margin: 0; font-size: 30px; line-height: 1.1; font-weight: 600; letter-spacing: -.03em; }
.head .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.toolbar .search { flex: 0 1 300px; }
.mobile-bar { display: none; }

/* Cartes */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-card); padding: 24px; min-width: 0; }
.card h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.card-head a { font-size: 13px; font-weight: 500; text-decoration: none; }
.card-head a:hover { color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.kpi { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.kpi .l { font-size: 13px; color: var(--muted); }
.kpi .v { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.kpi .v b { font-size: 34px; line-height: 1; font-weight: 600; letter-spacing: -.03em; font-feature-settings: 'tnum'; }
.kpi .v svg { width: 88px; height: 32px; }
.kpi .n { font-size: 12px; font-weight: 500; color: var(--muted); }
.kpi .n.up { color: var(--ok); } .kpi .n.warn { color: var(--warn); }

.chart { height: 200px; display: flex; align-items: flex-end; gap: 6px; margin-top: 16px; }
.chart .b { flex: 1 1 0; min-width: 0; border-radius: 4px 4px 2px 2px; background: var(--bar); position: relative; transition: height .5s var(--ease), background .2s; min-height: 3px; }
.chart .b.today { background: var(--inv); }
.chart .b:hover { background: var(--text-2); }
.chart .b .tip {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(4px); opacity: 0; pointer-events: none;
  background: var(--inv); color: var(--inv-text); font-size: 12px; font-weight: 500; padding: 5px 8px; border-radius: 7px; white-space: nowrap;
  transition: opacity .15s, transform .15s var(--ease); z-index: 2;
}
.chart .b:hover .tip { opacity: 1; transform: translateX(-50%) translateY(0); }
.chart-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 10px; }
.big { font-size: 22px; font-weight: 600; color: var(--text); letter-spacing: -.02em; font-feature-settings: 'tnum'; }

.kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { font-weight: 500; text-align: right; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .ic { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; background: var(--hover); display: flex; align-items: center; justify-content: center; }
.list .ic.bad { background: var(--bad-bg); color: var(--bad); }
.list .ic.ok { background: var(--ok-bg); color: var(--ok); }
.list .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list .tx b { font-size: 14px; font-weight: 500; }
.list .tx span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .tm { font-size: 12px; color: var(--muted); white-space: nowrap; }
.list li.click { cursor: pointer; border-radius: 10px; }
.list li.click:hover { background: var(--surface-2); }

.empty { padding: 40px 16px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .ic { width: 48px; height: 48px; border-radius: 14px; background: var(--hover); display: flex; align-items: center; justify-content: center; color: var(--text-2); }
.empty b { color: var(--text); font-size: 15px; font-weight: 600; }

/* Tableau */
.table-card { padding: 0; overflow-x: auto; }
table.t { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 14px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
table.t th:first-child, table.t td:first-child { padding-left: 20px; }
table.t th:last-child, table.t td:last-child { padding-right: 20px; text-align: right; }
table.t tbody tr { transition: background .15s; }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr.click:hover { background: var(--surface-2); }
table.t tbody tr:last-child td { border-bottom: 0; }
.who-cell { display: flex; align-items: center; gap: 12px; }
.who-cell .av { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 9px; background: var(--hover); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; text-transform: uppercase; }
.who-cell .tx { display: flex; flex-direction: column; min-width: 0; }
.who-cell .tx b { font-weight: 500; }
.who-cell .tx span { font-size: 12px; color: var(--muted); }
.key-cell { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; }
.meter { display: flex; flex-direction: column; gap: 6px; width: 110px; font-size: 13px; }
.meter i { height: 4px; border-radius: 2px; background: var(--hover); display: block; overflow: hidden; }
.meter i u { height: 100%; display: block; background: var(--inv); border-radius: 2px; text-decoration: none; }
.pager { display: flex; justify-content: center; padding: 16px; }

/* ============ Calques ============ */
.scrim { position: fixed; inset: 0; background: var(--scrim); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 40; animation: fade .25s var(--ease) both; }
.drawer {
  position: fixed; top: 12px; right: 12px; bottom: 12px; width: min(460px, calc(100vw - 24px)); z-index: 41;
  border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--sh-pop);
  display: flex; flex-direction: column; overflow: hidden; animation: slide .4s var(--ease) both;
}
.drawer.closing { animation: slideOut .25s var(--ease) both; }
.scrim.closing { animation: fadeOut .25s var(--ease) both; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 0; }
.drawer-head h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 20px; }
.drawer-foot { display: flex; gap: 10px; padding: 16px 24px 20px; border-top: 1px solid var(--line); }
.drawer-foot .btn { flex: 1; height: 46px; border-radius: 12px; }
.drawer-foot .btn.primary { flex: 2; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.section-t { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 4px 0 -8px; }

.modal-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { width: 100%; max-width: 420px; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--sh-pop); padding: 28px; position: relative; z-index: 1; animation: pop .3s var(--spring) both; }
.modal h3 { margin: 0 0 8px; font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.modal p { margin: 0 0 22px; color: var(--muted); }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; }
.modal-wrap .scrim { position: absolute; }

/* Carte licence */
.lcard {
  height: 232px; padding: 22px 24px; border-radius: 18px; color: #F5F5F7; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #2C2C2E 0%, #0A0A0B 46%, #1C1C1E 72%, #3A3A3C 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), inset 0 0 0 1px rgba(255,255,255,.06), 0 2px 4px rgba(0,0,0,.12), 0 18px 40px rgba(0,0,0,.28);
  display: flex; flex-direction: column; justify-content: space-between; flex: 0 0 auto;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .4s var(--ease);
}
.lcard::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 70%) var(--my, 0%), rgba(255,255,255,.10), transparent 45%);
}
.lcard .rings { position: absolute; right: -70px; top: -60px; width: 260px; height: 260px; }
.lcard .top, .lcard .bot { display: flex; justify-content: space-between; align-items: center; position: relative; gap: 12px; }
.lcard .bot { align-items: flex-end; }
.lcard .top .b { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.lcard .top .b img { width: 22px; height: 22px; border-radius: 6px; object-fit: contain; background: #F5F5F7; }
.lcard .plan { font-size: 11px; font-weight: 600; letter-spacing: .12em; color: rgba(245,245,247,.75); }
.lcard .key { position: relative; font-size: 19px; font-weight: 600; letter-spacing: .1em; font-feature-settings: 'tnum', 'zero'; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.lcard .key.ph { color: rgba(245,245,247,.5); }
.lcard .key button { width: 30px; height: 30px; border-radius: 8px; border: 0; background: rgba(255,255,255,.1); color: #F5F5F7; display: inline-flex; align-items: center; justify-content: center; }
.lcard .key button:hover { background: rgba(255,255,255,.18); }
.lcard .c { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lcard .c small { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: rgba(245,245,247,.62); }
.lcard .c b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-feature-settings: 'tnum'; }
.lcard .stats { display: flex; gap: 18px; text-align: right; }

.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.info-grid > div { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.info-grid > div:nth-child(odd) { border-right: 1px solid var(--line); }
.info-grid > div:nth-last-child(-n+2) { border-bottom: 0; }
.info-grid small { display: block; font-size: 12px; color: var(--muted); }
.info-grid b { display: block; margin-top: 4px; font-size: 14px; font-weight: 600; font-feature-settings: 'tnum'; }
.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.action-grid .btn { justify-content: flex-start; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 8px 0; font-size: 13px; }
.timeline li::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--line-3); margin-top: 6px; flex: 0 0 7px; }
.timeline li div { flex: 1; min-width: 0; }
.timeline li span { color: var(--muted); font-size: 12px; display: block; }

/* Menu contextuel */
.menu { position: fixed; z-index: 70; min-width: 200px; padding: 6px; border-radius: 14px; background: var(--surface); box-shadow: var(--sh-pop); animation: pop .2s var(--ease) both; }
.menu button { width: 100%; height: 36px; border: 0; background: transparent; border-radius: 8px; display: flex; align-items: center; gap: 10px; padding: 0 10px; font-size: 14px; text-align: left; }
.menu button:hover { background: var(--hover); }
.menu button.bad { color: var(--bad); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }

/* Palette Ctrl+K */
.palette-wrap { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.palette { width: 100%; max-width: 580px; border-radius: 18px; background: var(--surface); box-shadow: var(--sh-pop); overflow: hidden; position: relative; z-index: 1; animation: pop .25s var(--spring) both; }
.palette .in { display: flex; align-items: center; gap: 10px; padding: 0 18px; height: 58px; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette .in input { flex: 1; border: 0; outline: none; background: transparent; font-size: 16px; color: var(--text); }
.palette ul { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow-y: auto; }
.palette li.g { padding: 10px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.palette li.o { height: 42px; display: flex; align-items: center; gap: 12px; padding: 0 10px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.palette li.o span.s { margin-left: auto; font-size: 12px; color: var(--muted); }
.palette li.o[aria-selected="true"] { background: var(--hover); }
.palette .ft { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* Notifications */
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: var(--inv); color: var(--inv-text); font-size: 13px; font-weight: 500; box-shadow: 0 12px 32px rgba(0,0,0,.25); animation: toastIn .35s var(--spring) both; max-width: 360px; }
.toast.out { animation: toastOut .25s var(--ease) both; }
.toast .ok { color: #30D158; } [data-theme="dark"] .toast .ok { color: #1F7A3A; }
.toast .bad { color: #FF6961; } [data-theme="dark"] .toast .bad { color: #B42318; }

/* Upload */
.drop { border: 1.5px dashed var(--line-3); border-radius: 16px; padding: 28px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; transition: border-color .2s, background .2s; cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--text); background: var(--surface-2); }
.drop b { color: var(--text); }
.progress { height: 4px; border-radius: 2px; background: var(--hover); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--inv); transition: width .2s; }
.logo-prev { width: 96px; height: 96px; border-radius: 22px; background: var(--surface-2); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.logo-prev img { width: 100%; height: 100%; object-fit: contain; }

/* Squelettes */
.sk { background: linear-gradient(90deg, var(--hover) 0%, var(--surface-2) 50%, var(--hover) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; border-radius: 8px; }

/* ============ Animations ============ */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes slide { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes slideOut { to { opacity: 0; transform: translateX(24px); } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ============ Mobile ============ */
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .side { position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; height: auto; transform: translateX(-105%); transition: transform .35s var(--ease); box-shadow: var(--sh-pop); }
  .side.open { transform: none; }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--side); position: sticky; top: 0; z-index: 30; }
  .main { padding-top: 20px; }
  .head h1 { font-size: 26px; }
  .auth-card { padding: 28px; }
  #toasts { left: 16px; right: 16px; align-items: stretch; }
}
