/* ==========================================================
   NBS Automatic — Design System
   Tokens, reset, typography, shared components
   v2.0.0 | 2026-08-06 — FASE 1: fundamentos premium (aditivo)
   v1.0.0 | 2026-07-30
   Fonts: Inter (Apache-2.0), Fraunces (SIL OFL 1.1)

   v2.0.0 no modifica ni elimina nada de v1.0.0: landing, dashboard y
   detalle siguen renderizando exactamente igual. Añade la escala
   tipográfica, la paleta funcional de datos y los componentes que
   necesitarán el dashboard (F3), el detalle (F4), el gráfico (F5) y la
   tabla (F6) — ninguno de ellos se usa todavía en producción.
   ========================================================== */

/* ----------------------------------------------------------
   1. FONT FACES
   ---------------------------------------------------------- */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../assets/fonts/fraunces/fraunces-latin-upright.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('../assets/fonts/fraunces/fraunces-latin-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../assets/fonts/inter/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
    U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ----------------------------------------------------------
   2. DESIGN TOKENS
   ---------------------------------------------------------- */
:root {
  /* --- Color palette --- */
  --night:    #0A1628;  /* hero, footer, dark sections */
  --navy:     #1C3557;  /* primary dark, CTAs secondary */
  --ink:      #111827;  /* primary text */
  --body-c:   #374151;  /* body copy */
  --muted:    #6B7280;  /* labels, secondary text */
  --subtle:   #9CA3AF;  /* placeholders, captions */
  --border:   #E5E7EB;  /* dividers, card borders */
  --surface:  #F9F7F4;  /* page background */
  --white:    #FFFFFF;

  /* --- Accent --- */
  --amber:   #C47C1A;   /* primary CTAs, highlights */
  --amber-h: #A8661A;   /* amber hover */
  --amber-l: #FEF9F0;   /* amber light background */

  /* --- Semantic --- */
  --success:   #15803D;
  --success-l: #F0FDF4;
  --error:     #DC2626;
  --error-l:   #FEF2F2;

  /* --- Typography --- */
  --font-d: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-b: 'Inter', system-ui, -apple-system, sans-serif;

  /* --- Radii --- */
  --r-xs:  2px;
  --r-sm:  4px;
  --r-md:  8px;
  --r-lg:  12px;
  --r-xl:  20px;
  --r-full: 9999px;

  /* --- Shadows --- */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.06);

  /* --- Layout --- */
  --max: 1120px;
  --gap: 80px;
  --section-v: 96px;

  /* --- Borders --- */
  --border-1: 1px solid var(--border);
  --border-form: 1.5px solid var(--border);

  /* --- Transitions --- */
  --t-fast: .15s ease;
  --t-base: .2s ease;
  --t-slow: .3s ease;

  /* --- Z-index --- */
  --z-nav: 100;
  --z-modal: 200;
  --z-toast: 300;

  /* ============================================================
     v2.0.0 — FASE 1: fundamentos premium (aditivo, ver §14 en
     adelante). Nada de lo anterior cambia de valor.
     ============================================================ */

  /* --- Type scale: tamaño responsive por clamp(), peso, interlineado --- */
  --fs-display: clamp(2.25rem, 1.4rem + 3vw, 3.75rem);
  --fs-h1:      clamp(1.875rem, 1.4rem + 1.8vw, 2.75rem);
  --fs-h2:      clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem);
  --fs-h3:      clamp(1.25rem, 1.1rem + .6vw, 1.5rem);
  --fs-h4:      1.125rem;
  --fs-lede:    clamp(1.0625rem, 1rem + .3vw, 1.25rem);
  --fs-body:    1rem;
  --fs-small:   .875rem;
  --fs-caption: .75rem;
  --fs-micro:   .6875rem;

  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;

  --lh-tight:   1.1;
  --lh-snug:    1.25;
  --lh-base:    1.5;
  --lh-relaxed: 1.7;

  /* --- Spacing scale (referencia para F2-F8; no reescribe valores ya
         usados en producción) --- */
  --sp-1: 4px;  --sp-2: 8px;   --sp-3: 12px;  --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px;  --sp-8: 32px;  --sp-10: 40px;
  --sp-12: 48px; --sp-16: 64px; --sp-20: 80px; --sp-24: 96px;

  /* --- Paleta funcional de datos ---
     Ninguna se usa sola como único portador de significado: cada estado
     visual combina color + forma/icono/patrón (ver §16 Badges y §19
     Chart). Ratios verificados con la fórmula WCAG de luminancia
     relativa, no a ojo. */
  --data-current:       var(--navy);              /* 12.38:1 sobre blanco — texto y trazo principal */
  --data-down:          var(--success);            /*  5.02:1 — bajada de precio, buena noticia */
  --data-up:             var(--error);              /*  4.83:1 — subida de precio */
  --data-min:            var(--amber);              /*  3.36:1 — SOLO gráfico/icono (umbral 3:1 no-texto), nunca texto de cuerpo */
  --data-min-label:      var(--amber-h);            /*  4.58:1 — usar esta variante para la ETIQUETA de texto junto al hito */
  --data-min-l:          var(--amber-l);
  --data-legacy:         var(--subtle);             /*  2.54:1 — decorativo; el estado "legacy" nunca se afirma solo con este color, siempre + patrón discontinuo + etiqueta */
  --data-partial:        #B45309;                   /*  5.02:1 */
  --data-partial-l:      #FFFBEB;
  --data-complete:       var(--success);
  --data-expired:        #64748B;                   /*  4.76:1 */
  --warning:              #B45309;                   /*  5.02:1 — mismo valor que --data-partial: misma familia semántica ("necesita atención") */
  --warning-l:            #FFFBEB;
  --data-selection:       rgba(28, 53, 87, .12);      /* área de selección del gráfico, sobre --navy */
  --data-selection-ring:  var(--navy);

  /* --- Bordes y superficies auxiliares (v2), para no repetir hex sueltos --- */
  --amber-border:   #F5D9A0;   /* mismo tono que ya usaba .badge--amber en v1.0.0 */
  --card-hover-border: #D1D9E2; /* mismo tono que ya usaba .alert-card:hover */
  --skeleton-a: var(--border);
  --skeleton-b: #EFEDE9;
}

