/* FlowDon — feuille de styles. Charte : corail, brique, encre, sauge, pêche, crème · Outfit + JetBrains Mono */

:root {
  --corail: #E0603A;
  --brique: #B23A17;
  --brique-h: #962F12;
  --encre: #16241D;
  --sauge: #2E7D4F;
  --peche: #FCE6DA;
  --creme: #FBF7F2;

  --bg: #FBF7F2;
  --surface: #FFFFFF;
  --surface-2: #F6F0E8;
  --line: #ECE3D8;
  --line-strong: #DCCFC0;
  --text: #16241D;
  --text-2: #4A5751;
  --text-3: #6E7A74;
  --accent: #B23A17;
  --accent-soft: #FCE6DA;
  --accent-ink: #8A2C10;
  --ok: #2E7D4F;
  --ok-soft: #E3F1E8;
  --warn: #9A5B00;
  --warn-soft: #FFF1D6;
  --danger: #B42318;
  --danger-soft: #FDE7E4;
  --side: #16241D;
  --side-text: #D8E0DB;
  --side-mute: #93A39A;
  --shadow: 0 1px 2px rgba(22,36,29,.06), 0 8px 24px -12px rgba(22,36,29,.18);
  --shadow-lg: 0 24px 60px -20px rgba(22,36,29,.35);
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Outfit', 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --ease: cubic-bezier(.2,.8,.2,1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0E1612;
  --surface: #15211B;
  --surface-2: #1B2A22;
  --line: #24352C;
  --line-strong: #31463A;
  --text: #EEF2EF;
  --text-2: #B9C6BF;
  --text-3: #8C9C94;
  --accent: #F08A63;
  --accent-soft: #3A2219;
  --accent-ink: #FFB896;
  --ok: #6CC496;
  --ok-soft: #173326;
  --warn: #F2BE5C;
  --warn-soft: #33270F;
  --danger: #FF8A7A;
  --danger-soft: #3A1A16;
  --side: #0A110D;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; transition: background .3s var(--ease), color .3s var(--ease);
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -0.01em; }
.muted { color: var(--text-3); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--corail); outline-offset: 2px; border-radius: 6px; }

/* ---------- Splash & logo animé ---------- */
.splash { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--encre); transition: opacity .5s var(--ease), visibility .5s; }
.splash.hide { opacity: 0; visibility: hidden; }
.heart-trace { width: 96px; height: 96px; }
.heart-trace path, .logo-mark path {
  fill: none; stroke: var(--corail); stroke-width: 5.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 200; stroke-dashoffset: 200; animation: trace 1.4s var(--ease) forwards;
}
.splash .heart-trace path { animation: trace 1.1s var(--ease) forwards, beat 1.2s 1.1s ease-in-out infinite; transform-origin: 50% 55%; }
@keyframes trace { to { stroke-dashoffset: 0; } }
@keyframes beat { 0%,100% { transform: scale(1); } 15% { transform: scale(1.08); } 30% { transform: scale(1); } 45% { transform: scale(1.05); } }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand .logo-mark { width: 34px; height: 34px; flex: none; }
.brand-name { font-size: 22px; letter-spacing: -0.02em; }
.brand-name b { color: var(--corail); font-weight: 700; }
.brand-name span { font-weight: 500; }

