/* =====================================================================
   EDUKTIV — Sistema visual
   Tinta azul de cuaderno, margen rojo, resaltador amarillo.
   Mobile-first: barra inferior en celular, menú lateral en escritorio.
   ===================================================================== */
:root {
  --ink: #1F3FA8;          /* tinta (personalizable por colegio) */
  --ink-ink: #14286E;
  --paper: #FFFFFF;
  --bg: #F3F5FA;
  --grid: #DCE5F4;
  --line: #E2E7F1;
  --text: #1C2230;
  --muted: #5D6679;
  --red: #D23B2B;          /* margen del cuaderno */
  --hl: #FFE45C;           /* resaltador */
  --green: #1E7A4F;
  --amber: #A86200;
  --wa: #1DA851;
  --r: 14px;
  --r-sm: 10px;
  --fs-display: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  --fs-body: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  --side: 250px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--fs-body); }
h1, h2, h3 { font-family: var(--fs-display); line-height: 1.15; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; font-weight: 800; }
h2 { font-size: 1.12rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 .6rem; }
a { color: var(--ink); }
img { max-width: 100%; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--ink) 45%, transparent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.mt { margin-top: 1rem; }
.txt-red { color: var(--red); }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.hp { position: absolute; left: -9999px; }
.mono-lite { font-family: ui-monospace, Consolas, monospace; background: #fff6bf; padding: .05rem .35rem; border-radius: 5px; }

/* ---------- Estructura ---------- */
.main { padding: 1rem 1rem 6.5rem; max-width: 1120px; margin: 0 auto; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; background: var(--paper); border-bottom: 1px solid var(--line); }
.top-title { flex: 1; min-width: 0; line-height: 1.2; }
.top-title strong { display: block; font-family: var(--fs-display); font-size: 1.05rem; }
.top-title span { display: block; font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--text); font-family: var(--fs-display); font-weight: 800; font-size: 1.25rem; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 1.3rem; line-height: 1; padding-bottom: 3px; box-shadow: inset -4px 0 0 var(--red); }
.brand.big { font-size: 1.6rem; margin-bottom: 1.25rem; }
.brand.big .brand-mark { width: 42px; height: 42px; font-size: 1.6rem; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: color-mix(in srgb, var(--ink) 12%, #fff); color: var(--ink); display: inline-grid; place-items: center; font-weight: 700; font-size: .85rem; text-decoration: none; flex: none; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.1rem; }
.side { display: none; }
.tabbar { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: flex; background: var(--paper); border-top: 1px solid var(--line); padding: .25rem .25rem calc(.25rem + env(safe-area-inset-bottom)); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .45rem 0; font-size: .7rem; color: var(--muted); text-decoration: none; border-radius: 10px; }
.tabbar a i { font-size: 1.15rem; }
.tabbar a.on { color: var(--ink); font-weight: 700; }
.tabbar a.on i { transform: translateY(-1px); }

@media (min-width: 960px) {
  body.has-nav { padding-left: var(--side); }
  .top, .tabbar { display: none; }
  .main { padding: 1.75rem 2rem 3rem; }
  .side { display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--paper); border-right: 1px solid var(--line); padding: 1.25rem .9rem; overflow-y: auto; }
  .side .brand { padding: 0 .5rem; }
  .side-inst { font-size: .8rem; color: var(--muted); margin: .6rem .5rem 1rem; line-height: 1.3; }
  .side nav, .side-foot { display: flex; flex-direction: column; gap: 2px; }
  .side a, .side button { display: flex; align-items: center; gap: .7rem; padding: .55rem .65rem; border-radius: 9px; color: var(--text); text-decoration: none; font: inherit; font-size: .95rem; background: none; border: 0; cursor: pointer; width: 100%; text-align: left; }
  .side a i, .side button i { width: 18px; text-align: center; color: var(--muted); }
  .side a:hover, .side button:hover { background: var(--bg); }
  .side a.on { background: color-mix(in srgb, var(--ink) 10%, #fff); color: var(--ink); font-weight: 700; }
  .side a.on i { color: var(--ink); }
  .side-foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line); }
  .side-foot form { margin: 0; }
}

/* ---------- Encabezados ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem; margin: .25rem 0 1.1rem; }
.page-head h1 { margin: 0; }
.page-head .sub { margin: .2rem 0 0; color: var(--muted); }
.head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
@media (max-width: 959px) { .has-nav .page-head h1 { font-size: 1.35rem; } }
.hello { margin: .25rem 0 1rem; }
.hello h1 { font-size: 1.75rem; }
.hello p { margin: 0; }
.group-title { margin: 1.5rem 0 .6rem; color: var(--muted); font-size: 1rem; }
.link-back { display: inline-flex; gap: .4rem; align-items: center; margin-bottom: .75rem; text-decoration: none; font-weight: 700; }

/* ---------- Tarjetas y rejillas ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 1.1rem; margin-bottom: 1rem; }
.card > h2:first-child { margin-bottom: .75rem; }
.callout { border-left: 4px solid var(--red); }
.cols-2 { display: grid; gap: 0 1rem; }
@media (min-width: 820px) { .cols-2 { grid-template-columns: 1fr 1fr; align-items: start; } }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.row-gap { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.row-gap form { margin: 0; }

/* Accesos rápidos: la acción principal de cada rol */
.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin-bottom: 1rem; }
@media (min-width: 700px) { .quick { grid-template-columns: repeat(4, 1fr); } }
.quick a { display: flex; align-items: center; gap: .65rem; padding: .85rem .9rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--text); font-weight: 700; line-height: 1.2; }
.quick a i { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--ink) 10%, #fff); color: var(--ink); flex: none; }
.quick a:first-child { background: var(--ink); color: #fff; border-color: var(--ink); }
.quick a:first-child i { background: rgba(255,255,255,.16); color: #fff; }

/* Indicadores */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin-bottom: 1rem; }
@media (min-width: 820px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stats.compact { grid-template-columns: repeat(2, minmax(0, 200px)); }
.stat { display: block; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: .85rem .95rem; text-decoration: none; color: var(--text); }
.stat-n { display: block; font-family: var(--fs-display); font-weight: 800; font-size: 1.5rem; line-height: 1.1; }
.stat-l { display: block; color: var(--muted); font-size: .85rem; margin-top: .2rem; line-height: 1.3; }
.stat-warn .stat-n { color: var(--red); }
.bar, .mini-bar { display: block; height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.bar span, .mini-bar span { display: block; height: 100%; background: var(--ink); border-radius: 99px; }
.mini-bar { width: 70px; flex: none; }

/* Listas */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--line); justify-content: space-between; }
.list > li:last-child { border-bottom: 0; }
.list > li > a { display: flex; align-items: center; gap: .75rem; justify-content: space-between; color: inherit; text-decoration: none; flex: 1; min-width: 0; }
.list > li > a > i.fa-chevron-right { color: #A9B1C2; }
.card.list { padding-top: .25rem; padding-bottom: .25rem; }
.people .avatar { width: 40px; height: 40px; }
.is-dim { opacity: .55; }
.right { text-align: right; }
.ok-line { color: var(--green); font-weight: 700; display: flex; gap: .5rem; align-items: center; }
.steps { padding-left: 1.2rem; margin: 0 0 1rem; }
.steps li { margin-bottom: .4rem; }
.lead-total { font-size: 1.05rem; }

/* Estados vacíos */
.empty { text-align: center; padding: 2.5rem 1rem; background: var(--paper); border: 1px dashed #C9D2E3; border-radius: var(--r); margin-bottom: 1rem; }
.empty > i { font-size: 2rem; color: color-mix(in srgb, var(--ink) 55%, #fff); margin-bottom: .6rem; }
.empty p { color: var(--muted); max-width: 46ch; margin: 0 auto .9rem; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px; padding: .55rem 1rem; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--paper); color: var(--text); font: 700 .95rem var(--fs-body); text-decoration: none; cursor: pointer; }
.btn:hover { border-color: #BCC6D9; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-ink); border-color: var(--ink-ink); }
.btn-ghost { background: transparent; }
.btn-wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn-danger-ghost { color: var(--red); background: transparent; border-color: #F1C6C0; }
.btn-sm { min-height: 36px; padding: .35rem .7rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: progress; }
.link, .link-btn { color: var(--ink); font-weight: 700; text-decoration: none; background: none; border: 0; padding: .25rem .35rem; font: inherit; font-weight: 700; font-size: .875rem; cursor: pointer; }
.link-btn.danger { color: var(--red); }
.inline-mini { display: inline; margin: 0; }

/* ---------- Formularios ---------- */
.form { display: flex; flex-direction: column; gap: .8rem; }
.form label, .filters label { display: flex; flex-direction: column; gap: .3rem; font-weight: 700; font-size: .9rem; }
input, select, textarea { font: 400 1rem var(--fs-body); color: var(--text); background: #fff; border: 1px solid #CBD3E2; border-radius: var(--r-sm); padding: .6rem .7rem; min-height: 44px; width: 100%; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 18%, transparent); }
input[type=color] { padding: .2rem; width: 70px; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--ink); }
.check { flex-direction: row !important; align-items: center; gap: .5rem !important; font-weight: 400 !important; }
.grid-form { display: grid; gap: .8rem; }
@media (min-width: 640px) { .grid-form { grid-template-columns: 1fr 1fr; } .span-2 { grid-column: span 2; } }
fieldset { border: 1px solid var(--line); border-radius: var(--r-sm); padding: .6rem .8rem .8rem; margin: 0; }
legend { font-weight: 700; font-size: .9rem; padding: 0 .3rem; }
.checks { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; }
.form-actions { display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }
.row-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: 0; }
.row-form > input, .row-form > select { flex: 1; min-width: 120px; width: auto; }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-bottom: 1rem; }
.filters label { flex: 1 1 160px; }
.filters .grow { flex: 2 1 220px; }
.search { display: flex; align-items: center; gap: .5rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: .35rem .35rem .35rem .9rem; margin-bottom: 1rem; }
.search input { border: 0; box-shadow: none; padding-left: 0; }
.search > i { color: var(--muted); }
.pass-wrap { position: relative; display: block; }
.pass-toggle { position: absolute; right: 4px; top: 4px; bottom: 4px; width: 40px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.mono-area { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
details > summary { cursor: pointer; font-weight: 700; font-family: var(--fs-display); list-style-position: inside; }
details.card > summary { margin: -.1rem 0; }

/* ---------- Mensajes ---------- */
.flash { display: flex; gap: .6rem; align-items: flex-start; padding: .75rem .9rem; border-radius: var(--r-sm); margin-bottom: 1rem; background: #E7F5EE; color: #155F3C; border: 1px solid #BFE3CF; transition: opacity .6s; }
.flash.error { background: #FDECEA; color: #8E2318; border-color: #F5C3BC; }
.flash.warn { background: #FFF6D6; color: #7A5300; border-color: #F2DE98; }
.flash.fade { opacity: 0; pointer-events: none; height: 0; padding: 0; margin: 0; border: 0; overflow: hidden; }
.flash i { margin-top: .2rem; }
.demo-band { background: #FFF6D6; border: 1px solid #F2DE98; color: #6A4A00; border-radius: var(--r-sm); padding: .55rem .8rem; font-size: .88rem; margin-bottom: 1rem; }
.demo-band.warn { background: #FDECEA; border-color: #F5C3BC; color: #8E2318; }
.alert-card { display: flex; align-items: center; gap: .85rem; padding: .85rem 1rem; background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--ink); border-radius: var(--r); margin-bottom: .75rem; text-decoration: none; color: var(--text); }
.alert-card > i:first-child { font-size: 1.2rem; color: var(--ink); }
.alert-card.warn { border-left-color: var(--red); }
.alert-card.warn > i:first-child { color: var(--red); }
.alert-card span { flex: 1; }
.cred { border: 2px solid var(--hl); background: #FFFDF0; }

/* ---------- Etiquetas ---------- */
.tag { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 700; padding: .15rem .5rem; border-radius: 6px; background: #EEF1F7; color: #3E475A; vertical-align: middle; }
.tag-tarea { background: #E6EDFF; color: #1F3FA8; }
.tag-examen { background: #FDE7E4; color: #A12A1D; }
.tag-evento { background: #FFF3C4; color: #7A5300; }
.tag-material { background: #E6F4EC; color: #1E6B45; }
.pill { display: inline-block; font-size: .75rem; font-weight: 700; padding: .12rem .55rem; border-radius: 99px; background: #EEF1F7; color: #3E475A; }
.pill-ok { background: #E3F4EA; color: #1E6B45; }
.pill-bad { background: #FDE7E4; color: #A12A1D; }
.pill-neutral { background: #E6EDFF; color: #1F3FA8; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; vertical-align: middle; }
.asis { display: inline-block; font-size: .78rem; font-weight: 700; padding: .15rem .55rem; border-radius: 99px; background: #EEF1F7; }
.asis-P { background: #E3F4EA; color: #1E6B45; }
.asis-T { background: #FFF3C4; color: #7A5300; }
.asis-F { background: #FDE7E4; color: #A12A1D; }
.asis-J { background: #E6EDFF; color: #1F3FA8; }

/* Notas literales (AD/A/B/C) */
.nota { display: inline-grid; place-items: center; min-width: 38px; height: 30px; padding: 0 .4rem; border-radius: 8px; font-weight: 800; font-family: var(--fs-display); font-size: .9rem; }
.nota-ad { background: #1E7A4F; color: #fff; }
.nota-a { background: #DDF2E6; color: #155F3C; }
.nota-b { background: #FFF0B8; color: #6A4A00; }
.nota-c { background: #FBD9D4; color: #8E2318; }
.nota-none { color: #A9B1C2; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.course-card { border-top: 4px solid var(--c); }
.conclusion { font-size: .9rem; background: var(--bg); border-radius: var(--r-sm); padding: .6rem .75rem; margin: .6rem 0 0; }

/* ---------- Tablas ---------- */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { padding: .55rem .6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tbl th { font-size: .78rem; color: var(--muted); font-weight: 700; white-space: nowrap; }
.tbl .c { text-align: center; }
.tbl .r { text-align: right; white-space: nowrap; }
.tbl-grades td { padding: .35rem .4rem; }
.sticky-col { position: sticky; left: 0; background: var(--paper); z-index: 1; min-width: 170px; max-width: 220px; }
.grade-sel { width: 64px; min-height: 38px; padding: .3rem; text-align: center; font-weight: 800; font-family: var(--fs-display); }
.g-ad { background: #1E7A4F; color: #fff; border-color: #1E7A4F; }
.g-a { background: #DDF2E6; color: #155F3C; }
.g-b { background: #FFF0B8; color: #6A4A00; }
.g-c { background: #FBD9D4; color: #8E2318; }
.conc { min-width: 220px; font-size: .88rem; }
.comp-legend { font-size: .85rem; color: var(--muted); padding-left: 1.1rem; margin: .8rem 0 0; columns: 2 320px; }
.comp-legend li { break-inside: avoid; margin-bottom: .2rem; }

/* Barra fija para guardar (formularios largos) */
.sticky-save { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); display: flex; gap: .5rem; justify-content: flex-end; align-items: center; flex-wrap: wrap; background: rgba(255,255,255,.96); padding: .65rem 0 .1rem; margin-top: .75rem; border-top: 1px solid var(--line); }
@media (min-width: 960px) { .sticky-save { bottom: 0; } }

/* ---------- Asistencia ---------- */
.att-head { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; align-items: center; margin-bottom: .5rem; }
.att-count { display: flex; gap: .3rem; flex-wrap: wrap; }
.att-list { list-style: none; margin: 0; padding: 0; counter-reset: n; }
.att-list > li { display: grid; grid-template-columns: 1fr auto; gap: .45rem .75rem; align-items: center; padding: .7rem 0 .7rem 2rem; border-bottom: 1px solid var(--line); position: relative; counter-increment: n; }
.att-list > li::before { content: counter(n); position: absolute; left: 0; top: .85rem; width: 1.5rem; text-align: right; color: #A9B1C2; font-size: .8rem; }
.att-list > li[data-state=F] { background: linear-gradient(90deg, #FDECEA, transparent 60%); }
.att-list > li[data-state=T] { background: linear-gradient(90deg, #FFF6D6, transparent 60%); }
.att-name small { display: block; }
.att-obs { grid-column: 1 / -1; min-height: 36px; font-size: .88rem; padding: .35rem .6rem; display: none; }
.att-list > li[data-state=F] .att-obs, .att-list > li[data-state=T] .att-obs, .att-list > li[data-state=J] .att-obs, .att-obs:not(:placeholder-shown) { display: block; }
.seg { display: inline-flex; border: 1px solid #CBD3E2; border-radius: 10px; overflow: hidden; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: grid; place-items: center; width: 42px; height: 40px; font-weight: 800; color: var(--muted); border-left: 1px solid #E2E7F1; }
.seg label:first-child span { border-left: 0; }
.seg input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--ink) 45%, transparent); outline-offset: -3px; }
.seg-P input:checked + span { background: #1E7A4F; color: #fff; }
.seg-T input:checked + span { background: #E8A400; color: #fff; }
.seg-F input:checked + span { background: var(--red); color: #fff; }
.seg-J input:checked + span { background: var(--ink); color: #fff; }

/* ---------- Inicio: familia ---------- */
.kid-switch { display: flex; gap: .5rem; overflow-x: auto; margin-bottom: 1rem; padding-bottom: .2rem; }
.kid-switch a { display: flex; align-items: center; gap: .5rem; padding: .35rem .85rem .35rem .35rem; border-radius: 99px; background: var(--paper); border: 1px solid var(--line); text-decoration: none; color: var(--text); font-weight: 700; white-space: nowrap; }
.kid-switch a .av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); font-size: .75rem; }
.kid-switch a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.kid-switch a.on .av { background: rgba(255,255,255,.2); }
.today-card { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; align-items: center; background: var(--ink); color: #fff; border-radius: var(--r); padding: 1rem 1.1rem; margin-bottom: .75rem; position: relative; overflow: hidden; }
.today-card::after { content: ''; position: absolute; top: 0; bottom: 0; left: 18px; width: 2px; background: rgba(255, 120, 100, .55); }
.today-kid { display: flex; align-items: center; gap: .85rem; padding-left: 1.2rem; }
.today-kid h2 { color: #fff; margin: 0; font-size: 1.3rem; }
.today-kid p { margin: 0; opacity: .85; }
.today-card .avatar { background: rgba(255,255,255,.18); color: #fff; }
.today-status .asis { font-size: .85rem; padding: .3rem .75rem; }
.today-status .asis:not([class*=asis-]) { background: rgba(255,255,255,.15); color: #fff; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; align-items: center; gap: .7rem; padding: .5rem 0; border-bottom: 1px dashed var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .t { width: 3rem; font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem; }
.timeline li.now { background: #FFFBE0; border-radius: 8px; padding-left: .4rem; }
.tutor-box { display: flex; gap: .75rem; align-items: center; margin-top: .9rem; padding: .8rem .9rem; border-radius: var(--r-sm); background: #FDECEA; color: #8E2318; text-decoration: none; font-weight: 700; }
.tutor-box.done { background: #E3F4EA; color: #155F3C; }
.tutor-box i { font-size: 1.3rem; }
.tutor-box small { font-weight: 400; }
.person { display: flex; gap: .9rem; align-items: center; }
.person h2 { margin: 0; }

/* ---------- Agenda ---------- */
.agenda { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1rem; }
.agenda-day > header { display: flex; align-items: center; gap: .7rem; margin-bottom: .5rem; }
.agenda-day > header small { color: var(--muted); }
.day-n { width: 44px; height: 44px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); display: grid; place-items: center; font-family: var(--fs-display); font-weight: 800; font-size: 1.2rem; }
.is-today .day-n { background: var(--red); color: #fff; border-color: var(--red); }
.task { background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--r); padding: .85rem 1rem; margin-bottom: .5rem; }
.task h3 { margin: .35rem 0 .3rem; font-size: 1.05rem; }
.task p { font-size: .95rem; color: #3A4254; }
.task-top { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.course-name { font-size: .8rem; color: var(--muted); font-weight: 700; }
.task-admin { display: flex; gap: .75rem; margin-top: .4rem; font-size: .85rem; }
.task-admin a, .task-admin button { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; text-decoration: none; }
.task-admin button { color: var(--red); }
.task-admin form { margin: 0; }
.past summary { color: var(--muted); }

/* ---------- Comunicados ---------- */
.notices { list-style: none; padding: 0; margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); }
.notices li { border-bottom: 1px solid var(--line); }
.notices li:last-child { border-bottom: 0; }
.notices a { display: flex; gap: .75rem; padding: .85rem 1rem; text-decoration: none; color: var(--text); align-items: flex-start; }
.n-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: .45rem; flex: none; background: transparent; }
.unread .n-dot { background: var(--red); }
.n-main { flex: 1; min-width: 0; }
.n-main strong { display: block; }
.unread .n-main strong { font-weight: 800; }
.n-main small { color: var(--muted); display: block; }
.n-meta { font-size: .8rem; color: var(--muted); white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; }
.notice h1 { font-size: 1.5rem; }
.notice-body { font-size: 1.05rem; line-height: 1.6; margin: .75rem 0 1rem; max-width: 70ch; }

/* ---------- Horario ---------- */
.week-tabs { display: flex; gap: .3rem; margin-bottom: .75rem; }
.week-tabs button { flex: 1; min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); font: 700 .9rem var(--fs-body); cursor: pointer; }
.week-tabs button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.week-day { display: none; }
.week-day.on { display: block; }
.week-day h3 { display: none; }
.slot { position: relative; background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--r-sm); padding: .55rem .75rem; margin-bottom: .45rem; }
.slot-break { background: repeating-linear-gradient(45deg, #fff, #fff 6px, #F5F7FB 6px, #F5F7FB 12px); }
.slot-t { display: block; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.slot small { display: block; color: var(--muted); }
.slot-del { position: absolute; top: 4px; right: 4px; margin: 0; }
.slot-del button { border: 0; background: none; color: #A9B1C2; cursor: pointer; padding: .2rem .4rem; }
@media (min-width: 820px) {
  .week-tabs { display: none; }
  .week-grid { display: grid; grid-template-columns: repeat(var(--days, 5), minmax(0, 1fr)); gap: .6rem; }
  .week-day { display: block; }
  .week-day h3 { display: block; font-size: .9rem; color: var(--muted); }
}

/* ---------- Pagos ---------- */
.tabs { display: flex; gap: .25rem; overflow-x: auto; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.tabs a { padding: .6rem .9rem; text-decoration: none; color: var(--muted); font-weight: 700; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--ink); }
.pay-item { flex-wrap: wrap; }
.pay-item .right { display: flex; align-items: center; gap: .5rem; }
.pay-form { flex-basis: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; align-items: end; background: var(--bg); padding: .75rem; border-radius: var(--r-sm); }
.pay-form label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; font-weight: 700; }
.pay-form[hidden] { display: none; }

/* ---------- Secciones / cursos ---------- */
.sec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .6rem; }
.sec-tile { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: .85rem 1rem; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: .15rem; }
.sec-tile strong { font-family: var(--fs-display); font-size: 1.1rem; }
.sec-tile span, .sec-tile small { color: var(--muted); font-size: .85rem; }
.assign { list-style: none; padding: 0; margin: 0 0 .75rem; }
.assign li { display: grid; grid-template-columns: 1fr minmax(150px, 46%); gap: .5rem; align-items: center; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.assign select { min-height: 38px; padding: .3rem .5rem; font-size: .9rem; }
.comp-list { padding-left: 1.2rem; }
.comp-list li { margin-bottom: .35rem; }
.comp-list li span { margin-right: .3rem; }
.period-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: .4rem; align-items: center; border: 0; padding: 0; }
@media (max-width: 600px) { .period-row { grid-template-columns: 1fr 1fr; } }

/* ---------- Menú "Más" ---------- */
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; }
.menu-tile { display: flex; flex-direction: column; gap: .5rem; padding: 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--text); font-weight: 700; }
.menu-tile i { font-size: 1.3rem; color: var(--ink); }

/* ---------- Ingreso y demo (papel cuadriculado) ---------- */
.login-page { background: linear-gradient(160deg, #EEF2FF 0%, #F7F5FF 45%, #FFF8EC 100%); min-height: 100vh; }
.login-page .main { padding-bottom: 2rem; }
.login-wrap { min-height: calc(100vh - 3rem); display: grid; gap: 2rem; align-items: center; max-width: 980px; margin: 0 auto; }
@media (min-width: 880px) { .login-wrap { grid-template-columns: 420px 1fr; } }
.login-card { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 1.75rem 1.5rem; position: relative; box-shadow: 0 1px 0 var(--line); }
.login-card::before { content: ''; position: absolute; top: 0; bottom: 0; left: 26px; width: 2px; background: color-mix(in srgb, var(--red) 55%, transparent); }
.login-card > * { position: relative; margin-left: 1.1rem; }
.login-card h1 { font-size: 1.8rem; }
.login-alt { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; font-size: .9rem; }
.login-alt a { text-decoration: none; font-weight: 700; }
.login-side { display: none; }
@media (min-width: 880px) { .login-side { display: flex; flex-direction: column; gap: .9rem; padding-left: 1rem; } }
.note-line { font-family: var(--fs-display); font-size: 1.5rem; font-weight: 600; line-height: 1.25; color: var(--ink); transform: rotate(-.6deg); }
.note-line:nth-child(even) { transform: rotate(.5deg); margin-left: 1.5rem; }
.note-line .hl { background: linear-gradient(transparent 35%, var(--hl) 35%, var(--hl) 88%, transparent 88%); padding: 0 .25rem; margin-right: .35rem; font-weight: 800; color: var(--text); }
.demo-wrap { max-width: 760px; margin: 1rem auto; }
.demo-wrap h1 { font-size: 2rem; }
.lead-p { font-size: 1.1rem; }
.role-pick { display: grid; gap: .7rem; margin: 1.25rem 0 1.5rem; }
@media (min-width: 640px) { .role-pick { grid-template-columns: 1fr 1fr; } }
.role-pick button { text-align: left; display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: .8rem; padding: 1rem; border-radius: var(--r); border: 1px solid var(--line); background: var(--paper); font: inherit; color: var(--text); cursor: pointer; }
.role-pick button:hover { border-color: var(--ink); }
.role-pick i { grid-row: span 2; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--ink) 10%, #fff); color: var(--ink); font-size: 1.2rem; }
.role-pick strong { font-family: var(--fs-display); font-size: 1.1rem; }
.role-pick span { color: var(--muted); font-size: .9rem; }
.lead-card { border-top: 4px solid var(--red); }

/* ---------- Libreta imprimible ---------- */
.print-page { background: #fff; }
.print-actions { padding: 1rem; text-align: center; }
.libreta { max-width: 900px; margin: 0 auto; padding: 1rem 1.5rem 2rem; font-size: .9rem; }
.libreta header h1 { font-size: 1.4rem; margin: 0; }
.libreta header { border-bottom: 3px solid var(--ink); margin-bottom: 1rem; padding-bottom: .5rem; }
.libreta h2 { margin-top: 1.25rem; }
.lib-data, .lib-notas { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.lib-data th, .lib-data td, .lib-notas th, .lib-notas td { border: 1px solid #9AA3B5; padding: .35rem .5rem; text-align: left; }
.lib-data th, .lib-notas th { background: #EEF1F7; font-size: .8rem; }
.lib-notas td.c { text-align: center; font-weight: 800; width: 70px; }
.lib-legend { font-size: .8rem; color: var(--muted); }
.firmas { display: flex; justify-content: space-between; gap: 1rem; margin-top: 4rem; }
.firmas span { flex: 1; border-top: 1px solid #333; text-align: center; padding-top: .3rem; font-size: .8rem; }
@media print {
  .print-actions, .side, .top, .tabbar, .btn, .filters, .tabs, .demo-band { display: none !important; }
  body.has-nav { padding-left: 0; }
  .main { padding: 0; }
  .card { border: 0; padding: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }


/* =====================================================================
   Estilo amigable (v3): tipografía redondeada, tarjetas suaves, colores alegres
   ===================================================================== */
:root { --r: 18px; --r-sm: 12px; --bg: #F4F6FB; --line: #E6E9F2; --text: #1E2235; --muted: #5F6680;
  --mint: #23A86B; --mint-soft: #E4F7EE; --yellow: #FFC93C; --yellow-soft: #FFF6D9; --coral: #FF6B5B; --coral-soft: #FFEDEA;
  --lav: #8463E8; --lav-soft: #F0EBFF; --sky: #2EA3E6; --sky-soft: #E3F4FD; --shadow: 0 6px 20px -10px rgba(30, 40, 90, .2); }
body { font-size: 16.5px; line-height: 1.55; font-weight: 500; }
h1, h2, h3 { font-weight: 900; letter-spacing: -.005em; }
h2 { font-size: 1.15rem; }
strong, b { font-weight: 800; }
.card, .stat, .quick a, .notices, .sec-tile, .menu-tile, .task, .alert-card, .empty { border: 0; box-shadow: var(--shadow); }
.card { padding: 1.25rem; }
.brand-mark { background: linear-gradient(135deg, var(--ink), var(--lav)); box-shadow: none; border-radius: 12px; font-weight: 900; }
.avatar { background: var(--lav-soft); color: var(--lav); font-weight: 900; }
.btn { border-radius: 999px; font-weight: 800; padding-inline: 1.2rem; }
.btn-ghost { background: #fff; border: 2px solid var(--line); }
input, select, textarea { border: 2px solid var(--line); border-radius: 12px; font-weight: 600; }
.side { box-shadow: 4px 0 24px -18px rgba(30, 40, 90, .35); border-right: 0; }
.side a.on { border-radius: 999px; }
.side a, .side button { border-radius: 999px; font-weight: 700; }
.tabbar { box-shadow: 0 -6px 20px -14px rgba(30, 40, 90, .35); border-top: 0; }
.tabbar a.on { background: color-mix(in srgb, var(--ink) 10%, #fff); border-radius: 14px; }
.top { border-bottom: 0; box-shadow: 0 4px 16px -14px rgba(30, 40, 90, .4); }
/* accesos rápidos de colores */
.quick a { font-weight: 800; border-radius: 20px; padding: 1rem; }
.quick a:nth-child(2) { background: var(--mint-soft); } .quick a:nth-child(2) i { background: #fff; color: var(--mint); }
.quick a:nth-child(3) { background: var(--yellow-soft); } .quick a:nth-child(3) i { background: #fff; color: #B07A00; }
.quick a:nth-child(4) { background: var(--coral-soft); } .quick a:nth-child(4) i { background: #fff; color: var(--coral); }
.quick a:first-child { background: linear-gradient(135deg, var(--ink), var(--lav)); border: 0; }
.stat { border-radius: 20px; position: relative; overflow: hidden; padding: 1rem 1.05rem; }
.stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--ink); }
.stats > :nth-child(2)::before { background: var(--mint); } .stats > :nth-child(3)::before { background: var(--coral); } .stats > :nth-child(4)::before { background: var(--yellow); }
.stat-n { font-weight: 900; }
.today-card { background: linear-gradient(135deg, var(--ink), var(--lav)); border-radius: 22px; }
.today-card::after { display: none; }
.today-kid { padding-left: 0; }
.alert-card { border-left: 0; border-radius: 18px; background: var(--sky-soft); }
.alert-card > i:first-child { width: 40px; height: 40px; border-radius: 12px; background: #fff; display: grid; place-items: center; font-size: 1.05rem; }
.alert-card.warn { background: var(--coral-soft); }
.callout { border-left: 0; background: var(--yellow-soft); box-shadow: none; }
.cred { border: 0; background: var(--yellow-soft); }
.flash { border-radius: 14px; font-weight: 700; }
.demo-band { border-radius: 14px; border: 0; background: var(--yellow-soft); font-weight: 600; }
.tag, .pill, .asis { border-radius: 999px; font-weight: 800; }
.nota { border-radius: 10px; font-weight: 900; }
.tbl th { font-weight: 800; }
.list > li { padding: .8rem 0; }
.seg { border: 2px solid var(--line); border-radius: 14px; }
.seg span { font-weight: 900; }
.kid-switch a { border: 0; box-shadow: var(--shadow); font-weight: 800; }
.day-n { border: 0; box-shadow: var(--shadow); border-radius: 14px; }
.is-today .day-n { background: var(--coral); }
.task { border-left: 5px solid var(--c); }
.week-tabs button { border-radius: 999px; font-weight: 800; border: 2px solid var(--line); }
.tabs a { font-weight: 800; }
.tutor-box { border-radius: 16px; background: var(--coral-soft); }
.tutor-box.done { background: var(--mint-soft); }
.menu-tile { border-radius: 20px; font-weight: 800; }
.menu-tile i { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--ink) 10%, #fff); }
.empty { border-radius: 22px; }
.empty > i { width: 64px; height: 64px; border-radius: 20px; display: inline-grid; place-items: center; background: var(--lav-soft); color: var(--lav); font-size: 1.6rem; }
.page-head h1 { font-size: 1.7rem; }
/* ingreso y demo */
.login-card { border: 0; border-radius: 26px; box-shadow: 0 24px 60px -30px rgba(40, 50, 120, .45); padding: 2rem 1.75rem; }
.login-card::before { display: none; }
.login-card > * { margin-left: 0; }
.feat { display: flex; gap: .9rem; align-items: center; background: #fff; border-radius: 20px; padding: 1rem 1.1rem; box-shadow: var(--shadow); font-weight: 800; font-size: 1.05rem; }
.feat i { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.2rem; flex: none; }
.feat small { display: block; font-weight: 600; color: var(--muted); font-size: .9rem; }
.login-side h2 { font-size: 1.6rem; margin-bottom: .2rem; }
.role-pick button { border: 0; box-shadow: var(--shadow); border-radius: 20px; }
.lead-card { border-top: 0; }
