/* Portal de familias, maestros y dirección (demo, datos en este navegador).
   Mobile first: la base es el celular (barra inferior); desde 960px aparece la barra lateral.
   Usa los colores y la diagonal del sitio (estilos.css). */

/* ---------- Entrada ---------- */
.login { display: grid; min-height: 100dvh; }
.login-art { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; gap: 28px; padding: 24px 20px 40px; background: var(--navy); color: #fff; }
.login-art::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(var(--diag), transparent 0 82%, var(--red) 82% 100%); opacity: .9; }
.login-art img.bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; opacity: .28; }
.login-art .brand b { color: #fff; }
.login-art .brand small { color: rgba(255, 255, 255, .7); }
.login-art h1 { max-width: 14ch; font: 600 34px/1.05 var(--serif); }
.login-art p { display: none; max-width: 40ch; margin-top: 14px; opacity: .8; }
.login-box { display: grid; place-items: center; padding: 24px 20px 32px; }
.login-box .inner { width: 100%; max-width: 400px; }
.login-box h2 { font-size: 30px; }
.login-box img.esc { display: none; width: 64px; margin-bottom: 18px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); margin: 16px 0; padding: 4px; border-radius: 999px; background: var(--navy-soft); }
.seg button { padding: 11px 6px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: 700 14px var(--sans); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.link-btn { padding: 0; border: 0; background: none; color: var(--red); font: inherit; font-weight: 700; cursor: pointer; }
@media (min-width: 960px) {
  .login { grid-template-columns: 1fr 1fr; }
  .login-art { justify-content: space-between; padding: 48px; }
  .login-art::after { background: linear-gradient(var(--diag), transparent 0 70%, var(--red) 70% 100%); }
  .login-art h1 { font-size: clamp(40px, 4.4vw, 60px); }
  .login-art p { display: block; }
  .login-box { padding: 32px 20px; }
  .login-box h2 { font-size: 36px; }
  .login-box img.esc { display: block; }
}

/* ---------- Estructura ---------- */
.app { min-height: 100dvh; }
.side { display: none; }
.main { padding: 0 16px 110px; }
.main > *:not(.p-head):not(.mobile-top) { max-width: 1180px; }

/* Encabezado en celular: el mismo del sitio */
.mobile-top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 10px; margin: 0 -16px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.mobile-top .brand img { width: 38px; }
.mobile-top .brand b { font-size: 19px; }
.mobile-top .brand small { display: block; font-size: 10.5px; color: var(--red); }
.mobile-top button { margin-left: auto; }

/* Barra inferior en celular */
.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--white); }
.bottom a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 12px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 700; }
.bottom a i { font-size: 22px; }
.bottom a.on { color: var(--red); }
.bottom .badge { position: absolute; top: 0; right: 18%; min-width: 18px; height: 18px; padding: 0 5px; font-size: 10.5px; }
.badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--red); color: #fff; font-size: 12px; font-weight: 800; }

