/* ===========================================================================
   CEIP Les Rotes — sistema de diseño (componentes reutilizables)
   ---------------------------------------------------------------------------
   Plain CSS (NO @apply): el Play CDN no procesa @apply en hojas externas.
   Usa las variables de marca para que claro/oscuro funcione con un solo set de
   reglas. Cubre TANTO los componentes nuevos COMO las clases que ya usan las
   plantillas existentes (.card .btn .pill .msg .alert-critical .nav-day .muted)
   para no tener que tocarlas. Mobile-first.
   =========================================================================== */

:root {
  --brand:   #2563EB;
  --comedor: #16A34A;
  --aviso:   #F59E0B;
  --alergia: #EC4899;

  --bg:        #f8fafc;  /* slate-50  */
  --surface:   #ffffff;
  --surface-2: #f1f5f9;  /* slate-100 */
  --text:      #0f172a;  /* slate-900 */
  --muted:     #64748b;  /* slate-500 */
  --line:      #e2e8f0;  /* slate-200 */
  --radius:    .85rem;
}

.dark {
  --bg:        #020617;  /* slate-950 */
  --surface:   #0f172a;  /* slate-900 */
  --surface-2: #1e293b;  /* slate-800 */
  --text:      #e2e8f0;  /* slate-200 */
  --muted:     #94a3b8;  /* slate-400 */
  --line:      #1e293b;  /* slate-800 */
}

/* x-cloak: oculta el árbol Alpine hasta que está inicializado (anti-flash). */
[x-cloak] { display: none !important; }

/* --- Tipografía base --- */
body { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
h1, h2, h3, .font-display { font-family: 'Nunito', 'Inter', system-ui, sans-serif; }

h1 { font-size: 1.5rem;  font-weight: 800; line-height: 1.2; margin: .25rem 0 1rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; font-weight: 700; margin: 1.5rem 0 .6rem; }
.muted { color: var(--muted); font-size: .9rem; }

/* ===========================================================================
   CARD — sombra suave, borde sutil, se adapta a dark mode
   =========================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 4px 16px rgba(15,23,42,.06);
}
.dark .card { box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.35); }

.card-header { display:flex; align-items:center; justify-content:space-between; gap:.75rem; margin-bottom:.75rem; }
.card-title  { font-family:'Nunito',sans-serif; font-weight:700; font-size:1.05rem; margin:0; }

/* ===========================================================================
   BOTONES — grandes y accesibles (alto mínimo 48px), foco visible
   =========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px;                 /* ≥48px: objetivo táctil accesible */
  padding: .65rem 1.15rem;
  font-size: 1rem; font-weight: 600; line-height: 1;
  border: 1px solid transparent; border-radius: .6rem;
  background: var(--brand); color: #fff;
  text-decoration: none; cursor: pointer;
  transition: transform .06s ease, filter .15s ease, background .15s ease, box-shadow .15s ease;
  box-shadow: 0 1px 2px rgba(37,99,235,.18);
}
.btn:hover   { filter: brightness(1.06); }
.btn:active  { transform: translateY(1px); filter: brightness(.95); }
.btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
.btn[disabled], .btn:disabled { opacity: .55; cursor: not-allowed; }

