/*
 * Newfish BI Portal — Design System
 * theme.css v1.0
 *
 * Philosophy: Notion's cleanliness + Linear's precision + McKinsey's authority
 * Grid base: 4px | Font: Inter | Radius: 8–12px
 *
 * Table of Contents
 * ─────────────────────────────────────────────
 * 1.  Google Fonts Import
 * 2.  CSS Custom Properties (Light Mode)
 * 3.  Dark Mode Overrides
 * 4.  Reset & Base
 * 5.  Layout: Shell, TopNav, Sidebar, Main
 * 6.  Cards & KPI Tiles
 * 7.  Alert Cards (War Room)
 * 8.  Data Tables
 * 9.  Callout & Tooltip
 * 10. Skeleton Loaders
 * 11. Collapsible Groups
 * 12. Empty State
 * 13. Badges & Pills
 * 14. Utility Classes
 * 15. Responsive Breakpoints
 * ─────────────────────────────────────────────
 */

/* ============================================================
   1. GOOGLE FONTS
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');


/* ============================================================
   2. CSS CUSTOM PROPERTIES — LIGHT MODE
   ============================================================ */
:root {

  /* --- Typography scale --- */
  --text-xs:   12px;
  --text-sm:   14px;
  --text-base: 16px;
  --text-lg:   18px;
  --text-xl:   20px;
  --text-2xl:  24px;
  --text-3xl:  32px;
  --text-4xl:  40px;

  --weight-normal:   400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  --leading-tight:  1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;

  /* --- Spacing (4px grid) --- */
  --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;

  /* --- Border radius --- */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-full: 9999px;

  /* --- Primary: Blue --- */
  --color-primary-50:  #eff6ff;
  --color-primary-100: #dbeafe;
  --color-primary-200: #bfdbfe;
  --color-primary-300: #93c5fd;
  --color-primary-400: #60a5fa;
  --color-primary-500: #3f92d6;
  --color-primary-600: #1E73BE;
  --color-primary-700: #15588f;
  --color-primary-800: #1e40af;
  --color-primary-900: #1e3a8a;

  /* --- Neutral: Slate --- */
  --color-slate-50:  #f8fafc;
  --color-slate-100: #f1f5f9;
  --color-slate-200: #e2e8f0;
  --color-slate-300: #cbd5e1;
  --color-slate-400: #94a3b8;
  --color-slate-500: #64748b;
  --color-slate-600: #475569;
  --color-slate-700: #334155;
  --color-slate-800: #1e293b;
  --color-slate-900: #0f172a;
  --color-slate-950: #020617;

  /* --- Semantic --- */
  --color-success-50:  #f0fdf4;
  --color-success-100: #dcfce7;
  --color-success-500: #22c55e;
  --color-success-600: #16a34a;
  --color-success-700: #15803d;

  --color-warning-50:  #fffbeb;
  --color-warning-100: #fef3c7;
  --color-warning-500: #f59e0b;
  --color-warning-600: #d97706;
  --color-warning-700: #b45309;

  --color-danger-50:  #fff1f2;
  --color-danger-100: #ffe4e6;
  --color-danger-500: #ef4444;
  --color-danger-600: #dc2626;
  --color-danger-700: #b91c1c;

  --color-info-50:  #eff6ff;
  --color-info-100: #dbeafe;
  --color-info-500: #3b82f6;
  --color-info-600: #1E73BE;

  /* --- Chart palette (8 colors, light+dark safe) --- */
  --chart-1: #1E73BE;
  --chart-2: #0891b2;
  --chart-3: #7c3aed;
  --chart-4: #db2777;
  --chart-5: #ea580c;
  --chart-6: #16a34a;
  --chart-7: #ca8a04;
  --chart-8: #64748b;

  /* --- Semantic aliases (light mode) --- */
  --bg-page:        var(--color-slate-50);
  --bg-surface:     #ffffff;
  --bg-surface-2:   var(--color-slate-100);
  --bg-surface-3:   var(--color-slate-200);

  --border-color:   var(--color-slate-200);
  --border-strong:  var(--color-slate-300);

  --text-primary:   var(--color-slate-900);
  --text-secondary: var(--color-slate-600);
  /* Era slate-400: 2,56 de contraste sobre blanco, por debajo de lo legible.
     slate-500 sube a 4,76 y sigue siendo claramente el tercer nivel. */
  --text-tertiary:  var(--color-slate-500);
  --text-inverse:   #ffffff;
  --text-link:      var(--color-primary-600);

  /* --- Shadows --- */
  --shadow-xs:  0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm:  0 1px 3px 0 rgb(0 0 0 / 0.08), 0 1px 2px -1px rgb(0 0 0 / 0.06);
  --shadow-md:  0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.06);
  --shadow-lg:  0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);
  --shadow-xl:  0 20px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.04);

  /* --- Topnav --- */
  --topnav-height: 56px;
  --sidebar-width: 260px;

  /* --- Transitions --- */
  --transition-fast:   150ms ease;
  --transition-base:   200ms ease;
  --transition-slow:   300ms ease;
}


/* ============================================================
   3. DARK MODE OVERRIDES
   ============================================================
   DISABLED: Forced light mode for all dashboards.
   Dark mode via system preference is intentionally disabled.
   Use .dark class on <html> to opt-in explicitly if needed.
   ============================================================ */
/* @media (prefers-color-scheme: dark) { ... } — DISABLED */

