/* ============================================================
   NÚCLEO — Fondo Familiar
   Instrumento doméstico de control (AGENTS §9 · SPEC §18-§19)
   Paleta restringida · mobile-first · cifras tabulares
   ============================================================ */

:root {
  --paper: #F2EBDD;
  --ink: #2B2925;
  --muted: #6A6257;
  --surface: #C9B99A;
  --accent: #B85C38;

  --ink-08: rgba(43, 41, 37, .08);
  --ink-14: rgba(43, 41, 37, .14);
  --ink-24: rgba(43, 41, 37, .24);
  --ink-40: rgba(43, 41, 37, .40);
  --paper-70: rgba(242, 235, 221, .70);

  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 5px;
  --shadow-plate: 0 1px 0 rgba(43, 41, 37, .06), 0 10px 24px -18px rgba(43, 41, 37, .55);
  --shadow-sheet: 0 -8px 40px -18px rgba(43, 41, 37, .55);
  --shadow-fab: 0 6px 18px -8px rgba(43, 41, 37, .55);
  --nav-h: 62px;
  --top-h: 52px;
  --gutter: 16px;
  --maxw: 640px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
  min-height: 100dvh;
  overflow-wrap: break-word;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper);
  padding: 10px 14px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }
::selection { background: var(--surface); }

.texture {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .17 0 0 0 0 .16 0 0 0 0 .14 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- tipografía utilitaria ---------- */
.num { font-variant-numeric: tabular-nums; }
.label {
  font-size: 11px; font-weight: 600; letter-spacing: .13em;
  text-transform: uppercase; color: var(--muted);
}
.sub { font-size: 13px; color: var(--muted); }
.tiny { font-size: 12px; color: var(--muted); }
.strong { font-weight: 650; }
.accent { color: var(--accent); }
.center { text-align: center; }
.hide { display: none !important; }

/* ---------- estructura de la app ---------- */
.app { position: relative; z-index: 1; min-height: 100dvh; display: flex; flex-direction: column; }

.boot {
  flex: 1; display: flex; flex-direction: column; gap: 14px;
  align-items: center; justify-content: center; color: var(--muted);
}
.boot-mark { font-size: 13px; font-weight: 700; letter-spacing: .5em; text-indent: .5em; }
.boot-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: led 1.1s ease-in-out infinite; }
@keyframes led { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* ---------- barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--top-h);
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 0 var(--gutter);
  background: var(--paper);
  border-bottom: 1px solid var(--ink-14);
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark {
  font-size: 13px; font-weight: 800; letter-spacing: .34em; text-indent: .1em;
}
.led {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(184, 92, 56, .8);
  flex: none;
}
.led.is-off { background: var(--ink-40); box-shadow: none; }
.topbar-right { display: flex; align-items: center; gap: 4px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--radius);
  color: var(--muted);
}
.icon-btn:hover { background: var(--ink-08); color: var(--ink); }
.who {
  font-size: 11px; font-weight: 650; letter-spacing: .06em;
  color: var(--muted); text-transform: uppercase;
  padding: 0 4px; max-width: 110px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- contenido ---------- */
.main {
  flex: 1;
  width: 100%; max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--gutter) var(--gutter) calc(var(--nav-h) + 34px);
}
.view-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 2px 0 12px; }
.view-title { font-size: 13px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }

/* ---------- selector de período ---------- */
.period {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-bottom: 14px;
}
.period-btn {
  width: 36px; height: 34px; border: 1px solid var(--ink-14);
  border-radius: var(--radius); background: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink);
}
.period-btn:hover { background: var(--ink-08); }
.period-label {
  min-width: 168px; text-align: center;
  font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
}
.period-label .sub { display: block; font-size: 10px; letter-spacing: .1em; margin-top: 1px; }

/* ---------- placas ---------- */
.plate {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--ink-24);
  border-radius: var(--radius);
  box-shadow: var(--shadow-plate);
  padding: 16px;
  margin-bottom: 14px;
}
.plate::before, .plate::after {
  content: ""; position: absolute; width: 7px; height: 7px;
  border-color: var(--ink-40); border-style: solid; opacity: .55;
}
.plate::before { top: 5px; left: 5px; border-width: 1px 0 0 1px; }
.plate::after { bottom: 5px; right: 5px; border-width: 0 1px 1px 0; }
.plate-title {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 10px;
}
.plate-flush { padding: 0; overflow: hidden; }

