/* Suplencias · tema claro/oscuro con la paleta del diseño (sol, azul y turquesa). Los colores viven en variables. */
:root {
  --sol: #ffb703;
  --bg: #fffaf2;
  --surface: #ffffff;
  --text: #1d3557;
  --muted: #4a5a78;
  --border: #ebe2cf;
  --accent: #1d3557;
  --accent-text: #ffffff;
  --ok: #2a9d8f;
  --error: #c0392b;
  --glow-1: rgba(255, 183, 3, 0.20);
  --glow-2: rgba(33, 158, 188, 0.14);
  --campo: #ffffff;
  --radius: 18px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #0f1b2d;
    --surface: #172a45;
    --text: #f3efe6;
    --muted: #a9b6c9;
    --border: #2b3f5e;
    --accent: #ffb703;
    --accent-text: #1d3557;
    --ok: #5fd0c2;
    --error: #ff8a80;
    --glow-1: rgba(255, 183, 3, 0.12);
    --glow-2: rgba(33, 158, 188, 0.16);
    --campo: #0f1b2d;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0f1b2d;
  --surface: #172a45;
  --text: #f3efe6;
  --muted: #a9b6c9;
  --border: #2b3f5e;
  --accent: #ffb703;
  --accent-text: #1d3557;
  --ok: #5fd0c2;
  --error: #ff8a80;
  --glow-1: rgba(255, 183, 3, 0.12);
  --glow-2: rgba(33, 158, 188, 0.16);
  --campo: #0f1b2d;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  color: var(--text);
  font: 16px/1.55 "Trebuchet MS", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  min-height: 100%;
}

