/* ==========================================================================
   SISTEMA DE COMPONENTES («Señalética de Metro»). Depende de tokens.css y se carga DESPUÉS de Pico CSS.

   ÍNDICE
     1. Base y superficies del navegador (selección, caret, scrollbars, foco, subrayados, cifras)
     2. Puente con Pico CSS (las páginas aún no rediseñadas heredan el nuevo aspecto)
     3. Iconos (.ic)            4. Círculo de línea (.roundel)       5. Paneles (.panel)
     6. Botones (.btn)          7. Campos (.field, .input, .select)  8. Segmentado (.segmented) y casillas (.check)
     9. Tablas (.tbl)          10. Veredictos (.verdict) y etiquetas (.tag)
    11. Avisos (.alert, .notice) 12. Anulado/sellado (.is-void, .stamp) 13. Estado vacío (.empty-state)
    14. Paginación, migas y pestañas  15. LÍNEA DE ESTACIONES (.metro-line) — el componente firma
    16. Utilidades

   Reglas del sistema: retícula de 8 px; radios de 8 px; círculos perfectos para todo lo que sea «línea»; cifras
   siempre en Overpass con números tabulares y de caja alta (tnum + lnum); el color nunca es el único portador de significado
   (icono + texto); ninguna barra de color en un lado de una caja; sombras solo en menús flotantes.
   ========================================================================== */

/* ---------- 1. Base ---------- */
html { font-size: 100%; scroll-padding-top: var(--s-7); }
body { font-family: var(--font); font-size: var(--fs-base); line-height: var(--lh-base); font-weight: 400;
       background: var(--ground); color: var(--ink); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font); font-weight: 800; color: var(--ink); line-height: var(--lh-tight); text-wrap: balance; }
h1 { font-size: var(--fs-xl); line-height: 1.33; margin: 0 0 var(--s-2); }
h2 { font-size: var(--fs-lg); line-height: 1.25; margin: var(--s-4) 0 var(--s-2); }
h3, .h3 { font-size: var(--fs-md); line-height: 1.3; margin: var(--s-3) 0 var(--s-1); }
h4 { font-size: var(--fs-base); margin: var(--s-2) 0 var(--s-0); }
p, li { text-wrap: pretty; }
strong, b { font-weight: 800; }
small { font-size: var(--fs-xs); }
.num, td.num { font-family: var(--font); font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1; }
.num { font-weight: 600; }
.mono, code, kbd, samp { font-family: var(--font-mono); }

::selection { background: var(--action); color: var(--action-ink); }
input, textarea, [contenteditable] { caret-color: var(--action); }
:root { accent-color: var(--action); scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; border: 3px solid var(--ground); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-2); }
::placeholder { color: var(--ink-2); opacity: 1; }

a { color: var(--link); text-decoration-line: underline; text-decoration-thickness: 1px; text-underline-offset: .22em;
    text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); transition: text-decoration-color var(--dur-state), color var(--dur-state); }
a:hover { text-decoration-thickness: 2px; text-decoration-color: currentColor; }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }
:where(a, button, [role="button"], summary, label) { -webkit-tap-highlight-color: transparent; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-3) 0; }
abbr[title] { text-decoration: underline dotted; text-underline-offset: .2em; cursor: help; }