/* ---------- Connexion ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-side {
  position: relative; overflow: hidden; background: var(--encre); color: #FBF7F2; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-side .brand-name span { color: #FBF7F2; }
.auth-side h1 { font-size: clamp(30px, 3.4vw, 46px); font-weight: 600; max-width: 14ch; letter-spacing: -0.02em; }
.auth-side h1 em { font-style: normal; color: #F08A63; }
.auth-side p { color: #A9B5AE; max-width: 42ch; }
.auth-side .big-heart { position: absolute; right: -60px; bottom: -40px; width: 420px; height: 420px; opacity: .14; }
.auth-side .big-heart path { stroke-width: 3; animation-duration: 3s; }
.auth-org { display: flex; align-items: center; gap: 12px; color: #A9B5AE; font-size: 14px; }
.auth-org img { width: 40px; height: 40px; border-radius: 10px; background: #fff; object-fit: contain; padding: 3px; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 18px; animation: rise .6s var(--ease) both; }
.auth-card h2 { font-size: 28px; }
.link-btn { align-self: center; display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 6px; color: var(--text-2); font: inherit; font-size: 14px; cursor: pointer; border-radius: 6px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: transparent; transition: color .15s, text-decoration-color .15s; }
.link-btn:hover, .link-btn:focus-visible { color: var(--accent); text-decoration-color: currentColor; outline: none; }
.link-btn svg { width: 16px; height: 16px; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 32px 24px; min-height: 240px; }
  .auth-side .big-heart { width: 260px; height: 260px; }
}

/* ---------- Coquille ---------- */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side {
  flex: 0 0 248px; background: var(--side); color: var(--side-text); padding: 22px 14px; display: flex; flex-direction: column; gap: 20px;
  position: sticky; top: 0; height: 100vh;
}
.side .brand { padding: 4px 10px 8px; }
.side .brand-name span { color: #FBF7F2; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--side-text); text-decoration: none; font-weight: 500;
  position: relative; transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.nav a svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.06); transform: translateX(2px); }