/* Explicit .dark class override (JS-toggled) */
.dark {
  /* LOS TINTES Y SU TEXTO. 14-09-2026.
     Los tonos -50, -100 y -200 son los fondos suaves de las etiquetas, las
     pildoras, los avisos, la fila que se resalta al pasar por encima y la pestaña
     activa del indice. Son colores de paleta, no del tema, asi que NO cambiaban:
     en oscuro salia un recuadro casi blanco en medio de la pagina -"KPIs
     Principales" en el indice de Analisis era el caso mas visible-.

     Se pueden redefinir aqui sin miedo porque **solo se usan como fondo y como
     borde, nunca como texto** (comprobado en toda la hoja y en las ocho
     pantallas). Y con ellos hay que dar la vuelta al -700, que es el texto que
     va ENCIMA de esos fondos: si se oscurece el fondo y no el texto, queda
     oscuro sobre oscuro.

     El -600 NO se toca: es el azul de marca y ademas el fondo de los botones. */
  --color-primary-50:  #132a45;
  --color-primary-100: #173352;
  --color-primary-200: #1d4370;
  --color-success-50:  #0e2a1b;
  --color-success-100: #123823;
  --color-warning-50:  #2c2006;
  --color-warning-100: #3b2b08;
  --color-danger-50:   #2c1315;
  --color-danger-100:  #3a191c;
  --color-info-50:     #132a45;
  --color-info-100:    #173352;
  /* El texto que va encima de esos tintes */
  --color-primary-700: #93c5fd;
  --color-success-700: #86efac;
  --color-warning-700: #fcd34d;
  --color-danger-700:  #fca5a5;
  --color-info-600:    #93c5fd;

  --bg-page:        var(--color-slate-950);
  --bg-surface:     var(--color-slate-900);
  --bg-surface-2:   var(--color-slate-800);
  --bg-surface-3:   var(--color-slate-700);
  /* LOS BORDES, UN ESCALON MAS CLAROS QUE EN EL TEMA CLARO. No es capricho: en
     claro `--border-color` da 1,23 de contraste sobre el blanco y se ve
     perfectamente, porque el ojo detecta el canto. Sobre un fondo casi negro ese
     mismo 1,2 desaparece, y con el desaparece el contorno de los botones
     pequeños -"editar" y "borrar" parecian texto suelto-. Se sube un peldaño:
     slate-800 -> slate-700 y slate-700 -> slate-600. */
  --border-color:   var(--color-slate-700);
  --border-strong:  var(--color-slate-600);
  --text-primary:   var(--color-slate-50);
  /* AQUI ESTABA EL FALLO. La escala de grises se copio del tema claro tal cual
     -400 y 600- sin darle la vuelta, y en un fondo oscuro bajar el numero es
     ACERCARSE al fondo, no alejarse. Medido: el tercer nivel daba 1,93 de
     contraste sobre las tarjetas y 1,37 sobre las cajas grises, o sea texto
     invisible. Se sube un escalon cada uno y la escala vuelve a serlo:
       primary   slate-50   ~16
       secondary slate-300   9,85 sobre tarjeta
       tertiary  slate-400   5,71 sobre tarjeta */
  --text-secondary: var(--color-slate-300);
  --text-tertiary:  var(--color-slate-400);
  --text-inverse:   var(--color-slate-900);
  --text-link:      var(--color-primary-400);
  --shadow-xs:  0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-sm:  0 1px 3px 0 rgb(0 0 0 / 0.35), 0 1px 2px -1px rgb(0 0 0 / 0.3);
  --shadow-md:  0 4px 6px -1px rgb(0 0 0 / 0.35), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg:  0 10px 15px -3px rgb(0 0 0 / 0.35), 0 4px 6px -4px rgb(0 0 0 / 0.25);
  --shadow-xl:  0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.3);
}


/* ============================================================
   4. RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--text-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: linear-gradient(135deg, #EFF6FF 0%, #F0F0FF 50%, #F9FAFB 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* EL FONDO TAMBIEN CAMBIA. Era el unico color escrito a fuego de toda la hoja
   -comprobado: uno solo- y por eso, al encender el modo oscuro, las tarjetas se
   oscurecian pero la pagina se quedaba azul claro, con el titulo blanco encima
   sin poder leerse. Mismo degradado, girado a oscuro. 14-09-2026. */
.dark body {
  background: linear-gradient(135deg, #0B1220 0%, #101024 50%, #020617 100%);
  background-attachment: fixed;
}

/* Force light color-scheme at root level */
html {
  color-scheme: light;
}
/* Y con el tema, lo que pinta el navegador por su cuenta: barras de
   desplazamiento, desplegables y los calendarios de los campos de fecha. Sin
   esta linea salen en blanco en medio de una pagina oscura. */
html.dark {
  color-scheme: dark;
}

/* Tabular numerals applied globally to numeric contexts */
.num, .nf-kpi-value, td.num, .nf-badge,
[data-numeric], .nf-trend {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover { color: var(--color-primary-700); }

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  color: var(--text-primary);
}


/* ============================================================
   5. LAYOUT
   ============================================================ */

/* --- Shell: full-page wrapper --- */
.nf-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--bg-page);
}

/* --- Top Navigation Bar --- */
.nf-topnav {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--topnav-height);
  display: flex;
  align-items: center;
  /* El menu va centrado en absoluto, o sea fuera del flujo, asi que los unicos
     que quedan repartiendose la barra son el logo y el estado: con
     space-between el estado se va a la derecha, que es su sitio. Sin esto se
     pegaba al logo. Mismo criterio que la barra de la Operativa. */
  justify-content: space-between;
  padding: 0 var(--sp-6);
  gap: var(--sp-6);
  background: linear-gradient(135deg, #001F4D 0%, #1E73BE 100%);
  border-bottom: none;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

/* Dark nav override — only via explicit .dark class */
.dark .nf-topnav {
  background-color: rgba(15 23 42 / 0.85);
}

.nf-topnav__logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: #ffffff;
  white-space: nowrap;
  flex-shrink: 0;
}