/* ---------- 2. Puente con Pico CSS ---------- */
:root, :root[data-theme="light"], :root[data-theme="dark"] {
  --pico-font-family: var(--font); --pico-font-family-sans-serif: var(--font); --pico-font-family-monospace: var(--font-mono);
  --pico-font-size: 100%; --pico-line-height: var(--lh-base); --pico-font-weight: 400;
  --pico-background-color: var(--ground); --pico-color: var(--ink); --pico-muted-color: var(--ink-2);
  --pico-muted-border-color: var(--line); --pico-border-color: var(--line); --pico-border-radius: var(--radius);
  --pico-primary: var(--link); --pico-primary-background: var(--action); --pico-primary-underline: color-mix(in srgb, var(--link) 40%, transparent);
  --pico-primary-hover: var(--link); --pico-primary-hover-background: var(--action-hover); --pico-primary-hover-underline: var(--link);
  --pico-primary-focus: color-mix(in srgb, var(--focus) 40%, transparent); --pico-primary-inverse: var(--action-ink);
  --pico-secondary: var(--ink-2); --pico-secondary-background: var(--ink-2); --pico-secondary-hover: var(--ink);
  --pico-secondary-hover-background: var(--ink); --pico-secondary-underline: transparent; --pico-secondary-focus: color-mix(in srgb, var(--focus) 40%, transparent);
  --pico-secondary-inverse: var(--surface);
  --pico-contrast: var(--ink); --pico-contrast-background: var(--ink); --pico-contrast-inverse: var(--surface);
  --pico-h1-color: var(--ink); --pico-h2-color: var(--ink); --pico-h3-color: var(--ink); --pico-h4-color: var(--ink); --pico-h5-color: var(--ink); --pico-h6-color: var(--ink);
  --pico-card-background-color: var(--surface); --pico-card-border-color: var(--line); --pico-card-box-shadow: none;
  --pico-card-sectioning-background-color: var(--surface-2);
  --pico-form-element-background-color: var(--surface); --pico-form-element-selected-background-color: var(--surface-2);
  --pico-form-element-border-color: var(--line-strong); --pico-form-element-color: var(--ink); --pico-form-element-placeholder-color: var(--ink-2);
  --pico-form-element-active-background-color: var(--surface); --pico-form-element-active-border-color: var(--focus);
  --pico-form-element-focus-color: var(--focus); --pico-form-element-disabled-background-color: var(--surface-2);
  --pico-form-element-disabled-border-color: var(--line); --pico-form-element-invalid-border-color: var(--bad);
  --pico-form-element-invalid-active-border-color: var(--bad); --pico-form-element-invalid-focus-color: var(--bad);
  --pico-form-element-valid-border-color: var(--ok); --pico-form-element-valid-active-border-color: var(--ok); --pico-form-element-valid-focus-color: var(--ok);
  --pico-switch-background-color: var(--line-strong); --pico-switch-checked-background-color: var(--action); --pico-switch-color: var(--surface);
  --pico-range-border-color: var(--line); --pico-range-active-border-color: var(--line-strong);
  --pico-range-thumb-border-color: var(--surface); --pico-range-thumb-color: var(--action); --pico-range-thumb-active-color: var(--action-hover);
  --pico-table-border-color: var(--line-2); --pico-table-row-stripped-background-color: transparent;
  --pico-code-background-color: var(--surface-2); --pico-code-color: var(--ink); --pico-code-kbd-background-color: var(--ink); --pico-code-kbd-color: var(--surface);
  --pico-mark-background-color: var(--warn-bg); --pico-mark-color: var(--ink);
  --pico-ins-color: var(--ok); --pico-del-color: var(--bad);
  --pico-modal-overlay-background-color: color-mix(in srgb, var(--ground) 80%, transparent);
  --pico-block-spacing-vertical: var(--s-3); --pico-block-spacing-horizontal: var(--s-3);
  --pico-spacing: var(--s-2); --pico-typography-spacing-vertical: var(--s-2);
  --pico-nav-element-spacing-vertical: 0; --pico-nav-element-spacing-horizontal: 0;
  --pico-nav-link-spacing-vertical: 0; --pico-nav-link-spacing-horizontal: 0;
  --pico-form-element-spacing-vertical: .625rem; --pico-form-element-spacing-horizontal: .875rem;
  --pico-border-width: 1px; --pico-outline-width: 3px; --pico-transition: var(--dur-state) ease-in-out;
}
article, [role="group"] { box-shadow: none; }
article { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
article > header, article > footer { background: transparent; border-color: var(--line-2); }
details { border-bottom-color: var(--line); }
button, [type="submit"], [type="button"], [role="button"] { font-family: var(--font); font-weight: 600; border-radius: var(--radius); }
button[disabled], [role="button"][aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"]), select, textarea { font-family: var(--font); border-radius: var(--radius); }
input[type="checkbox"], input[type="radio"] { cursor: pointer; }
:where(input, select, textarea):disabled { opacity: .6; cursor: not-allowed; }
:where(input, select, textarea)[aria-invalid="true"] { border-color: var(--bad); }

/* ---------- 3. Iconos: SVG propios (static/img/icons.svg), trazo uniforme de 2 px ---------- */
.ic { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
.ic--lg { width: 1.5em; height: 1.5em; }

/* ---------- 4. Círculo de línea: .roundel + .roundel--fondos|planes|depositos|inversiones|cartera|economia|simulador|avisos|inicio ----------
   Contiene una letra, una cifra o un icono. Tamaños: --sm 18, (por defecto) 22, --lg 32. Es decorativo: la etiqueta va al lado. */
.roundel { --rc: var(--ink-2); --rc-ink: var(--surface); width: 22px; height: 22px; border-radius: var(--radius-round); display: inline-flex; align-items: center; justify-content: center;
           flex: none; font: 800 12px/1 var(--font); font-variant-numeric: tabular-nums; background: var(--rc); color: var(--rc-ink); letter-spacing: 0; }
.roundel .ic { width: 12px; height: 12px; stroke-width: 2.4; }
.roundel--sm { width: 20px; height: 20px; font-size: var(--fs-xs); }
.roundel--lg { width: 32px; height: 32px; font-size: 14px; }
.roundel--lg .ic { width: 16px; height: 16px; }
.roundel--fondos { --rc: var(--l-fondos); --rc-ink: var(--l-fondos-ink); }
.roundel--planes { --rc: var(--l-planes); --rc-ink: var(--l-planes-ink); }
.roundel--depositos { --rc: var(--l-depositos); --rc-ink: var(--l-depositos-ink); }
.roundel--inversiones { --rc: var(--l-inversiones); --rc-ink: var(--l-inversiones-ink); }
.roundel--cartera { --rc: var(--l-cartera); --rc-ink: var(--l-cartera-ink); }
.roundel--economia { --rc: var(--l-economia); --rc-ink: var(--l-economia-ink); }
.roundel--simulador { --rc: var(--l-simulador); --rc-ink: var(--l-simulador-ink); }
.roundel--avisos { --rc: var(--l-avisos); --rc-ink: var(--l-avisos-ink); }
.roundel--inicio { --rc: var(--metro); --rc-ink: #fff; box-shadow: inset 0 0 0 2px #fff; }
.roundel--ok { --rc: var(--ok-fill); --rc-ink: #04210f; }
.roundel--bad { --rc: var(--bad-fill); --rc-ink: #fff; }

/* ---------- 5. Paneles: .panel (+ --hero con filete Metro de 2 px, --flat sin relleno) ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s-3); min-width: 0; }
.panel--hero { border: 2px solid var(--metro); }
:root[data-theme="dark"] .panel--hero { border-color: var(--action); }
.panel > :first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }
.panel-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--s-0) var(--s-1); font-size: var(--fs-md); font-weight: 800; line-height: 1.5; margin: 0 0 var(--s-2); }
.panel-title small, .panel-title .hint { font-weight: 400; font-size: var(--fs-xs); color: var(--ink-2); }
.panel--hero .panel-title { font-size: var(--fs-lg); margin-bottom: var(--s-1); }

/* ---------- 6. Botones: .btn (primario) · .btn--secondary · .btn--danger (siempre aislado del resto) · .btn--sm · .btn--block ---------- */
.btn, a.btn, button.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-1); min-height: 40px; padding: 0 var(--s-3); margin: 0; width: auto;
              border: 1px solid var(--action); border-radius: var(--radius); background: var(--action); color: var(--action-ink); font: 800 var(--fs-base)/1.2 var(--font);
              text-decoration: none; text-align: center; cursor: pointer; white-space: nowrap; transition: background-color var(--dur-state), border-color var(--dur-state), color var(--dur-state); }
.btn:hover { background: var(--action-hover); border-color: var(--action-hover); color: var(--action-ink); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn.btn--secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.btn--secondary:hover { background: var(--surface-2); border-color: var(--ink); color: var(--ink); }
.btn.btn--danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.btn--danger:hover { background: var(--bad); border-color: var(--bad); color: var(--surface); }
.btn.btn--sm { min-height: 32px; padding: 0 var(--s-2); font-size: var(--fs-sm); }
.btn.btn--block { display: flex; width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-2); }
.danger-zone { margin-top: var(--s-6); padding-top: var(--s-3); border-top: 1px solid var(--line); }  /* las acciones destructivas van aisladas, al final */
.link-more { display: inline-flex; align-items: center; gap: var(--s-1); font-weight: 800; }

/* ---------- 7. Campos: .field (etiqueta + control + ayuda/error) · .input · .select ---------- */
.field { display: flex; flex-direction: column; gap: var(--s-0); min-width: 0; margin: 0; border: 0; padding: 0; }
.field-label, .field > label, legend.field-label { display: block; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); margin: 0 0 var(--s-0); padding: 0; line-height: 1.3; }
.field-hint { font-size: var(--fs-xs); color: var(--ink-2); margin: 0; }
.field-error { display: flex; align-items: center; gap: var(--s-0); font-size: var(--fs-xs); font-weight: 600; color: var(--bad); margin: 0; }
.field .input, .field .select, .input, .select { height: 40px; margin: 0; padding: 0 var(--s-2); border: 1px solid var(--line-strong); border-radius: var(--radius); background-color: var(--surface);
                      color: var(--ink); font: 600 var(--fs-md)/1 var(--font); width: 100%; transition: border-color var(--dur-state), box-shadow var(--dur-state); }
.input.num { font-family: var(--font); font-variant-numeric: tabular-nums lining-nums; font-variant-numeric: tabular-nums; }
.input:hover, .select:hover { border-color: var(--ink); }
.input:focus, .select:focus { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 30%, transparent); outline: none; }
.input:focus-visible, .select:focus-visible { outline: none; }
.input[aria-invalid="true"], .field.has-error .input { border-color: var(--bad); }
.input:disabled { background: var(--surface-2); color: var(--ink-2); }
.input-affix { position: relative; display: block; }
.input-affix .input { padding-right: var(--s-5); }
.input-affix .affix { position: absolute; right: var(--s-2); top: 50%; transform: translateY(-50%); font: 600 var(--fs-md) var(--font); color: var(--ink-2); pointer-events: none; }

/* ---------- 8. Segmentado: <fieldset class="segmented"> con radios · Casilla: <label class="check"> ---------- */
.segmented { display: flex; width: 100%; max-width: 320px; margin: 0; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.segmented > label { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; min-height: 38px; margin: 0; padding: 0 var(--s-1);
                     font-weight: 600; font-size: var(--fs-base); color: var(--ink); cursor: pointer; transition: background-color var(--dur-state), color var(--dur-state); }
.segmented > label + label { border-left: 1px solid var(--line-strong); }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.segmented > label:hover { background: var(--surface-2); }
.segmented > label:has(input:checked) { background: var(--action); color: var(--action-ink); font-weight: 800; }
.segmented > label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: -3px; }
.segmented > label:has(input:disabled) { opacity: .5; cursor: not-allowed; }

.check, label.check { display: flex; align-items: center; gap: var(--s-1); min-height: 40px; margin: 0; font-weight: 600; font-size: var(--fs-base); color: var(--ink); cursor: pointer; line-height: 1.3; }
.check input[type="checkbox"], .check input[type="radio"] { flex: none; width: 20px; height: 20px; margin: 0; }
.check input[type="checkbox"] { border-width: 2px; border-color: var(--line-strong); border-radius: var(--radius-sm); }

/* ---------- 9. Tablas: <table class="tbl"> (las tablas sin clase heredan el mismo aspecto) ----------
   Cabeceras ordenables (<th aria-sort>), cifras tabulares (td.num / th.num), columnas fijas con table-layout: fixed + <col class="w-*">. */
table { width: 100%; border-collapse: collapse; border-spacing: 0; }
th { font-family: var(--font); font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); text-align: left; padding: 0 var(--s-1) var(--s-1); border-bottom: 2px solid var(--ink); background: transparent; vertical-align: bottom; line-height: 1.25; }
td { padding: 12px var(--s-1); border-bottom: 1px solid var(--line-2); font-size: var(--fs-sm); line-height: 1.3; vertical-align: top; background: transparent; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
td.num, th.num, td.right, th.right { text-align: right; }
th.num { font-family: var(--font); font-weight: 600; }
td.num { white-space: nowrap; }
.tbl--fixed { table-layout: fixed; }
.w-xs { width: 5rem; } .w-sm { width: 6.5rem; } .w-md { width: 8.5rem; } .w-lg { width: 11rem; }
.tbl caption { text-align: left; font-weight: 800; padding-bottom: var(--s-1); }
.tbl-wrap { overflow-x: auto; }
.sort-btn { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 0; margin: 0; width: auto; min-height: 0; font: inherit; font-weight: 600; color: inherit; cursor: pointer; text-align: inherit; }
.sort-btn:hover { color: var(--ink); text-decoration: underline; }
.sort-arrow { display: inline-block; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; opacity: 0; }
th[aria-sort="ascending"] .sort-arrow { border-bottom: 5px solid currentColor; opacity: 1; }
th[aria-sort="descending"] .sort-arrow { border-top: 5px solid currentColor; opacity: 1; }
th[aria-sort="ascending"], th[aria-sort="descending"] { color: var(--ink); }
th[aria-sort="ascending"] .sort-btn, th[aria-sort="descending"] .sort-btn { color: var(--ink); }
.sort-link { color: inherit; font-weight: 600; text-decoration: none; }
.sort-link:hover { text-decoration: underline; }
.sort-link.active { color: var(--ink); }

/* ---------- 10. Veredictos y etiquetas: SIEMPRE icono + texto ----------
   <span class="verdict up|flat|down|none"><svg class="ic">…</svg> Puede subir</span> (ver web/templates/web/_verdict.html) */
.verdict { display: inline; font-weight: 800; white-space: nowrap; }  /* en línea: el icono (1.15em) baja .2em y queda centrado óptico sobre la línea base de la frase */
.verdict .ic { margin-right: .1em; }
.verdict.up { color: var(--ok); } .verdict.down { color: var(--bad); } .verdict.flat { color: var(--ink); }
.verdict.none { color: var(--ink-2); font-weight: 400; }
.verdict-sub { display: block; font-weight: 400; white-space: normal; }
.tag, .chip { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; min-height: 22px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2);
              font-size: var(--fs-xs); font-weight: 600; line-height: 1.5; color: var(--ink); white-space: nowrap; }
.tag.ok, .chip.ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.tag.warn, .chip.warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.tag.bad, .chip.bad { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.tag.pending, .chip.pending { background: var(--pending-bg); color: var(--pending); border-style: dashed; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--radius); background: var(--l-avisos); color: var(--l-avisos-ink);
         font: 800 var(--fs-xs)/1 var(--font); }
/* Estados de una predicción (línea de predicciones de cada fondo): acierto relleno, fallo anulado, pendiente hueco */
.status-hit { color: var(--ok); } .status-miss { color: var(--bad); } .status-pending { color: var(--pending); }
.hit-text, .good-text { color: var(--ok); font-weight: 600; }
.bad-text, .warn-text, .curr-warn { color: var(--bad); font-weight: 600; }

/* ---------- 11. Avisos: <div class="alert alert--info|ok|warn|bad" role="status|alert"> icono + texto ----------
   (.notice[.ok|.warn|.bad|.info] es el nombre heredado de la misma pieza, sin icono.) */
.alert, .notice { display: flex; align-items: flex-start; gap: var(--s-1); padding: 12px var(--s-2); margin: 0 0 var(--s-2); border: 1px solid var(--line); border-radius: var(--radius);
                  background: var(--info-bg); color: var(--ink); font-size: var(--fs-base); line-height: 1.4; }
.notice { display: block; }
.alert > .ic { margin-top: 2px; }
.alert p, .notice p { margin: 0; }
.alert--info, .notice.info { background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 30%, var(--line)); } .alert--info > .ic { color: var(--info); }
.alert--ok, .notice.ok { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); } .alert--ok > .ic { color: var(--ok); }
.alert--warn, .notice.warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); } .alert--warn > .ic { color: var(--warn); }
.alert--bad, .notice.bad { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); } .alert--bad > .ic { color: var(--bad); }
.notice:not(.info, .ok, .warn, .bad) { background: var(--surface); }

