/* Paleta Cygni (tomada de las láminas). Cambie colores solo aquí. */
:root {
  --azul: #12306b; --azul-osc: #0b1f4a; --amarillo: #f5b700;
  --verde: #1fa35b; --naranja: #f28a1f; --morado: #7b3fc4; --rojo: #d63b3b; --celeste: #2fa4e0;
  --fondo: #f4f6fb; --texto: #1c2540; --borde: #d8deec; --suave: #5d6785;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: 'Nunito', system-ui, sans-serif; color: var(--texto); background: var(--fondo); }
h1, h2, h3 { margin: 0 0 .5rem; }
a { color: var(--azul); }
label { display: block; font-weight: 600; margin: 0 0 .3rem; }
input, select { display: block; width: 100%; margin: 0 0 1rem; padding: .65rem .75rem; font: inherit; border: 1px solid var(--borde); border-radius: 8px; background: #fff; color: var(--texto); }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid var(--amarillo); outline-offset: 1px; }
.btn { background: var(--azul); color: #fff; border: 0; border-radius: 8px; padding: .7rem 1.2rem; font: inherit; font-weight: 800; cursor: pointer; transition: background .15s; }
.btn:hover { background: var(--azul-osc); }
.btn-ancho { width: 100%; }
.btn-claro { background: #fff; color: var(--azul); border: 1px solid var(--borde); }
.btn-claro:hover { background: var(--fondo); }
.btn-link { background: none; border: 0; color: var(--azul); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.btn-mini { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.45); border-radius: 8px; padding: .35rem .7rem; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.btn-mini:hover { background: rgba(255,255,255,.15); }
.error { color: var(--rojo); min-height: 1.3em; margin: .6rem 0 0; font-weight: 600; }
.ok { color: var(--verde); font-weight: 600; }
.nota { color: var(--suave); font-size: .9rem; margin: 0 0 1rem; }
.caja { background: #fff; border: 1px solid var(--borde); border-radius: 16px; padding: 2rem; width: min(420px, 92vw); box-shadow: 0 8px 30px rgba(18, 48, 107, .08); }

/* Portada / ingreso */
.portada { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.portada-marca { background: linear-gradient(160deg, var(--azul) 0%, var(--azul-osc) 100%); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; text-align: center; border-bottom: 8px solid var(--amarillo); }
.portada-marca img { width: min(240px, 60%); background: #fff; border-radius: 20px; padding: .8rem; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.portada-marca h1 { font-size: 2.2rem; font-weight: 800; margin-top: 1.5rem; }
.portada-marca .lema { font-style: italic; margin: 0; opacity: .95; }
.portada-marca .sitio { margin-top: 1.2rem; color: var(--amarillo); font-weight: 700; text-decoration: none; border-bottom: 2px solid transparent; }
.portada-marca .sitio:hover { border-bottom-color: var(--amarillo); }
.portada-form { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; gap: 1.2rem; }
.portada-simple { display: flex; align-items: center; justify-content: center; }
.pie-login { color: var(--suave); font-size: .85rem; margin: 0; }
.campo-clave { position: relative; }
.campo-clave input { padding-right: 4.2rem; }
.ojo { position: absolute; right: .4rem; top: .3rem; background: none; border: 0; color: var(--azul); font: inherit; font-weight: 700; font-size: .85rem; padding: .35rem .5rem; cursor: pointer; }
.perfiles { display: grid; gap: .6rem; margin-top: 1rem; }
.perfiles .btn { text-align: left; }

/* App: barra superior */
.app { display: flex; flex-direction: column; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1rem; padding: .5rem 1.2rem; background: var(--azul); color: #fff; border-bottom: 4px solid var(--amarillo); }
.marca { display: flex; align-items: center; gap: .6rem; font-weight: 800; white-space: nowrap; }
.marca img { height: 40px; width: 40px; object-fit: contain; background: #fff; border-radius: 10px; padding: 3px; }
.menu { display: flex; flex: 1; gap: .2rem; flex-wrap: wrap; }
.menu button { background: none; color: #fff; border: 0; padding: .55rem .8rem; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; }
.menu button:hover:not(:disabled) { background: rgba(255,255,255,.12); }
.menu button.activo { background: rgba(255,255,255,.18); box-shadow: inset 0 -3px var(--amarillo); }
.menu button:disabled { opacity: .5; cursor: default; }
.btn-menu { display: none; background: none; border: 1px solid rgba(255,255,255,.45); color: #fff; border-radius: 8px; font-size: 1.2rem; padding: .2rem .6rem; cursor: pointer; }
.usuario { display: flex; align-items: center; gap: .6rem; }
.usuario-datos { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; font-size: .9rem; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--amarillo); color: var(--azul-osc); font-weight: 800; display: grid; place-items: center; flex: none; }
.chip { background: var(--amarillo); color: var(--azul-osc); font-weight: 800; border-radius: 99px; padding: .05rem .6rem; font-size: .75rem; margin-top: .15rem; }

/* App: cuerpo */
.cuerpo { flex: 1; width: min(1200px, 100%); margin: 0 auto; padding: 1.2rem 1.5rem 2rem; }
.encabezado { border-left: 6px solid var(--amarillo); padding-left: .9rem; margin-bottom: 1rem; }
.encabezado h1 { font-size: 1.5rem; color: var(--azul); margin: 0; }
.encabezado .nota { margin: .2rem 0 0; text-transform: capitalize; }
.bienvenida { background: var(--azul); color: #fff; border-radius: 10px; padding: .7rem 1rem; margin-bottom: 1.2rem; }
.panel { background: #fff; border: 1px solid var(--borde); border-radius: 14px; padding: 1.2rem; margin-bottom: 1.2rem; }
.panel-cab { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.panel-cab h2 { margin: 0; }
.panel h3 { color: var(--azul); font-size: 1rem; margin: 1rem 0 .6rem; padding-bottom: .3rem; border-bottom: 2px solid var(--fondo); }
.form-fila { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 1rem; }
.roles-check { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin-bottom: 1rem; }
.roles-check label { font-weight: 400; margin: 0; display: flex; align-items: center; }
.roles-check input { display: inline; width: auto; margin: 0 .4rem 0 0; }

/* Tarjetas de inicio (estilo Cibercolegios, colores Cygni) */
.tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.tarjeta { display: flex; flex-direction: column; gap: .25rem; text-align: left; border: 0; border-radius: 14px; padding: 1.2rem; min-height: 130px; color: #fff; font: inherit; }
.tarjeta .t-ico { font-size: 2.2rem; line-height: 1; }
.tarjeta strong { font-size: 1.15rem; margin-top: auto; }
.tarjeta small { opacity: .92; }
button.tarjeta { cursor: pointer; transition: transform .15s, box-shadow .15s; }
button.tarjeta:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(18, 48, 107, .25); }
.t-azul { background: var(--azul); } .t-naranja { background: var(--naranja); } .t-verde { background: var(--verde); }
.t-morado { background: var(--morado); } .t-rojo { background: var(--rojo); } .t-celeste { background: var(--celeste); }
.t-prox { opacity: .55; }

/* Tabla de usuarios */
.buscador { max-width: 320px; margin: 0; }
.tabla-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--borde); font-size: .93rem; }
th { color: var(--azul); }
tbody tr:hover { background: var(--fondo); }
td button { margin-right: .6rem; }
.pill { display: inline-block; background: #e8edfa; color: var(--azul); border-radius: 99px; padding: .05rem .6rem; font-size: .8rem; font-weight: 600; margin: 0 .25rem .2rem 0; }
.pill-ok { background: #dff5e8; color: #14753f; }
.pill-no { background: #fbe4e4; color: var(--rojo); }

/* Pie */
.pie { display: flex; justify-content: space-between; gap: .5rem 1.5rem; flex-wrap: wrap; padding: .9rem 1.5rem; background: #fff; border-top: 1px solid var(--borde); color: var(--suave); font-size: .85rem; }

@media (max-width: 860px) {
  .portada { grid-template-columns: 1fr; } .portada-marca { padding: 1.5rem; }
  .topbar { flex-wrap: wrap; }
  .btn-menu { display: block; }
  .menu { display: none; flex: 1 1 100%; order: 5; flex-direction: column; }
  .menu.abierto { display: flex; }
  .usuario { margin-left: auto; }
  .usuario-datos { display: none; }
  .cuerpo { padding: 1rem; }
  .pie { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Módulo 2: parámetros */
.t-amarillo { background: var(--amarillo); color: var(--azul-osc); }
.sin-borde { border: 0; padding: 0; margin: 0; min-width: 0; }
.fila-param { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 1rem; padding: .2rem 0; border-bottom: 1px dashed var(--borde); margin-bottom: .4rem; }
.fila-param label { flex: 1 1 150px; margin: 0; }
.fila-param .btn-link { margin-bottom: 1.2rem; }
.suma { font-size: .85rem; font-weight: 800; margin-left: .6rem; }
.suma-ok { color: var(--verde); } .suma-mal { color: var(--rojo); }
.btn-claro { margin-top: .2rem; }

/* Módulo 3: áreas y asignaturas */
.grupo td { background: var(--fondo); color: var(--azul); font-weight: 800; }
.rejilla-horas { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0 .8rem; margin-bottom: .6rem; }
.rejilla-horas input { margin-bottom: .6rem; }

/* ===== Versión móvil ===== */
input, select { font-size: 16px; }                       /* evita el zoom automático en iPhone */
.btn, .menu button, .btn-mini { min-height: 44px; }      /* tamaño cómodo para el dedo */
.btn-link { padding: .35rem .2rem; }
.pie { padding-bottom: calc(.9rem + env(safe-area-inset-bottom)); }
.topbar { padding-top: calc(.5rem + env(safe-area-inset-top)); }

@media (max-width: 700px) {
  /* Las tablas se ven como tarjetas, una por registro */
  .tabla-wrap table, .tabla-wrap tbody, .tabla-wrap tr, .tabla-wrap td { display: block; width: 100%; }
  .tabla-wrap thead { display: none; }
  .tabla-wrap tr { border: 1px solid var(--borde); border-radius: 12px; padding: .5rem .8rem; margin-bottom: .7rem; background: #fff; }
  .tabla-wrap tbody tr:hover { background: #fff; }
  .tabla-wrap td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border: 0; padding: .35rem 0; text-align: right; }
  .tabla-wrap td::before { content: attr(data-label); flex: none; font-weight: 700; color: var(--azul); text-align: left; }
  .tabla-wrap td[colspan] { display: block; text-align: left; }
  .tabla-wrap td[colspan]::before { content: none; }
  .tabla-wrap td[data-label="Acciones"] { flex-wrap: wrap; justify-content: flex-end; border-top: 1px solid var(--fondo); margin-top: .3rem; padding-top: .5rem; }
  .tabla-wrap td[data-label="Horas por grado"] { flex-wrap: wrap; justify-content: flex-end; }
  .tabla-wrap tr.grupo { background: var(--fondo); border: 0; padding: .2rem .8rem; }
  .tabla-wrap tr.grupo td { display: block; text-align: left; }

  .cuerpo { padding: .8rem; }
  .encabezado h1 { font-size: 1.15rem; }
  .panel { padding: .9rem; }
  .panel-cab .btn, .buscador { width: 100%; max-width: none; }
  .fila-param label { flex: 1 1 100%; }
  .tarjetas { grid-template-columns: repeat(2, 1fr); gap: .7rem; }
  .tarjeta { min-height: 110px; padding: .9rem; }
  .tarjeta strong { font-size: 1rem; }
  .rejilla-horas { grid-template-columns: repeat(3, 1fr); }
  .portada-marca img { width: 120px; }
  .portada-marca h1 { font-size: 1.6rem; margin-top: 1rem; }
  .portada-form { padding: 1.2rem 1rem; }
  .caja { padding: 1.4rem; }
}
@media (max-width: 560px) {
  .marca span { display: none; }
  .usuario { gap: .4rem; }
  .btn-mini { padding: .35rem .5rem; font-size: .8rem; }
}

/* Ajustes móviles (segunda pasada) */
.solo-movil { display: none; }
.pills { display: flex; flex-wrap: wrap; gap: .25rem; }
.encabezado .nota { text-transform: none; }
.encabezado .nota::first-letter { text-transform: uppercase; }
@media (max-width: 860px) {
  .usuario .btn-mini { display: none; }
  .menu .solo-movil { display: block; border-top: 1px solid rgba(255,255,255,.2); border-radius: 0; margin-top: .2rem; text-align: left; }
}
@media (max-width: 700px) {
  .tabla-wrap td[data-label="Acciones"]::before { content: none; }
  .tabla-wrap td[data-label="Acciones"] { justify-content: flex-start; gap: .2rem 1.2rem; }
  .tabla-wrap td[data-label="Horas por grado"] { flex-direction: column; align-items: flex-start; text-align: left; gap: .3rem; }
  .tabla-wrap td[data-label="Horas por grado"] .pills { justify-content: flex-start; }
}
@media (max-width: 860px) { .menu button { text-align: left; } }

/* Cuadrícula de grupos (Módulo 4) */
.cuadricula-wrap { overflow-x: auto; margin-bottom: 1rem; }
.cuadricula { width: 100%; border-collapse: collapse; }
.cuadricula th, .cuadricula td { text-align: center; padding: .35rem .3rem; border-bottom: 1px solid var(--borde); }
.cuadricula th[scope="row"] { text-align: left; font-weight: 600; white-space: nowrap; }
.cuadricula thead th:first-child { text-align: left; }
.cuadricula input { display: inline-block; width: 22px; height: 22px; margin: 0; vertical-align: middle; }
.cuadricula label { display: inline-flex; align-items: center; gap: .3rem; margin: 0; font-weight: 800; color: var(--azul); }
.cuadricula th, .cuadricula td { padding: .35rem .15rem; }
.cuadricula thead label { flex-direction: column; gap: .15rem; }
.cuadricula input { width: 22px; height: 22px; }

/* Firma del desarrollador */
.firma { display: flex; flex-direction: column; gap: .1rem; line-height: 1.35; }
.firma-t { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--suave); }
.firma-n { font-size: 1.1rem; font-weight: 800; color: var(--azul); }
.firma-n::after { content: ""; display: block; width: 2.2rem; height: 3px; margin-top: .2rem; background: var(--amarillo); border-radius: 2px; }
.firma-r { font-size: .8rem; color: var(--suave); }
.firma-login { text-align: center; align-items: center; margin-top: .5rem; }

/* Menú lateral vertical (todos los perfiles) */
.layout { display: flex; flex: 1; align-items: stretch; }
.principal { flex: 1; min-width: 0; }
.menu { flex: 0 0 240px; flex-direction: column; flex-wrap: nowrap; align-content: flex-start; gap: .25rem; padding: 1rem .8rem; background: #0e2754; position: sticky; top: 62px; align-self: flex-start; height: calc(100vh - 62px); overflow-y: auto; }
.menu button { text-align: left; width: 100%; padding: .7rem .9rem; }
.menu button.activo { box-shadow: inset 4px 0 var(--amarillo); }
.usuario { margin-left: auto; }
@media (max-width: 860px) {
  .menu { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; height: auto; z-index: 9; padding: 4.5rem .8rem 1rem; order: 0; flex: none; background: var(--azul); }
  .menu.abierto { display: flex; }
}

/* Cerrar sesión (y cambiar perfil) al final del menú lateral */
.usuario .btn-mini { display: none; }
.menu .solo-movil { display: block; text-align: left; border-top: 1px solid rgba(255,255,255,.2); border-radius: 0; margin-top: 0; }
.menu button:not(.solo-movil) + .solo-movil { margin-top: auto; }
.menu button { min-height: 40px; padding: .5rem .9rem; }

/* Ficha de la asignatura */
.pestanas { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .8rem; border-bottom: 2px solid var(--borde); }
.pestanas button { background: none; border: 0; padding: .6rem 1.1rem; font: inherit; font-weight: 700; color: var(--suave); cursor: pointer; border-bottom: 4px solid transparent; margin-bottom: -2px; min-height: 44px; }
.pestanas button.activa { color: var(--azul); border-bottom-color: var(--amarillo); }
textarea { width: 100%; font: inherit; padding: .6rem .75rem; border: 1px solid var(--borde); border-radius: 10px; resize: vertical; background: #fff; color: inherit; }
.nota-in { max-width: 6rem; text-align: center; }
tr.anulada td { opacity: .55; }
.nota-baja { color: var(--rojo); }
.nota-ok { color: var(--azul); }
.check { display: flex; align-items: center; gap: .5rem; margin: .6rem 0; font-weight: 600; }
.check input { width: auto; }

/* Informes: gráficas de barras sencillas */
.barras { display: grid; gap: .45rem; margin-top: .6rem; }
.barra-fila { display: grid; grid-template-columns: minmax(110px, 220px) 1fr auto; gap: .6rem; align-items: center; font-size: .92rem; }
.barra-nom { font-weight: 600; overflow-wrap: anywhere; }
.barra-pista { background: #e8edfa; border-radius: 99px; height: 16px; overflow: hidden; }
.barra { display: block; height: 100%; border-radius: 99px; min-width: 2px; }
.barra-val { font-weight: 700; color: var(--azul); white-space: nowrap; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-top: .6rem; }
.kpi { background: #eef2fb; border-radius: 12px; padding: .8rem 1rem; }
.kpi strong { display: block; font-size: 1.5rem; color: var(--azul); }
.kpi span { font-size: .85rem; color: var(--suave); }
@media (max-width: 700px) { .barra-fila { grid-template-columns: 1fr auto; } .barra-fila .barra-pista { grid-column: 1 / -1; order: 3; } }

/* Planilla de calificaciones (formato Cibercolegios) */
.planilla table { font-size: .85rem; }
.planilla th.grupo { text-align: center; border-left: 2px solid var(--borde); }
.planilla td, .planilla th { white-space: nowrap; }

/* Boletines */
.boletin { page-break-after: always; break-inside: avoid; }
.bol-cab { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; border-bottom: 3px solid var(--amarillo); margin-bottom: 8px; }
.bol-cab h3 { margin: 0; }
.bol-datos { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 8px 0 12px; }
.bol-tabla th, .bol-tabla td { text-align: center; }
.bol-tabla td:first-child, .bol-tabla th:first-child { text-align: left; }
.bol-fila-area td { background: #eef1f9; font-weight: 800; color: var(--azul); text-align: left !important; }
.bol-area h4 { background: #eef1f9; color: var(--azul); padding: 6px 10px; margin: 12px 0 4px; border-radius: 6px; }
.bol-asig { padding: 4px 10px; border-bottom: 1px solid #e3e7f2; }
.bol-asig-cab { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.bol-letras { margin-left: auto; display: flex; gap: 10px; }
.bol-firma { margin-top: 36px; width: 260px; border-top: 1px solid #222; text-align: center; }
@media print {
  body * { visibility: hidden; }
  #b-res, #b-res * { visibility: visible; }
  #b-res { position: absolute; left: 0; top: 0; width: 100%; }
  .no-imprimir { display: none !important; }
  .boletin { box-shadow: none; border: 0; }
}
.bol-cab h3 { border: 0 !important; padding: 0 !important; margin: 0 0 2px !important; }
.bol-cab p { margin: 0 0 6px; }
.bol-firma span, .bol-firma small { display: block; }
.bol-nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.bol-nav .btn:disabled { opacity: .45; cursor: default; }
.bol-cab { align-items: center !important; justify-content: flex-start !important; }
.bol-logo { width: 70px; height: 70px; object-fit: contain; }
.bol-tit { flex: 1; text-align: center; }
.bol-tit small { display: block; color: var(--azul); }
.bol-cab .pill { margin-left: auto; }
@page { size: A4 portrait; margin: 12mm; }
.bol-area h4 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.bol-fila-area td:not(:first-child) { text-align: center !important; }

/* ===== Ingreso renovado ===== */
.portada-marca { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 20% 10%, #1d4a9c 0%, var(--azul) 45%, var(--azul-osc) 100%); }
.marca-centro { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; max-width: 440px; }
.portada-marca .saludo { margin: 1.6rem 0 .1rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: .85rem; color: var(--amarillo); }
.portada-marca h1 { margin-top: 0; font-size: 2.5rem; line-height: 1.1; }
.portada-marca .mensaje { margin: .9rem 0 1.1rem; font-size: 1.1rem; opacity: .95; line-height: 1.45; }
.portada-marca .lema { padding-top: 1rem; border-top: 2px solid rgba(255,255,255,.25); font-size: 1.05rem; }
.forma { position: absolute; border-radius: 50%; pointer-events: none; }
.f1 { width: 340px; height: 340px; background: var(--amarillo); opacity: .16; top: -120px; left: -110px; }
.f2 { width: 220px; height: 220px; border: 26px solid var(--celeste); opacity: .28; bottom: 40px; right: -70px; }
.f3 { width: 130px; height: 130px; background: var(--verde); opacity: .30; bottom: -40px; left: 14%; }
.f4 { width: 90px; height: 90px; background: var(--naranja); opacity: .30; top: 16%; right: 12%; }
.f5 { width: 60px; height: 60px; background: var(--morado); opacity: .40; top: 58%; left: 8%; }
.portada-form { background: linear-gradient(180deg, #ffffff 0%, var(--fondo) 100%); }
.portada-form .caja { border: 0; border-radius: 22px; padding: 2.4rem 2.2rem; width: min(440px, 92vw); box-shadow: 0 18px 50px rgba(18, 48, 107, .14); }
.portada-form .caja h2 { font-size: 1.7rem; color: var(--azul); margin-bottom: .4rem; }
.barra-amarilla { display: block; width: 54px; height: 5px; border-radius: 3px; background: var(--amarillo); margin-bottom: .9rem; }
.portada-form .caja input { padding: .8rem .9rem; border-radius: 10px; }
.portada-form .caja .btn-ancho { padding: .9rem; font-size: 1.05rem; border-radius: 10px; box-shadow: 0 6px 16px rgba(18, 48, 107, .25); }
.portada-form .caja .btn-ancho:hover { transform: translateY(-1px); }
@media (max-width: 860px) {
  .portada-marca { padding: 1.6rem 1.2rem 1.8rem; }
  .portada-marca h1 { font-size: 1.9rem; }
  .portada-marca .saludo { margin-top: 1rem; }
  .portada-marca .mensaje { font-size: 1rem; margin: .6rem 0 .8rem; }
  .f1 { width: 220px; height: 220px; } .f2, .f4 { display: none; }
}

/* Expediente disciplinario */
.rep.anulada { opacity: .55; }
.rep-seg { margin: .2rem 0 .6rem 1.1rem; padding: 0; }
.rep-seg li { margin-bottom: .4rem; }
.rep-acc { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: .6rem; }
.rep-f { margin-top: .8rem; }
.rep-f textarea, .rep-f select { width: 100%; }
.rep-nom { margin: 1.2rem 0 .3rem; color: var(--azul); }
.exp-pasos { margin: .4rem 0 .8rem 1.2rem; padding: 0; }
.exp-pasos li { margin-bottom: .45rem; }

.pie-legal-login { text-align: center; font-size: .78rem; color: var(--suave); margin: .6rem 0 0; }
.pie-legal-login a { color: inherit; }

.barra-volver{margin:0 0 10px}.barra-volver:empty{display:none}@media print{.barra-volver{display:none!important}}

/* Inicio agrupado por tema */
.grupo-tit { margin: 1.4rem 0 .6rem; font-size: .85rem; font-weight: 800; color: var(--azul); text-transform: uppercase; letter-spacing: .06em; }
.tarjetas.compactas { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .8rem; }
.tarjetas.compactas .tarjeta { min-height: 108px; padding: 1rem; }
.tarjetas.compactas .tarjeta strong { font-size: 1.05rem; }

.atencion{background:#fff8e6;border:1px solid #f1d88a;border-radius:14px;padding:12px 14px;margin:0 0 16px}
.atencion h3{margin:0 0 8px;font-size:1rem}
.atn-fila{display:flex;gap:10px;align-items:center;width:100%;text-align:left;background:#fff;border:1px solid #eee3bd;border-radius:10px;padding:10px 12px;margin:6px 0;font:inherit;cursor:pointer}
.atn-fila:hover{background:#fffdf5}
.atn-fila span:nth-child(2){flex:1}
.atn-ir{color:#999;font-size:1.3rem}
.atn-ok{margin:4px 0;color:#2e7d32}
.btn-link.peligro{color:#c62828}

.tabla-anot .caja-anot{width:100%;min-height:38px;max-height:160px;resize:vertical;font:inherit;padding:6px 8px;border:1px solid #cfd6e4;border-radius:8px}
.tabla-anot td{vertical-align:top}
.tabla-anot td.c{text-align:center;width:36px}
.tabla-anot td:nth-child(2){min-width:160px}

.bol-anot td{font-size:.85em;color:#333;background:#fafafa;padding:4px 8px}

.fam-resumen { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 10px 0 12px; }
.fam-tarj { background: #eef2fb; border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.fam-tarj strong { font-size: 1.7rem; line-height: 1.1; color: #12306b; }
.fam-tarj span { font-size: .85rem; color: #4b5877; }
.fam-tarj.ok { background: #e6f5ea; } .fam-tarj.ok strong { color: #1d7a3a; }
.fam-tarj.pend { background: #fff4dc; } .fam-tarj.pend strong { color: #a36a00; }
.fam-par { font-style: normal; font-weight: 700; color: #a36a00; }
@media (max-width: 700px) { .fam-resumen { grid-template-columns: repeat(2, 1fr); } }

/* ===== Estados de guardado (colores del colegio) ===== */
input:focus, select:focus, textarea:focus { outline: 3px solid var(--celeste); outline-offset: 0; border-color: var(--celeste); }
input:disabled, textarea:disabled, select:disabled { background: #eceff5; color: var(--suave); border-color: #cfd5e4; cursor: not-allowed; }
input:user-invalid, textarea:user-invalid, select:user-invalid { border-color: var(--rojo); background: #fff3f3; }
input.g-ok, textarea.g-ok { border-color: var(--verde); background: #f1fbf5 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 5' fill='none' stroke='%231fa35b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right .5rem top .55rem / 1rem; padding-right: 1.9rem; }
input.g-mod, textarea.g-mod { border-color: var(--amarillo); background: #fffbe8; box-shadow: 0 0 0 2px rgba(245,183,0,.35); }
input.nota-in.g-ok { background-position: right .25rem center; padding-right: 1.5rem; }
.g-aviso { display: inline-block; margin: .6rem .8rem .6rem 0; padding: .35rem .7rem; border-radius: 999px; background: #fff3c4; color: #7a5600; font-weight: 800; font-size: .9rem; border: 1px solid var(--amarillo); }
.btn.g-guardar { background: var(--amarillo); color: #1c2540; box-shadow: 0 0 0 3px rgba(245,183,0,.4); animation: g-lat 1.6s ease-in-out infinite; }
.btn.g-guardar:hover { background: #e0a800; }
@keyframes g-lat { 50% { box-shadow: 0 0 0 6px rgba(245,183,0,.15); } }
@media (prefers-reduced-motion: reduce) { .btn.g-guardar { animation: none; } }
.tema-lista { margin-bottom: .6rem; }
.tema-fila { display: flex; align-items: center; gap: .5rem; margin-bottom: .45rem; }
.tema-fila .tema-in { margin: 0; flex: 1; }
.tema-vi { color: var(--azul); font-size: 1.4rem; line-height: 1; width: 1rem; text-align: center; }
.temas-vi { margin: .2rem 0 .8rem; padding-left: 1.3rem; }
.temas-vi li::marker { color: var(--azul); }
.as-m.ok, .mensaje.ok { color: var(--verde); font-weight: 800; }

.tarjeta{position:relative}.tarjeta .alerta-n{position:absolute;top:12px;right:12px;background:#fff;color:#b00020;font-weight:800;font-size:.85rem;padding:4px 10px;border-radius:999px;box-shadow:0 2px 6px rgba(0,0,0,.25);animation:alerta-p 1.6s ease-in-out infinite}.tarjeta.con-alerta{outline:3px solid #ffd54f}@keyframes alerta-p{50%{transform:scale(1.08)}}@media (prefers-reduced-motion:reduce){.tarjeta .alerta-n{animation:none}}

.portada-marca .redes{display:flex;gap:14px;justify-content:center;margin-top:1rem}.portada-marca .redes a{display:block;width:44px;height:44px;border-radius:50%;box-shadow:0 0 0 2px rgba(255,255,255,.85);transition:transform .15s}.portada-marca .redes a:hover,.portada-marca .redes a:focus-visible{transform:translateY(-3px);outline:3px solid var(--amarillo);outline-offset:2px}.portada-marca .redes svg{width:100%;height:100%;display:block}

.portada-marca .detalle { margin: .2rem 0 .9rem; font-size: .8rem; opacity: .85; }

.fam-acc > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fam-acc > summary::-webkit-details-marker { display: none; }
.fam-acc > summary::after { content: '▾'; font-size: 1.1rem; color: #4b5877; transition: transform .15s; }
.fam-acc[open] > summary::after { transform: rotate(180deg); }
.fam-acc > summary h3 { margin: 0; }
.fam-acc[open] > summary { margin-bottom: 8px; }

/* Nova: asistente de guía */
#nova-b { position: fixed; right: 16px; bottom: 16px; z-index: 50; background: var(--azul); color: #fff; border: 0; border-radius: 999px; padding: .7rem 1.1rem; font: inherit; font-weight: 800; cursor: pointer; box-shadow: 0 4px 14px rgba(11, 31, 74, .35); }
#nova-b:hover { background: var(--azul-osc); }
#nova-p { position: fixed; right: 16px; bottom: 72px; z-index: 50; width: 340px; max-width: calc(100vw - 32px); background: #fff; border-radius: 14px; box-shadow: 0 8px 30px rgba(11, 31, 74, .35); overflow: hidden; }
#nova-p[hidden] { display: none; }
#nova-p header { background: var(--azul); color: #fff; padding: .7rem .9rem; display: flex; justify-content: space-between; align-items: center; }
#nova-p header button { background: none; border: 0; color: #fff; font-size: 1.1rem; cursor: pointer; }
#nova-c { padding: .8rem .9rem; max-height: min(60vh, 420px); overflow: auto; font-size: .95rem; }
.nova-hola { margin: 0 0 .6rem; }
.nova-q { display: block; width: 100%; text-align: left; background: #f3f5f9; border: 0; border-radius: 10px; padding: .6rem .7rem; margin: .4rem 0; font: inherit; cursor: pointer; }
.nova-q:hover { background: #e3e9f6; }
.nova-atras { background: none; border: 0; color: var(--azul); font: inherit; font-weight: 800; cursor: pointer; padding: 0; }
#nova-c h4 { margin: .5rem 0 0; }
#nova-c ol { padding-left: 1.2rem; }
@media print { #nova { display: none; } }

/* ===== Computador: letra un poco más pequeña (el celular y la tablet no cambian) ===== */
@media screen and (min-width: 861px) {
  html { font-size: 14.5px; }
  input, select, textarea { font-size: 1rem; }
  .btn, .menu button, .btn-mini { min-height: 38px; }
}

.guia-pantalla:empty{display:none}.guia-pantalla{margin:0 0 12px}.gp-c{display:flex;gap:10px;align-items:center;flex-wrap:wrap;background:#eaf3ff;border:1px solid #bcd6f5;border-radius:12px;padding:10px 14px;color:#1b3a63}.gp-i{font-size:1.1rem}.gp-t{flex:1 1 320px}.gp-b{white-space:nowrap}@media print{.guia-pantalla{display:none!important}}

.pest-grupos { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .8rem; }
.pest-grupos button { background: #eef2fb; border: 2px solid transparent; border-radius: 12px; padding: .55rem 1.1rem; font: inherit; font-weight: 800; color: var(--azul); cursor: pointer; min-height: 44px; }
.pest-grupos button.activa { background: var(--azul); color: #fff; }
.pest-sub { margin-top: .5rem; }
.pest-av { background: #c62828; color: #fff; border-radius: 10px; padding: 1px 8px; font-size: .78rem; margin-left: 4px; }
.pest-pt { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #e53935; margin-left: 4px; }
@media (max-width: 640px) { .pest-sub { flex-wrap: nowrap; overflow-x: auto; } .pest-sub button { white-space: nowrap; } }

.fam-hijos { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: .8rem; margin-top: .4rem; }
.fh-tarj { display: flex; gap: .8rem; align-items: center; text-align: left; background: #fff; border: 1px solid var(--borde, #d9dfec); border-radius: 14px; padding: .9rem 1rem; cursor: pointer; font: inherit; min-height: 44px; box-shadow: 0 1px 3px rgba(22,49,107,.08); }
.fh-tarj:hover { border-color: var(--azul, #16316b); }
.fh-av { flex: none; width: 52px; height: 52px; border-radius: 50%; background: var(--amarillo, #f2b705); color: var(--azul, #16316b); font-weight: 800; font-size: 1.4rem; display: flex; align-items: center; justify-content: center; }
.fh-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fh-tx strong { color: var(--azul, #16316b); font-size: 1.05rem; }
.fh-tx small { color: #6b7694; }
.fh-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.fh-chip { border-radius: 10px; padding: 2px 9px; font-size: .8rem; font-weight: 700; }
.fh-r { background: #fde7e7; color: #b3261e; } .fh-a { background: #fff2cc; color: #8a5a00; } .fh-ok { background: #e1f5e7; color: #1b6b35; }
.fh-go { color: var(--azul, #16316b) !important; font-weight: 700; margin-top: 2px; }

.fh-filtro { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: 10px; }
.fh-filtro button { border: 2px solid var(--azul, #16316b); background: #fff; color: var(--azul, #16316b); border-radius: 20px; padding: .35rem .9rem; font: inherit; font-weight: 700; cursor: pointer; min-height: 40px; }
.fh-filtro button.act { background: var(--azul, #16316b); color: #fff; }
.fh-h0 { background: #dbe8ff; color: #16316b; } .fh-h1 { background: #ffe3c2; color: #8a4b00; } .fh-h2 { background: #e1f5e7; color: #1b6b35; } .fh-h3 { background: #ececf4; color: #444a66; }

.ct-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; margin: .2rem 0 1rem; }
.ct-kpi { background: #fff; border: 1px solid var(--borde, #d9dfec); border-left: 6px solid var(--azul, #16316b); border-radius: 12px; padding: .9rem 1rem; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 1px 3px rgba(22,49,107,.08); }
.ct-kpi strong { font-size: 1.55rem; color: var(--azul, #16316b); }
.ct-kpi small { color: #6b7694; }
.ct-ico { font-size: 1.3rem; }
.ct-ok { border-left-color: #1b8a4b; } .ct-mora { border-left-color: #c62828; } .ct-mora strong { color: #c62828; }

.nav-badge { background: #e53935; color: #fff; border-radius: 999px; padding: 1px 8px; font-size: .78rem; font-weight: 800; margin-left: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.btn-menu { position: relative; }
.btn-menu.con-aviso::after { content: ''; position: absolute; top: 4px; right: 4px; width: 12px; height: 12px; border-radius: 50%; background: #e53935; border: 2px solid #fff; }

/* Portada: fotos y accesos (estilo de la propuesta aprobada) */
.portada-marca .fotos { display: flex; justify-content: center; gap: 12px; margin: 1.3rem 0 1rem; }
.portada-marca .fotos img { width: 104px; height: 128px; object-fit: cover; object-position: top; border-radius: 50%; padding: 0; background: #1d4a9c; border: 4px solid var(--amarillo); box-shadow: 0 8px 22px rgba(0,0,0,.28); }
.portada-marca .fotos img:nth-child(2) { margin-top: -10px; }
.portada-marca .iconos { list-style: none; display: flex; justify-content: center; gap: 0; margin: .4rem 0 1.1rem; padding: .55rem .4rem; border: 1.5px solid rgba(255,255,255,.35); border-radius: 40px; background: rgba(255,255,255,.08); }
.portada-marca .iconos li { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 0 .85rem; font-size: .8rem; font-weight: 700; border-left: 1px solid rgba(255,255,255,.25); }
.portada-marca .iconos li:first-child { border-left: 0; }
.portada-marca .iconos svg { width: 26px; height: 26px; color: var(--amarillo); }
.portada-marca .mensaje { font-weight: 700; font-style: italic; font-size: 1.2rem; }
.portada-marca h1 { color: #fff; } 
@media (max-width: 560px) {
  .portada-marca .fotos img { width: 84px; height: 104px; border-width: 3px; }
  .portada-marca .iconos li { padding: 0 .5rem; font-size: .72rem; } .portada-marca .iconos svg { width: 22px; height: 22px; }
}
.portada-marca img.logo-portada { background: none; padding: 0; border-radius: 0; box-shadow: none; width: min(320px, 78%); height: auto; }
@media (max-width: 560px) { .portada-marca img.logo-portada { width: 230px; } }