.nf-topnav__logo span {
  color: rgba(255,255,255,0.7);
}

.nf-topnav__nav {
  display: flex;
  align-items: center;
  gap: 0;
  /* Centrado DE VERDAD, no en el hueco que sobra. Hasta el 04-09-2026 esto era
     `flex:1; justify-content:center`, que centra dentro del espacio libre: con
     la pila de la derecha (frescura + estado + avatar) las pestañas se iban a
     la izquierda. Asi lo hacia la barra de la Operativa, que era la que se veia
     bien, y de ahi se copia. */
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nf-topnav__tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0 var(--sp-4);
  height: var(--topnav-height);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  border: none;
  background: none;
  transition: color var(--transition-fast);
  white-space: nowrap;
}

.nf-topnav__tab:hover {
  color: #ffffff;
}

.nf-topnav__tab.active {
  color: #ffffff;
  font-weight: var(--weight-semibold);
}

.nf-topnav__tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: var(--sp-4);
  right: var(--sp-4);
  height: 2px;
  background-color: #ffffff;
  border-radius: var(--radius-full) var(--radius-full) 0 0;
}

/* El interruptor de modo oscuro. Vive en la barra azul, asi que sus colores son
   los de la barra -blancos translucidos- y no los del tema, que cambian. */
.nf-topnav__tema {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; margin-right: var(--sp-1);
  background: none; border: 1px solid rgba(255,255,255,0.22); border-radius: 8px;
  color: rgba(255,255,255,0.75); cursor: pointer; flex-shrink: 0;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.nf-topnav__tema svg { width: 15px; height: 15px; }
.nf-topnav__tema:hover { color: #fff; border-color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.08); }
.nf-topnav__tema:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

.nf-topnav__status {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.5);
  flex-shrink: 0;
}

.nf-topnav__status-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background-color: var(--color-success-500);
  flex-shrink: 0;
}

/* --- Layout: Sidebar + Main --- */
/* Dos cosas que estuvieron aqui y ya no estan, las dos por el mismo motivo:
 * quien scrollea es la VENTANA, no una caja de dentro.
 *
 *   `overflow: hidden`  anulaba el `sticky` del indice. Un elemento pegajoso
 *                       deja de serlo si cualquier antepasado recorta.
 *   `height: calc(...)` fijaba la altura a una pantalla. Mientras esto era un
 *                       item flexible no se aplicaba -`flex: 1` manda sobre el
 *                       en el eje principal- y por eso llevaba escrito sin
 *                       hacer nada. Al meter la pantalla dentro de `.nf-pagina`
 *                       dejo de ser un item flexible y SI se habria aplicado:
 *                       el contenido habria pasado a scrollear por dentro, la
 *                       ventana se habria quedado quieta, y con ella el indice
 *                       y el marcador de seccion, que escuchan a la ventana.
 *                       Quitado el 10-09-2026 antes de que llegara a pasar.
 *
 * Lo horizontal lo sigue recortando `.nf-main`, que tiene su propio overflow-x.
 */
.nf-layout {
  display: flex;
  align-items: flex-start;
}

/* --- Sidebar --- */
/* El indice se queda a la vista al bajar. Puesto el 10-09-2026.
 *
 * QUE PASABA
 *   El indice se iba con la pagina, asi que al pinchar una seccion de abajo habia
 *   que volver arriba del todo para elegir otra. Con nueve secciones, eso es subir
 *   ocho pantallas cada vez.
 *
 * POR QUE NO BASTABA CON LO QUE HABIA
 *   El armazon esta pensado para que scrollee `.nf-main` por dentro y el indice se
 *   quede quieto: `.nf-layout` pide `height: calc(100vh - topnav)`. Pero es un item
 *   flexible con `flex: 1`, y en el eje principal **el flex-basis manda sobre el
 *   height**: medido en el navegador, `.nf-layout` acaba con 8.802 px y quien
 *   scrollea es el documento entero.
 *
 *   Rehacer eso cambiaria el scroll de toda la pagina. Con `sticky` se arregla lo
 *   que molesta sin tocar el resto.
 *
 * EL `align-self` NO SOBRA
 *   Un item flexible se estira por defecto, y algo estirado no puede quedarse
 *   pegado. Sin esta linea, `sticky` no hace nada.
 *
 * Debajo de 1024px manda la regla de mas abajo, que lo saca de la pantalla y lo
 * abre con un boton. Esa gana por ir despues.
 */
.nf-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: var(--topnav-height);
  align-self: flex-start;
  height: calc(100vh - var(--topnav-height));
  overflow-y: auto;
  overflow-x: hidden;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  padding: var(--sp-4) 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.nf-sidebar::-webkit-scrollbar { width: 4px; }
.nf-sidebar::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: var(--radius-full); }

.nf-sidebar__section-title {
  padding: var(--sp-3) var(--sp-4) var(--sp-1);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nf-sidebar__item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-md);
  margin: 1px var(--sp-2);
  transition: background-color var(--transition-fast), color var(--transition-fast);
  text-decoration: none;
}

.nf-sidebar__item:hover {
  background-color: var(--bg-surface-2);
  color: var(--text-primary);
}

.nf-sidebar__item.active {
  background-color: var(--color-primary-50);
  color: var(--color-primary-700);
  font-weight: var(--weight-semibold);
}

.dark .nf-sidebar__item.active {
  background-color: rgba(37 99 235 / 0.15);
  color: var(--color-primary-400);
}

