/* ==========================================================================
   Sistema Académico · San Ignacio de Loyola
   Estilos generales (sin dependencias externas: carga rápido con internet lento)
   ========================================================================== */
:root {
  --rojo: #a3201f;
  --rojo-2: #7e1716;
  --rojo-suave: #fbeceb;
  --tinta: #1d2430;
  --tinta-2: #4a5566;
  --gris: #8a94a3;
  --linea: #dfe3e8;
  --fondo: #f4f3ef;
  --papel: #ffffff;
  --verde: #1f7a4d;
  --verde-suave: #e6f4ec;
  --ambar: #9a6200;
  --ambar-suave: #fff4dc;
  --azul: #1f5fa8;
  --azul-suave: #e8f0fb;
  --g-a: #e9f4f6;   /* actitudinal: celeste como en el Excel */
  --g-c: #efeaf6;   /* conceptual: lila */
  --g-p: #eaf3e8;   /* procedimental */
  --g-final: #fff3b0; /* promedio unidad: amarillo como en el Excel */
  --radio: 10px;
  --sombra: 0 1px 2px rgba(20, 30, 50, .06), 0 2px 8px rgba(20, 30, 50, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fondo); color: var(--tinta);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: var(--rojo); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.55rem; margin: 0 0 .2rem; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 .8rem; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
code { background: #f0eee8; padding: .1em .35em; border-radius: 4px; font-size: .92em; }
.muted { color: var(--tinta-2); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.c { text-align: center; }
.txt-bad { color: var(--rojo); font-weight: 600; }

/* ---------- barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 1rem;
  padding: .5rem 1.25rem; background: var(--papel); border-bottom: 3px solid var(--rojo);
  box-shadow: var(--sombra);
}
.brand { display: flex; align-items: center; gap: .6rem; color: var(--tinta); text-decoration: none !important; }
.brand img { height: 38px; width: auto; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand small { color: var(--gris); font-size: .75rem; }
.mainnav { display: flex; align-items: center; gap: .2rem; margin-left: auto; }
.mainnav > a, .dropdown > summary {
  padding: .5rem .8rem; border-radius: 8px; color: var(--tinta); font-weight: 500; cursor: pointer; list-style: none;
}
.mainnav > a:hover, .dropdown > summary:hover { background: var(--fondo); text-decoration: none; }
.mainnav > a.on, .dropdown.on > summary { background: var(--rojo-suave); color: var(--rojo); }
.dropdown { position: relative; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown > summary::after { content: " ▾"; font-size: .8em; color: var(--gris); }
.dropdown > div {
  position: absolute; right: 0; top: 110%; min-width: 230px; background: var(--papel); border: 1px solid var(--linea);
  border-radius: var(--radio); box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: .4rem; display: flex; flex-direction: column;
}
.dropdown > div a { padding: .5rem .7rem; border-radius: 6px; color: var(--tinta); }
.dropdown > div a:hover { background: var(--fondo); text-decoration: none; }
.dropdown > div > span { padding: .4rem .7rem; }
.badge { display: inline-block; min-width: 1.4em; padding: 0 .4em; border-radius: 99px; background: var(--rojo); color: #fff; font-size: .75rem; text-align: center; }
.menu-btn { display: none; margin-left: auto; font-size: 1.4rem; background: none; border: 0; cursor: pointer; color: var(--tinta); }

.wrap { max-width: 1480px; margin: 0 auto; padding: 1.25rem; }

/* ---------- encabezados de página ---------- */
.page-head, .curso-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.curso-head h1 { margin-top: .2rem; }
.back { font-size: .85rem; color: var(--tinta-2); }
.head-actions { display: flex; gap: .5rem; align-items: center; }
.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--linea); margin-bottom: 1rem; overflow-x: auto; }
.tabs a { padding: .6rem 1rem; color: var(--tinta-2); border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 500; }
.tabs a.on { color: var(--rojo); border-bottom-color: var(--rojo); }
.tabs a:hover { text-decoration: none; color: var(--tinta); }

/* ---------- tarjetas y rejillas ---------- */
.card { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 1.1rem 1.2rem; margin-bottom: 1rem; box-shadow: var(--sombra); }
.card.narrow { max-width: 560px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.card-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1rem; align-items: start; }
.grid-2 > .card { margin-bottom: 0; }
.empty { color: var(--tinta-2); text-align: center; padding: 1.5rem .5rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.stats.compact { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); margin: .5rem 0; }
.stat { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); padding: .8rem 1rem; display: flex; flex-direction: column; }
.stat b { font-size: 1.6rem; line-height: 1.1; }
.stat span { color: var(--tinta-2); font-size: .82rem; }
.stat.bad b { color: var(--rojo); }
.stat.warn { background: var(--ambar-suave); border-color: #f2d89a; }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: .55rem 1rem;
  border-radius: 8px; border: 1px solid var(--rojo); background: var(--rojo); color: #fff; font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s;
}
.btn:hover { background: var(--rojo-2); }
.btn.ghost { background: var(--papel); color: var(--rojo); border-color: var(--linea); }
.btn.ghost:hover { background: var(--rojo-suave); border-color: #f0c9c7; }
.btn.sm { padding: .3rem .65rem; font-size: .85rem; font-weight: 500; }
.btn.lg { padding: .8rem 1.4rem; font-size: 1.05rem; }
.btn.block { width: 100%; }
.btn.danger { background: #fff; color: var(--rojo); border-color: #f0c9c7; }
.btn.danger:hover { background: var(--rojo); color: #fff; }
form.inline { display: inline; }

/* ---------- pastillas, chips, estados ---------- */
.pill { display: inline-block; padding: .12rem .55rem; border-radius: 99px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.pill.lvl1 { background: var(--ambar-suave); color: var(--ambar); }
.pill.lvl2 { background: #fde2e1; color: var(--rojo); }
.pill.lvl3 { background: var(--rojo); color: #fff; }
.pill.gray { background: #eceef1; color: var(--tinta-2); }
.pill.blue { background: var(--azul-suave); color: var(--azul); }
.cond { display: inline-block; padding: .1rem .5rem; border-radius: 6px; font-size: .8rem; font-weight: 600; }
.cond.aprobado { background: var(--verde-suave); color: var(--verde); }
.cond.desaprobado, .cond.dpi { background: #fde2e1; color: var(--rojo); }
.cond.en-curso { background: #eef1f4; color: var(--tinta-2); font-weight: 500; }
.cond.retirado { background: #eceef1; color: var(--gris); }
.chips, .mes-nav { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .8rem; }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .35rem .75rem; border: 1px solid var(--linea); border-radius: 99px; background: var(--papel); color: var(--tinta); font-size: .88rem; cursor: pointer; }
.chip.on { background: var(--tinta); color: #fff; border-color: var(--tinta); }
.chip:hover { text-decoration: none; border-color: var(--gris); }
.chips .sep { width: 1px; height: 1.4rem; background: var(--linea); margin: 0 .3rem; }

.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: .8rem; border: 1px solid; }
.flash.ok { background: var(--verde-suave); border-color: #b7e0c7; color: #155d39; }
.flash.err { background: #fde2e1; border-color: #f3b7b4; color: var(--rojo-2); }
.flash.warn { background: var(--ambar-suave); border-color: #f2d89a; color: #6f4700; }
.credenciales code { font-size: 1rem; }

/* ---------- formularios ---------- */
.form label, label.inline { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; color: var(--tinta-2); font-weight: 500; margin-bottom: .7rem; }
label.inline { display: inline-flex; flex-direction: row; align-items: center; margin: 0 .5rem 0 0; }
.form .row, form.row { display: flex; flex-wrap: wrap; gap: .7rem; align-items: flex-end; }
.form .row > label, form.row > label { margin-bottom: 0; }
.form label.check, label.check { flex-direction: row; align-items: center; gap: .4rem; color: var(--tinta); }
.grow { flex: 1 1 220px; }
input, select, textarea {
  font: inherit; color: var(--tinta); padding: .5rem .65rem; border: 1px solid #cfd5dc; border-radius: 7px; background: #fff; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(163, 32, 31, .25); border-color: var(--rojo); }
textarea { resize: vertical; width: 100%; }
.w-sm { width: 80px; } .w-md { width: 140px; } .w-pts { width: 60px; } .w-ord { width: 54px; }
.add-row { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--linea); }
fieldset { border: 1px solid var(--linea); border-radius: 8px; margin-bottom: 1rem; }
legend { font-weight: 600; padding: 0 .4rem; }
.cfg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 1rem; }
.cfg-grid .full { grid-column: 1 / -1; }
.sticky-save { position: sticky; bottom: 0; padding: .75rem 0; background: linear-gradient(transparent, var(--fondo) 30%); z-index: 5; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.daynav { display: flex; gap: .3rem; align-items: center; }

/* ---------- tablas ---------- */
.table-scroll { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--tinta-2); border-bottom: 2px solid var(--linea); padding: .5rem .6rem; }
.tbl td { border-bottom: 1px solid #eef0f3; padding: .5rem .6rem; vertical-align: middle; }
.tbl tr:hover td { background: #fafaf8; }
.tbl td.nota { font-weight: 700; }
.tbl td.nota.low, td.low, input.low { color: var(--rojo) !important; }
tr.retirado td, tr.retirado td a { color: #c0392b; }
tr.retirado td.nom, tr.retirado td:nth-child(2) { text-decoration: line-through; text-decoration-color: rgba(192,57,43,.5); }
tr.muted td { color: var(--gris); }

/* ---------- inicio ---------- */
.clase-list, .alert-list, .horario-list, .ind-list, .det-list { list-style: none; margin: 0; padding: 0; }
.clase { display: grid; grid-template-columns: 64px 1fr auto; gap: .8rem; align-items: center; padding: .75rem; border: 1px solid var(--linea); border-left: 4px solid var(--gris); border-radius: 8px; margin-bottom: .55rem; }
.clase.now { border-left-color: var(--azul); background: #fbfdff; }
.clase.done { border-left-color: var(--verde); }
.clase .hora { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.clase .hora span { color: var(--gris); font-size: .85rem; }
.clase .info { display: flex; flex-direction: column; gap: .1rem; }
.alert-list li { padding: .55rem 0; border-bottom: 1px solid #eef0f3; display: flex; flex-wrap: wrap; gap: .35rem .6rem; align-items: baseline; }
.alert-list li .muted { flex-basis: 100%; }

/* ---------- mis cursos ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; }
.curso-card { background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio); box-shadow: var(--sombra); display: flex; flex-direction: column; overflow: hidden; }
.cc-main { padding: 1rem 1rem .6rem; color: var(--tinta); text-decoration: none !important; display: flex; flex-direction: column; gap: .2rem; border-top: 4px solid var(--rojo); }
.cc-main:hover h3 { color: var(--rojo); }
.cc-main h3 { margin: 0; font-size: 1.05rem; }
.cc-carrera { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--rojo); font-weight: 600; }
.cc-stats { display: flex; flex-wrap: wrap; gap: .4rem .9rem; padding: 0 1rem .7rem; font-size: .85rem; color: var(--tinta-2); align-items: center; }
.cc-actions { display: flex; gap: .4rem; padding: .7rem 1rem; border-top: 1px solid #eef0f3; background: #fbfbfa; margin-top: auto; }

/* ---------- tomar asistencia ---------- */
.bloques { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.bloques .tema { flex-basis: 100%; margin: .4rem 0 0; display: flex; flex-direction: column; font-size: .85rem; color: var(--tinta-2); }
.bloques .extra { flex-basis: 100%; }
.tomar-tools { display: flex; justify-content: space-between; align-items: center; margin: .2rem 0 .6rem; gap: .5rem; flex-wrap: wrap; }
.contadores { font-weight: 600; font-variant-numeric: tabular-nums; }
.lista-asis { list-style: none; padding: 0; margin: 0; counter-reset: n; }
.lista-asis li {
  counter-increment: n; display: grid; grid-template-columns: 1fr auto; gap: .35rem .8rem; align-items: center;
  background: var(--papel); border: 1px solid var(--linea); border-radius: 9px; padding: .6rem .8rem; margin-bottom: .4rem;
}
.lista-asis li .nom { display: flex; flex-direction: column; }
.lista-asis li .nom b::before { content: counter(n) ". "; color: var(--gris); font-weight: 500; }
.lista-asis li.mF { background: #fff6f5; border-color: #f3c3c0; }
.lista-asis li.mT { background: #fffaf0; border-color: #f2d89a; }
.lista-asis li.mJ { background: #f5f8fe; border-color: #c9dbf3; }
.lista-asis .obs { grid-column: 1 / -1; display: none; font-size: .85rem; padding: .35rem .55rem; }
.lista-asis li.mF .obs, .lista-asis li.mJ .obs, .lista-asis li.mT .obs, .lista-asis .obs:not([value=""]) { display: block; }
.seg { display: inline-flex; border: 1px solid #cfd5dc; border-radius: 9px; overflow: hidden; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; width: 46px; padding: .55rem 0; text-align: center; font-weight: 700; color: var(--gris); border-left: 1px solid #e3e7ec; user-select: none; }
.seg label:first-child span { border-left: 0; }
.seg .sP input:checked + span { background: var(--verde); color: #fff; }
.seg .sT input:checked + span { background: #d88a00; color: #fff; }
.seg .sF input:checked + span { background: var(--rojo); color: #fff; }
.seg .sJ input:checked + span { background: var(--azul); color: #fff; }
.leyenda { margin-top: 1rem; }

/* ---------- grillas tipo Excel ---------- */
.toolbar-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .6rem; margin-bottom: .6rem; }
.toolbar-row .mes-nav { margin: 0; }
.grid-wrap { overflow: auto; max-height: 75vh; border: 1px solid #c9ced6; border-radius: 8px; background: #fff; }
.xgrid { border-collapse: separate; border-spacing: 0; font-size: .85rem; }
.xgrid th, .xgrid td { border-right: 1px solid #d5d9df; border-bottom: 1px solid #d5d9df; padding: 0; text-align: center; height: 30px; }
.xgrid thead { position: sticky; top: 0; z-index: 4; }
.xgrid thead th { background: #f3f4f6; font-weight: 700; font-size: .72rem; padding: .25rem .3rem; }
.xgrid .sticky { position: sticky; left: 0; z-index: 3; background: #fff; }
.xgrid thead .sticky { z-index: 5; background: #f3f4f6; }
.xgrid .n { width: 36px; min-width: 36px; }
.xgrid .nom { left: 36px; min-width: 250px; max-width: 300px; text-align: left; padding: 0 .5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xgrid td.nom a { color: var(--tinta); }
.xgrid .vert { height: 190px; vertical-align: bottom; white-space: nowrap; min-width: 30px; }
.xgrid .vert span { writing-mode: vertical-rl; transform: rotate(180deg); display: inline-block; max-height: 182px; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.xgrid th.ind { min-width: 46px; }
.xgrid .g-a { background: var(--g-a) !important; }
.xgrid .g-c { background: var(--g-c) !important; }
.xgrid .g-p { background: var(--g-p) !important; }
.xgrid th.final, .xgrid td.final { background: var(--g-final) !important; font-weight: 800; min-width: 74px; }
.xgrid td.calc { background: #f7f8fa; color: var(--tinta-2); min-width: 46px; font-variant-numeric: tabular-nums; }
.xgrid td.prom, .xgrid th.prom { background: #efeef8; font-weight: 600; min-width: 48px; }
.xgrid .cond-h, .xgrid .cond-c { min-width: 100px; padding: 0 .3rem; }
.xgrid td.in { padding: 0; min-width: 46px; }
.xgrid td.in input { width: 100%; height: 100%; min-height: 30px; border: 0; border-radius: 0; text-align: center; padding: 0 .2rem; background: transparent; font-variant-numeric: tabular-nums; }
.xgrid td.in input:focus { outline: 2px solid var(--azul); outline-offset: -2px; background: #fff; }
.xgrid td.in input.saving { background: #fffbe6; }
.xgrid td.in input.saved { background: #eaf7ef; transition: background 1s; }
.xgrid td.in input.error { background: #fde2e1; outline: 2px solid var(--rojo); outline-offset: -2px; }
.xgrid td.in input[readonly] { color: var(--gris); }
.xgrid tbody tr:hover td { background-color: #fbf8ec; }
.xgrid tbody tr:hover td.sticky { background: #fbf8ec; }
.xgrid .pmax { font-size: .8rem; }
.xgrid.asis td.cell { min-width: 30px; cursor: default; font-weight: 700; user-select: none; }
.xgrid.asis[data-editable="1"] td.cell { cursor: pointer; }
.xgrid.asis td.cell:hover { outline: 2px solid var(--azul); outline-offset: -2px; }
.xgrid td.stF { color: #fff; background: var(--rojo) !important; }
.xgrid td.stT { background: #ffe7b3 !important; color: #7a4d00; }
.xgrid td.stJ { background: #dbe8fb !important; color: var(--azul); }
.xgrid th.dia { min-width: 30px; }
.xgrid .tot { background: #f7f8fa; min-width: 34px; font-weight: 600; }
.xgrid td.dpi { background: var(--rojo) !important; color: #fff; }
.xgrid td.riesgo { background: var(--ambar-suave) !important; color: var(--ambar); }
.xgrid th .x { display: block; margin: 2px auto 0; border: 0; background: none; color: var(--gris); cursor: pointer; font-size: 1rem; line-height: 1; }
.xgrid th .x:hover { color: var(--rojo); }
.xgrid tr.retirado td.sticky.nom { color: #c0392b; }

/* ---------- indicadores ---------- */
.comp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.comp { border: 1px solid var(--linea); border-radius: 8px; padding: .8rem; }
.comp h3 { margin: 0 0 .4rem; display: flex; justify-content: space-between; }
.comp-a { background: var(--g-a); } .comp-c { background: var(--g-c); } .comp-p { background: var(--g-p); }
.ind-list li { display: flex; gap: .3rem; margin-bottom: .35rem; align-items: center; }
.ind-row { display: flex; gap: .3rem; flex: 1; }
.ind-row .grow { flex: 1; }
.ind-row input { padding: .35rem .45rem; font-size: .88rem; }
.add-ind { display: flex; flex-direction: column; gap: .35rem; margin-top: .5rem; }
.add-ind textarea { font-size: .88rem; }
.copiar { margin-top: 1rem; padding-top: .8rem; border-top: 1px dashed var(--linea); }
.inline-edit form { margin-top: .5rem; }

/* ---------- reportes ---------- */
.rep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-top: .6rem; }
.rep { border: 1px solid var(--linea); border-radius: 8px; padding: .9rem; display: flex; flex-wrap: wrap; gap: .4rem; align-content: flex-start; }
.rep h3 { margin: 0; flex-basis: 100%; }
.rep p { margin: 0 0 .3rem; flex-basis: 100%; }
.rep form, .rep ul { flex-basis: 100%; }
.mark { display: inline-block; width: 1.5em; text-align: center; border-radius: 4px; font-weight: 700; }
.mark.stF { background: var(--rojo); color: #fff; } .mark.stT { background: #ffe7b3; } .mark.stJ { background: #dbe8fb; }
.dias { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .6rem; }
.horario-list li { display: flex; justify-content: space-between; align-items: center; padding: .4rem 0; border-bottom: 1px solid #eef0f3; }
.inline-row { display: flex; align-items: center; gap: .6rem; padding: .3rem 0; }
.danger-zone { border-color: #f3d0ce; }

/* ---------- login ---------- */
.login-body, .login-body-inner { min-height: 90vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-card { width: 100%; max-width: 380px; background: var(--papel); border-radius: 14px; padding: 2rem; box-shadow: 0 10px 40px rgba(0,0,0,.08); border-top: 5px solid var(--rojo); }
.login-card h1 { margin-top: .5rem; }
.login-card label { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .9rem; font-size: .9rem; font-weight: 500; }
.login-logo { height: 70px; display: block; margin: 0 auto; }
.login-card > h1, .login-card > p.muted { text-align: center; }

/* ---------- aviso flotante ---------- */
.toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); background: var(--tinta); color: #fff; padding: .7rem 1.1rem; border-radius: 8px; z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 90vw; }
.toast.err { background: var(--rojo); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .grid-2, .comp-grid { grid-template-columns: 1fr; }
  .menu-btn { display: block; }
  .mainnav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--papel); border-bottom: 1px solid var(--linea); padding: .5rem; box-shadow: 0 10px 20px rgba(0,0,0,.08); }
  body.nav-open .mainnav { display: flex; }
  .dropdown > div { position: static; box-shadow: none; border: 0; padding-left: 1rem; }
}
@media (max-width: 600px) {
  body { font-size: 15px; }
  .wrap { padding: .8rem; }
  .topbar { padding: .45rem .8rem; }
  .brand small { display: none; }
  h1 { font-size: 1.3rem; }
  .clase { grid-template-columns: 54px 1fr; }
  .clase .accion { grid-column: 1 / -1; }
  .clase .accion .btn { width: 100%; }
  .lista-asis li { grid-template-columns: 1fr; }
  .seg { width: 100%; }
  .seg label { flex: 1; }
  .seg span { width: auto; padding: .7rem 0; }
  .xgrid .nom { min-width: 170px; max-width: 170px; }
  .page-head > div:last-child, .curso-head .head-actions { width: 100%; }
}
.form .dias label.chip { flex-direction: row; margin: 0; color: var(--tinta); }
.horario-list li b { min-width: 90px; display: inline-block; }

/* ==========================================================================
   PALETA INSTITUCIONAL (segunda propuesta)
   Azul marino #274C77 · Azul medio #6096BA · Celeste #A3CEF1
   Gris claro #E7ECEF · Gris #8B8C89
   El rojo se conserva SOLO para alertas, faltas y notas bajas.
   ========================================================================== */
:root {
  --primario: #274C77;
  --primario-2: #1B3755;      /* más oscuro: botones al pasar el mouse */
  --primario-suave: #E7ECEF;  /* fondo de menú y pestaña seleccionados */
  --acento: #6096BA;
  --celeste: #A3CEF1;
  --fondo: #F3F5F7;
  --gris: #8B8C89;
  --azul: #6096BA;            /* clase en curso y faltas justificadas */
  --azul-suave: #E3EFF9;
  --g-a: #E3EFF9;             /* columna actitudinal del registro */
}

/* Barra superior y menú */
.topbar { border-bottom-color: var(--primario); }
.mainnav > a.on, .dropdown.on > summary { background: var(--primario-suave); color: var(--primario); }
a { color: var(--primario); }

/* Pestañas del curso */
.tabs a.on { color: var(--primario); border-bottom-color: var(--primario); }

/* Botones */
.btn { background: var(--primario); border-color: var(--primario); }
.btn:hover { background: var(--primario-2); }
.btn.ghost { background: var(--papel); color: var(--primario); border-color: var(--linea); }
.btn.ghost:hover { background: var(--primario-suave); border-color: var(--celeste); }

/* Campos de formulario al escribir */
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(96, 150, 186, .35); border-color: var(--acento); }

/* Filtros y meses seleccionados */
.chip.on { background: var(--primario); border-color: var(--primario); }

/* Tarjetas de "Mis cursos" */
.cc-main { border-top-color: var(--primario); }
.cc-main:hover h3, .cc-carrera { color: var(--primario); }

/* Encabezados de las grillas de asistencia y notas */
.xgrid thead th, .xgrid thead .sticky { background: var(--primario-suave); }

/* Pantalla de ingreso */
.login-card { border-top-color: var(--primario); }

/* Asistencia: "Presente" en azul institucional (F sigue en rojo, T en ámbar) */
.seg .sP input:checked + span { background: var(--primario); }