/* Runway — feuille de style unique. Fond gris-bleu, encre nuit, bleu électrique pour l'action ; une couleur par domaine. */
:root {
  --bg: #F3F5F9;
  --surface: #FFFFFF;
  --surface-2: #EEF1F7;
  --fill: #E6EAF3;
  --seg-on: #FFFFFF;
  --line: #E4E8F0;
  --line-strong: #D3D9E6;
  --fg: #0F1222;
  --fg-2: #5B6178;
  --fg-3: #6F7590;
  --ink: #0F1222;
  --on-ink: #FFFFFF;
  --accent: #2F5BFF;
  --accent-soft: #E6EDFF;
  --on-accent: #FFFFFF;
  --in: #15803D;
  --in-soft: #E3F7EC;
  --out: #C8321F;
  --out-soft: #FBE7E4;
  --warn: #B45309;
  --warn-soft: #FFF8EB;
  --night: #0B1020;
  --stripe: #635BFF;
  --chart-in: #15803D; --chart-out: #2F5BFF;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-head: "Montserrat", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0D16; --surface: #141826; --surface-2: #1C2133; --fill: #242A40; --seg-on: #343B55;
    --line: rgba(255, 255, 255, 0.09); --line-strong: rgba(255, 255, 255, 0.18);
    --fg: #F2F4FA; --fg-2: #A3A9C0; --fg-3: #7C8299; --ink: #F2F4FA; --on-ink: #0F1222;
    --accent: #5B7CFF; --accent-soft: #1B2447; --on-accent: #FFFFFF;
    --in: #34C76A; --in-soft: #10301C; --out: #FF5F52; --out-soft: #3B1613; --warn: #F2B84B; --warn-soft: #382A0C;
    --stripe: #9A94FF;
    --chart-in: #29A957; --chart-out: #5B7CFF;
    --shadow: 0 24px 64px rgba(0, 0, 0, 0.6); --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A0D16; --surface: #141826; --surface-2: #1C2133; --fill: #242A40; --seg-on: #343B55;
  --line: rgba(255, 255, 255, 0.09); --line-strong: rgba(255, 255, 255, 0.18);
  --fg: #F2F4FA; --fg-2: #A3A9C0; --fg-3: #7C8299; --ink: #F2F4FA; --on-ink: #0F1222;
  --accent: #5B7CFF; --accent-soft: #1B2447; --on-accent: #FFFFFF;
  --in: #34C76A; --in-soft: #10301C; --out: #FF5F52; --out-soft: #3B1613; --warn: #F2B84B; --warn-soft: #382A0C;
  --stripe: #9A94FF;
  --chart-in: #29A957; --chart-out: #5B7CFF;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.6); --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0; min-height: 100%;
  background: var(--bg); color: var(--fg);
  font-family: var(--font); font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; font-family: var(--font-head); }
button { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* Structure : menu latéral + contenu */
.layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; padding: 22px 14px 18px max(14px, env(safe-area-inset-left, 0px)); background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
.side-top { display: grid; gap: 14px; }
.wordmark { font-family: var(--font-head); font-size: 20px; font-weight: 800; letter-spacing: -0.03em; padding: 0 8px; display: flex; align-items: center; gap: 10px; }
.wordmark::before { content: ""; width: 24px; height: 24px; border-radius: 8px; background: var(--ink); background-image: linear-gradient(45deg, transparent 38%, var(--accent) 38%, var(--accent) 62%, transparent 62%); background-size: 11px 11px; background-repeat: no-repeat; background-position: center; flex: none; }
.sidebar .select { width: 100%; max-width: none; }
.side-nav { display: grid; gap: 2px; margin-top: 4px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--fg-2); text-decoration: none; transition: background 0.12s ease, color 0.12s ease; }
.nav-item .ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--t, var(--surface-2)); color: var(--c, var(--fg-2)); }
.nav-item svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav-item:hover { background: var(--surface-2); color: var(--fg); }
.nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--fg); font-weight: 600; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nav-item .ic { background: color-mix(in srgb, var(--c, #5B6178) 20%, transparent); } }
:root[data-theme="dark"] .nav-item .ic { background: color-mix(in srgb, var(--c, #5B6178) 20%, transparent); }
.nav-group { font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); padding: 12px 10px 4px; }
.side-bottom { display: grid; gap: 12px; padding: 0 2px; }
.side-bottom .side-nav { margin-bottom: 4px; }
.page-sub { font-size: 12px; color: var(--fg-3); margin-top: 2px; }

/* Tuiles et grilles business */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 12px; }
.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.int-tabs { align-self: start; }
.int-pane { display: grid; gap: 16px; }
.tile { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px 20px 16px; display: grid; gap: 6px; align-content: start; min-width: 0; text-decoration: none; color: inherit; }
.tile::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 5px; background: var(--pc, var(--accent)); }
.tile .k { font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--pc, var(--accent)); display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.tile .k .pill { letter-spacing: 0; text-transform: none; }
.tile .v { font-family: var(--font-head); font-size: 26px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .v.bad { color: var(--warn); }
.tile .v.good { color: var(--in); }
.tile .s { font-size: 12.5px; color: var(--fg-2); }
.tile .s .in { color: var(--in); } .tile .s .out { color: var(--fg-2); }
.tile.off .v { color: var(--fg-3); font-size: 18px; font-weight: 600; }
.tile.off::before { background: var(--line-strong); }
a.tile:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.cols3:empty, .tiles:empty { display: none; }
.mini-chart { height: 150px; position: relative; }
.chart-sm { height: 220px; position: relative; }
.chart-wrap .tip, .mini-chart .tip, .chart-sm .tip { position: absolute; pointer-events: none; background: var(--surface); border-radius: 12px; padding: 10px 12px; font-size: 12px; min-width: 150px; max-width: 250px; box-shadow: var(--shadow-sm), 0 10px 30px rgba(0,0,0,0.12); z-index: 5; border: 1px solid var(--line); }
.mini-chart svg, .chart-sm svg { display: block; width: 100%; height: 100%; }
.kv { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--fg-2); }
.kv b { color: var(--fg); font-weight: 600; }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-3); padding: 6px 8px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.tbl td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl td.who { max-width: 220px; }
.tbl td.who b, .tbl td.who .sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl td.who b { font-weight: 500; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.r, .tbl th.r { text-align: right; white-space: nowrap; }
.tbl .sub { display: block; font-size: 11.5px; color: var(--fg-3); }
.tbl-wrap { overflow-x: auto; }
.list-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; align-items: baseline; }
.list-row:first-child { border-top: 0; padding-top: 2px; }
.list-row .l { min-width: 0; }
.list-row .l b { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .l span { font-size: 12px; color: var(--fg-3); }
.list-row .r { text-align: right; white-space: nowrap; font-weight: 500; }
.list-row .r span { display: block; font-size: 11.5px; color: var(--fg-3); font-weight: 400; }
.date-head { font-size: 12px; font-weight: 600; text-transform: capitalize; color: var(--fg-2); padding: 12px 0 4px; border-bottom: 1px solid var(--line-strong); }

/* Assistant : badges de navigation */
.nav-badge { margin-left: auto; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--fg-2); font-variant-numeric: tabular-nums; }
.nav-badge.bad { background: var(--out-soft); color: var(--out); }
.prio { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--fg-3); flex: none; margin-top: 6px; }
.prio.p1 { background: var(--out); } .prio.p2 { background: var(--warn); } .prio.p3 { background: var(--fg-3); opacity: 0.6; }

/* À faire */
.todo-add { display: grid; grid-template-columns: minmax(0, 1fr) 150px auto; gap: 8px; margin-bottom: 10px; }
.todo-add input { font: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid transparent; border-radius: 10px; background: var(--surface-2); color: var(--fg); min-width: 0; }
.todo-add input:focus { background: var(--surface); border-color: var(--ink); outline: none; }
.todo-list { display: grid; }
.todo { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.todo:first-child { border-top: 0; }
.todo .chk { position: relative; width: 18px; height: 18px; margin-top: 2px; cursor: pointer; }
.todo .chk input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.todo .chk span { position: absolute; inset: 0; border: 1.5px solid var(--fg-3); border-radius: 6px; transition: background 0.15s ease, border-color 0.15s ease; }
.todo .chk input:checked + span { background: var(--ink); border-color: var(--ink); }
.todo .chk input:checked + span::after { content: ""; position: absolute; left: 5px; top: 1.5px; width: 4px; height: 9px; border: solid var(--bg); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.todo .t { min-width: 0; display: grid; gap: 2px; }
.todo .title { cursor: text; overflow-wrap: anywhere; }
.todo .notes { font-size: 12px; color: var(--fg-3); }
.todo .meta { display: flex; gap: 6px; align-items: center; }
.todo .x { font: inherit; font-size: 16px; line-height: 1; border: 0; background: none; color: var(--fg-3); cursor: pointer; padding: 0 4px; opacity: 0; transition: opacity 0.15s ease; }
.todo:hover .x, .todo .x:focus-visible { opacity: 1; }
.todo .x:hover { color: var(--out); }
.todo.done .title { color: var(--fg-3); text-decoration: line-through; }
.todo.late .title { color: var(--out); }
.todo-edit { font: inherit; font-size: 14px; padding: 4px 8px; border: 1px solid var(--ink); border-radius: 8px; background: var(--surface); color: var(--fg); width: 100%; }
.todo-done { margin-top: 10px; }
.todo-done summary { font-size: 12px; color: var(--fg-3); cursor: pointer; padding: 6px 0; }
.more-link { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--fg-2); text-decoration: none; }
.more-link:hover { color: var(--fg); text-decoration: underline; }
.sug-head { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-3); margin: 16px 0 4px; display: flex; gap: 8px; align-items: baseline; }
.sug-head .meta { font-weight: 500; letter-spacing: 0; text-transform: none; }
.sug { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line); }
.sug:first-child { border-top: 0; }
.sug-main { display: flex; gap: 10px; min-width: 0; align-items: flex-start; }
.sug .title { font-size: 14px; font-weight: 500; color: var(--fg); text-decoration: none; }
.sug .title:hover { text-decoration: underline; }
.sug .detail { font-size: 12px; color: var(--fg-3); margin-top: 2px; line-height: 1.5; }
.sug-actions { display: flex; gap: 6px; flex: none; }
.btn.quiet.small, .btn.small.quiet { color: var(--fg-3); }

