/* Plataforma escolar · identidad tomada de ialeman.cl: azul institucional, rojo y amarillo, franja de colores y Roboto */
:root {
  --azul: #004587; --azul2: #043F60; --azul-claro: #4564BD; --rojo: #CF1417; --amarillo: #FFD008; --negro: #1B1B1B;
  --tx: #2E3138; --tx2: #5B606B; --tx3: #8A8F99; --borde: #E2E4E8; --fondo: #F4F5F7; --blanco: #fff;
  --ok: #1E8C5A; --ok-f: #E6F4EC; --warn: #B26A00; --warn-f: #FFF4DB; --mal: #C62828; --mal-f: #FDECEC; --info-f: #EAF0FB;
  --r: 8px; --sombra: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Roboto', system-ui, sans-serif; color: var(--tx); background: var(--fondo); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--azul); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
.hide { display: none !important; }

/* ---------- barra de maqueta, cabecera y franja de colores */
.demo { background: var(--negro); color: #EDEDED; font-size: 12px; letter-spacing: .02em; text-align: center; padding: 6px 12px; }
.demo b { color: var(--amarillo); font-weight: 600; }
header.top { background: var(--azul); color: #fff; display: flex; align-items: center; gap: 18px; padding: 10px 24px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; flex-shrink: 0; }
.brand .sello { width: 46px; height: 46px; background: #fff; border-radius: 50%; padding: 2px; }
.brand .ib { width: 40px; height: 40px; opacity: .95; }
.brand div { line-height: 1.15; font-weight: 700; font-size: 16px; }
.brand small { display: block; font-weight: 400; font-size: 12px; opacity: .8; }
nav#nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
nav#nav a { color: #F4F4F4; text-decoration: none; padding: 8px 12px; border-radius: 6px; font-size: 14.5px; font-weight: 500; }
nav#nav a:hover { background: rgba(255, 255, 255, .1); }
nav#nav a.on { background: #fff; color: var(--azul); }
.who { font-size: 13px; text-align: right; line-height: 1.2; }
.who small { display: block; opacity: .75; }
.salir { background: transparent; border: 1px solid rgba(255, 255, 255, .5); color: #fff; border-radius: 6px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
.franja { display: grid; grid-template-columns: repeat(5, 1fr); height: 6px; }
.franja i:nth-child(1) { background: #12A99B; } .franja i:nth-child(2) { background: #4564BD; } .franja i:nth-child(3) { background: #E52350; }
.franja i:nth-child(4) { background: #F7BE2A; } .franja i:nth-child(5) { background: #8BC34A; }
.burger { display: none; background: none; border: 0; color: #fff; font-size: 26px; cursor: pointer; margin-left: auto; }

main { max-width: 1280px; margin: 0 auto; padding: 26px 24px 60px; }
footer.pie { border-top: 1px solid var(--borde); background: #fff; padding: 16px 24px; display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; color: var(--tx2); font-size: 13px; }
footer.pie img { height: 26px; }
footer.pie .sep { width: 1px; height: 20px; background: var(--borde); }

/* ---------- títulos con la línea negro-rojo-oro del sitio */
h1 { font-size: 26px; margin: 0 0 6px; font-weight: 700; color: #262A33; }
h1::after { content: ''; display: block; width: 120px; height: 5px; margin-top: 10px; background: linear-gradient(90deg, #2B2523 0 33.3%, var(--rojo) 33.3% 66.6%, #FFD200 66.6%); }
h2 { font-size: 18px; margin: 0 0 12px; font-weight: 700; color: #262A33; }
h3 { font-size: 15px; margin: 0 0 8px; font-weight: 700; }
.sub { color: var(--tx2); margin: 0 0 22px; max-width: 820px; }
.mute { color: var(--tx2); }
.chico { font-size: 13px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 700; color: var(--rojo); }

/* ---------- componentes */
.card { background: #fff; border: 1px solid var(--borde); border-radius: var(--r); box-shadow: var(--sombra); padding: 18px 20px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.kpi { position: relative; overflow: hidden; }
.kpi .t { font-size: 13px; color: var(--tx2); font-weight: 500; }
.kpi .v { font-size: 30px; font-weight: 700; color: #1F2430; margin: 4px 0 2px; letter-spacing: -.01em; }
.kpi .d { font-size: 13px; color: var(--tx2); }
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--azul)); }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 6px; padding: 9px 16px; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; background: var(--rojo); color: #fff; white-space: nowrap; }
.btn:hover { filter: brightness(.95); }
.btn.az { background: var(--azul); } .btn.az2 { background: var(--azul-claro); }
.btn.am { background: var(--amarillo); color: #20386B; }
.btn.sec { background: #fff; color: var(--tx); border: 1px solid #CDD1D8; }
.btn.ve { background: var(--ok); }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #EEF0F3; color: #48505E; white-space: nowrap; }
.chip.ve { background: var(--ok-f); color: var(--ok); } .chip.am { background: var(--warn-f); color: var(--warn); } .chip.ro { background: var(--mal-f); color: var(--mal); } .chip.az { background: var(--info-f); color: var(--azul); }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--borde); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 10px 14px; font-weight: 600; color: var(--tx2); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs button.on { color: var(--azul); border-color: var(--rojo); }
.filtros { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filtros button.f { background: #fff; border: 1px solid #CDD1D8; border-radius: 99px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.filtros button.f.on { background: var(--azul); border-color: var(--azul); color: #fff; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  border: 1px solid #CDD1D8; border-radius: 6px; padding: 8px 10px; background: #fff; min-width: 0; }
textarea { width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(69, 100, 189, .35); border-color: var(--azul-claro); }
label.campo { display: block; font-size: 13px; font-weight: 600; color: #3B404A; margin-bottom: 12px; }
label.campo > input, label.campo > select, label.campo > textarea { display: block; width: 100%; margin-top: 5px; font-weight: 400; }
.tabla-wrap { overflow-x: auto; border: 1px solid var(--borde); border-radius: var(--r); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--tx2); background: #FAFAFB; padding: 10px 12px; border-bottom: 1px solid var(--borde); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid #EFF0F2; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.clic { cursor: pointer; } tr.clic:hover td { background: #F8FAFD; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.aviso { background: var(--warn-f); border: 1px solid #F3D58B; color: #6B4A00; border-radius: var(--r); padding: 10px 14px; font-size: 14px; margin-bottom: 14px; }
.aviso.info { background: var(--info-f); border-color: #C9D6F2; color: #23406E; }
.aviso.ok { background: var(--ok-f); border-color: #B8E0C9; color: #145C3B; }
.aviso ul { margin: 6px 0 0; padding-left: 18px; }
.barra { height: 8px; background: #ECEEF1; border-radius: 99px; overflow: hidden; }
.barra i { display: block; height: 100%; background: var(--c, var(--azul)); border-radius: 99px; }
.fila { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fila.ent { justify-content: space-between; }
.vacio { text-align: center; color: var(--tx3); padding: 30px 10px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); background: #1F2430; color: #fff; padding: 11px 18px; border-radius: 8px; font-size: 14px; opacity: 0; transition: .25s; pointer-events: none; z-index: 99; max-width: calc(100% - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
dialog { border: 0; border-radius: 10px; padding: 0; width: min(880px, calc(100% - 24px)); max-height: calc(100vh - 40px); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
dialog::backdrop { background: rgba(10, 20, 40, .45); }
dialog .dc { padding: 22px 24px; }
dialog .cerrar { float: right; background: none; border: 0; font-size: 24px; cursor: pointer; color: var(--tx2); line-height: 1; }
.lista-barras { display: grid; gap: 9px; }
.lista-barras .it { display: grid; grid-template-columns: 150px 1fr 48px; gap: 10px; align-items: center; font-size: 13.5px; }

/* ---------- ingreso */
.login { display: grid; grid-template-columns: 1.15fr 1fr; min-height: calc(100vh - 30px - 74px); }
.login .foto { background: #1d2d44 url(/img/hero_campus.jpg) center/cover; position: relative; }
.login .foto::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 30, 70, .0) 40%, rgba(0, 30, 70, .82)); }
.login .cap { position: absolute; left: 36px; right: 36px; bottom: 34px; color: #fff; z-index: 1; max-width: 560px; }
.login .cap b { display: block; font-size: 28px; line-height: 1.2; margin-bottom: 8px; }
.login .cap span { opacity: .9; }
.login .cap .mods { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.login .cap .mods i { font-style: normal; font-size: 12.5px; background: rgba(255, 255, 255, .15); border: 1px solid rgba(255, 255, 255, .35); padding: 4px 10px; border-radius: 99px; }
.login .panel { background: #fff; padding: 40px 48px; display: flex; flex-direction: column; justify-content: center; }
.login .logos { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.login .logos img { height: 64px; }
.login form { max-width: 420px; }
.login .tabs { margin-bottom: 16px; }
.login .cuentas { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--borde); max-width: 420px; }
.login .cuentas .fila button { font-size: 12.5px; }
.login .wa-link { margin-top: 22px; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: #128C4A; text-decoration: none; }
.err { color: var(--mal); font-size: 13.5px; min-height: 18px; margin: 4px 0; }

/* ---------- horario */
.hgrid { display: grid; grid-template-columns: 74px repeat(5, minmax(0, 1fr)); gap: 4px; }
.hgrid .hd { font-size: 12px; font-weight: 700; color: var(--tx2); text-transform: uppercase; text-align: center; padding: 4px 0; }
.hgrid .hb { font-size: 11.5px; color: var(--tx2); text-align: right; padding: 6px 6px 0 0; line-height: 1.15; }
.hgrid .hb b { display: block; color: var(--tx); font-size: 12.5px; }
.cel { min-height: 50px; border-radius: 6px; background: #fff; border: 1px dashed #DADDE2; padding: 5px 7px; font-size: 12.5px; line-height: 1.2; position: relative; }
.cel.clase { border: 0; border-left: 4px solid var(--c); background: color-mix(in srgb, var(--c) 9%, #fff); cursor: default; }
.cel.clase b { display: block; font-size: 13px; color: #1F2430; }
.cel.clase small { color: var(--tx2); }
.cel.res { background: repeating-linear-gradient(45deg, #F1F2F4, #F1F2F4 6px, #E8EAED 6px, #E8EAED 12px); border: 0; color: var(--tx3); font-size: 11px; display: flex; align-items: center; justify-content: center; text-align: center; }
.editable .cel.clase { cursor: pointer; } .editable .cel.clase:hover { box-shadow: 0 0 0 2px var(--azul-claro); }
.cel.sel { box-shadow: 0 0 0 3px var(--rojo) !important; }
.cel.puede { background: #E3F5EA; border: 2px solid #4CAF73; cursor: pointer; }
.cel.nopuede { background: #FBE9E9; border: 1px dashed #E6A0A0; }
.recreo { grid-column: 1 / -1; font-size: 11px; color: var(--tx3); text-align: center; padding: 1px 0; letter-spacing: .05em; }
.disp { display: grid; grid-template-columns: 60px repeat(5, 1fr); gap: 3px; font-size: 12px; }
.disp button { border: 1px solid #CDD1D8; background: #E6F4EC; border-radius: 4px; height: 26px; cursor: pointer; }
.disp button.no { background: #FBE2E2; border-color: #E3A3A3; }

/* ---------- planificación */
.unidad { border: 1px solid var(--borde); border-radius: var(--r); background: #fff; margin-bottom: 12px; }
.unidad > header { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--borde); background: #FAFBFC; border-radius: var(--r) var(--r) 0 0; }
.unidad > header .n { width: 30px; height: 30px; border-radius: 50%; background: var(--azul); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.unidad .cuerpo { padding: 14px 16px; }
.ev { display: grid; grid-template-columns: 140px 170px 1fr 70px 30px; gap: 8px; align-items: center; margin-bottom: 8px; }
.ev-ro { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 6px 0; border-top: 1px dashed var(--borde); font-size: 14px; }
.timeline { border-left: 2px solid var(--borde); padding-left: 14px; display: grid; gap: 10px; font-size: 13.5px; }

/* ---------- calendario */
.cal { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.cal .dh { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--tx2); padding: 4px 6px; }
.cal .dia { background: #fff; border: 1px solid var(--borde); border-radius: 6px; min-height: 96px; padding: 6px; font-size: 12px; }
.cal .dia.fuera { background: transparent; border-style: dashed; opacity: .5; }
.cal .dia.feriado { background: #F6F0E6; }
.cal .dia.exceso { border: 2px solid var(--mal); }
.cal .dia .nd { font-weight: 700; font-size: 13px; display: flex; justify-content: space-between; gap: 4px; }
.cal .ev1 { margin-top: 3px; border-left: 3px solid var(--c); padding: 1px 5px; background: color-mix(in srgb, var(--c) 8%, #fff); border-radius: 3px; line-height: 1.25; }
.cal .ev1.env { opacity: .65; border-left-style: dashed; }

/* ---------- conversaciones (panel) */
.inbox { display: grid; grid-template-columns: 360px 1fr; gap: 16px; min-height: 560px; }
.inbox .lst { background: #fff; border: 1px solid var(--borde); border-radius: var(--r); overflow-y: auto; max-height: 72vh; }
.inbox .it { padding: 11px 14px; border-bottom: 1px solid #F0F1F3; cursor: pointer; font-size: 13.5px; }
.inbox .it:hover, .inbox .it.on { background: #F3F6FC; }
.inbox .it .l1 { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.inbox .it .l2 { color: var(--tx2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hilo { background: #EFE7DE url(/img/wa_fondo.svg); border: 1px solid var(--borde); border-radius: var(--r); display: flex; flex-direction: column; max-height: 72vh; }
.hilo .msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.hilo form { display: flex; gap: 8px; padding: 10px; background: #F0F2F5; border-top: 1px solid var(--borde); border-radius: 0 0 var(--r) var(--r); }
.hilo form input { flex: 1; }

/* burbujas compartidas por el panel y el simulador */
.b { max-width: 82%; padding: 7px 10px 18px; border-radius: 8px; font-size: 14px; line-height: 1.38; position: relative; box-shadow: 0 1px .5px rgba(11, 20, 26, .13); white-space: pre-wrap; word-wrap: break-word; }
.b.yo { align-self: flex-end; background: #D9FDD3; border-top-right-radius: 2px; }
.b.el { align-self: flex-start; background: #fff; border-top-left-radius: 2px; }
.b .h { position: absolute; right: 8px; bottom: 3px; font-size: 11px; color: #667781; }
.b .et { display: block; font-size: 11.5px; font-weight: 700; margin-bottom: 2px; }
.b .et.sis { color: #B26A00; } .b .et.hum { color: #128C4A; } .b .et.age { color: var(--azul-claro); }
.b .docw { display: flex; gap: 10px; align-items: center; background: #F5F6F6; border-radius: 6px; padding: 8px 10px; margin-top: 8px; text-decoration: none; color: inherit; white-space: normal; }
.b .docw .pdf { width: 34px; height: 40px; background: #E5252A; color: #fff; border-radius: 3px; display: grid; place-items: center; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.b .docw small { display: block; color: #667781; font-size: 12px; }
.b .pagow { display: block; margin-top: 8px; text-align: center; background: #fff; border: 1px solid #D1D7DB; color: #027EB5; font-weight: 600; border-radius: 6px; padding: 8px; text-decoration: none; white-space: normal; }
.qr { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; max-width: 90%; }
.qr button { background: #fff; color: #027EB5; border: 0; border-radius: 8px; padding: 7px 12px; font-size: 13.5px; font-weight: 500; cursor: pointer; box-shadow: 0 1px .5px rgba(11, 20, 26, .13); }
.fecha-sep { align-self: center; background: #fff; color: #54656F; font-size: 12px; padding: 4px 10px; border-radius: 6px; box-shadow: 0 1px .5px rgba(11, 20, 26, .13); margin: 6px 0; }

/* ---------- familia */
.hijo-tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }

/* ---------- móvil */
@media (max-width: 1000px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g21 { grid-template-columns: minmax(0, 1fr); }
  .inbox { grid-template-columns: 1fr; }
  .burger { display: block; }
  header.top { flex-wrap: wrap; }
  nav#nav { display: none; flex-basis: 100%; flex-direction: column; }
  nav#nav.abierto { display: flex; }
  .who { display: none; }
}
@media (max-width: 760px) {
  main { padding: 18px 16px 50px; }
  header.top { padding: 8px 16px; gap: 10px; }
  .brand .ib { display: none; }
  .brand div { font-size: 14.5px; }
  .salir { padding: 5px 8px; font-size: 12px; }
  .g2, .g3, .g4, .g21 { grid-template-columns: minmax(0, 1fr); }
  .tabs { flex-wrap: nowrap; overflow-x: auto; }
  .btn { white-space: normal; }
  .card table { display: block; overflow-x: auto; }
  .fam .g21 > :last-child { order: -1; }
  .tabs button { white-space: nowrap; }
  .kpi .v { overflow-wrap: anywhere; }
  .kpi .v { font-size: 26px; }
  .login { grid-template-columns: 1fr; min-height: 0; }
  .login .foto { display: none; }
  .login .panel { padding: 22px 16px 30px; }
  .login .logos img { height: 48px; }
  h1 { font-size: 22px; }
  .hgrid { grid-template-columns: 46px repeat(5, minmax(56px, 1fr)); min-width: 520px; }
  .hscroll { overflow-x: auto; }
  .ev { grid-template-columns: 1fr 1fr; }
  .cal { grid-template-columns: 1fr; }
  .cal .dh { display: none; }
  .cal .dia { min-height: 0; }
  .cal .dia.vacio-m { display: none; }
  .lista-barras .it { grid-template-columns: 110px 1fr 40px; }
  dialog .dc { padding: 18px 16px; }
  footer.pie { font-size: 12px; }
}