.nav a.active { background: rgba(224,96,58,.16); color: #FFD3C2; }
.nav a.active::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--corail); animation: grow .35s var(--ease); }
.nav .badge { margin-left: auto; background: var(--corail); color: #fff; font-size: 11px; font-weight: 600; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 6px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 6px; }
.side-org { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: rgba(255,255,255,.05); font-size: 13px; color: var(--side-mute); }
.side-org img { width: 34px; height: 34px; border-radius: 8px; background: #fff; object-fit: contain; padding: 2px; flex: none; }
.side-org b { display: block; color: var(--side-text); font-weight: 500; font-size: 13px; line-height: 1.3; }
.ver { font-size: 11px; color: var(--side-mute); padding-left: 10px; }

.main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 32px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 22px; font-weight: 600; }
.topbar .spacer { flex: 1; }
.btn.burger { display: none; }
.content { padding: 28px 32px 64px; max-width: 1360px; width: 100%; }
.view { animation: view-in .45s var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.stagger > * { animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }

@media (max-width: 900px) {
  .side { position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; transform: translateX(-105%); transition: transform .3s var(--ease); box-shadow: var(--shadow-lg); }
  .shell.nav-open .side { transform: none; }
  .btn.burger { display: inline-flex; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; }
}

/* ---------- Boutons, champs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 16px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-weight: 500; cursor: pointer; text-decoration: none;
  transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .2s; white-space: nowrap;
}
.btn:hover { border-color: var(--text-3); }
.btn:active { transform: scale(.97); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn.primary { background: var(--brique); border-color: var(--brique); color: #fff; box-shadow: 0 6px 16px -8px rgba(178,58,23,.7); }
.btn.primary:hover { background: var(--brique-h); }
:root[data-theme="dark"] .btn.primary { background: #C9502B; border-color: #C9502B; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.sm { min-height: 34px; padding: 5px 11px; font-size: 14px; border-radius: 10px; }
.btn.icon { padding: 0; width: 42px; }
.btn.sm.icon { width: 34px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-color: #fff #fff transparent transparent; animation: spin .7s linear infinite; }
.btn:not(.primary).loading::after { border-color: var(--text) var(--text) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 500; color: var(--text-2); }
.field small { color: var(--text-3); font-size: 12.5px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 42px; padding: 9px 12px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--surface);
  transition: border-color .2s, box-shadow .2s; outline: none;
}
textarea.input { min-height: 110px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--corail); box-shadow: 0 0 0 4px color-mix(in srgb, var(--corail) 18%, transparent); }
.input.search { padding-left: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236E7A74' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 12px center; background-size: 17px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } .span2 { grid-column: auto; } }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--brique); }
.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface-2); border-radius: 12px; border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; cursor: pointer; font-weight: 500; color: var(--text-2); transition: background .2s, color .2s, box-shadow .2s; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---------- Cartes, KPI ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-h h3 { font-size: 17px; font-weight: 600; }
.kpi { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px; transition: transform .25s var(--ease), box-shadow .25s; }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.kpi .label { font-size: 13.5px; color: var(--text-2); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.kpi .label i { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.kpi .label i svg { width: 16px; height: 16px; }
.kpi .value { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 13px; color: var(--text-3); }
.kpi.hero { background: var(--encre); color: #FBF7F2; border-color: transparent; }
.kpi.hero .label { color: #B9C6BF; }
.kpi.hero .label i { background: rgba(224,96,58,.2); color: #F08A63; }
.kpi.hero .sub { color: #93A39A; }
.kpi.hero::after { content: ''; position: absolute; right: -30px; top: -30px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, rgba(224,96,58,.35), transparent 70%); }
.trend { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.trend.up { background: var(--ok-soft); color: var(--ok); }
.trend.down { background: var(--danger-soft); color: var(--danger); }
.kpi.hero .trend.up { background: rgba(108,196,150,.16); color: #8FDBB2; }

/* Graphique mensuel */
.chart { display: flex; align-items: flex-end; gap: 10px; height: 220px; padding-top: 18px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; min-width: 0; }
.chart .bar-zone { position: relative; flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.chart .prev { position: absolute; left: 12%; right: 12%; bottom: var(--p); height: 0; border-top: 2px dashed var(--text-3); opacity: .55; z-index: 1; pointer-events: none; }
.legend-prev { display: inline-block; width: 18px; border-top: 2px dashed var(--text-3); vertical-align: middle; margin-right: 4px; opacity: .7; }
.forecast { display: flex; gap: 12px; align-items: center; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.forecast > svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.forecast span { display: block; font-size: 12.5px; color: var(--text-3); }
.forecast b { font-size: 20px; font-variant-numeric: tabular-nums; }
.forecast small { display: block; color: var(--text-3); font-size: 12px; }
.proj-ok, .proj-ko { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 500; }
.proj-ok { color: var(--ok); } .proj-ko { color: var(--warn); }
.proj-ok svg, .proj-ko svg { width: 14px; height: 14px; }
.chart .bar {
  width: 100%; max-width: 38px; border-radius: 8px 8px 3px 3px; background: var(--peche); position: relative; height: var(--h);
  transform-origin: bottom; animation: bar-up .8s var(--ease) both; animation-delay: calc(var(--i) * 50ms); transition: background .2s;
}
:root[data-theme="dark"] .chart .bar { background: #3A2219; }
.chart .bar.cur { background: var(--corail); }
.chart .col:hover .bar { background: var(--corail); }
.chart .bar .tip {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%) translateY(4px); opacity: 0; pointer-events: none;
  background: var(--encre); color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 7px; white-space: nowrap; transition: opacity .2s, transform .2s;
}
.chart .col:hover .tip { opacity: 1; transform: translateX(-50%); }
.chart .m { font-size: 12px; color: var(--text-3); }
@keyframes bar-up { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.hbar { display: flex; flex-direction: column; gap: 12px; }
.hbar .row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 14px; }
.hbar .track { height: 10px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 6px; background: var(--corail); width: var(--w); animation: fill-in 1s var(--ease) both; }
@keyframes fill-in { from { width: 0; } }

.alerts { display: flex; flex-direction: column; gap: 10px; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 14px; border: 1px solid transparent; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.alert.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.alert.info { background: var(--surface-2); color: var(--text-2); border-color: var(--line); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.danger { background: var(--danger-soft); color: var(--danger); }
.alert b { color: inherit; }
.alert a { color: inherit; font-weight: 600; }

.feed { display: flex; flex-direction: column; }
.feed .item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.feed .item:last-child { border-bottom: 0; }
.feed .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--corail); margin-top: 7px; flex: none; }

/* ---------- Tableaux ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar .grow { flex: 1 1 220px; min-width: 0; }
.pop-wrap { position: relative; }
.pop { position: absolute; top: calc(100% + 8px); left: 0; z-index: 40; width: 320px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 16px; transform-origin: top left; animation: pop-down .18s var(--ease); }
.pop .section-t { margin-top: 0; }
.pop .seg { display: flex; }
.pop .seg button { flex: 1; padding: 7px 8px; }
.pop-list { display: grid; gap: 8px; }
.pop.menu { width: 270px; padding: 6px; left: auto; right: 0; transform-origin: top right; }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; transition: background .15s; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); outline: none; }
.menu-item svg { width: 18px; height: 18px; flex: none; color: var(--accent); }
.menu-item span { display: flex; flex-direction: column; line-height: 1.25; }
.menu-item b { font-weight: 600; font-size: 14px; }
.menu-item small { color: var(--text-3); font-size: 12.5px; }
.pop-foot { display: flex; justify-content: flex-end; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
@keyframes pop-down { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.btn .badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 2px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; line-height: 1; }
.btn.active { border-color: var(--accent); color: var(--accent-ink); }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
.t td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tbody tr { transition: background .15s; animation: rise .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 18ms); }
.t tbody tr:hover { background: color-mix(in srgb, var(--peche) 35%, transparent); }
:root[data-theme="dark"] .t tbody tr:hover { background: var(--surface-2); }
.t tbody tr.clickable { cursor: pointer; }
.t tbody tr:last-child td { border-bottom: 0; }
.t .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t .actions { text-align: right; white-space: nowrap; }
.t .w-check { width: 40px; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; background: var(--accent-soft); color: var(--accent-ink); }
.avatar.ent { border-radius: 10px; background: #E3ECF7; color: #1F4E8C; }
:root[data-theme="dark"] .avatar.ent { background: #17283D; color: #9CC3F5; }
.who b { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { color: var(--text-3); }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.accent { background: var(--accent-soft); color: var(--accent-ink); }
.pill.mono { font-family: var(--mono); font-weight: 500; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; font-size: 14px; color: var(--text-3); flex-wrap: wrap; }
.empty { text-align: center; padding: 56px 20px; color: var(--text-3); }
.empty > svg { width: 72px; height: 72px; margin-bottom: 10px; }
.empty > svg path { stroke: var(--line-strong); stroke-width: 4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.empty h4 { color: var(--text); font-size: 17px; margin-bottom: 4px; }

.skeleton { border-radius: 10px; background: linear-gradient(90deg, var(--surface-2) 0%, var(--line) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Tiroir et fenêtres ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(14,22,18,.45); backdrop-filter: blur(2px); animation: fade .25s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed; z-index: 61; top: 0; right: 0; bottom: 0; width: min(620px, 100%); background: var(--bg); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; animation: slide-in .35s var(--ease);
}
@keyframes slide-in { from { transform: translateX(100%); } }
.drawer.out { animation: slide-out .25s var(--ease) forwards; }
@keyframes slide-out { to { transform: translateX(100%); } }
.drawer-h { display: flex; align-items: center; gap: 14px; padding: 20px 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.drawer-h h2 { font-size: 20px; flex: 1; min-width: 0; }
.drawer-b { flex: 1; overflow-y: auto; padding: 22px 24px; display: flex; flex-direction: column; gap: 20px; }
.drawer-f { padding: 14px 24px; border-top: 1px solid var(--line); background: var(--surface); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.modal {
  position: fixed; z-index: 62; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100% - 24px)); max-height: calc(100vh - 32px);
  background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: pop .3s var(--ease);
}
.modal.wide { width: min(860px, calc(100% - 24px)); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -46%) scale(.97); } }
.modal-h { padding: 20px 24px 6px; display: flex; align-items: center; gap: 10px; }
.modal-h h3 { font-size: 19px; flex: 1; }
.modal-b { padding: 14px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-f { padding: 14px 24px 20px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.section-t { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; }
.stats-row { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { flex: 1 1 120px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.stat b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--text-3); }

.progress { height: 10px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--corail), var(--brique)); border-radius: 6px; transition: width .4s var(--ease); }
.progress-label { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--text-2); margin-top: 8px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 90; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast {
  display: flex; align-items: center; gap: 10px; background: var(--encre); color: #FBF7F2; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg);
  font-size: 14px; max-width: min(420px, calc(100vw - 40px)); animation: toast-in .35s var(--ease);
}
.toast svg { width: 18px; height: 18px; flex: none; }
.toast.ok svg { color: #8FDBB2; }
.toast.err { background: #7A1D12; }
.toast.out { animation: toast-out .3s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }

/* ---------- Import ---------- */
.steps { display: flex; gap: 8px; margin-bottom: 22px; flex-wrap: wrap; }
.steps .s { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 500; color: var(--text-3); font-size: 14px; transition: all .3s var(--ease); }
.steps .s i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-style: normal; font-size: 13px; font-weight: 600; }
.steps .s.on { color: var(--text); border-color: var(--corail); }
.steps .s.on i { background: var(--corail); color: #fff; }
.steps .s.done i { background: var(--sauge); color: #fff; }
.drop {
  display: block;
  border: 2px dashed var(--line-strong); border-radius: 20px; padding: 56px 24px; text-align: center; background: var(--surface); cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s var(--ease);
}
.drop:hover, .drop.over { border-color: var(--corail); background: color-mix(in srgb, var(--peche) 40%, var(--surface)); }
.drop.over { transform: scale(1.01); }
.drop .ico { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.drop .ico svg { width: 30px; height: 30px; }
.drop h3 { font-size: 19px; margin-bottom: 6px; }
.map-row { display: grid; grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.map-row:last-child { border-bottom: 0; }
.map-row .src b { display: block; }
.map-row .src small { color: var(--text-3); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-row .arrow { color: var(--text-3); }
.map-row.mapped .arrow { color: var(--corail); }
@media (max-width: 640px) { .map-row { grid-template-columns: 1fr; } .map-row .arrow { display: none; } }

/* ---------- Divers ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 12px 14px; cursor: pointer; font-weight: 500; color: var(--text-3); position: relative; white-space: nowrap; }
.tabs button.on { color: var(--text); }
.tabs button.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--corail); animation: grow-x .3s var(--ease); }
@keyframes grow-x { from { transform: scaleX(0); } }
.asset { display: flex; gap: 16px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.asset .thumb { width: 96px; height: 72px; border-radius: 10px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; flex: none; }
.asset .thumb img { max-width: 90%; max-height: 90%; }
.dot-sep { color: var(--text-3); margin: 0 6px; }
.kbd { font-family: var(--mono); font-size: 12px; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); }
.list-plain { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 14px; }
.success-burst { display: grid; place-items: center; padding: 20px 0 6px; }
.success-burst svg { width: 84px; height: 84px; }
.success-burst svg path { stroke: var(--sauge); }
.ac { position: relative; }
.ac-list { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 260px; overflow-y: auto; animation: rise .2s var(--ease); }
.ac-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 14px; cursor: pointer; }
.ac-list button:hover, .ac-list button.on { background: var(--surface-2); }
.ac-list small { color: var(--text-3); display: block; }
iframe.pdf { width: 100%; height: 70vh; border: 0; border-radius: 12px; background: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .heart-trace path, .logo-mark path { stroke-dashoffset: 0; }
}

/* ---------- Rôles ---------- */
.role-lecture [data-w] { display: none !important; }

/* ---------- Recherche Ctrl+K ---------- */
.search-trigger { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.05); color: var(--side-mute); cursor: pointer; font-size: 14px; transition: background .2s, border-color .2s; }
.search-trigger:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.2); }
.search-trigger svg { width: 17px; height: 17px; }
.search-trigger span:nth-child(2) { flex: 1; text-align: left; }
.search-trigger .kbd { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); color: var(--side-mute); }
.palette { position: fixed; z-index: 70; left: 50%; top: 12vh; transform: translateX(-50%); width: min(640px, calc(100% - 24px)); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pal-in .25s var(--ease); }
@keyframes pal-in { from { opacity: 0; transform: translate(-50%, -10px) scale(.98); } }
.palette-in { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.palette-in svg { width: 20px; height: 20px; color: var(--text-3); flex: none; }
.palette-in input { flex: 1; border: 0; outline: none; background: transparent; font-size: 17px; }
.palette-list { max-height: 52vh; overflow-y: auto; padding: 6px; }
.palette-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: none; cursor: pointer; text-align: left; }
.palette-item.on, .palette-item:hover { background: var(--surface-2); }
.palette-item.on .pi-ico { background: var(--corail); color: #fff; }
.pi-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; transition: background .2s, color .2s; }
.pi-ico svg { width: 17px; height: 17px; }
.pi-txt { flex: 1; min-width: 0; }
.pi-txt b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-txt small { color: var(--text-3); }
.palette-empty { padding: 26px; text-align: center; color: var(--text-3); }

/* ---------- Jauges de campagne ---------- */
.gauge { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; transition: transform .25s var(--ease), box-shadow .25s; }
.gauge:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.gauge-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.gauge-v { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.gauge-v small { font-size: 14px; font-weight: 500; color: var(--text-3); }
.gauge .progress > div { animation: fill-in 1.1s var(--ease) both; }
.trend svg { width: 12px; height: 12px; }
.code { font-family: var(--mono); font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; white-space: pre-wrap; word-break: break-all; user-select: all; }
.bank-cands { display: flex; flex-direction: column; gap: 6px; }
.bank-cand { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 6px 10px; border-radius: 10px; background: var(--ok-soft); font-size: 13.5px; }

/* ---------- Mode événement ---------- */
.collecte { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.col-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.col-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.col-stats > div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; min-width: 110px; }
.col-stats span { display: block; font-size: 12px; color: var(--text-3); }
.col-stats b { font-size: 22px; font-variant-numeric: tabular-nums; }
.col-stats > div:first-child { background: var(--encre); color: #FBF7F2; border-color: transparent; }
.col-stats > div:first-child span { color: #A9B5AE; }
.net { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 999px; }
.net svg { width: 16px; height: 16px; }
.net.on { background: var(--ok-soft); color: var(--ok); } .net.off { background: var(--warn-soft); color: var(--warn); }
.col-form { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.col-amounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.col-amounts button { min-height: 58px; border-radius: 14px; border: 2px solid var(--line-strong); background: var(--surface); font-size: 20px; font-weight: 700; cursor: pointer; transition: all .15s var(--ease); }
.col-amounts button.on { background: var(--corail); border-color: var(--corail); color: #fff; transform: translateY(-2px); box-shadow: 0 10px 22px -12px var(--corail); }
.col-amounts .input { min-height: 58px; font-size: 20px; font-weight: 600; text-align: center; }
.col-modes { width: 100%; } .col-modes button { flex: 1; min-height: 46px; font-size: 16px; }
.col-save { min-height: 58px; font-size: 18px; margin-top: 4px; }
.col-last { display: grid; gap: 8px; }
.col-item { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); animation: rise .35s var(--ease); }
.col-item b { grid-row: span 2; font-size: 18px; align-self: center; }
.col-item small { color: var(--warn); } .col-item.ok small { color: var(--ok); } .col-item.ko small { color: var(--danger); }
.qr-full { position: fixed; inset: 0; z-index: 80; background: rgba(14,22,18,.85); display: grid; place-items: center; animation: fade .25s; padding: 16px; }
.qr-box { background: #fff; color: #16241D; border-radius: 24px; padding: 28px; display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(460px, 100%); animation: pop-c .3s var(--ease); }
@keyframes pop-c { from { transform: scale(.94); opacity: 0; } }
.qr-box svg { width: 100%; height: auto; }
.qr-box b { font-size: 22px; } .qr-box small { color: #4A5751; }
.offline-shell .topbar { position: static; }
