/* Tablero de contenido de Nada Menos.
   Los tokens son copia de Quipu (src/quipu/tokens.css, v3.3.0-rc.2): el sitio se
   sirve suelto desde S3 y no puede importar el sistema vendorizado. Es UI de
   producto, así que aquí sí valen --q-exito y --q-error. */

:root {
  color-scheme: light dark;

  --q-profundo: #0D1120;
  --q-noche: #141A2E;
  --q-cerro: #1A2138;
  --q-cumbre: #202844;
  --q-piedra: #E9EBF0;
  --q-caliza: #F4F5F8;
  --q-cal: #FFFFFF;
  --q-hueso: #F5F3EE;
  --q-maiz: #F0C45E;
  --q-ocre: #7A5912;
  --q-ambar: #A97F1B;
  --q-niebla: #C5CBD8;
  --q-pizarra: #5F6880;
  --q-grafito: #3E4453;

  --q-bg: var(--q-piedra);
  --q-superficie-1: var(--q-caliza);
  --q-superficie-2: var(--q-cal);
  --q-texto-1: var(--q-profundo);
  --q-texto-2: var(--q-grafito);
  --q-texto-3: var(--q-pizarra);
  --q-acento: var(--q-ocre);
  --q-acento-hover: #5F4510;
  --q-linea: #D0D4DE;
  --q-linea-fuerte: #B7BDCB;
  --q-sombra-1: 0 1px 2px rgba(13, 17, 32, .07);
  --q-exito: #26704F;
  --q-error: #A63E35;
  --q-texto-inverso: var(--q-hueso);
  --q-acento-suave: rgba(122, 89, 18, .09);
  --q-acento-borde: rgba(122, 89, 18, .30);
  --q-error-suave: rgba(166, 62, 53, .08);
  --q-exito-suave: rgba(38, 112, 79, .09);
  --q-boton-bg: var(--q-profundo);
  --q-boton-texto: var(--q-hueso);
  --q-video-bg: #0D1120;

  --q-sans: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --q-serif: "Bitter", Georgia, serif;
  --q-d3: 28px; --q-d3-tracking: -0.02em;
  --q-d4: 21px; --q-d4-tracking: -0.01em;
  --q-b1: 17px; --q-b2: 15px; --q-b3: 13px;
  --q-l1: 12px; --q-l1-tracking: 0.08em;
  --q-lh-display: 1.15; --q-lh-cuerpo: 1.6; --q-lh-ui: 1.45;

  --q-esp-1: 4px; --q-esp-2: 8px; --q-esp-3: 12px; --q-esp-4: 16px;
  --q-esp-5: 20px; --q-esp-6: 24px; --q-esp-8: 32px; --q-esp-10: 40px; --q-esp-12: 48px;
  --q-radio-1: 4px; --q-radio-2: 8px; --q-radio-3: 12px; --q-radio-4: 16px; --q-radio-pill: 999px;
  --q-mov-rapido: 120ms; --q-mov-medio: 200ms;
  --q-curva-salida: cubic-bezier(0.2, 0, 0, 1);

  --alto-barra: 60px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --q-bg: var(--q-profundo);
    --q-superficie-1: var(--q-noche);
    --q-superficie-2: var(--q-cerro);
    --q-texto-1: var(--q-hueso);
    --q-texto-2: var(--q-niebla);
    --q-texto-3: #8E97AC;
    --q-acento: var(--q-maiz);
    --q-acento-hover: #F5D488;
    --q-linea: #252D45;
    --q-linea-fuerte: #333D5A;
    --q-sombra-1: 0 1px 2px rgba(0, 0, 0, .35);
    --q-exito: #63B893;
    --q-error: #E07A6E;
    --q-texto-inverso: var(--q-profundo);
    --q-acento-suave: rgba(240, 196, 94, .10);
    --q-acento-borde: rgba(240, 196, 94, .35);
    --q-error-suave: rgba(224, 122, 110, .10);
    --q-exito-suave: rgba(99, 184, 147, .10);
    --q-boton-bg: var(--q-hueso);
    --q-boton-texto: var(--q-profundo);
    --q-video-bg: #080B15;
  }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--q-bg);
  color: var(--q-texto-1);
  font-family: var(--q-sans);
  font-size: var(--q-b2);
  line-height: var(--q-lh-ui);
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--alto-barra) + env(safe-area-inset-bottom));
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: var(--q-d3); letter-spacing: var(--q-d3-tracking); line-height: var(--q-lh-display); font-weight: 600; }
h2 { font-size: var(--q-d4); letter-spacing: var(--q-d4-tracking); line-height: var(--q-lh-display); font-weight: 600; }
h3 { font-size: var(--q-b1); font-weight: 600; }
a { color: var(--q-acento); text-underline-offset: 2px; }
a:hover { color: var(--q-acento-hover); }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--q-acento); outline-offset: 2px; border-radius: var(--q-radio-1); }
[tabindex="-1"]:focus { outline: none; }
.num { font-variant-numeric: tabular-nums; }
.visualmente-oculto {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.saltar {
  position: absolute; left: var(--q-esp-4); top: -100px; z-index: 30;
  background: var(--q-superficie-2); padding: var(--q-esp-2) var(--q-esp-3); border-radius: var(--q-radio-2);
}
.saltar:focus { top: var(--q-esp-2); }

/* ---------- Cabecera y navegación ---------- */

.cabecera {
  position: sticky; top: 0; z-index: 10;
  background: var(--q-bg);
  border-bottom: 1px solid var(--q-linea);
}
.cabecera-fila {
  display: flex; align-items: center; justify-content: space-between; gap: var(--q-esp-3);
  max-width: 1120px; margin: 0 auto; padding: var(--q-esp-3) var(--q-esp-4);
}
.marca { font-weight: 600; font-size: var(--q-b1); letter-spacing: -0.01em; display: flex; align-items: center; gap: var(--q-esp-2); }
.marca svg { flex: none; }
.marca span { color: var(--q-texto-3); font-weight: 400; }
.sesion { display: flex; align-items: center; gap: var(--q-esp-2); font-size: var(--q-b3); color: var(--q-texto-3); min-width: 0; }
.sesion .correo { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.marca { white-space: nowrap; }
@media (max-width: 479px) { .sesion .correo { display: none; } }

.navegacion {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--q-superficie-2);
  border-top: 1px solid var(--q-linea);
  padding-bottom: env(safe-area-inset-bottom);
}
.navegacion a {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--alto-barra);
  color: var(--q-texto-3); text-decoration: none;
  font-size: var(--q-l1); font-weight: 500;
}
.navegacion a svg { width: 22px; height: 22px; }
.navegacion a[aria-current="page"] { color: var(--q-texto-1); }
.navegacion a[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 2px;
  background: var(--q-acento); border-radius: 0 0 2px 2px;
}
.contador {
  position: absolute; top: 6px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--q-radio-pill);
  background: var(--q-acento); color: var(--q-texto-inverso);
  font-size: 11px; font-weight: 600; line-height: 18px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.contador:empty { display: none; }