/* ----------------------------------------------------------
   3. RESET
   ---------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  font-family: var(--font-b);
  font-size: 16px;
  line-height: 1.6;
  color: var(--body-c);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul, ol { list-style: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ----------------------------------------------------------
   4. TYPOGRAPHY UTILITIES
   ---------------------------------------------------------- */
.t-eyebrow {
  font-family: var(--font-b);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.t-h2 {
  font-family: var(--font-d);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -.015em;
  color: var(--ink);
}
.t-body {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--body-c);
}
.t-small {
  font-size: .875rem;
  line-height: 1.6;
  color: var(--muted);
}
.t-caption {
  font-size: .75rem;
  line-height: 1.5;
  color: var(--subtle);
}

/* ----------------------------------------------------------
   5. LAYOUT
   ---------------------------------------------------------- */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}
.section { padding: var(--gap) 0; }
.section--dark { background: var(--night); color: var(--white); }
.section--alt  { background: var(--white); }
.section--surface { background: var(--surface); }

.skip-link {
  position: absolute;
  top: -100%;
  left: 12px;
  z-index: 9999;
  padding: 8px 16px;
  background: var(--amber);
  color: var(--white);
  border-radius: var(--r-sm);
  font-size: .875rem;
  font-weight: 500;
}
.skip-link:focus { top: 12px; }