/* ---------- 12. Anulado / sellado: nada desaparece, se tacha y se sella ----------
   <tr class="is-void"> … <span class="void-text">texto</span> … <span class="stamp">Anulado</span>   (o .stamp--expired «Caducada») */
.is-void { color: var(--ink-2); }
.is-void .void-text, .is-void td:not(.keep-text) { text-decoration: line-through; text-decoration-thickness: 1px; text-decoration-color: var(--ink-2); }
.is-void .num { color: var(--ink-2); }
.is-void .stamp, .is-void a, .is-void .verdict { text-decoration: none; }
.stamp { display: inline-block; padding: 1px 8px; border: 2px solid var(--bad); border-radius: var(--radius-sm); color: var(--bad); font: 800 var(--fs-xs)/1.4 var(--font);
         letter-spacing: .08em; text-transform: uppercase; transform: rotate(-3deg); white-space: nowrap; text-decoration: none; }
.stamp--expired { border-color: var(--pending); color: var(--pending); }
.stamp--sealed { border-color: var(--ink-2); color: var(--ink-2); }

/* ---------- 13. Estado vacío: <div class="empty-state"> icono + frase + acción ---------- */
.empty-state { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-1); padding: var(--s-3); border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--ink-2); }
.empty-state .ic { width: 28px; height: 28px; color: var(--ink-2); }
.empty-state p { margin: 0; max-width: 60ch; }
.empty-state strong { color: var(--ink); }
td.empty { text-align: center; color: var(--ink-2); }

