/* Patrimoine 360° — thème inspiré d'Antigravity, retravaillé (lisibilité, mobile, accessibilité) */
:root {
  --bg: #0b1220; --bg-elev: #0f172a; --card: #111c33; --card-alt: #16233f; --hover: rgba(148,163,184,.08);
  --border: rgba(148,163,184,.16); --border-strong: rgba(148,163,184,.32);
  --text: #f1f5f9; --text-muted: #94a3b8; --text-dim: #64748b;
  --emerald: #10b981; --emerald-bg: rgba(16,185,129,.14); --gold: #f59e0b; --gold-bg: rgba(245,158,11,.14);
  --sky: #38bdf8; --sky-bg: rgba(56,189,248,.14); --violet: #a855f7; --violet-bg: rgba(168,85,247,.14);
  --rose: #f43f5e; --rose-bg: rgba(244,63,94,.14); --slate-bg: rgba(148,163,184,.14);
  --shadow: 0 10px 30px rgba(0,0,0,.35); --radius: 14px; --radius-sm: 9px;
  --pos: #34d399; --neg: #fb7185;
}
body.light-theme {
  --bg: #f1f5f9; --bg-elev: #fff; --card: #fff; --card-alt: #f8fafc; --hover: rgba(15,23,42,.04);
  --border: rgba(15,23,42,.1); --border-strong: rgba(15,23,42,.22); --text: #0f172a; --text-muted: #475569; --text-dim: #64748b;
  --shadow: 0 6px 20px rgba(15,23,42,.07); --pos: #059669; --neg: #e11d48;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--sky); text-decoration: none; }
button, input, select, textarea { font: inherit; color: var(--text); }
[hidden], .hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
code { background: var(--card-alt); padding: 1px 6px; border-radius: 5px; font-size: .9em; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--pos); } .neg { color: var(--neg); } .warn { color: var(--gold); }
.muted { color: var(--text-muted); } .small { font-size: 12.5px; } .center { text-align: center; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .p-12 { padding: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- En-tête ---------- */
.topbar { position: sticky; top: 0; z-index: 40; background: rgba(11,18,32,.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); padding-top: env(safe-area-inset-top); }
body.light-theme .topbar { background: rgba(255,255,255,.93); }
.topbar-inner { max-width: 1440px; margin: 0 auto; padding: 0 20px; }
.topbar-row { display: flex; align-items: center; gap: 16px; padding: 10px 0; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); flex: none; }
.brand-logo { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: linear-gradient(135deg, var(--emerald), #0ea5e9); color: #04121c; font-weight: 800; font-size: 13px; }
.brand-logo.big { width: 64px; height: 64px; font-size: 20px; border-radius: 16px; margin: 0 auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title { font-weight: 800; letter-spacing: .02em; font-size: 15px; }
.brand-sub { font-size: 11.5px; color: var(--text-muted); }
.header-pills { display: flex; gap: 8px; flex: 1; justify-content: center; }
.header-pill { display: flex; flex-direction: column; padding: 4px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--text); line-height: 1.2; }
.header-pill span { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.header-pill b { font-size: 14px; color: var(--emerald); }
.header-actions { display: flex; gap: 8px; align-items: center; }
.sync { font-size: 11.5px; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.sync-ok { color: var(--emerald); background: var(--emerald-bg); }
.sync-saving { color: var(--sky); background: var(--sky-bg); }
.sync-error { color: var(--rose); background: var(--rose-bg); font-weight: 600; }
.tabs-nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs-nav::-webkit-scrollbar { display: none; }
.tab-btn { padding: 9px 13px; color: var(--text-muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; font-size: 13.5px; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--emerald); border-bottom-color: var(--emerald); }
.tab-badge { background: var(--gold); color: #1b1407; border-radius: 10px; padding: 0 6px; font-size: 11px; margin-left: 5px; font-weight: 700; }
.partner-banner { background: var(--violet-bg); color: var(--violet); border-bottom: 1px solid var(--border); padding: 9px 20px; text-align: center; font-weight: 600; font-size: 13px; }
.container { max-width: 1440px; margin: 0 auto; padding: 22px 20px 100px; }

/* ---------- Boutons, champs ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--card); color: var(--text); font-weight: 600; font-size: 13px; cursor: pointer; transition: border-color .15s, background .15s; white-space: nowrap; }
.btn:hover { border-color: var(--emerald); }
.btn-primary { background: var(--emerald); border-color: var(--emerald); color: #04121c; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-rose { color: var(--rose); border-color: var(--rose-bg); background: var(--rose-bg); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); border-color: var(--border); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-icon { padding: 7px 10px; }
.btn-block { width: 100%; justify-content: center; padding: 11px; font-size: 14px; }
.btn-partner { border-color: var(--violet-bg); color: var(--violet); }
.input, .select { width: 100%; padding: 9px 11px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--bg-elev); color: var(--text); font-size: 14px; }
.input:focus, .select:focus { border-color: var(--emerald); outline: none; box-shadow: 0 0 0 3px var(--emerald-bg); }
.input-sm { padding: 5px 8px; font-size: 13px; }
textarea.input { resize: vertical; }
.checkbox-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; background: var(--card-alt); font-size: 13px; }
.checkbox-pill input { width: 16px; height: 16px; accent-color: var(--emerald); }
input[type=checkbox] { accent-color: var(--emerald); width: 16px; height: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid.cols-4 { grid-template-columns: repeat(4, 1fr); align-items: end; }
.form-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.form-field label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.form-field.full, .full { grid-column: 1 / -1; }
.seg { display: flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 14px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px; cursor: pointer; font-weight: 600; color: var(--text-muted); }
.seg button.on { background: var(--emerald); color: #04121c; }

/* ---------- Cartes, grilles ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 23px; letter-spacing: -.01em; }
.page-head p { margin: 3px 0 0; }
.section-title { font-size: 15px; font-weight: 700; margin: 22px 0 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-asym { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 14px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card-alt { background: var(--card-alt); box-shadow: none; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.card-title { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.card-sub { margin: 0; color: var(--text-muted); font-size: 12.5px; }
.sub-title { font-size: 13.5px; margin: 10px 0 8px; font-weight: 700; }
.kpi-card { text-align: left; background: var(--card); border: 1px solid var(--border); border-top: 3px solid var(--emerald); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); color: var(--text); font: inherit; width: 100%; }
.kpi-card.click { cursor: pointer; } .kpi-card.click:hover { border-color: var(--border-strong); }
.kpi-emerald { border-top-color: var(--emerald); } .kpi-sky { border-top-color: var(--sky); } .kpi-gold { border-top-color: var(--gold); } .kpi-violet { border-top-color: var(--violet); } .kpi-rose { border-top-color: var(--rose); } .kpi-slate { border-top-color: var(--text-dim); }
.kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 700; }
.kpi-value { font-size: 22px; font-weight: 800; margin-top: 4px; letter-spacing: -.01em; }
.kpi-foot { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.creditor-card.selected { border-color: var(--rose); background: var(--card-alt); }
.scope-card { text-align: left; border-top: 3px solid; cursor: pointer; font: inherit; color: var(--text); }
.scope-card.selected { background: var(--card-alt); border-color: var(--border-strong); }
.scope-card .big { font-size: 20px; font-weight: 800; margin: 4px 0; }
.mini-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.mini-kpis > div { background: var(--card-alt); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; }
.mini-kpis span { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.mini-kpis b { font-size: 17px; margin-top: 2px; }
.mini-kpis small { color: var(--text-muted); font-size: 11.5px; }
.mini-kpis .hl { border-color: var(--emerald); background: var(--emerald-bg); }
.info-box { background: var(--sky-bg); border: 1px solid var(--border); border-left: 3px solid var(--sky); border-radius: var(--radius-sm); padding: 11px 14px; font-size: 13px; }
.empty { padding: 26px; text-align: center; color: var(--text-muted); }
.muted-card { opacity: .65; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge-emerald { background: var(--emerald-bg); color: var(--emerald); } .badge-gold { background: var(--gold-bg); color: var(--gold); }
.badge-sky { background: var(--sky-bg); color: var(--sky); } .badge-violet { background: var(--violet-bg); color: var(--violet); }
.badge-rose { background: var(--rose-bg); color: var(--rose); } .badge-slate { background: var(--slate-bg); color: var(--text-muted); }

/* ---------- Tableaux, listes ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 700; }
td.num, th.num { text-align: right; }
tr.click, .click { cursor: pointer; }
tr.click:hover td, .list-row.click:hover, .bridge-row.click:hover { background: var(--hover); }
tr.total td, tfoot td { font-weight: 700; border-top: 2px solid var(--border-strong); }
tr.total.big td { font-size: 16px; color: var(--emerald); }
tr.sub td { color: var(--text-muted); font-size: 13px; }
tr.group-row td { background: var(--card-alt); font-weight: 700; font-size: 12px; text-transform: uppercase; color: var(--text-muted); letter-spacing: .04em; }
tr.off td { opacity: .5; text-decoration: line-through; }
.list { display: flex; flex-direction: column; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.bridge-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 10px; border-bottom: 1px dashed var(--border); }
.bridge-row span small { display: block; font-size: 11.5px; }
.bridge-row.total { font-weight: 700; border-bottom-style: solid; }
.bridge-row.highlight { background: var(--emerald-bg); border-radius: var(--radius-sm); border-bottom: 0; font-weight: 700; margin-top: 4px; }
.cat-section-head { font-size: 11px; text-transform: uppercase; color: var(--text-dim); font-weight: 700; margin: 12px 0 2px; letter-spacing: .05em; }
.cat-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.pagination { display: flex; gap: 4px; justify-content: center; padding: 10px; flex-wrap: wrap; }
.page-btn { border: 1px solid var(--border); background: var(--card); border-radius: 7px; padding: 3px 9px; cursor: pointer; }
.page-btn.active { background: var(--emerald); color: #04121c; border-color: var(--emerald); }

/* ---------- Opérations ---------- */
.filter-card { padding: 14px; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-bar > .input, .filter-bar > .select { flex: 1 1 160px; width: auto; }
.filter-bar .search { flex: 3 1 280px; }
.totals-bar { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--text-muted); }
.bulk-bar { position: sticky; top: 108px; z-index: 20; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--violet-bg); border: 1px solid var(--violet); backdrop-filter: blur(10px); border-radius: var(--radius); padding: 10px 14px; margin-top: 12px; }
.bulk-bar .select { width: auto; max-width: 320px; }
.op-list { padding: 0 6px; margin-top: 12px; }
.day-group-header { display: flex; justify-content: space-between; padding: 14px 10px 6px; font-size: 12px; color: var(--text-muted); font-weight: 700; text-transform: capitalize; border-bottom: 1px solid var(--border); }
.op-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-bottom: 1px solid var(--border); cursor: pointer; }
.op-row:hover { background: var(--hover); }
.op-row.sel { background: var(--violet-bg); }
.op-row-body { flex: 1; min-width: 0; }
.op-row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-row-meta { font-size: 12.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-row-amt { font-weight: 700; }

/* ---------- Comptes ---------- */
.account-card-head { display: flex; justify-content: space-between; align-items: flex-start; }
.account-card-head h3 { margin: 0; font-size: 16px; }
.account-card-bal { font-size: 26px; font-weight: 800; margin: 8px 0 2px; }
.recon { margin: 10px 0; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; }
.recon-ok { background: var(--emerald-bg); color: var(--emerald); }
.recon-gap { background: var(--gold-bg); color: var(--gold); }
.recon .small { font-weight: 400; color: var(--text-muted); }
.account-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.bridge { margin-top: 12px; }

/* ---------- Accueil ---------- */
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut { width: 170px; height: 170px; flex: none; }
.donut-lbl { fill: var(--text-muted); font-size: 11px; }
.donut-val { fill: var(--text); font-size: 17px; font-weight: 800; }
.legend-list { flex: 1; min-width: 220px; }
.legend-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.legend-row[data-go] { cursor: pointer; }
.legend-row span:nth-child(2) { flex: 1; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.scope-flow { padding: 8px 0; border-bottom: 1px solid var(--border); }
.scope-flow:last-child { border: 0; }
.bar-track { display: block; height: 8px; background: var(--card-alt); border-radius: 5px; overflow: hidden; margin: 4px 0; }
.bar-track.thin { height: 6px; margin: 3px 0; }
.bar-fill { display: block; height: 100%; border-radius: 5px; }
.alert-item { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--gold); border-radius: var(--radius-sm); padding: 12px 14px; }
.alert-rose { border-left-color: var(--rose); } .alert-sky { border-left-color: var(--sky); } .alert-gold { border-left-color: var(--gold); }
.alert-title { font-weight: 700; margin-bottom: 3px; }
.todo-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border); }
.todo-left { display: flex; gap: 10px; align-items: center; cursor: pointer; flex: 1; }
.todo-item.done span { text-decoration: line-through; color: var(--text-muted); }
.hbars { display: flex; flex-direction: column; gap: 6px; }
.hbar-row { display: grid; grid-template-columns: minmax(120px, 2fr) 3fr auto; gap: 10px; align-items: center; }
.hbar-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid-line { stroke: var(--border); } .chart .axis { fill: var(--text-dim); font-size: 10px; }
.chart .bar-in, .chart-legend .bar-in { fill: var(--emerald); background: var(--emerald); } .chart .bar-out, .chart-legend .bar-out { fill: var(--rose); background: var(--rose); opacity: .85; }
.chart .line { fill: none; stroke: var(--emerald); stroke-width: 2.5; } .chart .dot { fill: var(--emerald); }
.chart-legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); margin-top: 6px; flex-wrap: wrap; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.period-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.period-pill, .subtab-btn { border: 1px solid var(--border); background: var(--card); color: var(--text-muted); border-radius: 20px; padding: 6px 13px; cursor: pointer; font-weight: 600; font-size: 13px; }
.period-pill.active, .subtab-btn.active { background: var(--emerald); color: #04121c; border-color: var(--emerald); }
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 12px; }
.progress-track { height: 8px; background: var(--card-alt); border-radius: 5px; overflow: hidden; margin: 6px 0 4px; }
.progress-fill { display: block; height: 100%; background: var(--emerald); } .progress-fill.over { background: var(--rose); }
details > summary { cursor: pointer; list-style: revert; }
.bilan td:first-child { width: 70%; }

/* ---------- Fenêtres ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(2,6,23,.6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--card); border: 1px solid var(--border-strong); border-radius: 16px; width: 100%; max-width: 620px; max-height: 92vh; overflow: auto; padding: 20px; box-shadow: var(--shadow); }
.modal-wide { max-width: 900px; }
.modal-actions { display: flex; gap: 8px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.menu-item { display: flex; gap: 10px; align-items: center; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-weight: 600; }
.menu-item.active { border-color: var(--emerald); color: var(--emerald); }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 140%); opacity: 0; visibility: hidden; z-index: 80; background: #0f172a; color: #f1f5f9; border: 1px solid var(--border-strong); border-radius: 12px; padding: 11px 16px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow); transition: transform .25s; max-width: 92vw; }
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.toast-error { border-color: var(--rose); }
.toast-btn { background: transparent; border: 0; color: var(--emerald); font-weight: 700; cursor: pointer; }

/* ---------- Accès ---------- */
.lock-overlay { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, rgba(16,185,129,.18), transparent 50%), var(--bg); padding: 16px; overflow: auto; }
.lock-card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 28px; width: min(380px, 100%); text-align: center; box-shadow: var(--shadow); }
.lock-title { font-size: 20px; margin: 12px 0 2px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; text-align: left; margin-top: 16px; }
.auth-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text-muted); font-weight: 600; }
.auth-err { color: var(--rose); font-size: 13px; font-weight: 600; }
.pin-input { text-align: center; font-size: 24px; letter-spacing: 10px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.key { padding: 13px; font-size: 20px; font-weight: 700; border-radius: 12px; border: 1px solid var(--border); background: var(--card-alt); cursor: pointer; }
.key:active { background: var(--emerald-bg); }

/* ---------- Navigation mobile ---------- */
.bottom-nav { display: none; }
@media (max-width: 1100px) { .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .header-pills { display: none; } }
@media (max-width: 760px) {
  .tabs-nav { display: none; }
  .topbar-row { padding: 8px 0; }
  .brand-text, .btn-partner { font-size: 0; }
  .btn-partner::before { content: "🤝"; font-size: 15px; }
  .brand-text { display: none; }
  .header-actions { margin-left: auto; }
  .hide-m { display: none !important; }
  .container { padding: 16px 12px 110px; }
  .grid-2, .grid-3, .grid-4, .grid-5, .grid-asym, .form-grid, .form-grid.cols-4 { grid-template-columns: 1fr; }
  .grid-4, .grid-5 { grid-template-columns: 1fr 1fr; }
  .kpi-value { font-size: 18px; }
  .card { padding: 14px; }
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 45; background: var(--bg-elev); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .bn-item { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 10.5px; color: var(--text-muted); background: none; border: 0; padding: 4px 6px; min-width: 54px; cursor: pointer; font-weight: 600; }
  .bn-item span { font-size: 18px; }
  .bn-item.active { color: var(--emerald); }
  .bn-add { background: var(--emerald); color: #04121c; border-radius: 50%; width: 50px; height: 50px; min-width: 50px; font-size: 26px; margin-top: -18px; box-shadow: 0 6px 18px rgba(16,185,129,.4); justify-content: center; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { border-radius: 18px 18px 0 0; max-height: 94vh; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .bulk-bar { top: 64px; }
  .hbar-row { grid-template-columns: 1fr 1fr auto; }
  .project-card .table-wrap table, .table-wrap table.wide { min-width: 640px; }
}
@media print {
  .topbar, .bottom-nav, .partner-banner, .btn, .toast { display: none !important; }
  body, .card { background: #fff !important; color: #000 !important; box-shadow: none !important; }
}
