/* ═══════════════════════════════════════════════════════════════
   HONORARIOS — sistema de diseño (portado del área de gestión 911,
   tema claro hueso + carbón, acento burdeos vino)
   ═══════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Cormorant Garamond';
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/cormorant-garamond-700.woff2') format('woff2');
}
@font-face { font-family: 'Jost'; font-weight: 300; font-display: swap; src: url('/fonts/jost-300.woff2') format('woff2'); }
@font-face { font-family: 'Jost'; font-weight: 400; font-display: swap; src: url('/fonts/jost-400.woff2') format('woff2'); }
@font-face { font-family: 'Jost'; font-weight: 500; font-display: swap; src: url('/fonts/jost-500.woff2') format('woff2'); }
@font-face { font-family: 'Jost'; font-weight: 600; font-display: swap; src: url('/fonts/jost-600.woff2') format('woff2'); }
@font-face { font-family: 'Space Mono'; font-weight: 400; font-display: swap; src: url('/fonts/space-mono-400.woff2') format('woff2'); }
@font-face { font-family: 'Space Mono'; font-weight: 700; font-display: swap; src: url('/fonts/space-mono-700.woff2') format('woff2'); }

:root {
  --bg: #F4F1EB;
  --bg-2: #ECE8E0;
  --panel: #FFFFFF;
  --panel-2: #FAF8F4;
  --border: #E3DED4;
  --border-2: #D2CCC0;
  --ink: #17150F;
  --ink-dim: #6E675C;
  --ink-faint: #A39A8B;
  --carbon: #14120F;
  --vino: #8E2043;
  --vino-dark: #691631;
  --vino-pale: rgba(142, 32, 67, .08);
  --gold: #A87C2E;
  --rojo: #C8102E;
  --rojo-pale: rgba(200, 16, 46, .07);
  --verde: #167A3D;
  --verde-pale: rgba(22, 122, 61, .1);
  --ambar: #B45309;
  --ambar-pale: rgba(180, 83, 9, .1);
  --azul: #1D4ED8;
  --azul-pale: rgba(29, 78, 216, .08);
  --gris-pale: rgba(23, 21, 15, .06);
  --f-body: 'Jost', system-ui, sans-serif;
  --f-disp: 'Cormorant Garamond', Georgia, serif;
  --f-mono: 'Space Mono', ui-monospace, monospace;
  --r: 10px;
  --r-lg: 16px;
  --sh: 0 1px 2px rgba(23, 21, 15, .05), 0 4px 16px -6px rgba(23, 21, 15, .08);
  --sh-lg: 0 12px 48px -12px rgba(23, 21, 15, .22);
  --ease: cubic-bezier(.32, .72, 0, 1);
}

@view-transition { navigation: auto; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-weight: 400;
  line-height: 1.55;
  min-height: 100vh;
}
a { color: var(--vino); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
:focus-visible { outline: 2px solid var(--vino); outline-offset: 2px; border-radius: 4px; }
.mono, .num { font-family: var(--f-mono); }

/* ── Layout app ── */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.main { display: flex; flex-direction: column; min-width: 0; }