/* Fondo con color suave arriba a los costados; se ve en toda la página */
html {
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 520px at 0% -5%, var(--glow-1), transparent 65%),
    radial-gradient(800px 480px at 100% 0%, var(--glow-2), transparent 65%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand { font-weight: 700; letter-spacing: .2px; }

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

h1 { font-size: 1.4rem; margin: 0 0 8px; }

.muted { color: var(--muted); }

.status { margin: 12px 0 0; font-size: .95rem; }
.status.ok { color: var(--ok); }
.status.error { color: var(--error); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 600;
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.btn-ghost:focus-visible,
.btn-ghost:hover { border-color: var(--accent); }

.footer {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
}

/* ---------- Etapa 2: navegación, formularios y listas ---------- */

.topbar-acciones { display: flex; align-items: center; gap: 8px; }
.topbar a.brand { color: var(--text); text-decoration: none; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a, .linkbtn {
  color: var(--text);
  text-decoration: none;
  padding: 8px 10px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
}
.nav a:hover, .linkbtn:hover { color: var(--accent); }

.acciones { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn:disabled { opacity: .6; cursor: default; }
.btn-ghost.chico, .btn.chico { min-height: 40px; padding: 0 12px; font-size: .9rem; }

.form { display: grid; gap: 14px; margin-top: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .95rem; }
.field-check { display: flex; align-items: center; gap: 10px; }
.field-check input { width: 22px; height: 22px; }
.field small { color: var(--muted); }

input, textarea, select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--text) 22%, var(--surface));
  border-radius: 10px;
  background: var(--campo);
  color: var(--text);
  font: inherit;
}
textarea { min-height: 110px; resize: vertical; }
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.lista { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.item-texto { display: grid; gap: 2px; min-width: 0; }
.item-texto small { color: var(--muted); }
.item-acciones { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  display: inline-block;
  font-size: .8rem;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.chip.aprobado { color: var(--ok); border-color: var(--ok); }
.chip.pendiente { color: var(--accent); border-color: var(--accent); }
.chip.rechazado { color: var(--error); border-color: var(--error); }
.item-acciones .chip { align-self: center; }

.cv { white-space: pre-line; color: var(--text); }
.small { font-size: .9rem; }
h2 { font-size: 1.1rem; margin: 22px 0 4px; }

/* ---------- Landing ---------- */

.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand img { border-radius: 6px; }

.seccion { padding: 44px 0; border-top: 1px solid var(--border); }
.seccion:first-child { border-top: 0; }
.seccion h2 { font-size: clamp(1.35rem, 3.2vw, 1.9rem); line-height: 1.25; margin: 0 0 14px; }

.heroe { padding: 56px 0 36px; }
.heroe h1 {
  font-size: clamp(2rem, 6vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -.02em;
  margin: 0 0 16px;
}
.lead { font-size: clamp(1.05rem, 2.4vw, 1.2rem); color: var(--text); max-width: 60ch; margin: 0; }
.lead-sm { color: var(--muted); max-width: 56ch; margin: 0 0 18px; }
.eyebrow {
  color: var(--accent);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.beneficio {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.beneficio h3 { font-size: 1.05rem; margin: 10px 0 6px; }
.beneficio p { margin: 0; color: var(--muted); font-size: .95rem; }
.beneficio-icono { font-size: 1.6rem; line-height: 1; }

.dos-col { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.dos-col.invertido > :first-child { order: 2; }

.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.checks li {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: start;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.check-ico { color: var(--accent); font-weight: 700; }
.checks li:has(.chip) { color: var(--muted); }

.chip.prox { color: var(--muted); border-style: dashed; font-size: .75rem; align-self: center; }
h3 .chip.prox { margin-left: 8px; }

.pasos { list-style: none; counter-reset: paso; padding: 0; margin: 0; display: grid; gap: 12px; }
.paso {
  counter-increment: paso;
  position: relative;
  padding: 16px 16px 16px 60px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.paso::before {
  content: counter(paso);
  position: absolute;
  left: 16px;
  top: 16px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  display: grid;
  place-items: center;
}
.paso p { margin: 4px 0 0; color: var(--muted); font-size: .95rem; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.tab {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-size: .95rem;
}
.tab:hover { border-color: var(--accent); }
.tab.activo { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }

.faq { display: grid; gap: 10px; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.faq summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.faq details p { margin: 8px 0 0; color: var(--muted); }

.cta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
}
.cta h2 { margin-top: 0; }
.cta p { color: var(--muted); }
.centrado { justify-content: center; }

.heroe .acciones .btn, .heroe .acciones .btn-ghost,
.seccion .btn { min-width: 0; }

@media (max-width: 760px) {
  .grid3, .dos-col { grid-template-columns: 1fr; gap: 20px; }
  .dos-col.invertido > :first-child { order: 0; }
  .seccion { padding: 32px 0; }
  .heroe { padding: 36px 0 24px; }
  .acciones .btn, .acciones .btn-ghost { flex: 1 1 100%; }
  .tabs .tab { flex: 1 1 auto; justify-content: center; }
  .topbar { padding: 10px 12px; }
  .nav a, .linkbtn { padding: 8px 6px; }
}

@media (prefers-reduced-motion: no-preference) {
  .beneficio, .checks li, .paso { transition: border-color .2s ease; }
  .beneficio:hover { border-color: var(--accent); }
}

/* Landing con el diseño de Suplencias: sol, azul y turquesa */
main.container:has(.portada) { max-width: 1120px; }

.seccion { border-top: 0; padding: clamp(56px, 8vw, 96px) 0; }
.seccion.banda-escuelas, .seccion.banda-docentes { padding: clamp(40px, 6vw, 72px) clamp(22px, 5vw, 56px); border-radius: 32px; }
/* Margen de cada banda = separación de secciones menos su propio padding, así el texto queda a la misma distancia */
.seccion.banda-escuelas, .seccion.banda-docentes { margin: calc(clamp(56px, 8vw, 96px) - clamp(40px, 6vw, 72px)) 0; }
.seccion.banda-escuelas { background: linear-gradient(135deg, #ffe08a 0%, #ffd166 100%); color: #1d3557; }
.seccion.banda-escuelas .lead-sm { color: #1d3557; }
.seccion.banda-docentes { background: linear-gradient(135deg, #1f8a9e 0%, #2a9d8f 100%); color: #ffffff; }
.seccion.banda-docentes h2, .seccion.banda-docentes .lead-sm, .seccion.banda-docentes .lista-check li { color: #ffffff; }

.encabezado-seccion { max-width: 640px; }
.centrado-texto { text-align: center; margin-left: auto; margin-right: auto; }
.centrado-texto .lead-sm { margin-left: auto; margin-right: auto; }

/* Portada */
.portada {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 40px;
  align-items: center;
  margin-top: 16px;
  padding: clamp(32px, 6vw, 64px) clamp(22px, 5vw, 56px);
  border-radius: 32px;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 183, 3, .25), transparent 40%),
    radial-gradient(circle at 88% 12%, rgba(33, 158, 188, .22), transparent 42%),
    var(--surface);
}
.portada h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); font-weight: 800; line-height: 1.12; letter-spacing: -.02em; margin: 0 0 16px; }
.portada .lead { font-size: 1.15rem; color: var(--muted); max-width: 34em; margin-bottom: 26px; }
.portada .acciones { margin: 0 0 16px; }
.etiqueta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: .9rem;
  font-weight: 700;
  color: var(--ok);
  margin-bottom: 18px;
}
.etiqueta::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.portada-ilustracion svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 20px 30px rgba(29, 53, 87, .15)); }

/* Botones */
.btn { min-height: 48px; padding: 0 24px; border-radius: 999px; }
.btn:hover { transform: translateY(-1px); }
.btn-sol { background: #ffb703; border-color: #ffb703; color: #1d3557; box-shadow: 0 8px 20px rgba(255, 183, 3, .35); }

/* Valores */
.valores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 40px; }
.valor {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 12px 30px rgba(29, 53, 87, .10);
}
.valor h3 { margin: 0 0 8px; }
.valor p { margin: 0; color: var(--muted); }
.icono-circulo { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 18px; }
.tono-sol { background: #ffe8c2; }
.tono-turq { background: #d6f0f6; }
.tono-verde { background: #d4f1ec; }

/* Bandas */
.banda { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.tarjeta-ilustrada {
  background: rgba(255, 255, 255, .55);
  border-radius: 28px;
  padding: 22px;
  box-shadow: 0 18px 40px rgba(29, 53, 87, .15);
}
.banda-docentes .tarjeta-ilustrada { background: rgba(255, 255, 255, .14); }
.tarjeta-ilustrada svg { width: 100%; height: auto; display: block; }

.lista-check { list-style: none; padding: 0; margin: 22px 0 30px; display: grid; gap: 14px; }
.lista-check li { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; }
.check {
  flex: 0 0 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  display: grid;
  place-items: center;
  font-size: .8rem;
  margin-top: 2px;
}
.banda-escuelas .check { background: #1d3557; color: #ffffff; }
.banda-docentes .check { background: #ffffff; color: #2a9d8f; }
.check.pendiente { background: transparent; border: 2px dashed var(--muted); color: var(--muted); }

/* Pasos */
.pasos { list-style: none; padding: 0; margin: 44px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.paso {
  position: relative;
  padding: 30px 26px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(29, 53, 87, .10);
}
.paso::before { content: none; }
.paso .numero {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.3rem;
  margin-bottom: 18px;
  background: #ffb703;
  color: #1d3557;
}
.paso:nth-child(2) .numero { background: #219ebc; color: #ffffff; }
.paso:nth-child(3) .numero { background: #2a9d8f; color: #ffffff; }
.paso h3 { margin: 0 0 8px; }
.paso p { margin: 0; color: var(--muted); }

/* Preguntas */
#preguntas .faq { max-width: 760px; margin: 36px auto 0; }

/* Llamado final */
.llamado {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  padding: clamp(40px, 6vw, 70px) clamp(22px, 5vw, 56px);
  background-color: #1d3557;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(255, 183, 3, .35), transparent 35%),
    radial-gradient(circle at 85% 80%, rgba(33, 158, 188, .45), transparent 40%);
  color: #ffffff;
  text-align: center;
}
.llamado h2 { color: #ffffff; max-width: 18em; margin: 0 auto 14px; }
.llamado p { color: #dfe8f5; font-size: 1.1rem; max-width: 36em; margin: 0 auto 28px; }
.llamado .btn-ghost { color: #ffffff; border-color: rgba(255, 255, 255, .7); background: rgba(255, 255, 255, .08); }
.llamado .acciones { justify-content: center; }

@media (max-width: 900px) {
  .portada, .banda { grid-template-columns: 1fr; }
  .valores, .pasos { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .portada, .seccion.banda-escuelas, .seccion.banda-docentes { border-radius: 24px; }
}

/* Búsqueda de docentes y registro con ubicación */
.filtros {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.filtros .acciones { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; }
.docentes-lista { display: grid; gap: 12px; margin-top: 16px; }
.docente-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 14px;
  padding: 16px;
}
.docente-card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.docente-card .niveles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* Campo de contraseña con botón para mostrar u ocultar */
.con-ver { position: relative; }
.con-ver input { padding-right: 46px; width: 100%; }
.ver-clave {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.ver-clave:hover, .ver-clave:focus-visible { color: var(--accent); }

/* Selector de niveles como chips */
.niveles-grupo { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.niveles-grupo legend { font-weight: 600; font-size: .95rem; padding: 0; margin-bottom: 8px; }
.niveles-opciones { display: flex; flex-wrap: wrap; gap: 8px; }
.nivel-chip { position: relative; cursor: pointer; }
.nivel-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.nivel-chip span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  transition: background .15s ease, border-color .15s ease;
}
.nivel-chip:hover span { border-color: var(--accent); }
.nivel-chip input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}
.nivel-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Panel con menú lateral */
main.container:has(.app-shell) { max-width: 1200px; padding: 0; }
body.panel-activo main#app { max-width: none; width: 100%; margin: 0; padding: 0; }
.app-shell { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 110px); }
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100%;
}
.side-titulo { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 12px 8px; }
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.side-link:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.side-link.activo { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.panel-main { padding: 24px; display: grid; gap: 16px; align-content: start; min-width: 0; }
.panel-main h1 { margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: 14px;
  padding: 18px;
}
.kpi-titulo { color: var(--muted); font-size: .9rem; }
.kpi-valor { font-size: 2rem; font-weight: 700; line-height: 1.1; margin-top: 6px; }
.kpi-nota { margin-top: 4px; }
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 8px;
    height: auto;
  }
  .side-titulo { display: none; }
  .side-link { white-space: nowrap; }
  .panel-main { padding: 16px; }
}

/* Botón de tema con icono y enlaces del héroe sobre color */
.tema-btn { width: 44px; padding: 0; display: grid; place-items: center; }
.heroe.colorido .muted a { color: #ffffff; font-weight: 600; text-decoration: underline; }
.side-link.salir { margin-top: auto; background: transparent; border: 0; cursor: pointer; font: inherit; text-align: left; color: var(--muted); }
.side-link.salir:hover { color: var(--error); }

/* Panel de administración: encabezado azul, menú oscuro y tarjetas de resumen */
body.panel-activo .topbar { background: #1d3557; color: #ffffff; border-bottom: 0; }
body.panel-activo .topbar .brand { color: #ffffff; }
body.panel-activo .topbar .btn-ghost { color: #ffffff; border-color: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .08); }

.sidebar { background: #152a45; border-right: 0; color: #d6deea; padding: 0 0 16px; gap: 0; }
.side-usuario {
  background: linear-gradient(160deg, #22395a 0%, #0f1f36 100%);
  color: #ffffff;
  padding: 26px 16px 18px;
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}
.side-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #ffb703;
  color: #1d3557;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  font-weight: 700;
  border: 3px solid rgba(255, 255, 255, .6);
  margin-bottom: 6px;
}
.side-usuario-nombre { font-weight: 600; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; max-width: 100%; }
.side-usuario-rol { font-size: .8rem; color: #a9b6c9; }
.side-acciones { display: flex; gap: 14px; margin-top: 8px; }
.side-acciones a, .side-acciones button {
  background: transparent;
  border: 0;
  color: #d6deea;
  cursor: pointer;
  font-size: 1rem;
  text-decoration: none;
  padding: 4px;
}
.side-acciones a:hover, .side-acciones button:hover { color: #ffffff; }
.side-titulo {
  background: #22395a;
  color: #8aa4af;
  margin: 0;
  padding: 10px 16px;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.sidebar .side-link { margin: 0; padding: 12px 16px; border-radius: 0; color: #d6deea; font-weight: 400; }
.sidebar .side-link:hover { background: #22395a; color: #ffffff; }
.sidebar .side-link.activo { background: #ffb703; color: #1d3557; font-weight: 600; }
/* Cerrar sesión al final del menú, debajo de Mi perfil */
.sidebar .side-link.salir { display: flex; margin-top: auto; color: #d6deea; }
.sidebar .side-link.salir:hover { color: #ffffff; background: #e63946; }

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 18px;
  color: var(--text);
}
.kpi-cabecera { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kpi-titulo { color: var(--muted); font-size: .95rem; }
.kpi-icono {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--k);
  color: #ffffff;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.kpi-valor { font-size: 2.1rem; font-weight: 700; color: var(--k); margin-top: 8px; line-height: 1.1; }
.kpi-nota { margin-top: 10px; font-size: .85rem; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.kpi-azul { --k: #1d3557; }
.kpi-teal { --k: #2a9d8f; }
.kpi-rojo { --k: #e63946; }
.kpi-naranja { --k: #fb8500; }

/* Tema oscuro: tarjetas de color sólido */
:root[data-theme="dark"] .kpi,
:root[data-theme="dark"] .kpi-titulo,
:root[data-theme="dark"] .kpi-valor,
:root[data-theme="dark"] .kpi-nota { color: #ffffff; }
:root[data-theme="dark"] .kpi { background: var(--k); border: 0; }
:root[data-theme="dark"] .kpi-titulo, :root[data-theme="dark"] .kpi-nota { color: rgba(255, 255, 255, .88); }
:root[data-theme="dark"] .kpi-icono { background: rgba(255, 255, 255, .22); }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .kpi,
  :root[data-theme="auto"] .kpi-valor { color: #ffffff; }
  :root[data-theme="auto"] .kpi { background: var(--k); border: 0; }
  :root[data-theme="auto"] .kpi-titulo, :root[data-theme="auto"] .kpi-nota { color: rgba(255, 255, 255, .88); }
  :root[data-theme="auto"] .kpi-icono { background: rgba(255, 255, 255, .22); }
}

@media (max-width: 760px) {
  .side-usuario { display: none; }
  .sidebar .side-link { padding: 12px 14px; }
}

/* Escritorio: el menú lateral ocupa todo el alto de la pantalla y queda fijo al hacer scroll */
@media (min-width: 761px) {
  body.panel-activo { position: relative; }
  body.panel-activo .app-shell { min-height: calc(100vh - 64px); }
  body.panel-activo .sidebar { position: sticky; top: 64px; height: calc(100vh - 64px); align-self: start; overflow-y: auto; }
  /* El footer ocupa el resto de la columna de contenido; el contenido deja espacio para no quedar tapado */
  body.panel-activo .panel-main { padding-bottom: 80px; }
  body.panel-activo .footer { position: absolute; left: 240px; right: 0; bottom: 0; height: 48px; display: flex; align-items: center; justify-content: center; padding: 0 16px; margin: 0; box-sizing: border-box; background: var(--surface); border-top: 1px solid var(--border); }
}

/* Encabezado del panel fijo y por encima del contenido: el scroll no pasa por encima de él */
body.panel-activo .topbar { position: sticky; top: 0; z-index: 500; height: 64px; box-sizing: border-box; padding: 0 16px; }

/* Toasts: avisos breves abajo a la derecha */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 650; display: grid; gap: 8px; max-width: min(360px, calc(100vw - 32px)); }
.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-left: 4px solid #2a9d8f;
  border-radius: 6px;
  padding: 12px 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
}
.toast-info { border-left-color: #1d3557; }
.toast-error { border-left-color: #e63946; }
.toast-cerrar { background: transparent; border: 0; color: inherit; font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 4px; }

/* Esqueleto de carga: se muestra hasta que la sesión y la vista están listas */
.esqueleto { display: grid; gap: 16px; padding: 24px 0; }
.esq-tarjeta { display: grid; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 20px; }
.esq-bloque {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--border) 25%, var(--surface) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: esq-brillo 1.2s linear infinite;
}
.esq-titulo { height: 28px; width: 40%; }
.esq-corto { width: 60%; }
@keyframes esq-brillo { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .esq-bloque { animation: none; } }

/* Esqueletos por tipo de vista */
.esq-pagina { display: grid; gap: 16px; padding: 24px 0; }
.esq-input { height: 42px; border-radius: 8px; }
.esq-boton { height: 40px; width: 140px; border-radius: 8px; }
.esq-medio { width: 50%; }
.esq-hero { display: grid; gap: 14px; padding: 40px 24px; border-radius: 12px; background: linear-gradient(135deg, #1d3557 0%, #219ebc 100%); }
.esq-hero .esq-bloque {
  background: linear-gradient(90deg, rgba(255, 255, 255, .25) 25%, rgba(255, 255, 255, .5) 50%, rgba(255, 255, 255, .25) 75%);
  background-size: 200% 100%;
}
.esq-hero .esq-titulo { height: 32px; }
.esq-botones { display: flex; gap: 12px; }
.esq-botones .esq-boton { background: rgba(255, 255, 255, .45); }
.esq-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.esq-panel { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 64px); }
.esq-sidebar { background: #152a45; padding-bottom: 16px; display: grid; align-content: start; gap: 10px; }
.esq-usuario { display: grid; justify-items: center; gap: 8px; padding: 26px 16px 18px; background: #0f1f36; }
.esq-sidebar .esq-bloque { background: linear-gradient(90deg, #22395a 25%, #2b4670 50%, #22395a 75%); background-size: 200% 100%; }
.esq-avatar { width: 64px; height: 64px; border-radius: 50%; }
.esq-item { height: 18px; margin: 0 16px; }
.esq-principal { display: grid; align-content: start; gap: 16px; padding: 24px; min-width: 0; }
.esq-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
@media (max-width: 760px) {
  .esq-panel { grid-template-columns: 1fr; }
  .esq-sidebar { display: none; }
  .esq-grid3 { grid-template-columns: 1fr; }
}

/* Calendario, ficha del docente y propuestas */
.calendario { display: grid; gap: 10px; width: 100%; max-width: none; }
.cal-cabecera { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-titulo { font-size: 1.05rem; }
.cal-nav { padding: 4px 12px; font-size: 1.2rem; line-height: 1; }
.cal-controles { display: flex; align-items: center; gap: 6px; }
.cal-cuerpo { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cab { text-align: center; font-size: .75rem; color: var(--muted); padding: 4px 0; }
.cal-dia {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: .9rem;
}
.cal-dia:disabled { color: var(--muted); background: transparent; cursor: default; }
.cal-dia.disponible { border-color: #2a9d8f; background: rgba(42, 157, 143, .14); font-weight: 600; }
.cal-dia.hoy { outline: 2px solid #1d3557; outline-offset: -2px; }
.cal-dia.elegido { background: #1d3557; border-color: #1d3557; color: #ffffff; }
.dia-detalle { display: grid; gap: 12px; margin-top: 16px; }
.rangos { margin: 0; padding-left: 18px; }
.rangos li { margin: 4px 0; }
.niveles-lista { display: flex; flex-wrap: wrap; gap: 6px; }
.nivel-tag { border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; font-size: .85rem; }
.ficha-texto { white-space: pre-line; }
.propuesta { border-top: 1px solid var(--border); padding-top: 12px; display: grid; gap: 8px; }
.cta-propuesta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cta-propuesta p { flex-basis: 100%; margin: 0; }
.cal-dia.ocupado { border-color: #e63946; background: rgba(230, 57, 70, .14); }

/* Agenda grande del docente */
.agenda-cabecera { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.agenda-titulo { font-size: 1.15rem; }
.agenda-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.agenda-cab { text-align: center; font-size: .8rem; color: var(--muted); padding: 4px 0; }
.agenda-grid { touch-action: none; user-select: none; }
.agenda-dia {
  min-height: 110px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 6px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  overflow: hidden;
}
.agenda-dia.pasado { color: var(--muted); cursor: default; }
.agenda-dia.hoy .agenda-num { color: #1d3557; font-weight: 700; }
.agenda-dia.sel { outline: 2px solid #1d3557; outline-offset: -2px; background: rgba(33, 158, 188, .12); }
.agenda-num { font-size: .9rem; }
.agenda-barra { font-size: .72rem; border-radius: 4px; padding: 2px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-barra.libre { background: rgba(42, 157, 143, .22); border-left: 3px solid #20a35e; }
.agenda-barra.ocupado { background: rgba(128, 128, 128, .30); border-left: 3px solid #808080; }
.agenda-barra.clicable { cursor: pointer; }
.agenda-mas { font-size: .7rem; color: var(--muted); }
@media (max-width: 760px) {
  .agenda-dia { min-height: 64px; padding: 4px; }
  .agenda-barra { font-size: 0; height: 6px; padding: 0; border-left: none; border-radius: 3px; }
  .agenda-mas { display: none; }
}

/* Modal (cargar horario) */
.modal-fondo { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 600; }
.modal { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 20px; width: min(440px, 100%); max-height: 90vh; overflow: auto; }
.modal-cabecera { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.modal-cabecera h2 { margin: 0; font-size: 1.1rem; }
.modal .form { margin-top: 12px; }
.modal .field[hidden] { display: none; }
.modal-pie { display: flex; justify-content: flex-end; margin-top: 12px; }
.peligro { color: #e63946; }
/* Tipo de horario: dos botones lado a lado, uno marcado a la vez */
.segmentado { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.segmentado button { flex: 1; padding: 9px 10px; border: 0; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.segmentado button + button { border-left: 1px solid var(--border); }
.segmentado .seg-disponible[aria-pressed="true"] { background: #20a35e; color: #fff; }
.segmentado .seg-ocupado[aria-pressed="true"] { background: #808080; color: #fff; }
/* Dos campos en una misma fila (fechas y horas de los modales de horario) */
.fila-dos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fila-dos[hidden] { display: none; }
/* Modal compacto: menos padding, separaciones y ancho */
.modal { width: min(380px, 100%); padding: 14px; }
.modal-cabecera h2 { font-size: 1rem; }
.modal .form { margin-top: 8px; gap: 8px; }
.modal .field { gap: 3px; }
.modal .field label { font-size: .85rem; }
.modal .field input, .modal .field select { padding: 6px 8px; }
.modal .fila-dos { gap: 8px; }
.modal .segmentado button { padding: 6px 8px; font-size: .9rem; }
.modal .btn { padding: 8px 12px; }
.modal-pie { margin-top: 8px; }
.modal-pie { gap: 8px; }
.modal-pie > * { flex: 1; text-align: center; }
.btn-peligro { background: #e63946; color: #fff; border-color: #e63946; }
/* Número del día y botón de detalle (ojo) */
.agenda-cab-dia { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.agenda-ojo { background: none; border: 0; padding: 0 2px; font-size: .9rem; line-height: 1; cursor: pointer; }
/* Detalle del día en el modal */
.horario-fila { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.horario-hora { flex: 1; }
.tipo-tag { font-size: .75rem; border-radius: 999px; padding: 2px 8px; }
.tipo-tag.disponible { background: rgba(42, 157, 143, .22); }
.tipo-tag.ocupado { background: rgba(128, 128, 128, .30); }
@media (max-width: 760px) { .agenda-ojo { font-size: .75rem; } }
/* Línea de tiempo del día (detalle del ojo) */
.linea-dia { position: relative; margin-top: 8px; }
.hora-fila { position: relative; box-sizing: border-box; }
/* La línea de cada hora arranca después de la columna de etiquetas: nunca pasa por detrás del texto */
.hora-fila::before { content: ""; position: absolute; left: 52px; right: 0; top: 0; border-top: 1px solid var(--border); }
.hora-etiqueta { position: absolute; left: 0; top: -8px; width: 44px; font-size: .7rem; color: var(--muted); }
.bloque { position: absolute; left: 52px; right: 0; box-sizing: border-box; display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; padding: 2px 6px; border-radius: 6px; font-size: .8rem; overflow: hidden; }
.bloque.disponible { background: rgba(42, 157, 143, .28); border-left: 3px solid #20a35e; }
.bloque.ocupado { background: rgba(128, 128, 128, .35); border-left: 3px solid #808080; }
.bloque.libre-fondo { background: rgba(42, 157, 143, .10); border: 1px dashed #20a35e; }
.bloque-texto { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Selección de un rango sobre la línea de tiempo del día */
.linea-dia { touch-action: none; user-select: none; }
.seleccion { position: absolute; left: 52px; right: 0; box-sizing: border-box; background: rgba(33, 158, 188, .35); border: 2px solid #1d3557; border-radius: 6px; pointer-events: none; padding: 0 6px; font-size: .75rem; font-weight: 600; line-height: 1.2; color: var(--text); white-space: nowrap; overflow: hidden; }
.seleccion[hidden] { display: none; }
.accion-rango { display: grid; gap: 8px; margin-top: 10px; font-size: .9rem; }
.accion-botones { display: flex; gap: 8px; }
.accion-botones > * { flex: 1; }
.btn-verde { background: #20a35e; color: #fff; border-color: #20a35e; }
.btn-gris { background: #808080; color: #fff; border-color: #808080; }
/* Botones de la selección del detalle del día: flotan sobre el rango elegido */
.accion-flotante { position: absolute; left: 52px; right: 0; z-index: 5; display: flex; align-items: center; padding: 0 6px; box-sizing: border-box; font-size: .85rem; }
.accion-flotante[hidden] { display: none; }
.accion-flotante .accion-botones { flex: 1; display: flex; gap: 6px; }
.accion-flotante .accion-botones button { flex: 1; padding: 4px 6px; font-size: .8rem; }
.accion-flotante .btn-ghost { background: var(--surface); }
.quitar-zona { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

/* Advertencia roja grande al quitar un horario con suplencias pendientes */
.aviso-rojo-grande {
  display: block;
  margin: 6px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #c62828;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}
.propuestas-institucion { margin-top: 16px; }
.perfil { display: grid; gap: 16px; }
.perfil h2 { font-size: 1.1rem; margin: 0 0 8px; }
.perfil-cabecera { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.perfil-cabecera h1 { margin: 0; }
.perfil-avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; font-size: 1.5rem; font-weight: 700; flex-shrink: 0; }
.perfil-datos { color: var(--muted); margin: 4px 0 0; }
.perfil-niveles { margin-top: 14px; }
.propuesta-fila { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; }
.propuesta-texto { flex: 1; }
/* Quitar un horario desde el bloque: una X roja que aparece al pasar el mouse */
.quitar-x { background: none; border: 0; padding: 0 2px; color: #d93025; font-size: 1.15rem; font-weight: 700; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s; }
.bloque:hover .quitar-x, .bloque:focus-within .quitar-x { opacity: 1; }
.quitar-x:hover { color: #b3261e; }
/* Estirar un horario desde su borde superior o inferior (sin superponerse con otros) */
.asa-bloque { position: absolute; left: 50%; width: 40px; height: 6px; margin-left: -20px; border-radius: 3px; background: rgba(255, 255, 255, .9); box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); cursor: ns-resize; touch-action: none; }
.asa-bloque:hover { background: #ffffff; box-shadow: 0 0 0 2px rgba(33, 158, 188, .9); }
.asa-arriba { top: 2px; }
.asa-abajo { bottom: 2px; }
/* Horario no disponible en la línea de tiempo de la institución: gris, no seleccionable */
.bloque.deshabilitado { background: rgba(128, 128, 128, .35); border-left: 3px solid #808080; }
/* Propuestas de instituciones en la línea de tiempo del docente: mitad derecha, con su estado */
/* Color sólido mezclado con la superficie: opaco para que las líneas de hora no se vean, y distinto del fondo de los inputs */
.bloque.propuesta { left: 50%; border: 1px dashed #d19225; background: color-mix(in srgb, #ffb703 42%, var(--surface)); }
.bloque.propuesta.aceptada { border: 1px solid #1d3557; background: color-mix(in srgb, #219ebc 42%, var(--surface)); }
/* Menú Suplencias del docente: pestañas, tablas y acciones */
.suplencias-cuerpo h2 { margin: 18px 0 8px; font-size: 1.05rem; }
.suplencias-cuerpo > h2:first-of-type { margin-top: 0; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 10px; background: rgba(128, 128, 128, .15); margin-bottom: 14px; flex-wrap: wrap; }
.tabs .btn, .tabs .btn-ghost { border-radius: 8px; }
.tabla-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 8px; }
.tabla-suplencias { width: 100%; min-width: 480px; border-collapse: collapse; font-size: .9rem; }
.tabla-suplencias th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; text-align: left; padding: 8px 10px; border-bottom: 2px solid rgba(128, 128, 128, .25); white-space: nowrap; opacity: .75; }
.tabla-suplencias td { padding: 10px; border-bottom: 1px solid rgba(128, 128, 128, .2); text-align: left; vertical-align: middle; }
.tabla-suplencias td:first-child { font-weight: 600; }
.tabla-suplencias td:nth-child(2), .tabla-suplencias td:nth-child(3) { white-space: nowrap; }
.tabla-suplencias tbody tr:hover { background: rgba(128, 128, 128, .08); }
.tabla-suplencias th:last-child { text-align: right; }
.acciones-tabla { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.suplencias-vacio { padding: 12px 0; }
.bloque.propuesta { cursor: pointer; }
/* Panel del docente: el calendario de Disponibilidad ocupa todo el ancho disponible */
body.panel-activo .container { max-width: none; }
body.panel-activo .panel-main,
body.panel-activo .panel-main > .card { width: 100%; max-width: none; box-sizing: border-box; min-width: 0; }
body.panel-activo .agenda-grid { width: 100%; }
/* Espacio entre las tarjetas de Suplencias */
.suplencias-cuerpo { display: grid; gap: 16px; }
.suplencias-cuerpo .tabs { margin-bottom: 0; }

/* Campanita de notificaciones (barra superior) */
.campanita { position: relative; }
.campanita-btn { position: relative; }
.campanita-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 999px; background: #e63946; color: #ffffff; font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center; }
.campanita-badge[hidden] { display: none; }
.campanita-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(360px, calc(100vw - 24px)); max-height: 60vh; overflow: auto; box-sizing: border-box; padding: 10px; display: grid; gap: 8px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .18); z-index: 70; text-align: left; }
.campanita-panel[hidden] { display: none; }
.menu-wrap { position: relative; }
.menu-wrap[hidden] { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 160px; display: grid; gap: 2px; padding: 6px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .18); z-index: 70; }
.menu-panel[hidden] { display: none; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.menu-item:hover { background: rgba(128, 128, 128, .12); }
.menu-item[hidden] { display: none; }
body.panel-activo .topbar .campanita-panel .btn-ghost { color: var(--text); border-color: var(--border); background: transparent; }
.campanita-cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.campanita-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.campanita-item { display: grid; gap: 4px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; font-size: .9rem; }
.campanita-item small { color: var(--muted); }
.notif-acciones { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* Notificación sin leer: borde y fondo celeste */
.notif-no-leida { border-left: 3px solid #1d3557; background: rgba(33, 158, 188, .08); }
.notif-cab { display: flex; justify-content: flex-end; margin-bottom: 4px; }

/* Chat entre docente e institución vinculados */
.chat-layout { display: grid; grid-template-columns: minmax(180px, 240px) 1fr; gap: 16px; }
@media (max-width: 760px) { .chat-layout { grid-template-columns: 1fr; } }
.chat-contactos { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.chat-contacto { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.chat-contacto.activo { border-color: #1d3557; background: rgba(33, 158, 188, .12); }
.chat-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #e63946; color: #ffffff; font-size: .75rem; font-weight: 700; line-height: 20px; text-align: center; }
.chat-panel { display: grid; gap: 10px; min-width: 0; }
.chat-cabecera { font-size: 1.05rem; }
.chat-hilo { display: flex; flex-direction: column; gap: 8px; height: 50vh; min-height: 240px; overflow-y: auto; padding: 8px; border: 1px solid var(--border); border-radius: 10px; }
.chat-msg { max-width: 80%; display: grid; gap: 2px; padding: 8px 10px; border-radius: 12px; word-break: break-word; background: rgba(128, 128, 128, .14); color: var(--text); }
.chat-msg.propio { align-self: flex-end; background: #1d3557; color: #ffffff; }
.chat-msg.otro { align-self: flex-start; }
.chat-msg small { color: var(--muted); font-size: .72rem; }
.chat-msg.propio small { color: rgba(255, 255, 255, .8); }
.chat-texto { white-space: pre-wrap; }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: stretch; margin-top: -4px; }
.chat-acciones { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; }
.chat-acciones > * { width: 100%; box-sizing: border-box; }
.chat-entrada { flex: 1; min-width: 0; resize: vertical; font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.chat-buscar { width: 100%; box-sizing: border-box; margin-bottom: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.chat-badge[hidden] { display: none; }
.side-badge { margin-left: auto; }
/* Emojis del chat */
.chat-emoji-wrap { position: relative; }
.chat-emoji-boton { font-size: 1.1rem; }
.chat-emojis { position: absolute; bottom: calc(100% + 6px); right: 0; z-index: 5; width: 260px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 8px; box-sizing: border-box; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.chat-emojis[hidden] { display: none; }
.chat-emoji { background: transparent; border: 0; border-radius: 6px; padding: 4px 0; font-size: 1.25rem; line-height: 1; cursor: pointer; }
.chat-emoji:hover, .chat-emoji:focus-visible { background: rgba(33, 158, 188, .18); outline: none; }

/* Registro de docentes e instituciones: cabecera con color por rol y tarjeta con acento */
.registro-cabecera {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 28px;
  align-items: center;
  margin: 8px 0 22px;
  padding: clamp(28px, 5vw, 44px);
  border-radius: 28px;
  box-shadow: 0 18px 40px rgba(29, 53, 87, .18);
}
.registro-cabecera h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); font-weight: 800; line-height: 1.15; margin: 0 0 10px; }
.registro-cabecera .lead-sm { margin: 0; max-width: 40ch; }
.registro-cabecera .etiqueta { background: rgba(255, 255, 255, .78); color: #1d3557; border-color: transparent; margin-bottom: 14px; }
.registro-cabecera .etiqueta::before { background: #2a9d8f; }
.registro-docente { background: linear-gradient(135deg, #1f8a9e 0%, #2a9d8f 100%); color: #ffffff; }
.registro-docente h1 { color: #ffffff; }
.registro-docente .lead-sm { color: #e6f7f4; }
.registro-institucion { background: linear-gradient(135deg, #ffe08a 0%, #ffd166 100%); color: #1d3557; }
.registro-institucion h1 { color: #1d3557; }
.registro-institucion .lead-sm { color: #1d3557; }
.registro-ilustracion svg { width: 100%; height: auto; display: block; }
.registro-tarjeta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 6px solid #2a9d8f;
  border-radius: var(--radius);
  padding: clamp(20px, 4vw, 32px);
  box-shadow: 0 12px 30px rgba(29, 53, 87, .10);
}
.registro-institucion ~ .registro-tarjeta { border-top-color: #ffb703; }
.estado-lista { list-style: none; padding: 0; margin: 12px 0 22px; display: grid; gap: 12px; }
.estado-paso { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--campo); border: 1px solid var(--border); }
.estado-paso > div { display: grid; gap: 2px; }
.estado-icono { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #ffffff; background: var(--ok); }
.estado-paso.pendiente { border-color: #ffb703; }
.estado-paso.pendiente .estado-icono { background: #ffb703; color: #1d3557; }
.estado-paso.espera { opacity: .75; }
.estado-paso.espera .estado-icono { background: transparent; color: var(--muted); border: 2px dashed var(--muted); }
@media (max-width: 760px) {
  .registro-cabecera { grid-template-columns: 1fr; }
  .registro-ilustracion { max-width: 300px; }
}

/* Ingreso: cabecera del selector de rol y acentos por rol en las tarjetas */
.ingreso-cabecera { background: linear-gradient(135deg, #1d3557 0%, #219ebc 100%); color: #ffffff; }
.ingreso-cabecera h1 { color: #ffffff; }
.ingreso-cabecera .lead-sm { color: #e0eef6; }
.ingreso-cabecera .etiqueta { background: rgba(255, 255, 255, .85); color: #1d3557; border-color: transparent; }
.ingreso-docente { border-top-color: #2a9d8f; }
.ingreso-institucion { border-top-color: #ffb703; }
.dos-col .registro-tarjeta h2 { margin-top: 0; }

/* Modales con línea de tiempo: el encabezado queda fijo y solo se desplaza la línea de tiempo */
.modal:has(.linea-scroll) { display: flex; flex-direction: column; overflow: hidden; }
.modal:has(.linea-scroll) .modal-cabecera { flex: 0 0 auto; }
.modal:has(.linea-scroll) div:has(.linea-scroll) { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.linea-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }

/* Footer: propiedad y contacto a la izquierda, versión a la derecha */
.footer-linea { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; width: 100%; max-width: 1120px; margin: 0 auto; }
.footer-version { margin-left: auto; }
.footer-enlace { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Perfil público: cabecera de color con avatar, ubicación, niveles e ilustración */
.perfil-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: clamp(24px, 4vw, 36px); border-radius: 28px; box-shadow: 0 18px 40px rgba(29, 53, 87, .18); }
.perfil-hero-id { display: flex; align-items: center; gap: 18px; min-width: 0; }
.perfil-hero-avatar { width: 88px; height: 88px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 2rem; font-weight: 800; color: #1d3557; background: #ffffff; border: 4px solid rgba(255, 255, 255, .5); }
.perfil-hero h1 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); font-weight: 800; line-height: 1.15; margin: 0 0 6px; overflow-wrap: anywhere; }
.perfil-hero .lead-sm { margin: 0 0 10px; overflow-wrap: anywhere; }
.perfil-hero .etiqueta { background: rgba(255, 255, 255, .85); color: #1d3557; border-color: transparent; margin-bottom: 10px; }
.perfil-hero .etiqueta::before { background: #2a9d8f; }
.perfil-hero .nivel-tag { background: rgba(255, 255, 255, .85); color: #1d3557; border-color: transparent; }
.perfil-hero-ilustracion { width: min(230px, 100%); }
.perfil-hero-ilustracion svg { width: 100%; height: auto; display: block; }
.perfil .registro-tarjeta { margin: 0; }

/* Perfil público: el footer queda siempre al pie de la pantalla y tiene fondo propio, distinto del sitio */
body.ficha-activa { display: flex; flex-direction: column; min-height: 100vh; }
body.ficha-activa main#app { flex: 1 0 auto; width: 100%; }
body.ficha-activa .footer { margin-top: auto; background: color-mix(in srgb, #2a9d8f 22%, var(--surface)); border-top: 1px solid color-mix(in srgb, #2a9d8f 45%, var(--border)); }