/* ---------- 14. Paginación (.pager), migas (.crumbs) y pestañas (.tabs) ---------- */
.pager ul, ul.pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: var(--s-1); list-style: none; margin: var(--s-3) 0; padding: 0; }
.pager li { list-style: none; padding: 0; margin: 0; }
.pager a, .pager span.current { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; padding: 0 var(--s-2); border: 1px solid var(--line-strong);
                                border-radius: var(--radius); font-weight: 600; text-decoration: none; color: var(--ink); background: var(--surface); }
.pager a:hover { background: var(--surface-2); border-color: var(--ink); }
.pager [aria-current="page"], .pager span.current { background: var(--action); border-color: var(--action); color: var(--action-ink); font-weight: 800; }
.pager [aria-disabled="true"] { opacity: .5; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-0) var(--s-1); margin: 0 0 var(--s-2); font-size: var(--fs-sm); color: var(--ink-2); }
.crumbs a { color: var(--ink-2); }
.crumbs a:hover { color: var(--ink); }
.crumbs > * + *::before { content: "/"; margin-right: var(--s-1); color: var(--line-strong); }
/* Tira de pestañas (.tabs): enlaces en una fila con subrayado activo recto, como la barra Metro; en pantallas estrechas se desplaza en horizontal sin mover la página.
   <nav class="tabs" aria-label="…"><a href="…" aria-current="page">Sección</a> …</nav>  Se oculta al imprimir. */