/* ---------- hero: placa del fondo ---------- */
.hero { padding: 20px 18px 18px; }
.hero-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.hero-brand { font-size: 12px; font-weight: 800; letter-spacing: .42em; text-indent: .42em; }
.hero-block { text-align: center; padding: 4px 0 14px; }
.hero-amount {
  font-size: clamp(34px, 10vw, 46px);
  font-weight: 750; letter-spacing: -.015em; line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.hero-amount .cur { font-size: .5em; font-weight: 650; color: var(--muted); vertical-align: .32em; margin-right: .12em; }
.hero-rule { height: 1px; background: var(--ink-14); margin: 4px 0 14px; }
.hero-split { display: flex; gap: 12px; }
.hero-cell { flex: 1; min-width: 0; }
.hero-cell + .hero-cell { border-left: 1px solid var(--ink-14); padding-left: 12px; }
.hero-cell .label { display: block; margin-bottom: 6px; }
.hero-value {
  font-size: 22px; font-weight: 720; font-variant-numeric: tabular-nums;
}
.hero-value small { font-size: 12px; font-weight: 650; color: var(--muted); }
.hero-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--ink-24);
}
.month-state { display: flex; align-items: center; gap: 8px; }

/* ---------- acciones rápidas ---------- */
.actions { display: flex; gap: 10px; margin-bottom: 16px; }
.actions .btn { flex: 1; }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 42px; padding: 0 16px;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  border: 1px solid transparent;
  transition: background-color .15s, color .15s, border-color .15s, transform .05s;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #1e1c19; }
.btn-accent { background: var(--accent); color: var(--paper); }
.btn-accent:hover { background: #a3502f; }
.btn-ghost { border-color: var(--ink-24); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink-08); }
.btn-quiet { color: var(--muted); min-height: 36px; padding: 0 10px; font-size: 12px; }
.btn-quiet:hover { color: var(--ink); background: var(--ink-08); }
.btn-danger { border-color: var(--accent); color: var(--accent); background: transparent; }
.btn-danger:hover { background: rgba(184, 92, 56, .08); }
.btn-sm { min-height: 34px; padding: 0 11px; font-size: 11.5px; }
.btn-block { width: 100%; }

