/* Censo · Cédula de Microdiagnóstico Familiar — sistema visual
   Minimalista, claro, tonos verde-azulado de salud. */
:root {
  --bg: #f4f7f6;
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --ink: #102320;
  --ink-2: #44554f;
  --muted: #7b8a85;
  --line: #e1e8e5;
  --line-2: #cfd9d5;
  --brand: #0f766e;
  --brand-strong: #0b5c56;
  --brand-soft: #e5f2ef;
  --brand-wash: #f0f8f6;
  --leaf: #4d9a6a;
  --ok: #15803d; --ok-soft: #e7f5ec;
  --warn: #a15c07; --warn-soft: #fdf3dc;
  --bad: #b42318; --bad-soft: #fdecea;
  --idle: #5f6b67; --idle-soft: #eef1f0;
  --men: #2a78d6; --women: #d55181;
  --grid: #e7ece9; --axis: #c3cec9;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 35, 32, .04), 0 4px 16px rgba(16, 35, 32, .05);
  --font: "Inter", "SF Pro Text", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body { min-height: 100vh; min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
h1, h2, h3 { margin: 0; letter-spacing: -0.015em; font-weight: 650; }
h1 { font-size: 1.55rem; line-height: 1.2; }
h2 { font-size: 1.12rem; }
h3 { font-size: .98rem; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ---------- Estructura ---------- */
.app { display: flex; min-height: 100dvh; }
.rail { display: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.2) blur(6px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 12px; height: 58px; padding: 0 16px; max-width: 1240px; margin: 0 auto; width: 100%; }
.brandmark { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.brandmark .logo { width: 32px; height: 32px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; flex: none; }
.brandmark .logo svg { width: 18px; height: 18px; }
.brandmark .t1 { font-weight: 650; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brandmark .t2 { font-size: .74rem; color: var(--muted); white-space: nowrap; }
.topbar .sp { flex: 1; }
.yearpill { white-space: nowrap; flex: none; font-size: .8rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-strong); }
.syncbtn { white-space: nowrap; flex: none; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 11px; font-size: .8rem; color: var(--ink-2); cursor: pointer; }
.syncbtn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.syncbtn.pend .dot { background: #e0a106; }
.syncbtn.off .dot { background: var(--muted); }
.syncbtn.busy .dot { animation: pulse 1s infinite; background: var(--brand); }
@keyframes pulse { 50% { opacity: .25; } }
.content { width: 100%; max-width: 1240px; margin: 0 auto; padding: 20px 16px calc(96px + var(--safe-b)); }
.narrow { max-width: 760px; margin: 0 auto; }

.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 62px; text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 600; }
.bottomnav a svg { width: 22px; height: 22px; }
.bottomnav a.on { color: var(--brand); }
.bottomnav a.fab span.ico { width: 44px; height: 44px; border-radius: 14px; background: var(--brand); color: #fff; display: grid; place-items: center; margin-top: -4px; }
.bottomnav a.fab { color: var(--brand-strong); }

@media (max-width: 420px) { .topbar .brandmark .t2 { display: none; } .topbar-in { gap: 8px; padding: 0 12px; } .yearpill { padding: 4px 8px; } }
@media (min-width: 980px) {
  .rail { display: flex; flex-direction: column; width: 232px; flex: none; border-right: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; height: 100dvh; padding: 18px 14px; gap: 4px; }
  .rail .brandmark { padding: 4px 8px 18px; flex: none; }
  .rail a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 550; font-size: .93rem; }
  .rail a svg { width: 19px; height: 19px; }
  .rail a:hover { background: var(--surface-2); }
  .rail a.on { background: var(--brand-soft); color: var(--brand-strong); }
  .rail .grow { flex: 1; }
  .rail .who { padding: 12px; border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); }
  .rail .who b { display: block; color: var(--ink); font-weight: 600; }
  .bottomnav { display: none; }
  .topbar .brandmark { display: none; }
  .content { padding-bottom: 48px; padding-top: 28px; }
}

/* ---------- Componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 18px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.card-b { padding: 14px 18px 18px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: repeat(3, 1fr); } }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 26px 2px 10px; }
.section-title h2 { font-size: 1.02rem; }
.eyebrow { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 650; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; font-size: .93rem; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--surface-2); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-strong); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--brand-strong); }
.btn.ghost:hover { background: var(--brand-wash); }
.btn.danger { color: var(--bad); border-color: #f1c6c1; }
.btn.sm { height: 36px; padding: 0 12px; font-size: .85rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.iconbtn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid transparent; background: transparent; display: inline-grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.iconbtn:hover { background: var(--surface-2); border-color: var(--line); }
.iconbtn svg { width: 20px; height: 20px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .lbl { font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: .78rem; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; height: 46px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--surface); padding: 0 13px; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 84px; padding: 11px 13px; resize: vertical; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%237b8a85' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 118, 110, .14); }
.input.err { border-color: #e7a59d; }
.input[readonly] { background: var(--surface-2); color: var(--ink-2); }

/* Selección por botones (segmentado) */
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { min-height: 42px; padding: 8px 14px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-weight: 550; font-size: .9rem; color: var(--ink-2); transition: all .12s; }
.seg button:hover { border-color: var(--brand); }
.seg button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.seg.multi button.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-strong); }
.seg.multi button.on::before { content: "✓ "; font-weight: 700; }
.seg.yn button { min-width: 64px; }
.seg.full { display: grid; grid-template-columns: 1fr 1fr; }
.seg.full.three { grid-template-columns: repeat(3, 1fr); }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 11px; overflow: hidden; height: 44px; background: var(--surface); }
.stepper button { width: 42px; height: 100%; border: 0; background: transparent; font-size: 1.2rem; cursor: pointer; color: var(--brand-strong); }
.stepper button:hover { background: var(--brand-wash); }
.stepper input { width: 46px; border: 0; text-align: center; height: 100%; font-weight: 650; outline: none; font-variant-numeric: tabular-nums; }
.stepper .of { padding-right: 10px; color: var(--muted); font-size: .82rem; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 650; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.completa { background: var(--ok-soft); color: var(--ok); }
.badge.por_verificar { background: var(--warn-soft); color: var(--warn); }
.badge.borrador { background: var(--idle-soft); color: var(--idle); }
.badge.local { background: #eef4fc; color: #1d5fae; }
.badge.local::before { display: none; }

.alert { padding: 12px 14px; border-radius: 12px; font-size: .88rem; border: 1px solid; display: flex; gap: 10px; align-items: flex-start; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert.info { background: var(--brand-wash); border-color: #cfe6e1; color: var(--brand-strong); }
.alert.warn { background: var(--warn-soft); border-color: #f2dca8; color: #7a4a06; }
.alert.bad { background: var(--bad-soft); border-color: #f4c9c4; color: var(--bad); }

.divider { height: 1px; background: var(--line); margin: 4px 0; }
.kbd { font-family: ui-monospace, Menlo, monospace; font-size: .82rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }

/* ---------- Inicio ---------- */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.hello p { margin: 4px 0 0; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stat .v { font-size: 1.7rem; font-weight: 650; letter-spacing: -.02em; line-height: 1.1; margin-top: 6px; }
.stat .l { font-size: .78rem; color: var(--muted); font-weight: 600; }
.stat .s { font-size: .78rem; color: var(--ink-2); margin-top: 4px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 20px 0 12px; }
.search { position: relative; flex: 1; min-width: 220px; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.search .input { padding-left: 40px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: .82rem; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .n { opacity: .6; margin-left: 4px; font-variant-numeric: tabular-nums; }

.list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.item { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; cursor: pointer; }
.item:last-child { border-bottom: 0; }
.item:hover { background: var(--surface-2); }
.avatar { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-strong); display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; }
.item .body { flex: 1; min-width: 0; }
.item .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .m { font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .r { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty svg { width: 44px; height: 44px; color: var(--line-2); margin-bottom: 8px; }

/* ---------- Editor de cédula ---------- */
.edhead { position: sticky; top: 58px; z-index: 15; background: var(--bg); padding: 10px 0 12px; margin: -20px -16px 14px; padding-left: 16px; padding-right: 16px; border-bottom: 1px solid var(--line); }
@media (min-width: 980px) { .edhead { margin-top: -28px; top: 58px; } }
.edhead .ttl { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.edhead .ttl .t { flex: 1; min-width: 0; }
.edhead .ttl .t b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.steps button { border: 0; background: transparent; padding: 0; cursor: pointer; text-align: left; color: var(--muted); font-size: .72rem; font-weight: 600; }
.steps button i { display: block; height: 4px; border-radius: 4px; background: var(--line); margin-bottom: 6px; }
.steps button.done i { background: #9fcfc7; }
.steps button.on i { background: var(--brand); }
.steps button.on { color: var(--brand-strong); }
.steps button span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 18px; margin-bottom: 14px; }
.fs > .h { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.fs > .h p { margin: 3px 0 0; font-size: .82rem; color: var(--muted); }
.q { display: flex; flex-direction: column; gap: 8px; }
.q .lbl small { font-weight: 500; color: var(--muted); }
.qrow { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.qrow:last-child { border-bottom: 0; }
.qrow .lbl { font-weight: 550; color: var(--ink); font-size: .9rem; }
.edfoot { position: fixed; left: 0; right: 0; bottom: calc(62px + var(--safe-b)); z-index: 25; background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); }
.edfoot-in { max-width: 760px; margin: 0 auto; display: flex; gap: 10px; padding: 10px 16px; align-items: center; }
.edfoot .saved { flex: 1; font-size: .78rem; color: var(--muted); }
@media (min-width: 980px) { .edfoot { left: 232px; bottom: 0; } }
.ed-pad { height: 70px; }

.member { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.member:hover { border-color: var(--line-2); }
.member > svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.member .avatar.m { background: #e9f1fc; color: #1d5fae; }
.member .avatar.f { background: #fbeaf1; color: #a83864; }
.member .body { flex: 1; min-width: 0; }
.member .t { font-weight: 600; }
.member .m { font-size: .8rem; color: var(--muted); }
.member .warnmini { font-size: .74rem; color: var(--warn); font-weight: 600; }

/* Hoja (modal inferior) */
.sheet-bg { position: fixed; inset: 0; background: rgba(16, 35, 32, .32); z-index: 60; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.sheet { background: var(--bg); width: 100%; max-width: 760px; max-height: 94dvh; border-radius: 20px 20px 0 0; display: flex; flex-direction: column; animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: .6; } }
@media (min-width: 760px) { .sheet-bg { align-items: center; } .sheet { border-radius: 20px; max-height: 90dvh; } }
.sheet-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--surface); border-radius: 20px 20px 0 0; }
.sheet-h h2 { flex: 1; font-size: 1.02rem; }
.sheet-b { overflow-y: auto; padding: 16px; flex: 1; -webkit-overflow-scrolling: touch; }
.sheet-f { display: flex; gap: 10px; padding: 12px 16px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--surface); }
.sheet-f .btn { flex: 1; }
.subsec { font-size: .74rem; letter-spacing: .07em; text-transform: uppercase; color: var(--brand-strong); font-weight: 700; margin: 6px 0 -4px; }

/* Vacunas */
.vacgrid { display: flex; flex-direction: column; gap: 10px; }
.vacrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.vacrow:last-child { border-bottom: 0; }
.vacrow .vn { flex: 1 1 180px; font-size: .88rem; font-weight: 550; }
.vacrow .seg button { min-height: 36px; padding: 5px 11px; font-size: .82rem; }

/* Revisión */
.review dl { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 8px 14px; margin: 0; font-size: .88rem; }
.review dt { color: var(--muted); }
.review dd { margin: 0; font-weight: 550; }
.checklist { margin: 0; padding-left: 18px; font-size: .88rem; color: var(--ink-2); }
.checklist li { margin: 3px 0; }

/* Login */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(180deg, #eef6f4 0%, var(--bg) 60%); }
.auth .card { width: 100%; max-width: 420px; padding: 28px 24px; }
.auth .logo { width: 48px; height: 48px; border-radius: 14px; background: var(--brand); display: grid; place-items: center; margin-bottom: 18px; }
.auth .logo svg { width: 26px; height: 26px; }
.auth h1 { font-size: 1.4rem; }
.auth .sub { color: var(--muted); margin: 6px 0 22px; font-size: .9rem; }

/* ---------- Tablero ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 6px 0 18px; }
.filters .field { flex: 1 1 160px; max-width: 240px; }
.filters .input { height: 40px; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(5, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .l { font-size: .76rem; color: var(--muted); font-weight: 600; }
.kpi .v { font-size: 1.75rem; font-weight: 650; letter-spacing: -.02em; margin-top: 4px; line-height: 1.1; }
.kpi .s { font-size: .76rem; color: var(--ink-2); margin-top: 4px; }
.dgrid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 900px) { .dgrid { grid-template-columns: 1fr 1fr; } .dgrid .wide { grid-column: 1 / -1; } }
.chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.chart-card .h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.chart-card .h p { margin: 3px 0 0; font-size: .8rem; color: var(--muted); }
.legend { display: flex; gap: 14px; font-size: .8rem; color: var(--ink-2); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.segsm { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; padding: 2px; background: var(--surface-2); }
.segsm button { border: 0; background: transparent; padding: 5px 10px; border-radius: 8px; font-size: .78rem; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.segsm button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
svg.chart text { font-family: var(--font); fill: var(--ink-2); font-size: 11px; }
svg.chart .ax { fill: var(--muted); font-variant-numeric: tabular-nums; }
svg.chart .val { fill: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
svg.chart [data-tip] { cursor: default; }
svg.chart rect.hit { fill: transparent; }
svg.chart g.bar:hover rect.mk { filter: brightness(.9); }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hb { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; font-size: .84rem; }
.hb .l { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb .v { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.hb .v small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.hb .track { grid-column: 1 / -1; height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.hb .fill { height: 100%; background: var(--brand); border-radius: 0 4px 4px 0; }
.meters { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 560px) { .meters { grid-template-columns: 1fr 1fr; } }
.meter .big { font-size: 2rem; font-weight: 650; letter-spacing: -.02em; }
.meter .l { font-size: .84rem; font-weight: 600; }
.meter .s { font-size: .78rem; color: var(--muted); }
.meter .bar { height: 10px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); margin: 8px 0 6px; overflow: hidden; }
.meter .bar i { display: block; height: 100%; background: var(--brand); border-radius: 0 6px 6px 0; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table.t { width: 100%; border-collapse: collapse; font-size: .84rem; }
table.t th { text-align: left; font-weight: 650; color: var(--ink-2); background: var(--surface-2); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: .78rem; }
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.n, table.t th.n { text-align: right; }
table.t tr.tot td { font-weight: 700; background: var(--surface-2); }
.tip { position: fixed; z-index: 90; pointer-events: none; background: var(--ink); color: #fff; padding: 7px 10px; border-radius: 8px; font-size: .8rem; line-height: 1.35; max-width: 240px; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); white-space: pre-line; }
.prog { height: 6px; border-radius: 4px; background: var(--surface-2); overflow: hidden; display: flex; min-width: 80px; border: 1px solid var(--line); }
.prog i { display: block; height: 100%; }

/* ---------- Ajustes ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: transparent; padding: 11px 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; font-size: .9rem; }
.tabs button.on { color: var(--brand-strong); border-bottom-color: var(--brand); }
.loc-row { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.loc-row:last-child { border-bottom: 0; }
.loc-row .input { height: 40px; }

/* Toast */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(150px + var(--safe-b)); z-index: 100; background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: .88rem; box-shadow: 0 8px 26px rgba(0, 0, 0, .2); animation: up .2s; max-width: calc(100% - 32px); }
@media (min-width: 980px) { .toast { bottom: 90px; } }

.spinner { width: 22px; height: 22px; border: 2.5px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center { display: grid; place-items: center; min-height: 50vh; }

@media print { .no-print { display: none !important; } }

/* Multiunidad */
.logo.img { background: #fff !important; border: 1px solid var(--line); overflow: hidden; width: auto !important; min-width: 32px; padding: 2px; }
.logo.img img { max-height: 26px; max-width: 84px; display: block; }
.rail .logo.img img { max-width: 56px; }
.rail .brandmark .t1, .rail .brandmark .t2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.brandmark.switch { cursor: pointer; border-radius: 10px; padding: 4px 6px; margin-left: -6px; }
.brandmark.switch:hover { background: var(--surface-2); }
.brandmark.switch .t1::after { content: " ▾"; color: var(--muted); font-size: .8em; }
.ctxbar { background: #fff7e6; border-top: 1px solid #f2dca8; }
.ctxbar-in { max-width: 1240px; margin: 0 auto; padding: 7px 16px; display: flex; align-items: center; gap: 10px; font-size: .84rem; color: #7a4a06; }
.ctxbar-in svg { width: 16px; height: 16px; flex: none; }
.ctxbar-in span { flex: 1; min-width: 0; }