.tabs, .tabstrip, .adm-tabs, .pf-tabs { display: flex; flex-wrap: nowrap; gap: 0; margin: 0 0 var(--s-3); padding: 0; max-width: 100%; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
                                         scrollbar-width: none; box-shadow: inset 0 -2px 0 var(--line); }
.tabs::-webkit-scrollbar, .tabstrip::-webkit-scrollbar { display: none; }
.tabs > a, .tabstrip > a, .adm-tabs > a, .pf-tabs > a { flex: none; display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--s-2); margin: 0; border: 0; border-bottom: 4px solid transparent; border-radius: 0; background: none;
                                          color: var(--ink-2); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; text-decoration: none; width: auto; }
.tabs > a:hover, .tabstrip > a:hover, .adm-tabs > a:hover, .pf-tabs > a:hover { color: var(--ink); background: var(--surface-2); border-bottom-color: var(--line-strong); text-decoration: none; }
.tabs > a[aria-current], .tabs > a.active, .tabstrip > a[aria-current], .adm-tabs > a[aria-current] { color: var(--ink); font-weight: 800; border-bottom-color: var(--metro); }
:root[data-theme="dark"] .tabs > a[aria-current], :root[data-theme="dark"] .tabstrip > a[aria-current], :root[data-theme="dark"] .tabs > a.active { border-bottom-color: var(--action); }
.tabs > a:focus-visible, .tabstrip > a:focus-visible { outline-offset: -3px; border-radius: 0; }
@media print { .tabs, .tabstrip, .adm-tabs, .pf-tabs { display: none !important; } }