/* Barra lateral en computadora: escudo, lema y regreso al sitio */
@media (min-width: 960px) {
  .app { display: grid; grid-template-columns: 252px 1fr; }
  .mobile-top, .bottom { display: none; }
  .main { padding: 0 36px 120px; }
  .side { position: sticky; top: 0; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; gap: 4px; height: 100dvh; padding: 28px 14px 22px; background: var(--navy); color: #fff; }
  .side::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; z-index: -1; height: 180px; background: linear-gradient(160deg, transparent 0 55%, var(--red) 55% 100%); opacity: .95; }
  .side-brand { display: flex; flex-direction: column; align-items: center; margin-bottom: 10px; padding: 0 8px 22px; border-bottom: 1px solid rgba(255, 255, 255, .12); text-align: center; text-decoration: none; color: #fff; }
  .side-brand img { width: 74px; margin-bottom: 10px; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .35)); }
  .side-brand b { font: 600 22px/1.1 var(--serif); }
  .side-brand small { margin-top: 4px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--red-light); }
  .nv { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; text-decoration: none; color: rgba(255, 255, 255, .75); font-size: 15px; font-weight: 600; }
  .nv i { font-size: 20px; }
  .nv:hover { background: rgba(255, 255, 255, .08); color: #fff; }
  .nv.on { background: #fff; color: var(--navy); box-shadow: inset 3px 0 0 var(--red); }
  .nv .badge { margin-left: auto; }
  .who { margin-top: auto; padding: 14px 10px 4px; font-size: 13.5px; color: rgba(255, 255, 255, .85); }
  .who b { display: block; font-size: 14.5px; color: #fff; }
  .lema { margin-bottom: 14px; font: italic 17px/1.25 var(--serif); color: #fff; }
  .who-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
  .who-act button { padding: 8px 14px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .1); color: #fff; font: 700 13px var(--sans); cursor: pointer; }
  .who-act a { border-bottom: 1px solid rgba(255, 255, 255, .5); text-decoration: none; color: #fff; font-size: 13px; font-weight: 700; }
}

/* ---------- Banda de encabezado (igual que las páginas del sitio) ---------- */
.p-head { position: relative; isolation: isolate; overflow: hidden; margin: 0 -16px 22px; padding: 22px 16px 54px; background: var(--navy); color: #fff; clip-path: polygon(0 0, 100% 0, 100% 86%, 0 100%); }
.p-head::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(var(--diag), transparent 0 80%, var(--red) 80% 100%); }
.ph-escudo { position: absolute; top: 18px; right: 16px; width: 64px; filter: drop-shadow(0 12px 26px rgba(0, 0, 0, .35)); }
.ph-ruta { padding-right: 80px; font-size: 12.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--red-light); }
.ph-fecha { display: none; }
.main-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 8px; padding-right: 70px; }
.main-head h1 { font: 600 34px/1.15 var(--serif); color: #fff; }
.main-head .right { display: flex; flex-wrap: wrap; gap: 8px; }
.demo-chip { padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .85); font-size: 12px; font-weight: 700; }
.p-head + .kids { position: relative; z-index: 2; margin: -44px 0 4px; }
.p-head + .tabs { margin-top: -6px; }
@media (min-width: 960px) {
  .p-head { margin: 0 -36px 26px; padding: 34px 36px 64px; clip-path: polygon(0 0, 100% 0, 100% 80%, 0 100%); }
  .p-head::before { background: linear-gradient(var(--diag), transparent 0 74%, var(--red) 74% 100%); }
  .ph-escudo { top: 50%; right: 48px; width: 104px; transform: translateY(-58%); }
  .ph-ruta, .main-head { max-width: 1180px; }
  .ph-ruta { padding-right: 0; }
  .ph-fecha { display: inline; }
  .main-head { padding-right: 140px; }
  .main-head h1 { font-size: 46px; }
  .main-head .right { margin-left: auto; }
  .p-head + .kids { margin-top: -50px; }
}

/* ---------- Hijos ---------- */
.kids { display: flex; flex-wrap: wrap; gap: 8px; }
.kid { display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--ink); font: 600 14px var(--sans); cursor: pointer; box-shadow: 0 8px 22px rgba(20, 34, 61, .16); }
.kid .avatar { width: 32px; height: 32px; font-size: 12px; }
.kid[aria-pressed="true"] { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy) inset, 0 8px 22px rgba(20, 34, 61, .16); }

/* ---------- Rejillas y paneles ---------- */
.grid { display: grid; gap: 18px; }
.g4 { grid-template-columns: 1fr 1fr; }
@media (min-width: 960px) {
  .g2 { grid-template-columns: 1.3fr 1fr; }
  .g3 { grid-template-columns: repeat(3, 1fr); }
  .g4 { grid-template-columns: repeat(4, 1fr); }
}
.panel { container-type: inline-size; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); }
a.panel { text-decoration: none; }
button.panel { width: 100%; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.panel h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding-top: 12px; background: linear-gradient(var(--red), var(--red)) 0 0 / 34px 2px no-repeat; font-size: 17px; font-weight: 800; }
.panel h2 i { color: var(--red); }
.panel h2 a { margin-left: auto; text-decoration: none; color: var(--red); font-size: 13.5px; font-weight: 700; }
.stat small { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
.stat strong { display: block; margin-top: 4px; font-size: 34px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }
.empty { padding: 34px 10px; text-align: center; color: var(--muted); }
.empty i { display: block; margin-bottom: 8px; font-size: 40px; }
.note { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); font-size: 14px; }

