/* =========================================================
   APE du Tourous — Trésorerie
   Feuille de style principale (thème modifiable via variables)
   ========================================================= */
:root {
  --primary: #3BA9D9;
  --accent: #8BCB4F;
  --primary-soft: color-mix(in srgb, var(--primary) 12%, white);
  --primary-strong: color-mix(in srgb, var(--primary) 80%, black);
  --accent-soft: color-mix(in srgb, var(--accent) 15%, white);
  --bg: #F7F5F0;
  --card: #FFFFFF;
  --ink: #26323F;
  --muted: #6D7787;
  --line: #E7E3DA;
  --line-soft: #F1EEE8;
  --good: #3FA45B;
  --good-soft: #E6F5EA;
  --bad: #E0584F;
  --bad-soft: #FDECEA;
  --warn: #EDA23A;
  --warn-soft: #FDF3E2;
  --kid-yellow: #F7D84B;
  --kid-orange: #F2B33D;
  --kid-purple: #8E6CC0;
  --kid-coral: #EF6F6C;
  --kid-blue: #5BC8F0;
  --kid-green: #8BCB4F;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(38, 50, 63, .05), 0 6px 18px rgba(38, 50, 63, .06);
  --shadow-lg: 0 10px 40px rgba(38, 50, 63, .18);
  --font: "Segoe UI Variable Text", "Segoe UI", "Nunito", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-brand: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  --fs: 15px;
  color-scheme: light;
}
:root[data-mode="dark"] {
  --primary-soft: color-mix(in srgb, var(--primary) 22%, #1C232C);
  --accent-soft: color-mix(in srgb, var(--accent) 20%, #1C232C);
  --primary-strong: color-mix(in srgb, var(--primary) 75%, white);
  --bg: #14191F;
  --card: #1E252E;
  --ink: #E8ECF1;
  --muted: #9AA5B4;
  --line: #2F3843;
  --line-soft: #262E38;
  --good-soft: #1F3527;
  --bad-soft: #3A2224;
  --warn-soft: #3A2F1C;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: var(--fs);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary-strong); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
h1 { font-size: 1.6em; font-weight: 700; }
h2 { font-size: 1.2em; font-weight: 700; }
h3 { font-size: 1.02em; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: .86em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }
.grow { flex: 1; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 16px; }
.pos { color: var(--good); } .neg { color: var(--bad); }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 250px 1fr; height: 100vh; }
.sidebar {
  background: var(--card);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 18px 12px;
  overflow-y: auto;
}
.brand { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 6px 16px; border-bottom: 1px dashed var(--line); margin-bottom: 12px; }
.brand img { width: 92px; height: auto; }
.brand .name { font-family: var(--font-brand); font-size: 1.25em; color: var(--ink); }
.brand .role { font-size: .78em; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95em;
  transition: background .15s;
}
.nav a .ico { font-size: 1.25em; width: 26px; text-align: center; }
.nav a:hover { background: var(--line-soft); }
.nav a.active { background: var(--primary-soft); color: var(--primary-strong); }
.nav a .badge { margin-left: auto; }
.sidebar-foot { margin-top: auto; padding-top: 14px; font-size: .8em; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.save-state { display: flex; align-items: center; gap: 6px; }
.save-state .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.save-state.saving .dot { background: var(--warn); }
.save-state.error .dot { background: var(--bad); }

.main { overflow-y: auto; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .title { display: flex; flex-direction: column; }
.topbar .title .sub { font-size: .85em; color: var(--muted); }
.topbar .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.content { padding: 22px 28px 60px; max-width: 1500px; width: 100%; }

/* ---------- Cards & grids ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head .actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.span2 { grid-column: span 2; }
@media (max-width: 1200px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 860px) { .app { grid-template-columns: 74px 1fr; } .brand .name, .brand .role, .nav a .lbl, .sidebar-foot { display: none; } .brand img { width: 48px; } .g2, .g3, .g4 { grid-template-columns: 1fr; } .span2 { grid-column: auto; } .content { padding: 16px; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* ---------- KPI ---------- */
.kpi { position: relative; overflow: hidden; }
.kpi .lbl { font-size: .85em; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi .val { font-size: 1.75em; font-weight: 800; margin-top: 4px; letter-spacing: -.01em; }
.kpi .hint { font-size: .8em; color: var(--muted); margin-top: 2px; }
.kpi::after { content: ""; position: absolute; right: -18px; top: -18px; width: 70px; height: 70px; border-radius: 50%; background: var(--kpi-c, var(--primary-soft)); opacity: .55; }
.kpi.c-green { --kpi-c: var(--kid-green); } .kpi.c-coral { --kpi-c: var(--kid-coral); } .kpi.c-yellow { --kpi-c: var(--kid-yellow); } .kpi.c-blue { --kpi-c: var(--kid-blue); } .kpi.c-purple { --kpi-c: var(--kid-purple); }
.kpi.c-green::after, .kpi.c-coral::after, .kpi.c-yellow::after, .kpi.c-blue::after, .kpi.c-purple::after { opacity: .18; }
.benefit-big { border-radius: var(--radius); padding: 18px 22px; color: #fff; background: var(--good); display: flex; flex-direction: column; justify-content: center; box-shadow: var(--shadow); }
.benefit-big.neg { background: var(--bad); }
.benefit-big .lbl { font-weight: 600; opacity: .92; }
.benefit-big .val { font-size: 2.3em; font-weight: 800; letter-spacing: -.02em; }
.benefit-big .hint { font-size: .82em; opacity: .9; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); cursor: pointer; font-weight: 600; font-size: .92em;
  transition: transform .05s, background .15s, border-color .15s; white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: var(--primary); background: var(--primary-soft); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-strong); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #1f2a12; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--line-soft); }
.btn.sm { padding: 5px 10px; font-size: .84em; border-radius: 9px; }
.btn.icon { padding: 5px 8px; }
.btn.pdf { background: var(--kid-coral); border-color: var(--kid-coral); color: #fff; }
.btn.pdf:hover { background: color-mix(in srgb, var(--kid-coral) 85%, black); }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- Forms ---------- */
label.f { display: flex; flex-direction: column; gap: 4px; font-size: .86em; font-weight: 600; color: var(--muted); }
label.f > span { padding-left: 2px; }
.inp, select.inp, textarea.inp {
  width: 100%; padding: 8px 11px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-weight: 500; font-size: .95em; outline: none;
}
.inp:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea.inp { min-height: 80px; resize: vertical; }
.inp.num { text-align: right; font-variant-numeric: tabular-nums; }
.fgrid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fgrid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
input[type=range] { accent-color: var(--primary); width: 100%; }
input[type=color] { width: 44px; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--card); cursor: pointer; }

/* ---------- Tables ---------- */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .93em; }
.tbl th { text-align: left; font-size: .8em; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 8px 8px; border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; }
.tbl td { padding: 4px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr:hover td { background: color-mix(in srgb, var(--primary-soft) 45%, transparent); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tfoot td { font-weight: 800; border-top: 2px solid var(--line); border-bottom: none; padding-top: 8px; }
.tbl .cell {
  width: 100%; border: 1px solid transparent; background: transparent; padding: 6px 6px; border-radius: 8px; outline: none; min-width: 40px;
}
.tbl .cell:hover { border-color: var(--line); background: var(--card); }
.tbl .cell:focus { border-color: var(--primary); background: var(--card); box-shadow: 0 0 0 3px var(--primary-soft); }
.tbl .cell.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl select.cell { cursor: pointer; }
.tbl .del { opacity: 0; transition: opacity .15s; }
.tbl tr:hover .del { opacity: 1; }
.tbl tr.clickable { cursor: pointer; }
.tbl-wrap { overflow-x: auto; }

/* Pole (section de bilan) */
.pole { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 14px; background: var(--card); }
.pole-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--pole-c, var(--primary-soft)); }
.pole-head .pname { font-weight: 800; border: 1px solid transparent; background: transparent; padding: 4px 6px; border-radius: 8px; flex: 1; min-width: 80px; outline: none; }
.pole-head .pname:focus, .pole-head .pname:hover { background: var(--card); border-color: var(--line); }
.pole-head .prev { display: flex; align-items: center; gap: 4px; font-size: .8em; color: var(--muted); font-weight: 600; }
.pole-head .prev input { width: 90px; }
.pole .tbl th { background: transparent; position: static; }
.pole-foot { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; border-top: 1px solid var(--line-soft); }
.pole-foot .tot { font-weight: 800; }

/* ---------- Badges, pills ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .76em; font-weight: 700; background: var(--line-soft); color: var(--muted); white-space: nowrap; }
.badge.red { background: var(--bad); color: #fff; }
.badge.green { background: var(--good-soft); color: var(--good); }
.badge.orange { background: var(--warn-soft); color: #B9741A; }
.badge.blue { background: var(--primary-soft); color: var(--primary-strong); }
.badge.purple { background: color-mix(in srgb, var(--kid-purple) 18%, var(--card)); color: var(--kid-purple); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { border: none; background: none; padding: 10px 14px; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--primary-strong); border-bottom-color: var(--primary); }
.seg { display: inline-flex; background: var(--line-soft); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: none; background: none; padding: 5px 11px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: .88em; color: var(--muted); }
.seg button.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- Event cards ---------- */
.ev-card { cursor: pointer; transition: transform .12s, box-shadow .12s; display: flex; flex-direction: column; gap: 10px; border-top: 5px solid var(--ev-c, var(--primary)); }
.ev-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.ev-card .ev-ico { font-size: 1.9em; line-height: 1; }
.ev-card .ev-res { display: flex; justify-content: space-between; align-items: flex-end; }
.ev-card .ev-res .b { font-size: 1.35em; font-weight: 800; }
.progress { height: 7px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 99px; }
.tpl-card { cursor: pointer; border: 2px solid var(--line); border-radius: 14px; padding: 14px; text-align: center; transition: all .12s; background: var(--card); }
.tpl-card:hover { border-color: var(--primary); }
.tpl-card.sel { border-color: var(--primary); background: var(--primary-soft); }
.tpl-card .i { font-size: 2em; }
.tpl-card .t { font-weight: 700; margin-top: 4px; }
.tpl-card .d { font-size: .78em; color: var(--muted); margin-top: 2px; }

/* ---------- Charts ---------- */
.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .seg-arc { transition: opacity .15s, transform .15s; transform-origin: center; cursor: pointer; }
.chart svg:hover .seg-arc { opacity: .55; }
.chart svg .seg-arc:hover { opacity: 1; transform: scale(1.035); }
.chart .bar { transition: opacity .15s; cursor: pointer; }
.chart .bar:hover { opacity: .75; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .84em; margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 4px; display: inline-block; }
.donut-wrap { display: flex; align-items: center; gap: 16px; }
.donut-wrap .chart { max-width: 190px; flex-shrink: 0; }
.donut-legend { display: flex; flex-direction: column; gap: 6px; font-size: .86em; flex: 1; min-width: 0; }
.donut-legend div { display: flex; align-items: center; gap: 8px; }
.donut-legend i { width: 11px; height: 11px; border-radius: 4px; flex-shrink: 0; }
.donut-legend .l { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-legend .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.tooltip { position: fixed; z-index: 1000; pointer-events: none; background: #26323F; color: #fff; font-size: .82em; padding: 6px 10px; border-radius: 8px; box-shadow: var(--shadow-lg); opacity: 0; transition: opacity .1s; max-width: 260px; }
.tooltip.on { opacity: 1; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.empty .i { font-size: 2.4em; }

/* ---------- Alerts ---------- */
.alert { border-radius: 12px; padding: 11px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: .92em; }
.alert .i { font-size: 1.2em; line-height: 1.2; }
.alert.info { background: var(--primary-soft); }
.alert.warn { background: var(--warn-soft); }
.alert.bad { background: var(--bad-soft); }
.alert.good { background: var(--good-soft); }

/* ---------- Drawer / modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20, 28, 38, .38); z-index: 100; opacity: 0; transition: opacity .2s; }
.overlay.on { opacity: 1; }
.drawer { position: fixed; right: 0; top: 0; bottom: 0; width: min(560px, 96vw); background: var(--card); z-index: 101; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .22s ease; }
.drawer.wide { width: min(980px, 96vw); }
.drawer.on { transform: none; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -46%); opacity: 0; width: min(720px, 94vw); max-height: 90vh; background: var(--card); border-radius: 20px; z-index: 102; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; transition: all .2s; }
.modal.on { transform: translate(-50%, -50%); opacity: 1; }
.modal.small { width: min(440px, 94vw); }

.toasts { position: fixed; bottom: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: var(--card); padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: .92em; max-width: 380px; animation: tin .25s ease; display: flex; gap: 8px; align-items: center; }
.toast.good { background: var(--good); color: #fff; } .toast.bad { background: var(--bad); color: #fff; } .toast.warn { background: var(--warn); color: #26323F; }
@keyframes tin { from { transform: translateY(14px); opacity: 0; } }

/* ---------- Checklist ---------- */
.phase { margin-bottom: 16px; }
.phase-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.phase-head .j { font-weight: 800; background: var(--primary); color: #fff; border-radius: 10px; padding: 2px 10px; font-size: .85em; min-width: 52px; text-align: center; }
.phase-head .j.past { background: var(--muted); }
.phase-head .j.now { background: var(--kid-coral); }
.ck { display: flex; gap: 10px; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--line-soft); margin-bottom: 6px; background: var(--card); align-items: flex-start; }
.ck input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--good); flex-shrink: 0; cursor: pointer; }
.ck .t { font-weight: 600; }
.ck .d { font-size: .86em; color: var(--muted); margin-top: 2px; }
.ck.done { opacity: .55; } .ck.done .t { text-decoration: line-through; }
.ck.late { border-color: var(--bad); background: var(--bad-soft); }
.ck .when { margin-left: auto; white-space: nowrap; }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { font-size: .75em; font-weight: 700; color: var(--muted); text-align: center; padding: 4px; text-transform: uppercase; }
.cal .day { min-height: 92px; border: 1px solid var(--line-soft); border-radius: 10px; padding: 4px 5px; font-size: .78em; background: var(--card); overflow: hidden; cursor: pointer; }
.cal .day:hover { border-color: var(--primary); }
.cal .day.other { opacity: .4; }
.cal .day.today { border: 2px solid var(--primary); }
.cal .day .n { font-weight: 800; font-size: 1.05em; }
.cal .it { border-radius: 5px; padding: 1px 5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--primary-soft); }
.cal .it.ev { background: var(--accent-soft); font-weight: 700; }
.cal .it.late { background: var(--bad-soft); color: var(--bad); }
.cal .it.done { opacity: .5; text-decoration: line-through; }

/* Dropzone & docs */
.dropzone { border: 3px dashed color-mix(in srgb, var(--primary) 45%, var(--line)); border-radius: 18px; padding: 26px; text-align: center; background: var(--primary-soft); cursor: pointer; transition: all .15s; }
.dropzone.over { background: color-mix(in srgb, var(--primary) 25%, var(--card)); border-color: var(--primary); transform: scale(1.01); }
.dropzone .i { font-size: 2.4em; }
.doc-tile { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--card); }
.doc-tile:hover { border-color: var(--primary); }
.doc-tile .i { font-size: 1.7em; }
.doc-tile .n { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree { display: flex; flex-direction: column; gap: 2px; font-size: .92em; }
.tree a { padding: 6px 10px; border-radius: 9px; cursor: pointer; text-decoration: none; color: var(--ink); display: flex; gap: 6px; }
.tree a:hover { background: var(--line-soft); }
.tree a.active { background: var(--primary-soft); color: var(--primary-strong); font-weight: 700; }
.tree .lvl2 { padding-left: 26px; }
.viewer { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 12px; background: #525659; }

/* Vault */
.vault-lock { max-width: 440px; margin: 30px auto; text-align: center; }
.vault-lock .i { font-size: 3.5em; }
.secret { font-family: Consolas, "Cascadia Mono", monospace; letter-spacing: .03em; }

/* Cash calculator */
.cash-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.cash-row { display: grid; grid-template-columns: 90px 1fr 110px; gap: 8px; align-items: center; padding: 5px 0; }
.coin { display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 54px; border-radius: 50%; font-weight: 800; font-size: .85em; background: radial-gradient(circle at 35% 30%, #FFF4C2, #E8BE45); color: #5a4300; box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }
.coin.copper { background: radial-gradient(circle at 35% 30%, #F8D2B0, #C7773F); color: #4a2307; }
.coin.bi { background: radial-gradient(circle at 35% 30%, #FFF4C2 30%, #C9CED6 31%); }
.note { display: inline-flex; align-items: center; justify-content: center; width: 78px; height: 42px; border-radius: 6px; font-weight: 800; color: #fff; box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }
.cash-row .inp { text-align: center; font-size: 1.1em; font-weight: 700; }
.cash-total { font-size: 2.1em; font-weight: 800; }
.pochette { border-radius: 14px; padding: 12px 16px; color: #fff; }
.pochette.bleue { background: #3A7BD5; } .pochette.verte { background: #3FA45B; }

/* Forecast */
.slider-card { display: flex; flex-direction: column; gap: 6px; }
.slider-card .v { font-size: 1.35em; font-weight: 800; color: var(--primary-strong); }
.fc-tbl td.yr, .fc-tbl th.yr { width: 130px; }
.fc-tbl tr.sum td { font-weight: 800; background: var(--line-soft); }
.fc-tbl tr.grp td { font-weight: 800; color: var(--muted); font-size: .8em; text-transform: uppercase; letter-spacing: .05em; padding-top: 14px; }

/* Welcome */
.welcome { max-width: 760px; margin: 30px auto; text-align: center; }
.welcome img { width: 160px; }
.welcome h1 { font-family: var(--font-brand); font-size: 2.1em; margin: 10px 0; }

/* Scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 40%, transparent); border-radius: 10px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

@media print { body { display: none; } }
.badge[hidden] { display: none !important; }
.topbar .title { min-width: 0; flex: 1 1 260px; }
.topbar h1 { font-size: 1.4em; }
.fc-tbl td:first-child { min-width: 230px; }
.tbl td:first-child .cell { min-width: 120px; }
@media (max-width: 1250px) { .content .grid.g2[style] { grid-template-columns: 1fr !important; } }
:root[data-mode="dark"] .brand img { background: #fff; border-radius: 18px; padding: 6px; }

/* ---------- v1.2 : barres horizontales, jauges, compte-rendu, présentation ---------- */
.hbars { display: flex; flex-direction: column; gap: 7px; }
.hb-row { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: .9em; cursor: default; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-t { background: var(--line-soft); border-radius: 99px; height: 14px; overflow: hidden; }
.hb-b { height: 100%; border-radius: 99px; transition: width .4s; }
.hb-v { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gauge { margin-bottom: 12px; }
.hero { display: flex; align-items: center; gap: 18px; background: linear-gradient(120deg, var(--primary-soft), var(--accent-soft)); border-radius: 20px; padding: 18px 22px; position: relative; overflow: hidden; }
.hero img { height: 84px; }
.hero h2 { font-size: 1.6em; }
.hero .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.chip { background: var(--card); border-radius: 99px; padding: 4px 12px; font-weight: 700; font-size: .86em; box-shadow: var(--shadow); }
.stars button { border: none; background: none; font-size: 1.5em; cursor: pointer; padding: 0 1px; filter: grayscale(1); opacity: .4; }
.stars button.on { filter: none; opacity: 1; }
.bigkpi { border-radius: 18px; padding: 16px 18px; color: #fff; box-shadow: var(--shadow); }
.bigkpi .l { font-weight: 700; opacity: .92; font-size: .9em; }
.bigkpi .v { font-size: 2em; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.bigkpi .h { font-size: .8em; opacity: .9; }
.rep-sec { margin-bottom: 14px; }
.rep-sec h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.rep-sec textarea { min-height: 90px; line-height: 1.5; }
.dropmini { border: 2px dashed color-mix(in srgb, var(--primary) 45%, var(--line)); border-radius: 12px; padding: 8px 14px; cursor: pointer; background: var(--primary-soft); font-weight: 600; font-size: .9em; }
.dropmini.over { background: color-mix(in srgb, var(--primary) 25%, var(--card)); }
.present { position: fixed; inset: 0; z-index: 500; background: #FBF8F3; color: #26323F; display: flex; flex-direction: column; }
.present .slide { flex: 1; display: none; flex-direction: column; justify-content: center; padding: 4vh 7vw; position: relative; overflow: hidden; }
.present .slide.on { display: flex; animation: slin .35s ease; }
@keyframes slin { from { opacity: 0; transform: translateX(30px); } }
.present h1 { font-size: 5vh; color: var(--primary-strong); margin-bottom: 2vh; }
.present .big { font-size: 13vh; font-weight: 800; letter-spacing: -.03em; color: var(--good); line-height: 1; }
.present .sub { font-size: 3vh; color: #6D7787; }
.present .kp { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2vw; }
.present .kp div { background: #fff; border-radius: 3vh; padding: 3vh 2vw; box-shadow: 0 10px 30px rgba(0,0,0,.08); }
.present .kp b { display: block; font-size: 5.5vh; margin-top: 1vh; }
.present .kp span { font-size: 2.3vh; color: #6D7787; font-weight: 700; }
.present .two { display: grid; grid-template-columns: 1fr 1fr; gap: 4vw; align-items: center; }
.present .hbars, .present .donut-legend { font-size: 2.4vh; }
.present .hb-t { height: 2.4vh; }
.present ul { font-size: 3vh; line-height: 1.6; }
.present .pnav { display: flex; justify-content: space-between; align-items: center; padding: 1.5vh 3vw; background: #fff; border-top: 1px solid #eee; }
.present .dots span { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #ddd; margin: 0 3px; }
.present .dots span.on { background: var(--primary); }
.present .deco { position: absolute; border-radius: 50%; opacity: .14; pointer-events: none; }

body.compact .tbl td { padding: 1px 6px; } body.compact .tbl .cell { padding: 3px 5px; } body.compact .card { padding: 13px; } body.compact .content { padding-top: 14px; }
body.noanim *, body.noanim *::before { transition: none !important; animation: none !important; }
.lockscreen { position: fixed; inset: 0; z-index: 900; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.lockscreen .card { width: min(380px, 92vw); text-align: center; }
.lockscreen img { width: 110px; }
.pin { font-size: 1.6em; text-align: center; letter-spacing: .4em; }

/* Raccourcis web (banque, drive…) */
.quick { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.quick .qt { font-size: .72em; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 0 6px; }
.quick a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .92em; background: var(--line-soft); border: 1px solid var(--line); transition: all .15s; }
.quick a:hover { background: var(--primary-soft); border-color: var(--primary); }
.quick a .ico { font-size: 1.15em; width: 26px; text-align: center; }
.quick a .ext { margin-left: auto; opacity: .5; font-size: .85em; }
@media (max-width: 860px) { .quick .qt, .quick a .lbl, .quick a .ext { display: none; } }

/* Mode NAS */
.userbox { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; border-radius: 10px; background: var(--line-soft); margin-bottom: 6px; }
.userbox a { color: var(--primary-strong); }
body.readonly .content input:not([type=checkbox]):not(#fQ):not(#dQ), body.readonly .content textarea, body.readonly .drawer-body input, body.readonly .drawer-body textarea { pointer-events: none; background: var(--line-soft); }
body.readonly .tbl .del, body.readonly [data-act], body.readonly #eNew, body.readonly #eNew2, body.readonly #jIn, body.readonly #jOut, body.readonly #jImp, body.readonly #bulkT, body.readonly .dropzone, body.readonly .dropmini, body.readonly #dNew, body.readonly #rNew, body.readonly #tOk, body.readonly #tDel { display: none !important; }