/* Cabecera de página: título con su roundel y un filete fino a todo el ancho del color de la línea (nunca una barra lateral).
   <header class="page-head page-head--fondos"> <span class="roundel roundel--lg roundel--fondos">…</span> <h1>…</h1> </header> */
.page-head { display: flex; align-items: center; gap: var(--s-2); margin: 0 0 var(--s-2); padding-bottom: var(--s-1); border-bottom: 2px solid var(--rc, var(--line)); }
.page-head:has(.roundel--fondos) { --rc: var(--l-fondos); } .page-head:has(.roundel--planes) { --rc: var(--l-planes); } .page-head:has(.roundel--depositos) { --rc: var(--l-depositos); }
.page-head:has(.roundel--inversiones) { --rc: var(--l-inversiones); } .page-head:has(.roundel--cartera) { --rc: var(--l-cartera); } .page-head:has(.roundel--economia) { --rc: var(--l-economia); }
.page-head:has(.roundel--simulador) { --rc: var(--l-simulador); } .page-head:has(.roundel--avisos) { --rc: var(--l-avisos); }
.page-head--fondos { --rc: var(--l-fondos); } .page-head--planes { --rc: var(--l-planes); } .page-head--depositos { --rc: var(--l-depositos); } .page-head--inversiones { --rc: var(--l-inversiones); }
.page-head--cartera { --rc: var(--l-cartera); } .page-head--economia { --rc: var(--l-economia); } .page-head--simulador { --rc: var(--l-simulador); } .page-head--avisos { --rc: var(--l-avisos); }

