/* Billix Evo — esprit Nexikos/Zeus : anthracite, bentos, bleu discret, clair/sombre. */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e2e5ea;
  --text: #1f2329;
  --muted: #6b7280;
  --accent: #2453d6;
  --accent-soft: #e8eefc;
  --accent-text: #ffffff;
  --anthracite: #23262d;
  --ok: #1e8e3e;
  --ok-soft: #e4f4e8;
  --warn: #b26a00;
  --warn-soft: #fff3dc;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --info: #475569;
  --info-soft: #eef1f5;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .04);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171c; --surface: #1d2027; --surface-2: #252932; --border: #2f343e; --text: #e8eaee; --muted: #9aa3b2;
    --accent: #7ea2ff; --accent-soft: #233056; --accent-text: #0f1320; --anthracite: #0f1115;
    --ok: #5fd08a; --ok-soft: #173426; --warn: #f2b45c; --warn-soft: #3a2c14; --danger: #ff7b6e; --danger-soft: #3d1d1a; --info: #b4bccb; --info-soft: #262b35;
    --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15171c; --surface: #1d2027; --surface-2: #252932; --border: #2f343e; --text: #e8eaee; --muted: #9aa3b2;
  --accent: #7ea2ff; --accent-soft: #233056; --accent-text: #0f1320; --anthracite: #0f1115;
  --ok: #5fd08a; --ok-soft: #173426; --warn: #f2b45c; --warn-soft: #3a2c14; --danger: #ff7b6e; --danger-soft: #3d1d1a; --info: #b4bccb; --info-soft: #262b35;
  --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.55rem; margin: 0 0 .25rem; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
h3 { font-size: .95rem; margin: .5rem 0; }
code, .mono { font-family: var(--mono); font-size: .85em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.text-danger { color: var(--danger); }
.text-success { color: var(--ok); }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; flex: none; }
.hash { word-break: break-all; }

