/* 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: #187546;
  --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, h2.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: 8px 20px; min-height: 60px; display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; }
.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 { display: flex; flex-wrap: wrap; gap: 2px 4px; }
.topbar nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; 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 > * { min-width: 0; } /* una tabla ancha se desplaza dentro de su tarjeta, no ensancha la rejilla */
.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; }
/* En pantallas estrechas una tabla no ensancha la página: se desplaza dentro de
   su contenedor. Si la vista no la envolvió en .tabla-scroll, lo hace su tarjeta.
   position: relative contiene los textos solo para lectores de pantalla (.sr),
   que si no se colocan respecto a la página y la ensanchan. */
.tabla-scroll, .card:has(table.tabla):not(:has(.tabla-scroll)) { overflow-x: auto; position: relative; }
.tabla-scroll { min-width: 0; max-width: 100%; }
input, select, textarea { max-width: 100%; }

/* ── 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; }

/* ── Accesibilidad ───────────────────────────────────────────────────────── */
.saltar { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 10px; font-weight: 600; }
.saltar:focus { top: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
#vista:focus, h1[tabindex="-1"]:focus { outline: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
.institucional { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 28px; padding: 18px 20px 0; max-width: var(--maxw); margin: 0 auto; }
.institucional img { max-height: 56px; max-width: 200px; object-fit: contain; }
.institucional p { flex-basis: 100%; text-align: center; color: var(--muted); font-size: .8rem; margin: 0; }
.faq details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--navy); min-height: 28px; }
.faq p { margin: 8px 0 0; }
.post--interno { background: var(--warn-soft); border-radius: 8px; padding-left: 10px; padding-right: 10px; }
.manual h2 { font-size: 1.1rem; }
.manual > h2:first-child { font-size: 1.4rem; }
.btn.activo { border-color: var(--accent); color: var(--accent); }
.tabla td.acciones { white-space: nowrap; }
.tabla td.acciones .btn + .btn { margin-left: 6px; }
.fila-copia td { background: var(--soft); }
.fila-copia form { align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.enlace { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; }

/* ── Comunidad del grupo: foros, chat, tablón, calendario ────────────────── */
.accesos { list-style: none; margin: 0; padding: 0; }
.accesos li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.accesos li:last-child { border-bottom: 0; }
.lista-foros { list-style: none; margin: 0; padding: 0; }
.lista-foros li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.lista-foros li:last-child { border-bottom: 0; }
.post { padding: 14px 0; border-bottom: 1px solid var(--line); }
.post:last-child { border-bottom: 0; }
.post__cab { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.texto-libre { overflow-wrap: anywhere; }
.hilo--chat { max-height: 55vh; min-height: 240px; }
.subnav { margin: 4px 0 14px; }
.anuncio .prosa { font-size: 1rem; }
.grid--lado-ancho { grid-template-columns: 1fr 340px; align-items: start; }
@media (max-width: 960px) { .grid--lado-ancho { grid-template-columns: 1fr; } }
.lista-eventos { list-style: none; margin: 0; padding: 0; }
.lista-eventos li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.lista-eventos li:last-child { border-bottom: 0; }
table.cal { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 520px; }
.cal th { font-size: .75rem; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 4px; text-align: left; }
.cal td { border: 1px solid var(--line); height: 78px; vertical-align: top; padding: 4px; font-size: .78rem; }
.cal__vacio { background: var(--soft); }
.cal__hoy { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal__n { display: block; font-weight: 600; color: var(--navy); margin-bottom: 2px; }
.cal__ev { display: block; border-radius: 6px; padding: 1px 5px; margin-top: 2px; background: #EAF1FF; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal__ev--examen { background: var(--bad-soft); color: var(--bad); }
.cal__ev--entrega { background: var(--warn-soft); color: var(--warn); }
.cal__ev--tutoria, .cal__ev--sesion { background: var(--ok-soft); color: var(--ok); }

/* ── Informes de la visita virtual ─────────────────────────────────────── */
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid--graficos { grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); }
.ficha { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 10px 0 0; font-size: .92rem; }
.ficha dt { color: var(--muted); }
.ficha dd { margin: 0; }
@media (max-width: 560px) { .ficha { grid-template-columns: 1fr; } .ficha dd { margin-bottom: 6px; } }
.tabla--compacta { font-size: .85rem; }
.tabla--compacta th, .tabla--compacta td { padding: 6px 8px; }
.informe h4 { margin: 14px 0 6px; font-size: .95rem; color: var(--navy); }
.grafico { width: 100%; max-width: 560px; height: auto; font-size: 12px; font-family: var(--sans); }
.grafico__eti { fill: var(--ink); }
.grafico__val { fill: var(--muted); }
.grafico__barra { fill: var(--accent); }
details.card > summary { cursor: pointer; min-height: 32px; }
.marco-paquete { position: relative; width: 100%; height: min(78vh, 760px); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.marco-paquete iframe { width: 100%; height: 100%; border: 0; }
pre.xml { background: var(--navy); color: #EAF1FF; padding: 14px; border-radius: 10px; overflow: auto; max-height: 480px; font-size: .78rem; line-height: 1.45; white-space: pre; }
code { overflow-wrap: anywhere; }
a.topbar__user { color: var(--muted); }
a.topbar__user:hover { color: var(--accent); }

@media print {
  .no-imprimir, .subnav { display: none !important; }
  .informe .card { break-inside: avoid; page-break-inside: avoid; }
  .grafico__barra { fill: #555; }
}

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