/* ===== Ma Compta — design ===== */
:root {
  --bg: #edf0f3;
  --surface: #ffffff;
  --surface-2: #f6f8fa;
  --line: #dde3e9;
  --ink: #101c28;
  --ink-2: #44566a;
  --side: #12202e;
  --side-ink: #b9c6d3;
  --side-active: #ffffff;
  --accent: #0b7a75;
  --accent-ink: #ffffff;
  --accent-soft: #dff2f0;
  --warn: #b4530a;
  --warn-soft: #fdebd7;
  --danger: #b42318;
  --danger-soft: #fde4e1;
  --ok: #17803d;
  --ok-soft: #dcf3e4;
  --info: #1d5fa8;
  --info-soft: #dfeafa;
  --seg-1: #0b7a75;
  --seg-2: #3b82c4;
  --seg-3: #c98a1b;
  --radius: 10px;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --side-w: 236px;
  --focus: 0 0 0 3px rgba(11, 122, 117, .35);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c141c;
    --surface: #131f2b;
    --surface-2: #192735;
    --line: #243546;
    --ink: #e9eff5;
    --ink-2: #9fb2c4;
    --side: #09111a;
    --accent: #2fb5ad;
    --accent-ink: #04201e;
    --accent-soft: #123a3a;
    --warn: #f0a35a;
    --warn-soft: #3a2812;
    --danger: #f28b82;
    --danger-soft: #3d1b1a;
    --ok: #6fd08c;
    --ok-soft: #14301f;
    --info: #86b6ee;
    --info-soft: #162c47;
    --seg-1: #2fb5ad;
    --seg-2: #6aa5dd;
    --seg-3: #e0ad48;
    --focus: 0 0 0 3px rgba(47, 181, 173, .45);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-head); letter-spacing: -.01em; margin: 0; }
h1 { font-size: 1.75rem; line-height: 1.15; font-weight: 700; }
h2 { font-size: 1.1rem; font-weight: 650; }
.muted { color: var(--ink-2); margin: .25rem 0 0; }
.small { font-size: .85rem; }
:focus-visible { outline: none; box-shadow: var(--focus); }

/* ---------- Forms ---------- */
label { display: block; font-size: .85rem; font-weight: 500; color: var(--ink-2); margin-bottom: .9rem; }
input, select {
  width: 100%;
  margin-top: .3rem;
  padding: .6rem .75rem;
  min-height: 42px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  font-size: .95rem;
  transition: border-color .12s, box-shadow .12s;
}
input:hover, select:hover { border-color: var(--ink-2); }
input:focus, select:focus { border-color: var(--accent); box-shadow: var(--focus); outline: none; }
input::placeholder { color: color-mix(in srgb, var(--ink-2) 65%, transparent); }
input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; margin: 0 .5rem 0 0; accent-color: var(--accent); }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.tag { font-size: .78rem; font-weight: 400; color: var(--ink-2); }
.check { display: flex; align-items: center; color: var(--ink); font-size: .9rem; font-weight: 450; }
.check.inline { margin: 0; align-self: center; }
.sep { border: none; border-top: 1px solid var(--line); margin: 1.2rem 0 1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 42px; padding: .5rem 1rem;
  border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: .9rem; font-weight: 600;
  cursor: pointer; transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); filter: brightness(1.1); }