.nf-sidebar__divider {
  height: 1px;
  background-color: var(--border-color);
  margin: var(--sp-3) var(--sp-4);
}

/* --- Main content area --- */
/* El aire de fuera -los margenes de pagina y el respiro del final- lo pone
 * `.nf-pagina`, que ahora envuelve tambien a esta pantalla. Aqui solo queda la
 * separacion con el indice de la izquierda. El `padding-top` de 16 iguala al
 * del indice, para que el primer bloque y el primer enlace empiecen a la misma
 * altura. */
.nf-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--sp-4) 0 0 var(--sp-8);
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.nf-main::-webkit-scrollbar { width: 6px; }
.nf-main::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: var(--radius-full); }

/* Page header within main */
.nf-page-header {
  margin-bottom: var(--sp-8);
}

.nf-page-header h1 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.nf-page-header p {
  margin-top: var(--sp-1);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}


/* ============================================================
   5.b  EL MARCO DE UNA PÁGINA DEL PORTAL
   ============================================================
   Añadido el 10-09-2026, tras medir las cuatro pantallas a la misma anchura de
   ventana. El título caía en un sitio distinto en cada una:

       Explorador  x=24     (a sangre, sin ancho maximo)
       Analisis    x=316    (dentro de la columna, detras del indice)
       Seguimiento x=92     (1240 centrado)

   Casi 300 px de salto al cambiar de pestaña. El ojo pierde el ancla y parece que
   has cambiado de aplicacion, no de seccion.

   Estos tres componentes son el marco comun. Los valores NO son inventados: son
   los de Seguimiento, que es la referencia que fijo Odette. Por eso adoptarlos
   ahi no cambia ni un pixel — comprobado antes y despues.

   COMO SE USA
     <div class="nf-pagina">
       <header class="nf-pagina__cab">
         <div><h1>Titulo</h1><p>De que va</p></div>
         <div>...acciones, si las hay...</div>
       </header>
       <nav class="nf-subtabs">...</nav>   <- opcional
       ...contenido...
     </div>

   NO cambia colores ni tipografias: solo dice donde empiezan las cosas.
   ============================================================ */

/* UN SOLO ANCHO PARA LAS TRES PANTALLAS. No hay variantes.
 *
 * Lo hubo durante unas horas el 10-09-2026: el Explorador se quedo en 1400 para
 * no perder la cuarta columna de tarjetas y Seguimiento en 1240. Resultado
 * medido a 1600 px de ventana: el titulo caia en x=200, x=120 y x=20 segun la
 * pestaña. Sigue siendo "cada pagina parece otra", que era justo lo que habia
 * que arreglar. Prioridad equivocada.
 *
 * 1400 es el numero: deja al Explorador sus cuatro columnas y le da a Analisis
 * sitio para el indice y las graficas. Por debajo de 1400 px de ventana manda la
 * ventana y las tres caen exactamente igual.
 */
.nf-pagina {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;                             /* ver la nota de abajo */
  padding: var(--sp-6) var(--sp-5) 90px;   /* 24 / 20 / 90 */
}
/* EL `width: 100%` NO SOBRA. En Analisis el marco vive dentro de `.nf-shell`,
 * que es un contenedor flexible en columna. Sin anchura declarada, el navegador
 * deja que el marco crezca hasta el ancho minimo de su contenido en vez de
 * ceñirlo al del contenedor: medido en una ventana de 900, el marco se iba a
 * 1010 px y la pagina se podia arrastrar de lado. Con `width: 100%` se queda en
 * 885 y no hay desplazamiento horizontal. En las otras tres pantallas no cambia
 * nada, porque ahi el marco ya ocupaba todo el ancho disponible. */

/* Titulo y subtitulo a la izquierda; a la derecha lo que cada pantalla necesite
   -el navegador de semana, el aviso del comite-. `flex-end` alinea la fila de
   acciones con la base del subtitulo, no con la del titulo. */
.nf-pagina__cab {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-5);
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.nf-pagina__cab h1 {
  font-size: var(--text-2xl, 24px);
  font-weight: var(--weight-semibold, 600);
  color: var(--text-primary);
  letter-spacing: -.01em;
  margin: 0 0 3px;
}
.nf-pagina__cab p {
  margin: 0;
  font-size: var(--text-sm, 14px);
  color: var(--text-secondary);
}

/* La tira de vistas de una misma seccion. Estaba duplicada en seguimiento.html y
   en seguimiento-plan.html con dos nombres distintos; vive aqui para que cualquier
   pantalla pueda usarla y no vuelva a haber dos copias que se separen. */