/* ---------- 15. LÍNEA DE ESTACIONES: .metro-line (componente firma, reutilizable) ----------
   <ol class="metro-line [metro-line--mini] [trace]">
     <li class="station is-safe|is-risk|is-hub|is-active|is-empty [seg-*]">
       <span class="st-dot"></span> <span class="st-val num">3,07 %</span> <span class="st-label">Letra 12 m <em>detalle</em></span>
     </li> …
   - Tramo: cada estación dibuja el tramo hasta la siguiente con su --seg (color de la línea); la última no dibuja tramo.
     Colores: .is-safe (verde) · .is-risk (rojo) · .is-hub (transbordo: círculo grande de borde oscuro; su tramo sigue en rojo) ·
     .seg-fondos|planes|depositos|inversiones|cartera|economia fuerzan el color de familia (--l-*).
   - Estación: círculo con relleno de superficie y borde grueso; .is-active la agranda (borde Metro).
   - Variante vertical (móvil ≤ 720 px): la línea gira, las etiquetas pasan a la derecha. La variante --mini (selector de plazo) no gira.
   - Selector (signature interaction): en --mini cada estación es un <label class="station"> con <input type="radio" class="sr-only"> dentro; la elegida
     se agranda y pinta de color los tramos anteriores. Trazado: .trace dibuja la línea una vez al cargar (700 ms, ease-out exponencial). */
.metro-line { --row: 32px; --dot: 32px; --dot-bw: 6px; --track: 8px; --vcol: 56px;
              display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin: 0; padding: 0; list-style: none; position: relative; }
.metro-line > .station { --tone: var(--rail-idle); --seg: var(--tone); position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; margin: 0; padding: 0 var(--s-0); min-width: 0; list-style: none; }
.metro-line > .station::before { content: ""; position: absolute; z-index: 0; left: 50%; width: 100%; top: calc(var(--row) / 2 - var(--track) / 2); height: var(--track); background: var(--seg); }
.metro-line > .station:last-child::before { display: none; }
.metro-line .st-dot { position: relative; z-index: 1; flex: none; box-sizing: border-box; width: var(--dot); height: var(--dot); margin-block: calc((var(--row) - var(--dot)) / 2); border-radius: var(--radius-round);
                      background: var(--surface); border: var(--dot-bw) solid var(--tone); transition: border-color var(--dur-state), width var(--dur-state), height var(--dur-state); }
.metro-line .st-val { margin-top: var(--s-1); font: 800 var(--fs-2xl)/1.4 var(--font); font-variant-numeric: tabular-nums lining-nums; color: var(--ink); white-space: nowrap; }
.metro-line .st-label { margin-top: 0; max-width: 11rem; font-size: var(--fs-xs); font-weight: 600; line-height: 1.35; color: var(--ink-2); text-wrap: balance; }
.metro-line .st-label em { display: block; font-style: normal; font-weight: 400; }
.station.is-safe { --tone: var(--rail-safe); }
.station.is-risk { --tone: var(--rail-risk); }
.station.is-hub { --tone: var(--ink); --seg: var(--rail-risk); --dot: 56px; --dot-bw: 8px; }
.station.is-hub .st-val { font-size: var(--fs-xl); margin-top: var(--s-1); }
.station.is-hub .st-label { color: var(--ink); font-weight: 800; }
.station.is-active .st-dot { --dot: 32px; --dot-bw: 6px; border-color: var(--metro); }
:root[data-theme="dark"] .station.is-active .st-dot { border-color: var(--action); }
.station.is-empty .st-dot { border-style: dashed; border-color: var(--pending-fill); }
.station.is-empty .st-val { color: var(--ink-2); }
.seg-fondos { --seg: var(--l-fondos); } .seg-planes { --seg: var(--l-planes); } .seg-depositos { --seg: var(--l-depositos); }
.seg-inversiones { --seg: var(--l-inversiones); } .seg-cartera { --seg: var(--l-cartera); } .seg-economia { --seg: var(--l-economia); }
.dot-fondos { --tone: var(--l-fondos); } .dot-planes { --tone: var(--l-planes); } .dot-depositos { --tone: var(--l-depositos); }
.dot-inversiones { --tone: var(--l-inversiones); } .dot-cartera { --tone: var(--l-cartera); } .dot-economia { --tone: var(--l-economia); }

