/* ============================================================
   FLUIDEZ360 · CAPA DE DISEÑO v2
   Se carga DESPUÉS de app.css y solo redefine tokens y
   componentes. Para volver al diseño anterior basta con
   quitar el <link> de base.html: nada más depende de aquí.

   Tipografías:
     Figtree · interfaz
     Andika  · textos que lee el estudiante (creada por SIL
               para alfabetización: "a" de un piso, letras
               inconfundibles para lectores iniciales)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=Andika:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  /* Marca: se conserva el teal institucional y se afina el resto */
  --primary: #116177;
  --primary-dark: #0c4a5c;
  --primary-light: #dff0f4;
  --primary-ring: rgba(17, 97, 119, 0.18);

  --ink: #15242b;
  --ink-soft: #3d525c;
  --muted: #5e7380;
  --faint: #8fa3ad;

  --line: #dce6ea;
  --line-strong: #c3d3da;
  --surface: #ffffff;
  --soft: #f7fafb;
  --bg: #f4f8fa;

  --ok: #0f8a52;
  --ok-soft: #e2f7ec;
  --warn: #b8690b;
  --warn-soft: #fef3e0;
  --risk: #c8412f;
  --risk-soft: #fdeae7;
  --gold: #d99a1f;
  --accent: #e0603a;

  --shadow-sm: 0 1px 2px rgba(21, 36, 43, .06);
  --shadow: 0 2px 10px rgba(21, 36, 43, .06), 0 1px 3px rgba(21, 36, 43, .04);
  --shadow-lg: 0 12px 32px rgba(21, 36, 43, .10);

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;

  --sans: 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --reading: 'Andika', 'Segoe UI', Verdana, sans-serif;
}

/* ---------- Base ---------- */

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Sin `color` a proposito: los titulos heredan del contenedor. Fijarlo aqui
   pisaba el blanco de los bloques oscuros (.leveling-hero, .demo-hero, login),
   porque una regla directa sobre h1 le gana al color heredado. */
h1, h2, h3, h4 {
  font-family: var(--sans);
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.app-shell.with-sidebar {
  margin-left: 264px;
  padding: 26px 30px 60px;
}

/* Cifras siempre alineadas en columna */
.metric strong, .kpi-val, .timer, .rec-timer,
.data-table td, .table td, .period-grid strong,
.f-kpi-val, .f-num {
  font-variant-numeric: tabular-nums;
}

/* ---------- Barra lateral ---------- */

.app-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  box-shadow: none;
  gap: 14px;
  padding: 16px 14px;
  width: 264px;
}