/* Courrier : aperçu */
.mail-mini { display: grid; }
.mm { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; min-width: 0; }
.mm:first-child { border-top: 0; }
.mm:hover .mm-head b { text-decoration: underline; }
.mm-main { min-width: 0; flex: 1; }
.mm-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.mm-head .muted { font-size: 11.5px; white-space: nowrap; }
.mm-sub { font-size: 13px; color: var(--fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-act { font-size: 12px; color: var(--fg-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm .pill { flex: none; margin-top: 2px; }

/* Courrier : page */
.mail-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.mail-bar .meta a { color: var(--fg-2); }
.mail-layout { display: grid; grid-template-columns: minmax(280px, 2fr) minmax(0, 3fr); gap: 16px; align-items: start; }
.mail-list { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 8px; display: grid; gap: 2px; max-height: calc(100vh - 220px); overflow: auto; }
.mail-item { font: inherit; text-align: left; border: 0; background: none; color: inherit; padding: 10px 12px; border-radius: 12px; cursor: pointer; display: grid; gap: 3px; min-width: 0; transition: background 0.12s ease; }
.mail-item:hover { background: var(--surface-2); }
.mail-item.sel { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.mail-item.replied { opacity: 0.7; }
.mi-head { display: flex; gap: 8px; align-items: center; font-size: 13px; min-width: 0; }
.mi-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mi-head .when { margin-left: auto; font-size: 11.5px; color: var(--fg-3); white-space: nowrap; }
.mi-head .prio { margin-top: 0; }
.mi-subj { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mi-sum { font-size: 12px; color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mi-pills { display: flex; gap: 5px; flex-wrap: wrap; }
.mail-detail { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px 24px; min-width: 0; }
.md-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.md-head h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.md-from { font-size: 12px; color: var(--fg-2); margin-top: 4px; }
.md-status { flex: none; }
.md-brief { margin-top: 14px; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; font-size: 13px; display: grid; gap: 6px; }
.md-brief .k { display: inline-block; min-width: 68px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-3); }
.md-body { margin-top: 12px; }
.md-body summary { font-size: 12px; font-weight: 600; color: var(--fg-2); cursor: pointer; padding: 6px 0; }
.md-body pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 13px; line-height: 1.55; color: var(--fg-2); max-height: 360px; overflow: auto; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; margin-top: 6px; }
.md-prev { margin-top: 8px; font-size: 12px; color: var(--fg-2); }
.md-reply { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.md-reply h3 { font-size: 14px; font-weight: 600; }
.md-reply h3 .meta { font-size: 12px; font-weight: 400; color: var(--fg-3); margin-left: 6px; }
.md-reply textarea { font: inherit; font-size: 14px; line-height: 1.55; padding: 10px 12px; border: 1px solid transparent; border-radius: 10px; background: var(--surface-2); color: var(--fg); width: 100%; resize: vertical; }
.md-reply textarea:focus, .md-instr input:focus { background: var(--surface); border-color: var(--ink); outline: none; }
.md-instr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 8px; }
.md-instr input { font: inherit; font-size: 13px; padding: 9px 12px; border: 1px solid transparent; border-radius: 10px; background: var(--surface-2); color: var(--fg); min-width: 0; }
.btn.link.xs { font-size: 12px; padding: 0 4px; height: auto; }
@media (max-width: 900px) {
  .mail-layout { grid-template-columns: 1fr; }
  .mail-list { max-height: 40vh; }
  .todo-add { grid-template-columns: minmax(0, 1fr) auto; }
  .todo-add input[type="date"] { display: none; }
}

.list-row.live .l b { color: var(--in); }
.list-row .l span .pill { margin-left: 2px; vertical-align: 1px; }

.err-list { display: grid; gap: 4px; font-size: 12px; color: var(--out); }
.banner.ok { color: var(--fg-2); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.side-user { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--fg-2); }
.side-user .name { font-weight: 600; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.main { padding: 26px 32px 64px; padding-right: max(28px, env(safe-area-inset-right, 0px)); display: grid; gap: 16px; align-content: start; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 2px 4px; }
.page-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; display: flex; align-items: center; gap: 12px; }
.page-head h1 .ic { width: 36px; height: 36px; border-radius: 12px; display: inline-grid; place-items: center; background: var(--pt, var(--surface-2)); color: var(--pc, var(--fg-2)); flex: none; }
.page-head h1 .ic svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.page-sub { padding-left: 48px; }
body[data-page="today"] .page-head h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
body[data-page="today"] .page-head { justify-content: flex-end; padding: 0 4px; min-height: 0; }
.page-sub { text-transform: none; }
.page-sub::first-letter { text-transform: uppercase; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.view { display: grid; gap: 16px; }
.page-body { display: grid; gap: 16px; }
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row .code { flex: 1; }

/* Résumé (tableau de bord) */
.sum-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.sum-row:first-child { border-top: 0; padding-top: 2px; }
.sum-row .k { font-weight: 500; }
.sum-row .s { font-size: 12px; color: var(--fg-3); }
.sum-row .v { text-align: right; font-weight: 600; }
.sum-row .v .btn { margin-left: 8px; }
.sum-row a { text-decoration: none; }
.sum-row a:hover .k { text-decoration: underline; text-underline-offset: 3px; }

.select {
  appearance: none; -webkit-appearance: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--fg);
  padding: 7px 30px 7px 12px; border: 0; border-radius: 10px; cursor: pointer; max-width: 220px; text-overflow: ellipsis;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5l3.5 3.5 3.5-3.5' fill='none' stroke='%238E8E93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center;
}
.select:hover { background-color: var(--fill); }
.select:disabled { color: var(--fg-3); cursor: default; }

.btn {
  font-size: 13px; font-weight: 600; padding: 7px 13px; border-radius: 11px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--fg); cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; line-height: 1.2;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.btn:hover { background: var(--surface-2); }
.btn.primary, .btn.accent { background: var(--accent); color: var(--on-accent); font-weight: 600; border-color: var(--accent); }
.btn.primary:hover, .btn.accent:hover { background: var(--accent); opacity: 0.88; }
.btn.ink { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.btn.ink:hover { background: var(--ink); opacity: 0.86; }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
.btn.white { background: #FFF; color: #0F1222; border-color: #FFF; }
.btn.white:hover { background: #FFF; opacity: 0.9; }
.btn.glass { background: rgba(255, 255, 255, 0.10); border-color: rgba(255, 255, 255, 0.18); color: #FFF; }
.btn.glass:hover { background: rgba(255, 255, 255, 0.16); }
.btn.danger { background: var(--out-soft); color: var(--out); border-color: transparent; }
.btn.quiet { background: transparent; color: var(--fg-2); border-color: transparent; }
.btn.quiet:hover { background: var(--surface-2); color: var(--fg); }
.btn.small { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn.link { background: none; border: 0; padding: 0; border-radius: 0; color: var(--fg); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.btn.link:hover { background: none; text-decoration-color: var(--fg); }
.btn.block { width: 100%; justify-content: center; padding: 11px 14px; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .seg button:focus-visible, .row:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 2px;
}

/* Contrôle segmenté */
.seg { display: inline-flex; background: var(--fill); border-radius: 9px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--fg-2); cursor: pointer; white-space: nowrap; transition: background 0.15s ease, color 0.15s ease; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--seg-on); color: var(--fg); font-weight: 600; box-shadow: var(--shadow-sm); }
.seg.small button { padding: 4px 9px; font-size: 12px; }

/* Bandeaux */
.banner { background: var(--surface); border-radius: 14px; padding: 12px 18px; display: flex; gap: 12px; align-items: center; justify-content: space-between; font-size: 13px; color: var(--fg-2); flex-wrap: wrap; }
.banner.warn { color: var(--warn); background: var(--warn-soft); }
.notice { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--on-ink); padding: 10px 18px; border-radius: 12px; font-size: 13px; font-weight: 500; z-index: 50; max-width: calc(100vw - 32px); box-shadow: var(--shadow); }

/* Cartes */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px 22px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.card-head .meta { font-size: 12px; color: var(--fg-3); }

/* Héros */
.card.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr); gap: 24px; align-items: stretch; padding: 30px 34px; border-radius: 26px; background: var(--night); color: #FFF; border-color: rgba(255, 255, 255, 0.06); }
.card.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, #0B1020 0%, #121B3F 100%); z-index: 0; }
.card.hero::after { content: ""; position: absolute; inset: 0; z-index: 0; background: radial-gradient(48% 60% at 78% 30%, rgba(47, 91, 255, 0.5), transparent 70%), radial-gradient(40% 50% at 30% 110%, rgba(34, 211, 238, 0.2), transparent 70%), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1100 340' preserveAspectRatio='none'%3E%3Cpath d='M560 340 L790 110 L830 110 L1100 340 Z' fill='%23141C3A' fill-opacity='.9'/%3E%3Cg fill='%23FFFFFF' fill-opacity='.55'%3E%3Ccircle cx='600' cy='320' r='3.2'/%3E%3Ccircle cx='650' cy='270' r='2.8'/%3E%3Ccircle cx='700' cy='220' r='2.4'/%3E%3Ccircle cx='740' cy='180' r='2'/%3E%3Ccircle cx='770' cy='150' r='1.7'/%3E%3Ccircle cx='790' cy='130' r='1.4'/%3E%3Ccircle cx='1060' cy='320' r='3.2'/%3E%3Ccircle cx='990' cy='270' r='2.8'/%3E%3Ccircle cx='920' cy='220' r='2.4'/%3E%3Ccircle cx='880' cy='180' r='2'/%3E%3Ccircle cx='850' cy='150' r='1.7'/%3E%3Ccircle cx='830' cy='130' r='1.4'/%3E%3C/g%3E%3Cg fill='%23FFB020' fill-opacity='.7'%3E%3Ccircle cx='830' cy='324' r='2.6'/%3E%3Ccircle cx='822' cy='280' r='2.3'/%3E%3Ccircle cx='816' cy='240' r='2'/%3E%3Ccircle cx='812' cy='205' r='1.7'/%3E%3Ccircle cx='809' cy='175' r='1.4'/%3E%3Ccircle cx='807' cy='150' r='1.1'/%3E%3C/g%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.card.hero > * { position: relative; z-index: 1; }
.hero-main { display: grid; gap: 6px; align-content: center; min-width: 0; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #7F9BFF; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.eyebrow .pill { letter-spacing: 0; text-transform: none; }
.big { font-family: var(--font-head); font-size: 46px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.02; overflow-wrap: anywhere; color: #FFF; margin-top: 4px; }
.big.bad { color: #FFB020; }
.hero-main .sub { font-size: 13px; color: #B8C0D9; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.hero-main .sub .btn.link { color: #FFF; text-decoration-color: rgba(255, 255, 255, 0.4); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-left: 1px solid rgba(255, 255, 255, 0.14); }
.stat { padding: 4px 0 4px 22px; display: grid; gap: 4px; align-content: center; min-width: 0; }
.stat + .stat { border-left: 1px solid rgba(255, 255, 255, 0.14); }
.stat .k { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #7F9BFF; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stat .v { font-family: var(--font-head); font-size: 24px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; overflow-wrap: anywhere; color: #FFF; }
.stat .v.bad { color: #FFB020; }
.stat .s { font-size: 12px; color: #B8C0D9; }
.card.hero .pill.good { background: rgba(52, 199, 106, 0.18); color: #7BE09A; }
.card.hero .pill.warn { background: rgba(255, 176, 32, 0.18); color: #FFC866; }
.card.hero .pill.bad { background: rgba(255, 176, 32, 0.18); color: #FFB020; }
.pill { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; background: var(--surface-2); color: var(--fg-2); line-height: 1.5; }
.pill.good { background: var(--in-soft); color: var(--in); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--out-soft); color: var(--out); }
.pill.dot::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 5px; vertical-align: 1px; }
.pill.ghost { background: transparent; border: 1px dashed var(--line); color: var(--fg-3); padding: 1px 7px; }
/* Virements Stripe prévus : même colonne, rendu plus léger que le réel */
.ev.fc .l, .cal-ev.fc .l { color: var(--fg-2); font-style: italic; }
.ev.fc .a, .cal-ev.fc .a { opacity: 0.8; }
/* Ignorer / rétablir une échéance récurrente un jour donné */
.ev .skip { font: inherit; font-size: 11px; color: var(--fg-3); background: none; border: 0; padding: 0 6px; cursor: pointer; opacity: 0; transition: opacity 0.15s ease; white-space: nowrap; }
.ev:hover .skip, .ev .skip:focus-visible, .ev.skipped .skip { opacity: 1; color: var(--fg-2); text-decoration: underline; text-underline-offset: 2px; }
.ev.skipped .l { color: var(--fg-3); text-decoration: line-through; }
.ev .a.muted { color: var(--fg-3); }
@media (hover: none) { .ev .skip { opacity: 1; } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 4px 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--fg-2); }
.chip .x { font: inherit; font-size: 14px; line-height: 1; border: 0; background: none; color: var(--fg-3); cursor: pointer; padding: 0 5px; border-radius: 50%; }
.chip .x:hover { color: var(--out); }

/* Courbe */
.chart-wrap { position: relative; height: 250px; }
.chart-wrap svg { display: block; width: 100%; height: 100%; }
.chart-wrap .tip { position: absolute; pointer-events: none; background: var(--surface); border-radius: 12px; padding: 10px 12px; font-size: 12px; min-width: 160px; max-width: 250px; box-shadow: var(--shadow-sm), 0 10px 30px rgba(0,0,0,0.12); z-index: 5; border: 1px solid var(--line); }
.tip .tdate { color: var(--fg-2); margin-bottom: 2px; text-transform: capitalize; }
.tip .tbal { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.tip .tev { display: flex; justify-content: space-between; gap: 10px; margin-top: 3px; color: var(--fg-2); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--fg-2); flex-wrap: wrap; }
.legend span::before { content: ""; display: inline-block; width: 16px; height: 0; border-top: 2px solid var(--accent); vertical-align: middle; margin-right: 6px; }
.legend .l-thr::before { border-top: 1.5px dashed var(--fg-3); }
.legend .l-today::before { border-top: 1.5px dotted var(--fg-3); }

/* Colonnes */
.cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }

/* Échéancier */
.month-nav { display: flex; align-items: center; gap: 2px; }
.month-nav .mname { font-family: var(--font-head); font-weight: 800; font-size: 22px; min-width: 190px; text-align: center; text-transform: capitalize; letter-spacing: -0.03em; }
.month-nav .btn { font-size: 18px; padding: 2px 10px; line-height: 1; }
.month-sum { display: flex; gap: 18px; font-size: 12px; color: var(--fg-2); flex-wrap: wrap; padding-bottom: 10px; }
.month-sum b { color: var(--fg); font-weight: 600; }
.tl-day { display: grid; grid-template-columns: 76px minmax(0, 1fr) 124px; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); align-items: start; }
.tl-day .d { font-size: 12px; color: var(--fg-2); line-height: 1.3; }
.tl-day .d b { display: block; font-size: 15px; color: var(--fg); font-weight: 600; text-transform: capitalize; }
.tl-day .d .j { color: var(--fg-3); }
.tl-day.today .d .j { color: var(--fg); font-weight: 600; }
.tl-day .evs { display: grid; gap: 4px; min-width: 0; }
.ev { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; min-width: 0; }
.ev .l { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev .l .cat { color: var(--fg-3); }
.ev .a { white-space: nowrap; font-weight: 500; }
.in { color: var(--in); } .out { color: var(--fg-2); }
.tl-day .bal { text-align: right; }
.tl-day .bal b { display: block; font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.tl-day.under .bal b { color: var(--warn); }
.tl-day .bal .net { font-size: 12px; color: var(--fg-3); }
.tl-day .bal .none { color: var(--fg-3); }
.tl-day .bal .alert { font-size: 11px; color: var(--warn); font-weight: 600; }
.muted { color: var(--fg-3); }
.foot { border-top: 1px solid var(--line-strong); padding-top: 12px; margin-top: 2px; display: flex; justify-content: space-between; font-size: 13px; color: var(--fg-2); gap: 12px; flex-wrap: wrap; }
.foot b { color: var(--fg); font-weight: 600; }
.empty { color: var(--fg-2); font-size: 13px; padding: 22px 0; line-height: 1.55; max-width: 44ch; }

/* Calendrier */
.head-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* Même carte que « La semaine en argent » : date, pastilles, entrées en vert avec montant, charges, solde */
.cal-head, .cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head { padding: 0 2px 8px; gap: 8px; }
.cal-head span { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); padding-left: 12px; }
.cal { gap: 8px; }
.cal-cell { cursor: pointer; }
.cal-cell.out { opacity: 0.45; }
.cal-cell.past { opacity: 0.6; }
.cal-cell.past .s { color: var(--fg-3); font-weight: 500; }
.cal-cell.sel { box-shadow: 0 0 0 2px var(--accent); border-color: var(--accent); }
.cal-cell.today .d { color: var(--accent); }
.cal-cell.today .d::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: 1px; }
.cal-cell.nobal .s { color: var(--fg-3); font-weight: 500; }
.day-detail { margin-top: 14px; border-top: 1px solid var(--line-strong); padding-top: 12px; }
.day-detail .dd-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.day-detail .dd-head h3 { font-size: 15px; font-weight: 600; text-transform: capitalize; }
.day-detail .dd-head .j { font-size: 12px; color: var(--fg-3); margin-left: 8px; text-transform: none; }
.day-detail .dd-list { display: grid; gap: 6px; }
.day-detail .dd-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--fg-2); }
.day-detail .dd-foot b { color: var(--fg); font-weight: 600; }
.day-detail .dd-foot b.bad { color: var(--out); }

/* Registre */
.tabs { margin-bottom: 8px; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 11px 8px; margin: 0 -8px; border-top: 1px solid var(--line); cursor: pointer; border-radius: 10px; align-items: center; transition: background 0.12s ease; }
.row:first-child { border-top: 0; }
.row:hover { background: var(--surface-2); }
.row .t { font-weight: 500; display: flex; gap: 6px; align-items: center; min-width: 0; flex-wrap: wrap; }
.row .t span.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row .m { font-size: 12px; color: var(--fg-2); margin-top: 1px; }
.row .amt { text-align: right; white-space: nowrap; font-weight: 500; }
.row .amt .fq { display: block; font-size: 11px; color: var(--fg-3); font-weight: 400; }
.row.off { opacity: 0.5; }
.row .amt.in { color: var(--in); }
.row .amt.out { color: var(--out); }
.row.past .t .name, .row.past .m { color: var(--fg-3); }
.row.past .amt { opacity: 0.75; }
.ledger-foot { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0 0; border-top: 1px solid var(--line-strong); font-size: 13px; color: var(--fg-2); flex-wrap: wrap; }
.ledger-foot b { color: var(--fg); font-weight: 600; }
.ledger-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* Dialogues */
dialog { border: 0; border-radius: 24px; background: var(--surface); color: var(--fg); padding: 24px; width: min(540px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow: auto; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0, 0, 0, 0.32); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
dialog h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 16px; }
dialog h3 { font-size: 13px; font-weight: 600; color: var(--fg-2); text-transform: uppercase; letter-spacing: 0.06em; margin: 18px 0 10px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field label { font-size: 12px; color: var(--fg-2); font-weight: 500; }
.field input, .field select, .field textarea {
  font: inherit; font-size: 14px; padding: 9px 12px; border: 1px solid transparent; border-radius: 10px;
  background: var(--surface-2); color: var(--fg); width: 100%; min-width: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus { background: var(--surface); border-color: var(--ink); outline: none; }
.field input[type="number"], .field input[type="date"] { font-variant-numeric: tabular-nums; }
.field.check label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--fg); }
.field.check input { width: auto; accent-color: var(--ink); }
.field .err { color: var(--out); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.span2 { grid-column: 1 / -1; }
.actions { display: flex; gap: 8px; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.actions .spacer { flex: 1; }
.deposit-form { display: flex; gap: 8px; align-items: end; margin-top: 14px; flex-wrap: wrap; }
.deposit-form .field { flex: 1 1 220px; }
.deposit-form input[type="datetime-local"] { font-variant-numeric: tabular-nums; }
.form-error { color: var(--out); font-size: 13px; margin-top: 10px; }
.help { font-size: 12px; color: var(--fg-2); line-height: 1.55; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; background: var(--surface-2); padding: 8px 10px; border-radius: 8px; overflow-wrap: anywhere; user-select: all; }
.csv-preview { max-height: 240px; overflow: auto; border-radius: 10px; margin-top: 10px; background: var(--surface-2); }
.csv-preview table { border-collapse: collapse; width: 100%; font-size: 12px; }
.csv-preview th, .csv-preview td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.csv-preview th { color: var(--fg-2); font-weight: 500; position: sticky; top: 0; background: var(--surface-2); }
.csv-sum { font-size: 13px; color: var(--fg-2); margin-top: 8px; }
.acc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.acc-row:first-child { border-top: 0; }
.acc-row input { font: inherit; font-size: 14px; padding: 8px 12px; border: 1px solid transparent; border-radius: 10px; background: var(--surface-2); color: var(--fg); width: 100%; min-width: 0; }
.acc-row input:focus { background: var(--surface); border-color: var(--ink); outline: none; }
.acc-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-strong); }

/* Pages d'authentification */
.auth { min-height: 100vh; display: grid; place-items: center; padding-block: 32px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); background: var(--night) radial-gradient(60% 50% at 75% 20%, rgba(47, 91, 255, 0.45), transparent 70%); }
.auth .card { width: min(420px, 100%); padding: 32px; border-radius: 26px; }
.auth .wordmark { padding: 0; margin-bottom: 18px; }
.auth h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 6px; }
.auth .lead { color: var(--fg-2); font-size: 13.5px; line-height: 1.5; margin-bottom: 20px; }
.auth form { display: grid; gap: 14px; }
.auth .alt { margin-top: 18px; font-size: 13px; color: var(--fg-2); text-align: center; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  /* Barre haute sur deux lignes : marque, compte et réglages ; puis les sections, défilantes */
  .sidebar { position: sticky; top: 0; height: auto; z-index: 20; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 10px; row-gap: 8px; padding: 10px max(14px, env(safe-area-inset-right, 0px)) 8px max(14px, env(safe-area-inset-left, 0px)); border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .side-top { display: contents; }
  .wordmark { grid-column: 1; grid-row: 1; padding: 0; font-size: 18px; }
  .wordmark::before { display: none; }
  .sidebar .select { grid-column: 2; grid-row: 1; width: auto; max-width: 180px; justify-self: start; }
  #nav-main { grid-column: 1 / -1; grid-row: 2; overflow-x: auto; scrollbar-width: none; }
  #nav-main::-webkit-scrollbar { display: none; }
  .side-bottom { grid-column: 3; grid-row: 1; }
  .side-nav { display: flex; gap: 2px; margin: 0; }
  .side-nav .nav-item { flex: none; }
  .nav-item { padding: 5px 7px; font-size: 13px; gap: 8px; }
  .nav-item span:not(.ic) { display: none; }
  .nav-item .ic { width: 24px; height: 24px; }
  .nav-item[aria-current="page"] span { display: inline; }
  .nav-item[aria-current="page"] .ic { display: grid; }
  .side-bottom { display: flex; align-items: center; gap: 8px; }
  .side-user .name { display: none; }
  .main { padding: 16px 16px 48px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .cols, .cols2, .cols3 { grid-template-columns: 1fr; }
  .nav-group { display: none; }
  .side-bottom .side-nav { margin: 0; }
  .hero { grid-template-columns: 1fr; gap: 18px; }
  .stats { border-left: 0; border-top: 1px solid var(--line); padding-top: 14px; }
  .stat { padding-left: 0; padding-right: 14px; }
  .stat + .stat { padding-left: 14px; }
}
@media (max-width: 520px) {
  .card { padding: 16px; border-radius: 16px; }
  #theme-seg { display: none; }
  .page-head h1 { font-size: 19px; }
  .big { font-size: 38px; }
  .stats { grid-template-columns: 1fr; }
  .stat { padding: 10px 0; }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
  .tl-day { grid-template-columns: 60px minmax(0, 1fr) 98px; gap: 8px; }
  .form-grid { grid-template-columns: 1fr; }
  .month-nav .mname { min-width: 120px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Navigation à deux niveaux ---------- */
.subnav { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 0 4px; }
.subnav .seg button { padding: 6px 14px; }
.subnav .seg.lvl3 { background: transparent; padding: 0; gap: 6px; }
.subnav .seg.lvl3 button { padding: 4px 11px; font-size: 12.5px; border-radius: 999px; background: var(--surface); box-shadow: none; border: 1px solid var(--line); }
.subnav .seg.lvl3 button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.subnav .sub-count { font-size: 11px; font-weight: 600; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--fill); color: var(--fg-2); }
.subnav .seg button[aria-pressed="true"] .sub-count { background: var(--ink); color: var(--on-ink); }
.subnav .sub-count.bad { background: var(--out-soft); color: var(--out); }
.pane { display: grid; gap: 16px; }
/* Sous-onglets dépliés dans le menu latéral (grand écran) ; en haut de page sur petit écran */
.nav-subs { display: grid; gap: 1px; margin: 2px 0 6px 0; padding-left: 26px; position: relative; }
.nav-subs::before { content: ""; position: absolute; left: 17px; top: 4px; bottom: 6px; width: 1px; background: var(--line-strong); }
.nav-sub { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 10px; border-radius: 8px; font-size: 13px; color: var(--fg-2); text-decoration: none; }
.nav-sub:hover { background: var(--surface-2); color: var(--fg); }
.nav-sub.on { color: var(--fg); font-weight: 600; background: var(--surface-2); }
.nav-sub .nav-badge { margin-left: 0; }
.subnav .seg.lvl2:not(.always) { display: none; }
.subnav.only-lvl2 { display: none; }
@media (max-width: 900px) {
  .nav-subs { display: none; }
  .subnav .seg.lvl2:not(.always) { display: inline-flex; }
  .subnav.only-lvl2 { display: flex; }
}
.nav-pref.module { align-items: start; }
.nav-group-row { display: flex; align-items: center; justify-content: space-between; padding-right: 6px; }
.nav-add { border: 0; background: var(--surface-2); color: var(--fg-2); width: 20px; height: 20px; border-radius: 6px; font-size: 15px; line-height: 1; cursor: pointer; display: inline-grid; place-items: center; }
.nav-add:hover { background: var(--ink); color: var(--on-ink); }
.nav-item.nav-empty { border: 0; background: transparent; width: 100%; cursor: pointer; color: var(--fg-3); font-weight: 500; }
.nav-item.nav-empty:hover { color: var(--fg); background: var(--surface-2); }
.mod-list { display: grid; gap: 6px; }
.mod { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.mod.on { box-shadow: inset 0 0 0 1px var(--in); }
.mod.soon { opacity: 0.75; }
.mod-main { min-width: 0; }
.mod-main b { font-size: 14px; font-weight: 600; display: block; }
.mod-desc { font-size: 12.5px; color: var(--fg-2); line-height: 1.45; margin-top: 2px; }
.mod-act { display: flex; gap: 8px; align-items: center; flex: none; }
.mod-idea { margin-top: 16px; }
.mod-idea .k { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-3); }
@media (max-width: 900px) { .nav-group-row, .nav-item.nav-empty { display: none; } }
@media (max-width: 760px) { #theme-seg { display: none; } }
.nav-pref.module .help { font-size: 12px; }
.nav-item .nav-badge.good { background: var(--in-soft); color: var(--in); }
.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.conn { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.conn .conn-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.conn .conn-head h3 { font-size: 14px; font-weight: 600; }
.conn .conn-body { font-size: 12.5px; color: var(--fg-2); line-height: 1.5; }
.conn .conn-body b { color: var(--fg); font-weight: 600; }
.conn .conn-foot { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.conn.off { opacity: 0.8; }
.check-list { display: grid; gap: 6px; }
.check-list h4 { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-3); margin: 4px 0 2px; }
.check-list label { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); cursor: pointer; }
.check-list label span.s { color: var(--fg-3); font-size: 11.5px; margin-left: auto; white-space: nowrap; }
.check-list .empty { padding: 10px 0; }
#google-scopes { display: grid; gap: 2px; }
#google-scopes label { display: flex; align-items: center; justify-content: flex-start; gap: 8px; font-size: 13px; padding: 4px 0; font-weight: 400; color: var(--fg); }
#google-scopes input[type="checkbox"], .check-list input[type="checkbox"], .nav-pref input[type="checkbox"] { width: 16px; height: 16px; flex: none; margin: 0; }
.nav-pref { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.nav-pref:first-child { border-top: 0; }
.nav-pref input[type="text"] { font: inherit; font-size: 13px; padding: 6px 10px; border: 1px solid transparent; border-radius: 8px; background: var(--surface-2); color: var(--fg); width: 100%; }
.nav-pref input[type="text"]:focus { background: var(--surface); border-color: var(--ink); outline: none; }
.nav-pref .mv { display: flex; gap: 4px; }
.nav-pref .mv button { border: 0; background: var(--surface-2); border-radius: 8px; width: 28px; height: 28px; cursor: pointer; color: var(--fg-2); }
.nav-pref .mv button:hover { background: var(--fill); color: var(--fg); }
.nav-pref.hidden-item { opacity: 0.5; }

/* ---------- Agenda : calendrier jour / semaine / mois ---------- */
:root { --k-client: #2F5BFF; --k-interne: #5B6178; --k-dejeuner: #C7781A; --k-fournisseur: #6B46E5; --k-autre: #0E7490; }
.cal-toolbar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.cal-toolbar .cal-title { font-family: var(--font-head); font-size: 22px; font-weight: 800; letter-spacing: -0.03em; min-width: 200px; }
.cal-toolbar .cal-title::first-letter, .ev-when::first-letter { text-transform: uppercase; }
.cal-toolbar .spacer { flex: 1; }
.kind-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.kind-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 4px 10px 4px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--fg-2); }
.kind-chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--k, var(--fg-3)); }
.kind-chip[aria-pressed="true"] { color: var(--fg); border-color: var(--line-strong); background: var(--surface-2); }
.kind-chip[aria-pressed="false"] i { opacity: 0.3; }
.kind-chip .n { color: var(--fg-3); font-variant-numeric: tabular-nums; }
.ev-k-interne { --k: var(--k-interne); } .ev-k-client { --k: var(--k-client); } .ev-k-dejeuner { --k: var(--k-dejeuner); } .ev-k-fournisseur { --k: var(--k-fournisseur); } .ev-k-autre { --k: var(--k-autre); }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal-month .mh { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); padding: 0 0 0 12px; }
.cal-month .mc { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; min-height: 132px; padding: 10px 8px 10px; display: grid; align-content: start; gap: 4px; cursor: pointer; min-width: 0; }
.cal-month .mc:hover { border-color: var(--line-strong); }
.cal-month .mc.out { opacity: 0.45; }
.cal-month .mc .dn { font-size: 12px; font-weight: 600; color: var(--fg-3); padding: 0 4px 2px; display: flex; justify-content: space-between; align-items: center; }
.cal-month .mc.today .dn b { color: var(--accent); }
.cal-month .mc.today .dn b::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: 1px; }
.cal-month .mc .dn .cnt { font-size: 10.5px; color: var(--fg-3); font-weight: 500; }
.cal-ev { display: flex; align-items: center; gap: 5px; font-size: 12px; line-height: 1.35; padding: 4px 8px; border-radius: 8px; background: color-mix(in srgb, var(--k, var(--fg-3)) 12%, transparent); color: var(--fg); min-width: 0; cursor: pointer; border: 0; text-align: left; width: 100%; font-family: inherit; }
.cal-ev:hover { background: color-mix(in srgb, var(--k, var(--fg-3)) 24%, transparent); }
.cal-ev .t { font-weight: 700; color: var(--k, var(--fg-2)); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cal-ev .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev.past { opacity: 0.55; }
.cal-ev.cancelled .l { text-decoration: line-through; }
.cal-ev.prep::after { content: "✓"; font-size: 10px; color: var(--in); margin-left: auto; }
.cal-ev.todo { background: var(--ink); color: var(--on-ink); }
.cal-ev.todo .t { color: #7F9BFF; }
.cal-ev.todo:hover { background: var(--ink); opacity: 0.9; }
.cal-more { font-size: 11px; color: var(--fg-3); padding: 0 6px; cursor: pointer; }
.cal-scroll { margin-top: 14px; max-height: calc(100vh - 300px); min-height: 480px; overflow: auto; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); overscroll-behavior: contain; }
.cal-week { display: grid; grid-template-columns: 56px repeat(var(--cols, 7), minmax(0, 1fr)); background: var(--surface); }
.cal-week .wh { position: sticky; top: 0; z-index: 6; background: var(--surface); padding: 8px 6px 6px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); font-size: 12px; text-align: center; text-transform: capitalize; color: var(--fg-2); min-width: 0; }
.cal-week .wh b { display: block; font-family: var(--font-head); font-size: 20px; font-weight: 800; letter-spacing: -0.03em; color: var(--fg); line-height: 1.2; }
.cal-week .wh.today b { color: var(--accent); }
.cal-week .wh.we { color: var(--fg-3); }
.cal-week .wh-corner { position: sticky; top: 0; z-index: 6; background: var(--surface); border-bottom: 1px solid var(--line); }
.cal-week .allday { position: sticky; top: var(--head-h, 51px); z-index: 5; background: var(--surface); border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 3px 4px; display: grid; gap: 2px; min-height: 28px; min-width: 0; }
.cal-week .allday-label { position: sticky; top: var(--head-h, 51px); z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); font-size: 10.5px; color: var(--fg-3); padding: 8px 6px; text-align: right; }
.cal-week .gutter { position: relative; }
.cal-week .gutter span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.cal-week .col { position: relative; border-left: 1px solid var(--line); min-width: 0; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour) - 1px), var(--line) calc(var(--hour) - 1px), var(--line) var(--hour)); cursor: pointer; }
.cal-week .col.we { background-color: color-mix(in srgb, var(--surface) 85%, var(--bg)); }
.cal-week .col.today { background-color: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.cal-week .now { position: absolute; left: 0; right: 0; height: 2px; background: #FFB020; z-index: 3; pointer-events: none; }
.cal-week .now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #FFB020; }
.cal-wev { position: absolute; border-radius: 10px; padding: 5px 9px 4px; font-size: 12.5px; line-height: 1.3; overflow: hidden; background: color-mix(in srgb, var(--k, var(--fg-3)) 14%, var(--surface)); border-left: 3px solid var(--k, var(--fg-3)); color: var(--fg); cursor: pointer; z-index: 2; min-width: 0; border-top: 0; border-right: 0; border-bottom: 0; text-align: left; font-family: inherit; display: flex; flex-direction: column; gap: 1px; }
.cal-wev:hover { z-index: 4; background: color-mix(in srgb, var(--k, var(--fg-3)) 26%, var(--surface)); box-shadow: var(--shadow-sm); }
.cal-wev.todo { background: var(--ink); color: var(--on-ink); border-left-color: var(--ink); }
.cal-wev.todo span { color: rgba(255, 255, 255, 0.72); }
:root[data-theme="dark"] .cal-wev.todo span { color: rgba(15, 18, 34, 0.7); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cal-wev.todo span { color: rgba(15, 18, 34, 0.7); } }
.cal-wev.todo:hover { background: var(--ink); opacity: 0.92; }

.cal-wev b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; }
.cal-wev span { display: block; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; }
.cal-wev.short { padding: 2px 8px; justify-content: center; font-size: 12px; }
.cal-wev.short em { font-style: normal; font-weight: 600; color: var(--k, var(--fg-2)); font-variant-numeric: tabular-nums; margin-right: 2px; }
.cal-wev.prep::after { content: "✓ préparé"; position: absolute; right: 7px; bottom: 3px; font-size: 10px; font-weight: 600; color: var(--in); background: color-mix(in srgb, var(--surface) 80%, transparent); padding: 0 4px; border-radius: 4px; }
.cal-wev.short.prep::after { content: "✓"; bottom: auto; top: 50%; transform: translateY(-50%); }
.cal-wev.past { opacity: 0.55; }
.cal-wev.tentative { border-left-style: dashed; }
.cal-wev.cancelled b { text-decoration: line-through; }
.cal-day-side { display: grid; gap: 12px; align-content: start; }
.cal-day-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr); gap: 16px; align-items: start; }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--fg-2); }
.ev-list { display: grid; }
.ev-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); cursor: pointer; }
.ev-row:first-child { border-top: 0; }
.ev-row:hover .ev-title { text-decoration: underline; }
.ev-row .ev-time { font-size: 12.5px; font-weight: 600; display: grid; line-height: 1.25; font-variant-numeric: tabular-nums; }
.ev-row .ev-time span { font-size: 11px; font-weight: 500; color: var(--fg-3); }
.ev-row .ev-title { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-row .ev-sub { font-size: 12px; color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-row.past { opacity: 0.5; }
.kdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--k, var(--fg-3)); margin-right: 6px; vertical-align: 1px; }
.kind-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 2px 9px 2px 7px; border-radius: 999px; background: color-mix(in srgb, var(--k, var(--fg-3)) 14%, transparent); color: var(--k, var(--fg-2)); white-space: nowrap; }
.kind-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* Panneau d'un rendez-vous (dialogue) */
dialog.ev-dlg { width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; }
.ev-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.ev-head h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.ev-when { font-size: 13px; color: var(--fg-2); margin-top: 4px; }
.ev-when .j { font-size: 11px; font-weight: 600; color: var(--fg-3); margin-left: 6px; text-transform: none; letter-spacing: 0.04em; }
.ev-kinds { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.ev-kinds button { font: inherit; font-size: 12px; font-weight: 500; padding: 4px 10px 4px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--fg-2); }
.ev-kinds button i { width: 8px; height: 8px; border-radius: 50%; background: var(--k, var(--fg-3)); }
.ev-kinds button[aria-pressed="true"] { background: color-mix(in srgb, var(--k, var(--fg-3)) 16%, var(--surface)); border-color: var(--k, var(--fg-3)); color: var(--fg); font-weight: 600; }
.ev-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin-top: 14px; font-size: 13px; }
.ev-grid .k { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 3px; }
.ev-grid .span2 { grid-column: span 2; }
.ev-att { display: grid; gap: 4px; }
.ev-att div { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.ev-att .st { font-size: 11px; color: var(--fg-3); white-space: nowrap; }
.ev-att .st.accepted { color: var(--in); } .ev-att .st.declined { color: var(--out); }
.ev-ctx { margin-top: 14px; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; font-size: 13px; display: grid; gap: 8px; }
.ev-ctx h4 { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-3); }
.ev-ctx .row { display: flex; justify-content: space-between; gap: 10px; }
.ev-ctx .row span { color: var(--fg-3); font-size: 12px; white-space: nowrap; }
.ev-prep { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.ev-prep h3 { font-size: 14px; font-weight: 600; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.ev-prep h3 .meta { font-size: 12px; font-weight: 400; color: var(--fg-3); }
.ev-prep .prep-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; line-height: 1.6; margin-top: 8px; padding: 12px 14px; background: var(--surface-2); border-radius: 12px; max-height: 420px; overflow: auto; }
.ev-prep .prep-text .h { display: block; font-weight: 700; font-size: 11.5px; letter-spacing: 0.06em; margin-top: 10px; color: var(--fg-2); }
.ev-prep .prep-text .h:first-child { margin-top: 0; }
.ev-notes textarea { font: inherit; font-size: 13.5px; line-height: 1.5; padding: 10px 12px; border: 1px solid transparent; border-radius: 10px; background: var(--surface-2); color: var(--fg); width: 100%; resize: vertical; min-height: 64px; }
.ev-notes textarea:focus { background: var(--surface); border-color: var(--ink); outline: none; }
.ev-edit { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.ev-edit h3 { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.ev-dlg .actions { margin-top: 16px; }
.ev-dlg .actions .btn + .btn { margin-left: 0; }
.ev-read { font-size: 12px; color: var(--fg-3); margin-top: 10px; }
@media (max-width: 900px) {
  .cal-day-layout { grid-template-columns: 1fr; }
  .cal-week { --cols: 7; font-size: 11px; }
  .cal-week .wh b { font-size: 14px; }
  .cal-scroll { max-height: calc(100vh - 220px); }
  .ev-grid { grid-template-columns: 1fr; }
  .ev-grid .span2 { grid-column: span 1; }
}

/* Marketing & SEO */
.net-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 900px) { .net-grid { grid-template-columns: 1fr; } }
.status-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--fg-2); }
.delta { font-size: 12px; font-weight: 600; } .delta.up { color: var(--in); } .delta.down { color: var(--out); } .delta.flat { color: var(--fg-3); }


