/* Base: tipografías, foco visible, números en monoespaciada, tabla densa. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--sans); background: var(--bg); color: var(--tx);
  font-size: 14px; line-height: 1.55;
}
h1, h2, h3, h4 { margin: 0; }
h1 { font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: -.01em; color: var(--tx); }
h2 { font-family: var(--sans); font-weight: 700; font-size: 15px; color: var(--tx); }
h3 { font-family: var(--sans); font-weight: 700; font-size: 13px; color: var(--tx2); text-transform: uppercase; letter-spacing: .06em; }
p { margin: 0; }
a { color: var(--purple); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
[hidden] { display: none !important; }

/* Foco visible y consistente */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--purple2); outline-offset: 2px; border-radius: 4px; }

.solo-lectores {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Todo monto, fecha, id, % y columna numérica va en JetBrains Mono con cifras tabulares */
.num, .mono, code, td.num, th.num {
  font-family: var(--mono); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1;
}
.num { text-align: right; white-space: nowrap; }
.texto-2 { color: var(--tx2); }
.ayuda { color: var(--tx2); font-size: 12px; }

/* Tabla densa con cabecera fija; las anchas scrollean dentro de su caja, nunca la página */
.tabla-caja { overflow-x: auto; border: 1px solid var(--bdr); border-radius: var(--r2); background: var(--card); box-shadow: var(--sh-1); max-height: 70vh; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--bdr); text-align: left; vertical-align: top; }
th {
  position: sticky; top: 0; z-index: 1; background: var(--purple-bg); color: var(--tx2);
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
th.num { text-align: right; }
/* Los encabezados de fila (th scope="row") son texto normal, no encabezado de columna */
tbody th, tfoot th {
  position: static; background: transparent; color: var(--tx); font-size: 13px; font-weight: 600; letter-spacing: normal; text-transform: none; white-space: normal;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #FBFAFE; }
tfoot td { font-weight: 700; background: var(--purple-bg); border-top: 1px solid var(--bdr2); }