@media (min-width: 760px) {
  body { padding-bottom: 0; }
  .cabecera-fila { padding-bottom: 0; }
  .navegacion {
    position: static; display: flex; gap: var(--q-esp-1);
    max-width: 1120px; margin: 0 auto; padding: 0 var(--q-esp-2);
    background: none; border: 0;
  }
  .navegacion a {
    flex-direction: row; gap: var(--q-esp-2); min-height: 44px; padding: 0 var(--q-esp-3);
    font-size: var(--q-b2);
  }
  .navegacion a svg { width: 18px; height: 18px; }
  .navegacion a[aria-current="page"]::before { top: auto; bottom: -1px; left: var(--q-esp-3); right: var(--q-esp-3); border-radius: 2px 2px 0 0; }
  .contador { position: static; }
}

/* ---------- Contenido ---------- */

main { max-width: 1120px; margin: 0 auto; padding: var(--q-esp-5) var(--q-esp-4) var(--q-esp-10); outline: none; }
.encabezado-vista { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--q-esp-2); margin-bottom: var(--q-esp-5); }
.encabezado-vista p { color: var(--q-texto-3); font-size: var(--q-b3); }
.etiqueta-l1 { font-size: var(--q-l1); letter-spacing: var(--q-l1-tracking); text-transform: uppercase; color: var(--q-texto-3); font-weight: 600; }
.secundario { color: var(--q-texto-3); font-size: var(--q-b3); }
.cargando, .vacio {
  color: var(--q-texto-3); padding: var(--q-esp-10) var(--q-esp-4); text-align: center;
}
.vacio h2 { color: var(--q-texto-1); margin-bottom: var(--q-esp-2); }
.cargando::before {
  content: ""; display: block; width: 24px; height: 24px; margin: 0 auto var(--q-esp-3);
  border: 2px solid var(--q-linea-fuerte); border-top-color: var(--q-acento); border-radius: 50%;
  animation: girar 800ms linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}