.btn.secondary { background: #64748b; box-shadow: none; }
.dark .btn.secondary { background: #475569; }
.btn.danger    { background: var(--alergia); box-shadow: 0 1px 2px rgba(236,72,153,.22); }
.btn.success   { background: var(--comedor); box-shadow: 0 1px 2px rgba(22,163,74,.22); }
.btn.warn      { background: var(--aviso);   color:#3a2400; box-shadow: 0 1px 2px rgba(245,158,11,.25); }
.btn.ghost {
  background: var(--surface); color: var(--brand);
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line));
  box-shadow: none;
}
.btn.ghost:hover { background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
.dark .btn.ghost { color: #93c5fd; background: var(--surface-2); }

.btn.sm  { min-height: 38px; padding: .4rem .8rem; font-size: .9rem; }
.btn.block { width: 100%; }

/* ===========================================================================
   FORMULARIOS
   =========================================================================== */
input, select, textarea {
  width: 100%; max-width: 100%;
  padding: .65rem .75rem; min-height: 48px;
  font-size: 1rem; color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line); border-radius: .55rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 96px; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}
label { display:block; font-size:.85rem; font-weight:600; color: var(--muted); margin: .7rem 0 .25rem; }

/* ===========================================================================
   TABLAS — limpias, con cabecera tenue y filas hover
   =========================================================================== */
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
thead th {
  text-align: left; font-weight: 700; font-size: .78rem;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: .55rem .5rem;
  border-bottom: 1px solid var(--line);
}
tbody td { padding: .7rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }

/* ===========================================================================
   PILL / BADGE
   =========================================================================== */
.pill, .badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .6rem; border-radius: 999px;
  font-size: .78rem; font-weight: 700; line-height: 1.3;
  white-space: nowrap;
}
.pill.yes, .badge.green  { background: color-mix(in srgb, var(--comedor) 16%, var(--surface)); color: var(--comedor); }
.pill.no,  .badge.pink   { background: color-mix(in srgb, var(--alergia) 16%, var(--surface)); color: var(--alergia); }
.badge.blue   { background: color-mix(in srgb, var(--brand) 16%, var(--surface));   color: var(--brand); }
.badge.amber  { background: color-mix(in srgb, var(--aviso) 18%, var(--surface));   color: #b45309; }
.badge.slate  { background: var(--surface-2); color: var(--muted); }
.dark .badge.amber { color: #fcd34d; }

/* ===========================================================================
   ALÉRGENO — color + ICONO + TEXTO (nunca solo color, por accesibilidad)
   ---------------------------------------------------------------------------
   Uso: {% include "partials/allergen.html" with name=a.name severity=... %}
   =========================================================================== */
.allergen {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .28rem .65rem .28rem .55rem;
  border-radius: 999px;
  font-size: .82rem; font-weight: 700; line-height: 1.2;
  border: 1.5px solid;
}
.allergen .ico { font-size: 1rem; line-height: 1; }     /* el icono refuerza el color */
.allergen .txt { white-space: nowrap; }

/* severidad: intolerancia (ámbar) < alergia (rosa) < anafilaxia (rojo fuerte) */
.allergen.intolerancia { color:#b45309; border-color: color-mix(in srgb, var(--aviso) 55%, transparent); background: color-mix(in srgb, var(--aviso) 14%, var(--surface)); }
.allergen.alergia      { color:#be185d; border-color: color-mix(in srgb, var(--alergia) 55%, transparent); background: color-mix(in srgb, var(--alergia) 12%, var(--surface)); }
.allergen.anafilaxia   { color:#b91c1c; border-color:#ef4444; background: color-mix(in srgb, #ef4444 14%, var(--surface)); }
.dark .allergen.intolerancia { color:#fcd34d; }
.dark .allergen.alergia      { color:#f9a8d4; }
.dark .allergen.anafilaxia   { color:#fca5a5; }
.allergen.anafilaxia .ico { animation: allergen-pulse 1.6s ease-in-out infinite; }
@keyframes allergen-pulse { 0%,100%{ transform: scale(1); } 50%{ transform: scale(1.18); } }
@media (prefers-reduced-motion: reduce) { .allergen.anafilaxia .ico { animation: none; } }

/* ===========================================================================
   MENSAJES / ALERTAS (Django messages + alerta crítica de cocina)
   =========================================================================== */
.msg {
  display:flex; align-items:flex-start; gap:.5rem;
  padding: .7rem 1rem; border-radius: .6rem;
  font-size: .95rem; border: 1px solid transparent;
}
.msg.success { background: color-mix(in srgb, var(--comedor) 12%, var(--surface)); color: var(--comedor); border-color: color-mix(in srgb, var(--comedor) 35%, transparent); }
.msg.error   { background: color-mix(in srgb, var(--alergia) 12%, var(--surface)); color: var(--alergia); border-color: color-mix(in srgb, var(--alergia) 35%, transparent); }
.msg.warning { background: color-mix(in srgb, var(--aviso) 14%, var(--surface)); color:#b45309; border-color: color-mix(in srgb, var(--aviso) 40%, transparent); }
.msg.info    { background: color-mix(in srgb, var(--brand) 10%, var(--surface)); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
.dark .msg.warning { color:#fcd34d; }

.alert-critical {
  background: color-mix(in srgb, #ef4444 10%, var(--surface));
  border: 1.5px solid #ef4444; color: #b91c1c;
  border-radius: .7rem; padding: .9rem 1.1rem; margin-bottom: 1rem;
  box-shadow: 0 4px 16px rgba(239,68,68,.12);
}
.dark .alert-critical { color:#fca5a5; }
.alert-critical table { margin-top:.5rem; }
.alert-critical thead th, .alert-critical tbody td { border-color: color-mix(in srgb, #ef4444 25%, transparent); }

/* ===========================================================================
   NAV-DÍA (selector de día prev/siguiente de roster y cocina)
   =========================================================================== */
.nav-day {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .4rem .6rem; margin-bottom: 1rem;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.nav-day strong { font-family:'Nunito',sans-serif; text-transform: capitalize; }
.nav-day .btn.secondary { min-width: 48px; }

/* ===========================================================================
   LANDING PÚBLICA — animaciones y componentes de marketing de la home (/)
   ---------------------------------------------------------------------------
   Todo lo de esta sección es exclusivo de templates/public/home.html.
   Progressive enhancement: [data-reveal] arranca oculto solo si hay JS+IO
   (clase .js en <html>); sin JS aparece visible (regla por defecto abajo).
   =========================================================================== */

/* La landing (body.lp-page) pinta a ancho completo: el wrapper centrado vacío
   de base.html (block content) se colapsa para no dejar una franja arriba. */
.lp-page > div.max-w-6xl { display: none !important; }
.lp-page { background: var(--bg); }

/* -- scroll-reveal: por defecto VISIBLE (no-JS friendly); el JS añade .js al
      <html> y entonces sí parte oculto hasta .is-visible. -- */
[data-reveal] {
  opacity: 1;
  transform: none;
}
.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .6s cubic-bezier(.16,1,.3,1),
              transform .6s cubic-bezier(.16,1,.3,1);
  will-change: opacity, transform;
}
.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
.js [data-reveal="left"]  { transform: translateX(-26px); }
.js [data-reveal="right"] { transform: translateX(26px); }
.js [data-reveal="zoom"]  { transform: scale(.94); }
.js [data-reveal="left"].is-visible,
.js [data-reveal="right"].is-visible,
.js [data-reveal="zoom"].is-visible { transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* -- HERO -- */
.hero-bg {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(60rem 40rem at 75% -10%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%),
    radial-gradient(48rem 32rem at 5% 10%, color-mix(in srgb, var(--comedor) 12%, transparent), transparent 70%),
    var(--bg);
}
.hero-blob {
  position: absolute;
  inset: auto -8rem -10rem auto;
  width: 28rem; height: 28rem;
  background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--aviso) 26%, transparent), transparent 60%);
  filter: blur(8px);
  border-radius: 999px;
  pointer-events: none;
  animation: hero-float 14s ease-in-out infinite;
}
@keyframes hero-float {
  0%,100% { transform: translateY(0) scale(1); }
  50%     { transform: translateY(-18px) scale(1.05); }
}
@media (prefers-reduced-motion: reduce) { .hero-blob { animation: none; } }

/* Marco del vídeo del hero (placeholder con poster que Joan sustituirá). */
.hero-video-frame {
  position: relative;
  border-radius: 1.4rem;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
  box-shadow: 0 12px 40px rgba(15,23,42,.16), 0 2px 8px rgba(15,23,42,.08);
  aspect-ratio: 16 / 10;
}
.dark .hero-video-frame { box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.hero-video-frame video,
.hero-video-frame img,
.hero-video-frame .hero-video-ph { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-video-ph {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .5rem; text-align: center; padding: 1.5rem;
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--brand) 14%, var(--surface)),
      color-mix(in srgb, var(--comedor) 12%, var(--surface)));
  color: var(--muted);
}

/* -- chips de paleta (los 4 colores del Excel real) -- */
.swatch { width: 1.05rem; height: 1.05rem; border-radius: .35rem; display: inline-block; }
.swatch.brand   { background: var(--brand); }
.swatch.comedor { background: var(--comedor); }
.swatch.aviso   { background: var(--aviso); }
.swatch.alergia { background: var(--alergia); }

/* -- feature cards: hover de elevación + icono que cobra vida -- */
.feature-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  padding: 1.4rem;
  box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 6px 20px rgba(15,23,42,.05);
  transition: transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s ease, border-color .25s ease;
  height: 100%;
}
.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(15,23,42,.12);
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
}
.dark .feature-card:hover { box-shadow: 0 12px 32px rgba(0,0,0,.5); }
.feature-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3rem; height: 3rem; border-radius: .9rem;
  font-size: 1.5rem; margin-bottom: .85rem;
  transition: transform .25s ease;
}
.feature-card:hover .feature-icon { transform: scale(1.12) rotate(-4deg); }
.feature-icon.i-brand   { background: color-mix(in srgb, var(--brand) 14%, var(--surface));   }
.feature-icon.i-comedor { background: color-mix(in srgb, var(--comedor) 16%, var(--surface)); }
.feature-icon.i-aviso   { background: color-mix(in srgb, var(--aviso) 18%, var(--surface));   }
.feature-icon.i-alergia { background: color-mix(in srgb, var(--alergia) 14%, var(--surface)); }

/* -- "Excel a mano" del bloque problema -- */
.excel-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 3px;
  padding: .6rem;
  border-radius: .8rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.excel-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.excel-cell.c-brand   { background: color-mix(in srgb, var(--brand) 55%, var(--surface)); }
.excel-cell.c-comedor { background: color-mix(in srgb, var(--comedor) 55%, var(--surface)); }
.excel-cell.c-aviso   { background: color-mix(in srgb, var(--aviso) 60%, var(--surface)); }
.excel-cell.c-alergia { background: color-mix(in srgb, var(--alergia) 55%, var(--surface)); }

/* -- stat / counter -- */
.stat-num {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1;
  letter-spacing: -.02em;
}

/* -- role card -- */
.role-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  padding: 1.4rem;
  transition: transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s ease;
  height: 100%;
}
.role-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(15,23,42,.1); }
.dark .role-card:hover { box-shadow: 0 12px 28px rgba(0,0,0,.45); }

/* -- pill de sección (eyebrow) -- */
.eyebrow {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .8rem; border-radius: 999px;
  font-size: .78rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  background: color-mix(in srgb, var(--brand) 12%, var(--surface));
  color: var(--brand);
  border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent);
}
.dark .eyebrow { color: #93c5fd; }

/* -- títulos grandes de sección de la landing (override de h1/h2 de paneles) -- */
.lp-h1 {
  font-family: 'Nunito', sans-serif; font-weight: 900;
  font-size: clamp(2.1rem, 6vw, 3.6rem); line-height: 1.05;
  letter-spacing: -.025em; margin: 0;
}
.lp-h2 {
  font-family: 'Nunito', sans-serif; font-weight: 800;
  font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.12;
  letter-spacing: -.02em; margin: 0;
}
.lp-lead { font-size: clamp(1.05rem, 2.2vw, 1.25rem); line-height: 1.6; color: var(--muted); }

/* Botón grande para los CTA de la landing. */
.btn.lg { min-height: 56px; padding: .9rem 1.6rem; font-size: 1.05rem; border-radius: .75rem; }

/* ===========================================================================
   PANELES (profesor · familia · cocina · dirección) — componentes de UI
   ---------------------------------------------------------------------------
   Todo lo de abajo es exclusivo de los paneles auth-gated. Mobile-first,
   táctil (objetivos ≥48px), dark-mode con las variables de marca. NO toca la
   lógica de negocio: solo presentación.
   =========================================================================== */

/* -- rejilla de cards de métrica (dashboards) -- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

/* -- STAT CARD: número grande + etiqueta + acento de color por la izquierda -- */
.stat-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem 1.1rem 1.35rem;
  box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 4px 16px rgba(15,23,42,.06);
  overflow: hidden;
}
.dark .stat-card { box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.35); }
.stat-card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 5px;
  background: var(--accent, var(--brand));
}
.stat-card.a-brand   { --accent: var(--brand); }
.stat-card.a-comedor { --accent: var(--comedor); }
.stat-card.a-aviso   { --accent: var(--aviso); }
.stat-card.a-alergia { --accent: var(--alergia); }
.stat-card .stat-label {
  display: flex; align-items: center; gap: .4rem;
  font-size: .82rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .03em;
}
.stat-card .stat-big {
  font-family: 'Nunito', sans-serif; font-weight: 900;
  font-size: clamp(2.2rem, 7vw, 3.2rem); line-height: 1;
  letter-spacing: -.02em; color: var(--text); margin: .35rem 0 .1rem;
}
.stat-card .stat-sub { font-size: .85rem; color: var(--muted); }

/* -- BLOQUE DE ALÉRGENOS de cocina: card crítica destacada arriba -- */
.allergen-board {
  background: color-mix(in srgb, #ef4444 7%, var(--surface));
  border: 2px solid #ef4444;
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem; margin-bottom: 1.25rem;
  box-shadow: 0 6px 24px rgba(239,68,68,.15);
}
.dark .allergen-board { background: color-mix(in srgb, #ef4444 12%, var(--surface)); }
.allergen-board .ab-head {
  display: flex; align-items: center; gap: .55rem;
  font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 1.1rem;
  color: #b91c1c; margin-bottom: .85rem;
}
.dark .allergen-board .ab-head { color: #fca5a5; }
.allergen-board .ab-head .ab-count {
  margin-left: auto; font-size: .8rem; font-weight: 800;
  background: #ef4444; color: #fff; padding: .15rem .6rem; border-radius: 999px;
}
.allergen-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem;
  padding: .7rem .25rem; border-top: 1px solid color-mix(in srgb, #ef4444 22%, transparent);
}
.allergen-row:first-of-type { border-top: 0; }
.allergen-row .ar-name { font-weight: 800; min-width: 9rem; color: var(--text); }
.allergen-row .ar-allergens { display: flex; flex-wrap: wrap; gap: .35rem; }
.allergen-row.collision {
  background: color-mix(in srgb, #ef4444 9%, transparent);
  border-radius: .55rem;
}
.collision-flag {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .76rem; font-weight: 800; color: #fff; background: #dc2626;
  padding: .2rem .55rem; border-radius: 999px; white-space: nowrap;
  animation: allergen-pulse 1.6s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { .collision-flag { animation: none; } }
.allergen-row .ar-protocol {
  flex-basis: 100%; font-size: .85rem; color: var(--muted);
  padding-left: .1rem; margin-top: -.1rem;
}
.allergen-row .ar-protocol b { color: var(--text); font-weight: 700; }

/* -- barra de desglose por tipo de menú (color del propio tipo) -- */
.menu-bars { display: flex; flex-direction: column; gap: .7rem; }
.menu-bar { display: grid; grid-template-columns: 8.5rem 1fr auto; align-items: center; gap: .6rem; }
.menu-bar .mb-name { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; font-size: .92rem; }
.menu-bar .mb-dot { width: .85rem; height: .85rem; border-radius: 50%; flex-shrink: 0; }
.menu-bar .mb-track { height: .85rem; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.menu-bar .mb-fill { height: 100%; border-radius: 999px; transition: width .5s cubic-bezier(.16,1,.3,1); min-width: 2px; }
.menu-bar .mb-val { font-family: 'Nunito', sans-serif; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 4.5rem; text-align: right; }
.menu-bar .mb-val .mb-split { font-size: .75rem; color: var(--muted); font-weight: 700; }

/* -- TABLA RESUMEN para cocina (estructura exacta de la hoja del Excel) -- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 1rem; }
.resumen-table { min-width: 30rem; font-variant-numeric: tabular-nums; }
.resumen-table th.rt-block { text-align: left; white-space: nowrap; font-weight: 800; }
.resumen-table .rt-num { text-align: right; white-space: nowrap; }
.resumen-table thead th { font-size: .82rem; text-transform: uppercase; letter-spacing: .02em; }
.resumen-table thead .rt-num { text-align: right; }
.resumen-table .rt-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .35rem; vertical-align: middle; }
.resumen-table .rt-total { font-weight: 800; }
.resumen-table tbody th.rt-block { color: var(--text); }
.resumen-table tfoot th, .resumen-table tfoot td { border-top: 2px solid var(--line); font-weight: 800; }
.resumen-table tfoot .rt-foot-global td, .resumen-table tfoot .rt-foot-global th { font-size: 1.05rem; }
.resumen-table tfoot .rt-foot-global .rt-total { color: var(--brand, #2563eb); }

/* -- LISTA TÁCTIL del roster del profesor -- */
.touch-list { display: flex; flex-direction: column; gap: .6rem; }
.touch-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: .8rem; padding: .55rem .7rem;
  transition: border-color .15s ease, box-shadow .15s ease, opacity .2s ease, background .15s ease;
}
.touch-row:hover { border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); }
/* verde = come (estado por defecto, borde sutil verde a la izquierda) */
.touch-row { border-left: 4px solid color-mix(in srgb, var(--comedor) 55%, var(--line)); }
/* gris = ausente (no viene) */
.touch-row.is-absent {
  background: color-mix(in srgb, var(--muted) 8%, var(--surface));
  border-left-color: var(--muted);
}
/* ámbar = dieta blanda (está malito pero SÍ come) — distinto de la ausencia */
.touch-row.is-soft {
  background: color-mix(in srgb, var(--aviso) 9%, var(--surface));
  border-left-color: var(--aviso);
}
.touch-row.is-absent.is-soft { border-left-color: var(--aviso); }

/* El bloque grande (avatar+nombre) ES el botón de ausencia: ocupa la línea */
.touch-row .tr-toggle { flex: 1 1 14rem; min-width: 0; margin: 0; }
.touch-row .tr-tap {
  display: flex; align-items: center; gap: .75rem; width: 100%;
  background: transparent; border: 0; padding: .15rem; margin: 0;
  text-align: left; cursor: pointer; border-radius: .6rem;
  min-height: 48px; color: inherit; font: inherit;
}
.touch-row .tr-tap:hover { background: color-mix(in srgb, var(--brand) 5%, transparent); }
.touch-row .tr-tap:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 1px; }
.touch-row .tr-avatar {
  flex-shrink: 0; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 1rem;
  background: color-mix(in srgb, var(--comedor) 14%, var(--surface)); color: var(--comedor);
}
.touch-row.is-absent .tr-avatar { background: color-mix(in srgb, var(--muted) 16%, var(--surface)); color: var(--muted); }
.touch-row.is-soft .tr-avatar { background: color-mix(in srgb, var(--aviso) 18%, var(--surface)); color: var(--aviso); }
.touch-row .tr-main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.touch-row .tr-name { font-weight: 700; color: var(--text); display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.touch-row .tr-meta { font-size: .8rem; color: var(--muted); margin-top: .1rem; }
.touch-row .tr-spinner { flex-shrink: 0; }
.touch-row .tr-action { flex-shrink: 0; }

/* pill ámbar de dieta blanda */
.pill.soft, .badge.soft { background: color-mix(in srgb, var(--aviso) 18%, var(--surface)); color: #92600a; }
.dark .pill.soft { color: var(--aviso); }

/* cluster de acciones inline (celdas editables) + sus formularios en línea */
.touch-row .tr-cells { display: flex; flex-wrap: wrap; gap: .4rem; flex-shrink: 0; }
.touch-row .tr-cells form { margin: 0; }

/* editores inline desplegables (menú / alérgenos): ocupan toda la fila */
.touch-row .tr-editor {
  flex-basis: 100%; margin-top: .35rem; padding: .7rem .8rem;
  background: var(--surface-2); border-radius: .6rem; border: 1px solid var(--line);
}
.touch-row .tr-editor form { margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.touch-row .tr-editor select { max-width: 22rem; }
.tr-editor-label { font-size: .82rem; font-weight: 700; color: var(--muted); }
.tr-allergens { display: flex; flex-wrap: wrap; gap: .4rem .9rem; }
.tr-chk { display: inline-flex; align-items: center; gap: .35rem; font-size: .9rem; }
.tr-chk input { width: 1.05rem; height: 1.05rem; }

/* feedback HTMX: la fila se atenúa mientras vuela la petición */
.touch-row.htmx-request { opacity: .55; }
.touch-row .htmx-indicator { opacity: 0; transition: opacity .15s ease; }
.touch-row.htmx-request .htmx-indicator { opacity: 1; }

/* -- CHILD CARD del panel familia -- */
.child-card { padding: 1.1rem 1.25rem; }
.child-card .cc-head { display: flex; align-items: center; gap: .8rem; margin-bottom: .85rem; }
.child-card .cc-avatar {
  width: 3rem; height: 3rem; border-radius: 1rem; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 1.15rem;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 18%, var(--surface)), color-mix(in srgb, var(--comedor) 18%, var(--surface)));
  color: var(--brand);
}
.child-card .cc-name { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 1.1rem; margin: 0; }
.child-card .cc-enrollment { font-size: .9rem; color: var(--muted); margin: .1rem 0 0; }
.child-card .cc-status { display: flex; align-items: center; gap: .5rem; margin: .9rem 0; padding: .6rem .8rem; border-radius: .6rem; background: var(--surface-2); }
.child-card .cc-status.eats { background: color-mix(in srgb, var(--comedor) 12%, var(--surface)); }
.child-card .cc-status.skip { background: color-mix(in srgb, var(--alergia) 12%, var(--surface)); }

/* -- canvas de gráfica (dirección): caja con alto fijo responsiva -- */
.chart-box { position: relative; height: 280px; }
@media (min-width: 768px) { .chart-box { height: 320px; } }

/* -- mini-leyenda de tipos de menú -- */
.legend { display: flex; flex-wrap: wrap; gap: .6rem 1rem; margin-top: .8rem; }
.legend .lg-item { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; font-weight: 600; color: var(--muted); }
.legend .lg-dot { width: .8rem; height: .8rem; border-radius: 50%; }

/* -- toolbar de cabecera de panel (título + acción a la derecha) -- */
.panel-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem; margin-bottom: .25rem; }
.panel-head h1 { margin-bottom: .25rem; }