.nf-subtabs {
  display: inline-flex;
  flex-wrap: nowrap;
  max-width: 100%;
  gap: 4px;
  padding: 4px;
  margin: 0 0 18px;
  background: var(--bg-surface-2, #f1f5f9);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
}
.nf-subtabs a,
.nf-subtabs button {
  position: relative;
  padding: 9px 18px;
  font: inherit;
  font-size: var(--text-sm, 14px);
  font-weight: var(--weight-medium, 500);
  color: var(--text-secondary, #475569);
  text-decoration: none;
  white-space: nowrap;
  background: none;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.nf-subtabs a:hover,
.nf-subtabs button:hover {
  color: var(--text-primary, #0f172a);
  background: var(--bg-surface, #ffffff);
}
/* La vista en la que estas se ve de lejos: fondo de color y letra blanca. Antes
   era una subraya de 2 px sobre texto gris y el equipo no encontraba las vistas
   de A3 y de benefit tracking (1-oct-2026, Odette: "se quedan un poco
   invisibles"). */
.nf-subtabs [aria-current="page"] {
  color: #ffffff;
  background: var(--color-primary-600, #1E73BE);
  font-weight: var(--weight-semibold, 600);
  box-shadow: var(--shadow-xs, 0 1px 2px 0 rgb(0 0 0 / 0.05));
}
.nf-subtabs [aria-current="page"]:hover {
  color: #ffffff;
  background: var(--color-primary-600, #1E73BE);
}
/* La subraya ya no hace falta: el fondo dice cual es. Se anula explicitamente
   porque alguna pagina puede traerla de una copia vieja. */
.nf-subtabs [aria-current="page"]::after { content: none; }

/* En un movil, cinco vistas no caben de largo -medido a 390 px-. Ahi la tira se
 * desliza en horizontal en vez de recortarse, sin barra a la vista. */
@media (max-width: 700px) {
  .nf-subtabs {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .nf-subtabs::-webkit-scrollbar { display: none; }
  .nf-subtabs a,
  .nf-subtabs button { flex: none; }
}

/* ============================================================
   6. CARDS & KPI TILES
   ============================================================ */

/* --- Standard card --- */
/* El radio de las tarjetas es el mismo en todo el portal: --radius-lg, 12 px.
 * Antes habia tres. Estas iban a 16 (--radius-xl), las del Explorador a 14 y
 * las de Seguimiento y el plan a 12. Gana el 12 porque es el que ya usaban dos
 * de las tres pantallas. Solo las usa Analisis, comprobado el 10-09-2026. */
.nf-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  overflow: hidden;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.nf-card:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.nf-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border-color);
}

.nf-card-header__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.nf-card-header__subtitle {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: 2px;
}

.nf-card-header__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.nf-card-header__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: var(--text-xs);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.nf-card-header__btn:hover {
  background-color: var(--bg-surface-2);
  color: var(--text-primary);
}

.nf-card-body {
  padding: var(--sp-5);
}

/* --- KPI Card --- */
.nf-kpi {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.nf-kpi:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.nf-kpi::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary-500), var(--color-primary-300));
}

.nf-kpi-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nf-kpi-value {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1;
}

.nf-kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  padding: 2px var(--sp-2);
  border-radius: var(--radius-full);
  width: fit-content;
}

.nf-kpi-trend--up {
  color: var(--color-success-700);
  background-color: var(--color-success-50);
}

.nf-kpi-trend--up::before { content: '↑ '; }

.nf-kpi-trend--down {
  color: var(--color-danger-700);
  background-color: var(--color-danger-50);
}

.nf-kpi-trend--down::before { content: '↓ '; }

.nf-kpi-trend--neutral {
  color: var(--text-secondary);
  background-color: var(--bg-surface-2);
}

.nf-kpi-sparkline {
  height: 40px;
  width: 100%;
  margin-top: var(--sp-1);
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface-2);
  overflow: hidden;
}

/* Optional: smaller KPI variant */
.nf-kpi--sm .nf-kpi-value { font-size: var(--text-2xl); }
.nf-kpi--sm { padding: var(--sp-4); }


/* ============================================================
   7. ALERT CARDS — War Room
   ============================================================ */
.nf-alert-card {
  position: relative;
  display: block;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--color-slate-300);
  border-radius: var(--radius-lg);
  padding: var(--sp-4) var(--sp-5);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition:
    box-shadow var(--transition-fast),
    transform var(--transition-fast),
    border-left-color var(--transition-fast);
}

.nf-alert-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* Urgency variants via left border color */
.nf-alert-card--urgent  { border-left-color: var(--color-danger-500); }
.nf-alert-card--follow  { border-left-color: var(--color-warning-500); }
.nf-alert-card--opportunity { border-left-color: var(--color-success-500); }

.nf-alert-card__signal {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  line-height: var(--leading-tight);
  margin-bottom: var(--sp-1);
}

.nf-alert-card__mechanism {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
  margin-bottom: var(--sp-3);
}

.nf-alert-card__footer {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.nf-alert-card__impact {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--sp-2);
  border-radius: var(--radius-full);
  background-color: var(--color-primary-600);
  color: #ffffff;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.nf-alert-card__owner {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--sp-2);
  border-radius: var(--radius-full);
  background-color: var(--bg-surface-2);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  border: 1px solid var(--border-color);
}

.nf-alert-card__lever {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-style: italic;
}


/* ============================================================
   8. DATA TABLES
   ============================================================ */
.nf-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.nf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.nf-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: var(--bg-surface-2);
}

.nf-table thead th {
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}

.nf-table thead th.num { text-align: right; }

.nf-table tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background-color var(--transition-fast);
}

/* Alternating rows — very subtle */
.nf-table tbody tr:nth-child(even) {
  background-color: rgba(248 250 252 / 0.6);
}

.dark .nf-table tbody tr:nth-child(even) {
  background-color: rgba(255 255 255 / 0.02);
}

.nf-table tbody tr:hover {
  background-color: var(--color-primary-50);
}

.dark .nf-table tbody tr:hover {
  background-color: rgba(37 99 235 / 0.08);
}

.nf-table tbody tr:last-child {
  border-bottom: none;
}

.nf-table tbody td {
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-sm);
  color: var(--text-primary);
  white-space: nowrap;
}

/* Numeric columns */
.nf-table td.num,
.nf-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.nf-table td.num-primary {
  text-align: right;
  font-weight: var(--weight-semibold);
  color: var(--color-primary-600);
  font-variant-numeric: tabular-nums;
}