.btn-ghost { background: transparent; }
.btn-sm { min-height: 34px; padding: .3rem .7rem; font-size: .82rem; }
.btn-block { width: 100%; }
.btn-danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  background: transparent; border: none; border-radius: 8px; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.delete:hover, .icon-btn[data-del]:hover { color: var(--danger); background: var(--danger-soft); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- Shell ---------- */
.shell { display: block; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 1.5rem;
  padding: .55rem 1.2rem;
  background: var(--side); color: var(--side-ink);
}
.brand { display: flex; align-items: center; gap: .7rem; padding: 0; color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; }
.logo {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 1.05rem;
}
.tabs { display: flex; flex-direction: row; gap: .2rem; overflow-x: auto; scrollbar-width: none; }
.tab {
  display: flex; align-items: center; gap: .75rem;
  padding: .5rem .8rem; border-radius: 8px; white-space: nowrap;
  color: var(--side-ink); font-weight: 550; font-size: .93rem;
  transition: background .12s, color .12s;
}
.tab svg { width: 20px; height: 20px; flex: none; }
.tab:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.tab.active { background: rgba(255, 255, 255, .13); color: var(--side-active); box-shadow: inset 0 -3px 0 var(--accent); }
.side-tools { margin-left: auto; display: flex; flex-direction: row; align-items: center; gap: .8rem; }
.year-picker { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin: 0; color: var(--side-ink); font-size: .85rem; }
.year-picker select { width: auto; margin: 0; min-height: 36px; background: rgba(255, 255, 255, .08); border-color: transparent; color: #fff; }
.year-picker select option { color: #111; }
.user-btn {
  display: flex; align-items: center; gap: .6rem; width: auto;
  padding: .55rem .6rem; border-radius: 8px; border: none; background: rgba(255, 255, 255, .07);
  color: #fff; font: inherit; font-size: .9rem; font-weight: 550; cursor: pointer; text-align: left;
}
.user-btn:hover { background: rgba(255, 255, 255, .13); }
.user-btn .avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: .8rem; font-weight: 700; flex: none; }
.user-btn .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout { color: var(--side-ink); font-size: .85rem; padding: .2rem .6rem; }
.logout:hover { color: #fff; }

.container { max-width: none; width: 100%; margin: 0; padding: 1rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.head-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.head-actions .year-picker { color: var(--ink-2); }
.head-actions .year-picker select { background: var(--surface); border: 1px solid var(--line); color: var(--ink); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; margin-bottom: 1.2rem;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.card.compact { padding: .9rem 1.1rem; }
.entry-form-card h2 { margin-bottom: 1rem; }

.grid-form {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: .2rem 1rem; align-items: end;
}
.grid-form .form-actions, .rates-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: .6rem; margin-top: .3rem; }
.form-actions { display: flex; justify-content: flex-end; gap: .6rem; }

/* ---------- Stats ---------- */
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .9rem; margin-bottom: 1.2rem; }
.stat { display: flex; flex-direction: column; gap: .2rem; margin: 0; padding: 1rem 1.1rem; position: relative; }
.stat-label { font-size: .85rem; color: var(--ink-2); font-weight: 500; }
.stat-value { font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat-sub { font-size: .8rem; color: var(--ink-2); }
.stat::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.stat.warn::before { background: var(--warn); }
.stat.ok::before { background: var(--ok); }
.stat.danger::before { background: var(--danger); }
.stat.info::before { background: var(--info); }
.stat.bank::before { background: var(--seg-2); }
.stat.warn .stat-value { color: var(--warn); }
.stat.ok .stat-value { color: var(--ok); }
.stat.danger .stat-value { color: var(--danger); }
.stat-edit { position: absolute; top: .4rem; right: .4rem; }

/* Estimation (suivi) */
.earn { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: .9rem; margin-bottom: 1.2rem; }
.earn .hero { grid-row: span 1; background: var(--side); color: #fff; border-color: transparent; padding: 1.3rem 1.4rem; margin: 0; }
.earn .hero .stat-label { color: var(--side-ink); }
.earn .hero .big { font-family: var(--font-head); font-size: clamp(2.4rem, 5vw, 3.4rem); font-weight: 750; letter-spacing: -.03em; line-height: 1; margin: .4rem 0 1rem; font-variant-numeric: tabular-nums; }
.split { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: rgba(255, 255, 255, .12); gap: 2px; }
.split i { display: block; height: 100%; min-width: 0; transition: flex-grow .3s; }
.split .s1 { background: var(--seg-1); } .split .s2 { background: var(--seg-2); } .split .s3 { background: var(--seg-3); }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin-top: .7rem; font-size: .82rem; color: var(--side-ink); }
.legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: .4rem; background: var(--c); }
.legend b { color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -.25rem; padding: 0 .25rem; }
.data-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.data-table th {
  text-align: left; padding: .6rem .75rem; color: var(--ink-2); font-weight: 600; font-size: .82rem;
  border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface);
}
.data-table td { padding: .7rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table .actions { text-align: right; white-space: nowrap; }
.data-table tr.total-row td { border-top: 2px solid var(--ink); font-weight: 700; font-size: 1rem; }
.data-table tr.debit .amount-cell { color: var(--danger); }
.data-table tr.credit .amount-cell { color: var(--ok); }
.data-table tr.facture { opacity: .85; }
.data-table tr.facture .amount-cell { color: var(--warn); }
.empty { text-align: center; color: var(--ink-2); padding: 2.2rem 1rem !important; }
.badge { display: inline-block; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: .12rem .65rem; font-size: .82rem; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pill { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.pill.credit, .pill.service { background: var(--accent-soft); color: var(--accent); }
.pill.debit, .pill.urgence { background: var(--danger-soft); color: var(--danger); }
.pill.facture { background: var(--warn-soft); color: var(--warn); }
.pay-btn { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.mini-input { width: 96px; margin: 0; min-height: 34px; padding: .3rem .5rem; text-align: right; font-size: .88rem; }
.urssaf-cell { display: inline-flex; align-items: center; gap: .4rem; margin: 0; }
.urssaf-cell .mini-input { width: 88px; }
.urssaf-prev.is-paid { color: var(--ink-2); text-decoration: line-through; opacity: .6; }
.transferred.tf-ok { border-color: var(--ok); }
.transferred.tf-warn { border-color: var(--warn); }
.transferred.tf-over { border-color: var(--danger); background: var(--danger-soft); }
.notes-list { margin: 1rem 0 0; padding-left: 1.2rem; color: var(--ink-2); line-height: 1.7; font-size: .88rem; }

/* Réglages de l'année */
.ys-head { margin-bottom: .6rem; }
.ys-head h2 { font-size: .98rem; }
.ys-row { display: grid; grid-template-columns: minmax(240px, 2fr) minmax(260px, 2fr) auto; align-items: end; gap: .6rem 1.2rem; }
.ys-field { display: flex; flex-direction: column; gap: .25rem; margin: 0; font-size: .85rem; }
.ys-field select, .ys-field input { margin-top: 0; }
.ys-inline { display: flex; align-items: center; gap: .6rem; }
.ys-inline input[type="number"] { flex: 1; min-width: 0; }
.ys-check { display: flex; align-items: center; margin: 0; color: var(--ink); white-space: nowrap; }
.ys-actions { display: flex; }

/* Paramètres */
.rate-row { display: grid; grid-template-columns: 2fr 1fr 3fr; gap: .2rem 1rem; align-items: end; padding-bottom: .5rem; margin-bottom: .6rem; border-bottom: 1px solid var(--line); }
.rate-row .unit { color: var(--ink-2); font-size: .78rem; margin-left: .3rem; }
.rate-extra { display: flex; gap: 1rem; grid-column: 1 / -1; }
.rate-extra label { flex: 0 0 200px; }

/* ---------- Modal / toast ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 15, 22, .55); }
.modal-card { position: relative; width: min(440px, 92vw); background: var(--surface); border-radius: 14px; padding: 1.6rem; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.modal-card h2 { margin-bottom: 1rem; }
.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); z-index: 300;
  background: var(--ink); color: var(--bg); padding: .7rem 1.1rem; border-radius: 10px; font-weight: 550; font-size: .9rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.toast.error { background: var(--danger); color: #fff; }
.toast.ok::before { content: "✓ "; }

/* ---------- Auth ---------- */
.auth-body { display: grid; place-items: center; min-height: 100vh; background: var(--side); padding: 1rem; }
.auth-card { width: min(410px, 100%); background: var(--surface); border-radius: 16px; padding: 2rem; box-shadow: 0 30px 70px rgba(0, 0, 0, .4); }
.auth-card .brand { color: var(--ink); padding: 0; margin-bottom: 1.6rem; }
.auth-card .brand h1 { font-size: 1.3rem; }
.auth-card .brand p { margin: 0; color: var(--ink-2); font-size: .85rem; font-weight: 400; font-family: var(--font-body); }
.auth-card h2 { margin-bottom: 1rem; }
.auth-error { margin-top: .8rem; padding: .65rem .85rem; background: var(--danger-soft); border-radius: 8px; color: var(--danger); font-size: .88rem; }
.auth-switch { text-align: center; color: var(--ink-2); font-size: .9rem; margin: 1.2rem 0 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .earn { grid-template-columns: 1fr 1fr; }
  .earn .hero { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .sidebar { flex-wrap: wrap; gap: .4rem .8rem; padding: .5rem .8rem; }
  .brand span:not(.logo) { display: none; }
  .side-tools { order: 2; }
  .side-tools .year-picker span { display: none; }
  .user-btn .name, .logout { display: none; }
  .tabs { order: 3; flex: 1 0 100%; }
  .tab { padding: .5rem .7rem; font-size: .88rem; }
  .tab svg { display: none; }
  .container { padding: .75rem; }
  h1 { font-size: 1.45rem; }
  .ys-row { grid-template-columns: 1fr; }
  .rate-row { grid-template-columns: 1fr; }
  .earn { grid-template-columns: 1fr; }
  .grid-form .wide { grid-column: auto; }
  .page-head { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ===== Suivi du temps ===== */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sv { display: flex; flex-direction: column; gap: 1.6rem; }

.sv-months { display: flex; gap: .35rem; overflow-x: auto; padding-bottom: .2rem; scrollbar-width: thin; }
.chip {
  flex: 1 0 auto; min-width: 68px; display: flex; flex-direction: column; align-items: center; gap: .1rem;
  padding: .55rem .7rem; border: none; border-radius: 8px;
  background: var(--surface); color: var(--ink-2); font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer;
  transition: background .12s, color .12s;
}
.chip small { font-size: .74rem; font-weight: 500; font-variant-numeric: tabular-nums; opacity: .8; }
.chip:hover { background: var(--accent-soft); color: var(--ink); }
.chip.has { color: var(--ink); }
.chip.on { background: var(--accent); color: var(--accent-ink); }
.chip.on small { opacity: .9; }

.sv-hero h1 {
  font-size: clamp(3rem, 9vw, 7.5rem); line-height: .95; letter-spacing: -.04em; font-weight: 750;
  font-variant-numeric: tabular-nums; margin: 0;
}
.sv-sentence { font-size: 1.15rem; color: var(--ink-2); margin: .6rem 0 0; max-width: 60ch; }

/* Compteur de packs */
.sv-meter { display: flex; gap: .5rem; align-items: stretch; min-height: 72px; }
.sv-meter .slot { position: relative; flex: 1 1 0; border-radius: 10px; background: var(--surface-2); overflow: hidden; min-width: 90px; }
.sv-meter .slot i { position: absolute; inset: 0 auto 0 0; background: var(--seg-3); transition: width .35s; }
.sv-meter .slot.pack i { background: var(--seg-1); }
.sv-meter .slot b { position: absolute; left: .8rem; bottom: .55rem; font-size: .9rem; font-weight: 650; color: var(--ink); mix-blend-mode: normal; text-shadow: none; }
.sv-meter .slot.pack b { color: var(--accent-ink); }
.sv-meter.year { align-items: flex-end; min-height: 120px; }
.sv-meter .bar { flex: 1 1 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 120px; gap: .35rem; font-size: .8rem; color: var(--ink-2); }
.sv-meter .bar i { display: block; width: 100%; min-height: 4px; border-radius: 6px 6px 0 0; background: var(--seg-1); }
.sv-meter-note { margin: .7rem 0 0; color: var(--ink-2); max-width: 70ch; }

/* Saisie (compacte) */
.sv-capture { background: var(--accent-soft); border-radius: 12px; padding: .6rem .9rem .5rem; margin: 0; }
.sv-fields { display: grid; grid-template-columns: 9.5rem 11rem 8.5rem minmax(8rem, 1fr) minmax(12rem, 2fr) auto; gap: 0 .7rem; align-items: end; }
.sv-fields label { color: var(--ink); font-weight: 600; font-size: .78rem; margin-bottom: .35rem; }
.sv-fields input, .sv-fields select { min-height: 38px; padding: .35rem .6rem; margin-top: .15rem; font-weight: 450; font-size: .92rem; border-color: transparent; }
.sv-actions { display: flex; gap: .4rem; margin: 0 0 .35rem auto; justify-self: end; }
.sv-actions .btn { min-height: 38px; white-space: nowrap; }
.sv-actions .btn-ghost { border-color: transparent; background: rgba(255, 255, 255, .5); }
.sv-preview { margin: 0; color: var(--ink-2); font-size: .85rem; line-height: 1.3; }
.sv-preview.ok { color: var(--ink); }
.sv-preview.bad { color: var(--danger); }
.sv-preview strong { font-variant-numeric: tabular-nums; }

/* Liste + relevé */
.sv-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.6rem; align-items: start; }
.sv-list-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.sv-tools { display: flex; gap: .4rem; }
.sv-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.sv-rows .row {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; gap: 1rem; align-items: center;
  background: var(--surface); border-radius: 10px; padding: .7rem 1rem .7rem .8rem;
}
.sv-rows .row:hover { background: var(--surface-2); }
.sv-rows time { display: flex; flex-direction: column; align-items: center; line-height: 1.05; background: var(--bg); border-radius: 8px; padding: .4rem 0; }
.sv-rows time b { font-family: var(--font-head); font-size: 1.3rem; }
.sv-rows time span { font-size: .72rem; color: var(--ink-2); }
.sv-rows .what { display: flex; flex-direction: column; min-width: 0; }
.sv-rows .what strong { font-weight: 600; overflow-wrap: anywhere; }
.sv-rows .what span { font-size: .85rem; color: var(--ink-2); }
.sv-rows .kind { font-style: normal; color: var(--accent); font-weight: 600; }
.sv-rows .kind.urg { color: var(--danger); }
.sv-rows .dur { font-family: var(--font-head); font-size: 1.25rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.sv-rows .acts { display: flex; opacity: .35; transition: opacity .12s; }
.sv-rows .row:hover .acts, .sv-rows .row:focus-within .acts { opacity: 1; }
.sv-empty { background: var(--surface); border-radius: 10px; padding: 2rem 1.2rem; color: var(--ink-2); }

.sv-statement { position: sticky; top: 1rem; background: var(--side); color: #fff; border-radius: 14px; padding: 1.4rem; }
.sv-statement h2 { font-size: 1.2rem; margin-bottom: 1rem; }
.sv-statement dl { margin: 0; display: flex; flex-direction: column; gap: .25rem; }
.sv-statement .ln { display: flex; justify-content: space-between; gap: 1rem; padding: .65rem .8rem; border-radius: 8px; background: rgba(255, 255, 255, .06); }
.sv-statement dt { display: flex; flex-direction: column; font-weight: 550; }
.sv-statement dt small { font-weight: 400; color: var(--side-ink); font-size: .8rem; }
.sv-statement dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.sv-statement .ln.total { background: var(--accent); color: var(--accent-ink); margin-top: .5rem; padding: .9rem .8rem; font-family: var(--font-head); font-size: 1.15rem; font-weight: 700; }
.sv-statement .ln.total dd { font-size: 1.35rem; }
.sv-empty-line { color: var(--side-ink); margin: 0 0 .5rem; }
.sv-note { margin: .9rem 0 0; font-size: .82rem; color: var(--side-ink); }
.sv-note:empty { display: none; }

@media (max-width: 1200px) {
  .sv-fields { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .sv-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .sv-grid { grid-template-columns: 1fr; }
  .sv-statement { position: static; order: -1; }
}
@media (max-width: 600px) {
  .sv-rows .row { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .sv-rows .acts { grid-column: 2 / -1; opacity: 1; justify-content: flex-end; }
  .sv-actions .btn { flex: 1; }
  .sv-meter .slot { min-width: 70px; }
}

.sv-rates { margin-top: 1.4rem; }
.sv-rates h2 { font-size: 1.05rem; margin-bottom: .7rem; }
.sv-rates dl { margin: 0; display: flex; flex-direction: column; gap: .25rem; }
.sv-rates .ln { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem .8rem; border-radius: 8px; background: rgba(255, 255, 255, .06); }
.sv-rates dt { display: flex; flex-direction: column; font-weight: 550; }
.sv-rates dt small { font-weight: 400; color: var(--side-ink); font-size: .78rem; }
.sv-rates dd { margin: 0; font-weight: 650; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.sv-rates dd small { display: block; font-weight: 400; color: var(--side-ink); font-size: .78rem; }
.sv-rows .dur small { display: block; font-family: var(--font-body); font-size: .72rem; font-weight: 450; color: var(--ink-2); text-align: right; }

/* ===== Multi-entreprise ===== */
.sv-global h1 { font-size: clamp(3rem, 8vw, 6.5rem); line-height: .95; letter-spacing: -.04em; font-weight: 750; font-variant-numeric: tabular-nums; margin: 0; }
.sv-cos { list-style: none; margin: 1.2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .5rem; }
.co-row {
  width: 100%; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "nm am" "bar bar" "sb sb"; gap: .35rem .8rem;
  text-align: left; padding: .8rem 1rem; border: none; border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer;
  transition: background .12s;
}
.co-row:hover { background: var(--accent-soft); }
.co-row.on { background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent); }
.co-row .nm { grid-area: nm; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-row .am { grid-area: am; font-family: var(--font-head); font-weight: 700; font-variant-numeric: tabular-nums; }
.co-row .bar { grid-area: bar; height: 8px; border-radius: 4px; background: var(--bg); overflow: hidden; }
.co-row .bar i { display: block; height: 100%; background: var(--seg-1); border-radius: 4px; }
.co-row .sb { grid-area: sb; font-size: .8rem; color: var(--ink-2); }

.sv-companies { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.chip.co { flex: 0 0 auto; flex-direction: row; padding: .65rem 1.1rem; font-size: 1rem; }
.chip.co.on { background: var(--side); color: #fff; }

.sv-company { background: var(--surface-2); border-radius: 14px; padding: 1.2rem 1.3rem; }
.sv-cohead h2 { font-size: 1.6rem; }
.sv-cohead p { margin: .15rem 0 1rem; color: var(--ink-2); }
.sv-ctiles { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: .6rem; margin-bottom: 1.1rem; }
.tile { background: var(--surface); border-radius: 10px; padding: .85rem 1rem; display: flex; flex-direction: column; gap: .1rem; }
.tile span { font-size: .85rem; color: var(--ink-2); font-weight: 500; }
.tile b { font-family: var(--font-head); font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile small { font-size: .8rem; color: var(--ink-2); }
.tile.main { background: var(--accent); color: var(--accent-ink); }
.tile.main span, .tile.main small { color: var(--accent-ink); opacity: .85; }
.tile.main b { font-size: 2.2rem; }
.sv-cgrid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.4rem; align-items: start; }
.sv-company .sv-statement { position: static; }

.sv-table td, .sv-table th { padding-top: .6rem; padding-bottom: .6rem; }
.sv-table { background: var(--surface); border-radius: 10px; }
.sv-table .actions { width: 1%; }

.co-list { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.co-list li { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.co-list .co-name { max-width: 320px; margin: 0; }
.empty-line { color: var(--ink-2); }
.inline-form { display: flex; align-items: flex-end; gap: .7rem; flex-wrap: wrap; }
.inline-form label { margin: 0; flex: 1 1 260px; max-width: 360px; }

.rate-row { display: grid; grid-template-columns: 2fr 1.4fr 1fr 3fr auto; gap: .2rem 1rem; align-items: end; padding: .8rem 0 .4rem; border-bottom: 1px solid var(--line); }
.rate-row .r-inpack-wrap, .rate-row .r-hours-wrap, .rate-row .r-th-wrap { grid-column: 2 / 4; align-self: center; margin: 0 0 .6rem; }
.rate-row .r-hours-wrap, .rate-row .r-th-wrap { grid-column: auto; }
.rate-row .r-del { margin-bottom: .9rem; }

@media (max-width: 1200px) {
  .sv-cgrid { grid-template-columns: 1fr; }
  .sv-ctiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .rate-row { grid-template-columns: 1fr 1fr; }
}

/* ===== Suivi du temps — version dense ===== */
.sv { gap: .7rem; font-size: .9rem; }
.sv label { margin-bottom: .45rem; }

.sv-months { gap: .25rem; }
.sv-months .chip { flex-direction: row; justify-content: center; gap: .4rem; min-width: 0; padding: .3rem .6rem; font-size: .85rem; border-radius: 6px; }
.sv-months .chip small { font-size: .72rem; }

.sv-global { display: flex; align-items: baseline; gap: .3rem 1.2rem; flex-wrap: wrap; }
.sv-global h1 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); letter-spacing: -.03em; line-height: 1; }
.sv-global .sv-sentence { font-size: .92rem; margin: 0; flex: 1 1 22rem; }

.sv-companies { gap: .3rem; }
.chip.co { flex-direction: row; align-items: baseline; gap: .55rem; padding: .35rem .8rem; font-size: .88rem; border-radius: 8px; }
.chip.co small { font-size: .78rem; }
.chip.co.on small { opacity: .85; }

.sv-company { padding: .6rem .8rem .7rem; border-radius: 10px; }
.sv-cohead { display: flex; align-items: baseline; gap: .3rem 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.sv-cohead h2 { font-size: 1.1rem; }
.sv-cohead p { margin: 0; font-size: .84rem; }
.sv-ctiles { grid-template-columns: 1.5fr repeat(3, 1fr); gap: .4rem; margin: 0; }
.tile { padding: .45rem .7rem; border-radius: 8px; flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 0 .5rem; }
.tile span { font-size: .78rem; flex: 1 0 100%; }
.tile b { font-size: 1.2rem; }
.tile.main b { font-size: 1.45rem; }
.tile small { font-size: .74rem; }

.sv-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: .8rem; align-items: start; }
.sv-main { display: flex; flex-direction: column; gap: .7rem; min-width: 0; }
.sv-side { display: flex; flex-direction: column; gap: .6rem; position: sticky; top: 3.6rem; }
.sv-meterbox { background: var(--surface-2); border-radius: 10px; padding: .6rem .7rem; }
.sv-meter { min-height: 38px; gap: .3rem; }
.sv-meter .slot { min-width: 54px; border-radius: 6px; }
.sv-meter .slot b { left: .5rem; bottom: .3rem; font-size: .75rem; }
.sv-meter.year { min-height: 70px; }
.sv-meter .bar { height: 70px; font-size: .68rem; gap: .2rem; }
.sv-meter-note { margin: .4rem 0 0; font-size: .78rem; line-height: 1.35; }

.sv-statement { padding: .7rem .8rem; border-radius: 10px; }
.sv-statement h2 { font-size: .95rem; margin-bottom: .5rem; }
.sv-statement dl { gap: .15rem; }
.sv-statement .ln { padding: .35rem .6rem; font-size: .84rem; border-radius: 6px; }
.sv-statement dt small, .sv-rates dt small { font-size: .72rem; }
.sv-statement .ln.total { padding: .5rem .6rem; margin-top: .3rem; font-size: .95rem; }
.sv-statement .ln.total dd { font-size: 1.1rem; }
.sv-note { margin: .5rem 0 0; font-size: .74rem; }
.sv-rates { margin-top: .7rem; }
.sv-rates h2 { font-size: .9rem; margin-bottom: .4rem; }
.sv-rates .ln { padding: .35rem .6rem; font-size: .82rem; border-radius: 6px; }

.sv-capture { padding: .45rem .7rem .4rem; border-radius: 10px; }
.sv-fields { grid-template-columns: 8.6rem 10rem 7rem minmax(7rem, 1fr) minmax(10rem, 2fr) auto; gap: 0 .5rem; }
.sv-fields label { font-size: .72rem; margin-bottom: .25rem; }
.sv-fields input, .sv-fields select { min-height: 32px; padding: .2rem .5rem; font-size: .85rem; margin-top: .1rem; }
.sv-actions { margin-bottom: .25rem; }
.sv-actions .btn { min-height: 32px; padding: .2rem .7rem; font-size: .82rem; }
.sv-preview { font-size: .76rem; }

.sv-list-head { margin-bottom: .4rem; }
.sv-list-head h2 { font-size: .98rem; }
.sv-tools .btn { min-height: 28px; padding: .1rem .6rem; font-size: .76rem; }
.sv-table { font-size: .84rem; }
.sv-table th { padding: .35rem .6rem; font-size: .76rem; }
.sv-table td { padding: .28rem .6rem; }
.sv-table .pill { padding: .05rem .5rem; font-size: .72rem; }
.sv-table .icon-btn { width: 26px; height: 26px; }
.sv-table .icon-btn svg { width: 15px; height: 15px; }

@media (max-width: 1100px) {
  .sv-cols { grid-template-columns: 1fr; }
  .sv-side { position: static; order: -1; }
  .sv-fields { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
  .sv-ctiles { grid-template-columns: repeat(2, 1fr); }
}
