/* Encuestas del profesorado — Colegio Puertosol */
:root {
  --verde: #216e40;
  --verde-osc: #14331f;
  --verde-claro: #e8f2ec;
  --oro: #f2b705;
  --tinta: #1d2a22;
  --gris: #5a6b60;
  --linea: #dfe5e1;
  --fondo: #f5f7f5;
  --blanco: #fff;
  --rojo: #b3261e;
  --radio: 12px;
  font-family: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--tinta);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fondo); font-size: 17px; line-height: 1.5; }
a { color: var(--verde); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }

/* Cabecera */
.cab { background: var(--verde-osc); color: #fff; }
.cab__in { max-width: 860px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.cab img { height: 40px; width: auto; background: #fff; border-radius: 8px; padding: 3px; }
.cab__t { font-weight: 700; font-size: 1.05rem; line-height: 1.15; }
.cab__s { font-size: .85rem; opacity: .8; }
.cab__der { margin-left: auto; font-size: .9rem; text-align: right; }
.cab a { color: #fff; }

.marco { max-width: 860px; margin: 0 auto; padding: 20px 16px 48px; }
.tarjeta { background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radio); padding: 22px; margin-bottom: 16px; }
.nota-aviso { background: var(--verde-claro); border-left: 4px solid var(--verde); padding: 14px 16px; border-radius: 8px; margin: 16px 0; }
.error { background: #fdecea; border-left: 4px solid var(--rojo); padding: 12px 16px; border-radius: 8px; margin: 12px 0; color: #5f1410; }
.ok { background: var(--verde-claro); border-left: 4px solid var(--verde); padding: 12px 16px; border-radius: 8px; margin: 12px 0; }
.suave { color: var(--gris); }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px;
  border-radius: 10px; border: 2px solid var(--verde); background: var(--verde); color: #fff; font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--verde-osc); border-color: var(--verde-osc); }
.btn--sec { background: #fff; color: var(--verde); }
.btn--sec:hover { background: var(--verde-claro); color: var(--verde-osc); }
.btn--peq { min-height: 36px; padding: 0 14px; font-size: .9rem; border-width: 1.5px; }
.btn--link { background: none; border: none; color: var(--gris); text-decoration: underline; font-weight: 400; padding: 0 6px; min-height: 40px; }
.btn--link:hover { background: none; color: var(--tinta); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--oro); outline-offset: 2px; }
.acciones { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-top: 20px; }

input[type=text], input[type=password], select, textarea { font: inherit; padding: 10px 12px; border: 1.5px solid #b9c4bd;
  border-radius: 8px; background: #fff; width: 100%; }
label { font-weight: 600; }

/* Entrada con código */
.codigo { font-size: 1.6rem; letter-spacing: .2em; text-transform: uppercase; text-align: center; font-family: ui-monospace, Menlo, Consolas, monospace; }

/* Progreso */
.progreso { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-size: .95rem; color: var(--gris); }
.progreso__barra { flex: 1; height: 8px; border: 0; border-radius: 99px; overflow: hidden; background: var(--linea); -webkit-appearance: none; appearance: none; }
.progreso__barra::-webkit-progress-bar { background: var(--linea); border-radius: 99px; }
.progreso__barra::-webkit-progress-value { background: var(--verde); border-radius: 99px; }
.progreso__barra::-moz-progress-bar { background: var(--verde); border-radius: 99px; }

/* Cabecera de materia */
.materia { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 4px; }
.materia h1 { margin: 0; }
.materia__prof { font-size: 1.1rem; color: var(--gris); }

/* Pregunta con escala 1-10 */
.preg { border: 0; padding: 18px 0; margin: 0; border-top: 1px solid var(--linea); }
.preg:first-of-type { border-top: 0; }
.preg legend { font-weight: 600; padding: 0; margin-bottom: 10px; float: left; width: 100%; }
.preg legend + * { clear: both; }
.preg__n { color: var(--verde); margin-right: 4px; }
.escala { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.escala input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.escala label { display: flex; align-items: center; justify-content: center; height: 46px; border: 1.5px solid #b9c4bd;
  border-radius: 10px; background: #fff; font-weight: 700; cursor: pointer; user-select: none; }
.escala label:hover { border-color: var(--verde); }
.escala input:checked + label { background: var(--verde); border-color: var(--verde); color: #fff; }
.escala input:focus-visible + label { outline: 3px solid var(--oro); outline-offset: 2px; }
.extremos { display: flex; justify-content: space-between; font-size: .85rem; color: var(--gris); margin-top: 4px; }
.preg--falta legend { color: var(--rojo); }
.preg--falta .escala label { border-color: #e2a29d; }
@media (max-width: 560px) {
  .escala { grid-template-columns: repeat(5, 1fr); }
  .cab__s { display: none; }
}

/* Revisión */
.lista-rev { list-style: none; padding: 0; margin: 0; }
.lista-rev li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--linea); }
.lista-rev li:first-child { border-top: 0; }
.lista-rev .chk { width: 28px; height: 28px; border-radius: 50%; background: var(--verde); color: #fff; display: grid; place-items: center; flex: none; font-weight: 700; }
.lista-rev .chk--no { background: var(--gris); }
.lista-rev .chk--falta { background: #fff; border: 2px solid var(--rojo); color: var(--rojo); }
.lista-rev span.d { flex: 1; }
.lista-rev small { display: block; color: var(--gris); }

/* ---------- Panel ---------- */
.panel .marco { max-width: 1200px; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; background: #fff; border-bottom: 1px solid var(--linea); padding: 0 16px; }
.nav a { padding: 12px 14px; text-decoration: none; color: var(--gris); font-weight: 600; border-bottom: 3px solid transparent; }
.nav a.on { color: var(--verde); border-bottom-color: var(--verde); }
.nav__in { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 4px; width: 100%; }
table.t { border-collapse: collapse; width: 100%; background: #fff; font-size: .92rem; }
.t th, .t td { padding: 7px 10px; border-bottom: 1px solid var(--linea); text-align: left; vertical-align: top; }
.t th { background: #f0f3f1; font-weight: 700; position: sticky; top: 0; }
.t td.n, .t th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t tr.sub td { background: #f8faf9; font-weight: 700; }
.t tfoot td { font-weight: 700; background: #f0f3f1; }
.scroll { overflow-x: auto; border: 1px solid var(--linea); border-radius: var(--radio); }
.t-alto { background: #e3f1e7; } .t-medio { background: #f7f7e6; } .t-bajo { background: #fdf0de; } .t-critico { background: #fbe1df; }
.cifras { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.cifra { background: #fff; border: 1px solid var(--linea); border-radius: var(--radio); padding: 14px 16px; }
.cifra b { display: inline-block; padding: 0 6px; margin-left: -6px; border-radius: 6px; font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.cifra span { color: var(--gris); font-size: .9rem; }
.barra { height: 10px; background: var(--linea); border-radius: 99px; overflow: hidden; min-width: 80px; }
.barra span { display: block; height: 100%; background: var(--verde); }
.etq { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .8rem; font-weight: 700; background: var(--linea); }
.etq--abierta { background: var(--verde); color: #fff; } .etq--cerrada { background: var(--tinta); color: #fff; }
.filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 14px; }
.filtros > div { min-width: 200px; }
.leyenda { display: flex; flex-wrap: wrap; gap: 12px; font-size: .85rem; color: var(--gris); margin: 8px 0 14px; }
.leyenda i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; border: 1px solid var(--linea); }
.oculto-sin-umbral { color: var(--gris); font-style: italic; }

/* Tarjetas imprimibles de Primaria */
.tarjetas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.tarjetas .tj { border: 1px dashed #999; padding: 14px; height: 6.2cm; display: flex; flex-direction: column; justify-content: space-between; break-inside: avoid; }
.tj__nom { font-weight: 700; } .tj__g { color: var(--gris); font-size: .85rem; }
.tj__cod { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.5rem; letter-spacing: .15em; font-weight: 700; text-align: center; }
.tj__url { font-size: .8rem; text-align: center; }

@media print {
  body { background: #fff; font-size: 11pt; }
  .cab, .nav, .no-print, .acciones { display: none !important; }
  .marco { padding: 0; max-width: none; }
  .tarjeta { border: 0; padding: 0; }
  .scroll { overflow: visible; border: 0; }
  .t th { position: static; }
  .salto { break-before: page; }
  .t-alto, .t-medio, .t-bajo, .t-critico, .t th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Vista previa de administración */
.previa { background: var(--oro); color: var(--tinta); }
.previa__in { max-width: 860px; margin: 0 auto; padding: 8px 16px; font-size: .95rem; }
.previa__in a { color: var(--tinta); font-weight: 700; }
.previa__grupo { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.previa__grupo select { flex: 1 1 240px; }
