:root {
  --bg: #05080f;
  --bg-2: #0a1020;
  --panel: #0d1528;
  --panel-2: #111b33;
  --line: #1c2a47;
  --line-2: #273a60;
  --text: #e6ecf7;
  --text-2: #a9b6cf;
  --text-3: #6f7e9c;
  --accent: #2f6bff;
  --accent-2: #1b46c4;
  --accent-soft: rgba(47, 107, 255, .14);
  --metal-1: #e9eef7;
  --metal-2: #9aa8c0;
  --metal-3: #5c6a85;
  --pos: #3fcf8e;
  --neg: #ff6b6b;
  --warn: #f2b84b;
  --info: #6aa8ff;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 12px 30px -18px rgba(0,0,0,.8);
  --font: "SF Pro Display", "Segoe UI Variable Display", "Inter", system-ui, -apple-system, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Cascadia Mono", ui-monospace, Menlo, monospace;
  --nav-w: 232px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(47,107,255,.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(120,140,180,.06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--info); }
.num, .money { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }
.pos { color: var(--pos); } .neg { color: var(--neg); } .muted { color: var(--text-3); } .dim { color: var(--text-2); }
.warn-text { color: var(--warn); }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.015em; }
h2 { font-size: 1.05rem; }
h3 { font-size: .95rem; }
.eyebrow { font-size: .7rem; text-transform: uppercase; letter-spacing: .14em; color: var(--text-3); font-weight: 600; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 22px 14px;
  border-right: 1px solid var(--line); background: linear-gradient(180deg, rgba(13,21,40,.85), rgba(5,8,15,.6));
  display: flex; flex-direction: column; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand img { width: 34px; height: 34px; }
.brand-name {
  font-weight: 800; letter-spacing: .16em; font-size: .95rem;
  background: linear-gradient(180deg, var(--metal-1), var(--metal-2) 60%, var(--metal-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px;
  color: var(--text-2); text-decoration: none; font-weight: 520; font-size: .93rem;
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.nav a:hover { background: rgba(255,255,255,.03); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: #fff; box-shadow: inset 2px 0 0 var(--accent); }
.nav a.active svg { opacity: 1; color: var(--info); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; font-size: .78rem; color: var(--text-3); padding: 0 8px; }

.main { min-width: 0; padding: 22px 28px 60px; max-width: 1280px; width: 100%; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.topbar h1 { font-size: 1.45rem; }
.topbar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mobile-brand { display: none; }

.status-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); font-size: .78rem; color: var(--text-2);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot.ok { background: var(--pos); } .dot.err { background: var(--neg); } .dot.warn { background: var(--warn); } .dot.info { background: var(--info); }

.banner {
  display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap;
  padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: .88rem;
  border: 1px solid var(--line-2); background: var(--panel);
}
.banner.demo { border-color: rgba(242,184,75,.45); background: linear-gradient(90deg, rgba(242,184,75,.10), rgba(242,184,75,.03)); }
.banner.error { border-color: rgba(255,107,107,.5); background: rgba(255,107,107,.08); }
.banner.info { border-color: rgba(106,168,255,.4); background: rgba(106,168,255,.07); }
.banner .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 14px; }
.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)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.section { margin-top: 22px; }
.section > .card-head { margin-bottom: 10px; }

.hero {
  position: relative; overflow: hidden; padding: 22px;
  background:
    radial-gradient(500px 220px at 100% 0%, rgba(47,107,255,.22), transparent 70%),
    linear-gradient(180deg, #101c38, #0b1326);
  border-color: var(--line-2);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.035) 50%, transparent 60%);
}
.hero-value { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 650; margin: 6px 0 4px; letter-spacing: -.03em; }
.hero-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.kpi .label { font-size: .78rem; color: var(--text-3); font-weight: 560; text-transform: uppercase; letter-spacing: .08em; }
.kpi .value { font-size: 1.45rem; font-weight: 620; margin: 4px 0 6px; }
.kpi .value.lg { font-size: 2rem; }
.kpi .sub { font-size: .8rem; color: var(--text-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kpi.primary { border-color: rgba(47,107,255,.5); background: linear-gradient(180deg, rgba(47,107,255,.16), var(--panel)); }
.unavail { color: var(--text-3); font-style: italic; font-family: var(--font); font-size: .95em; font-weight: 500; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 6px;
  font-size: .7rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; border: 1px solid transparent; white-space: nowrap;
}
.src-reel { color: #8fe0b5; border-color: rgba(63,207,142,.35); background: rgba(63,207,142,.08); }
.src-manuel { color: #b9c6dd; border-color: var(--line-2); background: rgba(255,255,255,.03); }
.src-importe { color: #9cc3ff; border-color: rgba(106,168,255,.35); background: rgba(106,168,255,.08); }
.src-reconstruit { color: #c9b4ff; border-color: rgba(170,140,255,.35); background: rgba(170,140,255,.08); }
.src-estime { color: #ffd38a; border-color: rgba(242,184,75,.35); background: rgba(242,184,75,.07); }
.src-indisponible { color: #9aa3b5; border-color: var(--line); background: transparent; }
.src-demo { color: #ffce73; border-color: rgba(242,184,75,.55); background: rgba(242,184,75,.12); }
.b-ok { color: #8fe0b5; border-color: rgba(63,207,142,.35); }
.b-warn { color: #ffd38a; border-color: rgba(242,184,75,.4); }
.b-err { color: #ff9b9b; border-color: rgba(255,107,107,.4); }
.b-info { color: #9cc3ff; border-color: rgba(106,168,255,.35); }
.b-neutral { color: var(--text-2); border-color: var(--line-2); }

.warnings { margin: 8px 0 0; padding: 0; list-style: none; font-size: .8rem; color: var(--warn); display: grid; gap: 3px; }
.warnings li::before { content: "⚠ "; }

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  padding: 7px 13px; border-radius: 9px; border: 1px solid var(--line-2); background: rgba(255,255,255,.03);
  font-size: .86rem; font-weight: 560; color: var(--text); min-height: 36px; white-space: nowrap;
}
.btn:hover { border-color: #3a5288; background: rgba(255,255,255,.06); }
.btn.primary { background: linear-gradient(180deg, #3a77ff, var(--accent-2)); border-color: #3a77ff; color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: #ffb0b0; border-color: rgba(255,107,107,.4); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.sm { padding: 4px 9px; min-height: 30px; font-size: .8rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { padding: 4px 7px; min-height: 30px; }

.field { display: grid; gap: 5px; }
.field label { font-size: .8rem; color: var(--text-2); font-weight: 560; }
.field .hint { font-size: .75rem; color: var(--text-3); }
.field .hint.warn { color: var(--warn); }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=time], select, textarea {
  width: 100%; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line-2); background: #070c18;
  min-height: 40px; outline: none;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,107,255,.2); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; gap: 8px; align-items: center; font-size: .88rem; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; gap: 2px; background: #070c18; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; cursor: pointer; color: var(--text-2); font-size: .85rem; font-weight: 560; min-height: 32px; }
.seg button.on { background: var(--accent-soft); color: #fff; box-shadow: inset 0 0 0 1px rgba(47,107,255,.5); }

.tri { display: inline-flex; gap: 3px; }
.tri button { border: 1px solid var(--line-2); background: transparent; border-radius: 6px; padding: 2px 8px; font-size: .75rem; cursor: pointer; color: var(--text-3); min-height: 28px; }
.tri button.on-oui { background: rgba(63,207,142,.15); color: #8fe0b5; border-color: rgba(63,207,142,.5); }
.tri button.on-non { background: rgba(255,107,107,.13); color: #ff9b9b; border-color: rgba(255,107,107,.45); }
.tri button.on-unk { background: rgba(255,255,255,.06); color: var(--text-2); }
.checklist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.checklist .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .84rem; padding: 4px 0; border-bottom: 1px dashed var(--line); }

/* ---------- Calendrier du mois ---------- */
.month-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(0, .9fr); gap: 6px; }
.mhead { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 600; padding: 0 4px 2px; }
.mcell {
  display: grid; align-content: space-between; gap: 2px; min-height: 76px; padding: 7px 8px; border-radius: 10px; text-align: left;
  border: 1px solid var(--line); background: #0a1224; color: var(--text); cursor: pointer; font: inherit; min-width: 0;
}
.mcell:hover { border-color: #3a5288; }
.mcell.today { box-shadow: inset 0 0 0 2px var(--accent); }
.mcell.out { background: transparent; border-style: dashed; opacity: .35; cursor: default; }
.mcell.empty-day .mday { color: var(--text-3); }
.mday { display: flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 600; color: var(--text-2); }
.mday .dot { width: 6px; height: 6px; }
.mpnl { font-size: .95rem; font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.mtr { font-size: .7rem; color: var(--text-3); }
.mweek { display: grid; align-content: center; justify-items: end; gap: 2px; padding: 7px 8px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(255,255,255,.02); font-weight: 650; font-size: .9rem; min-width: 0; }

/* ---------- Recherche de crypto ---------- */
.coin-results { display: grid; gap: 4px; margin-top: 6px; max-height: 260px; overflow-y: auto; }
.coin-opt { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; text-align: left; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: #0a1224; color: var(--text); cursor: pointer; font: inherit; min-height: 40px; }
.coin-opt:hover { border-color: var(--accent); }
.coin-opt img { border-radius: 50%; }

/* ---------- Dépôt de fichiers ---------- */
.dropzone {
  display: grid; justify-items: center; gap: 4px; padding: 30px 16px; border-radius: var(--radius); cursor: pointer; text-align: center;
  border: 1.5px dashed var(--line-2); background: rgba(47,107,255,.04); transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: rgba(47,107,255,.10); }
.dropzone strong { font-size: 1rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 600; padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 8px; border-bottom: 1px solid rgba(28,42,71,.6); vertical-align: middle; }
td.r, th.r { text-align: right; }
tr:hover td { background: rgba(255,255,255,.015); }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.empty { padding: 22px; text-align: center; color: var(--text-3); border: 1px dashed var(--line-2); border-radius: var(--radius-sm); font-size: .9rem; }

/* ---------- Gauges ---------- */
.meter { height: 8px; border-radius: 99px; background: #0a1224; border: 1px solid var(--line); overflow: hidden; position: relative; }
.meter > span { position: absolute; top: 0; bottom: 0; border-radius: 99px; }
.limits { display: grid; gap: 10px; }
.limit-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; font-size: .85rem; }
.limit-row .meter { grid-column: 1 / -1; }
.state-box { padding: 12px 14px; border-radius: 10px; font-weight: 560; font-size: .9rem; display: flex; gap: 10px; align-items: center; }
.state-ok { background: rgba(63,207,142,.08); border: 1px solid rgba(63,207,142,.3); color: #b7f0d2; }
.state-attention { background: rgba(242,184,75,.08); border: 1px solid rgba(242,184,75,.4); color: #ffe0a6; }
.state-stop_perte, .state-stop_gain { background: rgba(255,107,107,.09); border: 1px solid rgba(255,107,107,.45); color: #ffc4c4; }
.state-inconnu { background: rgba(255,255,255,.03); border: 1px solid var(--line-2); color: var(--text-2); }

.comp-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; gap: 2px; margin: 14px 0 8px; }
.comp-bar span { display: block; min-width: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .78rem; color: var(--text-2); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 9px 13px; color: var(--text-2); text-decoration: none; font-weight: 560; font-size: .9rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: #fff; border-bottom-color: var(--accent); }


.thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.thumb { width: 160px; display: grid; gap: 6px; font-size: .75rem; color: var(--text-3); }
.thumb img { width: 160px; height: 100px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line-2); background: #070c18; }
.thumb .ph { width: 160px; height: 100px; border-radius: 8px; border: 1px dashed var(--line-2); display: grid; place-items: center; }

dialog {
  border: 1px solid var(--line-2); border-radius: 16px; background: linear-gradient(180deg, #111b33, #0b1326); color: var(--text);
  padding: 0; width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 30px 80px -20px rgba(0,0,0,.9);
}
dialog::backdrop { background: rgba(2,4,10,.7); backdrop-filter: blur(3px); }
dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 34px); }
.dlg-head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dlg-body { padding: 16px 18px; overflow-y: auto; }
.dlg-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 50; padding: 10px 16px; border-radius: 10px;
  background: #13203d; border: 1px solid var(--line-2); font-size: .88rem; box-shadow: 0 12px 30px rgba(0,0,0,.6); max-width: calc(100vw - 32px);
}
.toast.err { border-color: rgba(255,107,107,.6); }

.spark { width: 100%; height: 70px; display: block; }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; font-size: .86rem; }
.kv dt { color: var(--text-3); } .kv dd { margin: 0; text-align: right; }
.list-plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.stack { display: grid; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.small { font-size: .8rem; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.mobile-nav { display: none; }

/* =====================================================================
   Thème « Aurora » — premium, coloré mais sobre, animé
   ===================================================================== */
:root {
  --bg: #06070c;
  --panel: rgba(255, 255, 255, .035);
  --panel-2: rgba(255, 255, 255, .055);
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --text: #eef0f7;
  --text-2: #a6abc0;
  --text-3: #6c7189;
  --accent: #7c6cff;
  --accent-2: #5b8cff;
  --accent-soft: rgba(124, 108, 255, .14);
  --grad: linear-gradient(135deg, #5b8cff 0%, #8b6cff 55%, #c56cf0 100%);
  --pos: #34d399;
  --neg: #fb7185;
  --warn: #fbbf24;
  --info: #8ab4ff;
  --c-livret: #2dd4bf;
  --c-tr: #60a5fa;
  --c-crypto: #a78bfa;
  --c-prop: #fbbf24;
  --c-journal: #fb7185;
  --c-settings: #94a3b8;
  --mod: #8b6cff;
  --radius: 18px;
  --radius-sm: 11px;
  --shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 20px 40px -24px rgba(0,0,0,.9);
  --ease: cubic-bezier(.2, .75, .2, 1);
}
.app[data-route="synthese"] { --mod: #8b6cff; }
.app[data-route="prop"] { --mod: var(--c-prop); }
.app[data-route="journal"] { --mod: var(--c-journal); }
.app[data-route="tr"] { --mod: var(--c-tr); }
.app[data-route="crypto"] { --mod: var(--c-crypto); }
.app[data-route="settings"] { --mod: var(--c-settings); }

body { background: var(--bg); }
/* Lueurs d'aurore en arrière-plan, très lentes */
body::before, body::after {
  content: ""; position: fixed; inset: -20vmax; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38vmax 30vmax at 18% 22%, rgba(91,140,255,.22), transparent 62%),
    radial-gradient(34vmax 28vmax at 82% 12%, rgba(197,108,240,.17), transparent 60%),
    radial-gradient(36vmax 30vmax at 70% 88%, rgba(45,212,191,.12), transparent 62%);
  animation: aurora 38s ease-in-out infinite alternate;
}
body::after {
  background: radial-gradient(30vmax 24vmax at 35% 80%, rgba(251,113,133,.07), transparent 60%);
  animation-duration: 52s; animation-direction: alternate-reverse;
}
@keyframes aurora {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(3vmax, -2vmax, 0) scale(1.06); }
  100% { transform: translate3d(-3vmax, 2vmax, 0) scale(1.02); }
}

/* Barre latérale en verre */
.sidebar { background: rgba(8, 9, 16, .55); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); border-right-color: var(--line); }
.brand-name { background: linear-gradient(180deg, #fff, #b9b4ff 70%, #8e86e6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav a { position: relative; transition: background .25s var(--ease), color .25s var(--ease); }
.nav a[href="#/synthese"] { --nc: #8b6cff; } .nav a[href="#/prop"] { --nc: var(--c-prop); } .nav a[href="#/journal"] { --nc: var(--c-journal); }
.nav a[href="#/tr"] { --nc: var(--c-tr); } .nav a[href="#/crypto"] { --nc: var(--c-crypto); } .nav a[href="#/settings"] { --nc: var(--c-settings); }
.nav a svg { color: var(--nc); opacity: .75; transition: transform .3s var(--ease), opacity .3s; }
.nav a:hover svg { transform: scale(1.08); opacity: 1; }
.nav a.active { background: linear-gradient(90deg, color-mix(in srgb, var(--nc) 22%, transparent), transparent 90%); box-shadow: none; color: #fff; }
.nav a.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--nc); box-shadow: 0 0 12px var(--nc); }
.nav a.active svg { color: var(--nc); opacity: 1; }

/* Cartes en verre */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.018));
  border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(16px) saturate(130%); -webkit-backdrop-filter: blur(16px) saturate(130%);
  transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.card:hover { border-color: var(--line-2); }
.kpi.card:hover, .grid > .card.kpi:hover { transform: translateY(-2px); box-shadow: 0 24px 40px -28px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.04); }
.kpi .label { letter-spacing: .1em; font-size: .72rem; color: var(--text-3); }
.kpi .value, .kpi .value .money { font-family: var(--font); font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: -.025em; }
.hero-value .money { font-family: inherit; }
.kpi.primary { border-color: color-mix(in srgb, var(--mod) 45%, transparent); background: linear-gradient(160deg, color-mix(in srgb, var(--mod) 20%, transparent), rgba(255,255,255,.02) 70%); }

/* Carte d'univers : liseré de couleur + halo discret */
.mod-card { position: relative; overflow: hidden; }
.mod-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, var(--mc), transparent 85%); opacity: .9; }
.mod-card::after { content: ""; position: absolute; width: 160px; height: 160px; right: -60px; top: -80px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--mc) 28%, transparent), transparent 70%); pointer-events: none; transition: transform .6s var(--ease); }
.mod-card:hover::after { transform: scale(1.25); }
.mod-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--mc); box-shadow: 0 0 10px var(--mc); margin-right: 8px; }

/* Héros : contour lumineux qui tourne lentement */
@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.hero {
  border: 1px solid transparent;
  background:
    linear-gradient(160deg, rgba(20,22,38,.92), rgba(10,11,20,.92)) padding-box,
    conic-gradient(from var(--angle), rgba(91,140,255,.0), rgba(91,140,255,.55), rgba(197,108,240,.55), rgba(45,212,191,.35), rgba(91,140,255,.0) 70%) border-box;
  animation: spin-border 14s linear infinite;
}
@keyframes spin-border { to { --angle: 360deg; } }
.hero::after { background: radial-gradient(60% 80% at 100% 0%, rgba(139,108,255,.18), transparent 70%); }
.hero-value { font-family: var(--font); font-variant-numeric: tabular-nums; letter-spacing: -.035em; background: linear-gradient(180deg, #ffffff 30%, #c9c3ff); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 600; }
.hero-value .unavail { -webkit-text-fill-color: var(--text-3); }

/* Barre de répartition */
.comp-bar { height: 8px; gap: 3px; background: rgba(255,255,255,.04); }
.comp-bar span { border-radius: 99px; transform-origin: left center; }

/* Boutons */
.btn { border-color: var(--line-2); background: rgba(255,255,255,.04); transition: transform .2s var(--ease), background .2s, border-color .2s; }
.btn:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 24px -12px rgba(139,108,255,.8); position: relative; overflow: hidden; }
.btn.primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%); transform: translateX(-120%); transition: transform .7s var(--ease); }
.btn.primary:hover::after { transform: translateX(120%); }
.btn.primary:hover { filter: brightness(1.06); }

/* Onglets, badges, champs */
.tabs { border-bottom-color: var(--line); }
.tabs a { transition: color .2s; }
.tabs a.on { border-bottom-color: var(--mod); color: #fff; }
.seg button.on { background: color-mix(in srgb, var(--mod) 22%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mod) 55%, transparent); }
.badge { border-radius: 7px; }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=time], select, textarea { background: rgba(0,0,0,.28); border-color: var(--line-2); transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { border-color: var(--mod); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mod) 25%, transparent); }
.status-pill { background: rgba(255,255,255,.04); border-color: var(--line); backdrop-filter: blur(10px); }
.banner { background: rgba(255,255,255,.04); border-color: var(--line-2); backdrop-filter: blur(12px); }
dialog { background: linear-gradient(180deg, rgba(24,26,42,.96), rgba(12,13,22,.97)); border-color: var(--line-2); animation: pop .35s var(--ease); }
dialog::backdrop { background: rgba(3,4,8,.6); backdrop-filter: blur(6px); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.toast { background: rgba(22,24,40,.92); backdrop-filter: blur(14px); border-color: var(--line-2); animation: pop .3s var(--ease); }
tr { transition: background .2s; }
.mcell { transition: transform .25s var(--ease), border-color .25s; }
.mcell:not(.out):hover { transform: translateY(-2px); border-color: var(--line-2); }
.dropzone { border-color: color-mix(in srgb, var(--mod) 45%, transparent); background: color-mix(in srgb, var(--mod) 6%, transparent); }
.dropzone:hover, .dropzone.over { border-color: var(--mod); background: color-mix(in srgb, var(--mod) 12%, transparent); }

/* Entrée d'écran : cascade des cartes, barre qui se remplit */
#view.enter .card, #view.enter .tabs { animation: rise .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms); }
#view.enter .comp-bar span { animation: grow 1.1s var(--ease) both; animation-delay: .25s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Barre de navigation mobile en verre */
@media (max-width: 860px) {
  .mobile-nav { background: rgba(8, 9, 16, .72); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); border-top-color: var(--line); }
  .mobile-nav a[href="#/synthese"] { --nc: #8b6cff; } .mobile-nav a[href="#/prop"] { --nc: var(--c-prop); } .mobile-nav a[href="#/journal"] { --nc: var(--c-journal); }
  .mobile-nav a[href="#/tr"] { --nc: var(--c-tr); } .mobile-nav a[href="#/crypto"] { --nc: var(--c-crypto); } .mobile-nav a[href="#/settings"] { --nc: var(--c-settings); }
  .mobile-nav a.active svg { color: var(--nc); filter: drop-shadow(0 0 6px var(--nc)); }
  .mobile-nav a.active { color: #fff; }
}

/* Accessibilité : pas d'animation si l'appareil le demande */
@media (prefers-reduced-motion: reduce) {
  body::before, body::after, .hero { animation: none !important; }
  #view.enter .card, #view.enter .tabs, #view.enter .comp-bar span, dialog, .toast { animation: none !important; }
  .card, .btn, .mcell { transition: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 14px 16px calc(84px + env(safe-area-inset-bottom)); }
  .mobile-brand { display: flex; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span2 { grid-column: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .checklist { grid-template-columns: 1fr; }
  .month-grid { gap: 3px; }
  .mcell, .mweek { min-height: 58px; padding: 5px 4px; border-radius: 7px; }
  .mpnl { font-size: .72rem; }
  .mweek { font-size: .7rem; }
  .mtr { font-size: .6rem; }
  .topbar h1 { font-size: 1.2rem; }
  .mobile-nav {
    display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: rgba(8,9,16,.72); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .mobile-nav a { display: grid; justify-items: center; gap: 2px; text-decoration: none; color: var(--text-3); font-size: .62rem; font-weight: 600; padding: 4px 0; min-height: 44px; }
  .mobile-nav a svg { width: 20px; height: 20px; }
  .mobile-nav a.active { color: #fff; }
  .mobile-nav a.active svg { color: var(--info); }
  .hide-mobile { display: none !important; }
  dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  dialog form { max-height: 100dvh; height: 100%; }
}
@media (max-width: 420px) {
  .g4, .g5 { grid-template-columns: 1fr; }
  .kpi .value { font-size: 1.3rem; }
}

/* ---------- Jour « compte liquidé » (marquage visuel, ambre) ---------- */
:root { --liq: #f59e0b; --liq-soft: rgba(245, 158, 11, .16); --liq-ink: #3b2504; }
.liq-badge { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border-radius: 6px; background: #fbbf24; color: var(--liq-ink); font-size: .64rem; font-weight: 800; letter-spacing: .03em; line-height: 1.5; white-space: nowrap; }
.liq-badge .liq-short { display: none; }
.liq-note { font-size: .74rem; color: #fcd34d; margin-top: 3px; line-height: 1.35; white-space: normal; }
.mcell.liquidated { background: var(--liq-soft) !important; border: 2px solid var(--liq) !important; box-shadow: 0 0 0 1px rgba(245,158,11,.35), 0 0 18px -6px rgba(245,158,11,.7); }
.mcell.liquidated .liq-badge { justify-self: start; max-width: 100%; white-space: normal; line-height: 1.2; padding: 2px 5px; }
.liq-row { background: var(--liq-soft); box-shadow: inset 3px 0 0 var(--liq); }
li.liq-row { padding: 6px 8px; border-radius: 8px; border: 1px solid rgba(245,158,11,.45); }
tr.liq-row td { background: var(--liq-soft); }
@media (max-width: 860px) {
  .mcell.liquidated .liq-badge { font-size: .55rem; padding: 0 3px; }
  .mcell.liquidated .liq-full { display: none; }
  .mcell.liquidated .liq-badge .liq-short { display: inline; }
}

/* ---------- Tableaux compacts ---------- */
.nowrap { white-space: nowrap; }
.row-actions { flex-wrap: nowrap; }
@media (max-width: 1200px) { .hide-md { display: none; } }