/* ---------- Barre supérieure ---------- */
.topbar, .sa-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .6rem 1.25rem; background: var(--anthracite); color: #f1f3f6; }
.brand { display: flex; align-items: center; gap: .55rem; color: inherit; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #4f7bff, #2453d6 55%, #1b3a99); color: #fff; font-weight: 800; }
.brand-name em { font-style: normal; color: #8fb0ff; font-weight: 600; }
.public .brand { color: var(--text); }
.mainnav { display: flex; gap: .25rem; flex: 1; overflow-x: auto; }
.mainnav a { display: flex; align-items: center; gap: .4rem; padding: .45rem .75rem; border-radius: 9px; color: #c7ccd6; white-space: nowrap; }
.mainnav a:hover { background: rgba(255,255,255,.07); text-decoration: none; color: #fff; }
.mainnav a.active { background: rgba(126,162,255,.18); color: #fff; }
.topbar-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 1.2rem; }
.icon-btn:hover { background: rgba(127,127,127,.15); }
.avatar { list-style: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #3a3f4b; color: #fff; font-weight: 700; cursor: pointer; }
.avatar::-webkit-details-marker { display: none; }

/* ---------- Menus déroulants ---------- */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: .35rem; z-index: 30; display: flex; flex-direction: column; }
.menu-panel a, .menu-panel .linklike { display: block; width: 100%; text-align: left; padding: .45rem .6rem; border-radius: 7px; color: var(--text); }
.menu-panel a:hover, .menu-panel .linklike:hover { background: var(--surface-2); text-decoration: none; }
.menu-panel form { margin: 0; }
.menu-panel .stack { padding: .3rem .6rem; }
.menu-head { padding: .45rem .6rem; border-bottom: 1px solid var(--border); margin-bottom: .25rem; display: flex; flex-direction: column; }
.menu-langs { display: flex; gap: .25rem; padding: .35rem .6rem; }
.menu-langs a { padding: .15rem .45rem; width: auto; font-size: .8rem; }
.menu-langs a.active, .langs a.active { background: var(--accent-soft); color: var(--accent); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.linklike.danger { color: var(--danger) !important; }

/* ---------- Mise en page ---------- */
.container { max-width: 1240px; margin: 0 auto; padding: 1.25rem 1.25rem 5rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head p { margin: .1rem 0 0; }
.row-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.row-actions form { margin: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; align-items: start; }
.stack { display: flex; flex-direction: column; gap: .75rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.empty { text-align: center; padding: 2.5rem 1rem; }

/* ---------- Bentos ---------- */
.bentos { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .85rem; margin-bottom: 1rem; }
.bentos-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.bento { display: flex; flex-direction: column; gap: .3rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); color: var(--text); }
a.bento:hover { border-color: var(--accent); text-decoration: none; }
.stat-label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 1.9rem; font-weight: 750; letter-spacing: -.02em; }
.stat-value.small { font-size: 1rem; }
.money-value { font-size: 1.25rem; font-weight: 700; }
.stat-alert { border-color: var(--danger); background: var(--danger-soft); }
.bento.plan.current { border-color: var(--accent); }
.swatch { width: 100%; height: 6px; border-radius: 6px; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; gap: .4rem; justify-content: center; border: 1px solid transparent; border-radius: 10px; padding: .55rem .95rem; font: 600 .92rem var(--font); cursor: pointer; background: var(--surface-2); color: var(--text); text-decoration: none; white-space: nowrap; }
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.topbar .btn-ghost, .sa-top .btn-ghost { color: #e5e8ee; border-color: rgba(255,255,255,.2); }
.btn-warning { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.btn-danger-ghost { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-sm { padding: .4rem .7rem; font-size: .85rem; }
.btn-xs { padding: .2rem .5rem; font-size: .8rem; border-radius: 7px; }
.btn-lg { padding: .8rem 1.3rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* ---------- Formulaires ---------- */
label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; font-weight: 600; color: var(--text); }
label.check, label.switch { flex-direction: row; align-items: center; gap: .5rem; font-weight: 500; }
label.switch { flex-wrap: wrap; }
label.switch small { flex-basis: 100%; font-weight: 400; }
label.inline { flex-direction: row; align-items: center; gap: .35rem; font-weight: 500; }
input, select, textarea { font: 400 .95rem var(--font); color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: .55rem .7rem; width: 100%; min-width: 0; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); }
input[type="color"] { padding: .15rem; height: 40px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
input[readonly] { background: var(--surface-2); }
textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem 1rem; }
.span2, .form-grid > h2, .form-grid > .row-actions { grid-column: 1 / -1; }
fieldset { border: 0; margin: 0; padding: 0; }
fieldset.seg { display: flex; gap: 1rem; }
fieldset.checks { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
legend { font-weight: 700; margin-bottom: .4rem; }
.field-error { color: var(--danger); font-size: .8rem; font-weight: 500; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.filters input[type="search"] { max-width: 260px; }
.filters select { width: auto; }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.inline-form select, .inline-form input { width: auto; flex: 1 1 160px; }
details.more > summary { cursor: pointer; color: var(--accent); font-weight: 600; padding: .25rem 0; }
details.more[open] > summary { margin-bottom: .75rem; }
.w-sm { max-width: 110px; }
.notice { background: var(--info-soft); border-radius: 9px; padding: .6rem .8rem; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th, .table td { padding: .6rem .7rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; }
.table.compact td, .table.compact th { padding: .4rem .5rem; font-size: .9rem; }
.table tr:hover td { background: var(--surface-2); }
.table tfoot td { font-weight: 600; }
.table tfoot tr.grand td { font-size: 1.05rem; color: var(--accent); }
.num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.actions { text-align: right; white-space: nowrap; }
.row-overdue td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
tr.voided td { text-decoration: line-through; color: var(--muted); }
.table-wrap > .table { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: .12rem .5rem; border-radius: 999px; font-size: .74rem; font-weight: 700; letter-spacing: .02em; background: var(--info-soft); color: var(--info); vertical-align: middle; white-space: nowrap; }
.badge-draft { background: var(--surface-2); color: var(--muted); }
.badge-sent, .badge-viewed { background: var(--accent-soft); color: var(--accent); }
.badge-partial { background: var(--warn-soft); color: var(--warn); }
.badge-paid, .badge-mail-sent, .badge-health-ok { background: var(--ok-soft); color: var(--ok); }
.badge-overdue, .badge-mail-failed, .badge-health-error { background: var(--danger-soft); color: var(--danger); }
.badge-cancelled { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
.badge-credit_note { background: #efe7fb; color: #6a3fb5; }
.badge-mail-stub, .badge-health-warning { background: var(--warn-soft); color: var(--warn); }
.badge-health-info { background: var(--info-soft); color: var(--info); }
.badge-mode-complimentary { background: var(--ok-soft); color: var(--ok); }
.badge-mode-stripe { background: var(--accent-soft); color: var(--accent); }
.fav { color: #e0a800; }
.fav .ico { fill: currentColor; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: .3rem .75rem; cursor: pointer; font: 500 .85rem var(--font); }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.fav-bar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.fav-bar > span { color: var(--muted); font-size: .85rem; display: flex; align-items: center; gap: .3rem; }

/* ---------- Messages ---------- */
.flash { padding: .7rem .9rem; border-radius: 10px; margin-bottom: 1rem; background: var(--info-soft); border: 1px solid transparent; }
.flash ul { margin: .3rem 0 0 1.1rem; padding: 0; }
.flash-success { background: var(--ok-soft); color: var(--ok); }
.flash-error { background: var(--danger-soft); color: var(--danger); }
.flash-warning { background: var(--warn-soft); color: var(--warn); }
.promo { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .5rem 1.25rem; background: var(--accent-soft); color: var(--text); font-size: .9rem; }
.promo form { margin: 0; }

/* ---------- Listes ---------- */
.action-list { list-style: none; margin: 0; padding: 0; }
.action-list li { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.action-list li:last-child { border-bottom: 0; }
.action-list .amount { margin-left: auto; font-weight: 650; font-variant-numeric: tabular-nums; }
.action-list form { margin: 0; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 130px 1fr; gap: .6rem; padding: .4rem 0; border-bottom: 1px dashed var(--border); font-size: .9rem; }
.timeline time { color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline small { display: block; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0 0 1rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; word-break: break-word; }
.notes { background: var(--surface-2); border-radius: 9px; padding: .6rem .8rem; }
.onboarding ol { margin: 0; padding-left: 1.2rem; display: flex; gap: 1.5rem; flex-wrap: wrap; }
.onboarding li.done a { color: var(--ok); }
.checklist { list-style: none; padding: 0; columns: 2; }
.checklist .ok { color: var(--ok); }
.checklist .ko { color: var(--danger); }

/* ---------- Éditeur de facture ---------- */
.lines { width: 100%; border-collapse: collapse; }
.lines th { font-size: .75rem; text-transform: uppercase; color: var(--muted); text-align: left; padding: .3rem .25rem; }
.lines td { padding: .25rem; vertical-align: top; }
.lines .col-desc { width: 40%; }
.lines .col-num { width: 11%; }
.lines .col-unit { width: 8%; }
.lines .col-pct { width: 8%; }
.lines textarea { min-height: 40px; overflow: hidden; }
.lines [data-line-total] { padding-top: .8rem; font-weight: 600; }
.lines-head { display: flex; justify-content: space-between; align-items: baseline; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: .3rem 1.5rem; max-width: 360px; margin: 1rem 0 0 auto; font-variant-numeric: tabular-nums; }
.totals dd { margin: 0; text-align: right; }
.totals .grand { font-size: 1.15rem; font-weight: 750; color: var(--accent); border-top: 1px solid var(--border); padding-top: .35rem; }
.sticky-actions { position: sticky; bottom: 0; display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; padding: .75rem; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(6px); border-top: 1px solid var(--border); z-index: 10; }
.payment-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: .6rem; align-items: end; }
.payment-form .span-all { grid-column: 1 / 5; }
.sig-pad { width: 100%; max-width: 600px; height: 180px; border: 1px dashed var(--border); border-radius: 10px; background: #fff; touch-action: none; }
.sig-preview { max-height: 70px; background: #fff; border-radius: 8px; padding: .3rem; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: .5rem; margin-top: 1rem; }
.thumbs figure { margin: 0; background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 14px 14px; border-radius: 8px; padding: .4rem; text-align: center; }
.thumbs img { max-width: 100%; max-height: 60px; }
.thumbs figcaption { font-size: .72rem; color: var(--muted); }

/* ---------- Onglets ---------- */
.tabs, .sa-view-tabs { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.tabs a, .sa-view-tabs a { padding: .55rem .8rem; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 600; font-size: .9rem; }
.tabs a.active, .sa-view-tabs a.active { color: var(--accent); border-bottom-color: var(--accent); text-decoration: none; }
.sa-view-tabs { background: var(--surface); padding: 0 1.25rem; margin: 0; }
.langs { display: flex; gap: .25rem; }
.langs a { padding: .2rem .5rem; border-radius: 7px; font-size: .8rem; font-weight: 600; color: var(--muted); }

/* ---------- Super console ---------- */
.sa-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; padding: 1rem 0; margin-bottom: .5rem; }
.env { padding: .15rem .55rem; border-radius: 7px; font-size: .75rem; font-weight: 800; background: #3a3f4b; }
.env-prod { background: #1e8e3e; }
.env-ctlq, .env-test { background: #b26a00; }
.access-pill { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 650; background: var(--ok-soft); color: var(--ok); }
.access-pill.warning { background: var(--warn-soft); color: var(--warn); }
.health-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 1rem; }
.health-list { list-style: none; margin: 0; padding: 0; }
.health-list li { display: grid; grid-template-columns: 10px 1fr auto auto; gap: .6rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.health-list .h-title small { display: block; font-size: .78rem; }
.health-list .h-value { font-variant-numeric: tabular-nums; text-align: right; max-width: 220px; overflow-wrap: anywhere; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--info); }
.lvl-ok .dot { background: var(--ok); }
.lvl-warning .dot { background: var(--warn); }
.lvl-error .dot { background: var(--danger); }

/* ---------- Pages publiques ---------- */
.public-top { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; max-width: 1160px; margin: 0 auto; }
.public-actions { display: flex; gap: .75rem; align-items: center; }
.public-main { max-width: 1160px; margin: 0 auto; padding: 1rem 1.5rem 3rem; }
.public-footer { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; padding: 1.5rem; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--border); }
.public-footer .discreet { color: var(--muted); opacity: .7; font-size: .8rem; }
.app-footer { display: flex; justify-content: center; gap: 1.5rem; padding: 1rem; color: var(--muted); font-size: .78rem; }
.swiss { display: inline-block; width: 13px; height: 13px; border-radius: 2px; vertical-align: -1px; background:
  linear-gradient(#fff, #fff) center / 3px 8px no-repeat, linear-gradient(#fff, #fff) center / 8px 3px no-repeat, #d52b1e; }
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2.5rem; align-items: center; padding: 3rem 0 2rem; }
.hero h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.1; letter-spacing: -.03em; }
.lead { font-size: 1.12rem; color: var(--muted); }
.eyebrow { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.hero-cta { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.hero-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 1.5rem; box-shadow: 0 20px 50px rgba(36,83,214,.12); display: flex; flex-direction: column; gap: 1rem; }
.mock-row { display: flex; justify-content: space-between; align-items: center; }
.mock-amount { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.mock-lines i { display: block; height: 9px; border-radius: 6px; background: var(--surface-2); margin: .45rem 0; }
.mock-lines i.short { width: 60%; }
.mock-qr { width: 64px; height: 64px; border-radius: 6px; background: repeating-conic-gradient(var(--text) 0 25%, var(--surface) 0 50%) 0 0 / 12px 12px; opacity: .85; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 2rem 0; }
.flow { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; margin: 2rem 0; }
.flow-step { display: flex; align-items: center; gap: .5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: .4rem .9rem .4rem .4rem; font-weight: 600; }
.flow-step span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-size: .8rem; }
.auth-card { max-width: 420px; margin: 2rem auto; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 1.75rem; box-shadow: var(--shadow); }
.auth-card.wide { max-width: 640px; }
.error-code { font-size: 3rem; font-weight: 800; color: var(--muted); margin: 0; }
.public-doc { max-width: 720px; margin: 1rem auto; }

/* ---------- Navigation mobile ---------- */
.bottomnav { display: none; }
@media (max-width: 900px) {
  .grid-main { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr 1fr; }
  .hero { grid-template-columns: 1fr; padding-top: 1.5rem; }
}
@media (max-width: 720px) {
  body { font-size: 15px; }
  .container { padding: 1rem .9rem 6rem; }
  .topbar { padding: .55rem .9rem; }
  .mainnav { display: none; }
  .hide-sm { display: none !important; }
  .bottomnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--anthracite); padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom)); justify-content: space-around; }
  .bottomnav a { display: flex; flex-direction: column; align-items: center; gap: .1rem; font-size: .68rem; color: #c7ccd6; padding: .25rem .4rem; border-radius: 8px; }
  .bottomnav a.active { color: #fff; background: rgba(126,162,255,.18); }
  .bottomnav a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 68px; }
  .grid2, .form-grid { grid-template-columns: 1fr; }
  .bentos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .bentos-3 { grid-template-columns: 1fr; }
  .bento { padding: .8rem .9rem; }
  .stat-value { font-size: 1.5rem; }
  .features { grid-template-columns: 1fr; }
  .payment-form { grid-template-columns: 1fr 1fr; }
  .payment-form .span-all { grid-column: 1 / -1; }
  .timeline li { grid-template-columns: 1fr; gap: 0; }
  .health-grid { grid-template-columns: 1fr; }
  .health-list li { grid-template-columns: 10px 1fr auto; }
  .health-list .h-value { grid-column: 2 / -1; text-align: left; }
  .sticky-actions { bottom: 58px; justify-content: stretch; }
  .sticky-actions .btn { flex: 1 1 45%; }
  .lines thead { display: none; }
  .lines, .lines tbody, .lines tr, .lines td { display: block; width: 100% !important; }
  .lines tr { border: 1px solid var(--border); border-radius: 10px; padding: .4rem; margin-bottom: .6rem; display: grid; grid-template-columns: 1fr 1fr; gap: .25rem; }
  .lines td:first-child { grid-column: 1 / -1; }
  .lines td::before { content: attr(data-label); display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; }
  .lines td:last-child::before { content: none; }
  .filters input[type="search"] { max-width: none; flex: 1 1 100%; }
  .checklist { columns: 1; }
  .app-footer { padding-bottom: 5rem; }
}
@media print {
  .topbar, .bottomnav, .sticky-actions, .app-footer { display: none; }
}