.nav-brand {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.brand-mark {
  background: var(--primary);
  border-radius: 10px;
  font-size: .8rem;
  font-weight: 800;
  height: 40px;
  width: 40px;
  letter-spacing: .02em;
}

.brand-name { font-size: 1rem; font-weight: 800; letter-spacing: -.02em; }
.nav-brand span { font-size: .76rem; color: var(--faint); }

.nav-section, .nav-section-label {
  color: var(--faint);
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .12em;
  padding: 10px 10px 4px;
  text-transform: uppercase;
}

/* Selector de módulos */
.mod-btn {
  border-radius: var(--r-sm);
  color: var(--ink-soft);
  font-size: .82rem;
  font-weight: 600;
  gap: 10px;
  padding: 9px 11px;
}

.mod-btn:hover { background: var(--soft); color: var(--ink); }

.mod-btn.active {
  background: var(--primary);
  box-shadow: none;
  color: #fff;
}

.mod-btn .mod-icon { font-size: .95rem; opacity: .95; }
.mod-btn .mod-label small { font-size: .67rem; opacity: .7; }

.nav-menu a {
  border-radius: var(--r-sm);
  color: var(--ink-soft);
  font-size: .875rem;
  font-weight: 600;
  padding: 9px 11px;
  transition: background .14s, color .14s;
}

.nav-menu a:hover { background: var(--soft); color: var(--primary) !important; }

.nav-user {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.nav-user span { font-size: .8rem; font-weight: 600; color: var(--ink-soft); }

/* ---------- Botones ---------- */

.btn {
  border-radius: var(--r-sm);
  font-size: .875rem;
  font-weight: 650;
  letter-spacing: -.005em;
  min-height: 40px;
  padding: 9px 16px;
  transition: background .15s, border-color .15s, color .15s;
}

.btn:hover { transform: none; }

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-success { background: var(--ok); border-color: var(--ok); }

.btn-outline-primary, .btn-outline-secondary, .btn-ghost {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
}

.btn-outline-primary:hover, .btn-outline-secondary:hover, .btn-ghost:hover {
  background: var(--soft);
  border-color: var(--primary);
  color: var(--primary);
}

/* ---------- Superficies ---------- */

.metric, .content-panel, .audio-recorder, .proposal-card,
.content-card, .kpi-card, .form-card, .recorder-card, .reading-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}

.content-panel { padding: 22px; margin-bottom: 18px; }

/* Filete superior de un solo color: devuelve presencia de marca a la tarjeta
   sin volver al degradado tricolor, que ensuciaba la jerarquia. */
.metric::before {
  background: var(--primary);
  border-radius: var(--r) var(--r) 0 0;
  content: "";
  display: block;
  height: 3px;
  left: 0; right: 0; top: 0;
  position: absolute;
}
.metric { position: relative; }

.metric {
  padding: 16px 18px;
  transition: border-color .15s;
}

.metric span { color: var(--muted); font-size: .78rem; font-weight: 600; }
.metric strong {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -.03em;
  margin: 6px 0 2px;
}
.metric small { color: var(--faint); font-size: .74rem; }

.metric-primary { background: var(--surface); border-color: var(--primary); }
.metric-primary strong { color: var(--primary); }
.metric-accent strong { color: var(--accent); }

.section-title { align-items: center; margin-bottom: 14px; }
.section-title h2 { font-size: 1.05rem; font-weight: 750; }
.section-title p { font-size: .82rem; color: var(--muted); }

.page-head { align-items: center; margin-bottom: 20px; }
.page-head h1 { font-size: 1.6rem; font-weight: 800; margin: 2px 0 0; }
.page-head p { font-size: .88rem; }

.eyebrow, .panel-kicker, .page-eyebrow {
  color: var(--primary);
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .12em;
}

.mini-label, .status-pill, .table-pill, .badge {
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 650;
  padding: 4px 10px;
}

.mini-label { background: var(--primary-light); border-color: transparent; color: var(--primary); }
.status-pill { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.table-pill { background: var(--soft); border-color: var(--line); color: var(--ink-soft); }
.mini-label.warning { background: var(--warn-soft); border-color: transparent; color: var(--warn); }

/* ---------- Tablas ---------- */

.data-table thead th, .table thead th {
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 10px 12px;
}

.data-table td, .table td, .data-table th, .table th {
  border-bottom: 1px solid var(--line);
  font-size: .875rem;
  padding: 11px 12px;
}

.data-table tbody tr:hover, .table tbody tr:hover { background: var(--soft); }
.data-table tbody tr:last-child td, .table tbody tr:last-child td { border-bottom: none; }

/* ---------- Formularios ---------- */

.form-control, .form-select, input[type="text"], input[type="password"],
input[type="email"], input[type="number"], input[type="date"], select, textarea {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  font-family: var(--sans);
  font-size: .9rem;
  min-height: 42px;
  transition: border-color .15s, box-shadow .15s;
}

.form-control:focus, input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.form-label { font-size: .82rem; font-weight: 650; }

/* Foco visible para navegación por teclado */
a:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---------- Texto que lee el estudiante ---------- */

.reading-text, .reading-body, .karaoke-text-area {
  font-family: var(--reading);
  color: #1d2b32;
}

/* ---------- Ingreso ---------- */

.login-page {
  background:
    radial-gradient(1100px 520px at 8% -10%, rgba(255, 255, 255, .10), transparent 60%),
    linear-gradient(158deg, #147a94 0%, #116177 52%, #0a4353 100%);
}

.login-product h1 {
  font-size: clamp(2.6rem, 5.4vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.02;
}

.login-lead {
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, .82);
  margin: 22px 0;
}

.login-proof article, .procurement-note {
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: var(--r);
}

.login-proof strong { font-size: 1.3rem; font-weight: 750; }

.login-panel {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 34px 32px;
}

/* La franja tricolor superior se reemplaza por un filete sobrio */
.login-panel::before {
  background: var(--primary);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  height: 4px;
}

.login-panel h2 { font-size: 1.35rem; font-weight: 750; }

/* ---------- Componentes nuevos del panel ---------- */

.f-head {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 22px;
}

.f-head h1 { font-size: 1.55rem; font-weight: 800; margin: 3px 0 0; }
.f-head p { color: var(--muted); font-size: .88rem; margin: 4px 0 0; }

.f-kpis {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin-bottom: 20px;
}

.f-kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}

.f-kpi-label {
  color: var(--muted);
  display: block;
  font-size: .76rem;
  font-weight: 650;
}

.f-kpi-val {
  color: var(--primary-dark);
  display: block;
  font-size: 1.95rem;
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.1;
  margin: 6px 0 2px;
}

.f-kpi-note { color: var(--faint); display: block; font-size: .74rem; }
.f-kpi.is-accent .f-kpi-val { color: var(--primary); }
.f-kpi.is-risk .f-kpi-val { color: var(--risk); }

/* Distribución de calidad lectora */
.f-dist { display: grid; gap: 12px; }

.f-dist-row { display: grid; gap: 5px; }

.f-dist-top {
  display: flex;
  font-size: .82rem;
  justify-content: space-between;
}

.f-dist-top b { font-weight: 650; }
.f-dist-top span { color: var(--muted); }

.f-bar {
  background: #e9f0f3;
  border-radius: 999px;
  height: 9px;
  overflow: hidden;
}

.f-bar > i {
  border-radius: inherit;
  display: block;
  height: 100%;
  min-width: 3px;
}

/* Escala secuencial: a mayor dominio lector, tono más intenso */
.f-bar.lv1 > i { background: #0a4353; }
.f-bar.lv2 > i { background: #146b80; }
.f-bar.lv3 > i { background: #3d94a5; }
.f-bar.lv4 > i { background: #86bcc7; }
.f-bar.lv5 > i { background: #c3dde2; }

/* Periodos del año */
.f-periods { display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); }

.f-period {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 13px 14px;
}

.f-period span { color: var(--muted); font-size: .76rem; font-weight: 650; }
.f-period strong { display: block; font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; }
.f-period small { color: var(--faint); font-size: .72rem; }

/* Estudiantes que requieren apoyo */
.f-priority { display: grid; gap: 8px; }

.f-priority a {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--risk);
  border-radius: var(--r-sm);
  color: var(--ink);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 11px 14px;
  text-decoration: none;
  transition: background .14s;
}

.f-priority a:hover { background: var(--soft); }
.f-priority strong { font-size: .9rem; font-weight: 650; }
.f-priority .f-priority-meta { color: var(--muted); font-size: .78rem; }
.f-priority .f-num { color: var(--risk); font-weight: 750; white-space: nowrap; }

/* Accesos rápidos */
.f-actions { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 20px; }

.f-action {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s;
}

.f-action:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.f-action.is-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.f-action.is-primary .f-action-sub { color: rgba(255, 255, 255, .78); }
.f-action strong { display: block; font-size: .92rem; font-weight: 700; }
.f-action-sub { color: var(--muted); display: block; font-size: .77rem; }
.f-action svg { flex-shrink: 0; }

/* Estado vacío */
.f-empty {
  color: var(--muted);
  font-size: .88rem;
  padding: 26px 10px;
  text-align: center;
}

/* Dos columnas de análisis */
.f-split {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr);
}

@media (max-width: 1040px) {
  .app-shell.with-sidebar { margin-left: 0; padding: 20px 16px 40px; }
  .f-split, .f-periods { grid-template-columns: 1fr; }
}

/* ---------- Clasificacion segun la norma del curso ---------- */

.f-norm {
  border-radius: 999px;
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  padding: 4px 11px;
  white-space: nowrap;
}

.f-norm.is-logrado { background: var(--ok-soft); color: var(--ok); }
.f-norm.is-proceso { background: var(--warn-soft); color: var(--warn); }
.f-norm.is-inicio  { background: var(--risk-soft); color: var(--risk); }

/* ---------- Registro de lectura palabra por palabra ---------- */

.f-run {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-family: var(--reading);
  font-size: 1.06rem;
  line-height: 2.05;
  padding: 18px 20px;
}

.f-run i {
  border-radius: 4px;
  font-style: normal;
  padding: 1px 2px;
}

/* Omitida: tachada, porque no se leyo */
.f-run i.om {
  background: var(--risk-soft);
  color: var(--risk);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

/* Sustituida: subrayada, con lo que se escucho debajo */
.f-run i.sus {
  background: var(--warn-soft);
  color: var(--warn);
  position: relative;
}

.f-run i.sus small {
  color: var(--warn);
  display: block;
  font-family: var(--sans);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1;
  margin-top: -3px;
  opacity: .85;
  text-align: center;
}

.f-run-legend {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: .76rem;
  gap: 16px;
  margin-top: 12px;
}

.f-run-legend span { align-items: center; display: flex; gap: 6px; }

.f-run-legend b {
  border-radius: 3px;
  display: inline-block;
  height: 11px;
  width: 11px;
}

.f-run-legend b.om  { background: var(--risk); }
.f-run-legend b.sus { background: var(--warn); }
.f-run-legend b.ok  { background: var(--line-strong); }

/* ---------- Ficha del alumno: evolucion en el año ---------- */

.f-evo { display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); }

.f-evo-cell {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 13px 14px;
}

.f-evo-cell.is-empty { background: transparent; border-style: dashed; }
.f-evo-cell span { color: var(--muted); font-size: .74rem; font-weight: 650; }

.f-evo-cell strong {
  display: block;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.2;
}

.f-evo-cell small { color: var(--faint); font-size: .72rem; }

/* Barra de avance contra la meta del curso */
.f-goal { display: grid; gap: 6px; margin-top: 4px; }

.f-goal-track {
  background: #e9f0f3;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  position: relative;
}

.f-goal-track > i {
  background: var(--primary);
  border-radius: inherit;
  display: block;
  height: 100%;
  min-width: 3px;
}

.f-goal-track > u {
  background: var(--ink);
  bottom: 0;
  opacity: .45;
  position: absolute;
  top: 0;
  width: 2px;
}

.f-goal-scale {
  color: var(--faint);
  display: flex;
  font-size: .7rem;
  justify-content: space-between;
}

/* Tendencia entre la primera y la ultima medicion */
.f-trend {
  align-items: baseline;
  display: flex;
  font-weight: 750;
  gap: 6px;
}

.f-trend.up   { color: var(--ok); }
.f-trend.down { color: var(--risk); }
.f-trend.flat { color: var(--muted); }
.f-trend small { font-size: .72rem; font-weight: 600; color: var(--muted); }

/* Buscador sobre un listado */
.f-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.f-filters .form-control, .f-filters .form-select { max-width: 260px; }

.f-linkrow { color: inherit; text-decoration: none; }
.f-linkrow:hover { color: var(--primary); text-decoration: underline; }

@media (max-width: 1040px) {
  .f-evo { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .f-head { align-items: stretch; flex-direction: column; }
  .login-panel { padding: 24px 20px; }
  .f-run { font-size: 1rem; line-height: 1.95; padding: 14px; }
}

/* ---------- Grafico de evolucion (SVG en linea, sin libreria) ----------
   Marcas fijas: linea 2px, marcador r=4.5 con anillo de 2px del color de la
   superficie, area al 10%, rejilla de 1px continua y recesiva. El texto usa
   tokens de tinta, nunca el color de la serie. */

.f-chart {
  display: block;
  height: auto;
  margin: 4px 0 18px;
  width: 100%;
}

.f-chart .grid { stroke: var(--line); stroke-width: 1; }
.f-chart .area { fill: var(--primary); opacity: .10; }

.f-chart .line {
  fill: none;
  stroke: var(--primary);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.f-chart .dot {
  fill: var(--primary);
  stroke: var(--surface);
  stroke-width: 2;
  transition: r .12s;
}

/* Blanco de golpe mas grande que el punto: 4.5px es imposible de apuntar */
.f-chart .dot-hit { fill: transparent; cursor: pointer; }
.f-chart .dot-hit:hover + .dot,
.f-chart .dot-hit:hover ~ .dot { r: 6; }

.f-chart .meta-line { stroke: var(--ink-soft); stroke-dasharray: 4 4; stroke-width: 1; opacity: .45; }

.f-chart .tick       { fill: var(--faint); font-size: 10px; font-family: var(--sans); }
.f-chart .meta-label { fill: var(--muted); font-size: 10px; font-family: var(--sans); font-weight: 600; }
.f-chart .end-label  { fill: var(--ink);   font-size: 13px; font-family: var(--sans); font-weight: 800; }

/* ---------- Identidad del establecimiento ----------
   El logo va sobre fondo claro siempre: los escudos escolares suelen usar
   verdes y azules que sobre el teal de marca pierden contraste. */

.brand-logo {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  flex-shrink: 0;
  height: 40px;
  justify-content: center;
  padding: 3px;
  width: 40px;
}

.brand-logo img { display: block; max-height: 100%; max-width: 100%; }

.login-colegio {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  margin: -8px 0 20px;
  padding-bottom: 16px;
}

.login-colegio img { height: 46px; width: auto; }

.login-colegio span {
  color: var(--ink-soft);
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.25;
}

/* ---------- Color en las tarjetas de indicador ----------
   Cada tarjeta lleva el color de lo que mide, no un color decorativo:
   teal = velocidad (la marca), verde = precision (logro), ambar = volumen
   de trabajo, rojo = alerta. El numero y el filete comparten ese tono; las
   etiquetas siguen en tinta, que es lo legible. */

.f-kpi {
  overflow: hidden;
  padding-right: 60px;          /* deja aire para el icono */
  position: relative;
}

.f-kpi::before {
  background: var(--primary);
  content: "";
  height: 3px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.f-kpi-ico {
  align-items: center;
  background: var(--primary-light);
  border-radius: 10px;
  color: var(--primary);
  display: flex;
  height: 34px;
  justify-content: center;
  position: absolute;
  right: 16px;
  top: 16px;
  width: 34px;
}

.f-kpi-ico svg { height: 18px; width: 18px; }

.f-kpi.is-vel::before  { background: var(--primary); }
.f-kpi.is-vel  .f-kpi-val { color: var(--primary); }
.f-kpi.is-vel  .f-kpi-ico { background: var(--primary-light); color: var(--primary); }

.f-kpi.is-prec::before { background: var(--ok); }
.f-kpi.is-prec .f-kpi-val { color: var(--ok); }
.f-kpi.is-prec .f-kpi-ico { background: var(--ok-soft); color: var(--ok); }

/* El filete y el icono van en el ambar vivo, pero la cifra usa el tono
   oscuro: medido, el ambar claro sobre blanco daba 2,44:1, bajo el minimo
   de 3:1 que necesita un numero de este tamaño para leerse. */
.f-kpi.is-eval::before { background: var(--gold); }
.f-kpi.is-eval .f-kpi-val { color: var(--warn); }
.f-kpi.is-eval .f-kpi-ico { background: var(--warn-soft); color: var(--warn); }

.f-kpi.is-risk::before { background: var(--risk); }
.f-kpi.is-risk .f-kpi-val { color: var(--risk); }
.f-kpi.is-risk .f-kpi-ico { background: var(--risk-soft); color: var(--risk); }

.f-kpi.is-ok::before   { background: var(--ok); }
.f-kpi.is-ok   .f-kpi-val { color: var(--ok); }
.f-kpi.is-ok   .f-kpi-ico { background: var(--ok-soft); color: var(--ok); }

/* Accesos rapidos: el icono tambien toma color */
.f-action:not(.is-primary) svg { color: var(--primary); }

/* Las celdas de periodo dejan de ser cinco grises iguales */
.f-period { border-left: 3px solid var(--primary); }
.f-period strong { color: var(--primary-dark); }

@media (max-width: 520px) {
  .f-kpi { padding-right: 18px; }
  .f-kpi-ico { display: none; }
}