/* ----------------------------------------------------------
   6. NAVIGATION
   ---------------------------------------------------------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  height: 64px;
  transition: background var(--t-slow), box-shadow var(--t-slow);
}
.nav.scrolled {
  background: var(--night);
  box-shadow: 0 2px 20px rgba(0,0,0,.25);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}
.nav__logo {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.nav__logo-mark {
  font-family: var(--font-d);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--white);
  line-height: 1;
}
.nav__logo-sub {
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .05em;
  color: rgba(255,255,255,.5);
  text-transform: uppercase;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav__link {
  font-size: .875rem;
  font-weight: 450;
  color: rgba(255,255,255,.7);
  transition: color var(--t-base);
}
.nav__link:hover { color: var(--white); }
.nav__cta {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 18px;
  background: var(--amber);
  color: var(--white);
  font-size: .875rem;
  font-weight: 500;
  border-radius: var(--r-sm);
  transition: background var(--t-base);
}
.nav__cta:hover { background: var(--amber-h); }
@media (max-width: 640px) {
  .nav__links { gap: 14px; }
  .nav__link--hide { display: none; }
}

/* ----------------------------------------------------------
   7. BUTTONS
   ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 28px;
  font-family: var(--font-b);
  font-size: .9375rem;
  font-weight: 500;
  border-radius: var(--r-sm);
  transition: background var(--t-base), color var(--t-base), border-color var(--t-base);
  white-space: nowrap;
  cursor: pointer;
  border: none;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn--primary { background: var(--amber); color: var(--white); }
.btn--primary:hover { background: var(--amber-h); }

.btn--ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255,255,255,.3);
}
.btn--ghost:hover { border-color: rgba(255,255,255,.6); }

.btn--outline {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--navy);
}
.btn--outline:hover { background: var(--navy); color: var(--white); }

.btn--navy { background: var(--navy); color: var(--white); }
.btn--navy:hover { background: #264a73; }

.btn--sm { height: 40px; padding: 0 20px; font-size: .875rem; }
.btn--sm svg { width: 15px; height: 15px; }

/* ----------------------------------------------------------
   8. FORMS
   ---------------------------------------------------------- */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 5px;
}
.form-input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: var(--border-form);
  border-radius: var(--r-sm);
  font-family: var(--font-b);
  font-size: .9375rem;
  color: var(--ink);
  background: var(--white);
  transition: border-color var(--t-base);
  appearance: none;
}
.form-input:focus {
  outline: none;
  border-color: var(--navy);
}
.form-input::placeholder { color: var(--subtle); }
.form-input.error { border-color: var(--error); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 400px) { .form-row { grid-template-columns: 1fr; } }

/* ----------------------------------------------------------
   9. BADGE
   ---------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: .75rem;
  font-weight: 500;
}
.badge--amber {
  background: var(--amber-l);
  color: var(--amber);
  border: 1px solid #F5D9A0;
}
.badge--success {
  background: var(--success-l);
  color: var(--success);
  border: 1px solid #BBF7D0;
}
.badge--navy {
  background: var(--navy);
  color: var(--white);
}
.badge svg { width: 12px; height: 12px; }

/* ----------------------------------------------------------
   10. DIVIDER
   ---------------------------------------------------------- */
.divider {
  border: none;
  border-top: var(--border-1);
  margin: 0;
}

