/* pesos: nada de bold, el maximo del ecosistema es 600 */
b,strong,th,optgroup,h1,h2,h3,h4,h5,h6{font-weight:600}
/* GestCampus · aplicación (campus del alumno y panel del centro)
   Mismos tokens que gestcampus.com: Inter, azul #2563EB, navy #0B2E59.
   El centro puede sobreescribir --accent y --navy desde su tema (whitelabel). */

:root {
  --bg: #FEFEFE;
  --soft: #F5F7FB;
  --line: #E3E9F2;
  --ink: #0F1B2D;
  --muted: #5B6B82;
  --accent: #2563EB;
  --accent-ink: #FFFFFF;
  --navy: #0B2E59;
  --ok: #1B7F4C;
  --ok-soft: #E6F5EC;
  --warn: #9A6700;
  --warn-soft: #FFF6DC;
  --bad: #B4453A;
  --bad-soft: #FBEAE8;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --radius: 14px;
  --shadow: 0 10px 28px -18px rgba(8, 37, 69, .38);
  --maxw: 1100px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--soft); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; color: var(--navy); letter-spacing: -.01em; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
[hidden] { display: none !important; }

/* ── Barra superior ─────────────────────────────────────────────────────── */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar__in { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--navy); }
.brand__logo { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: .9rem; overflow: hidden; }
.brand__logo img { width: 100%; height: 100%; object-fit: cover; }
.brand__centro { font-weight: 500; color: var(--muted); }
.topbar__sp { flex: 1; }
.topbar__user { font-size: .9rem; color: var(--muted); }
.topbar nav a { margin-left: 14px; font-weight: 500; color: var(--ink); }
.topbar nav a.activo { color: var(--accent); }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 28px 20px 60px; }
.wrap--estrecho { max-width: 760px; }
.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--lado { grid-template-columns: 280px 1fr; }
@media (max-width: 860px) { .grid--lado { grid-template-columns: 1fr; } }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.card--plana { box-shadow: none; }
.card + .card { margin-top: 18px; }
.card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 600; color: var(--accent); margin-bottom: 6px; }