/* ---------- Listas: en celular el monto y los botones van abajo ---------- */
.list { display: grid; }
.item { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--navy-soft); color: var(--navy); font-size: 20px; }
.ic.red { background: var(--bad-soft); color: var(--red); }
.tx { flex: 1 1 calc(100% - 60px); min-width: 0; }
.tx b { display: block; font-size: 15px; }
.tx span { display: block; font-size: 13.5px; color: var(--muted); }
.end { display: flex; align-items: center; justify-content: flex-end; gap: 8px; width: 100%; padding-left: 54px; }
.end:empty { display: none; }
/* Depende del ancho del panel, no de la pantalla: en una columna angosta la etiqueta baja */
@container (min-width: 440px) {
  .item { flex-wrap: nowrap; }
  .tx { flex: 1; }
  .end { width: auto; margin-left: auto; padding-left: 0; flex: none; }
}

/* ---------- Reporte quincenal grande ---------- */
.big-report { position: relative; isolation: isolate; overflow: hidden; border: 0; background: linear-gradient(160deg, var(--navy), var(--navy-2)); color: #fff; }
.big-report::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(var(--diag), transparent 0 80%, rgba(173, 32, 45, .9) 80% 100%); }
.big-report .avatar { background: #fff; color: var(--navy); }
.big-report .kpi { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); }
.big-report .kpi small, .big-report .muted, .big-report .report-head span:not(.pill) { color: rgba(255, 255, 255, .7); }
.big-report .subj { border-color: rgba(255, 255, 255, .12); }
.big-report .note { border: 0; background: rgba(255, 255, 255, .08); color: #fff; }
.btn-outline-light { color: #fff; border-color: rgba(255, 255, 255, .3); background: transparent; }
.acciones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* Barras del historial */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 120px; margin-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.bars .b i { display: block; width: 100%; max-width: 46px; border-radius: 8px 8px 4px 4px; background: var(--navy); }
.bars .b.last i { background: var(--red); }
.bars .b strong { font-size: 13px; color: var(--ink); }

/* ---------- Pestañas, listas de alumnos y tablas ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tabs button { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--ink); font: 700 13.5px var(--sans); cursor: pointer; }
.tabs button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.roster { display: grid; gap: 8px; }
.st { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.st .avatar { width: 34px; height: 34px; font-size: 12px; }
.st b { font-size: 14.5px; }
.st .end { width: 100%; padding-left: 0; justify-content: flex-start; gap: 6px; }
.st select, .st input { width: auto; height: 40px; font-size: 14px; }
.st select { padding: 0 32px 0 12px; background-position: right 10px center; }
.st input.cal { width: 70px; padding: 0 8px; text-align: center; }
label.st { cursor: pointer; }
.st input[type=checkbox] { width: 22px; height: 22px; margin-left: auto; }
.tog { width: 38px; height: 34px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--muted); font: 800 13px var(--sans); cursor: pointer; }
.tog.on.P { background: var(--ok); border-color: var(--ok); color: #fff; }
.tog.on.F { background: var(--red); border-color: var(--red); color: #fff; }
.tog.on.R { background: var(--warn); border-color: var(--warn); color: #fff; }
@media (min-width: 600px) { .st { flex-wrap: nowrap; } .st .end { width: auto; margin-left: auto; } }
.t-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.t th { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 12.5px; font-weight: 700; color: var(--muted); }
table.t td { padding: 12px 10px; border-bottom: 1px solid var(--line); }
table.t tr:last-child td { border-bottom: 0; }

/* ---------- Ventanas y avisos rápidos ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: none; place-items: center; padding: 16px; background: rgba(10, 16, 30, .55); }
.modal.open { display: grid; }
.modal .box { width: 100%; max-width: 520px; max-height: 90dvh; overflow: auto; padding: 26px; border-top: 4px solid var(--red); border-radius: 20px; background: var(--white); }
.modal .box h3 { margin-bottom: 6px; font: 600 30px/1.15 var(--serif); color: var(--navy); }
.modal .actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal label.item { cursor: pointer; }
.modal label.item input { width: auto; height: auto; }
.toast { position: fixed; left: 50%; bottom: 96px; z-index: 90; display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); padding: 13px 18px; border-radius: 999px; background: var(--navy); color: #fff; font-size: 14.5px; font-weight: 700; box-shadow: 0 12px 30px rgba(20, 34, 61, .35); opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(20px); transition: all .3s var(--ease); }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast i { color: #6fd3a0; }
@media (min-width: 960px) { .toast { bottom: 32px; } }