/* Subtle total/summary row */
.nf-table tbody tr.nf-table__row--total {
  background-color: var(--bg-surface-2);
  font-weight: var(--weight-semibold);
  border-top: 2px solid var(--border-strong);
}

/* --- Margin badge --- */
.nf-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Margin thresholds: >8% green, 4–8% amber, <4% red, 0% gray */
.nf-badge--high    { background-color: var(--color-success-100); color: var(--color-success-700); }
.nf-badge--mid     { background-color: var(--color-warning-100); color: var(--color-warning-700); }
.nf-badge--low     { background-color: var(--color-danger-100);  color: var(--color-danger-700); }
.nf-badge--neutral { background-color: var(--bg-surface-2);      color: var(--text-tertiary);    }
.nf-badge--info    { background-color: var(--color-info-100);    color: var(--color-info-600); }


/* ============================================================
   9. CALLOUT & TOOLTIP
   ============================================================ */

/* --- Callout: "So what" box below charts --- */
.nf-callout {
  margin-top: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background-color: var(--color-primary-50);
  border-left: 3px solid var(--color-primary-400);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: var(--text-sm);
  font-style: italic;
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

.dark .nf-callout {
  background-color: rgba(37 99 235 / 0.08);
  border-left-color: var(--color-primary-500);
}

.nf-callout strong {
  font-style: normal;
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

/* --- Tooltip: Metric definition on hover --- */
.nf-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: help;
}

.nf-tooltip__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  background-color: var(--color-slate-300);
  color: var(--color-slate-600);
  font-size: 9px;
  font-weight: var(--weight-bold);
  font-style: normal;
  line-height: 1;
  vertical-align: middle;
  margin-left: var(--sp-1);
  flex-shrink: 0;
}

.nf-tooltip__trigger::after {
  content: '?';
}

.nf-tooltip__content {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: 220px;
  padding: var(--sp-2) var(--sp-3);
  background-color: var(--color-slate-900);
  color: #ffffff;
  font-size: var(--text-xs);
  font-style: normal;
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
  white-space: normal;
}

.nf-tooltip__content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--color-slate-900);
}

.nf-tooltip:hover .nf-tooltip__content {
  opacity: 1;
  visibility: visible;
}


/* ============================================================
   10. SKELETON LOADERS
   ============================================================ */
@keyframes nf-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.nf-skeleton {
  background-color: var(--bg-surface-2);
  background-image: linear-gradient(
    90deg,
    var(--bg-surface-2) 0px,
    var(--bg-surface-3) 80px,
    var(--bg-surface-2) 160px
  );
  background-size: 800px 100%;
  animation: nf-shimmer 1.5s infinite linear;
  border-radius: var(--radius-md);
}

/* Base text-line skeleton */
.nf-skeleton--line {
  height: 14px;
  width: 100%;
  margin-bottom: var(--sp-2);
}

.nf-skeleton--line:last-child { width: 70%; }

/* Chart skeleton */
.nf-skeleton--chart {
  height: 200px;
  width: 100%;
  border-radius: var(--radius-md);
}

/* KPI skeleton */
.nf-skeleton--kpi {
  height: 100px;
  width: 100%;
  border-radius: var(--radius-lg);
}

/* Table skeleton: stacked rows */
.nf-skeleton--table {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.nf-skeleton--table .nf-skeleton--row {
  height: 40px;
  width: 100%;
  border-radius: var(--radius-sm);
}

.nf-skeleton--table .nf-skeleton--row:first-child {
  background-color: var(--bg-surface-3);
  background-image: none;
  animation: none;
}


/* ============================================================
   11. COLLAPSIBLE GROUPS
   ============================================================ */
.nf-group {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--sp-4);
}

.nf-group__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  cursor: pointer;
  user-select: none;
  background-color: var(--bg-surface-2);
  border-bottom: 1px solid var(--border-color);
  transition: background-color var(--transition-fast);
}

.nf-group__header:hover {
  background-color: var(--bg-surface-3);
}

.nf-group__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.nf-group__summary {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.nf-group__chevron {
  display: inline-block;
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  transition: transform var(--transition-slow);
  flex-shrink: 0;
}

/* CSS-only chevron via border trick */
.nf-group__chevron::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin: 2px auto;
  transition: transform var(--transition-slow);
}

.nf-group__body {
  max-height: 2000px;
  overflow: hidden;
  transition: max-height var(--transition-slow) ease-in-out;
}

/* Collapsed state */
.nf-group.collapsed .nf-group__body {
  max-height: 0;
}

.nf-group.collapsed .nf-group__chevron::before {
  transform: rotate(-45deg);
}

.nf-group.collapsed .nf-group__header {
  border-bottom-color: transparent;
}


/* ============================================================
   12. EMPTY STATE
   ============================================================ */
.nf-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-16) var(--sp-8);
  text-align: center;
  color: var(--text-secondary);
}

.nf-empty__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background-color: var(--bg-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-4);
  font-size: 20px;
  color: var(--text-tertiary);
}

.nf-empty__title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--sp-1);
}

.nf-empty__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  max-width: 320px;
  line-height: var(--leading-relaxed);
}


/* ============================================================
   13. BADGES & PILLS (standalone)
   ============================================================ */
.nf-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px var(--sp-2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  border: 1px solid transparent;
}

.nf-pill--blue    { background: var(--color-primary-50);   color: var(--color-primary-700);  border-color: var(--color-primary-200); }
.nf-pill--green   { background: var(--color-success-50);   color: var(--color-success-700);  border-color: var(--color-success-100); }
.nf-pill--amber   { background: var(--color-warning-50);   color: var(--color-warning-700);  border-color: var(--color-warning-100); }
.nf-pill--red     { background: var(--color-danger-50);    color: var(--color-danger-700);   border-color: var(--color-danger-100); }
.nf-pill--slate   { background: var(--bg-surface-2);        color: var(--text-secondary);     border-color: var(--border-color); }