/* Mini línea (selector de plazo): estaciones pequeñas, la elegida se agranda; los tramos hasta la elegida se colorean */
.metro-line--mini { --row: 32px; --dot: 20px; --dot-bw: 4px; --track: 6px; }
.metro-line--mini > .station, .metro-line--mini > label.station { width: auto; margin: 0; --tone: var(--line-strong); --seg: var(--rail-idle); cursor: pointer; padding: 0; min-height: var(--tap); }
.metro-line--mini > .station:has(~ .station input:checked) { --seg: var(--rail-safe); }
.metro-line--mini > .station:has(input:checked) { --tone: var(--rail-safe); }
.metro-line--mini > .station:has(~ .station input:checked) { --tone: var(--rail-safe); }
.metro-line--mini > .station:has(input:checked) .st-dot { --dot: 32px; --dot-bw: 6px; border-color: var(--metro); }
:root[data-theme="dark"] .metro-line--mini > .station:has(input:checked) .st-dot { border-color: var(--action); }
.metro-line--mini > .station:hover .st-dot { border-color: var(--ink); }
.metro-line--mini > .station:has(input:focus-visible) .st-dot { outline: 3px solid var(--focus); outline-offset: 3px; }
.metro-line--mini .st-label { margin-top: var(--s-1); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); max-width: none; }
.metro-line--mini > .station:has(input:checked) .st-label { color: var(--ink); font-weight: 800; }
.metro-line--mini > .station > input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
/* Los tramos de la mini línea nacen en el centro de la primera estación y acaban en el de la última */

/* Trazado: la línea se dibuja una vez, de izquierda a derecha (arriba abajo en vertical). Estado por defecto = todo visible. */
@keyframes metro-trace-x { from { clip-path: inset(-24px 100% -24px 0); } }
@keyframes metro-trace-y { from { clip-path: inset(0 -24px 100% -24px); } }
@media (prefers-reduced-motion: no-preference) {
  .metro-line.trace { animation: metro-trace-x var(--dur-trace) var(--ease-out) both; }
}

@media (max-width: 720px) {
  .metro-line:not(.metro-line--mini) { grid-auto-flow: row; grid-auto-columns: auto; }
  .metro-line:not(.metro-line--mini) > .station { display: grid; grid-template-columns: var(--vcol) minmax(0, 1fr); grid-template-rows: auto auto; column-gap: var(--s-2); justify-items: start; align-items: center;
                                                  text-align: left; min-height: 72px; padding: var(--s-1) 0; }
  .metro-line:not(.metro-line--mini) > .station::before { left: calc(var(--vcol) / 2 - var(--track) / 2); top: 50%; width: var(--track); height: 100%; }
  .metro-line:not(.metro-line--mini) .st-dot { grid-column: 1; grid-row: 1 / span 2; justify-self: center; margin-block: 0; }
  .metro-line:not(.metro-line--mini) .st-val { grid-column: 2; grid-row: 1; margin: 0; font-size: var(--fs-lg); line-height: 1.3; align-self: end; }
  .metro-line:not(.metro-line--mini) .st-label { grid-column: 2; grid-row: 2; margin: 0; max-width: none; align-self: start; font-size: var(--fs-sm); }
  .metro-line:not(.metro-line--mini) .station.is-hub .st-val { font-size: var(--fs-lg); }
  @media (prefers-reduced-motion: no-preference) {
    .metro-line.trace:not(.metro-line--mini) { animation-name: metro-trace-y; }
  }
}
@media (max-width: 480px) {
  .metro-line--mini .st-label { font-size: var(--fs-xs); }
}
@media (forced-colors: active) {
  .metro-line > .station::before { background: CanvasText; }
  .metro-line .st-dot { border-color: CanvasText; }
}

/* ---------- 16. Utilidades ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.muted { color: var(--ink-2); }
.nowrap { white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: var(--s-2); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-2); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; scroll-behavior: auto !important; } }
