/* =====================================================================
   Plataforma Escolar - estilos (sin dependencias ni compilación)
   ===================================================================== */
:root {
  --navy: #0F1B2D; --navy-2: #172741; --navy-3: #22406E; --navy-text: #C6CFDC; --navy-muted: #A9B4C4;
  --primary: #1E40AF; --primary-hover: #172F82; --primary-soft: #EEF2FB; --primary-ink: #1E3A8A; --brand: #2D5BE3;
  --bg: #F4F6F9; --surface: #FFFFFF; --line: #E3E8EF; --line-strong: #CBD3DE;
  --ink: #15202B; --ink-2: #3B4552; --muted: #5B6573;
  --sup-bg: #DCFCE7; --sup-fg: #14532D;
  --alt-bg: #DBEAFE; --alt-fg: #1E3A8A;
  --bas-bg: #FEF3C7; --bas-fg: #78350F;
  --baj-bg: #FFE4D6; --baj-fg: #9A3412;
  --danger: #C2410C; --danger-bg: #FFF1EA;
  --radius: 12px; --radius-lg: 16px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5; }
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }
h1, h2, h3 { line-height: 1.25; margin: 0; }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid #93B4F5; outline-offset: 2px; }
input:focus, select:focus, textarea:focus { outline: 3px solid #93B4F5; outline-offset: 1px; border-color: var(--primary); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: #fff; padding: 10px 16px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- Estructura con menú lateral ---------- */
.shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.side { flex: 1 1 240px; max-width: 280px; background: var(--navy); color: #E6EBF2; padding: 24px 16px; display: flex; flex-direction: column; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--brand); display: flex; align-items: center; justify-content: center; flex: none; }
.brand-name { font-weight: 800; font-size: 15px; line-height: 1.2; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a, .nav button { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--navy-text); text-decoration: none; font-size: 14px; font-weight: 600; background: transparent; border: 0; font-family: inherit; cursor: pointer; width: 100%; text-align: left; }
.nav a:hover, .nav button:hover { background: var(--navy-2); color: #fff; }
.nav a[aria-current="page"] { background: var(--navy-3); color: #fff; }
.nav-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--navy-muted); padding: 12px 12px 4px; }
.side-foot { margin-top: auto; padding: 12px; border-radius: 12px; background: var(--navy-2); font-size: 13px; color: var(--navy-muted); line-height: 1.5; }
.side-foot strong { color: #fff; }
.main { flex: 999 1 560px; min-width: 0; padding: 32px; display: flex; flex-direction: column; gap: 24px; }
.main > * { width: 100%; max-width: 1200px; }
.menu-toggle { display: none; }

@media (max-width: 820px) {
  .side { max-width: none; flex-basis: 100%; padding: 12px 16px; gap: 12px; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .menu-toggle { display: inline-flex; margin-left: auto; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid #33476A; background: transparent; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
  .side .nav, .side .side-foot { display: none; flex-basis: 100%; }
  .side.open .nav, .side.open .side-foot { display: flex; }
  .main { padding: 20px 16px; gap: 18px; }
}

/* ---------- Encabezados ---------- */
.page-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.page-head h1 { font-size: 30px; font-weight: 800; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.back { font-size: 14px; font-weight: 600; text-decoration: none; display: inline-block; margin-bottom: 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 600px) { .page-head h1 { font-size: 24px; } .page-head > .avatar { display: none; } .seg { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; } .seg a { white-space: nowrap; } }

/* ---------- Tarjetas y secciones ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.card-tight { padding: 20px; }
.card h2 { font-size: 20px; font-weight: 800; }
.card .sub { margin: -10px 0 0; font-size: 14px; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.row > .grow-3 { flex: 3 1 420px; min-width: 0; }
.row > .grow-2 { flex: 2 1 300px; min-width: 0; }
.row > .grow-1 { flex: 1 1 260px; min-width: 0; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-family: inherit; font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--bg); color: var(--ink); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-primary[disabled], .btn-primary.is-disabled { background: #9AA6B6; border-color: #9AA6B6; cursor: not-allowed; }
.btn-soft { background: var(--primary-soft); border-color: transparent; color: var(--primary-ink); }
.btn-soft:hover { background: #E1E8F8; color: var(--primary-ink); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); color: var(--danger); }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-dashed { border-style: dashed; color: var(--primary); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--primary); cursor: pointer; text-decoration: underline; }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fields > .field { flex: 1 1 200px; }
.field label, .field .label { font-size: 14px; font-weight: 700; }
.field .hint { font-size: 13px; color: var(--muted); font-weight: 400; }
.input, .select, .textarea { width: 100%; min-height: 46px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); font-family: inherit; font-size: 16px; color: var(--ink); background: #fff; }
.textarea { padding: 12px 14px; line-height: 1.5; resize: vertical; min-height: 110px; }
.select { padding-right: 36px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235B6573' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input-sm { min-height: 40px; font-size: 15px; padding: 0 10px; }
.fields { display: flex; flex-wrap: wrap; gap: 16px; }
.field-error .input, .field-error .select, .field-error .textarea { border-color: var(--danger); }
.error-text { color: var(--danger); font-size: 13px; font-weight: 600; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-size: 14px; font-weight: 700; padding: 0; margin-bottom: 10px; }

/* Chips de selección (radio/checkbox con apariencia de botón) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip > span { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; font-size: 14px; font-weight: 600; color: var(--ink); }
.chip input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
.chip input:focus-visible + span { outline: 3px solid #93B4F5; outline-offset: 2px; }
.chip-box > span { border-radius: 12px; border-width: 2px; min-height: 48px; font-size: 15px; font-weight: 700; }
.chip-box small { font-weight: 500; color: var(--muted); font-size: 13px; }
.chip-box .tick { display: none; }
.chip-box input:checked + span .tick { display: inline; }
.chip-box input:checked + span .plus { display: none; }

/* Interruptor */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; min-height: 48px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 48px; height: 28px; flex: none; border-radius: 999px; background: #9AA6B6; position: relative; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 3px solid #93B4F5; outline-offset: 2px; }
.switch-text strong { display: block; font-size: 15px; }
.switch-text span { display: block; font-size: 13px; color: var(--muted); }

/* ---------- Avisos ---------- */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border-radius: var(--radius); font-size: 14px; font-weight: 600; }
.alert svg { flex: none; margin-top: 1px; }
.alert-ok { background: var(--sup-bg); color: var(--sup-fg); }
.alert-error { background: var(--baj-bg); color: var(--baj-fg); }
.alert-info { background: var(--primary-soft); color: var(--primary-ink); }
.alert-warn { background: #FFF7ED; color: var(--baj-fg); }
.alert ul { margin: 4px 0 0; padding-left: 18px; font-weight: 500; }
.note { padding: 12px 14px; border-radius: 10px; background: var(--bg); font-size: 14px; color: var(--ink-2); }

/* ---------- Etiquetas ---------- */
.pill { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill-sup { background: var(--sup-bg); color: var(--sup-fg); }
.pill-alt { background: var(--alt-bg); color: var(--alt-fg); }
.pill-bas { background: var(--bas-bg); color: var(--bas-fg); }
.pill-baj { background: var(--baj-bg); color: var(--baj-fg); }
.pill-none { background: var(--line); color: var(--ink-2); }
.pill-primary { background: var(--primary-soft); color: var(--primary-ink); }
.pill-critico { background: var(--baj-bg); color: var(--baj-fg); }
.pill-alerta { background: var(--bas-bg); color: var(--bas-fg); }
.pill-neutral { background: var(--line); color: var(--ink-2); }
.pill-lg { padding: 6px 14px; font-size: 13px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; font-weight: 800; }
.subject-icon { width: 48px; height: 48px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-size: 13px; font-weight: 600; padding: 10px 8px; }
.table td { padding: 12px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.table .num { font-variant-numeric: tabular-nums; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* ---------- Pestañas ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs a { min-height: 48px; padding: 0 18px; display: flex; align-items: center; text-decoration: none; font-size: 15px; font-weight: 700; color: var(--muted); box-shadow: inset 0 -3px 0 transparent; }
.tabs a[aria-current="page"] { color: var(--primary); box-shadow: inset 0 -3px 0 var(--primary); }
.seg { display: inline-flex; gap: 6px; padding: 4px; border-radius: 12px; background: #E8ECF2; flex-wrap: wrap; }
.seg a { min-height: 40px; padding: 0 16px; border-radius: 9px; display: flex; align-items: center; text-decoration: none; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.seg a[aria-current="page"] { background: #fff; color: var(--ink); }

/* ---------- Tarjetas de acceso rápido y listas ---------- */
.quick { flex: 1 1 240px; display: flex; align-items: center; gap: 16px; padding: 20px; border-radius: var(--radius-lg); background: #fff; border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.quick:hover { border-color: var(--line-strong); color: var(--ink); }
.quick-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.quick-primary:hover { background: var(--primary-hover); color: #fff; }
.quick .ico { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; background: var(--primary-soft); }
.quick-primary .ico { background: var(--brand); }
.quick strong { display: block; font-size: 17px; font-weight: 800; }
.quick small { display: block; font-size: 14px; color: var(--muted); }
.quick-primary small { color: #D3DCF5; }
.list-item { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.list-item:first-of-type { border-top: 0; }
.list-item .grow { flex: 1 1 200px; min-width: 0; }
.list-item .title { display: block; font-weight: 700; }
.list-item .meta { display: block; font-size: 13px; color: var(--muted); }
.act-card { display: flex; gap: 16px; align-items: center; padding: 18px; border-radius: var(--radius-lg); background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); flex-wrap: wrap; }
.act-card:hover { border-color: var(--line-strong); color: var(--ink); }
.act-card .grow { flex: 1 1 220px; min-width: 0; }
.act-card strong { display: block; font-size: 16px; font-weight: 800; }
.act-card small { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.group-card { padding: 18px; border-radius: var(--radius-lg); background: #fff; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; color: var(--ink); text-decoration: none; }
.group-card:hover { border-color: var(--primary); color: var(--ink); }
.group-card .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.group-card .name { font-size: 22px; font-weight: 800; }
.bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--primary); }
.date-box { width: 52px; flex: none; text-align: center; padding: 6px 0; border-radius: 10px; background: var(--bg); }
.date-box small { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.date-box strong { display: block; font-size: 20px; font-weight: 800; line-height: 1.2; }
.stat { flex: 1 1 160px; padding: 18px; border-radius: var(--radius-lg); background: #fff; border: 1px solid var(--line); }
.stat strong { display: block; font-size: 28px; font-weight: 800; }
.stat span { font-size: 14px; color: var(--muted); }

/* ---------- Escala SIEE ---------- */
.scale-bar { display: flex; height: 40px; border-radius: 10px; overflow: hidden; font-size: 13px; font-weight: 700; }
.scale-bar div { display: flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden; transition: flex-basis .2s; }
.sb-baj { background: var(--baj-bg); color: var(--baj-fg); }
.sb-bas { background: var(--bas-bg); color: var(--bas-fg); }
.sb-alt { background: var(--alt-bg); color: var(--alt-fg); }
.sb-sup { background: var(--sup-bg); color: var(--sup-fg); }
.sum-box { padding: 10px 14px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.sum-ok { background: var(--sup-bg); color: var(--sup-fg); }
.sum-bad { background: var(--baj-bg); color: var(--baj-fg); }

/* ---------- Planilla ---------- */
.gradebook { width: 100%; border-collapse: collapse; font-size: 14px; }
.gradebook thead th { background: var(--bg); font-size: 12px; color: var(--ink-2); padding: 8px; font-weight: 700; }
.gradebook thead tr:nth-child(2) th { color: var(--muted); font-weight: 600; max-width: 130px; }
.gradebook .student { position: sticky; left: 0; z-index: 1; text-align: left; background: #fff; min-width: 220px; padding: 8px 14px; font-weight: 600; }
.gradebook thead .student { background: var(--bg); }
.gradebook td { padding: 6px; text-align: center; border-top: 1px solid var(--line); }
.gradebook th.student { border-top: 1px solid var(--line); }
.gradebook .sep { border-left: 1px solid var(--line); }
.gradebook .final { border-left: 2px solid var(--line-strong); font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 70px; }
.grade-input { width: 60px; min-height: 40px; text-align: center; border-radius: 8px; font-family: inherit; font-size: 15px; font-variant-numeric: tabular-nums; border: 1px solid var(--line-strong); background: #fff; }
.grade-input.linked { border-color: #93B4F5; background: #F5F8FF; }
.grade-input.bad { border-color: var(--danger); background: var(--danger-bg); }
.grade-input.saving { border-color: #F59E0B; }
.grade-input.saved { border-color: #16A34A; }
.grade-input[readonly] { background: var(--bg); border-color: var(--line); }
.col-head { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Archivos y zona de carga ---------- */
.dropzone { position: relative; min-height: 120px; border: 2px dashed #9AA6B6; border-radius: 14px; background: #F9FAFC; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 16px; }
.dropzone.drag { border-color: var(--primary); background: var(--primary-soft); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dropzone strong { font-size: 15px; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.file-row .name { flex: 1; font-size: 14px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-link { display: inline-flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--bg); text-decoration: none; color: var(--ink); }
.file-link:hover { color: var(--ink); background: #EBEFF5; }
.file-link small { display: block; font-size: 12px; color: var(--muted); }

/* ---------- Vista previa ---------- */
.preview-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.mail-btn { align-self: flex-start; padding: 10px 16px; border-radius: 10px; background: var(--primary); color: #fff; font-weight: 700; }
.prewrap { white-space: pre-line; }

/* ---------- Ingreso ---------- */
.auth { min-height: 100vh; display: flex; flex-wrap: wrap; }
.auth-hero { flex: 1 1 440px; background: var(--navy); color: #E6EBF2; padding: 56px 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth-hero h1 { font-size: 40px; font-weight: 800; color: #fff; margin-bottom: 16px; line-height: 1.15; }
.auth-hero p { font-size: 17px; line-height: 1.6; color: #C6CFDC; margin: 0; max-width: 460px; }
.auth-hero ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; font-size: 15px; color: #DCE3EC; }
.auth-hero li { display: flex; gap: 12px; align-items: center; }
.auth-panel { flex: 1 1 440px; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 36px; display: flex; flex-direction: column; gap: 20px; }
.auth-card h2 { font-size: 26px; font-weight: 800; }
.pass-wrap { display: flex; gap: 8px; }
.pass-wrap .input { flex: 1; min-width: 0; }
@media (max-width: 700px) { .auth-hero { padding: 32px 24px; gap: 24px; } .auth-hero h1 { font-size: 28px; } .auth-hero ul { display: none; } .auth-card { padding: 24px; } }

/* ---------- Diálogos ---------- */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 24px 64px rgba(15, 27, 45, .25); }
dialog::backdrop { background: rgba(15, 27, 45, .45); }
.dialog-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 10px; background: var(--bg); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--ink); }
.icon-btn:hover { background: #E8ECF2; }

/* ---------- Errores ---------- */
.error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.error-card { max-width: 480px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.error-card .code { font-size: 64px; font-weight: 800; color: var(--primary); line-height: 1; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,.2); }

@media print { .side, .actions, .no-print { display: none !important; } .main { padding: 0; } }

/* =====================================================================
   Fase 2
   ===================================================================== */
.nav-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: #F59E0B; color: #1F1300; font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.menu-toggle .nav-badge { margin-left: 4px; }

/* Páginas públicas (admisiones, verificación) */
.pub-head { background: var(--navy); color: #fff; padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.pub-main { max-width: 920px; margin: 0 auto; padding: 32px 20px 64px; display: flex; flex-direction: column; gap: 24px; }
@media (max-width: 600px) { .pub-main { padding: 20px 16px 48px; } }

/* Pasos de un proceso */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.steps li { flex: 1 1 120px; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--bg); font-size: 14px; font-weight: 600; color: var(--muted); }
.steps li span { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--line-strong); font-size: 12px; font-weight: 800; flex: none; }
.steps li.done { color: var(--sup-fg); background: var(--sup-bg); }
.steps li.done span { background: var(--sup-fg); color: #fff; border-color: var(--sup-fg); }
.steps li.now { color: var(--primary-ink); background: var(--primary-soft); box-shadow: inset 0 0 0 2px var(--primary); }
.steps li.now span { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Pares clave-valor */
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 24px; }
.kv span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.kv strong { display: block; font-size: 15px; margin-top: 2px; word-break: break-word; }
details > summary { cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }

/* Asistencia */
.asis-row { gap: 10px; }
.asis-opts { display: inline-flex; gap: 4px; padding: 3px; border-radius: 12px; background: #E8ECF2; flex-wrap: wrap; }
.asis-opts label { position: relative; }
.asis-opts input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.asis-opts span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.asis-opts input:focus-visible + span { outline: 3px solid #93B4F5; }
.asis-presente input:checked + span { background: var(--sup-fg); color: #fff; }
.asis-ausente input:checked + span { background: var(--danger); color: #fff; }
.asis-tarde input:checked + span { background: #B45309; color: #fff; }
.asis-excusa input:checked + span { background: var(--primary); color: #fff; }
.asis-row { flex-wrap: wrap; }
.asis-obs { flex: 1 1 100%; margin-left: 50px; max-width: calc(100% - 50px); }
/* La nota solo aparece para quien no está presente (o si ya tiene texto). */
.asis-row:has(.asis-presente input:checked) .asis-obs:placeholder-shown { display: none; }
@media (max-width: 700px) { .asis-row .grow { flex-basis: calc(100% - 50px); } .asis-obs { margin-left: 0; max-width: 100%; } }

/* Contactos y conversación */
.contact-list { display: flex; flex-direction: column; gap: 4px; max-height: 460px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.contact { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; cursor: pointer; border: 2px solid transparent; }
.contact:hover { background: var(--bg); }
.contact input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.contact:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.contact:has(input:focus-visible) { outline: 3px solid #93B4F5; }
.contact strong { display: block; font-size: 14px; }
.contact small { display: block; font-size: 12px; color: var(--muted); }
.chat { gap: 12px; max-height: 60vh; overflow-y: auto; }
.bubble { max-width: 78%; padding: 12px 14px; border-radius: 14px; background: var(--bg); display: flex; flex-direction: column; gap: 6px; align-self: flex-start; }
.bubble.mine { align-self: flex-end; background: var(--primary-soft); }
@media (max-width: 600px) { .bubble { max-width: 92%; } }

/* =====================================================================
   Fase 3 · Formación integral
   ===================================================================== */
.pill-grave { background: #FEE2E2; color: #991B1B; }
.txt-danger { color: var(--danger); font-weight: 700; }
label.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; min-height: 32px; }
label.check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--primary); }

/* Filtros tipo enlace */
.chip-link { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; }
.chip-link b { font-weight: 800; color: var(--muted); }
.chip-link.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
.progress-line { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--line); }
.progress-line span { display: block; height: 100%; }
.seg-aprobada { background: #16A34A; } .seg-enviada { background: #F59E0B; } .seg-devuelta { background: var(--danger); } .seg-borrador { background: #94A3B8; }

/* Planeación */
[data-rows] { counter-reset: ind; }
.ind-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--bg); }
.ind-num { counter-increment: ind; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none; margin-top: 6px; }
.ind-num::before { content: counter(ind); }
.week-head { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding-top: 8px; }
details.clase { border: 1px solid var(--line); border-radius: 12px; }
details.clase > summary { display: flex; gap: 12px; align-items: center; padding: 10px 12px; list-style: none; }
details.clase > summary .grow { flex: 1 1 auto; min-width: 0; }
details.clase > summary .title { display: block; font-weight: 700; }
details.clase > summary .meta { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
details.clase[open] > summary svg:last-child { transform: rotate(90deg); }
.clase-body { padding: 0 14px 14px 76px; display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 600px) { .clase-body { padding-left: 14px; } }

/* Convivencia */
.conv-item { text-decoration: none; color: inherit; }
.conv-item:hover .title { color: var(--primary); }
.conv-mark { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.conv-positiva { background: var(--sup-bg); color: var(--sup-fg); }
.conv-tipo1 { background: var(--bas-bg); color: var(--bas-fg); }
.conv-tipo2 { background: var(--baj-bg); color: var(--baj-fg); }
.conv-tipo3 { background: #FEE2E2; color: #991B1B; }
.conv-card { border-left: 5px solid var(--line-strong); }
.conv-card.conv-positiva { border-left-color: #16A34A; background: #fff; color: inherit; }
.conv-card.conv-tipo1 { border-left-color: #D97706; background: #fff; color: inherit; }
.conv-card.conv-tipo2 { border-left-color: var(--danger); background: #fff; color: inherit; }
.conv-card.conv-tipo3 { border-left-color: #B91C1C; background: #fff; color: inherit; }
.tipo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.tipo-opt { position: relative; }
.tipo-opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.tipo-opt > span { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line-strong); background: #fff; }
.tipo-opt strong { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.tipo-opt small { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.tipo-opt input:focus-visible + span { outline: 3px solid #93B4F5; outline-offset: 2px; }
.tipo-positiva input:checked + span { border-color: #16A34A; background: var(--sup-bg); }
.tipo-tipo1 input:checked + span { border-color: #D97706; background: var(--bas-bg); }
.tipo-tipo2 input:checked + span { border-color: var(--danger); background: var(--baj-bg); }
.tipo-tipo3 input:checked + span { border-color: #B91C1C; background: #FEE2E2; }
.protocolo { background: #FFF8EB; border: 1px solid #F5D9A8; border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.protocolo h2 { display: flex; align-items: center; gap: 6px; }
.protocolo ol { margin: 0; padding-left: 20px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.firmas { display: flex; flex-wrap: wrap; gap: 8px; }
.firma { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; border-radius: 10px; background: var(--bg); font-size: 13px; color: var(--muted); flex: 1 1 200px; }
.firma svg { margin-top: 3px; flex: none; }
.firma strong { color: var(--ink); }
.firma small { display: block; font-size: 12px; }
.firma.ok { background: var(--sup-bg); color: var(--sup-fg); }
.firma-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding: 12px; border-radius: 12px; border: 2px dashed var(--primary); background: var(--primary-soft); }
.firma-form button { align-self: flex-start; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 18px; }
.timeline li { position: relative; display: flex; flex-direction: column; gap: 6px; }
.timeline li::before { content: ''; position: absolute; left: -26px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--primary); }
.timeline li.tl-cierre::before { border-color: #16A34A; background: #16A34A; }
.timeline li.tl-citacion::before { border-color: #D97706; }
.timeline li.tl-remision::before { border-color: var(--danger); }
.timeline li.tl-vacio::before { border-color: var(--line-strong); }
.tl-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }

/* Promoción */
.caso { display: flex; flex-direction: column; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.caso:first-of-type { border-top: 0; }
.caso-head { display: flex; gap: 12px; align-items: center; }
.caso-head .grow { flex: 1 1 auto; min-width: 0; }
.caso-head .title { display: block; font-weight: 700; }
.caso-head .meta { display: block; font-size: 13px; color: var(--muted); }
.cierre-row select.falta { border-color: var(--danger); background-color: var(--danger-bg); }
.rec-calificar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex: 1 1 260px; justify-content: flex-end; }

/* Calendario */
.cal-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--ink-2); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i, .cal-dots i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.cal-festivo { --c: #DC2626; --cb: #FEE2E2; } .cal-evento { --c: #2563EB; --cb: #DBEAFE; } .cal-periodo { --c: #7C3AED; --cb: #EDE9FE; }
.cal-actividad { --c: #D97706; --cb: #FEF3C7; } .cal-cita { --c: #059669; --cb: #D1FAE5; } .cal-convivencia { --c: #BE185D; --cb: #FCE7F3; }
.cal-recuperacion { --c: #EA580C; --cb: #FFEDD5; } .cal-comision { --c: #0F766E; --cb: #CCFBF1; }
.cal-legend i, .cal-dots i, .agenda-bar { background: var(--c); }
.cal-card { padding: 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { font-size: 12px; font-weight: 800; color: var(--muted); text-align: center; padding: 4px 0; text-transform: uppercase; letter-spacing: .04em; }
.cal-day { min-height: 104px; border-radius: 10px; background: var(--bg); padding: 6px; display: flex; flex-direction: column; gap: 3px; text-decoration: none; color: var(--ink); overflow: hidden; border: 2px solid transparent; }
.cal-day:hover { border-color: var(--line-strong); color: var(--ink); }
.cal-day.fuera { opacity: .45; }
.cal-day.festivo .cal-num { color: #DC2626; }
.cal-day.hoy .cal-num { background: var(--primary); color: #fff; }
.cal-day.sel { border-color: var(--primary); background: var(--primary-soft); }
.cal-num { font-size: 13px; font-weight: 800; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.cal-fest { font-size: 11px; font-weight: 700; color: #B91C1C; line-height: 1.2; }
.cal-chip { display: block; font-size: 11.5px; line-height: 1.3; padding: 2px 6px; border-radius: 6px; background: var(--cb); color: var(--ink); border-left: 3px solid var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip b { font-weight: 800; }
.cal-more { font-size: 11px; font-weight: 700; color: var(--muted); }
.cal-dots { display: none; gap: 3px; flex-wrap: wrap; }
.agenda-item { text-decoration: none; color: inherit; flex-wrap: nowrap; }
.agenda-item .grow { min-width: 0; }
.agenda-bar { width: 5px; align-self: stretch; border-radius: 3px; flex: none; }
@media (max-width: 760px) {
  .cal-day { min-height: 54px; padding: 4px; align-items: center; }
  .cal-chip, .cal-more, .cal-fest { display: none; }
  .cal-dots { display: flex; justify-content: center; }
  .cal-card { padding: 8px; }
}

/* Eventos y citas */
.aut-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.aut-row:first-of-type { border-top: 0; }
.aut-row .grow { flex: 1 1 220px; min-width: 0; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.doc-card { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 12px; border: 2px solid var(--line); text-decoration: none; color: var(--ink); }
.doc-card:hover { border-color: var(--line-strong); color: var(--ink); }
.doc-card strong, .doc-card small { display: block; }
.doc-card small { font-size: 12.5px; color: var(--muted); }
.doc-card.on { border-color: var(--primary); background: var(--primary-soft); }
.doc-card.off { opacity: .6; }
.slot-day { border: 0; padding: 0; margin: 0; }
.slot-day legend { font-weight: 800; font-size: 14px; margin-bottom: 8px; }
.slot-day .chip > span { min-height: 40px; padding: 0 14px; }
@media print { .cal-legend, .tabs { display: none !important; } }
.row > .cal-card { flex: 3 1 640px; min-width: 0; }
.row > .cal-side { flex: 1 1 300px; min-width: 0; }
.cierre-row select { min-width: 200px; }

/* =====================================================================
   Fase 4 · Inteligencia institucional
   ===================================================================== */
html.texto-grande body { zoom: 1.15; }
.nav button[aria-pressed="true"] { background: var(--navy-3); color: #fff; }
.txt-ok { color: #15803D; font-weight: 700; }
.filtros { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.kpi { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.kpi > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi strong { font-size: 28px; line-height: 1.1; }
.kpi small { font-size: 12.5px; color: var(--muted); }
.tabla-datos summary { color: var(--primary); font-weight: 600; padding: 6px 0; }

/* Barras horizontales */
.gb { display: flex; flex-direction: column; gap: 6px; position: relative; }
.gb-row { display: grid; grid-template-columns: minmax(90px, 30%) 1fr 56px; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); padding: 2px 0; border-radius: 6px; }
a.gb-row:hover { background: var(--bg); color: var(--ink); }
.gb-row:has(.gb-val-wide) { grid-template-columns: minmax(90px, 30%) 1fr 120px; }
.gb-label { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gb-track { position: relative; height: 14px; background: var(--bg); border-radius: 4px; }
.gb[style*="--basico"] .gb-track::after { content: ''; position: absolute; top: -3px; bottom: -3px; left: var(--basico); border-left: 2px dashed #94A3B8; }
.gb-bar { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; }
.gb-val { font-size: 13.5px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.gb-det { grid-column: 2 / 4; font-size: 12px; color: var(--muted); margin-top: -4px; }
.gb-axis { display: grid; grid-template-columns: minmax(90px, 30%) 1fr 56px; gap: 10px; font-size: 11.5px; color: var(--muted); }
.gb-axis-track { position: relative; height: 16px; }
.gb-axis-track span { position: absolute; top: 0; white-space: nowrap; }
@media (max-width: 560px) { .gb-row, .gb-axis { grid-template-columns: 1fr 52px; } .gb-label { grid-column: 1 / 3; } .gb-track { grid-column: 1; } .gb-row:has(.gb-val-wide) { grid-template-columns: 1fr 110px; } .gb-det { grid-column: 1 / 3; } .gb-axis > span:first-child { display: none; } }

/* Distribución por desempeño (100 %) */
.dist { display: flex; gap: 2px; height: 26px; border-radius: 6px; overflow: hidden; }
.dist > span { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11.5px; font-weight: 800; min-width: 3px; }
.dist-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); }
.dist-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dist-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.dist-legend small { color: var(--muted); }

/* Líneas */
.gl-wrap { width: 100%; }
.gl { width: 100%; height: auto; display: block; overflow: visible; }
.gl-grid { stroke: var(--line); stroke-width: 1; }
.gl-basico { stroke: #94A3B8; stroke-width: 1.5; stroke-dasharray: 5 4; }
.gl-tick { font-size: 13px; fill: var(--muted); font-family: var(--font); }
.gl-pt { cursor: default; }
.gl-pt:hover circle:last-of-type { r: 6.5; }

/* Alertas */
.alerta { display: flex; flex-direction: column; gap: 10px; padding: 16px 0; border-top: 1px solid var(--line); }
.alerta:first-of-type { border-top: 0; }
.alerta-head { display: flex; gap: 12px; align-items: center; }
.alerta-head .grow { flex: 1 1 auto; min-width: 0; }
.alerta-head .title { display: block; font-weight: 700; }
.alerta-head .meta { display: block; font-size: 13px; color: var(--muted); }
.senales { list-style: none; margin: 0 0 0 52px; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.senales li { display: flex; gap: 6px; align-items: flex-start; }
.senales svg { margin-top: 3px; flex: none; color: var(--danger); }
.alerta-acciones { display: flex; gap: 8px; flex-wrap: wrap; margin-left: 52px; align-items: flex-start; }
@media (max-width: 600px) { .senales, .alerta-acciones { margin-left: 0; } }

/* Tesorería */
.fila-vencida td { background: #FFF7F2; }
.meta-bar { display: flex; flex-direction: column; gap: 6px; }
.copy-row { display: flex; gap: 8px; }
.copy-row .input { flex: 1 1 auto; min-width: 0; font-size: 13px; }

/* Ingreso con cuentas institucionales */
.oauth-sep { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.oauth-sep::before, .oauth-sep::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.oauth-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.oauth-btn { flex: 1 1 140px; justify-content: center; gap: 10px; }
.filtros .select { min-width: 150px; padding-right: 36px; }
.table td.num, .table th.num { white-space: nowrap; }
.kpi strong { white-space: nowrap; font-size: clamp(21px, 2.1vw, 28px); }
@media (max-width: 600px) { .gl-tick { font-size: 18px; } }