/* ============================================================
   14. UTILITY CLASSES
   ============================================================ */

/* Text alignment */
.text-left    { text-align: left; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }

/* Font sizes */
.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg   { font-size: var(--text-lg); }

/* Font weights */
.font-normal   { font-weight: var(--weight-normal); }
.font-medium   { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold     { font-weight: var(--weight-bold); }

/* Text colors */
.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary  { color: var(--text-tertiary); }
.text-success   { color: var(--color-success-600); }
.text-danger    { color: var(--color-danger-600); }
.text-warning   { color: var(--color-warning-600); }
.text-blue      { color: var(--color-primary-600); }

/* Margin top */
.mt-1  { margin-top: var(--sp-1); }
.mt-2  { margin-top: var(--sp-2); }
.mt-3  { margin-top: var(--sp-3); }
.mt-4  { margin-top: var(--sp-4); }
.mt-6  { margin-top: var(--sp-6); }
.mt-8  { margin-top: var(--sp-8); }

/* Margin bottom */
.mb-1  { margin-bottom: var(--sp-1); }
.mb-2  { margin-bottom: var(--sp-2); }
.mb-3  { margin-bottom: var(--sp-3); }
.mb-4  { margin-bottom: var(--sp-4); }
.mb-6  { margin-bottom: var(--sp-6); }
.mb-8  { margin-bottom: var(--sp-8); }

/* Gap (for flex/grid containers) */
.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.gap-8 { gap: var(--sp-8); }

/* Flex utilities */
.flex         { display: flex; }
.flex-col     { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.flex-wrap    { flex-wrap: wrap; }
.flex-1       { flex: 1; }

/* Responsive grids */
.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: var(--sp-4);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Divider */
.nf-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: var(--sp-6) 0;
}

/* Truncate single line */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Visually hidden (accessible) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}


/* ============================================================
   15. RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Tablet: 768px – 1024px */