.error-carga { border: 1px solid var(--q-error); background: var(--q-error-suave); border-radius: var(--q-radio-3); padding: var(--q-esp-4); }

.superficie {
  background: var(--q-superficie-2);
  border: 1px solid var(--q-linea);
  border-radius: var(--q-radio-4);
  box-shadow: var(--q-sombra-1);
}

/* ---------- Botones y campos ---------- */

.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--q-esp-2);
  min-height: 44px; padding: 0 var(--q-esp-4);
  border-radius: var(--q-radio-pill); border: 1px solid var(--q-linea-fuerte);
  background: var(--q-superficie-2); color: var(--q-texto-1);
  font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background var(--q-mov-rapido) var(--q-curva-salida), border-color var(--q-mov-rapido) var(--q-curva-salida);
  touch-action: manipulation; user-select: none;
}
.boton:hover { border-color: var(--q-texto-3); }
.boton:active { transform: scale(.98); }
.boton[aria-expanded="true"] { border-color: var(--q-acento); background: var(--q-acento-suave); }
.boton[disabled] { opacity: .5; cursor: default; transform: none; }
.boton-primario { background: var(--q-boton-bg); color: var(--q-boton-texto); border-color: var(--q-boton-bg); }
.boton-primario:hover { border-color: var(--q-boton-bg); opacity: .92; }
.boton-peligro { color: var(--q-error); }
.boton-texto { border-color: transparent; background: none; padding: 0 var(--q-esp-2); min-height: 36px; color: var(--q-texto-2); }
.boton-texto:hover { border-color: transparent; color: var(--q-texto-1); }
.boton-chico { min-height: 36px; padding: 0 var(--q-esp-3); font-size: var(--q-b3); }

.campo { display: grid; gap: var(--q-esp-1); }
.campo label, .campo .etiqueta { font-size: var(--q-b3); color: var(--q-texto-2); font-weight: 500; }
.entrada, textarea.entrada {
  width: 100%; min-height: 44px;
  padding: var(--q-esp-2) var(--q-esp-3);
  border: 1px solid var(--q-linea-fuerte); border-radius: var(--q-radio-2);
  background: var(--q-superficie-1);
  font-size: 16px; /* evita el zoom de iOS al enfocar */
  line-height: var(--q-lh-cuerpo);
}
textarea.entrada { resize: vertical; min-height: 120px; }
.entrada:focus-visible { outline-offset: 0; border-color: var(--q-acento); }

/* ---------- Chips de estado ---------- */

.chip {
  display: inline-flex; align-items: center; gap: var(--q-esp-1);
  padding: 2px var(--q-esp-2); border-radius: var(--q-radio-pill);
  font-size: var(--q-b3); font-weight: 500; white-space: nowrap;
  border: 1px solid var(--q-linea-fuerte); color: var(--q-texto-2);
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-sin-punto::before { display: none; }
.chip-acento { color: var(--q-acento); border-color: var(--q-acento-borde); background: var(--q-acento-suave); }
.chip-exito { color: var(--q-exito); border-color: currentColor; background: var(--q-exito-suave); }
.chip-error { color: var(--q-error); border-color: currentColor; background: var(--q-error-suave); }
.chip-tenue { color: var(--q-texto-3); }

/* ---------- Entrar ---------- */

.entrar { max-width: 400px; margin: var(--q-esp-10) auto 0; padding: var(--q-esp-6); display: grid; gap: var(--q-esp-5); }
.entrar p { color: var(--q-texto-2); }
.entrar form { display: grid; gap: var(--q-esp-4); }
.entrar .boton { width: 100%; }

/* ---------- Por aprobar ---------- */

.pieza { margin-bottom: var(--q-esp-8); }
.pieza-cabeza { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--q-esp-3); margin-bottom: var(--q-esp-4); }
.pieza-cabeza .titulo { display: grid; gap: 2px; }
.pieza-cuerpo { display: grid; gap: var(--q-esp-4); }
@media (min-width: 900px) {
  .pieza-cuerpo { grid-template-columns: 300px 1fr; align-items: start; }
  .pieza-video { position: sticky; top: 120px; }
}
.pieza-video { display: grid; gap: var(--q-esp-2); }
.pieza-video video {
  display: block; width: 100%; max-height: min(440px, 55vh);
  background: var(--q-video-bg); border-radius: var(--q-radio-3);
}
.pieza-video .falla-video {
  display: grid; place-items: center; min-height: 160px; padding: var(--q-esp-4);
  background: var(--q-superficie-1); border: 1px dashed var(--q-linea-fuerte); border-radius: var(--q-radio-3);
  color: var(--q-texto-3); text-align: center; font-size: var(--q-b3);
}
.tarjetas { display: grid; gap: var(--q-esp-3); }