.sidebar {
  background: var(--carbon);
  color: #EAE6DF;
  display: flex; flex-direction: column;
  padding: 1.4rem 0 1rem;
  position: sticky; top: 0; height: 100vh;
}
.sb-brand { display: flex; align-items: baseline; gap: .6rem; padding: 0 1.3rem 1.3rem; }
.sb-brand .sb-logo { font-family: var(--f-disp); font-size: 1.35rem; font-weight: 600; color: #F0EDEA; }
.sb-brand span {
  font-size: .6rem; letter-spacing: .16em; text-transform: uppercase;
  color: #99938A; border: 1px solid rgba(240, 237, 234, .16); border-radius: 999px; padding: .15rem .5rem;
}
.sb-nav { flex: 1; overflow-y: auto; padding: .4rem .7rem; display: flex; flex-direction: column; gap: 2px; }
.sb-link {
  display: flex; align-items: center; gap: .7rem;
  padding: .58rem .8rem; border-radius: 8px;
  font-size: .88rem; font-weight: 400; color: #B7B1A7;
  transition: background .25s var(--ease), color .25s var(--ease);
}
.sb-link:hover { color: #F0EDEA; background: rgba(240, 237, 234, .06); text-decoration: none; }
.sb-link.on { color: #fff; background: var(--vino); }
.sb-link svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .8; }
.sb-link.on svg { opacity: 1; }
.sb-foot {
  padding: .9rem 1.3rem 0; border-top: 1px solid rgba(240, 237, 234, .09);
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
}
.sb-foot .sb-quien { font-size: .78rem; color: #99938A; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-foot button { font-size: .78rem; color: #99938A; }
.sb-foot button:hover { color: #F0EDEA; }

.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: .9rem 1.8rem;
  background: rgba(244, 241, 235, .85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
}
.top-title, .top-brand { font-family: var(--f-disp); font-size: 1.35rem; font-weight: 600; }
.top-brand { display: none; }
.top-fecha { margin-left: auto; font-family: var(--f-mono); font-size: .72rem; color: var(--ink-faint); }
@media (max-width: 899px) {
  .top-title { display: none; }
  .top-brand { display: block; }
}

.contenido { padding: 1.8rem; max-width: 1200px; width: 100%; animation: vista .4s var(--ease) both; }
.lienzo { padding: 1.5rem; max-width: 720px; margin: 0 auto; }
@keyframes vista {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .contenido { animation: none; }
  * { transition-duration: .01ms !important; }
}

/* ── Tabbar móvil ── */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: var(--carbon);
  display: none;
  justify-content: space-around;
  padding: .5rem .2rem calc(.5rem + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 32px -12px rgba(23, 21, 15, .35);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: .66rem; letter-spacing: .02em;
  color: #99938A; min-width: 44px; padding: .15rem .3rem;
  transition: color .25s var(--ease);
}
.tabbar a:hover { text-decoration: none; }
.tabbar a.activo { color: #F0EDEA; }
.tab-ico { font-size: 1.15rem; line-height: 1.1; }
.tab-registrar .tab-mas {
  background: var(--vino); color: #fff;
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.45rem; margin-top: -20px;
  box-shadow: 0 6px 18px -4px rgba(142, 32, 67, .55);
  transition: transform .25s var(--ease);
}
.tab-registrar:active .tab-mas { transform: scale(.92); }
.tab-registrar.activo .tab-mas { background: var(--vino-dark); }

@media (max-width: 899px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .tabbar { display: flex; }
  .topbar { padding: .8rem 1.1rem; }
  .contenido { padding: 1.1rem 1rem 5.5rem; }
  body { padding-bottom: env(safe-area-inset-bottom); }
}

/* ── Cabeceras de vista ── */
.titulo-pagina { font-family: var(--f-disp); font-size: 1.9rem; font-weight: 600; line-height: 1.1; margin: .2rem 0 1.4rem; }
.seccion { margin: 2rem 0; }
.seccion h2 { font-family: var(--f-disp); font-size: 1.3rem; font-weight: 600; margin-bottom: .9rem; }
.miga { font-size: .85rem; margin-bottom: .4rem; }
.miga a { color: var(--ink-dim); }
.miga a:hover { color: var(--ink); text-decoration: none; }
.ayuda { color: var(--ink-dim); font-size: .88rem; margin-bottom: .9rem; max-width: 62ch; }
.vacio {
  padding: 3rem 1.5rem; text-align: center; color: var(--ink-faint);
  background: var(--panel); border: 1px dashed var(--border-2); border-radius: var(--r-lg);
}
.pie-dato { color: var(--ink-faint); font-size: .82rem; margin-top: 1rem; }
.opcional { color: var(--ink-faint); font-weight: 400; font-size: .74rem; letter-spacing: .02em; text-transform: none; }

/* ── KPIs ── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.kpi {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--sh); padding: 1.1rem 1.25rem;
  display: flex; flex-direction: column;
  color: var(--ink);
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
a.kpi:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--border-2); box-shadow: var(--sh-lg); }
.kpi-num { font-family: var(--f-mono); font-size: 1.55rem; line-height: 1.15; letter-spacing: -.02em; }
.kpi-label { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim); margin-top: .4rem; }
.kpi-alerta .kpi-num { color: var(--rojo); }

/* ── Tarjetas ── */
.tarjeta {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--sh);
  padding: 1.4rem;
}
.bienvenida { text-align: center; padding: 3.5rem 1.5rem; }
.bienvenida h1 { font-family: var(--f-disp); font-size: 2rem; font-weight: 600; margin-bottom: .4rem; }
.bienvenida p { color: var(--ink-dim); margin-bottom: 1.5rem; }

/* ── Tablas ── */
.tabla-envoltorio {
  overflow-x: auto; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh);
}
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th {
  text-align: left; font-size: .64rem; font-weight: 500; letter-spacing: .13em;
  text-transform: uppercase; color: var(--ink-dim);
  padding: .8rem 1rem; border-bottom: 1px solid var(--border); background: var(--panel-2);
  white-space: nowrap;
}
td { padding: .72rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr { transition: background .2s var(--ease); }
tbody tr:hover { background: var(--panel-2); }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; }
td.num { font-size: .82rem; }
td.alerta { color: var(--rojo); font-weight: 700; }
td.aviso-suave { color: var(--ambar); font-weight: 600; }
tr.inactivo { opacity: .5; }
.acciones { white-space: nowrap; text-align: right; }
.acciones form { display: inline-block; margin-left: 4px; }
.dias { font-family: var(--f-mono); font-size: .68rem; color: var(--ink-faint); margin-left: .4rem; }

/* ── Badges ── */
.badge {
  display: inline-block; padding: .18rem .6rem; border-radius: 999px;
  font-size: .7rem; font-weight: 500; letter-spacing: .04em;
  white-space: nowrap;
  background: var(--gris-pale); color: var(--ink-dim);
}
.badge-REALIZADO, .badge-PRE-PENDIENTE { background: var(--gris-pale); color: var(--ink-dim); }
.badge-EN_PREFACTURA, .badge-PRE-CONCILIADA { background: var(--azul-pale); color: var(--azul); }
.badge-FACTURADO, .badge-FAC-EMITIDA { background: var(--ambar-pale); color: var(--ambar); }
.badge-COBRADO, .badge-FAC-COBRADA, .badge-PRE-FACTURADA { background: var(--verde-pale); color: var(--verde); }
.badge-DISCREPANCIA { background: var(--rojo-pale); color: var(--rojo); }
.badge-FAC-ANULADA { background: var(--rojo-pale); color: var(--rojo); text-decoration: line-through; }

/* ── Botones ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .55rem 1.15rem; border-radius: 999px;
  font-size: .87rem; font-weight: 500;
  background: var(--panel); border: 1px solid var(--border-2); color: var(--ink);
  transition: all .3s var(--ease);
  white-space: nowrap; text-align: center;
}
.btn:hover { border-color: var(--ink); text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn.principal {
  background: var(--vino); border-color: var(--vino); color: #fff;
  box-shadow: 0 6px 18px -6px rgba(142, 32, 67, .5);
}
.btn.principal:hover { background: var(--vino-dark); border-color: var(--vino-dark); }
.btn.peligro { background: var(--panel); color: var(--rojo); border-color: rgba(200, 16, 46, .35); }
.btn.peligro:hover { background: var(--rojo); color: #fff; border-color: var(--rojo); }
.btn.ancho { width: 100%; }
.btn.grande { font-size: 1rem; padding: .8rem 1.6rem; }
.btn.mini { padding: .28rem .75rem; font-size: .76rem; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ── Formularios ── */
.form { display: flex; flex-direction: column; gap: 1rem; }
.form label, .form-inline label, .filtros label {
  display: block;
  font-size: .68rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim);
}
.form label > input, .form label > select,
.form-inline label > input, .form-inline label > select,
.filtros label > input, .filtros label > select { margin-top: .35rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="number"], input[type="file"], select {
  background: var(--panel); border: 1px solid var(--border-2); border-radius: var(--r);
  padding: .6rem .85rem; font-size: .95rem; width: 100%; min-height: 44px;
  color: var(--ink);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
input:focus, select:focus { outline: none; border-color: var(--vino); box-shadow: 0 0 0 3px var(--vino-pale); }
.campo-grupo { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 1rem 1rem .9rem; display: flex; flex-direction: column; gap: .8rem; }
.campo-grupo legend { font-size: .68rem; font-weight: 500; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-dim); padding: 0 .4rem; }
.fila-toggle { display: flex !important; flex-direction: row; align-items: center; gap: .6rem; font-size: .9rem !important; text-transform: none !important; letter-spacing: 0 !important; color: var(--ink) !important; }
.fila-toggle input { width: 17px; height: 17px; min-height: 0; accent-color: var(--vino); margin-top: 0 !important; }
.fila-doble { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1rem; }
.campo-corto { max-width: 240px; }

.form-inline { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; margin-top: .9rem; }
.form-inline input, .form-inline select { width: auto; flex: 1 1 130px; }
.form-inline button { flex: 0 0 auto; }
.lineas-form { background: var(--panel); border: 1px dashed var(--border-2); border-radius: var(--r-lg); padding: .9rem; }

.filtros { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.1rem; align-items: center; }
.filtros input, .filtros select {
  width: auto; flex: 1 1 130px; min-height: 0;
  border-radius: 999px; padding: .4rem .95rem; font-size: .85rem;
}
.filtros .btn { flex: 0 0 auto; }

/* ── Chips de actos (registrar) ── */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  font-size: .9rem; padding: .55rem 1.05rem; min-height: 44px; border-radius: 999px;
  border: 1px solid var(--border-2); background: var(--panel); color: var(--ink);
  transition: all .25s var(--ease);
}
.chip:hover { border-color: var(--ink); }
.chip:active { transform: scale(.96); }
.chip.activo {
  background: var(--vino); border-color: var(--vino); color: #fff; font-weight: 500;
  box-shadow: 0 6px 18px -6px rgba(142, 32, 67, .5);
}
.chip .chip-e { font-family: var(--f-mono); font-size: .62rem; opacity: .75; margin-left: .35rem; }

.sugerencias {
  border: 1px solid var(--border); border-radius: var(--r); background: var(--panel);
  max-height: 220px; overflow-y: auto; box-shadow: var(--sh-lg);
}
.sugerencias button {
  display: block; width: 100%; text-align: left; font-size: .9rem;
  padding: .6rem .85rem; border-bottom: 1px solid var(--border);
  transition: background .2s var(--ease);
}
.sugerencias button:last-child { border-bottom: none; }
.sugerencias button:hover { background: var(--vino-pale); }

/* ── Avisos ── */
.aviso {
  background: var(--ambar-pale); color: var(--ambar);
  border-radius: var(--r); padding: .75rem 1rem; font-size: .88rem; margin-bottom: 1rem;
}
.aviso.error { background: var(--rojo-pale); color: var(--rojo); }
.aviso.exito { background: var(--verde-pale); color: var(--verde); }
.oculto { display: none; }

/* ── Toasts (portados del 911) ── */
#toasts { position: fixed; right: 1.2rem; bottom: calc(1.2rem + env(safe-area-inset-bottom)); z-index: 300; display: flex; flex-direction: column; gap: .5rem; }
#toasts > div { display: flex; flex-direction: column; gap: .5rem; }
.toast {
  background: var(--carbon); color: #F0EDEA;
  padding: .75rem 1.2rem; border-radius: var(--r);
  font-size: .88rem; box-shadow: var(--sh-lg);
  transform: translateY(12px); opacity: 0;
  transition: all .35s var(--ease);
  max-width: 340px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast--err { background: var(--rojo); }
@media (max-width: 899px) { #toasts { right: .9rem; left: .9rem; bottom: calc(5.2rem + env(safe-area-inset-bottom)); align-items: center; } }

/* ── Modal de confirmación (portado del 911) ── */
.modal-ov {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(23, 21, 15, .45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 12vh 1rem;
  opacity: 0; transition: opacity .25s var(--ease);
  overflow-y: auto;
}
.modal-ov.show { opacity: 1; }
.modal {
  background: var(--bg); border-radius: var(--r-lg); box-shadow: var(--sh-lg);
  width: min(460px, 100%);
  transform: translateY(18px); transition: transform .3s var(--ease);
}
.modal-ov.show .modal { transform: translateY(0); }
.modal:focus { outline: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.4rem .6rem; }
.modal-head h2 { font-family: var(--f-disp); font-size: 1.3rem; font-weight: 600; }
.modal-body { padding: 0 1.4rem .6rem; color: var(--ink-dim); font-size: .92rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: .6rem; padding: .8rem 1.4rem 1.2rem; }

/* ── Login (portado del 911: overlay oscuro + glow) ── */
.login-fondo {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #14120F 0%, #23201A 100%);
  overflow: hidden;
}
.login-fondo::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(90% 90% at 50% 110%, rgba(142, 32, 67, .3), transparent 60%);
}
.login-caja {
  position: relative; z-index: 2;
  width: min(400px, calc(100vw - 2rem));
  background: rgba(255, 255, 255, .96);
  border-radius: var(--r-lg); box-shadow: var(--sh-lg);
  padding: 2.6rem 2.4rem 2.2rem;
}
.login-marca { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.login-logo { font-family: var(--f-disp); font-size: 1.4rem; font-weight: 700; }
.login-tag {
  font-size: .62rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-faint); border: 1px solid var(--border); border-radius: 999px; padding: .2rem .6rem;
}
.login-caja h1 { font-family: var(--f-disp); font-size: 1.7rem; font-weight: 600; margin: 1rem 0 .2rem; }
.login-sub { color: var(--ink-dim); font-size: .9rem; margin-bottom: 1.6rem; }

/* ── Página "Más" ── */
.lista-mas { display: flex; flex-direction: column; gap: .8rem; }
.enlace-mas { display: flex; flex-direction: column; gap: .25rem; color: var(--ink); transition: transform .25s var(--ease), border-color .25s var(--ease); }
.enlace-mas:hover { text-decoration: none; transform: translateX(3px); border-color: var(--vino); }
.enlace-mas strong { font-family: var(--f-disp); font-size: 1.15rem; font-weight: 600; }
.enlace-mas span { color: var(--ink-dim); font-size: .85rem; }

/* ── Vista previa de totales ── */
.totales-previa { margin: 1rem 0; font-size: .92rem; }
.totales-previa .total-previa { font-family: var(--f-disp); font-size: 1.35rem; font-weight: 600; margin-top: .4rem; }
.totales-previa .total-previa strong { font-family: var(--f-mono); font-size: 1.15rem; font-weight: 700; }
.totales-previa .alerta-previa { color: var(--rojo); font-weight: 500; margin-bottom: .4rem; }

/* ── Factura (hoja) ── */
.factura-hoja {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 2.4rem; max-width: 760px; margin: 1.2rem auto; box-shadow: var(--sh);
}
.factura-titulo { font-family: var(--f-disp); font-size: 1.9rem; font-weight: 600; }
.factura-fecha { color: var(--ink-dim); font-size: .85rem; margin-top: .2rem; }
.factura-partes { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; margin: 1.8rem 0; }
.factura-partes h2 { font-size: .64rem; text-transform: uppercase; letter-spacing: .13em; color: var(--ink-dim); margin-bottom: .4rem; font-weight: 500; }
.factura-partes p { font-size: .9rem; }
.factura-lineas { margin: 1.3rem 0; }
.factura-totales { margin-left: auto; width: auto; min-width: 300px; }
.factura-totales td { border-bottom: none; padding: .3rem .9rem; font-size: .92rem; }
.factura-totales td.num { font-family: var(--f-mono); font-size: .88rem; }
.factura-totales .total td { border-top: 2px solid var(--ink); font-weight: 700; font-size: 1.05rem; font-family: var(--f-disp); padding-top: .55rem; }
.factura-totales .total td.num { font-family: var(--f-mono); font-size: 1rem; }
.factura-nota { font-size: .76rem; color: var(--ink-dim); margin-top: 1.2rem; max-width: 62ch; }
.factura-hash { font-family: var(--f-mono); font-size: .64rem; color: var(--ink-faint); }

@media (max-width: 600px) {
  .factura-hoja { padding: 1.4rem 1.1rem; }
  .factura-partes { grid-template-columns: 1fr; gap: 1rem; }
  .fila-doble { grid-template-columns: 1fr; }
}

.acciones-pie { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

/* ── Impresión ── */
@media print {
  body { background: #fff; font-size: 12px; }
  .sidebar, .topbar, .tabbar, #toasts, .no-print, .miga, .btn { display: none !important; }
  .app { display: block; }
  .contenido { max-width: none; padding: 0; animation: none; }
  .factura-hoja { border: none; box-shadow: none; margin: 0; max-width: none; }
}