/* ----------------------------------------------------------
   11. UTILITY CLASSES
   ---------------------------------------------------------- */
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-36 { margin-top: 36px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ----------------------------------------------------------
   12. ACCESSIBILITY FOCUS
   ---------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

/* ----------------------------------------------------------
   13. FOOTER (shared)
   ---------------------------------------------------------- */
.footer { background: var(--night); padding: 60px 0 36px; }
.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}
.footer__brand-name {
  font-family: var(--font-d);
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--white);
  margin-bottom: 8px;
}
.footer__brand-desc {
  font-size: .875rem;
  line-height: 1.6;
  color: rgba(255,255,255,.42);
  max-width: 260px;
}
.footer__brand-email {
  display: inline-block;
  margin-top: 14px;
  font-size: .8125rem;
  color: rgba(255,255,255,.42);
  transition: color var(--t-base);
}
.footer__brand-email:hover { color: rgba(255,255,255,.65); }
.footer__col-title {
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  margin-bottom: 14px;
}
.footer__links { display: flex; flex-direction: column; gap: 9px; }
.footer__links a {
  font-size: .875rem;
  color: rgba(255,255,255,.52);
  transition: color var(--t-base);
}
.footer__links a:hover { color: rgba(255,255,255,.82); }
.footer__bottom {
  border-top: 1px solid rgba(255,255,255,.07);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.footer__copy { font-size: .8125rem; color: rgba(255,255,255,.28); }
.footer__note { font-size: .75rem; color: rgba(255,255,255,.18); max-width: 440px; text-align: right; }
@media (max-width: 620px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__note { text-align: left; }
}
@media (max-width: 420px) {
  .footer__grid { grid-template-columns: 1fr; }
}

/* ============================================================
   v2.0.0 — FASE 1: FUNDAMENTOS PREMIUM (aditivo)
   Todo lo de aquí en adelante usa clases nuevas que hoy no renderiza
   ninguna página en producción. Se activan página por página en F2-F6.
   ============================================================ */

/* ----------------------------------------------------------
   14. TYPOGRAPHY — escala completa
   ---------------------------------------------------------- */
.t-display {
  font-family: var(--font-d);
  font-size: var(--fs-display);
  font-weight: var(--fw-regular);
  line-height: var(--lh-tight);
  letter-spacing: -.02em;
  color: var(--ink);
}
.t-h1 {
  font-family: var(--font-d);
  font-size: var(--fs-h1);
  font-weight: var(--fw-regular);
  line-height: var(--lh-tight);
  letter-spacing: -.015em;
  color: var(--ink);
}
.t-h3 {
  font-family: var(--font-d);
  font-size: var(--fs-h3);
  font-weight: var(--fw-regular);
  line-height: var(--lh-snug);
  color: var(--ink);
}
.t-h4 {
  font-family: var(--font-b);
  font-size: var(--fs-h4);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  color: var(--ink);
}
.t-lede {
  font-family: var(--font-b);
  font-size: var(--fs-lede);
  line-height: var(--lh-relaxed);
  color: var(--body-c);
}
.t-micro {
  font-size: var(--fs-micro);
  line-height: var(--lh-base);
  color: var(--subtle);
  letter-spacing: .02em;
}
/* Cifras (precios, IDs, códigos IATA): mantiene el ancho de cada dígito
   para que una columna de precios no "baile" al cambiar el valor. */
.t-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* ----------------------------------------------------------
   15. LINKS (cuerpo de texto, distinto de .nav__link / .footer__links)
   ---------------------------------------------------------- */
.link {
  color: var(--navy);
  text-underline-offset: 3px;
  text-decoration: underline;
  text-decoration-color: rgba(28,53,87,.35);
  transition: color var(--t-base), text-decoration-color var(--t-base);
}
.link:hover { color: var(--amber-h); text-decoration-color: currentColor; }

/* ----------------------------------------------------------
   16. BADGES — variantes que faltaban
   ---------------------------------------------------------- */
.badge--warning {
  background: var(--warning-l);
  color: var(--warning);
  border: 1px solid var(--amber-border);
}
.badge--legacy {
  background: var(--white);
  color: var(--muted);              /* 4.83:1 — el texto siempre en --muted; --data-legacy queda para lo decorativo (borde, puntos del gráfico) */
  border: 1px dashed var(--border);
}
.badge--partial {
  background: var(--data-partial-l);
  color: var(--data-partial);
  border: 1px dashed var(--amber-border);
}
.badge--expired {
  background: var(--white);
  color: var(--data-expired);
  border: 1px solid var(--border);
  text-decoration: line-through;
  opacity: .85;
}

/* ----------------------------------------------------------
   17. BUTTONS — estado disabled (faltaba)
   ---------------------------------------------------------- */
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}
.form-input:disabled { background: var(--surface); color: var(--subtle); cursor: not-allowed; }

/* Selector nativo con flecha propia, coherente entre navegadores */
select.form-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%236B7280' stroke-width='1.5'%3E%3Cpath d='M5 7.5 10 12.5 15 7.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
/* Input de fecha: sólo se puede recolorear el icono del selector nativo
   en navegadores basados en Chromium; el calendario emergente es del
   sistema operativo y no se puede restilizar sin un datepicker propio
   (fuera de alcance de la Fase 1 — "no añadir librerías nuevas"). */
input[type="date"].form-input::-webkit-calendar-picker-indicator {
  opacity: .55;
}

/* ----------------------------------------------------------
   18. CARD — primitiva genérica (F3/F4 la adoptarán; .alert-card de
   hoy no se toca)
   ---------------------------------------------------------- */
.card {
  background: var(--white);
  border: var(--border-1);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-6);
  transition: box-shadow var(--t-base), border-color var(--t-base);
}
.card:hover { box-shadow: var(--shadow-md); border-color: var(--card-hover-border); }
.card--flat { box-shadow: none; }
.card--dark { background: var(--night); border-color: rgba(255,255,255,.08); color: var(--white); }

/* ----------------------------------------------------------
   19. CHART — lenguaje visual (F5). Sin datos ficticios: estas clases
   sólo definen trazo, color y forma; los números vienen siempre de
   price_observations.
   ---------------------------------------------------------- */