@media (max-width: 1024px) {
  .nf-layout {
    position: relative;
  }

  .nf-sidebar {
    position: fixed;
    top: var(--topnav-height);
    left: 0;
    height: calc(100vh - var(--topnav-height));
    z-index: 500;
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
    box-shadow: var(--shadow-xl);
  }

  .nf-sidebar.open {
    transform: translateX(0);
  }

  /* Aqui el indice ya es un cajon lateral oculto, asi que el contenido ocupa
     todo el marco y no necesita separarse de nada. */
  .nf-main {
    padding: var(--sp-4) 0 0;
  }

  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }

  .nf-topnav__nav {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Mobile: <768px */
@media (max-width: 767px) {
  .nf-topnav {
    padding: 0 var(--sp-4);
    gap: var(--sp-3);
  }

  .nf-topnav__nav {
    display: none;
  }

  .nf-main {
    padding: var(--sp-3) 0 0;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .nf-kpi-value {
    font-size: var(--text-2xl);
  }

  .nf-pagina__cab h1 {
    font-size: var(--text-xl);
  }

  .nf-table-wrapper {
    border-radius: var(--radius-md);
  }

  .nf-card-body {
    padding: var(--sp-4);
  }
}

/* En pantallas grandes no hace falta nada: quien impide que el contenido se
   estire es `.nf-pagina`, con su ancho maximo de 1400. Antes habia aqui un
   `padding: 32 48` para `.nf-main` que solo se aplicaba a partir de 1600 px, y
   era la razon de que Analisis tuviera un margen distinto al de las otras dos
   pantallas justo en las ventanas grandes. */

/* Icono de cada pestaña. Mismas medidas que las de la barra de la Operativa. */
.nf-topnav__tab-icon {
  width: 16px;
  height: 16px;
  margin-right: 7px;
  opacity: .7;
  flex-shrink: 0;
}

/* ── La tira de propuestas de Seguimiento (10-09-2026) ──────────────────────
   La pinta nfPropuestas() y solo la ve Freedom. Va en ambar, como todo lo que
   esta por confirmar en esta pantalla: es un borrador, no un dato. */
.nf-props {
  border: 1px solid var(--color-warning-500, #f59e0b);
  background: var(--color-warning-50, #fffbeb);
  border-radius: var(--radius-md, 8px);
  margin-bottom: 18px;
  overflow: hidden;
}
.dark .nf-props { background: rgba(245, 158, 11, .08); }

/* La tira se pliega. El <details> no lleva estilo propio: el marco sigue siendo
   .nf-props, y esto solo quita el triangulo que pone el navegador para poner el
   nuestro, que se gira al abrir. */
.nf-props__caja { display: block; }
.nf-props__cab {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.nf-props__cab::-webkit-details-marker { display: none; }
.nf-props__cab::before {
  content: "";
  width: 0; height: 0; flex-shrink: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform .15s ease;
  opacity: .65;
}
.nf-props__caja[open] > .nf-props__cab::before { transform: rotate(90deg); }
.nf-props__caja[open] > .nf-props__cab {
  border-bottom: 1px solid var(--color-warning-500, #f59e0b);
}
.nf-props__cab:hover { background: rgba(245, 158, 11, .08); }
/* Plegada, el texto largo sobra: basta el recuento y el boton. */
.nf-props__caja:not([open]) > .nf-props__cab > span { display: none; }
.nf-props__cab span { color: var(--text-secondary, #475569); font-size: 12px; }
.nf-props__cab button {
  margin-left: auto;
  border: 1px solid var(--color-warning-700, #b45309);
  background: var(--color-warning-700, #b45309); color: #fff;
  border-radius: var(--radius-md, 8px); padding: 5px 12px;
  font-size: 12px; cursor: pointer;
}
.nf-props__cab button:disabled { opacity: .6; cursor: default; }

.nf-props__lista { list-style: none; margin: 0; padding: 0; }
.nf-prop {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 14px;
  border-top: 1px solid var(--border-color, #e2e8f0);
}
.nf-prop:first-child { border-top: 0; }
.nf-prop__cuerpo { flex: 1; min-width: 0; }
/* Tres alturas: donde cae, que cambia, y por que. La prueba va plegada porque
   es larga y solo hace falta cuando la cifra sorprende. */
.nf-prop__donde {
  font-size: 11px; letter-spacing: .02em; text-transform: uppercase;
  color: var(--text-secondary, #475569); margin-bottom: 2px;
}
.nf-prop__que { font-size: 14px; line-height: 1.4; }
.nf-prop__que s { color: var(--text-secondary, #475569); text-decoration-thickness: 1px; }
.nf-prop__que b { font-weight: 600; }
.nf-prop__porque {
  color: var(--text-secondary, #475569); font-size: 12px; margin-top: 4px; line-height: 1.45;
}
.nf-prop__porque > summary {
  cursor: pointer; font-size: 11px; color: var(--color-info-600, #1E73BE);
  list-style: none; display: inline-block;
}
.nf-prop__porque > summary::-webkit-details-marker { display: none; }
.nf-prop__porque > summary::after { content: " +"; }
.nf-prop__porque[open] > summary::after { content: " -"; }
.nf-prop__porque[open] > summary { margin-bottom: 3px; }
.nf-prop__editor { display: grid; gap: 8px; margin-top: 8px; max-width: 560px; }
.nf-prop__editor[hidden] { display: none; }
.nf-prop__editor label {
  display: block; font-size: 11px; color: var(--text-secondary, #475569);
}
.nf-prop__editor input, .nf-prop__editor textarea, .nf-prop__editor select {
  width: 100%; margin-top: 3px; padding: 6px 8px; font: inherit; font-size: 12px;
  border: 1px solid var(--border-color, #e2e8f0); border-radius: var(--radius-md, 8px);
  background: var(--bg-surface, #fff); color: inherit;
}
.nf-prop__botones { display: flex; gap: 6px; flex-shrink: 0; }
.nf-prop__botones button {
  border: 1px solid var(--border-strong, #cbd5e1); background: var(--bg-surface, #fff);
  color: inherit; border-radius: var(--radius-md, 8px); padding: 4px 10px;
  font-size: 12px; cursor: pointer;
}
.nf-prop__botones button[data-hacer="aceptar"] {
  border-color: var(--color-success-700, #15803d); color: var(--color-success-700, #15803d);
}
.nf-prop__botones button:hover { background: var(--bg-surface-2, #f1f5f9); }
.dark .nf-prop__botones button { background: var(--bg-surface-2, #1e293b); }

/* La confirmacion de "aceptar todos". Va DENTRO de la tira y por encima de la
   lista, no en una ventana aparte: lo que hay que leer es la lista de lo que se
   va a escribir, y una ventana modal la taparia. */
.nf-props__confirmar {
  margin: 0; padding: 12px 14px;
  background: var(--bg-surface, #fff);
  border-top: 1px solid var(--color-warning-500, #f59e0b);
  border-bottom: 1px solid var(--color-warning-500, #f59e0b);
  font-size: 13px;
}
.dark .nf-props__confirmar { background: var(--bg-surface-2, #1e293b); }
/* Los dos botones de ambar relleno. En claro son ambar oscuro con letra
   blanca; en oscuro eso se da la vuelta, porque el tono -700 aqui pasa a ser
   el ambar CLARO con el que se escribe sobre los tintes. Sin esto, el boton
   'Aceptar los 3' salia amarillo con letra blanca encima. */
.dark .nf-props__cab button,
.dark .nf-props__confirmar button[data-si] {
  background: #3b2b08; border-color: #6b4f10; color: #fcd34d;
}
.nf-props__confirmar > p { margin: 0 0 8px; }
.nf-props__confirmar > ul {
  margin: 0 0 12px; padding-left: 18px; max-height: 220px; overflow-y: auto;
}
.nf-props__confirmar > ul > li { margin-bottom: 7px; line-height: 1.4; }
.nf-props__confirmar > ul > li > b {
  font-weight: 400; font-size: 11px; text-transform: uppercase;
  letter-spacing: .02em; color: var(--text-secondary, #475569);
}
.nf-props__confirmar-bot { display: flex; gap: 8px; }
.nf-props__confirmar-bot button {
  border-radius: var(--radius-md, 8px); padding: 6px 14px; font-size: 13px; cursor: pointer;
  border: 1px solid var(--border-strong, #cbd5e1); background: var(--bg-surface, #fff); color: inherit;
}
.nf-props__confirmar-bot #nf-props-si {
  border-color: var(--color-warning-700, #b45309);
  background: var(--color-warning-700, #b45309); color: #fff;
}
.nf-props__confirmar-bot button:disabled { opacity: .6; cursor: default; }

.nf-props__aviso {
  padding: 8px 14px; font-size: 12px;
  color: var(--color-danger-700, #b91c1c);
  border-top: 1px solid var(--border-color, #e2e8f0);
}
.nf-props__aviso[hidden] { display: none; }

@media (max-width: 700px) {
  .nf-prop { flex-direction: column; }
  .nf-prop__botones { width: 100%; }
}