/* ---------- listas / filas ---------- */
.rows { border-top: 1px solid var(--ink-14); }
.row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  padding: 11px 2px;
  border-bottom: 1px solid var(--ink-08);
}
.row:hover { background: rgba(43, 41, 37, .03); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 640; font-size: 14.5px; }
.row-meta { font-size: 12px; color: var(--muted); margin-top: 1px; }
.row-end { text-align: right; flex: none; }
.row-amount { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14.5px; }
.row-date {
  flex: none; width: 44px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.row-date .d { font-size: 16px; font-weight: 720; line-height: 1.1; }
.row-date .m { font-size: 9.5px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.row.is-inactive { opacity: .55; }

/* ---------- chips / etiquetas grabadas ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 7px;
  border: 1px solid var(--ink-24); border-radius: 3px;
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap;
}
.chip.is-accent { border-color: var(--accent); color: var(--accent); }
.chip.is-ink { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip.is-soft { background: rgba(201, 185, 154, .35); }

/* ---------- barras finas de reparto ---------- */
.share { margin-top: 6px; }
.share-line { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.share-line + .share-line { border-top: 1px dashed var(--ink-14); }
.share-name { flex: 1; min-width: 0; font-size: 13.5px; }
.share-track {
  flex: 1.2; height: 5px; background: var(--ink-08); border-radius: 3px; overflow: hidden;
}
.share-fill { height: 100%; background: var(--ink-40); border-radius: 3px; }
.share-amount { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- estados de aporte ---------- */
.member-line { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.member-line + .member-line { border-top: 1px dashed var(--ink-14); }
.member-dot {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--ink-40);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: var(--muted); flex: none;
}
.member-dot.is-done { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.member-dot.is-part { border-color: var(--accent); color: var(--accent); }
.member-name { flex: 1; min-width: 0; font-weight: 620; font-size: 14px; }
.member-state { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.member-state.is-done { color: var(--accent); }
.member-figures { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- próximos ---------- */
.upcoming-line { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.upcoming-line + .upcoming-line { border-top: 1px dashed var(--ink-14); }
.upcoming-when {
  flex: none; width: 58px; font-size: 11px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.upcoming-what { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 620; }
.upcoming-amt { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- banner ---------- */
.banner {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px; margin-bottom: 14px;
  border: 1px solid var(--ink-24); border-left: 3px solid var(--ink);
  border-radius: var(--radius);
  background: rgba(201, 185, 154, .3);
  font-size: 13.5px;
}
.banner.is-closed { border-left-color: var(--accent); }
.banner .btn { margin-left: auto; flex: none; }

/* ---------- filtros ---------- */
.filters { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; }
.search {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 11px;
  border: 1px solid var(--ink-24); border-radius: var(--radius);
  background: rgba(255, 255, 255, .35);
}
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 14px; }
.search:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.search svg { flex: none; color: var(--muted); }
.filter-btn {
  height: 40px; padding: 0 13px;
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--ink-24); border-radius: var(--radius);
  font-size: 12.5px; font-weight: 650;
}
.filter-btn.has-filter { border-color: var(--accent); color: var(--accent); }
.list-meta {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 8px 2px; font-size: 12px; color: var(--muted);
  font-variant-numeric: tabular-nums;
  border-top: 1px solid var(--ink-14);
}

/* ---------- estados vacíos / carga ---------- */
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty-title { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.empty-hint { font-size: 13px; margin-top: 6px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 42px 0; color: var(--muted); font-size: 13px; }
.spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--ink-24); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- navegación inferior ---------- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: var(--paper);
  border-top: 1px solid var(--ink-24);
  box-shadow: 0 -10px 24px -20px rgba(43, 41, 37, .6);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--muted); font-size: 10px; font-weight: 650;
  letter-spacing: .06em; text-transform: uppercase;
  border-top: 2px solid transparent; margin-top: -1px;
}
.nav-item svg { width: 20px; height: 20px; }
.nav-item.is-active { color: var(--ink); border-top-color: var(--accent); }
.nav-item.is-active svg { color: var(--accent); }

/* ---------- acción flotante ---------- */
.fab {
  position: fixed; right: 16px; z-index: 35;
  bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom));
  min-height: 48px; padding: 0 18px;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: var(--paper);
  border-radius: var(--radius);
  font-size: 13px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase;
  box-shadow: var(--shadow-fab);
}
.fab:active { transform: translateY(1px); }

/* ---------- menú hoja (Más) ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(43, 41, 37, .42);
  opacity: 0; transition: opacity .18s ease;
}
.sheet-backdrop.is-open { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51;
  max-height: 88dvh; display: flex; flex-direction: column;
  background: var(--paper);
  border-top: 1px solid var(--ink-24);
  border-radius: 12px 12px 0 0;
  box-shadow: var(--shadow-sheet);
  transform: translateY(102%);
  transition: transform .22s cubic-bezier(.3, .7, .3, 1);
}
.sheet.is-open { transform: translateY(0); }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--ink-24); margin: 9px auto 3px; flex: none; }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px var(--gutter) 10px;
  border-bottom: 1px solid var(--ink-14);
}
.sheet-title { font-size: 12.5px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.sheet-body { padding: 14px var(--gutter) calc(18px + env(safe-area-inset-bottom)); overflow-y: auto; }
.sheet-nav { display: flex; flex-direction: column; gap: 2px; }
.sheet-nav .row { border-bottom: 1px dashed var(--ink-14); padding: 13px 2px; }
.sheet-nav .row:last-child { border-bottom: 0; }

/* ---------- formularios ---------- */
.form-grid { display: flex; flex-direction: column; gap: 13px; }
.field label, .field .seg-label { display: block; margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 11px;
  border: 1px solid var(--ink-24); border-radius: var(--radius);
  background: rgba(255, 255, 255, .4);
  font-size: 15px;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); }
.field input.num, .field input[inputmode="decimal"] { font-variant-numeric: tabular-nums; }
.field textarea { min-height: 74px; resize: vertical; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236A6257' stroke-width='1.6' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.field .err { display: none; margin-top: 4px; font-size: 12.5px; color: var(--accent); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--accent); }
.field.has-error .err { display: block; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; min-width: 0; }
.form-note { font-size: 12.5px; color: var(--muted); }
.form-actions { display: flex; gap: 10px; margin-top: 4px; }
.form-actions .btn { flex: 1; }

.seg { display: flex; border: 1px solid var(--ink-24); border-radius: var(--radius); overflow: hidden; }
.seg button {
  flex: 1; min-height: 40px;
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}
.seg button + button { border-left: 1px solid var(--ink-24); }
.seg button.is-on { background: var(--ink); color: var(--paper); }

.override {
  border: 1px solid var(--accent); border-radius: var(--radius);
  padding: 12px; margin-top: 4px;
  background: rgba(184, 92, 56, .06);
}
.override p { font-size: 13px; margin-bottom: 10px; }

.confirm-text { font-size: 14px; line-height: 1.5; margin-bottom: 14px; }
.confirm-text strong { font-variant-numeric: tabular-nums; }

/* ---------- toasts ---------- */
.toast-root {
  position: fixed; left: 0; right: 0; z-index: 70;
  bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; padding: 0 14px;
}
.toast {
  max-width: 440px; width: 100%;
  padding: 11px 14px;
  background: var(--ink); color: var(--paper);
  border-radius: var(--radius);
  font-size: 13.5px; font-weight: 600;
  box-shadow: 0 10px 26px -14px rgba(43, 41, 37, .8);
  animation: toast-in .18s ease;
}
.toast.is-error { background: var(--accent); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- login ---------- */
.login-wrap {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: 24px var(--gutter);
}
.login-plate { width: 100%; max-width: 380px; text-align: center; padding: 30px 24px 26px; }
.login-mark {
  font-size: 17px; font-weight: 800; letter-spacing: .5em; text-indent: .5em;
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.login-sub { margin-top: 6px; font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.login-form { margin-top: 24px; text-align: left; }
.login-form .btn { margin-top: 16px; }
.login-foot { margin-top: 18px; font-size: 12px; color: var(--muted); }

/* ---------- secciones ---------- */
.section { margin-bottom: 18px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 8px;
}
.section-head .label { position: relative; padding-bottom: 5px; }
.kv-line { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 14px; }
.kv-line + .kv-line { border-top: 1px dashed var(--ink-14); }
.kv-line .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.kv-total { border-top: 1px solid var(--ink-24); margin-top: 3px; padding-top: 9px; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-bottom: 12px; }
.detail-grid .label { display: block; margin-bottom: 2px; }
.detail-grid .v { font-size: 14.5px; font-weight: 650; }

/* ---------- ocurrencias ---------- */
.occ-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.occ-line + .occ-line { border-top: 1px dashed var(--ink-14); }
.occ-when { flex: none; width: 74px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); }
.occ-main { flex: 1; min-width: 0; }
.occ-amt { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.occ-actions { display: flex; gap: 6px; flex: none; }

/* ---------- escritorio ---------- */
.sidebar { display: none; }

@media (min-width: 960px) {
  :root { --gutter: 24px; }
  .app { flex-direction: row; }
  .topbar { position: fixed; top: 0; left: 0; right: 0; }
  .sidebar {
    display: flex; flex-direction: column; gap: 2px;
    position: fixed; top: var(--top-h); bottom: 0; left: 0; z-index: 30;
    width: 216px; padding: 18px 12px;
    background: var(--paper);
    border-right: 1px solid var(--ink-14);
  }
  .side-item {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px; border-radius: var(--radius);
    color: var(--muted); font-size: 13px; font-weight: 650;
    letter-spacing: .05em; text-transform: uppercase;
    text-align: left; text-decoration: none;
  }
  .side-item svg { width: 18px; height: 18px; }
  .side-item:hover { background: var(--ink-08); color: var(--ink); }
  .side-item.is-active { background: var(--ink); color: var(--paper); }
  .side-sep { flex: 1; }
  .main { margin-left: 216px; max-width: calc(var(--maxw) + 40px); padding-bottom: 40px; padding-top: calc(var(--top-h) + var(--gutter)); }
  .bottomnav { display: none; }
  .fab { bottom: 26px; right: 28px; }
  .toast-root { bottom: 24px; }
  .sheet {
    left: 50%; right: auto; bottom: auto; top: 50%;
    width: 480px; max-height: 86dvh;
    border: 1px solid var(--ink-24); border-radius: 8px;
    transform: translate(-50%, -46%) scale(.98); opacity: 0;
    transition: transform .18s ease, opacity .18s ease;
  }
  .sheet.is-open { transform: translate(-50%, -50%); opacity: 1; }
  .sheet-grip { display: none; }
  .hero-amount { font-size: 48px; }
}

@media (min-width: 1180px) {
  .dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; align-items: start; }
  .dash-grid .section-hero { grid-column: 1 / -1; }
  .main { max-width: 960px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