.chart__line--primary  { stroke: var(--data-current); stroke-width: 2.5; fill: none; }
.chart__line--secondary{ stroke: var(--subtle); stroke-width: 1.5; stroke-dasharray: 3 4; fill: none; opacity: .55; }
.chart__area--selection { fill: var(--data-selection); stroke: none; }
.chart__point--current { fill: var(--data-current); stroke: var(--white); stroke-width: 2; }
.chart__point--min      { fill: var(--data-min); stroke: var(--white); stroke-width: 2; }
.chart__point--legacy   { fill: var(--white); stroke: var(--data-legacy); stroke-width: 1.5; stroke-dasharray: 2 2; }
.chart__point--current:focus-visible,
.chart__point--min:focus-visible,
.chart__point--legacy:focus-visible {
  outline: 2px solid var(--data-selection-ring);
  outline-offset: 2px;
}
.chart__legend { display: flex; gap: var(--sp-5); flex-wrap: wrap; font-size: var(--fs-small); color: var(--muted); }
.chart__legend-item { display: inline-flex; align-items: center; gap: 6px; }
.chart__legend-swatch { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.chart__filterbar { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.chart__filter {
  height: 32px; padding: 0 14px; border-radius: var(--r-full);
  border: var(--border-1); background: var(--white); color: var(--muted);
  font-size: var(--fs-small); font-weight: var(--fw-medium); cursor: pointer;
  transition: border-color var(--t-base), color var(--t-base), background var(--t-base);
}
.chart__filter[aria-pressed="true"] { background: var(--navy); color: var(--white); border-color: var(--navy); }
.chart__filter:hover:not([aria-pressed="true"]) { border-color: var(--navy); color: var(--navy); }

/* ----------------------------------------------------------
   20. TOOLTIP (compartido por gráfico y tabla)
   ---------------------------------------------------------- */
.tooltip { position: relative; display: inline-block; }
.tooltip__bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  max-width: 300px;
  background: var(--night);
  color: var(--white);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-small);
  line-height: var(--lh-base);
  z-index: var(--z-modal);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast);
}
.tooltip__bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--night);
}
.tooltip:hover .tooltip__bubble,
.tooltip:focus-within .tooltip__bubble,
.tooltip[data-open="true"] .tooltip__bubble { opacity: 1; }
.tooltip__row { display: flex; justify-content: space-between; gap: var(--sp-4); }
.tooltip__row + .tooltip__row { margin-top: 4px; }
.tooltip__label { color: rgba(255,255,255,.55); }

/* ----------------------------------------------------------
   21. TABLE (F6 — tabla histórica)
   ---------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: var(--border-1); border-radius: var(--r-lg); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.table thead th {
  text-align: left;
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: var(--border-1);
  white-space: nowrap;
}
.table tbody td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: var(--border-1);
  color: var(--body-c);
  vertical-align: middle;
}
.table tbody tr:hover td { background: var(--amber-l); }
.table tbody tr:last-child td { border-bottom: none; }
.table td.is-numeric { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.is-legacy td { color: var(--muted); border-bottom-style: dashed; }
.table__expand-btn {
  width: 22px; height: 22px; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); transition: transform var(--t-base);
}
.table__row-detail { background: var(--surface); }
.table__pagination { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-3) var(--sp-4); }

/* ----------------------------------------------------------
   22. SKELETON (carga)
   ---------------------------------------------------------- */
.skeleton {
  background: linear-gradient(90deg, var(--skeleton-a) 25%, var(--skeleton-b) 37%, var(--skeleton-a) 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: var(--r-sm);
}
@keyframes skeleton-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; background: var(--border); }
}

/* ----------------------------------------------------------
   23. STATE BLOCK (error / 404 / vacío — generaliza .empty-state)
   ---------------------------------------------------------- */
.state-block {
  max-width: 46ch;
  margin: 0 auto;
  padding: var(--sp-12) var(--sp-4);
  text-align: center;
}
.state-block__icon {
  width: 48px; height: 48px; margin: 0 auto var(--sp-4);
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--muted);
}
.state-block--error .state-block__icon { background: var(--error-l); color: var(--error); }
.state-block--404 .state-block__icon   { background: var(--surface); color: var(--subtle); }
.state-block__title { font-family: var(--font-d); font-size: var(--fs-h3); font-weight: var(--fw-regular); color: var(--ink); margin-bottom: var(--sp-2); }
.state-block__sub { font-size: var(--fs-body); color: var(--muted); line-height: var(--lh-relaxed); }

/* ----------------------------------------------------------
   24. TOAST (usado por NBS.toast en shared.js, sin estilos propios hasta ahora)
   ---------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: var(--sp-6);
  left: 50%;
  transform: translateX(-50%);
  min-width: 260px;
  max-width: 90vw;
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-md);
  background: var(--night);
  color: var(--white);
  font-size: var(--fs-small);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-toast);
}
.toast--error { background: var(--error); }
.toast--success { background: var(--success); }