/* ---------- Aujourd'hui : le point du jour, quatre états, la journée, la semaine en argent ---------- */
.view.today { gap: 24px; }
.disp { font-family: var(--font-head); font-weight: 800; letter-spacing: -0.03em; line-height: 1.02; }
.hero-night { position: relative; border-radius: 26px; overflow: hidden; min-height: 300px; padding: 40px 44px; display: flex; flex-direction: column; justify-content: flex-end; background: var(--night); color: #FFF; border: 1px solid rgba(255, 255, 255, 0.06); }
.hero-night .sky { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-night .hero-body { position: relative; max-width: 680px; }
.hero-night .kick { font-size: 11.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #7F9BFF; }
.hero-night .kick a { color: #7F9BFF; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(127, 155, 255, 0.4); text-transform: none; letter-spacing: 0; font-weight: 600; }
.hero-night h2 { font-size: clamp(32px, 4.2vw, 50px); margin: 12px 0 0; color: #FFF; text-wrap: balance; }
.hero-night h2 .lt { color: #7F9BFF; }
.hero-night p { margin: 14px 0 0; font-size: 16px; line-height: 1.55; color: #B8C0D9; max-width: 580px; }
.hero-night .hero-acts { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.hero-night .hero-acts .btn { padding: 10px 16px; font-size: 13.5px; border-radius: 12px; }
.hero-night .skel { display: grid; gap: 9px; margin-top: 18px; max-width: 540px; }
.hero-night .skel span { display: block; height: 12px; border-radius: 6px; background: rgba(255, 255, 255, 0.10); animation: skel 1.4s ease-in-out infinite; }
@keyframes skel { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

.tiles4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.state { border-radius: 20px; padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; min-height: 236px; position: relative; overflow: hidden; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line); transition: transform 0.15s ease, border-color 0.15s ease; }
.state::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 5px; background: var(--c); }
.state:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.state .ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--t); color: var(--c); }
.state .ic svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.state .k { font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c); }
.state h3 { font-family: var(--font-head); font-weight: 700; font-size: 22px; letter-spacing: -0.025em; line-height: 1.1; }
.state p { font-size: 13.5px; color: var(--fg-2); max-width: 32ch; line-height: 1.45; }
.state .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: nowrap; border-top: 0; padding-top: 6px; font-size: inherit; color: inherit; }
.state .foot .btn { flex: none; }
.state .big { font-family: var(--font-head); font-size: 26px; font-weight: 800; letter-spacing: -0.03em; white-space: nowrap; }
.state .big.bad { color: var(--warn); }
.state .meta { font-size: 12.5px; color: var(--fg-3); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .state .ic { background: color-mix(in srgb, var(--c) 20%, transparent); } }
:root[data-theme="dark"] .state .ic { background: color-mix(in srgb, var(--c) 20%, transparent); }

.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.sec-head h2 { font-size: 26px; font-weight: 700; }
.sec-head .meta { font-size: 12.5px; color: var(--fg-3); }
.sec-head .meta a { color: var(--fg-2); }
.sec-head .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; margin: 0 5px 0 10px; }
.sec-head .legend i:first-child { margin-left: 0; }
.sec-head .legend i.out { background: var(--accent); }
.sec-head .legend i.in { background: var(--in); }
.sec-head .legend b.in { color: var(--in); }
.empty-line { color: var(--fg-2); font-size: 14px; padding: 4px 2px; }
.empty-line a { color: var(--accent); }

.day { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.slot { border-radius: 16px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; min-height: 118px; cursor: pointer; }
.slot .t { font-size: 11.5px; font-weight: 700; color: var(--fg-3); letter-spacing: 0.08em; text-transform: uppercase; }
.slot b { font-weight: 600; font-size: 15px; line-height: 1.25; }
.slot span:not(.t) { font-size: 12.5px; color: var(--fg-3); }
.slot .btn { align-self: flex-start; margin-top: 6px; }
.slot.hot { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.slot.hot span:not(.t) { color: rgba(255, 255, 255, 0.7); }
.slot.hot .t { color: #7F9BFF; }
.slot.hot.blue { background: var(--accent); border-color: var(--accent); color: #FFF; }
.slot.hot.blue .t { color: #CBD7FF; }
:root[data-theme="dark"] .slot.hot:not(.blue) { background: #F2F4FA; color: #0F1222; }
:root[data-theme="dark"] .slot.hot:not(.blue) span:not(.t) { color: rgba(15, 18, 34, 0.7); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .slot.hot:not(.blue) { background: #F2F4FA; color: #0F1222; } :root:not([data-theme="light"]) .slot.hot:not(.blue) span:not(.t) { color: rgba(15, 18, 34, 0.7); } }
.slot.free { border-style: dashed; cursor: default; }

.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.wd { border-radius: 14px; padding: 12px 12px 10px; background: var(--surface); border: 1px solid var(--line); min-height: 118px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; }
.wd:hover { border-color: var(--line-strong); }
.wd .d { font-size: 12px; font-weight: 600; color: var(--fg-3); }
.wd .dots { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; min-height: 10px; }
.wd .dots i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--accent); }
.wd .dots i.in { background: var(--in); }
.wd .dots i.soft { opacity: 0.35; }
.wd .dots i.none { background: var(--line); }
.wd .dots em { font-style: normal; font-size: 10.5px; color: var(--fg-3); }
.wd .mv { display: grid; gap: 2px; font-size: 12.5px; font-weight: 600; }
.wd .mv small { display: block; font-size: 10.5px; font-weight: 500; color: var(--fg-3); }
.wd .mv .in { color: var(--in); }
.wd .mv .out { color: var(--fg-2); }
.wd .mv .quiet { color: var(--fg-3); font-weight: 400; }
.wd .s { margin-top: auto; font-size: 14px; font-weight: 700; }
.wd.alert { border-color: #F59E0B; background: var(--warn-soft); }
.wd.alert .d, .wd.alert .s { color: var(--warn); }
.wd.gain { border-color: var(--in); background: var(--in-soft); }
.wd.gain .d, .wd.gain .s { color: var(--in); }
.wd.alert.gain { border-color: #F59E0B; background: var(--warn-soft); }
.wd.alert.gain .s { color: var(--warn); }

@media (max-width: 1100px) {
  .tiles4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .day { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .week { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .hero-night { padding: 28px 22px; min-height: 260px; border-radius: 20px; }
  .tiles4 { grid-template-columns: 1fr; }
  .day { grid-template-columns: 1fr; }
  .week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .state { min-height: 0; }
}


/* ---------- Une couleur par domaine, portée par la page ---------- */
body[data-page="bank"] { --pc: #2F5BFF; --pt: #E6EDFF; }
body[data-page="subscribers"] { --pc: #6B46E5; --pt: #EFEAFF; }
body[data-page="leads"] { --pc: #5B6178; --pt: #EEF0F5; }
body[data-page="marketing"] { --pc: #C7781A; --pt: #FFF1DE; }
body[data-page="seo"] { --pc: #15803D; --pt: #E3F7EC; }
body[data-page="assistant"] { --pc: #0E7490; --pt: #E0F4FA; }
body[data-page="integrations"], body[data-page="settings"] { --pc: #5B6178; --pt: #EEF0F5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body { --pt: color-mix(in srgb, var(--pc, #5B6178) 20%, transparent); } }
:root[data-theme="dark"] body { --pt: color-mix(in srgb, var(--pc, #5B6178) 20%, transparent); }
.sum-row .k, .row .t { font-weight: 600; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { box-shadow: none; }
.todo .chk input:checked + span { background: var(--accent); border-color: var(--accent); }
.todo .chk input:checked + span::after { border-color: #FFF; }
.field.check input { accent-color: var(--accent); }
.field input:focus, .field select:focus, .field textarea:focus, .todo-add input:focus, .md-reply textarea:focus, .md-instr input:focus, .acc-row input:focus, .nav-pref input[type="text"]:focus, .ev-notes textarea:focus { border-color: var(--accent); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .seg button:focus-visible, .row:focus-visible { outline-color: var(--accent); }
.subnav .seg button[aria-pressed="true"] .sub-count { background: var(--accent); color: var(--on-accent); }
.nav-add:hover { background: var(--accent); color: var(--on-accent); }
@media (max-width: 760px) {
  .cal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cal-head { display: none; }
  .cal-cell.out { display: none; }
  .cal-month { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cal-month .mh { display: none; }
  .cal-month .mc.out { display: none; }
  .card.hero { grid-template-columns: 1fr; padding: 24px; }
  .page-head h1 { font-size: 24px; }
  .page-sub { padding-left: 0; }
}

/* Faits en ligne sous une liste (Banque → Solde) et connecteurs en pied de vue d'ensemble */
.facts { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--fg-2); }
.fact { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; }
.fact .k { color: var(--fg-3); }
.fact b { font-weight: 700; color: var(--fg); }
.fact .btn { margin-left: 4px; }
a.fact:hover .k { color: var(--fg); }
.connectors { margin-top: 8px; }
.connectors .conn-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.conn .conn-head h3 { font-family: var(--font-head); font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.conn.off .conn-head h3 { color: var(--fg-2); }
.tile .v.muted, .big.muted { color: var(--fg-3); font-size: 22px; font-weight: 600; }
.card.hero .big.muted { color: #B8C0D9; font-size: 30px; }

/* Blocs des vues d'ensemble : lignes compactes, mini-courbe, chiffre d'appel, « Voir tout » */
.drow { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; min-width: 0; }
.drow:first-child { border-top: 0; }
.drow .l { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drow .d { font-size: 12px; color: var(--fg-3); margin-right: 10px; font-variant-numeric: tabular-nums; }
.drow .r { white-space: nowrap; font-weight: 600; }
.drow .r.in { color: var(--in); } .drow .r.bad { color: var(--warn); }
.chart-mid { height: 150px; position: relative; }
.big-line { display: flex; align-items: baseline; gap: 10px; padding-bottom: 8px; flex-wrap: wrap; }
.big-line b { font-family: var(--font-head); font-size: 28px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.big-line b.bad { color: var(--warn); }
.big-line span { font-size: 12.5px; color: var(--fg-2); }
.more-row { display: flex; justify-content: center; padding-top: 12px; }
.mini-list .more-link { margin-top: 6px; }
.cols2.even, .cols3.even { align-items: stretch; }
/* Valeurs négatives qui doivent ressortir (résiliés, pertes) : rouge */
.neg, .drow .r.neg, .tile .v.neg, .tile .v .neg, .card.hero .stat .v.neg { color: var(--out); }
.legend-colored span::before { border-top-color: var(--lc, var(--accent)); }
.legend-colored span.l-thr::before { border-top-style: dashed; }
.card-head .meta a { color: var(--fg-2); }

/* Intégrations : catalogue par section, une carte par connecteur */
.cat-section + .cat-section { margin-top: 10px; }
.cat-section .sec-head h2 { font-size: 20px; display: flex; align-items: center; gap: 10px; }
.cat-section .sec-head h2 .ic { width: 12px; height: 12px; border-radius: 4px; background: var(--c); display: inline-block; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.conn-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: inherit; min-width: 0; transition: transform 0.15s ease, border-color 0.15s ease; }
a.conn-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.conn-card .mark { width: 42px; height: 42px; border-radius: 13px; background: var(--b); color: #FFF; display: grid; place-items: center; font-family: var(--font-head); font-weight: 800; font-size: 17px; letter-spacing: -0.02em; flex: none; }
.conn-card:not(.on) .mark { opacity: 0.55; }
.conn-card.soon { opacity: 0.8; }
.conn-card .cc-main { min-width: 0; flex: 1; }
.conn-card h3 { font-family: var(--font-head); font-weight: 700; font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conn-card .cc-sub { font-size: 12.5px; color: var(--fg-2); line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.conn-card .pill { flex: none; }

/* Suivi manuel des impayés / résiliations */
.select.sm { font-size: 12px; padding: 5px 26px 5px 10px; border-radius: 9px; max-width: 200px; background-position: right 8px center; }
.follow-sel { font-weight: 600; border: 1px solid transparent; min-width: 190px; }
.select.sm.relancer { background-color: #FFF1DE; color: #B45309; border-color: #F5C98A; }
.select.sm.appele { background-color: var(--accent-soft); color: var(--accent); border-color: #B9C8FF; }
.select.sm.annulation { background-color: var(--out-soft); color: var(--out); border-color: #F2B8B0; }
.select.sm.va_payer { background-color: var(--in-soft); color: var(--in); border-color: #A7DDBB; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .select.sm.va_payer { border-color: #1E5A35; } }
:root[data-theme="dark"] .select.sm.va_payer { border-color: #1E5A35; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .select.sm.relancer { background-color: #3A2A0C; color: #F2B84B; border-color: #5C4316; } :root:not([data-theme="light"]) .select.sm.appele { border-color: #2C3B78; } :root:not([data-theme="light"]) .select.sm.annulation { border-color: #5A2520; } }
:root[data-theme="dark"] .select.sm.relancer { background-color: #3A2A0C; color: #F2B84B; border-color: #5C4316; }
:root[data-theme="dark"] .select.sm.appele { border-color: #2C3B78; }
:root[data-theme="dark"] .select.sm.annulation { border-color: #5A2520; }
.follow-sel:disabled { opacity: 0.6; }
.tbl td.follow { white-space: nowrap; }
.tbl td.follow .sub { margin-top: 3px; }

/* Prévision des renouvellements : ce qui est compté */
.warn-txt { color: var(--warn); font-weight: 600; }
.fc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip-info { font-size: 12.5px; padding: 5px 11px; border-radius: 999px; background: var(--pt, var(--surface-2)); color: var(--fg); }
.chip-info b { font-weight: 700; color: var(--pc, var(--fg)); }
.tile .v .unit { font-family: var(--font); font-size: 14px; font-weight: 600; color: var(--fg-2); letter-spacing: 0; }
.fc-question { display: flex; justify-content: space-between; align-items: center; gap: 14px 20px; flex-wrap: wrap; margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: #FFF8EB; border: 1px solid #F5C98A; }
.fc-question b { display: block; font-size: 14px; }
.fc-question span { font-size: 12.5px; color: var(--fg-2); }
.fc-q-acts { display: flex; gap: 8px; flex-wrap: wrap; }
:root[data-theme="dark"] .fc-question { background: #2A1F0A; border-color: #5C4316; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fc-question { background: #2A1F0A; border-color: #5C4316; } }
/* Actualisation automatique en cours */
.refreshing { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--accent); padding: 0 6px; }
.refreshing i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: skel 1s ease-in-out infinite; }

/* Renouvellements encaissés chez Stripe (pas encore en banque) : vert clair, ne comptent pas dans le solde */
.wd .mv .info { color: color-mix(in srgb, var(--in) 70%, var(--fg-3)); font-weight: 600; }
.wd .mv .info small { color: var(--fg-3); }
.wd .dots i.ring { background: transparent; box-shadow: inset 0 0 0 2px var(--in); opacity: 0.7; }
.sec-head .legend i.ring { background: transparent; box-shadow: inset 0 0 0 2px var(--in); }
.ev.info .l, .ev.info .a { color: color-mix(in srgb, var(--in) 70%, var(--fg-3)); }
.ev.info .a { font-weight: 600; }
.day-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.day-checks label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--fg); padding: 6px 10px; border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.day-checks input { accent-color: var(--accent); }
.wd .held { font-size: 11px; font-weight: 600; color: var(--accent); margin-top: auto; }
.wd .held + .s { margin-top: 2px; }

/* Banque connectée (Qonto) et solde Stripe : deux lignes en bas de chaque jour */
.wd .bals { margin-top: auto; display: grid; gap: 1px; }
.wd .bals .s, .wd .bals .st { margin-top: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 6px; min-width: 0; }
.wd .bals small { font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-3); }
.wd .bals .st { font-size: 12px; font-weight: 600; color: var(--stripe); }
.wd .bals .st small { color: color-mix(in srgb, var(--stripe) 70%, var(--fg-3)); }
.wd.alert .bals small, .wd.gain .bals small { color: inherit; opacity: 0.75; }
.wd.alert .bals .st, .wd.gain .bals .st { color: var(--stripe); }
.cal-cell.past .bals .s { color: var(--fg-2); }
.tl-day .bal .st { display: block; font-size: 11.5px; font-weight: 600; color: var(--stripe); }
.dd-foot b.stripe { color: var(--stripe); }
.pill.bank { background: color-mix(in srgb, var(--fg) 10%, transparent); color: var(--fg); }
.stats.s4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats.s4 .stat { padding-left: 18px; }
.stats.s4 .stat .v { font-size: 22px; }
@media (max-width: 1180px) { .stats.s4 { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; } .stats.s4 .stat:nth-child(3) { border-left: 0; } }
@media (max-width: 520px) { .stats.s4 { grid-template-columns: 1fr; } }
ol.steps { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.row.ro { cursor: default; }
.more-row { display: flex; justify-content: center; padding: 12px 0 4px; }
@media (max-width: 760px) { .stats.s4 .stat:nth-child(odd) { padding-left: 0; } }
@media (max-width: 520px) { .stats.s4 .stat { padding-left: 0; } .stats.s4 .stat:nth-child(3) { border-top: 1px solid var(--line); } }
.field input:disabled, .field select:disabled { opacity: 0.6; cursor: not-allowed; }
.wd .bals .st-when { font-size: 10px; font-weight: 600; color: color-mix(in srgb, var(--stripe) 75%, var(--fg-3)); text-align: right; }
.held-box { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--stripe) 8%, transparent); border: 1px solid color-mix(in srgb, var(--stripe) 22%, transparent); font-size: 13px; color: var(--fg-2); }
.held-box ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.held-box b { color: var(--fg); }
.big.stale { opacity: 0.45; }

/* Vue Année */
.year-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.year-bar .help { margin: 0; }
.legend .l-in::before, .legend .l-out::before { width: 10px; height: 10px; border: 0; border-radius: 3px; background: var(--chart-in); vertical-align: -1px; }
.legend .l-out::before { background: var(--chart-out); }
.year-tbl td.num, .year-tbl th:not(:first-child) { text-align: right; white-space: nowrap; }
.year-tbl td.in { color: var(--in); }
.year-tbl td.neg { color: var(--out); }
.year-tbl tfoot th, .year-tbl tfoot td { border-top: 1px solid var(--line-strong); font-weight: 700; padding: 10px 8px; }
.year-tbl tfoot th { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--fg); }
#year-view { min-width: 0; max-width: 100%; }
#year-view > * { min-width: 0; }
.year-tbl { min-width: 680px; }
/* Sous-onglets : défilent horizontalement sur mobile au lieu d'élargir la page */
.subnav { min-width: 0; max-width: 100%; }
.subnav .seg.lvl2 { max-width: 100%; overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
.subnav .seg.lvl2::-webkit-scrollbar { display: none; }
.subnav .seg.lvl2 button { flex: 0 0 auto; white-space: nowrap; }
.main > * { min-width: 0; }