.tarjeta { padding: var(--q-esp-4); display: grid; gap: var(--q-esp-3); }
.tarjeta-cabeza { display: flex; flex-wrap: wrap; align-items: center; gap: var(--q-esp-2); }
.tarjeta-cabeza h3 { margin-right: auto; }
.datos { display: flex; flex-wrap: wrap; gap: var(--q-esp-1) var(--q-esp-4); font-size: var(--q-b3); color: var(--q-texto-2); }
.datos b { font-weight: 600; color: var(--q-texto-1); }
.rechazo-nota { font-size: var(--q-b3); padding: var(--q-esp-2) var(--q-esp-3); border-left: 3px solid var(--q-error); background: var(--q-error-suave); border-radius: 0 var(--q-radio-2) var(--q-radio-2) 0; }
.acciones { display: flex; flex-wrap: wrap; gap: var(--q-esp-2); }
.acciones .boton-primario { flex: 1 1 auto; }
@media (min-width: 480px) { .acciones .boton-primario { flex: 0 0 auto; } }
.panel-extra { display: grid; gap: var(--q-esp-3); padding: var(--q-esp-3); background: var(--q-superficie-1); border-radius: var(--q-radio-3); }
.tarjeta-resuelta { padding: var(--q-esp-3) var(--q-esp-4); display: flex; flex-wrap: wrap; align-items: center; gap: var(--q-esp-2); color: var(--q-texto-2); font-size: var(--q-b3); }
.tarjeta-resuelta b { color: var(--q-texto-1); font-size: var(--q-b2); }

.avisos {
  border: 1px solid var(--q-acento-borde); background: var(--q-acento-suave);
  border-radius: var(--q-radio-3); padding: var(--q-esp-3); display: grid; gap: var(--q-esp-2);
  font-size: var(--q-b3);
}
.avisos .titulo-avisos { display: flex; align-items: center; gap: var(--q-esp-2); font-weight: 600; color: var(--q-acento); }
.avisos ul { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--q-esp-1); }
.avisos li button {
  all: unset; cursor: pointer; display: block; width: 100%; padding: var(--q-esp-1) 0;
  color: var(--q-texto-2);
}
.avisos li button:focus-visible { outline: 2px solid var(--q-acento); outline-offset: 2px; border-radius: var(--q-radio-1); }
.avisos li button:hover .contexto { text-decoration: underline; text-decoration-color: var(--q-acento-borde); }
.texto-marcado { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--q-texto-2); line-height: var(--q-lh-cuerpo); }
mark {
  background: var(--q-acento-suave); color: var(--q-texto-1);
  box-shadow: inset 0 -2px 0 var(--q-acento); border-radius: 2px; padding: 0 1px;
}

/* ---------- Calendario ---------- */

.dias { display: grid; gap: var(--q-esp-3); }
.dia { padding: var(--q-esp-3) var(--q-esp-4); }
.dia-cabeza { display: flex; align-items: baseline; gap: var(--q-esp-2); padding: var(--q-esp-1) 0 var(--q-esp-2); }
.dia-cabeza h2 { font-size: var(--q-b1); letter-spacing: 0; }
.dia-hoy { border-color: var(--q-acento-borde); box-shadow: inset 3px 0 0 var(--q-acento); }
.dia-vacio { padding: var(--q-esp-2) var(--q-esp-4); background: none; border-style: dashed; box-shadow: none; }
.dia-vacio .dia-cabeza { padding: 0; }
.dia-vacio .dia-cabeza h2 { font-size: var(--q-b2); font-weight: 500; color: var(--q-texto-3); }
.grupo-pieza + .grupo-pieza { margin-top: var(--q-esp-3); }
.grupo-pieza > p { margin-bottom: var(--q-esp-1); }
.filas { list-style: none; margin: 0; padding: 0; }
.fila {
  display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: var(--q-esp-1) var(--q-esp-3);
  padding: var(--q-esp-2) 0; border-top: 1px solid var(--q-linea);
}
.fila:first-child { border-top: 0; }
.fila .hora { color: var(--q-texto-3); font-size: var(--q-b3); }
.fila .red { font-weight: 500; min-width: 0; }
.fila .detalle { grid-column: 2 / -1; font-size: var(--q-b3); color: var(--q-texto-2); display: flex; flex-wrap: wrap; align-items: center; gap: var(--q-esp-2); overflow-wrap: anywhere; }
.fila .detalle.error { color: var(--q-error); }

