:root {
  --ink: #1c2430;
  --muted: #5c6b7a;
  --line: #d7e0ea;
  --bg: #f4f7fb;
  --card: #fff;
  --brand: #0f6e56;
  --brand-2: #14956f;
  --danger: #a33b3b;
  --warn: #8a5a12;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--fuente, "Segoe UI"), system-ui, sans-serif;
  font-size: var(--fuente-px, 16px);
  color: var(--ink);
  background: var(--bg);
}
button, input, select {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  background: var(--brand);
  color: white;
}
button.ghost {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--line);
}
button.danger { background: var(--danger); }
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.4rem;
  width: min(460px, 100%);
  box-shadow: 0 12px 40px rgba(20, 40, 60, 0.06);
}
h1 { font-size: 1.45rem; margin: 0 0 0.3rem; }
.sub { color: var(--muted); margin: 0 0 1rem; }
label { display: block; font-size: 0.85rem; margin: 0.7rem 0 0.25rem; }
input, select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
input[type="checkbox"] { width: auto; padding: 0; accent-color: var(--brand); }
.col-picker { display: flex; flex-wrap: wrap; gap: 0.35rem 0.85rem; align-items: center; margin: 0.2rem 0 0.85rem; }
.col-picker strong { font-size: 0.85rem; }
details.col-picker { display: block; }
details.col-picker summary { cursor: pointer; font-weight: 600; margin-bottom: 0.35rem; }
details.col-picker label { display: inline-flex; margin: 0.15rem 0.85rem 0.15rem 0; }
.marca-previa { display: block; margin: 0.35rem 0; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; }
.marca-previa.escudo { width: 72px; height: 72px; object-fit: contain; }
.marca-previa.banner { width: min(100%, 280px); height: 72px; object-fit: cover; }
input[type="file"] { padding: 0.4rem; background: #fff; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.6rem; margin: 0.8rem 0; }
.kpi { border: 1px solid var(--line); border-radius: 10px; padding: 0.65rem 0.75rem; background: #f8fafc; }
.kpi span { display: block; color: var(--muted); font-size: 0.78rem; }
.kpi strong { font-size: 1.25rem; }
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
nav {
  background: linear-gradient(180deg, var(--nav-a, #10261f), var(--nav-b, #10261f));
  color: #e7f6f1;
  padding: 1.1rem 0.8rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
button.nav-sec[data-menu="configuracion"] { margin-top: auto; }
button.nav-sec {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin: 0.55rem 0 0.05rem;
  padding: 0.4rem 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
}
button.nav-sec:hover { background: rgba(255,255,255,0.08); }
.nav-chevron {
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  flex: 0 0 auto;
}
.nav-chevron.abierto { transform: rotate(45deg); }
.nav-grupo[hidden] { display: none; }
nav a.nav-extra:hover { background: rgba(255,255,255,0.12); }
.perm { display: inline-flex; align-items: center; gap: 0.15rem; margin-right: 0.35rem; font-size: 0.75rem; }
.perm input { width: auto; }
.copiloto-fab, .copiloto { position: fixed; right: 1.1rem; z-index: 30; }
.copiloto-fab { bottom: 1.1rem; width: 3.2rem; height: 3.2rem; border-radius: 50%; padding: 0; font-size: 1.3rem; }
.copiloto-fab img, .copiloto img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.copiloto { bottom: 5rem; width: min(360px, calc(100vw - 2rem)); background: white; color: var(--ink); border: 1px solid var(--line); border-radius: 14px; padding: 0.8rem; box-shadow: 0 12px 40px rgba(20, 40, 60, 0.16); }
.copiloto[hidden] { display: none; }
.copiloto header { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
#copiloto-log { max-height: 240px; overflow: auto; margin: 0.6rem 0; }
#copiloto-log p { margin: 0.4rem 0; }
.privilegios { min-width: 520px; }
nav strong { display: block; padding: 0.4rem 0.7rem 1rem; }
nav button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: inherit;
  margin: 0.15rem 0;
}
.ayuda {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: #c62828;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  line-height: 1;
  padding: 0;
  flex: 0 0 auto;
}
nav button.active { background: rgba(255,255,255,0.12); }
main { padding: 1.3rem; }
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: end; }
.modal-fondo { position: fixed; inset: 0; z-index: 40; background: rgba(20, 32, 48, 0.45); display: grid; place-items: center; padding: 1rem; }
.modal { width: min(760px, 100%); max-height: min(86vh, 900px); overflow: auto; background: white; border-radius: 14px; padding: 1rem 1.1rem 1.2rem; box-shadow: 0 18px 50px rgba(20, 32, 48, 0.25); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.8rem; }
.modal-head h3 { margin: 0; }
.modal-cuerpo .row { margin-bottom: 0.6rem; }
.modal-error { margin: 0.6rem 0 0; color: var(--danger); }
.aviso-ok .modal { width: min(26rem, 100%); }
.aviso-ok .modal-cuerpo { text-align: center; }
.row[hidden], form[hidden] { display: none !important; }
.row > div[hidden] { display: none !important; }
.row > * { flex: 1; min-width: 160px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.4rem; }
.checks label { display: flex; gap: 0.4rem; align-items: center; margin: 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.45rem 0.3rem; border-bottom: 1px solid var(--line); }
.msg { padding: 0.7rem 0.8rem; border-radius: 8px; background: #e7f6ef; margin-bottom: 0.8rem; }
.msg.warn { background: #fff4df; color: var(--warn); }
.msg.err { background: #fdecec; color: var(--danger); }
.top { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.carga-btn { display: block; width: 100%; text-align: left; margin: 0.35rem 0; padding: 0.85rem 1rem; font-size: 1.05rem; }
.aula-row { display: flex; justify-content: space-between; gap: 0.6rem; align-items: center; padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.aula-row strong { flex: 1; }
table.horario td { min-width: 7.5rem; vertical-align: top; font-size: 0.85rem; }
table.horario button { margin-top: 0.35rem; padding: 0.2rem 0.45rem; }
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  nav { max-height: 46vh; overflow: auto; }
  nav strong { display: none; }
}
.dash { display: grid; gap: 0.9rem; }
.dash-welcome, .dash-card, .dash-docs, .dash-stat, .dash-epi-card, .dash-lesson {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.dash-welcome { display: flex; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.2rem; background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 12%, white), white); }
.dash-user, .dash-welcome-side, .dash-bar, .dash-docs, .dash-epi, .dash-lesson header, .dash-act li { display: flex; gap: 0.75rem; align-items: center; }
.dash-welcome-side { flex-direction: column; align-items: stretch; min-width: 180px; }
.dash-avatar { width: 3.2rem; height: 3.2rem; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: white; font-weight: 700; flex: 0 0 auto; }
.dash h2 { margin: 0.1rem 0; }
.dash-kicker, .dash-rol, .dash-muted, .dash-stat small, .dash-docs span { color: var(--muted); font-size: 0.85rem; }
.dash-chips { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.dash-chips span { background: color-mix(in srgb, var(--brand) 12%, white); color: var(--brand); border-radius: 999px; padding: 0.2rem 0.55rem; font-size: 0.78rem; }
.dash-stats, .dash-grid3, .dash-grid2, .dash-epi { display: grid; gap: 0.75rem; }
.dash-stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.dash-stat { padding: 0.8rem 0.9rem; border-top: 4px solid var(--stat, var(--brand)); }
.dash-stat span, .dash-stat small { display: block; }
.dash-stat strong { font-size: 1.6rem; }
.dash-split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 0.75rem; align-items: start; }
.dash-grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-grid2 { grid-template-columns: 1fr 1fr; margin-top: 0.75rem; }
.dash-card { padding: 0.9rem 1rem; }
.dash-card h3, .dash-docs h3 { margin: 0 0 0.6rem; font-size: 1rem; }
.dash-bar { margin: 0.45rem 0; }
.dash-bar-body { flex: 1; min-width: 0; }
.dash-bar-top { display: flex; justify-content: space-between; gap: 0.4rem; font-size: 0.88rem; }
.dash-avatar { width: 2rem; height: 2rem; font-size: 0.72rem; }
.dash-welcome .dash-avatar { width: 3.2rem; height: 3.2rem; font-size: 1rem; background: var(--brand); color: white; }
.dash-track { height: 6px; background: #e8eef5; border-radius: 99px; overflow: hidden; margin-top: 0.25rem; }
.dash-track div { height: 100%; }
.dash-donut-wrap { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }
.dash-donut { width: 148px; height: 148px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; }
.dash-donut-hole { width: 92px; height: 92px; border-radius: 50%; background: white; display: grid; place-items: center; text-align: center; }
.dash-donut-hole span { font-size: 0.72rem; color: var(--muted); }
.dash-legend { list-style: none; margin: 0; padding: 0; font-size: 0.85rem; }
.dash-legend li { display: flex; gap: 0.35rem; align-items: center; margin: 0.25rem 0; }
.dash-legend i { width: 0.65rem; height: 0.65rem; border-radius: 50%; display: inline-block; }
.dash-epi { grid-template-columns: 1.2fr repeat(3, 1fr); margin-top: 0.75rem; }
.dash-epi-card { padding: 0.8rem; display: grid; align-content: center; }
.dash-epi-card strong { font-size: 1.5rem; }
.dash-epi-card.alerta { border-top: 4px solid #dc2626; }
.dash-epi-card.seguimiento { border-top: 4px solid var(--brand); }
.dash-epi-card.cierre { border-top: 4px solid #16a34a; }
.dash-docs { padding: 0.9rem 1rem; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.dash-docs ul { list-style: none; margin: 0; padding: 0; flex: 1; }
.dash-docs li { margin: 0.35rem 0; }
.dash-docs button[data-doc] { background: transparent; color: var(--brand); padding: 0; }
.dash-lessons { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.55rem; }
.dash-lesson { padding: 0.7rem 0.8rem; border-left: 4px solid var(--stat, var(--brand)); }
.dash-lesson header { justify-content: space-between; font-size: 0.8rem; color: var(--muted); }
.dash-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.25rem; }
.dash-cal-head, .dash-cal-cell { font-size: 0.72rem; text-align: center; }
.dash-cal-head.finde { color: var(--muted); }
.dash-cal-cell { min-height: 2.3rem; border: 1px solid var(--line); border-radius: 6px; padding: 0.15rem; position: relative; }
.dash-cal-cell.vacio { border-color: transparent; }
.dash-cal-cell.hoy { outline: 2px solid var(--brand); }
.dash-cal-cell.evento { background: color-mix(in srgb, var(--brand) 16%, white); }
.dash-cal-cell.siguiente { opacity: 0.75; }
.dash-cal-cell i { display: block; font-style: normal; color: var(--brand); font-size: 0.65rem; }
.dash-act { list-style: none; margin: 0.4rem 0; padding: 0; }
.dash-act li { justify-content: space-between; border-bottom: 1px solid var(--line); padding: 0.3rem 0; }
.dash-act em { font-style: normal; color: var(--brand); font-size: 0.75rem; }
.dash-cal-form { margin-top: 0.6rem; }
.dash-demo { margin: 0.2rem 0 0; }
@media (max-width: 980px) {
  .dash-split, .dash-grid3, .dash-grid2, .dash-epi, .dash-welcome { grid-template-columns: 1fr; display: grid; }
  .dash-welcome-side { min-width: 0; }
}
.informe-tools > * { flex: 0 1 auto; min-width: 0; }
.informe-tools label { display: flex; align-items: center; gap: 0.4rem; margin: 0; }
.boleta { border: 1px solid var(--line); border-radius: 12px; padding: 0.9rem 1rem; margin: 0.8rem 0; background: white; overflow-x: auto; }
.boleta h3 { margin: 0.6rem 0 0.2rem; }
.boleta summary { cursor: pointer; }
.acta-centro { text-align: center; margin: 0.15rem 0; }
.acta-firma { margin: 1.2rem 0 0.2rem; }
.acta-grid th, .acta-grid td { border: 1px solid var(--ink); font-size: 0.82rem; }
.boleta table { min-width: 760px; }
.radar-rojo td { background: #f8d0d0; }
.radar-naranja td { background: #fde4c8; }
.radar-amarillo td { background: #fff3c4; }
.informe-ia { white-space: pre-wrap; font-family: inherit; }
.boleta th, .boleta td { white-space: nowrap; vertical-align: top; }
@media print {
  nav, .top, button, .no-print { display: none !important; }
  body, .shell, main, .panel { background: white; }
  .shell { display: block; }
  .boleta { break-after: page; page-break-after: always; border: 0; }
}

/* Ingreso por institución (SaaS) */
.landing-escudo { width: 76px; height: 76px; object-fit: contain; border-radius: 14px; background: #f8fafc; border: 1px solid var(--line); padding: 6px; }
.landing-banner { width: 100%; max-height: 92px; object-fit: contain; display: block; margin: 0 auto 0.7rem; }
.logo-inst { width: 58px; height: 58px; object-fit: contain; display: block; margin: 0 auto 0.45rem; background: #fff; border-radius: 10px; padding: 4px; }
.landing-inicial { width: 76px; height: 76px; border-radius: 14px; background: var(--brand, #1e3a8a); color: #fff; display: grid; place-items: center; font-size: 1.6rem; font-weight: 700; }
.landing-opciones { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 1.1rem; }
.landing-opciones button { flex: 1 1 180px; padding: 0.9rem 1rem; font-size: 1rem; }
.inst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.7rem; width: 100%; }
.inst-card { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--card); cursor: pointer; text-align: center; }
.inst-card:hover { border-color: var(--brand); }
.inst-card img { width: 56px; height: 56px; object-fit: contain; }
.inst-card strong { font-size: 0.95rem; }
