/* Field-ledger layout: brand-green chrome, paper-tinted workspace, ear-tag yellow for every arete number */
:root {
  --bg: #F1F4ED;
  --surface: #FFFFFF;
  --sunk: #E7ECE2;
  --ink: #18261C;
  --muted: #5A685D;
  --line: #D5DDCF;
  --brand: #1F4D2B;
  --brand-2: #2E7D32;
  --brand-ink: #F2F8F1;
  --tag: #F2C230;
  --tag-ink: #2C2200;
  --ok: #23803F; --ok-bg: #E1F1E3;
  --warn: #9A6400; --warn-bg: #FAEFCF;
  --bad: #B3302A; --bad-bg: #F8DFDB;
  --gray: #687369; --gray-bg: #E6EAE3;
  --shadow: 0 1px 2px rgb(20 40 25 / .06), 0 8px 24px rgb(20 40 25 / .07);
  --f-display: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  --f-body: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --r: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1410; --surface: #162019; --sunk: #111914; --ink: #E3EBE1; --muted: #98A699; --line: #29362C;
    --brand: #14341D; --brand-2: #6CC07C; --brand-ink: #EAF5EC; --tag: #E8BA2A; --tag-ink: #221A00;
    --ok: #63C97E; --ok-bg: #15301C; --warn: #E6AC3A; --warn-bg: #33280F; --bad: #F2766A; --bad-bg: #3A1A17;
    --gray: #97A399; --gray-bg: #222B24; --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1410; --surface: #162019; --sunk: #111914; --ink: #E3EBE1; --muted: #98A699; --line: #29362C;
  --brand: #14341D; --brand-2: #6CC07C; --brand-ink: #EAF5EC; --tag: #E8BA2A; --tag-ink: #221A00;
  --ok: #63C97E; --ok-bg: #15301C; --warn: #E6AC3A; --warn-bg: #33280F; --bad: #F2766A; --bad-bg: #3A1A17;
  --gray: #97A399; --gray-bg: #222B24; --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 40; background: var(--brand); }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; letter-spacing: .2px; line-height: 1.1; margin: 0; text-wrap: balance; }
h1 { font-size: 30px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
a { color: var(--brand-2); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--f-mono); font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

/* ---------- estructura ---------- */
.app { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100vh; }
.side { display: none; }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 10px;
  background: var(--brand); color: var(--brand-ink);
  padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.topbar .brand { flex: 1; min-width: 0; }
.iconbtn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.iconbtn:hover { background: rgb(255 255 255 / .1); }
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand b { font-family: var(--f-display); font-size: 24px; font-weight: 800; letter-spacing: .3px; }
.brand b span { color: var(--tag); }
.brand small { font-size: 12px; opacity: .8; text-transform: uppercase; letter-spacing: 1.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
main {
  width: 100%; max-width: 1120px; margin: 0 auto; min-width: 0;
  padding-block: 18px 104px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
}
.tabbar a { display: grid; justify-items: center; gap: 2px; padding: 8px 2px 7px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; }
.tabbar a.on { color: var(--brand-2); }
.tabbar a.on .ic { stroke-width: 2.2; }
@media (min-width: 960px) {
  .app { grid-template-columns: 252px minmax(0, 1fr); }
  .side {
    display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
    background: var(--brand); color: var(--brand-ink); padding: 22px 14px;
  }
  .side .brand { flex-direction: column; gap: 0; padding: 0 10px 18px; }
  .side .brand b { font-size: 32px; }
  .topbar, .tabbar { display: none; }
  main { padding-block: 28px 48px; }
}
.navlink { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: inherit; text-decoration: none; font-weight: 500; opacity: .86; }
.navlink:hover { background: rgb(255 255 255 / .08); opacity: 1; }
.navlink.on { background: rgb(255 255 255 / .14); opacity: 1; font-weight: 600; }
.navlink.on .ic { color: var(--tag); }
.side .spacer { flex: 1; }
.side .who { padding: 12px; border-top: 1px solid rgb(255 255 255 / .14); font-size: 13px; }
.side .who b { display: block; }
.demo-bar { background: var(--tag); color: var(--tag-ink); font-size: 13px; font-weight: 600; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: center;
  padding-block: 7px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.demo-bar button { border: 1.5px solid currentColor; background: transparent; border-radius: 999px; padding: 2px 12px; font-weight: 700; font-size: 12px; cursor: pointer; }
.demo-bar button.on { background: var(--tag-ink); color: var(--tag); }

/* ---------- encabezado de página ---------- */
.phead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.phead .t { min-width: 0; }
.phead .eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 1.3px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.phead .acts { display: flex; flex-wrap: wrap; gap: 8px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-size: 14px; margin-bottom: 6px; }

/* ---------- botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #0D1A10; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #0D1A10; } }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: wait; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--brand-2); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- tarjetas y listas ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.card + .card, .card + .section, .section + .section, .section + .card { margin-top: 16px; }
.section > h2 { margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.section > h2 .count { font-family: var(--f-body); font-size: 13px; font-weight: 600; color: var(--muted); }
.grid2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; min-width: 0; }
.row:first-child { border-top: 0; }
a.row:hover, button.row:hover { background: var(--sunk); }
button.row { width: 100%; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.row .main { flex: 1; min-width: 0; }
.row .main > b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .main > span { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .end { text-align: right; flex: none; display: grid; justify-items: end; gap: 4px; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); margin-bottom: 4px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; flex: none; background: var(--sunk); display: grid; place-items: center; overflow: hidden; font-family: var(--f-display); font-weight: 700; color: var(--muted); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- arete (chapa amarilla) ---------- */
.tag { display: inline-flex; align-items: center; gap: 5px; background: var(--tag); color: var(--tag-ink); font-family: var(--f-mono); font-weight: 600; font-size: 13px;
  padding: 2px 8px 2px 6px; border-radius: 4px 9px 9px 4px; letter-spacing: .4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .15); }
.rango { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rango i { font-style: normal; color: var(--muted); }

/* ---------- semáforo ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.chip.verde { background: var(--ok-bg); color: var(--ok); }
.chip.amarillo { background: var(--warn-bg); color: var(--warn); }
.chip.rojo { background: var(--bad-bg); color: var(--bad); }
.chip.gris { background: var(--gray-bg); color: var(--gray); }
.chip.plain::before { display: none; }
.meter { height: 8px; border-radius: 999px; background: var(--sunk); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; }
.meter.verde i { background: var(--ok); } .meter.amarillo i { background: var(--warn); } .meter.rojo i { background: var(--bad); } .meter.gris i { background: var(--gray); }
.meter.big { height: 14px; }
.mini-meter { width: 72px; }

/* ---------- KPI ---------- */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 18px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; min-width: 0; }
.kpi small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; }
.kpi b { display: block; font-family: var(--f-display); font-size: clamp(22px, 6.4vw, 30px); font-weight: 700; line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi span { font-size: 12px; color: var(--muted); }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }

/* ---------- pestañas y filtros ---------- */
.tabs { display: flex; gap: 4px; background: var(--sunk); padding: 4px; border-radius: 12px; margin-bottom: 16px; overflow-x: auto; }
.tabs a, .tabs button { flex: 1; text-align: center; padding: 8px 12px; border-radius: 9px; text-decoration: none; color: var(--muted); font-weight: 600; white-space: nowrap; border: 0; background: transparent; cursor: pointer; font-size: 14px; }
.tabs .on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters button { border: 1px solid var(--line); background: var(--surface); padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); }
.filters button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.search { position: relative; margin-bottom: 12px; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; padding-left: 40px; }

/* ---------- formularios ---------- */
input, select, textarea { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-2); outline-offset: 0; border-color: transparent; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field > span em { font-style: normal; color: var(--bad); }
.field .hint { font-size: 12px; color: var(--muted); }
.fgrid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 560px) { .fgrid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fgrid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fsec { border-top: 1px dashed var(--line); padding-top: 14px; margin-top: 14px; }
.fsec > h3 { margin-bottom: 10px; }
.err { background: var(--bad-bg); color: var(--bad); padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.warnbox { background: var(--warn-bg); color: var(--warn); padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.okbox { background: var(--ok-bg); color: var(--ok); padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.slots { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.slot { display: grid; gap: 6px; cursor: pointer; text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); min-width: 0; }
.slot-img { aspect-ratio: 4 / 3; max-width: 100%; border: 1.5px dashed var(--line); border-radius: 10px; display: grid; place-items: center; overflow: hidden; background: var(--sunk); }
.slot-img img { width: 100%; height: 100%; object-fit: cover; }
.adjs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.adj { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: var(--sunk); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 700; color: var(--muted); font-size: 12px; }
.adj img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.adj .x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgb(0 0 0 / .6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.adj .x .ic { width: 14px; height: 14px; }
.filebtn { position: relative; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.linea { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--sunk); display: grid; gap: 12px; }
.linea + .linea { margin-top: 10px; }
.linea-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.tipos { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tipos button { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 14px; cursor: pointer; display: grid; gap: 4px; }
.tipos button b { font-family: var(--f-display); font-size: 18px; }
.tipos button span { font-size: 12px; color: var(--muted); }
.tipos button:hover { border-color: var(--brand-2); }
.total-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; background: var(--brand); color: var(--brand-ink); border-radius: 12px; margin-top: 14px; }
.total-bar b { font-family: var(--f-display); font-size: 24px; font-variant-numeric: tabular-nums; }

/* ---------- hoja (formulario emergente) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; background: rgb(8 14 10 / .5); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 720px; max-height: 94vh; border-radius: 18px 18px 0 0; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow); }
@media (min-width: 760px) { .sheet-wrap { align-items: center; padding: 24px; } .sheet { border-radius: 18px; max-height: 90vh; } }
.sheet-h { display: flex; align-items: center; gap: 8px; padding: 12px 8px 12px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.sheet-h h2 { flex: 1; min-width: 0; }
.sheet-b { overflow-y: auto; padding: 18px; padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
.sheet-f { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--surface); }
.sheet-f .btn { flex: 1; } @media (min-width: 560px) { .sheet-f .btn { flex: none; } }
.lightbox img { width: 100%; border-radius: 10px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom, 0px)); z-index: 60; background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow); max-width: calc(100% - 32px); text-align: center; }
@media (min-width: 960px) { .toast { bottom: 28px; } }

/* ---------- detalle ---------- */
.dl { display: grid; gap: 10px 18px; grid-template-columns: minmax(0, 1fr); margin: 0; }
@media (min-width: 560px) { .dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dl div { min-width: 0; }
.dl dt { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .7px; }
.dl dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.hero { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.hero .avatar { width: 64px; height: 64px; font-size: 24px; }
.photos { display: flex; gap: 10px; flex-wrap: wrap; }
.photos figure { margin: 0; display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.photos img, .photos .ph { width: 140px; max-width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); cursor: zoom-in; background: var(--sunk); }
.photos .ph { display: grid; place-items: center; cursor: default; }
.capbox { display: grid; gap: 10px; }
.capnums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; }
.capnums b { display: block; font-family: var(--f-display); font-size: 28px; font-variant-numeric: tabular-nums; }
.capnums small { color: var(--muted); font-size: 12px; font-weight: 600; }
.alertline { display: flex; gap: 10px; align-items: flex-start; }

/* ---------- tablas ---------- */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 10px 12px; border-top: 1px solid var(--line); white-space: nowrap; }
table.t .n { text-align: right; font-variant-numeric: tabular-nums; }
table.t tfoot td { font-weight: 700; border-top: 2px solid var(--line); }

/* ---------- recibo ---------- */
.recibo { position: relative; background: #fff; color: #18261C; border: 1px solid var(--line); border-radius: 6px; padding: 22px; max-width: 640px; margin: 0 auto; overflow: hidden; }
.rc-head { display: flex; justify-content: space-between; gap: 12px; border-bottom: 3px solid #1F4D2B; padding-bottom: 12px; }
.rc-brand { font-family: var(--f-display); font-size: 30px; font-weight: 800; color: #1F4D2B; line-height: 1; }
.rc-brand span { color: #2E7D32; }
.rc-sub { font-size: 12px; color: #5A685D; }
.rc-num { text-align: right; display: grid; }
.rc-num small { font-size: 11px; color: #5A685D; text-transform: uppercase; letter-spacing: 1px; }
.rc-num b { font-family: var(--f-mono); font-size: 18px; }
.rc-tipo { font-family: var(--f-display); font-size: 20px; font-weight: 700; margin: 14px 0 8px; }
.rc-datos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; margin: 0 0 14px; font-size: 13px; }
.rc-datos dt { color: #5A685D; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; }
.rc-datos dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.rc-tabla { width: 100%; border-collapse: collapse; font-size: 13px; }
.rc-tabla th { text-align: left; border-bottom: 1px solid #C9D2C3; padding: 6px 4px; font-size: 11px; text-transform: uppercase; color: #5A685D; }
.rc-tabla td { padding: 8px 4px; border-bottom: 1px solid #E3E8DF; vertical-align: top; }
.rc-tabla .n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rc-tabla tfoot td { font-weight: 800; font-size: 16px; border-bottom: 0; padding-top: 10px; }
.rc-tabla .tag { font-size: 11px; }
.rc-tabla .tag::before { background: #fff; }
.rc-notas { font-size: 13px; color: #5A685D; }
.rc-firmas { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 44px; font-size: 12px; text-align: center; color: #5A685D; }
.rc-firmas div { border-top: 1px solid #18261C; padding-top: 6px; }
.rc-sello { position: absolute; top: 46%; left: 50%; transform: translate(-50%, -50%) rotate(-14deg); border: 4px solid #B3302A; color: #B3302A; font-family: var(--f-display);
  font-size: 46px; font-weight: 800; padding: 4px 18px; border-radius: 8px; opacity: .85; text-align: center; background: rgb(255 255 255 / .7); }
.rc-sello small { display: block; font-size: 13px; font-family: var(--f-body); font-weight: 600; max-width: 260px; }
.rc-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 16px 0; }

.auth { min-height: 100vh; display: grid; place-items: center; padding-block: 24px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); background: var(--brand); }
.auth .card { width: 100%; max-width: 420px; box-shadow: var(--shadow); }
.auth .brand { color: var(--brand-ink); justify-content: center; margin-bottom: 18px; flex-direction: column; align-items: center; gap: 2px; }
.auth .brand b { font-size: 44px; }
.stack { display: grid; gap: 14px; }

@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: up .22s ease-out; }
  @keyframes up { from { transform: translateY(24px); opacity: .6; } }
}
@media print {
  body::before, .side, .topbar, .tabbar, .demo-bar, .phead, .rc-actions, .noprint, .toast { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .app { display: block; }
  .recibo { border: 0; max-width: none; }
}