/* ---------- Rendimiento ---------- */

.seccion + .seccion { margin-top: var(--q-esp-10); }
.seccion > h2 { margin-bottom: var(--q-esp-2); }
.seccion > .secundario { margin-bottom: var(--q-esp-4); }
.lista-rend { display: grid; gap: var(--q-esp-3); }
@media (min-width: 900px) { .lista-rend { grid-template-columns: 1fr 1fr; } }
.rend { padding: var(--q-esp-4); }
.rend-cabeza { display: flex; align-items: baseline; justify-content: space-between; gap: var(--q-esp-2); margin-bottom: var(--q-esp-2); }
table.metricas { width: 100%; border-collapse: collapse; font-size: var(--q-b3); }
table.metricas th, table.metricas td { padding: var(--q-esp-2) var(--q-esp-1); text-align: right; border-top: 1px solid var(--q-linea); }
table.metricas thead th { border-top: 0; color: var(--q-texto-3); font-weight: 500; font-size: var(--q-l1); vertical-align: bottom; }
table.metricas th[scope="row"], table.metricas thead th:first-child { text-align: left; font-weight: 500; color: var(--q-texto-1); padding-left: 0; }
table.metricas td { font-variant-numeric: tabular-nums; }
table.metricas abbr { text-decoration: none; }
table.metricas td.sin-dato { color: var(--q-texto-3); }
table.metricas tfoot td, table.metricas tfoot th { font-weight: 600; border-top: 1px solid var(--q-linea-fuerte); }
.multiples { display: grid; gap: var(--q-esp-3); }
@media (min-width: 640px) { .multiples { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .multiples { grid-template-columns: 1fr 1fr 1fr; } }
.grafico { padding: var(--q-esp-4); display: grid; gap: var(--q-esp-2); }
.grafico-cabeza { display: flex; align-items: baseline; justify-content: space-between; gap: var(--q-esp-2); }
.grafico-cabeza .valor { font-size: var(--q-b1); font-weight: 600; font-variant-numeric: tabular-nums; }
.grafico svg { display: block; width: 100%; height: auto; overflow: visible; }
.grafico .linea { fill: none; stroke: var(--q-texto-1); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
.grafico .area { fill: var(--q-acento-suave); }
.grafico .punto-final { fill: var(--q-acento); }
.grafico .rejilla { stroke: var(--q-linea); stroke-width: 1; }
.grafico .base { stroke: var(--q-linea-fuerte); stroke-width: 1; }
.grafico text { fill: var(--q-texto-3); font-size: 11px; font-family: var(--q-sans); font-variant-numeric: tabular-nums; }

/* ---------- Comentarios ---------- */

.comentarios { display: grid; gap: var(--q-esp-3); }
.comentario { padding: var(--q-esp-4); display: grid; gap: var(--q-esp-2); }
.comentario-cabeza { display: flex; flex-wrap: wrap; align-items: center; gap: var(--q-esp-1) var(--q-esp-2); font-size: var(--q-b3); color: var(--q-texto-3); }
.comentario-cabeza .autor { color: var(--q-texto-1); font-weight: 600; font-size: var(--q-b2); }
.comentario .cuerpo { font-size: var(--q-b1); line-height: var(--q-lh-cuerpo); white-space: pre-wrap; overflow-wrap: anywhere; }
.comentario .pie { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--q-esp-2); }

/* ---------- Avisos flotantes ---------- */

.aviso-flotante {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 20;
  bottom: calc(var(--alto-barra) + env(safe-area-inset-bottom) + var(--q-esp-3));
  display: grid; gap: var(--q-esp-2); width: min(420px, calc(100% - 32px));
  pointer-events: none;
}
@media (min-width: 760px) { .aviso-flotante { bottom: var(--q-esp-6); } }
.aviso-flotante > div {
  background: var(--q-boton-bg); color: var(--q-boton-texto);
  padding: var(--q-esp-3) var(--q-esp-4); border-radius: var(--q-radio-3);
  font-size: var(--q-b3); box-shadow: 0 8px 24px rgba(13, 17, 32, .2);
  animation: entrar var(--q-mov-medio) var(--q-curva-salida);
}
.aviso-flotante > div.error { background: var(--q-error); color: var(--q-texto-inverso); }
@keyframes entrar { from { opacity: 0; transform: translateY(8px); } }