/* ── Botones y formularios ───────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 999px; padding: 10px 18px; font-weight: 600; cursor: pointer; background: var(--accent); color: var(--accent-ink); transition: filter .15s, transform .05s; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn--sec { background: #fff; color: var(--navy); border-color: var(--line); }
.btn--sec:hover { background: var(--soft); }
.btn--peligro { background: var(--bad); }
.btn--peq { padding: 6px 12px; font-size: .875rem; }
.btn--bloque { width: 100%; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 5px; color: var(--navy); }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; background: #fff; color: var(--ink); }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field textarea { min-height: 90px; resize: vertical; }
.codigo input { letter-spacing: .4em; font-size: 1.6rem; text-align: center; font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.right { margin-left: auto; }

/* ── Avisos ──────────────────────────────────────────────────────────────── */
.aviso { border-radius: 10px; padding: 10px 14px; font-size: .92rem; border: 1px solid; margin: 0 0 14px; }
.aviso--ok { background: var(--ok-soft); border-color: #BFE5CD; color: var(--ok); }
.aviso--warn { background: var(--warn-soft); border-color: #F1DC9E; color: var(--warn); }
.aviso--bad { background: var(--bad-soft); border-color: #F0C3BE; color: var(--bad); }
.aviso--info { background: #EAF1FF; border-color: #C9DAFF; color: var(--navy); }

/* ── Chips, progreso, tablas ─────────────────────────────────────────────── */
.chip { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 600; background: var(--soft); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.chip--ok { background: var(--ok-soft); color: var(--ok); border-color: #BFE5CD; }
.chip--warn { background: var(--warn-soft); color: var(--warn); border-color: #F1DC9E; }
.chip--bad { background: var(--bad-soft); color: var(--bad); border-color: #F0C3BE; }
.chip--accent { background: #EAF1FF; color: var(--accent); border-color: #C9DAFF; }

.barra { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.barra > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s; }

table.tabla { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabla th, .tabla td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tabla th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.tabla tr:hover td { background: var(--soft); }
.tabla .num { text-align: right; font-variant-numeric: tabular-nums; }
.tabla-scroll { overflow-x: auto; }

/* ── Lista de unidades ───────────────────────────────────────────────────── */
.unidades { list-style: none; margin: 0; padding: 0; }
.unidades li { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.unidades li:last-child { border-bottom: 0; }
.unidades .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 600; background: var(--soft); color: var(--muted); flex: none; }
.unidades .hecha .n { background: var(--ok); color: #fff; }
.unidades .actual .n { background: var(--accent); color: #fff; }
.unidades .bloqueada { opacity: .55; }
.unidades .t { flex: 1; }
.unidades .t a { color: var(--ink); font-weight: 500; }
.unidades .actual .t a { color: var(--accent); }

/* ── Contenido de la unidad (prosa) ──────────────────────────────────────── */
.prosa { font-size: 1.04rem; line-height: 1.7; max-width: 72ch; }
.prosa h2, .prosa h3, .prosa h4 { margin-top: 1.6em; }
.prosa ul, .prosa ol { padding-left: 1.4em; }
.prosa li { margin: .35em 0; }
.prosa li ul { margin-top: .3em; }
.prosa strong { color: var(--navy); }
.prosa table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .95rem; }
.prosa th, .prosa td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prosa th { background: var(--soft); }
.prosa img { max-width: 100%; border-radius: 10px; }
.prosa blockquote { margin: 1em 0; padding: .6em 1em; border-left: 4px solid var(--accent); background: var(--soft); border-radius: 0 10px 10px 0; }
.prosa code { background: var(--soft); padding: 1px 5px; border-radius: 5px; font-size: .92em; }
.prosa pre { background: var(--navy); color: #fff; padding: 14px; border-radius: 10px; overflow-x: auto; }
.prosa pre code { background: none; color: inherit; }

/* ── Lector: barra de lectura ────────────────────────────────────────────── */
.lector { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 12px 20px; margin: 30px -22px -20px; border-radius: 0 0 var(--radius) var(--radius); display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.lector__tiempo { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--navy); }
.lector__estado { font-size: .85rem; color: var(--muted); flex: 1; min-width: 200px; }
.fin-unidad { text-align: center; padding: 24px 0 6px; color: var(--muted); font-size: .9rem; }

/* ── Test ────────────────────────────────────────────────────────────────── */
.pregunta { padding: 16px 0; border-bottom: 1px solid var(--line); }
.pregunta:last-child { border-bottom: 0; }
.pregunta__n { color: var(--accent); font-weight: 600; margin-right: 6px; }
.pregunta__e { font-weight: 600; margin-bottom: 10px; }
.opcion { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin: 6px 0; cursor: pointer; background: #fff; }
.opcion:hover { background: var(--soft); }
.opcion input { margin-top: 4px; }
.opcion.acierto { background: var(--ok-soft); border-color: #BFE5CD; }
.opcion.fallo { background: var(--bad-soft); border-color: #F0C3BE; }
.opcion.clave { border-color: var(--ok); }
.explicacion { font-size: .9rem; color: var(--muted); margin-top: 8px; padding-left: 4px; }
.nota-grande { font-size: 3rem; font-weight: 600; color: var(--navy); line-height: 1; margin: 6px 0; }
.cuenta-atras { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ── Mensajes ────────────────────────────────────────────────────────────── */
.hilo { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; max-height: 360px; overflow-y: auto; }
.msg { max-width: 82%; padding: 9px 13px; border-radius: 14px; background: var(--soft); font-size: .95rem; }
.msg--propio { align-self: flex-end; background: #EAF1FF; }
.msg__meta { display: block; font-size: .75rem; color: var(--muted); margin-top: 2px; }

/* ── KPIs del panel ──────────────────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.kpi b { display: block; font-size: 1.6rem; color: var(--navy); line-height: 1.1; }
.kpi span { font-size: .8rem; color: var(--muted); }

/* ── Pie ─────────────────────────────────────────────────────────────────── */
.pie { text-align: center; color: var(--muted); font-size: .8rem; padding: 30px 20px; }
.pie a { color: inherit; }

/* Acceso */
.acceso { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.acceso .card { width: 100%; max-width: 420px; }
.acceso .brand { justify-content: center; margin-bottom: 18px; font-size: 1.2rem; }

@media print {
  .topbar, .lector, .btn, nav { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; }
}
