/* ══════════════════════════════════════════════════════════
   PALETA SISTEMA — tonos morado/violeta del logo EduPlanner
   Independiente de los colores de módulos educativos
   ══════════════════════════════════════════════════════════ */
:root {
  --sys-100: #f3effe;   /* fondo muy claro lavanda */
  --sys-200: #e0d4f7;   /* borde / pale */
  --sys-300: #c2a9ef;   /* acento claro */
  --sys-400: #9e7dd6;   /* acento principal (logo morado medio) */
  --sys-500: #7b55c4;   /* morado saturado */
  --sys-600: #5e3aab;   /* dark — gradiente oscuro */
  --sys-700: #432882;   /* muy oscuro */
  --sys-txt: #3b1f7a;   /* texto sobre fondos claros */
  --sys-ink: #2a1a5e;   /* ink oscuro del sistema */

  /* Gradiente hero auth */
  --auth-grad-from: #5e3aab;
  --auth-grad-to:   #9e7dd6;

  /* Botón submit auth */
  --auth-btn-bg:    #7b55c4;
  --auth-btn-hover: #6344b0;

  /* Links y acentos en el panel */
  --auth-link-color: #5e3aab;
}

.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  box-sizing: border-box;
  overflow: hidden;
  min-width: 0;
  width: 100%;
  /* Gradiente morado del sistema */
  background: linear-gradient(135deg, var(--auth-grad-from) 0%, var(--auth-grad-to) 100%);
}

/* En desktop el hero actúa como fondo absoluto (capa de gradiente + blobs) */
.auth-shell > .auth-hero {
  position: absolute;
  inset: 0;
  z-index: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  /* No muestra brand ni hero-foot en desktop — sólo los blobs de fondo */
}

.auth-shell > .auth-hero .auth-brand,
.auth-shell > .auth-hero .auth-hero-foot,
.auth-shell > .auth-hero .auth-copy,
.auth-shell > .auth-hero .auth-modules {
  display: none;
}

/* ── Layout de dos columnas (hero visible + panel) ── */
.auth-shell--split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 560px);
  align-items: stretch;
  justify-content: initial;
  padding: 0;
  gap: 0;
}

.auth-shell--split > .auth-hero {
  position: static;
  inset: auto;
  z-index: 1;
  order: -1;
  padding: 52px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  min-height: 100dvh;
}

.auth-shell--split > .auth-hero .auth-brand {
  display: block;
  margin-bottom: 0;
}

.auth-shell--split > .auth-hero .auth-copy {
  display: block;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 0;
}

.auth-shell--split > .auth-hero .auth-copy h1 {
  font-size: clamp(1.8rem, 2.8vw, 2.6rem);
  line-height: 1.08;
  margin-bottom: 16px;
}

.auth-shell--split > .auth-hero .auth-copy p {
  font-size: 1rem;
  max-width: 44ch;
}

.auth-shell--split > .auth-hero .auth-modules {
  display: block;
}

.auth-shell--split > .auth-hero .auth-hero-foot {
  display: block;
}

.auth-shell--split > .auth-hero .auth-module-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.auth-shell--split > .auth-panel {
  position: relative;
  z-index: 2;
  max-width: none;
  width: 100%;
  border-radius: 0;
  box-shadow: -4px 0 32px rgba(30, 40, 120, 0.10);
  overflow-y: auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-shell--split > .auth-panel .auth-panel-inner {
  padding: 52px 52px;
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}

.auth-shell--split > .auth-panel .auth-wordmark {
  margin-bottom: 32px;
}

.auth-shell--split > .auth-panel .auth-card h2 {
  font-size: clamp(1.4rem, 2vw, 1.75rem);
  margin-bottom: 8px;
}

.auth-shell--split > .auth-panel .auth-card > p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 20px;
}

.auth-panel {
  position: relative;
  z-index: 2;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(30, 40, 120, 0.22), 0 4px 16px rgba(30, 40, 120, 0.10);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  min-width: 0;
  width: 100%;
  max-width: 460px;
  overflow: hidden;
}

.auth-panel-inner {
  width: 100%;
  padding: 28px 36px 28px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* En desktop el hero no es un bloque de contenido separado */
.auth-shell > .auth-hero-blobs {
  display: none;
}

.auth-hero {
  position: relative;
  padding: max(48px, env(safe-area-inset-top, 0px)) max(48px, env(safe-area-inset-right, 0px))
    max(48px, env(safe-area-inset-bottom, 0px)) max(48px, env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  min-width: 0;
  /* Fondo morado del sistema en móvil/tablet (desktop lo hereda del auth-shell) */
  background: linear-gradient(135deg, var(--auth-grad-from) 0%, var(--auth-grad-to) 100%);
}

/* ── Blobs decorativos ── */
.auth-hero-blobs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.auth-blob {
  position: absolute;
  border-radius: 999px;
  /* Blobs en tonos morado claro semitransparente */
  background: radial-gradient(circle at 35% 45%, rgba(255,255,255,0.45) 0%, rgba(194,169,239,0.12) 70%);
  box-shadow: inset 0 0 30px rgba(255,255,255,0.18), 0 8px 32px rgba(60,20,120,0.18);
  animation: blobFloat 9s ease-in-out infinite;
}

.auth-blob--lg {
  width: clamp(180px, 28vw, 300px);
  height: clamp(180px, 28vw, 300px);
  top: -12%;
  right: -8%;
  animation-delay: 0s;
  background: radial-gradient(circle at 38% 42%, rgba(255,255,255,0.62) 0%, rgba(180,190,255,0.18) 70%);
}

.auth-blob--md {
  width: clamp(110px, 16vw, 190px);
  height: clamp(110px, 16vw, 190px);
  bottom: 18%;
  left: -5%;
  animation-delay: -3s;
  background: radial-gradient(circle at 40% 40%, rgba(255,255,255,0.50) 0%, rgba(140,160,255,0.14) 70%);
}

.auth-blob--sm {
  width: clamp(70px, 10vw, 120px);
  height: clamp(70px, 10vw, 120px);
  top: 38%;
  right: 10%;
  animation-delay: -5.5s;
}

.auth-blob--xs {
  width: clamp(44px, 6vw, 76px);
  height: clamp(44px, 6vw, 76px);
  bottom: 8%;
  right: 24%;
  animation-delay: -1.8s;
  opacity: 0.70;
}

@keyframes blobFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  45%       { transform: translateY(-14px) scale(1.03); }
  70%       { transform: translateY(6px)  scale(0.97); }
}

.auth-brand,
.auth-copy,
.auth-modules,
.auth-side-list {
  position: relative;
  z-index: 1;
}

/* los pseudo-elementos quedan como refuerzo sutil, solo en desktop */
.auth-hero::before,
.auth-hero::after {
  content: '';
  position: absolute;
  border-radius: 999px;
}

.auth-hero::before {
  width: 360px;
  height: 360px;
  background: rgba(255, 255, 255, 0.10);
  top: -140px;
  right: -80px;
}

.auth-hero::after {
  width: 220px;
  height: 220px;
  background: rgba(255, 255, 255, 0.08);
  bottom: -60px;
  left: -40px;
}

/* z-index ya declarado en el bloque de blobs arriba */

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

/* ── Logo imagen ── */
.brand-logo {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
}

/* En el panel blanco: logo en colores normales */
.brand-logo--panel {
  width: clamp(120px, 18vw, 160px);
  height: auto;
}

/* En el hero (fondo de gradiente): logo invertido a blanco */
.brand-logo--hero {
  width: clamp(120px, 32vw, 160px);
  height: auto;
  filter: brightness(0) invert(1);
}

/* En la barra lateral del dashboard */
.brand-logo--sidebar {
  width: 130px;
  height: auto;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  max-width: 100%;
  text-align: center;
  line-height: 1.25;
  hyphens: auto;
}

/* auth-copy h1 ya definido en el bloque nuevo (auth-copy) */
.selector-header h1,
.dash-hero-copy h1 {
  font-size: clamp(2rem, 3vw, 3.3rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-weight: 900;
}

.auth-copy p,
.selector-header p,
.dash-hero-copy p {
  font-size: 1rem;
  line-height: 1.6;
  max-width: 52ch;
  color: rgba(255, 255, 255, 0.9);
}

.auth-module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.auth-module-card {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 20px;
  padding: 18px;
  color: var(--white);
}

.auth-module-card strong,
.auth-module-card span {
  display: block;
}

.auth-module-card strong {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.auth-module-card span {
  font-size: 0.82rem;
  opacity: 0.9;
}

/* ─ Wordmark del panel (solo en desktop; oculto en móvil donde el hero muestra la marca) ─ */
.auth-wordmark {
  margin-bottom: 20px;
  line-height: 0; /* evita espacio extra bajo el img */
}

/* Auth card: plana, sin caja visual — el panel blanco ya hace de fondo */
.auth-card {
  min-width: 0;
}

.auth-card h2 {
  font-size: clamp(1.3rem, 2.5vw, 1.65rem);
  letter-spacing: -0.04em;
  font-weight: 900;
  color: var(--ink);
  margin-bottom: 16px;
  line-height: 1.08;
}

.auth-card-desc {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
  margin-bottom: 22px;
}

/* ─ Pie del hero — tagline corta en la zona inferior ─ */
.auth-hero-foot {
  position: relative;
  z-index: 1;
}

.auth-hero-foot p {
  font-size: 1.05rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.4;
  max-width: 28ch;
}

/* ─ Fila inside el formulario: link "olvidé" alineado a la derecha ─ */
.auth-form-foot {
  display: flex;
  justify-content: flex-end;
  margin: -6px 0 20px;
}

/* ─ Link auxiliar (olvidé contraseña, volver, etc.) ─ */
.auth-link {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--sys-600);
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-switch-copy {
  margin: 20px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.auth-switch-copy a {
  color: var(--sys-600);
  font-weight: 800;
  text-decoration: none;
}

.auth-switch-copy a:hover {
  text-decoration: underline;
}

/* ─ auth-copy en el hero: solo título corto visible en desktop ─ */
.auth-copy {
  position: relative;
  z-index: 1;
}

.auth-copy h1 {
  font-size: clamp(1.9rem, 3.5vw, 2.9rem);
  line-height: 1.06;
  letter-spacing: -0.04em;
  font-weight: 900;
  color: var(--white);
}

.auth-switch-copy + .auth-switch-copy {
  margin-top: 10px;
}

.auth-switch-copy a {
  color: var(--sys-600);
  font-weight: 800;
  text-decoration: none;
}

.auth-switch-copy a:hover {
  text-decoration: underline;
}

.level-selection-grid {
  display: grid;
  gap: 10px;
}

.level-choice-list {
  display: grid;
  gap: 8px;
}

.level-choice-card,
.module-choice-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--border2);
  background: #fbfbfe;
  cursor: pointer;
  position: relative;
}

.level-choice-list input[type='checkbox'],
.module-choice-list input[type='radio'],
.toggle-check input[type='checkbox'] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.module-choice-list {
  display: grid;
  gap: 12px;
}

.level-choice-card::before,
.module-choice-card::before,
.toggle-check::before {
  content: '';
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 1.5px solid #cfd7ec;
  background: #ffffff;
  box-shadow: inset 0 0 0 0 transparent;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.level-choice-card::before,
.toggle-check::before {
  border-radius: 8px;
}

.module-choice-card::before {
  border-radius: 999px;
}

.level-choice-card:has(input:checked),
.module-choice-card:has(input:checked),
.acknowledge-card:has(input:checked) {
  border-color: var(--a);
  background: #f7faff;
  box-shadow: 0 14px 24px rgba(74, 114, 204, 0.08);
}

.level-choice-card:has(input:checked)::before,
.toggle-check:has(input:checked)::before {
  border-color: var(--a-dark);
  background: var(--a-dark);
  box-shadow: inset 0 0 0 4px #ffffff;
}

.module-choice-card:has(input:checked)::before {
  border-color: var(--a-dark);
  background: var(--a-dark);
  box-shadow: inset 0 0 0 5px #ffffff;
}

.level-choice-card:has(input:focus-visible),
.module-choice-card:has(input:focus-visible),
.toggle-check:has(input:focus-visible) {
  outline: 2px solid rgba(127, 163, 232, 0.28);
  outline-offset: 2px;
}

.level-choice-copy strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 0.9rem;
}

.level-choice-copy span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
}

.auth-note-card {
  border-radius: 10px;
  border: 1px solid #cddff8;
  border-left: 3px solid #4a90d9;
  background: #eef6ff;
  padding: 10px 14px;
  color: #1e4d8c;
  font-size: 0.84rem;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.auth-note-card::before {
  content: '\F431'; /* bi-info-circle */
  font-family: 'bootstrap-icons';
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
  line-height: 1.5;
}

/* ── Íconos de estado en pantallas de verificación ── */
.auth-info-icon,
.auth-success-icon,
.auth-error-icon {
  font-size: 2.6rem;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-info-icon    { color: var(--sys-400, #9e7dd6); }
.auth-success-icon { color: #3aa76d; }
.auth-error-icon   { color: #d9534f; }

.auth-info-text {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--muted, #7a7a9d);
  margin-bottom: 12px;
  text-align: center;
}
.auth-info-hint {
  font-size: 0.82rem;
  color: var(--sys-300, #c2a9ef);
  text-align: center;
  margin-bottom: 20px;
}
.auth-resend-block {
  border-top: 1px solid var(--sys-200, #e0d4f7);
  padding-top: 16px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted, #7a7a9d);
  margin-bottom: 12px;
}
.auth-resend-block p { margin-bottom: 6px; }

.auth-resend-inline {
  margin-top: 8px;
  font-size: 0.85rem;
}
.auth-resend-inline a {
  color: var(--auth-link-color, #5e3aab);
  text-decoration: none;
  font-weight: 700;
}
.auth-resend-inline a:hover { text-decoration: underline; }

.form-row {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.form-row label {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--ink);
}

.form-row input {
  width: 100%;
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
  background: #fbfbfe;
}

.form-row input:focus {
  outline: 2px solid rgba(158, 125, 214, 0.25);
  border-color: var(--sys-400);
}

.password-field {
  position: relative;
  min-width: 0;
}

.password-field input {
  min-width: 0;
  padding-right: 54px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.password-toggle:hover {
  background: rgba(127, 163, 232, 0.12);
  color: var(--a-dark);
}

.password-toggle:focus-visible {
  outline: 2px solid rgba(127, 163, 232, 0.28);
  outline-offset: 2px;
}

.password-toggle i {
  font-size: 1rem;
  pointer-events: none;
}

.acknowledge-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--border2);
  border-radius: 14px;
  background: #fbfbfe;
  padding: 10px 14px;
}

/* ── School setup carousel ───────────────────────────────────── */
.school-carousel {
  display: grid;
  gap: 16px;
}

.school-carousel-track-wrap {
  overflow: hidden;
  border-radius: 14px;
}

.school-carousel-track {
  display: flex;
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}

.school-setup-block {
  flex: 0 0 100%;
  display: grid;
  gap: 12px;
  border: 1px solid var(--border2);
  border-radius: 14px;
  background: #fbfbfe;
  padding: 16px 18px;
  box-sizing: border-box;
}

.school-setup-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.school-setup-nivel-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--sys-100);
  color: var(--sys-700);
  border-radius: 20px;
  padding: 3px 10px;
}

.school-carousel-step {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .02em;
}

/* Dots */
.school-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
}

.school-carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border2);
  transition: background .25s, transform .25s;
  cursor: default;
}

.school-carousel-dot.is-active {
  background: var(--sys-500, #7c5cbf);
  transform: scale(1.25);
}

/* Nav buttons */
.school-carousel-nav {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.school-carousel-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--sys-300, #c4aef5);
  background: #fff;
  color: var(--sys-700, #4b2da0);
  cursor: pointer;
  transition: background .18s, border-color .18s;
}

.school-carousel-btn:hover {
  background: var(--sys-100, #f3effb);
  border-color: var(--sys-400, #9e7fe0);
}

.school-carousel-btn[hidden] {
  display: none;
}

.school-search-input {
  width: 100%;
}

.school-search-help-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: #5f4daf;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
  padding: 0;
}

.school-search-help-toggle:hover {
  color: #3e2e8d;
  text-decoration: underline;
}

.school-search-results {
  margin-top: 8px;
  border: 1px solid rgba(208, 217, 240, 0.96);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(29, 42, 79, 0.1);
  max-height: 220px;
  overflow-y: auto;
}

.school-search-option {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(236, 241, 252, 0.9);
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  display: grid;
  gap: 2px;
  cursor: pointer;
}

.school-search-option:last-child {
  border-bottom: 0;
}

.school-search-option strong {
  color: #31456f;
  font-size: 0.88rem;
}

.school-search-option span {
  color: #7181ab;
  font-size: 0.76rem;
  font-weight: 700;
}

.school-search-option small,
.school-search-option em {
  color: #8794b7;
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 700;
  line-height: 1.25;
}

.school-search-option em {
  color: #9aa5c1;
  font-weight: 600;
}

.school-search-option:hover {
  background: rgba(244, 247, 255, 0.95);
}

.school-search-highlight {
  padding: 0 2px;
  border-radius: 4px;
  background: rgba(255, 211, 102, 0.45);
  color: inherit;
  font-weight: 900;
}

.school-search-empty {
  padding: 10px 12px;
  color: #7f8db0;
  font-size: 0.8rem;
  font-weight: 700;
  display: grid;
  gap: 2px;
}

.school-search-empty strong {
  color: #52628a;
  font-size: 0.82rem;
}

.school-search-empty span {
  color: #8794b7;
  font-size: 0.72rem;
}

.school-search-selected {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(122, 197, 158, 0.35);
  background: rgba(115, 197, 155, 0.12);
  color: #287a59;
  font-size: 0.8rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.school-search-selected span {
  display: grid;
  gap: 1px;
}

.school-search-selected small {
  font-size: 0.68rem;
  font-weight: 800;
  color: inherit;
  opacity: 0.82;
}

.school-search-selected.is-auto {
  border-color: rgba(67, 143, 214, 0.4);
  background: rgba(80, 156, 228, 0.12);
  color: #245f95;
}

.school-auto-badge {
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  font-weight: 900;
  background: rgba(36, 95, 149, 0.12);
  color: inherit;
}

.school-cct-modal[hidden] {
  display: none;
}

.school-cct-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
}

.school-cct-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 18, 51, 0.58);
  backdrop-filter: blur(6px);
}

.school-cct-dialog {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  height: min(760px, calc(100vh - 48px));
  border: 1px solid rgba(207, 216, 240, 0.9);
  border-radius: 18px;
  background: #f8faff;
  box-shadow: 0 24px 70px rgba(23, 19, 52, 0.28);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}

.school-cct-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(207, 216, 240, 0.9);
  background: #fff;
}

.school-cct-header span {
  display: block;
  color: #7c88ad;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.school-cct-header h3 {
  margin: 2px 0 0;
  color: #2f385d;
  font-size: 1.2rem;
  font-weight: 900;
}

.school-cct-close {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(198, 207, 233, 0.9);
  border-radius: 12px;
  background: #fff;
  color: #7180a9;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.school-cct-close:hover {
  background: #f2f5ff;
  color: #4b3aa0;
}

.school-cct-body {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  background: #eef3ff;
}

.school-cct-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(207, 216, 240, 0.9);
  background: rgba(255, 255, 255, 0.88);
}

.school-cct-toolbar p {
  margin: 0;
  color: #69789f;
  font-size: 0.82rem;
  font-weight: 800;
}

.school-cct-toolbar a {
  flex: 0 0 auto;
  border: 1px solid rgba(126, 90, 201, 0.28);
  border-radius: 999px;
  padding: 8px 12px;
  color: #5b3aa5;
  background: rgba(126, 90, 201, 0.08);
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.school-cct-toolbar a:hover {
  background: rgba(126, 90, 201, 0.14);
}

.school-cct-body iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.school-select-search {
  width: 100%;
  margin-bottom: 8px;
  border: 1px solid rgba(201, 210, 233, 0.96);
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
  color: #4e5d86;
  font: inherit;
  font-size: 0.86rem;
}

.school-select-search:focus {
  outline: none;
  border-color: rgba(120, 151, 227, 0.9);
  box-shadow: 0 0 0 2px rgba(120, 151, 227, 0.14);
}

/* ── School Expand ────────────────────────────────────── */
.school-expand-choices {
  display: grid;
  gap: 10px;
  margin-bottom: 4px;
}

.school-expand-choice-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--border2);
  background: #fbfbfe;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  color: var(--ink);
  width: 100%;
  box-sizing: border-box;
  transition: border-color .18s, background .18s, box-shadow .18s;
}

.school-expand-choice-card:hover {
  border-color: var(--a);
  background: #f7faff;
}

.school-expand-choice-card.is-active {
  border-color: var(--a);
  background: #f7faff;
  box-shadow: 0 8px 20px rgba(74, 114, 204, 0.09);
}

.school-expand-choice-card--link {
  text-decoration: none;
}

.school-expand-choice-icon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--sys-100);
  color: var(--sys-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.school-expand-choice-body {
  flex: 1;
  min-width: 0;
}

.school-expand-choice-body strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}

.school-expand-choice-body span {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.3;
}

.school-expand-choice-check {
  flex: 0 0 auto;
  font-size: 1.1rem;
  color: var(--a);
  opacity: 0;
  transition: opacity .15s;
}

.school-expand-choice-card.is-active .school-expand-choice-check {
  opacity: 1;
}

.school-expand-choice-arrow {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 1rem;
  transition: transform .18s;
}

.school-expand-choice-card--link:hover .school-expand-choice-arrow {
  transform: translateX(4px);
}

.school-expand-form-wrap {
  margin-top: 12px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--border2);
  background: #f9f9fd;
  transition: opacity .2s;
}

.school-expand-form-wrap.is-hidden {
  display: none;
}

.auth-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .15s;
}

.auth-link-btn:hover {
  color: var(--ink);
}

.auth-note-text {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.5;
}


.toggle-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  position: relative;
}

.toggle-check span {
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.4;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.setup-block-title {
  display: block;
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 900;
}

/* ══════════════════════════════════════════════════
   ONB — Vista de arranque minimalista (onboarding_welcome)
   Layout de dos columnas: hero izquierda, panel derecha
══════════════════════════════════════════════════ */
.onb-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 520px);
  background: linear-gradient(135deg, var(--auth-grad-from) 0%, var(--auth-grad-to) 100%);
}

/* ── Hero (izquierda) ── */
.onb-hero {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 52px 56px;
  overflow: hidden;
  position: relative;
}

.onb-hero::before {
  content: '';
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  top: -120px;
  right: -80px;
  pointer-events: none;
}

.onb-hero::after {
  content: '';
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  bottom: -60px;
  left: -40px;
  pointer-events: none;
}

.onb-hero-brand {
  position: relative;
  z-index: 1;
}

.onb-hero-body {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 0 32px;
}

.onb-hero-eyebrow {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 12px;
}

.onb-hero-title {
  font-size: clamp(2rem, 3vw, 2.9rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.07;
  color: var(--white);
  margin-bottom: 16px;
  max-width: 16ch;
}

.onb-hero-sub {
  font-size: 0.97rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  max-width: 38ch;
  margin-bottom: 24px;
}

.onb-hero-levels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.onb-level-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.onb-hero-foot {
  position: relative;
  z-index: 1;
  height: 24px;
}

/* ── Panel (derecha) ── */
.onb-panel {
  background: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: -6px 0 40px rgba(30, 40, 120, 0.12);
  overflow-y: auto;
  min-height: 100dvh;
}

.onb-panel-inner {
  padding: 56px 52px;
  width: 100%;
  box-sizing: border-box;
}

.onb-panel-header {
  margin-bottom: 32px;
}

.onb-step-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: #eef6ff;
  color: #31528e;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.onb-panel-title {
  font-size: clamp(1.4rem, 2.2vw, 1.75rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--ink);
  line-height: 1.1;
}

/* ── Tarjetas de módulo ── */
.onb-module-list {
  display: grid;
  gap: 10px;
  margin-bottom: 28px;
}

.onb-module-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 2px solid var(--border2);
  background: #fbfbfe;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.onb-module-card:hover {
  border-color: var(--sys-400);
  background: #f5f8ff;
}

.onb-module-card:has(input:checked) {
  border-color: var(--sys-600);
  background: #eef4ff;
  box-shadow: 0 0 0 3px rgba(var(--sys-600-rgb, 80, 120, 200), 0.08);
}

.onb-module-card input[type="radio"] {
  accent-color: var(--sys-600);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
}

.onb-module-card-body strong {
  display: block;
  font-size: 0.97rem;
  font-weight: 800;
  color: var(--ink);
}

.onb-submit {
  margin-top: 0;
}

/* ── Responsive ≤ 820px: apila en una columna ── */
@media (max-width: 820px) {
  .onb-shell {
    grid-template-columns: 1fr;
    grid-template-rows: clamp(200px, 34vh, 280px) 1fr;
  }

  .onb-hero {
    padding: 28px 28px 44px;
    justify-content: space-between;
  }

  .onb-hero-body {
    flex: none;
    padding: 16px 0 0;
    justify-content: flex-start;
  }

  .onb-hero-title {
    font-size: clamp(1.2rem, 4.5vw, 1.6rem);
    max-width: 24ch;
  }

  .onb-hero-sub {
    display: none;
  }

  .onb-hero-foot {
    display: none;
  }

  .onb-panel {
    min-height: unset;
    justify-content: flex-start;
    border-radius: 26px 26px 0 0;
    margin-top: -26px;
    box-shadow: 0 -14px 52px rgba(40, 40, 100, 0.16);
  }

  .onb-panel-inner {
    padding: 32px 24px max(32px, env(safe-area-inset-bottom, 0px));
    max-width: 520px;
    margin-inline: auto;
  }

  .onb-panel-header {
    margin-bottom: 22px;
  }
}

@media (max-width: 480px) {
  .onb-shell {
    grid-template-rows: clamp(170px, 30vh, 240px) 1fr;
  }

  .onb-hero {
    padding: 22px 22px 40px;
  }

  .onb-panel-inner {
    padding: 26px 20px max(28px, env(safe-area-inset-bottom, 0px));
  }
}

.onboarding-grid {
  gap: 18px;
}



.onboarding-form-grid {
  margin-top: 12px;
}

.auth-module-grid-secondary {
  margin-top: 12px;
}

.auth-card--compact {
  max-width: 560px;
}

.auth-card--support {
  display: grid;
  gap: 18px;
}

.auth-card-actions {
  display: grid;
  gap: 10px;
}

.auth-card-actions .auth-switch-copy {
  margin: 0;
}

.auth-note-card--spaced {
  margin-bottom: 18px;
}

.auth-note-card-title {
  display: block;
  margin-bottom: 6px;
}

.auth-switch-copy--soft {
  margin-top: 10px;
}

.setup-progress-bar.is-step-two span {
  width: 66%;
}

.auth-side-list {
  display: grid;
  gap: 12px;
}

.auth-side-item {
  display: grid;
  gap: 4px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--white);
}

.auth-side-item strong {
  font-size: 1rem;
  font-weight: 800;
}

.auth-side-item span {
  font-size: 0.85rem;
  line-height: 1.5;
  opacity: 0.92;
}

.setup-progress {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid #d9e3f5;
  background: linear-gradient(180deg, #f9fbff 0%, #f2f7ff 100%);
}

.setup-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.setup-progress-head strong {
  color: var(--ink);
  font-size: 0.94rem;
}

.setup-progress-head span {
  color: #31528e;
  font-size: 0.82rem;
  font-weight: 800;
}

.setup-progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #dfe8f8;
  overflow: hidden;
}

.setup-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--a-dark), var(--a));
}

.setup-progress-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.setup-progress-steps span {
  border-radius: 14px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
}

.setup-progress-steps .is-done {
  background: #eefbf3;
  color: #19653a;
}

.setup-progress-steps .is-current {
  background: #eef6ff;
  color: #31528e;
}

.auth-submit,
.selector-card,
.cta-link,
.logout-link {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.auth-submit {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--sys-600), var(--sys-400));
  color: var(--white);
  font: inherit;
  font-weight: 900;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(94, 58, 171, 0.28);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.auth-submit:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
  transform: none !important;
}

.auth-submit:hover {
  background: linear-gradient(135deg, var(--sys-700), var(--sys-500));
  box-shadow: 0 20px 36px rgba(94, 58, 171, 0.36);
}

.auth-submit:hover,
.selector-card:hover,
.cta-link:hover,
.logout-link:hover {
  transform: translateY(-2px);
}

/* ── Register desktop: panel ancho + grid 2 columnas ─── */
.auth-shell--register {
  align-items: center;
  padding: 16px 24px;
}

.auth-shell--register > .auth-panel {
  max-width: 700px;
  width: 100%;
}

/* Reducción de espaciados para evitar scroll vertical en desktop */
@media (min-width: 601px) {
  .auth-shell--register .auth-panel-inner {
    padding: 25px 37px 23px;
  }

  .auth-shell--register .auth-wordmark {
    margin-bottom: 15px;
  }

  .auth-shell--register .brand-logo--panel {
    height: 40px;
  }

  .auth-shell--register .register-header {
    margin-bottom: 0;
  }

  .auth-shell--register .auth-card h2 {
    font-size: 1.45rem;
    margin-bottom: 4px;
  }

  .auth-shell--register .register-subtitle {
    font-size: 0.82rem;
  }

  .auth-shell--register .form-row {
    margin-bottom: 14px;
    gap: 6px;
  }

  .auth-shell--register .form-row input,
  .auth-shell--register .form-row select {
    padding: 11px 15px;
    font-size: 0.9rem;
  }

  .auth-shell--register .form-row label {
    font-size: 0.8rem;
  }

  .auth-shell--register .register-grid {
    gap: 0 15px;
  }

  .auth-shell--register .form-legal {
    padding: 13px 0 9px;
    margin-bottom: 0;
    margin-top: 19px;
    gap: 8px;
  }

  .auth-shell--register .form-legal__check {
    font-size: 0.8rem;
  }

  .auth-shell--register .form-legal__docs {
    font-size: 0.74rem;
  }

  .auth-shell--register .auth-submit {
    padding: 13px 21px;
    font-size: 0.94rem;
  }

  .auth-shell--register .auth-social-divider {
    margin: 13px 0 11px;
    font-size: 0.74rem;
  }

  .auth-shell--register .auth-social-btns {
    margin-bottom: 13px;
  }

  .auth-shell--register .auth-switch-copy {
    margin: 11px 0 0;
    font-size: 0.86rem;
  }
}

.auth-card--register {
  width: 100%;
}

.register-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
}

.register-wordmark {
  margin-bottom: 0 !important;
  flex-shrink: 0;
}

.register-header {
  margin-bottom: 0;
}

@media (min-width: 601px) {
  .auth-shell--register .register-top {
    margin-bottom: 16px;
  }
}

.register-header h2 {
  margin-bottom: 4px;
}

.register-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  margin: 0;
}

.register-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.register-col-full {
  grid-column: 1 / -1;
}

/* En móvil vuelve a una columna */
@media (max-width: 600px) {
  .register-grid {
    grid-template-columns: 1fr;
  }
  .register-col-full {
    grid-column: 1;
  }
  .auth-shell--register > .auth-panel {
    max-width: 460px;
  }
}

/* ── ────────────────────────────────────────────────────── */

/* ── Social login ──────────────────────────────────────── */
.auth-social-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 14px;
  color: var(--text-muted, #94a3b8);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-social-divider::before,
.auth-social-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--surface-border, #e2e8f0);
}

.auth-social-btns {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 12px;
  margin-bottom: 18px;
}

.auth-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1.5px solid var(--surface-border, #e2e8f0);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s, box-shadow 0.16s, transform 0.16s;
}

.auth-social-btn:hover {
  background: var(--surface-hover, #f8fafc);
  border-color: var(--sys-300, #c4b5fd);
  box-shadow: 0 4px 12px rgba(0,0,0,0.07);
  transform: translateY(-2px);
}

/* Botones sociales deshabilitados (próximamente) */
.auth-social-btn:disabled,
.auth-social-btn--soon {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.auth-social-soon-note {
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted, #7a7a9d);
  margin: -10px 0 14px;
  letter-spacing: 0.02em;
}

.auth-social-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ── ────────────────────────────────────────────────────── */

/* ── Form legal footer ─────────────────────────────────── */
.form-legal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 16px 0 12px;
  border-top: 1px solid var(--surface-border, #e2e8f0);
}

.form-legal__check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  line-height: 1.5;
}

.form-legal__check input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  margin-top: 2px;
  padding: 0;
  border-radius: 4px !important;
  border: 1.5px solid var(--sys-400, #9e7dd6) !important;
  background: #fff !important;
  accent-color: var(--sys-500, #7c3aed);
  cursor: pointer;
  appearance: auto;
  -webkit-appearance: checkbox;
  pointer-events: auto;
  position: static;
  opacity: 1;
}

.form-legal__link {
  color: var(--sys-500, #7c3aed);
  font-weight: 600;
  text-decoration: none;
}

.form-legal__link:hover {
  text-decoration: underline;
}

.form-legal__docs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
  text-decoration: none;
  transition: color 0.18s;
}

.form-legal__docs:hover {
  color: var(--sys-500, #7c3aed);
}

/* ── ────────────────────────────────────────────────────── */

.form-errors,
.field-errors,
.flash-note {
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.84rem;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

/* Icono automático via ::before */
.form-errors::before,
.field-errors::before {
  content: '\F333'; /* bi-exclamation-circle */
  font-family: 'bootstrap-icons';
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
  line-height: 1.45;
}

.flash-note::before {
  content: '\F431'; /* bi-info-circle */
  font-family: 'bootstrap-icons';
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
  line-height: 1.45;
}

.form-errors,
.field-errors {
  background: #fff5f5;
  color: #952a2a;
  border: 1px solid #f7cecc;
  border-left: 3px solid #d94040;
}

.flash-note {
  background: #eef6ff;
  color: #1e4d8c;
  border: 1px solid #cddff8;
  border-left: 3px solid #4a90d9;
}

/* Listas internas del errorlist de Django */
.form-errors ul,
.field-errors ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.form-errors ul li,
.field-errors ul li {
  display: block;
}

.dashboard-flash-stack {
  display: grid;
  gap: 10px;
  margin: 0;
}

.dashboard-flash {
  box-shadow: var(--shadow);
}

.dashboard-flash-success {
  background: #f0fbf4;
  color: #19653a;
  border-color: #bfe7cd;
  border-left-color: #2e9c5a;
}

.dashboard-flash-error {
  background: #fff5f5;
  color: #952a2a;
  border-color: #f7cecc;
  border-left-color: #d94040;
}

.dashboard-flash-info {
  background: #eef6ff;
  color: #1e4d8c;
  border-color: #cddff8;
  border-left-color: #4a90d9;
}

/* ══════════════════════════════════════════════════════════
   SISTEMA GLOBAL DE TOASTS
   ══════════════════════════════════════════════════════════ */
.edu-toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
  width: clamp(280px, 90vw, 380px);
}

.edu-toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: #ffffff;
  box-shadow: 0 8px 32px rgba(30, 40, 100, 0.16), 0 2px 8px rgba(30, 40, 100, 0.08);
  pointer-events: all;
  cursor: default;
  animation: eduToastIn 0.3s cubic-bezier(0.34, 1.4, 0.64, 1) both;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.edu-toast.is-hiding {
  animation: eduToastOut 0.25s ease forwards;
}

@keyframes eduToastIn {
  from { opacity: 0; transform: translateX(32px) scale(0.94); }
  to   { opacity: 1; transform: translateX(0)    scale(1); }
}

@keyframes eduToastOut {
  from { opacity: 1; transform: translateX(0) scale(1);    max-height: 120px; margin-bottom: 0; }
  to   { opacity: 0; transform: translateX(32px) scale(0.94); max-height: 0; margin-bottom: -10px; }
}

/* Barra de progreso de auto-cierre */
.edu-toast::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 16px 16px;
  background: currentColor;
  opacity: 0.18;
  width: 100%;
  transform-origin: left;
  animation: eduToastBar var(--toast-dur, 4s) linear forwards;
  animation-delay: 0.3s;
}

@keyframes eduToastBar {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* Ícono */
.edu-toast-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

/* Cuerpo */
.edu-toast-body {
  flex: 1;
  min-width: 0;
}

.edu-toast-msg {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink);
}

/* Botón cerrar */
.edu-toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  padding: 2px 4px;
  border-radius: 6px;
  flex-shrink: 0;
  transition: background 0.14s, color 0.14s;
  line-height: 1;
  margin-top: 1px;
}

.edu-toast-close:hover {
  background: rgba(0, 0, 0, 0.07);
  color: var(--ink);
}

/* Variantes por tipo */
.edu-toast--success {
  border-color: #bfe7cd;
  background: linear-gradient(135deg, #f0fbf4 0%, #ffffff 60%);
}
.edu-toast--success .edu-toast-ico {
  background: #d8f5e5;
  color: #1a6636;
}

.edu-toast--error {
  border-color: #f2cdcd;
  background: linear-gradient(135deg, #fff5f5 0%, #ffffff 60%);
}
.edu-toast--error .edu-toast-ico {
  background: #ffe0e0;
  color: #a82828;
}

.edu-toast--warning {
  border-color: #f5dea0;
  background: linear-gradient(135deg, #fffbee 0%, #ffffff 60%);
}
.edu-toast--warning .edu-toast-ico {
  background: #fff0c0;
  color: #8a5c00;
}

.edu-toast--info {
  border-color: #cddff8;
  background: linear-gradient(135deg, #eef6ff 0%, #ffffff 60%);
}
.edu-toast--info .edu-toast-ico {
  background: #ddeeff;
  color: #1e4d8c;
}

.dashboard-form-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.dashboard-form-grid .auth-submit {
  margin-top: 4px;
}

.dashboard-inline-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.dashboard-inline-actions--spaced {
  margin-bottom: 12px;
}

.dashboard-tag-row {
  margin-bottom: 10px;
}

.dashboard-pane-body {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.dashboard-pane-form {
  padding: 0 14px 14px;
}

.dashboard-stat-text {
  font-size: 15px;
}

.brand-mark--sidebar {
  display: flex;
  align-items: center;
  overflow: hidden;
  line-height: 0;
}

.link-reset {
  text-decoration: none;
}

.link-block {
  display: block;
}

.sidebar-copy-fill,
.module-card-copy {
  flex: 1;
  min-width: 0;
}

.sidebar-copy-fill {
  overflow: hidden;
}

.subs-meta {
  font-size: 9px;
  opacity: 0.75;
}

.dashboard-inline-actions form {
  margin: 0;
}

.dashboard-action-link,
.dashboard-action-button,
.dashboard-reset-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.dashboard-action-link .bi,
.dashboard-action-button .bi,
.dashboard-reset-link .bi,
.profile-panel-header .bi,
.overview-panel-header .bi,
.planning-side-card-header .bi,
.overview-modal-header .bi {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.dashboard-action-link,
.dashboard-reset-link {
  background: #eef6ff;
  color: #31528e;
}

.dashboard-action-button {
  border: 1px solid rgba(183, 191, 219, 0.9);
  background: rgba(244, 247, 255, 0.96);
  color: #50607f;
  cursor: pointer;
}

.dashboard-action-button.is-primary {
  border-color: rgba(110, 140, 220, 0.85);
  background: #6e8cdc;
  color: #fff;
}

.dashboard-action-button.is-primary:hover {
  background: #5a7acc;
}

.dashboard-action-button.is-danger {
  border-color: rgba(232, 148, 148, 0.92);
  background: rgba(255, 239, 241, 0.94);
  color: #b33c4c;
}

.dashboard-reset-link {
  width: fit-content;
}

.dashboard-action-link:hover,
.dashboard-action-button:hover,
.dashboard-reset-link:hover {
  transform: translateY(-1px);
}

/* ── Barra slim de módulo activo ── */
.dash-module-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 22px;
  border-bottom: 1px solid var(--border2);
  background: #ffffff;
}

.dash-module-bar-current {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--a-dark);
  letter-spacing: 0.01em;
}

.dash-module-bar-current i {
  font-size: 0.95rem;
  opacity: 0.75;
}

.dash-module-bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.dash-module-bar-btn:hover {
  color: var(--a-dark);
  border-color: var(--a);
  background: var(--a-pale);
}

.dashboard-form-shell {
  gap: 18px;
  align-content: start;
}

.dashboard-form-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(244, 247, 253, 0.86);
  border: 1px solid rgba(127, 163, 232, 0.16);
}

.dashboard-form-header strong {
  display: block;
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 1rem;
}

.dashboard-form-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.material-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.material-credit-badge,
.material-state-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
}

.material-credit-badge {
  background: rgba(127, 163, 232, 0.16);
  color: #31528e;
}

.material-state-badge {
  background: #fff7e8;
  color: #9a6a0b;
}

.material-state-badge.is-owned {
  background: #eefbf3;
  color: #19653a;
}

.material-library-panel {
  min-height: 100%;
}

.material-showcase {
  width: 100%;
  max-width: none;
  display: grid;
  gap: 16px;
  min-height: calc(100vh - 126px);
  align-content: start;
}

.material-showcase-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.material-showcase-tags {
  gap: 8px;
}

.material-filter-row-catalog {
  margin: 0;
}

.material-catalog-hero {
  margin-bottom: 0;
  border-radius: 28px;
  box-shadow: 0 18px 36px rgba(144, 104, 199, 0.18);
  justify-content: flex-start;
  gap: 20px;
  padding: 22px 28px;
}

.mat-hero-body {
  flex: 1;
}

.mat-hero-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.mat-hero-chip {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.material-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.profile-hub {
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 126px);
  align-content: start;
}

.profile-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.profile-metric-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-md);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.profile-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(45, 45, 78, 0.12);
  border-color: rgba(127, 163, 232, 0.22);
}

.profile-metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--a-txt);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), var(--a-pale));
  box-shadow: inset 0 0 0 1px rgba(127, 163, 232, 0.14);
}

.profile-metric-card strong,
.profile-summary-stats strong {
  display: block;
  color: var(--ink);
  font-size: 1.08rem;
  line-height: 1.05;
}

.profile-metric-card small,
.profile-summary-stats span,
.profile-summary-role,
.profile-panel-header p,
.profile-context-list li span {
  color: var(--muted);
}

.profile-metric-label,
.profile-context-label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7a86a8;
}

.profile-layout-grid {
  display: grid;
  grid-template-columns: minmax(240px, 290px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.profile-summary-card,
.profile-panel {
  padding: 24px;
  border-radius: 26px;
}

.profile-summary-card,
.profile-panel,
.school-summary-card,
.group-summary-card,
.planning-summary-card,
.overview-summary-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.profile-summary-card:hover,
.profile-panel:hover,
.school-summary-card:hover,
.group-summary-card:hover,
.planning-summary-card:hover,
.overview-summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(45, 45, 78, 0.11);
}

.profile-summary-card {
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
}

.profile-avatar {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(239, 244, 255, 1) 0%, rgba(228, 237, 255, 1) 100%);
  color: var(--a-dark);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.profile-summary-name {
  font-size: 1.7rem;
  line-height: 1.08;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.profile-summary-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-summary-stats {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-summary-stats article {
  padding: 16px 12px;
  border-radius: 18px;
  background: #fbfbfe;
  border: 1px solid rgba(208, 214, 236, 0.8);
}

.profile-summary-info {
  width: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  border-top: 1px solid rgba(208, 214, 236, 0.7);
  padding-top: 14px;
}

.profile-summary-info li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.82rem;
  color: #5a6490;
}

.profile-summary-info li i {
  font-size: 0.88rem;
  color: #8e9ec4;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

.profile-summary-info li em {
  color: #aab0cc;
  font-style: normal;
}

/* ── Card escuela en sidebar del perfil ── */
.profile-school-sidebar-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(203, 211, 235, 0.6);
  background: rgba(245, 247, 255, 0.7);
  text-align: center;
}

.profile-school-sidebar-logo {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(203, 211, 235, 0.7);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-school-sidebar-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.profile-school-sidebar-logo-placeholder {
  font-size: 26px;
  color: #94a3b8;
}

.profile-school-sidebar-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.profile-school-sidebar-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
}

.profile-school-sidebar-cct {
  font-size: 0.72rem;
  color: #7a8db5;
  font-weight: 600;
}

.profile-school-sidebar-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
}

.profile-school-sidebar-chips span {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(239, 244, 255, 0.96);
  border: 1px solid rgba(203, 211, 235, 0.88);
  color: #536384;
}

.profile-school-sidebar-edit {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--a);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(var(--a-rgb, 99, 102, 241), 0.3);
  background: rgba(var(--a-rgb, 99, 102, 241), 0.06);
  transition: background 0.15s;
}

.profile-school-sidebar-edit:hover {
  background: rgba(var(--a-rgb, 99, 102, 241), 0.12);
}

.profile-content-stack {
  display: grid;
  gap: 16px;
}

.profile-panel {
  display: grid;
  gap: 18px;
}

.profile-panel-header {
  display: grid;
  gap: 6px;
}

.profile-panel-header h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.55rem;
  letter-spacing: -0.04em;
  color: var(--ink);
  line-height: 1.08;
}

.profile-panel-header h3 i {
  color: var(--a-dark);
}

.profile-form-grid {
  display: grid;
  gap: 12px;
  margin-top: 0;
}

.profile-form-row2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.profile-submit {
  max-width: 240px;
}

.profile-context-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.profile-context-card {
  padding: 18px;
  border-radius: 20px;
  background: #fbfbfe;
  border: 1px solid rgba(208, 214, 236, 0.8);
}

.profile-context-list {
  list-style: none;
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
}

.profile-context-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-context-list li strong {
  color: var(--ink);
  font-size: 0.94rem;
}

.profile-actions-row {
  margin-top: 0;
  margin-bottom: 0;
}

.profile-school-list {
  display: grid;
  gap: 10px;
}

.profile-school-item {
  background: #fbfbfe;
}

.school-compact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 16px;
  background: #fbfbfe;
  border: 1px solid rgba(208, 214, 236, 0.8);
}

.school-compact-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.school-compact-info strong {
  font-size: 0.95rem;
  color: #33405f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.school-compact-meta {
  font-size: 0.78rem;
  color: #7b87aa;
  font-weight: 600;
}

.school-compact-chips {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.school-compact-chips span {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(239, 244, 255, 0.96);
  border: 1px solid rgba(203, 211, 235, 0.88);
  color: #536384;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.flash-note--compact {
  padding: 8px 14px;
  font-size: 0.8rem;
}

.profile-password-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  margin-top: 0;
  align-items: start;
}

.profile-password-grid .is-full {
  grid-column: 1 / -1;
}

.profile-password-grid .form-row {
  min-width: 0;
}

/* ── Verificar contraseña actual ── */
.password-verify-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.password-verify-row .password-field {
  flex: 1;
  min-width: 0;
}

.password-verify-btn {
  flex-shrink: 0;
  padding: 0 18px;
  border-radius: 12px;
  border: none;
  background: var(--a);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.password-verify-btn:hover { opacity: 0.88; }
.password-verify-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.password-verify-feedback {
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 5px;
  min-height: 1.2em;
}

.password-verify-feedback.is-success { color: #16a34a; }
.password-verify-feedback.is-error   { color: #dc2626; }

.profile-help-text {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
  min-width: 0;
  overflow-wrap: anywhere;
}

.profile-help-text ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.schools-hub {
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 126px);
}

.schools-layout-grid {
  display: grid;
  grid-template-columns: minmax(240px, 290px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.school-summary-card {
  display: grid;
  gap: 14px;
  padding: 24px;
  border-radius: 26px;
  justify-items: center;
  text-align: center;
}

.school-summary-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--a-dark);
  background: rgba(255,255,255,0.3);
  flex-shrink: 0;
}

.group-hero-header {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.group-hero-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.school-summary-title {
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.2;
}

.school-summary-subtitle,
.school-summary-note span {
  color: var(--muted);
  font-size: 0.82rem;
}

.school-summary-stats {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.school-summary-stats article,
.school-summary-note {
  padding: 14px 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(208, 214, 236, 0.6);
  backdrop-filter: blur(4px);
}

/* ── Sidebar de expansión de perfil (dentro del resumen) ── */
.school-expand-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.school-expand-sidebar-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border-radius: 12px;
  background: rgba(255,255,255,0.6);
  border: 1.5px dashed rgba(150, 170, 220, 0.7);
  color: var(--a-dark, #3d5fa0);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  transition: background .17s, border-color .17s, color .17s;
}

.school-expand-sidebar-btn:hover {
  background: rgba(238, 246, 255, 0.9);
  border-color: var(--a, #7fa3e8);
}

.school-expand-sidebar-btn--level {
  color: var(--sys-700, #4b2da0);
  border-color: rgba(180, 138, 212, 0.6);
}

.school-expand-sidebar-btn--level:hover {
  background: rgba(243, 239, 251, 0.9);
  border-color: var(--sys-400, #9e7fe0);
}

/* ── Tarjeta CTA "Agregar escuela / nivel" en la lista ── */
.school-add-cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px dashed rgba(150, 170, 220, 0.65);
  background: rgba(239, 246, 255, 0.55);
}

.school-add-cta-card--level {
  border-color: rgba(180, 138, 212, 0.6);
  background: rgba(243, 239, 251, 0.5);
}

.school-add-cta-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.school-add-cta-icon {
  font-size: 1.4rem;
  flex: 0 0 auto;
  color: var(--a-dark, #3d5fa0);
}

.school-add-cta-card--level .school-add-cta-icon {
  color: var(--sys-700, #4b2da0);
}

.school-add-cta-inner strong {
  display: block;
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}

.school-add-cta-inner span {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.3;
}

/* ── Botón "Eliminar" como link de acción (modo danger) ── */
.dashboard-action-link.is-danger,
.dashboard-action-button.is-danger-link {
  background: rgba(255, 239, 241, 0.9);
  color: #b33c4c;
  border: none;
  cursor: pointer;
}

.dashboard-action-link.is-danger:hover,
.dashboard-action-button.is-danger-link:hover {
  background: rgba(255, 228, 232, 0.98);
}


  display: grid;
  gap: 16px;
}

.schools-card-list {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.schools-card-item {
  border-radius: 20px;
}

.field-help {
  margin-top: 6px;
  color: #647397;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.45;
}

.group-management-card {
  display: grid;
  gap: 10px;
}

.group-management-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.group-management-meta span,
.group-management-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(239, 244, 255, 0.96);
  border: 1px solid rgba(203, 211, 235, 0.88);
  color: #536384;
  font-size: 0.75rem;
  font-weight: 800;
}

.group-management-subjects {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.group-management-chip.is-muted {
  background: rgba(248, 250, 255, 0.96);
  color: #8390b0;
}

/* ── Groups panel redesign ────────────────────────── */
.groups-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.groups-panel-header > div {
  display: grid;
  gap: 6px;
}

.groups-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--a-dark, #3557a7);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 2px 8px rgba(53, 87, 167, 0.22);
}

.groups-add-btn:hover {
  background: #2a4796;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(53, 87, 167, 0.3);
}

.groups-add-btn.is-sm {
  padding: 8px 16px;
  font-size: 0.8rem;
}

.groups-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.group-card {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 20px;
  background: #fbfbfe;
  border: 1px solid rgba(208, 214, 236, 0.8);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.group-card:hover {
  box-shadow: 0 4px 16px rgba(60, 80, 140, 0.1);
  transform: translateY(-1px);
}

.group-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.group-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(219, 228, 250, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--a-dark, #3557a7);
  font-size: 1rem;
  flex-shrink: 0;
}

.group-card-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.group-card-title strong {
  font-size: 0.97rem;
  color: #33405f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-card-title span {
  font-size: 0.75rem;
  color: #7b87aa;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.group-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(239, 244, 255, 0.96);
  border: 1px solid rgba(203, 211, 235, 0.88);
  color: #536384;
  font-size: 0.72rem;
  font-weight: 800;
}

.group-card-meta span i {
  font-size: 0.7rem;
}

.group-card-subjects {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.group-card-subjects span {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(248, 250, 255, 0.96);
  border: 1px dashed rgba(190, 200, 228, 0.9);
  color: #6b78a4;
  font-size: 0.7rem;
  font-weight: 700;
}

.group-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.group-card-actions form {
  margin: 0;
}

.group-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.group-card-btn:hover {
  transform: translateY(-1px);
}

.group-card-btn.is-edit {
  background: #eef3ff;
  color: #3557a7;
}

.group-card-btn.is-edit:hover {
  background: #dde8ff;
}

.group-card-btn.is-delete {
  background: #fff2f2;
  color: #ab3535;
}

.group-card-btn.is-delete:hover {
  background: #ffe0e0;
}

.group-card-btn.is-delete:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.groups-empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 36px 20px;
  border-radius: 16px;
  border: 2px dashed rgba(190, 200, 228, 0.7);
  color: #8a96be;
  text-align: center;
}

.groups-empty-state i {
  font-size: 2rem;
  opacity: 0.5;
}

.groups-empty-state span {
  font-size: 0.9rem;
  line-height: 1.5;
}

.group-management-warning {
  margin: 0;
  color: #a35e34;
  font-size: 0.78rem;
  font-weight: 700;
}

.school-management-card {
  display: grid;
  gap: 10px;
}

.school-card-logo-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.school-card-logo {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: contain;
  border: 1px solid rgba(203, 211, 235, 0.7);
  background: rgba(241, 244, 255, 0.8);
  flex-shrink: 0;
}

.school-card-logo-placeholder {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  border: 1px solid rgba(203, 211, 235, 0.7);
  background: rgba(241, 244, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #7a8db5;
  flex-shrink: 0;
}

/* ── Nombre + badge verificado ── */
.school-card-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.school-card-name-row { display: flex; align-items: center; gap: 6px; }
.school-card-name-row strong { font-size: 0.9rem; font-weight: 700; color: #1e293b; }
.school-card-address { font-size: 0.75rem; color: #6b7ea0; display: flex; align-items: center; gap: 3px; margin-top: 2px; }

/* ── Badge verificado ── */
.school-verified-badge { font-size: 15px; line-height: 1; flex-shrink: 0; }
.school-verified-badge i { color: #f59e0b; }
.school-verified-badge.is-verified i { color: #22c55e; }

/* ── Zona upload logo ── */
.school-logo-upload-row { display: flex; flex-direction: column; gap: 8px; }
.school-logo-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  border: 2px dashed rgba(148, 163, 184, 0.55);
  border-radius: 14px;
  background: rgba(241, 245, 255, 0.6);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  padding: 16px;
  position: relative;
  overflow: hidden;
  gap: 8px;
}
.school-logo-upload-zone:hover { border-color: #6366f1; background: rgba(238, 240, 255, 0.8); }
.school-logo-upload-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.school-logo-upload-placeholder { display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.school-logo-upload-placeholder i { font-size: 28px; color: #94a3b8; }
.school-logo-upload-placeholder span { font-size: 0.82rem; color: #64748b; font-weight: 600; }
.school-logo-upload-hint { font-size: 0.72rem !important; color: #94a3b8 !important; font-weight: 400 !important; }

/* ── Campos de solo lectura en formulario de escuela ── */.schools-form-grid input[readonly],
.schools-form-grid select[disabled] {
  background: rgba(241, 245, 249, 0.7);
  color: #94a3b8;
  cursor: not-allowed;
  border-color: rgba(203, 213, 225, 0.5);
  pointer-events: none;
}
.schools-form-grid .form-row:has(input[readonly]) label,
.schools-form-grid .form-row:has(select[disabled]) label {
  color: #94a3b8;
}
.schools-form-grid .form-row:has(input[readonly])::after {
  content: 'Solo admin';
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  background: rgba(241, 245, 249, 0.9);
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: 6px;
  vertical-align: middle;
}
.school-logo-upload-preview { max-height: 90px; max-width: 160px; object-fit: contain; border-radius: 8px; pointer-events: none; }

.school-management-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.school-management-meta span {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(239, 244, 255, 0.96);
  border: 1px solid rgba(203, 211, 235, 0.88);
  color: #536384;
  font-size: 0.75rem;
  font-weight: 800;
}

.school-management-warning,
.school-modal-note {
  margin: 0;
  color: #8a6431;
  font-size: 0.8rem;
  font-weight: 700;
}

.school-modal-note {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 246, 226, 0.96);
  border: 1px solid rgba(239, 205, 134, 0.82);
}

.schools-card-item,
.planning-card-item,
.task-item,
.efem-item,
.sch-item {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.schools-card-item:hover,
.planning-card-item:hover,
.task-item:hover,
.efem-item:hover,
.sch-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(45, 45, 78, 0.08);
}

.schools-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  margin-top: 0;
}

.schools-form-grid .is-full {
  grid-column: 1 / -1;
}

.groups-hub {
  width: 100%;
  max-width: none;
  display: grid;
  gap: 16px;
}

.planning-hub {
  width: 100%;
  max-width: none;
  display: grid;
  gap: 16px;
  min-height: calc(100vh - 126px);
  align-content: start;
}

.dashboard-home-blank {
  position: relative;
  min-height: calc(100vh - 150px);
  width: 100%;
  max-width: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(226, 231, 246, 0.86);
  box-shadow: 0 18px 42px rgba(42, 54, 92, 0.08);
}

.dashboard-home-bg-logo {
  position: absolute;
  width: min(62vw, 620px);
  max-width: 82%;
  opacity: 0.055;
  filter: grayscale(1);
  pointer-events: none;
  user-select: none;
}

.overview-hub {
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 126px);
  align-content: start;
}

.overview-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.overview-task-list,
.overview-level-list,
.overview-alert-list {
  margin-top: 0;
}

.groups-section-hero,
.planning-section-hero {
  margin-bottom: 0;
  border-radius: 28px;
  box-shadow: 0 18px 36px rgba(144, 104, 199, 0.18);
  gap: 14px;
  padding: 24px 28px;
  flex-direction: column;
  align-items: stretch;
}

/* ── Planning hero top row ── */
.planning-hero-top {
  display: flex;
  align-items: center;
  gap: 16px;
}

.planning-hero-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255,255,255,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #fff;
  flex-shrink: 0;
}

.planning-hero-titles {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.planning-hero-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.planning-hero-subtitle {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
}

.planning-hero-badges {
  display: flex;
  gap: 8px;
}

.planning-hero-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.planning-hero-badge i {
  font-size: 0.8rem;
  opacity: 0.85;
}

/* ── Planning hero divider ── */
.planning-section-hero .planning-hero-bottom {
  border-top: 1px solid rgba(255,255,255,0.2);
  padding-top: 14px;
}

/* ── Planning hero bottom row ── */
.planning-hero-bottom {
  display: flex;
  align-items: center;
  gap: 14px;
}

.planning-hero-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.planning-hero-field-label {
  color: rgba(255,255,255,0.65);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.planning-hero-group select {
  flex: 1;
  min-width: 0;
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.3);
  color: #fff;
  border-radius: 12px;
  padding: 9px 14px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: background 0.15s, border-color 0.15s;
}

.planning-hero-group select:focus {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.55);
}

.planning-hero-group select option {
  background: #7b6fcf;
  color: #fff;
}

.planning-hero-stats {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.planning-hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 14px;
  padding: 8px 18px;
  min-width: 60px;
  gap: 1px;
}

.planning-hero-stat span {
  color: rgba(255,255,255,0.65);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.planning-hero-stat strong {
  color: #fff;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.1;
}

.planning-hero-stat.is-total {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.4);
  padding-inline: 22px;
}

.planning-hero-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255,255,255,0.65);
  font-size: 0.82rem;
}

.planning-hero-hint a {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
}

.groups-section-hero {
  flex-direction: row;
  align-items: center;
}

#group-schedule {
  margin-top: 24px;
}

/* ── Planning locked state ── */
.is-planning-locked {
  opacity: 0.4;
  pointer-events: none;
  user-select: none;
  filter: grayscale(0.3);
  transition: opacity 0.25s, filter 0.25s;
}

[data-planning-locked] {
  transition: opacity 0.25s, filter 0.25s;
}

.group-summary-card,
.planning-summary-card {
  display: grid;
  gap: 16px;
  padding: 22px;
  border-radius: 26px;
  justify-items: start;
  text-align: left;
  background: linear-gradient(145deg, #ede8ff 0%, #dce8ff 60%, #e8f0ff 100%);
  border: 1.5px solid rgba(180, 170, 240, 0.35);
}

.overview-main-grid {
  position: relative;
  display: grid;
  grid-template-columns: 0 minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  overflow: visible;
  transition:
    grid-template-columns 0.68s cubic-bezier(0.19, 1, 0.22, 1),
    grid-template-rows 0.68s cubic-bezier(0.19, 1, 0.22, 1),
    gap 0.42s ease;
}

.overview-main-grid.is-sidebar-open {
  grid-template-columns: minmax(320px, 360px) minmax(0, 1fr);
  gap: 16px;
}

.overview-calendar-column {
  display: grid;
  gap: 14px;
  min-width: 0;
  transition: opacity 0.26s ease, transform 0.36s var(--motion-ease, ease);
}

.overview-bottom-panels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

.overview-bottom-panels > .overview-side-card:first-child {
  display: none;
}

.overview-efem-ticker {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 48px;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(185, 201, 238, 0.78);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 30px rgba(39, 56, 102, 0.08);
}

.overview-efem-ticker-label {
  position: relative;
  z-index: 2;
  height: 100%;
  min-height: 48px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #4f7fd8 0%, #42a38e 100%);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 10px 0 24px rgba(60, 91, 160, 0.16);
}

.overview-efem-ticker-track {
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
}

.overview-efem-ticker-content {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 28px;
  padding: 0 28px;
  animation: overviewTicker 24s linear infinite;
}

.overview-efem-ticker:hover .overview-efem-ticker-content {
  animation-play-state: paused;
}

.overview-efem-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #3a4568;
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

.overview-efem-ticker-item::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #7d98dd;
  opacity: 0.72;
  margin-left: 20px;
}

.overview-efem-ticker-item strong {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(82, 127, 216, 0.12);
  color: #315fbd;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

@keyframes overviewTicker {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.overview-sidebar,
.overview-sidebar-panels {
  display: grid;
  gap: 14px;
}

.overview-sidebar {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  min-height: calc(100vh - 260px);
  height: auto;
  max-height: none;
  align-self: start;
  overflow: hidden;
  padding: 0;
  border-radius: 22px;
  background: rgba(241, 246, 255, 0.96);
  border: 0 solid rgba(194, 207, 238, 0);
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  clip-path: inset(0 100% 0 0 round 22px);
  transform: translateX(-16px) scale(0.985);
  transition:
    clip-path 0.7s cubic-bezier(0.19, 1, 0.22, 1),
    opacity 0.46s ease,
    transform 0.7s cubic-bezier(0.19, 1, 0.22, 1),
    visibility 0s linear 0.46s,
    padding 0.46s ease,
    border-color 0.46s ease,
    box-shadow 0.46s ease;
}

.overview-sidebar-scroll {
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 14px;
  padding-right: 2px;
  padding-bottom: 78px;
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  transform: translateX(-8px);
  transition:
    opacity 0.48s ease,
    transform 0.62s cubic-bezier(0.19, 1, 0.22, 1);
}

.overview-main-grid.is-sidebar-open .overview-sidebar {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  clip-path: inset(0 0 0 0 round 22px);
  transform: translateX(0) scale(1);
  padding: 10px;
  align-self: stretch;
  border-width: 1px;
  border-color: rgba(194, 207, 238, 0.92);
  box-shadow: 0 18px 42px rgba(35, 48, 87, 0.14);
  animation: none;
  transition-delay: 0s;
}

.overview-main-grid.is-sidebar-open .overview-sidebar-scroll {
  opacity: 1;
  transform: translateX(0);
  transition-delay: 0.16s;
}

.overview-sidebar-backdrop {
  display: none;
}

.overview-main-grid.is-sidebar-open .overview-sidebar-backdrop {
  display: none;
}

.overview-sidebar-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 8px;
}

.overview-sidebar-drawer-head span {
  display: block;
  color: #6b789c;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.overview-sidebar-drawer-head strong {
  display: block;
  color: #2f3b5c;
  font-size: 0.98rem;
  line-height: 1.25;
}

.overview-sidebar-close {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(185, 199, 232, 0.9);
  border-radius: 999px;
  background: #fff;
  color: #5e6d98;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.overview-sidebar-close:hover {
  background: #edf3ff;
  color: #315bb8;
  transform: translateY(-1px);
}

.overview-sidebar-scroll-controls {
  position: absolute;
  right: 16px;
  top: 62px;
  z-index: 2;
  display: grid;
  gap: 8px;
}

.overview-sidebar-scroll-controls button {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(151, 173, 226, 0.86);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #4f68ad;
  box-shadow: 0 12px 26px rgba(34, 48, 88, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

.overview-sidebar-scroll-controls button:hover:not(:disabled) {
  background: #edf4ff;
  color: #2755b2;
  transform: translateY(-1px);
}

.overview-sidebar-scroll-controls button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  box-shadow: none;
}

.overview-side-card {
  padding: 14px 14px 15px;
}

.overview-panel-header {
  margin-bottom: 10px;
}

.overview-panel-header h3 {
  font-size: 1.09rem;
}

.overview-mini-link {
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

.overview-calendar-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-height: calc(100vh - 260px);
  padding: 10px 10px 12px;
}

.overview-calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 4px 8px;
  flex-wrap: wrap;
}

.overview-calendar-title-group,
.overview-calendar-actions,
.overview-calendar-nav,
.overview-calendar-view-switch {
  display: flex;
  align-items: center;
}
.overview-calendar-title-group {
  gap: 8px;
  flex-wrap: wrap;
  margin-right: auto;
}

.overview-calendar-title-group h3 {
  margin: 0;
  font-size: 1.38rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.overview-calendar-nav {
  gap: 5px;
}

.overview-calendar-nav-btn,
.overview-calendar-today,
.overview-calendar-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid #dadce0;
  background: #ffffff;
  color: #3c4043;
  box-shadow: none;
}
.overview-calendar-nav-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
}

.overview-calendar-today {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.overview-calendar-today.is-current {
  background: rgba(66, 133, 244, 0.12);
  border-color: rgba(66, 133, 244, 0.46);
  color: #1a73e8;
}

.overview-calendar-actions {
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.overview-calendar-view-switch {
  padding: 2px;
  gap: 3px;
  border-radius: 999px;
  border: 1px solid #dadce0;
  background: #ffffff;
}

.overview-calendar-view-switch button {
  border: 0;
  background: transparent;
  color: #5f6368;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.overview-calendar-view-switch button.is-active {
  background: #e8f0fe;
  color: #1a73e8;
}

.overview-calendar-cta {
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
}

.overview-calendar-cta.is-primary {
  background: #1a73e8;
  border-color: #1a73e8;
  color: #fff;
}

.overview-panel-toggle {
  position: relative;
  justify-content: flex-start;
  gap: 12px;
  min-height: 52px;
  padding: 7px 12px 7px 10px;
  border: 1.5px solid rgba(60, 100, 196, 0.5);
  background: linear-gradient(135deg, #ffffff 0%, #eaf2ff 100%);
  color: #244a9b;
  box-shadow: 0 12px 28px rgba(64, 96, 176, 0.17), 0 0 0 4px rgba(71, 118, 214, 0.06);
  overflow: hidden;
  cursor: pointer;
}

.overview-panel-toggle::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.72) 42%, transparent 72%);
  transform: translateX(-120%);
  transition: transform 0.42s var(--motion-ease, ease);
  pointer-events: none;
}

.overview-panel-toggle:hover::after {
  transform: translateX(120%);
}

.overview-panel-toggle-icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(70, 118, 218, 0.18), rgba(66, 163, 142, 0.16));
  color: #245ec4;
  flex: 0 0 auto;
}

.overview-panel-toggle-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1px;
  text-align: left;
  line-height: 1.1;
}

.overview-panel-toggle-copy strong {
  font-size: 0.82rem;
  font-weight: 900;
}

.overview-panel-toggle-copy small {
  color: #65759e;
  font-size: 0.66rem;
  font-weight: 800;
  white-space: nowrap;
}

.overview-panel-toggle[aria-expanded="true"] {
  background: linear-gradient(135deg, #e7f0ff 0%, #dff6f1 100%);
  border-color: rgba(47, 122, 196, 0.72);
  color: #174ea6;
  box-shadow: 0 14px 32px rgba(54, 96, 180, 0.2), 0 0 0 4px rgba(66, 163, 142, 0.08);
}

.overview-panel-toggle-arrow {
  position: relative;
  z-index: 1;
  width: 26px;
  height: 26px;
  margin-left: auto;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(72, 108, 190, 0.1);
  color: #315fbd;
  transition: transform 0.22s ease, background 0.22s ease, color 0.22s ease;
}

.overview-panel-toggle:hover {
  border-color: rgba(47, 97, 196, 0.72);
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(64, 96, 176, 0.22), 0 0 0 4px rgba(71, 118, 214, 0.08);
}

.overview-panel-toggle:hover .overview-panel-toggle-arrow {
  background: rgba(49, 95, 189, 0.16);
  transform: translateX(2px);
}

.overview-panel-toggle[aria-expanded="true"] .overview-panel-toggle-arrow {
  background: rgba(49, 126, 111, 0.14);
  color: #317e6f;
  transform: rotate(180deg);
}

.overview-calendar-grid {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  border: 1px solid #dfe1e5;
  border-radius: 28px;
  overflow: hidden;
  background: #ffffff;
  min-height: 100%;
}

.overview-calendar-weekdays,
.overview-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
}

.overview-calendar-days {
  grid-auto-rows: minmax(118px, 1fr);
}

.overview-calendar-weekdays {
  padding: 0;
  background: #f8f9fa;
  border-bottom: 1px solid #e5e8ec;
}

.overview-calendar-weekdays span {
  min-height: 40px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #5f6368;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #e5e8ec;
}

.overview-calendar-weekdays span:last-child {
  border-right: 0;
}

.overview-calendar-day {
  min-height: 0;
  padding: 9px 10px 8px;
  border-radius: 0;
  border: 0;
  border-right: 1px solid #e5e8ec;
  border-bottom: 1px solid #e5e8ec;
  background: #ffffff;
  display: grid;
  align-content: start;
  gap: 6px;
  transition: background 0.15s ease;
}

.overview-calendar-day:hover {
  background: #f8fbff;
}
.overview-calendar-day.is-outside {
  opacity: 1;
  background: #f8f9fa;
}
.overview-calendar-day.is-today {
  background: #ffffff;
}
.overview-calendar-day.is-efemeride {
  background: #fff8f6;
}
.overview-calendar-day.is-no-school {
  background: #fff4f0;
  box-shadow: inset 0 0 0 1px rgba(220, 79, 73, 0.18);
}
.overview-calendar-day.is-plan {
  background: #f8fbff;
}

.overview-calendar-day.is-selected {
  background: #eef5ff;
  box-shadow: inset 0 0 0 1px rgba(26, 115, 232, 0.35);
}

.overview-calendar-day-number {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: #3c4043;
}

.overview-calendar-day.is-today .overview-calendar-day-number {
  background: #1a73e8;
  color: #ffffff;
}

.overview-calendar-day-events {
  display: grid;
  gap: 3px;
}

.overview-calendar-event,
.overview-calendar-more {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  width: 100%;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 0.67rem;
  font-weight: 700;
}

.overview-calendar-event.is-plan {
  background: rgba(66, 133, 244, 0.12);
  color: #335fa7;
}

.overview-calendar-event.is-efemeride {
  background: rgba(234, 67, 53, 0.12);
  color: #bf3b2e;
}

.overview-calendar-event.is-suspension {
  background: rgba(220, 79, 73, 0.14);
  color: #a33a32;
  border: 1px solid rgba(220, 79, 73, 0.32);
}

.overview-calendar-event.is-council {
  background: rgba(126, 90, 201, 0.14);
  color: #5a3aa2;
  border: 1px solid rgba(126, 90, 201, 0.28);
}

.overview-calendar-event.is-workshop {
  background: rgba(36, 145, 126, 0.14);
  color: #1f7568;
  border: 1px solid rgba(36, 145, 126, 0.28);
}

.overview-calendar-event.is-admin {
  background: rgba(245, 172, 65, 0.18);
  color: #94601a;
  border: 1px solid rgba(245, 172, 65, 0.32);
}

.overview-calendar-event.is-vacation {
  background: rgba(69, 150, 214, 0.14);
  color: #2f6f9f;
  border: 1px solid rgba(69, 150, 214, 0.28);
}

.overview-calendar-event.is-enrollment {
  background: rgba(71, 118, 205, 0.14);
  color: #335fa7;
  border: 1px solid rgba(71, 118, 205, 0.28);
}

.overview-calendar-event.is-procedure {
  background: rgba(103, 112, 138, 0.14);
  color: #4f5d7c;
  border: 1px solid rgba(103, 112, 138, 0.28);
}

.overview-calendar-event.is-locked,
.overview-week-event.is-locked {
  cursor: default;
  user-select: none;
}

.overview-calendar-event.is-locked::before,
.overview-week-event.is-locked::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.72;
  margin-right: 4px;
  flex: 0 0 auto;
}

.overview-calendar-event.is-activity {
  background: rgba(66, 133, 244, 0.12);
  color: var(--event-color, #557ab9);
  border: 1px solid var(--event-color, #557ab9);
}

.overview-calendar-more {
  color: #5f6368;
  background: rgba(95, 99, 104, 0.12);
}

.overview-efem-list,
.overview-schedule-list {
  gap: 8px;
}

.overview-efem-item {
  background: rgba(245, 248, 255, 0.86);
}

.compact-empty-state {
  padding: 16px;
  border-radius: 18px;
}

.overview-schedule-list {
  display: grid;
}

.overview-schedule-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(212, 218, 236, 0.88);
  background: rgba(255, 255, 255, 0.78);
}
.overview-schedule-item strong,
.overview-schedule-item span {
  display: block;
}

.overview-schedule-item strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.overview-schedule-item span {
  color: #8088a6;
  font-size: 0.82rem;
  font-weight: 700;
}

.overview-schedule-item small {
  display: block;
  margin-top: 3px;
  color: #9aa2bd;
  font-size: 0.72rem;
  font-weight: 800;
}

.overview-task-list {
  display: grid;
  gap: 8px;
}

.overview-task-filters {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 12px;
  background: rgba(237, 241, 252, 0.9);
  border-radius: 12px;
  padding: 4px;
}

.overview-task-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.overview-task-metric {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(247, 249, 255, 0.96);
  border: 1px solid rgba(205, 212, 234, 0.88);
}

.overview-task-metric strong {
  font-size: 1.08rem;
  color: #35405f;
}

.overview-task-metric span {
  font-size: 0.74rem;
  font-weight: 800;
  color: #7a86a8;
}

.overview-task-metric.is-pending {
  background: rgba(255, 247, 233, 0.96);
}

.overview-task-metric.is-completed {
  background: rgba(236, 248, 239, 0.96);
}

.overview-task-metric.is-week {
  background: rgba(235, 243, 255, 0.96);
}

.overview-task-filter {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: #7a86a8;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.overview-task-filter:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.65);
  color: #4a5a80;
}

.overview-task-filter-count {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(126, 163, 232, 0.18);
  color: #6882b6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 900;
  padding: 0 5px;
}

.overview-task-filter.is-active {
  background: #fff;
  color: #3d5a99;
  box-shadow: 0 1px 4px rgba(90, 120, 200, 0.18), 0 0 0 1px rgba(190, 205, 240, 0.6);
}
.overview-task-filter.is-active .overview-task-filter-count {
  background: rgba(110, 140, 220, 0.15);
  color: #4a6aaa;
}

.overview-task-copy {
  min-width: 0;
}

.overview-task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.overview-task-actions form {
  margin: 0;
}

.overview-task-btn {
  border: 1px solid rgba(183, 191, 219, 0.9);
  border-radius: 999px;
  background: rgba(244, 247, 255, 0.96);
  color: #50607f;
  padding: 5px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.overview-task-btn.is-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  border-radius: 8px;
}

.overview-task-btn.is-danger {
  border-color: rgba(232, 148, 148, 0.92);
  color: #b33c4c;
  background: rgba(255, 239, 241, 0.94);
}

.overview-schedule-bar {
  width: 8px;
  height: 34px;
  border-radius: 999px;
}
.overview-schedule-bar.is-sky {
  background: linear-gradient(180deg, #8cb2f2 0%, #6e97e2 100%);
}
.overview-schedule-bar.is-lilac {
  background: linear-gradient(180deg, #d4c5f3 0%, #b6a2e4 100%);
}
.overview-schedule-bar.is-lime {
  background: linear-gradient(180deg, #c8e8ad 0%, #a8d87c 100%);
}
.overview-schedule-bar.is-rose {
  background: linear-gradient(180deg, #f2c1cb 0%, #ea9db0 100%);
}
.overview-schedule-bar.is-mint {
  background: linear-gradient(180deg, #bae7dd 0%, #8ed2c2 100%);
}
.overview-schedule-bar.is-amber {
  background: linear-gradient(180deg, #ffd394 0%, #f5ac41 100%);
}
.overview-schedule-bar.is-coral {
  background: linear-gradient(180deg, #ffaf9b 0%, #ef684b 100%);
}

.overview-calendar-panel.is-hidden {
  display: none;
}

.overview-calendar-hint {
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f1f3f4;
  color: #5f6368;
  font-size: 0.75rem;
  font-weight: 700;
}

.overview-week-shell {
  display: grid;
  gap: 0;
  border: 1px solid #dfe1e5;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
}

.overview-week-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-bottom: 1px solid #e8eaed;
  background: #fff;
}

.overview-week-toolbar strong {
  color: #3c4043;
  font-size: 0.9rem;
  font-weight: 700;
}

.overview-week-nav,
.overview-week-reset {
  border: 1px solid #dadce0;
  border-radius: 999px;
  background: #fff;
  color: #3c4043;
  padding: 6px 12px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s ease;
}

.overview-week-nav:hover,
.overview-week-reset:hover {
  background: #f1f3f4;
}

.overview-week-reset {
  margin-left: auto;
}

.overview-week-head,
.overview-week-grid {
  display: grid;
  grid-template-columns: 68px repeat(7, minmax(0, 1fr));
  gap: 0;
}

.overview-week-head {
  align-items: stretch;
  border-bottom: 1px solid #e8eaed;
}

.overview-week-head .hour,
.overview-week-head .day {
  background: #fff;
  color: #3c4043;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 8px 4px 10px;
  border-right: 1px solid #e8eaed;
}

.overview-week-head .hour {
  color: #5f6368;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 11px;
}

.overview-week-head .day .weekday {
  display: block;
  color: #5f6368;
  letter-spacing: 0.05em;
}

.overview-week-head .day strong {
  display: block;
  margin-top: 2px;
  font-size: 1.9rem;
  line-height: 1;
  font-weight: 500;
  color: #202124;
}

.overview-week-head .day:last-child {
  border-right: 0;
}

.overview-week-grid {
  max-height: 620px;
  overflow-y: auto;
}

.overview-week-grid .time,
.overview-week-grid .slot {
  min-height: 46px;
  border-right: 1px solid #e8eaed;
  border-bottom: 1px solid #e8eaed;
  background: #fff;
  padding: 6px;
  box-sizing: border-box;
}

.overview-week-grid .time {
  font-size: 0.8rem;
  font-weight: 700;
  color: #5f6368;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.overview-week-grid .slot:nth-child(8n + 8) {
  border-right: 0;
}

.overview-week-grid .time:nth-last-child(-n + 8),
.overview-week-grid .slot:nth-last-child(-n + 8) {
  border-bottom: 0;
}

.overview-week-event {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 0.72rem;
  font-weight: 700;
  border-left: 3px solid currentColor;
}

.overview-week-event.is-draggable,
.overview-calendar-event.is-activity[data-activity-id] {
  cursor: grab;
}

.overview-week-event.is-dragging,
.overview-calendar-event.is-activity.is-dragging {
  opacity: 0.45;
}

.overview-calendar-day.is-drop-target,
.overview-day-slot.is-drop-target,
.overview-week-grid .slot.is-drop-target {
  border-color: rgba(26, 115, 232, 0.45);
  box-shadow: inset 0 0 0 1px rgba(26, 115, 232, 0.2);
  background: #e8f0fe;
}

.overview-day-shell {
  display: grid;
  gap: 0;
  border: 1px solid #dfe1e5;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
}

.overview-day-heading {
  margin: 0;
  padding: 11px 14px;
  border-bottom: 1px solid #e8eaed;
  background: #fff;
  color: #202124;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  font-weight: 700;
}

.overview-day-list {
  display: grid;
  gap: 0;
}

.overview-day-row {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 0;
}

.overview-day-time,
.overview-day-slot {
  min-height: 46px;
  padding: 6px;
  border-right: 1px solid #e8eaed;
  border-bottom: 1px solid #e8eaed;
  background: #fff;
  box-sizing: border-box;
}

.overview-day-time {
  font-size: 0.8rem;
  font-weight: 700;
  color: #5f6368;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.overview-day-slot {
  display: flex;
  align-items: flex-start;
}

.overview-day-row:last-child .overview-day-time,
.overview-day-row:last-child .overview-day-slot {
  border-bottom: 0;
}

.overview-day-row .overview-day-slot {
  border-right: 0;
}

.overview-day-empty,
.overview-week-add {
  font-size: 0.74rem;
  color: #5f6368;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.12s ease, background 0.12s ease;
  opacity: 0.88;
}

.overview-day-empty:hover,
.overview-week-add:hover {
  color: #1a73e8;
  background: #e8f0fe;
  opacity: 1;
}

.overview-week-grid .slot[data-week-add],
.overview-day-slot[data-day-add] {
  cursor: pointer;
}

.overview-week-grid .slot[data-week-add]:hover,
.overview-day-slot[data-day-add]:hover {
  background: #e8f0fe;
}

.overview-week-grid .slot[data-week-add]:hover .overview-week-add,
.overview-day-slot[data-day-add]:hover .overview-day-empty {
  color: #1a73e8;
  background: transparent;
}

.overview-week-grid .slot:not([data-week-add]):hover,
.overview-day-slot:not([data-day-add]):hover {
  background: #f8fbff;
}

.overview-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.overview-modal.is-open {
  display: flex;
}

.overview-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(46, 54, 78, 0.24);
  backdrop-filter: blur(2px);
}

.overview-modal-dialog {
  position: relative;
  width: min(500px, 100%);
  max-height: calc(100vh - 40px);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: #f8f9ff;
  box-shadow: 0 20px 48px rgba(20, 28, 47, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: auto;
}

.overview-modal-dialog.is-wide {
  width: min(720px, 100%);
}

.overview-modal-header,
.overview-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
}

.overview-modal-header {
  border-bottom: 1px solid rgba(206, 214, 234, 0.72);
}

.overview-modal-footer {
  justify-content: flex-end;
  border-top: 1px solid rgba(206, 214, 234, 0.72);
}

/* Compact form rows inside modals */
.overview-modal-body .form-row {
  gap: 4px;
  margin-bottom: 0;
}

.overview-modal-body .form-row label {
  font-size: 0.72rem;
}

.overview-modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  color: #2d3452;
}

.overview-modal-dialog.is-wide .overview-modal-header h3 {
  font-size: 2.1rem;
}

.overview-modal-icon-btn {
  border: 0;
  background: transparent;
  color: #8189a6;
  font-size: 1.2rem;
  cursor: pointer;
}

.overview-modal-body {
  padding: 14px 18px 18px;
  display: grid;
  gap: 10px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.overview-field-grid {
  display: grid;
  gap: 10px;
}

.overview-field-grid.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.overview-field-stack {
  display: grid;
  gap: 7px;
}

.overview-field-stack label {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 900;
  color: #6f77a0;
}

.overview-field-stack input,
.overview-field-stack textarea,
.overview-schedule-row input:not([type='color']):not([type='hidden']),
.overview-schedule-row select {
  width: 100%;
  border: 1px solid rgba(201, 210, 233, 0.96);
  border-radius: 11px;
  background: #fff;
  padding: 9px 12px;
  font: inherit;
  color: #414867;
}

.overview-field-stack textarea {
  resize: vertical;
}

.overview-color-palette {
  display: flex;
  gap: 8px;
}

.overview-color-palette button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 2px solid transparent;
  background: var(--swatch);
  cursor: pointer;
}

.overview-color-palette button.is-active {
  border-color: #6f97e2;
  box-shadow: 0 0 0 2px rgba(111, 151, 226, 0.2);
}

.overview-schedule-col-headers {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(0, 1.6fr) 34px 34px;
  gap: 8px;
  padding: 0 2px;
}

.overview-schedule-col-headers span {
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #8892b5;
}

.overview-schedule-editor {
  display: grid;
  gap: 8px;
}

.overview-schedule-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(0, 1.6fr) 34px 34px;
  gap: 8px;
  align-items: center;
}

.overview-schedule-remove-btn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(216, 135, 135, 0.75);
  background: rgba(255, 241, 241, 0.9);
  color: #b84e5d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.overview-schedule-remove-btn:hover {
  background: rgba(255, 229, 229, 0.95);
  border-color: rgba(204, 102, 102, 0.88);
  transform: translateY(-1px);
}

.overview-schedule-remove-btn i {
  font-size: 0.82rem;
}

.overview-color-input {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.overview-color-input input[type='color'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.overview-schedule-chip {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(123, 134, 170, 0.4);
  display: block;
  cursor: pointer;
  transition: transform 0.12s;
}
.overview-schedule-chip:hover {
  transform: scale(1.12);
}

.overview-schedule-chip.is-sky {
  background: #9ab5ef;
}

.overview-schedule-chip.is-lilac {
  background: #b7a6d8;
}

.overview-schedule-chip.is-lime {
  background: #b6cfa2;
}

.overview-schedule-chip.is-rose {
  background: #efb5c3;
}

.overview-schedule-chip.is-mint {
  background: #98d9c8;
}

.overview-schedule-chip.is-amber {
  background: #f5ac41;
}

.overview-schedule-chip.is-coral {
  background: #ef684b;
}

.group-schedule-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.group-schedule-tab {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(203, 211, 235, 0.9);
  background: rgba(248, 250, 255, 0.96);
  color: #50607f;
  text-decoration: none;
}

.group-schedule-tab strong {
  font-size: 0.92rem;
}

.group-schedule-tab span {
  font-size: 0.76rem;
  color: #8290b0;
  font-weight: 700;
}

.group-schedule-tab.is-active {
  border-color: rgba(114, 152, 226, 0.92);
  background: rgba(232, 239, 255, 0.98);
}

.group-schedule-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(243, 246, 255, 0.95);
}

.group-schedule-summary strong {
  color: #34405f;
}

.group-schedule-summary span {
  color: #7482a4;
  font-size: 0.8rem;
  font-weight: 700;
}

.group-schedule-form {
  display: grid;
  gap: 14px;
}

.group-schedule-clone-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(247, 249, 255, 0.96);
  border: 1px solid rgba(203, 211, 235, 0.88);
}

.group-schedule-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(239, 245, 255, 0.96);
  border: 1px solid rgba(196, 207, 235, 0.88);
}

.group-schedule-toolbar span {
  color: #6d7a9d;
  font-size: 0.8rem;
  font-weight: 700;
}

.group-schedule-undo-form {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 246, 226, 0.96);
  border: 1px solid rgba(239, 205, 134, 0.82);
}

.group-schedule-undo-form span {
  color: #7d6a35;
  font-size: 0.8rem;
  font-weight: 700;
}

.group-schedule-clone-label {
  color: #5f6d92;
  font-size: 0.82rem;
  font-weight: 800;
}

.group-schedule-clone-form select {
  width: 100%;
  border: 1px solid rgba(201, 210, 233, 0.96);
  border-radius: 11px;
  background: #fff;
  padding: 9px 12px;
  font: inherit;
  color: #414867;
}

.dashboard-toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 130;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.dashboard-toast {
  min-width: 220px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(42, 51, 78, 0.96);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 800;
  box-shadow: 0 18px 36px rgba(18, 24, 42, 0.2);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.dashboard-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.dashboard-toast.is-success {
  background: rgba(45, 107, 78, 0.96);
}

.dashboard-toast.is-error {
  background: rgba(159, 56, 70, 0.96);
}

.group-schedule-row {
  grid-template-columns: minmax(0, 1fr) 150px 180px 30px;
}

.group-schedule-subject-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.group-schedule-subject-wrap input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  padding-right: 30px;
}

.group-schedule-remove-row {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #b0bacf;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  padding: 0;
  z-index: 1;
}

.group-schedule-remove-row:hover {
  background: #ffe3e3;
  color: #e05252;
}


.group-schedule-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.group-schedule-footnote {
  margin: 0;
  color: #7482a4;
  font-size: 0.78rem;
  font-weight: 700;
}

.group-schedule-history {
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(248, 250, 255, 0.96);
  border: 1px solid rgba(203, 211, 235, 0.88);
}

.group-schedule-history-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.group-schedule-history-header strong {
  color: #374261;
}

.group-schedule-history-header span {
  color: #7a86a8;
  font-size: 0.76rem;
  font-weight: 800;
}

.group-schedule-history-list {
  display: grid;
  gap: 10px;
}

.group-schedule-history-item {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(211, 218, 238, 0.88);
}

.group-schedule-history-item.is-clone {
  border-left: 4px solid #6a96e5;
}

.group-schedule-history-item.is-undo {
  border-left: 4px solid #d6a34a;
}

.group-schedule-history-item strong {
  color: #374261;
  font-size: 0.84rem;
}

.group-schedule-history-item span,
.group-schedule-history-item small {
  color: #7a86a8;
  font-size: 0.75rem;
  font-weight: 700;
}

.group-schedule-print-sheet {
  display: none;
}

.group-schedule-print-header {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.group-schedule-print-header strong {
  font-size: 1.2rem;
  color: #27304a;
}

.group-schedule-print-header span {
  color: #65728f;
  font-size: 0.86rem;
}

.group-schedule-print-table {
  width: 100%;
  border-collapse: collapse;
}

.group-schedule-print-table th,
.group-schedule-print-table td {
  border: 1px solid rgba(184, 194, 220, 0.92);
  padding: 10px 12px;
  text-align: left;
}

.group-schedule-print-table th {
  background: rgba(239, 245, 255, 0.96);
  color: #394465;
}

@media (max-width: 900px) {
  .overview-main-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 0 minmax(0, auto);
    gap: 0;
  }

  .overview-efem-ticker {
    grid-template-columns: 1fr;
  }

  .overview-efem-ticker-label {
    min-height: 38px;
    justify-content: center;
  }

  .overview-efem-ticker-track {
    min-height: 42px;
    display: flex;
    align-items: center;
  }

  .overview-main-grid.is-sidebar-open {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(320px, 58vh) minmax(0, auto);
    gap: 14px;
  }

  .overview-sidebar {
    min-height: 0;
    height: 100%;
    max-height: 58vh;
  }

  .overview-bottom-panels {
    grid-template-columns: 1fr;
  }

  .overview-calendar-toolbar,
  .overview-calendar-actions,
  .overview-calendar-title-group {
    align-items: flex-start;
  }

  .overview-calendar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .overview-panel-toggle {
    width: 100%;
    max-width: 360px;
  }

  .overview-calendar-view-switch {
    width: 100%;
    overflow-x: auto;
  }

  .overview-calendar-card {
    min-height: 0;
  }

  .overview-calendar-day {
    min-height: 96px;
  }

  .overview-week-head,
  .overview-week-grid {
    grid-template-columns: 62px repeat(7, minmax(110px, 1fr));
    overflow-x: auto;
  }

  .overview-day-row {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .task-item {
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: start;
  }

  .overview-task-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .overview-modal {
    padding: 10px;
    align-items: flex-start;
  }

  .overview-modal-header h3,
  .overview-modal-dialog.is-wide .overview-modal-header h3 {
    font-size: 1.5rem;
  }

  .overview-field-grid.two-cols,
  .overview-schedule-row {
    grid-template-columns: 1fr;
  }

  .overview-schedule-col-headers {
    display: none;
  }

  .group-schedule-summary,
  .group-schedule-toolbar,
  .group-schedule-actions,
  .group-schedule-undo-form,
  .group-schedule-history-header {
    flex-direction: column;
    align-items: stretch;
  }

  .overview-week-toolbar {
    justify-content: flex-start;
  }

  .overview-week-reset {
    margin-left: 0;
  }

  .group-schedule-clone-form {
    grid-template-columns: 1fr;
  }

  .overview-task-metrics {
    grid-template-columns: 1fr;
  }

  .planning-workspace,
  .planning-form-actions,
  .planning-class-glance,
  .planning-mini-stats {
    grid-template-columns: 1fr;
  }

  /* Métricas: grid 2x2 con altura fija */
  .planning-top-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
  }

  .planning-metric-card {
    flex-direction: row;
    align-items: center;
    min-height: 72px;
    padding: 12px 14px;
    gap: 12px;
    border-radius: 18px;
  }

  .planning-metric-icon {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
    border-radius: 12px;
    flex-shrink: 0;
  }

  .planning-metric-copy {
    min-width: 0;
    flex: 1;
  }

  .planning-metric-copy span {
    font-size: 0.65rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }

  .planning-metric-copy strong {
    font-size: 1.4rem;
    line-height: 1.1;
  }

  .planning-metric-copy strong.planning-metric-text {
    font-size: 0.9rem;
    line-height: 1.2;
  }

  /* Workspace: columna única */
  .planning-workspace {
    grid-template-columns: 1fr;
  }

  .planning-canvas-shell {
    display: grid;
    gap: 14px;
  }

  .planning-canvas-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .planning-recent-link {
    width: 100%;
    justify-content: center;
  }

  .planning-form-actions {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .planning-secondary-action {
    width: 100%;
    text-align: center;
  }
}

/* ── Mobile small: planeaciones ────────────── */
@media (max-width: 600px) {
  .planning-hub {
    width: 100%;
    overflow-x: hidden;
  }

  .planning-top-metrics {
    gap: 8px;
    margin-bottom: 12px;
  }

  .planning-metric-card {
    min-height: 64px;
    padding: 10px 12px;
    gap: 10px;
    border-radius: 16px;
  }

  .planning-metric-icon {
    width: 34px;
    height: 34px;
    font-size: 0.85rem;
    border-radius: 10px;
  }

  .planning-metric-copy strong {
    font-size: 1.25rem;
  }

  .planning-metric-copy strong.planning-metric-text {
    font-size: 0.82rem;
  }

  /* Form cards: padding reducido */
  .planning-side-card {
    padding: 14px;
    gap: 10px;
  }

  .planning-side-card-header h3 {
    font-size: 0.94rem;
  }

  /* Inputs */
  .planning-studio-form select,
  .planning-studio-form input,
  .planning-studio-form textarea {
    padding: 9px 11px;
    font-size: 0.88rem;
  }

  /* Glance y mini-stats: 2 columnas */
  .planning-class-glance,
  .planning-mini-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  /* Canvas */
  .planning-canvas-card {
    padding: 14px;
  }

  .planning-canvas-header h3 { font-size: 1rem; }

  /* Recientes */
  .planning-card-item {
    padding: 12px 14px;
    border-radius: 14px;
  }

  /* Submit */
  .auth-submit.profile-submit {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  /* Preview */
  .planning-preview-card,
  .planning-preview-empty {
    padding: 14px;
    border-radius: 16px;
  }

  /* Chips: scroll horizontal */
  .planning-chip-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }
}

@media print {
  .app,
  .dashboard-toast-stack {
    display: none !important;
  }

  .group-schedule-print-sheet {
    display: block !important;
    padding: 20px;
  }

  body {
    background: #fff;
  }
}

.planning-summary-link {
  width: 100%;
}

.planning-top-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.planning-metric-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 96px;
  padding: 18px 20px;
  border-radius: 24px;
}

.planning-metric-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), var(--a-pale));
  color: var(--a-txt);
  font-size: 1.18rem;
  box-shadow: inset 0 0 0 1px rgba(127, 163, 232, 0.14);
}

.planning-metric-copy {
  display: grid;
  gap: 2px;
}

.planning-metric-copy span,
.planning-metric-copy small {
  color: #848fb0;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.planning-metric-copy strong {
  color: #2f3652;
  font-size: 1.85rem;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.planning-metric-copy strong.planning-metric-text {
  font-size: 1.1rem;
  line-height: 1.2;
  white-space: normal;
}

.planning-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.planning-form-shell-card {
  padding: 0;
}

.planning-studio-form {
  display: grid;
  gap: 8px;
}

.planning-side-card {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(219, 225, 242, 0.72);
}

.planning-side-card:last-child {
  border-bottom: 0;
}

.planning-side-card-header {
  display: grid;
  gap: 4px;
}

.planning-side-card-header h3 {
  margin: 0;
  color: #374261;
  font-size: 1.05rem;
}

.planning-side-card-header p {
  margin: 0;
  color: #647397;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.45;
}

.planning-field-stack {
  display: grid;
  gap: 7px;
}

.planning-field-stack label,
.planning-studio-form .form-row label {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 900;
  color: #62709a;
}

.planning-studio-form select,
.planning-studio-form input,
.planning-studio-form textarea {
  width: 100%;
  border: 1px solid rgba(201, 210, 233, 0.96);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  font: inherit;
  color: #414867;
}

.planning-multiselect {
  position: relative;
  display: grid;
  gap: 8px;
}

.planning-multiselect-trigger {
  width: 100%;
  border: 1px solid rgba(201, 210, 233, 0.96);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  color: #5a6488;
  text-align: left;
  font: inherit;
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.planning-multiselect-trigger::after {
  content: "\F282";
  font-family: bootstrap-icons;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #8e9ac1;
  font-size: 0.84rem;
}

.planning-multiselect-trigger > i {
  color: #7d8fbc;
  font-size: 0.95rem;
}

.planning-multiselect-trigger > span {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.planning-multiselect.has-selection {
  align-items: start;
}

.planning-multiselect.has-selection .planning-multiselect-trigger {
  position: relative;
  right: auto;
  top: auto;
  width: 100%;
  min-width: 0;
  height: auto;
  padding: 10px 12px;
  border-radius: 12px;
  justify-content: flex-start;
  border: 1px solid rgba(187, 198, 230, 0.96);
  background: rgba(248, 250, 255, 0.96);
  z-index: 1;
}

.planning-multiselect.has-selection .planning-multiselect-trigger::after {
  display: block;
}

.planning-multiselect.has-selection .planning-multiselect-trigger > span {
  display: inline;
}

.planning-multiselect.has-selection .planning-multiselect-trigger > i {
  color: #5369ac;
  font-size: 0.92rem;
}

.planning-multiselect.has-selection .planning-multiselect-chips {
  padding-right: 0;
  min-height: 0;
}

.planning-multiselect-menu {
  position: fixed;
  top: var(--ms-menu-top, 0);
  left: var(--ms-menu-left, 0);
  right: auto;
  width: var(--ms-menu-width, 360px);
  z-index: 1450;
  border: 1px solid rgba(201, 210, 233, 0.96);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 36px rgba(24, 34, 66, 0.15);
  max-height: var(--ms-menu-max-height, min(360px, 46vh));
  padding: 6px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.planning-multiselect-menu[hidden] {
  display: none;
}

.planning-multiselect-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 2px 8px;
  border-bottom: 1px solid rgba(220, 226, 244, 0.8);
  margin-bottom: 6px;
}

.planning-multiselect-action {
  border: 0;
  background: transparent;
  color: #5f72a8;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 8px;
}

.planning-multiselect-action:hover {
  background: rgba(109, 136, 218, 0.12);
}

.planning-multiselect-options {
  max-height: 164px;
  overflow-y: auto;
  display: grid;
  gap: 2px;
  padding-right: 2px;
}

.planning-multiselect-option {
  position: relative;
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 9px;
  cursor: pointer;
}

.planning-multiselect-option:hover {
  background: rgba(245, 248, 255, 0.95);
}

.planning-multiselect-option input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.planning-multiselect-check {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid rgba(188, 200, 230, 0.95);
  background: #fff;
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  transition: all 0.15s ease;
  box-shadow: inset 0 1px 2px rgba(44, 62, 108, 0.08);
}

.planning-multiselect-option input[type="checkbox"]:checked + .planning-multiselect-check {
  background: linear-gradient(135deg, rgba(110, 142, 229, 0.2), rgba(110, 199, 154, 0.2));
  border-color: rgba(102, 136, 220, 0.7);
  color: #4f70cb;
}

.planning-multiselect-option input[type="checkbox"]:focus-visible + .planning-multiselect-check {
  outline: 2px solid rgba(102, 136, 220, 0.35);
  outline-offset: 1px;
}

.planning-multiselect-text {
  color: #424d73;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
}

.planning-multiselect-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.planning-selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(232, 238, 255, 0.9);
  color: #455782;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.2;
}

.planning-selected-chip i {
  font-size: 0.72rem;
  opacity: 0.95;
}

.planning-selected-chip.is-eje {
  background: rgba(106, 136, 220, 0.14);
  border-color: rgba(106, 136, 220, 0.28);
  color: #3f5cab;
}

.planning-multiselect-empty {
  color: #6f7da4;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.35;
}

.planning-pda-picker {
  display: grid;
  gap: 8px;
}

.planning-pda-open {
  width: 100%;
  border: 1px solid rgba(201, 210, 233, 0.96);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  color: #5a6488;
  text-align: left;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.planning-pda-open i {
  color: #d86b18;
}

.planning-pda-picker.is-blocked .planning-pda-open,
.planning-pda-open:disabled {
  background: rgba(245, 247, 253, 0.95);
  border-color: rgba(201, 210, 233, 0.82);
  color: #9aa6c8;
  cursor: not-allowed;
  box-shadow: none;
}

.planning-pda-picker.is-blocked .planning-pda-open i,
.planning-pda-open:disabled i {
  color: #a9b5d2;
}

.planning-pda-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.planning-pda-summary span {
  padding: 0;
  border-radius: 0;
  font-size: 0.8rem;
  font-weight: 800;
  background: transparent;
  color: #556896;
}

.planning-pda-chips {
  margin-top: 2px;
}

.planning-pda-selected-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin-top: 4px;
  width: 100%;
}

.planning-wizard-modal {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: none;
  place-items: center;
  padding: 18px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.planning-wizard-modal.is-open {
  display: grid;
}

.planning-wizard-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(49, 56, 82, 0.24);
  backdrop-filter: blur(2px);
}

.planning-wizard-dialog {
  position: relative;
  z-index: 1;
  width: min(820px, calc(100vw - 28px));
  max-height: min(720px, calc(100vh - 28px));
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(205, 216, 242, 0.95);
  border-radius: 18px;
  background: linear-gradient(180deg, #f7f9ff 0%, #eef3ff 100%);
  box-shadow: 0 24px 72px rgba(24, 35, 67, 0.32);
  padding: 0;
}

.planning-wizard-modal.is-open .planning-wizard-dialog {
  animation-fill-mode: none;
  transform: none;
  will-change: auto;
}

.planning-wizard-scroll-controls {
  position: fixed;
  top: 50%;
  right: max(12px, calc((100vw - min(820px, calc(100vw - 28px))) / 2 - 54px));
  z-index: 12001;
  display: grid;
  gap: 8px;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.planning-wizard-modal.is-open .planning-wizard-scroll-controls.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.planning-wizard-scroll-controls button {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(156, 176, 228, 0.82);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #526aa8;
  box-shadow: 0 12px 28px rgba(38, 52, 95, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

.planning-wizard-scroll-controls button:hover:not(:disabled) {
  background: #eef4ff;
  color: #315bb8;
  transform: translateY(-1px);
}

.planning-wizard-scroll-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
  box-shadow: none;
}

.planning-wizard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px 10px;
  border-bottom: 1px solid rgba(213, 222, 244, 0.9);
  background: rgba(255, 255, 255, 0.72);
}

.planning-wizard-kicker {
  display: block;
  color: #6b7aa8;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.planning-wizard-head h3 {
  margin: 1px 0 0;
  color: #2f3c62;
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1.2;
}

.planning-wizard-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(213, 222, 244, 0.9);
  background: linear-gradient(180deg, rgba(248, 250, 255, 0.96) 0%, rgba(239, 244, 255, 0.96) 100%);
}

.planning-wizard-step {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 40px;
  border: 1px solid rgba(190, 203, 234, 0.9);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  color: #556693;
  font: inherit;
  cursor: default;
  padding: 6px 9px;
  text-align: left;
  box-shadow: 0 8px 18px rgba(54, 74, 128, 0.06);
  pointer-events: none;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.planning-wizard-step:hover {
  border-color: rgba(190, 203, 234, 0.9);
  box-shadow: 0 8px 18px rgba(54, 74, 128, 0.06);
}

.planning-wizard-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 999px;
  background: rgba(231, 238, 255, 0.96);
  color: #5570b6;
  font-size: 0.76rem;
  font-weight: 900;
}

.planning-wizard-step-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.planning-wizard-step-copy small {
  color: #8793ba;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.planning-wizard-step-copy strong {
  color: #45547e;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planning-wizard-step.is-active {
  border-color: rgba(67, 108, 210, 0.95);
  background: linear-gradient(180deg, rgba(232, 240, 255, 0.98) 0%, rgba(215, 228, 255, 0.98) 100%);
  box-shadow: 0 14px 28px rgba(68, 105, 196, 0.16);
}

.planning-wizard-step.is-active .planning-wizard-step-num {
  background: linear-gradient(135deg, #5076d7, #43a67a);
  color: #fff;
}

.planning-wizard-step.is-active .planning-wizard-step-copy small {
  color: #506cac;
}

.planning-wizard-step.is-active .planning-wizard-step-copy strong {
  color: #244fae;
}

.planning-wizard-panel {
  display: none;
  border-bottom: 0;
  padding: 14px 18px;
}

.planning-wizard-panel .planning-side-card-header {
  gap: 2px;
}

.planning-wizard-panel .planning-side-card-header h3 {
  font-size: 0.98rem;
}

.planning-wizard-panel .planning-side-card-header p {
  font-size: 0.76rem;
}

.planning-wizard-panel .form-row {
  margin-bottom: 10px;
}

.planning-wizard-panel .form-row.is-full {
  margin-bottom: 8px;
}

.planning-wizard-panel.is-active {
  display: grid;
}

.planning-wizard-panel .planning-acc-toggle {
  pointer-events: none;
}

.planning-wizard-panel .planning-acc-chevron {
  display: none;
}

.planning-wizard-panel .planning-acc-body {
  display: block;
}

.planning-skip-context {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 440px;
  margin: 2px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #6f7da4;
  cursor: pointer;
  box-shadow: none;
  transition: color 0.18s ease;
}

.planning-skip-context:hover {
  color: #4d6295;
  box-shadow: none;
}

.planning-skip-context input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.planning-skip-context-box {
  width: 18px;
  height: 18px;
  border: 1.5px solid rgba(107, 128, 181, 0.48);
  border-radius: 6px;
  background: #fff;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-shadow: none;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.planning-skip-context-box i {
  font-size: 0.68rem;
  opacity: 0;
  transform: scale(0.82);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.planning-skip-context input:checked + .planning-skip-context-box {
  border-color: #4e79d8;
  background: #4e79d8;
  box-shadow: 0 3px 8px rgba(78, 121, 216, 0.22);
}

.planning-skip-context input:checked + .planning-skip-context-box i {
  opacity: 1;
  transform: scale(1);
}

.planning-skip-context span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.planning-skip-context strong {
  color: inherit;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: none;
}

.planning-skip-context small {
  color: #8a97ba;
  font-size: 0.7rem;
  font-weight: 700;
}

.planning-wizard-panel .planning-form-grid {
  display: grid;
}

.planning-pedagogy-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 12px;
  row-gap: 6px;
}

.planning-pedagogy-grid .form-row:not(.is-full) {
  min-width: 0;
}

.planning-pedagogy-grid .planning-multiselect {
  min-width: 0;
}

.planning-pedagogy-grid .planning-multiselect-trigger {
  width: 100%;
}

.planning-pedagogy-grid .planning-multiselect-menu {
  position: fixed;
  top: var(--ms-menu-top, 0);
  left: var(--ms-menu-left, 0);
  right: auto;
  width: var(--ms-menu-width, 360px);
  margin-top: 0;
  max-height: var(--ms-menu-max-height, min(360px, 46vh));
  z-index: 1450;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.planning-pedagogy-grid .planning-multiselect-menu[hidden] {
  display: none;
}

.planning-pedagogy-grid .planning-multiselect-options {
  max-height: none;
  min-height: 0;
  overflow-y: auto;
}

.planning-pedagogy-grid .planning-multiselect.is-open {
  z-index: 121;
}

.planning-pedagogy-grid .planning-ejes-row {
  position: relative;
  margin-top: 2px;
  padding: 12px;
  border: 1px solid rgba(202, 213, 240, 0.72);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.46);
}

.planning-pedagogy-grid .planning-pda-row,
.planning-pedagogy-grid .planning-ejes-row {
  align-self: start;
}

.planning-pedagogy-grid .planning-pda-row {
  margin-top: 2px;
  padding: 12px;
  border: 1px solid rgba(202, 213, 240, 0.72);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.46);
}

.planning-pedagogy-grid .planning-pda-row .field-help {
  margin-top: 5px;
  font-size: 0.68rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.planning-pedagogy-grid .planning-ejes-row > label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.planning-pedagogy-grid .planning-ejes-row > label::before {
  content: "\F3E7";
  font-family: bootstrap-icons;
  color: #6c82c7;
  font-size: 0.86rem;
  line-height: 1;
}

.planning-pedagogy-grid .planning-field-stack {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  align-self: start;
}

.planning-pedagogy-grid .planning-field-stack .form-row {
  margin-bottom: 0;
}

.planning-wizard-panel .planning-studio-form select,
.planning-wizard-panel .planning-studio-form input,
.planning-wizard-panel .planning-studio-form textarea,
.planning-wizard-panel select,
.planning-wizard-panel input,
.planning-wizard-panel textarea {
  min-height: 42px;
  padding: 8px 12px;
}

.planning-wizard-panel textarea[readonly] {
  background: rgba(245, 248, 255, 0.92);
  color: #6f7ca6;
  cursor: not-allowed;
  resize: none;
}

.planning-wizard-panel .planning-pda-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  row-gap: 6px;
}

.planning-wizard-panel .planning-pda-row .planning-pda-picker {
  grid-template-columns: minmax(0, 1fr);
}

.planning-wizard-panel .planning-pda-open,
.planning-wizard-panel .planning-multiselect-trigger {
  min-height: 42px;
  padding: 8px 12px;
}

.planning-wizard-panel .planning-pda-open {
  min-width: 0;
}

.planning-wizard-panel .planning-pda-summary {
  justify-content: flex-start;
  white-space: nowrap;
  gap: 6px;
}

.planning-wizard-panel .planning-pda-row .planning-pda-summary {
  display: none;
}

.planning-wizard-panel .planning-pda-summary span {
  font-size: 0.74rem;
}

.planning-wizard-panel .planning-pda-row .planning-pda-summary span {
  font-size: 0.7rem;
}

.planning-wizard-panel .planning-pda-chips {
  grid-column: 1 / -1;
  margin-top: 0;
}

.planning-wizard-panel .planning-pda-row .planning-pda-chips {
  min-height: 0;
}

.planning-wizard-panel .planning-pda-row .planning-multiselect-empty,
.planning-wizard-panel .planning-pda-row .planning-pda-selection-note {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-top: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(232, 238, 255, 0.58);
  color: #6f7fae;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1.2;
}

.planning-wizard-panel .field-help,
.planning-wizard-panel .planning-pda-selection-note {
  font-size: 0.73rem;
  line-height: 1.35;
}

.planning-wizard-panel .form-row.is-full > .field-help {
  margin-top: 3px;
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.planning-wizard-panel .planning-pda-selected-list {
  gap: 5px;
}

.planning-wizard-panel .planning-pda-selected-item {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 0.7rem;
}

.planning-wizard-panel .planning-pda-selected-field {
  font-size: 0.58rem;
}

.planning-confirm-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.planning-confirm-card {
  position: relative;
  display: grid;
  gap: 5px;
  min-height: 82px;
  padding: 12px;
  border: 1px solid rgba(200, 212, 239, 0.92);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
}

.planning-confirm-card span {
  color: #62729c;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.25;
}

.planning-confirm-card strong {
  color: #344267;
  font-size: 0.95rem;
  line-height: 1.42;
}

.planning-confirm-detail-trigger {
  justify-self: start;
  width: fit-content;
  border: 1px solid rgba(133, 157, 220, 0.55);
  border-radius: 999px;
  background: rgba(235, 241, 255, 0.92);
  color: #536ca8;
  padding: 3px 9px;
  font-size: 0.74rem;
  font-weight: 900;
  cursor: pointer;
  line-height: 1.2;
}

.planning-confirm-tooltip {
  position: fixed;
  left: var(--confirm-tooltip-left, 16px);
  top: var(--confirm-tooltip-top, 16px);
  width: var(--confirm-tooltip-width, min(560px, calc(100vw - 36px)));
  max-height: var(--confirm-tooltip-max-height, min(440px, calc(100vh - 36px)));
  overflow-y: auto;
  padding: 12px 12px 46px;
  border: 1px solid rgba(136, 161, 215, 0.86);
  border-radius: 14px;
  background: rgba(22, 38, 75, 0.98);
  color: #edf3ff;
  box-shadow: 0 18px 38px rgba(21, 35, 71, 0.34);
  font-size: 0.8rem;
  line-height: 1.5;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 12000;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  touch-action: pan-y;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  transform: translateY(4px);
}

.planning-confirm-card-detail:hover .planning-confirm-tooltip,
.planning-confirm-card-detail:focus-within .planning-confirm-tooltip,
.planning-confirm-card-detail.is-open .planning-confirm-tooltip {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.planning-confirm-tooltip-section {
  display: grid;
  gap: 7px;
}

.planning-confirm-tooltip-section + .planning-confirm-tooltip-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(202, 216, 255, 0.18);
}

.planning-confirm-tooltip-section > strong {
  color: #d2e3ff;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.planning-confirm-tooltip-section p {
  margin: 0;
  color: #edf3ff;
  font-weight: 800;
}

.planning-confirm-detail-item {
  display: grid;
  gap: 5px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
}

.planning-confirm-detail-item + .planning-confirm-detail-item {
  margin-top: 7px;
}

.planning-confirm-detail-item b {
  color: #ffffff;
}

.planning-confirm-detail-field {
  width: fit-content;
  max-width: 100%;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(210, 227, 255, 0.13);
  color: #cfe0ff;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.25;
}

.planning-confirm-detail-item ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 16px;
}

.planning-confirm-detail-item small {
  color: #b9cfff;
  font-weight: 700;
}

.planning-confirm-tooltip-actions {
  position: sticky;
  left: 0;
  right: 0;
  bottom: -46px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 10px -2px -36px;
  padding: 8px 0 0;
  background: linear-gradient(180deg, rgba(22, 38, 75, 0), rgba(22, 38, 75, 0.98) 28%);
}

.planning-confirm-tooltip-actions button {
  border: 1px solid rgba(205, 222, 255, 0.28);
  border-radius: 999px;
  background: rgba(239, 246, 255, 0.12);
  color: #edf3ff;
  padding: 6px 10px;
  font-size: 0.74rem;
  font-weight: 900;
  cursor: pointer;
  line-height: 1.2;
}

.planning-confirm-tooltip-actions button:hover:not(:disabled) {
  background: rgba(239, 246, 255, 0.2);
}

.planning-confirm-tooltip-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.planning-wizard-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 18px 12px;
  border-top: 1px solid rgba(213, 222, 244, 0.9);
  background: rgba(255, 255, 255, 0.72);
}

.planning-wizard-footer .planning-secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 118px;
  min-height: 40px;
  border-radius: 12px;
  padding: 9px 14px;
  font-size: 0.88rem;
  font-weight: 900;
  cursor: pointer;
  opacity: 1;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.planning-wizard-footer [data-plan-prev] {
  border: 1px solid rgba(185, 199, 233, 0.92);
  background: linear-gradient(180deg, #ffffff 0%, #f1f5ff 100%);
  color: #526490;
  box-shadow: 0 8px 18px rgba(68, 88, 140, 0.08);
}

.planning-wizard-footer [data-plan-prev][hidden] {
  display: none !important;
}

.planning-wizard-footer [data-plan-next] {
  margin-left: auto;
  border: 1px solid rgba(61, 126, 104, 0.42);
  background: linear-gradient(135deg, #5376d4 0%, #41a879 100%);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(65, 129, 143, 0.22);
}

.planning-wizard-footer [data-plan-next].is-submit-step {
  min-width: 178px;
  background: linear-gradient(135deg, #7146c7 0%, #9668d8 100%);
  border-color: rgba(113, 70, 199, 0.42);
  box-shadow: 0 16px 32px rgba(101, 73, 177, 0.28);
}

.planning-wizard-footer [data-plan-prev]:hover:not(:disabled) {
  border-color: rgba(120, 146, 212, 0.92);
  background: linear-gradient(180deg, #ffffff 0%, #e8efff 100%);
  color: #3456a3;
  box-shadow: 0 12px 24px rgba(68, 92, 158, 0.13);
  transform: translateY(-1px);
}

.planning-wizard-footer [data-plan-next]:hover:not(:disabled) {
  background: linear-gradient(135deg, #466ad0 0%, #32986b 100%);
  box-shadow: 0 16px 30px rgba(54, 119, 140, 0.28);
  transform: translateY(-1px);
}

.planning-wizard-footer [data-plan-next].is-submit-step:hover:not(:disabled) {
  background: linear-gradient(135deg, #633ab7 0%, #8657cf 100%);
  box-shadow: 0 18px 34px rgba(94, 62, 170, 0.32);
}

.planning-wizard-footer .planning-secondary-action:focus-visible {
  outline: 3px solid rgba(83, 118, 212, 0.26);
  outline-offset: 2px;
}

.planning-wizard-footer .planning-secondary-action:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  box-shadow: none;
  transform: none;
}

.planning-primary-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #5376d4, #41a879);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(65, 97, 177, 0.22);
}

.planning-context-alert {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  max-width: 100%;
  margin-top: -2px;
  padding: 4px 10px;
  border: 1px solid rgba(246, 181, 54, 0.82);
  border-radius: 999px;
  background: rgba(255, 246, 211, 0.96);
  color: #8a6100;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.25;
}

.planning-context-alert i {
  color: #e6a11b;
  font-size: 0.72rem;
}

.planning-pda-selected-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 5px 8px;
  border-radius: 12px;
  border: 1px solid var(--field-border, rgba(145, 169, 223, 0.88));
  background: rgba(255, 255, 255, 0.84);
  color: var(--field-ink, #2f4f97);
  font-size: 0.73rem;
  font-weight: 800;
  line-height: 1.2;
  cursor: help;
  max-width: 100%;
}

.planning-pda-selected-item::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 999px;
  background: var(--field-accent, #5377c9);
  box-shadow: 0 0 0 2px var(--field-ring, rgba(83, 119, 201, 0.16));
}

.planning-pda-selected-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planning-pda-selected-field {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  max-width: 88px;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--field-soft, rgba(255, 255, 255, 0.62));
  color: var(--field-ink, #2f4f97);
  font-size: 0.61rem;
  font-weight: 900;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planning-pda-selected-item:focus-visible {
  outline: 2px solid rgba(83, 119, 201, 0.65);
  outline-offset: 2px;
}

.planning-pda-tooltip {
  position: fixed;
  left: var(--pda-tooltip-left, 16px);
  top: var(--pda-tooltip-top, 16px);
  width: var(--pda-tooltip-width, min(520px, calc(100vw - 32px)));
  max-height: none;
  transform: translateY(4px);
  overflow: visible;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(136, 161, 215, 0.86);
  background: rgba(22, 38, 75, 0.96);
  color: #edf3ff;
  box-shadow: 0 14px 28px rgba(21, 35, 71, 0.34);
  font-size: 0.74rem;
  line-height: 1.4;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 3000;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.planning-pda-selected-item:hover .planning-pda-tooltip,
.planning-pda-selected-item:focus-visible .planning-pda-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.planning-pda-selected-item.is-open .planning-pda-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.planning-pda-tooltip strong {
  display: block;
  margin-bottom: 6px;
  color: #d2e3ff;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.planning-pda-tooltip-field {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 7px;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid var(--field-border, rgba(145, 169, 223, 0.72));
  background: var(--field-soft, rgba(232, 240, 255, 0.18));
  color: var(--field-ink, #d2e3ff);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.planning-pda-tooltip ul {
  margin: 0;
  padding: 0 0 0 14px;
  display: grid;
  gap: 4px;
}

.planning-pda-tooltip li {
  margin: 0;
}

.planning-pda-tooltip small {
  display: inline-block;
  margin-top: 6px;
  color: #b9cfff;
  font-weight: 700;
}

@media (hover: none), (pointer: coarse) {
  .planning-pda-selected-item {
    cursor: pointer;
  }

  .planning-pda-selected-item:hover .planning-pda-tooltip {
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
  }

  .planning-pda-tooltip {
    width: var(--pda-tooltip-width, min(340px, calc(100vw - 32px)));
    transform: translateY(-3px);
  }

  .planning-pda-selected-item.is-open .planning-pda-tooltip,
  .planning-pda-selected-item:focus-visible .planning-pda-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

.planning-selected-chip.is-pda-content {
  background: rgba(241, 119, 31, 0.14);
  border-color: rgba(241, 119, 31, 0.26);
  color: #b65a14;
}

.planning-pda-selection-note {
  display: block;
  color: #6276a6;
  font-size: 0.79rem;
  font-weight: 700;
  line-height: 1.45;
}

.pda-modal-dialog {
  width: min(1960px, calc(100vw - 4px));
  max-height: calc(100vh - 40px);
  border-radius: 14px;
}

#modal-pda-catalog {
  z-index: 1500;
  padding: 6px;
}

.pda-modal-header h3 {
  color: #cb4f07;
  font-size: 1.72rem;
}

.pda-modal-body.pda-modal-body {
  min-height: 340px;
  max-height: 72vh;
  padding: 14px 6px 6px;
  background: linear-gradient(180deg, #f7f9ff 0%, #f3f6ff 100%);
}

.pda-modal-state {
  color: #7d88aa;
  font-weight: 700;
  font-size: 0.95rem;
}

.pda-modal-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.pda-modal-asignatura {
  display: grid;
  gap: 5px;
  flex: 0 1 280px;
  min-width: min(100%, 240px);
}

.pda-modal-asignatura span {
  color: #7180a6;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pda-modal-asignatura select {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(191, 202, 228, 0.9);
  border-radius: 12px;
  background: #fff;
  color: #425074;
  font: inherit;
  font-size: 0.87rem;
  font-weight: 700;
  padding: 8px 11px;
}

.pda-modal-field-error {
  flex-basis: 100%;
  margin: -2px 0 0;
}

.pda-modal-search {
  flex: 1 1 360px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(191, 202, 228, 0.9);
  border-radius: 12px;
  background: #fff;
  padding: 8px 11px;
}

.pda-modal-search i {
  color: #8898bf;
}

.pda-modal-search input {
  border: 0;
  outline: 0;
  width: 100%;
  color: #2e3f64;
  font-weight: 700;
  font-size: 0.87rem;
  background: transparent;
}

.pda-modal-search input::placeholder {
  color: #8d9bc0;
  font-weight: 600;
}

.pda-modal-search-clear {
  border: 1px solid rgba(189, 200, 227, 0.92);
  border-radius: 10px;
  padding: 8px 12px;
  background: rgba(247, 249, 255, 0.95);
  color: #4a5e8c;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.pda-modal-search-clear:hover {
  background: rgba(235, 241, 255, 0.98);
}

.pda-modal-results {
  margin-left: auto;
  color: #5a6c96;
  font-size: 0.76rem;
  font-weight: 800;
}

.pda-table-head {
  display: grid;
  grid-template-columns: minmax(240px, 28%) minmax(220px, 28%) minmax(360px, 44%);
  gap: 0;
  border: 1px solid rgba(202, 213, 239, 0.9);
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  position: sticky;
  top: 0;
  z-index: 2;
}

.pda-table-head span {
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(234, 241, 255, 0.98) 0%, rgba(228, 236, 252, 0.98) 100%);
  border-right: 1px solid rgba(209, 218, 240, 0.88);
  color: #445b88;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.pda-table-head span:last-child {
  border-right: 0;
}

.pda-modal-content {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(209, 218, 240, 0.88);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  padding: 12px;
  background: #f7f9ff;
}

.pda-content-card {
  border: 1px solid var(--field-border, rgba(211, 220, 240, 0.92));
  border-left: 5px solid var(--field-accent, rgba(83, 119, 201, 0.7));
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pda-content-card:last-child {
  border-bottom: 1px solid rgba(211, 220, 240, 0.92);
}

.pda-content-card.is-hidden,
.pda-row.is-hidden {
  display: none;
}

.pda-content-card.is-selected {
  border-color: var(--field-border, rgba(156, 184, 236, 0.92));
  box-shadow: 0 8px 20px var(--field-shadow, rgba(113, 141, 193, 0.14));
}

.pda-content-card.is-open {
  border-color: var(--field-border, rgba(170, 192, 234, 0.95));
}

.pda-modal-field-banner {
  text-align: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--field-border, rgba(188, 204, 238, 0.95));
  background: var(--field-soft, linear-gradient(180deg, rgba(231, 239, 255, 0.98) 0%, rgba(224, 234, 252, 0.98) 100%));
  color: var(--field-ink, #2d5fd0);
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.pda-accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 0;
  background: #fff;
  cursor: pointer;
}

.pda-accordion-trigger .bi {
  font-size: 1rem;
  color: #7f95ca;
  transition: transform 0.2s ease;
}

.pda-accordion-trigger[aria-expanded="true"] .bi {
  transform: rotate(180deg);
}

.pda-accordion-panel {
  border-top: 1px solid rgba(221, 230, 247, 0.95);
  background: rgba(249, 251, 255, 0.95);
  padding: 10px 12px 12px;
}

.pda-grade-grid {
  display: grid;
  gap: 10px;
  align-items: start;
}

.pda-grade-column {
  border: 1px solid rgba(197, 211, 240, 0.9);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  overflow: hidden;
  width: 100%;
  word-break: break-word;
}

.pda-grade-heading {
  padding: 8px 10px;
  background: linear-gradient(180deg, rgba(232, 239, 255, 0.98) 0%, rgba(226, 235, 252, 0.98) 100%);
  color: #2f60cd;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-align: center;
}

.pda-grade-body {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.pda-col {
  padding: 10px;
  border-right: 1px solid rgba(223, 229, 245, 0.86);
}

.pda-col:last-child {
  border-right: 0;
}

.pda-col-grade {
  display: grid;
  gap: 8px;
  align-content: start;
}

.pda-grade-block {
  display: grid;
  gap: 8px;
  padding: 8px;
  border-radius: 12px;
  background: var(--field-muted, rgba(248, 251, 255, 0.95));
  box-shadow: inset 0 0 0 1px var(--field-border, rgba(212, 223, 246, 0.82));
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(214, 222, 241, 0.92);
}

.pda-grade-block:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.pda-content-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0;
  background: transparent;
  color: #27344f;
  min-width: 0;
}

.pda-content-select {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  text-transform: none;
}


.pda-content-select input[type="checkbox"],
.pda-row input[type="checkbox"] {
  width: 16px;
  min-width: 16px;
  max-width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  appearance: auto;
  accent-color: #4d74d6;
}

.pda-content-head-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.pda-content-title {
  color: #20345c;
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.01em;
  text-align: left;
}

.pda-content-select-text {
  color: #4e648f;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.35;
  text-transform: none;
  letter-spacing: normal;
}

.pda-content-desc {
  margin: 0;
  padding: 0;
  color: #4a5a80;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.55;
}

.pda-list {
  display: grid;
  gap: 8px;
}

.pda-toggle-btn {
  border: 1px solid rgba(173, 192, 229, 0.9);
  border-radius: 999px;
  background: rgba(235, 243, 255, 0.96);
  color: #355a96;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  padding: 5px 8px;
  flex-shrink: 0;
  cursor: pointer;
}

.pda-toggle-btn:hover {
  background: rgba(228, 238, 255, 0.98);
}

.pda-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid var(--field-border, rgba(208, 220, 244, 0.88));
  border-left: 4px solid var(--field-accent, #5377c9);
  border-radius: 10px;
  color: #2f3f63;
  font-size: 0.82rem;
  line-height: 1.42;
  background: #fff;
  transition: background-color 0.18s ease, border-color 0.18s ease;
  text-transform: none;
}

.pda-row:hover {
  background: var(--field-muted, rgba(239, 244, 255, 0.55));
}

.pda-row.is-selected {
  background: var(--field-soft, rgba(229, 241, 255, 0.74));
  border-color: var(--field-border, rgba(152, 184, 235, 0.95));
}

.is-field-lenguajes {
  --field-accent: #2f74d0;
  --field-ink: #244f93;
  --field-border: rgba(94, 143, 218, 0.58);
  --field-ring: rgba(47, 116, 208, 0.16);
  --field-soft: linear-gradient(180deg, rgba(232, 241, 255, 0.98) 0%, rgba(218, 232, 255, 0.98) 100%);
  --field-muted: rgba(238, 245, 255, 0.94);
  --field-shadow: rgba(47, 116, 208, 0.15);
}

.is-field-saberes {
  --field-accent: #167c9c;
  --field-ink: #135e76;
  --field-border: rgba(54, 145, 173, 0.58);
  --field-ring: rgba(22, 124, 156, 0.16);
  --field-soft: linear-gradient(180deg, rgba(228, 247, 252, 0.98) 0%, rgba(208, 237, 246, 0.98) 100%);
  --field-muted: rgba(236, 250, 253, 0.94);
  --field-shadow: rgba(22, 124, 156, 0.15);
}

.is-field-etica {
  --field-accent: #238653;
  --field-ink: #1b633f;
  --field-border: rgba(62, 151, 100, 0.6);
  --field-ring: rgba(35, 134, 83, 0.16);
  --field-soft: linear-gradient(180deg, rgba(229, 248, 236, 0.98) 0%, rgba(211, 239, 224, 0.98) 100%);
  --field-muted: rgba(237, 250, 242, 0.94);
  --field-shadow: rgba(35, 134, 83, 0.14);
}

.is-field-humano {
  --field-accent: #8a5bbd;
  --field-ink: #63408f;
  --field-border: rgba(153, 111, 202, 0.58);
  --field-ring: rgba(138, 91, 189, 0.16);
  --field-soft: linear-gradient(180deg, rgba(244, 236, 255, 0.98) 0%, rgba(234, 222, 250, 0.98) 100%);
  --field-muted: rgba(248, 242, 255, 0.94);
  --field-shadow: rgba(138, 91, 189, 0.14);
}

.pda-row input {
  margin-top: 2px;
}

.pda-row-text {
  color: #31486f;
  font-size: 0.83rem;
  font-weight: 700;
  text-transform: none;
}

.pda-highlight {
  background: linear-gradient(180deg, rgba(255, 238, 157, 0.95) 0%, rgba(255, 220, 122, 0.98) 100%);
  color: #3a2a10;
  border-radius: 4px;
  padding: 0 2px;
}

@media (max-width: 920px) {
  .planning-wizard-modal {
    padding: 8px;
  }

  .planning-wizard-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .planning-wizard-scroll-controls {
    right: 14px;
  }

  .planning-wizard-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
  }

  .planning-wizard-step {
    min-height: 44px;
    padding: 7px 8px;
  }

  .planning-wizard-step-num {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
    font-size: 0.76rem;
  }

  .planning-wizard-step-copy strong {
    font-size: 0.78rem;
  }

  .planning-confirm-grid {
    grid-template-columns: 1fr;
  }

  .planning-pedagogy-grid {
    grid-template-columns: 1fr;
  }

  .planning-pedagogy-grid .planning-field-stack {
    grid-template-columns: 1fr;
  }

  .planning-canvas-header {
    align-items: stretch;
  }

  .planning-primary-action,
  .planning-recent-link {
    width: 100%;
    justify-content: center;
  }

  .pda-modal-tools {
    align-items: stretch;
  }

  .pda-modal-search {
    flex-basis: 100%;
  }

  .pda-modal-results {
    margin-left: 0;
    width: 100%;
    order: 3;
  }

  .pda-table-head {
    display: none;
  }

  .pda-modal-content {
    border: 0;
    border-radius: 0;
    overflow: visible;
    display: grid;
    gap: 10px;
    padding: 0;
  }

  .pda-content-card {
    border: 1px solid rgba(223, 229, 245, 0.9);
    border-radius: 12px;
    overflow: hidden;
  }

  .pda-grade-grid {
    grid-template-columns: 1fr !important;
  }

  .pda-grade-body {
    padding: 8px;
  }

  .pda-accordion-trigger {
    padding: 10px 12px;
  }

  .pda-content-title {
    font-size: 0.92rem;
  }

  .pda-content-head {
    gap: 8px;
  }

  .pda-toggle-btn {
    font-size: 0.66rem;
    padding: 4px 8px;
  }

  .pda-row-text {
    font-size: 0.82rem;
  }

  .pda-list {
    gap: 7px;
  }
}

.planning-class-glance,
.planning-mini-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.planning-focus-empty {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(248, 250, 255, 0.96);
  border: 1px solid rgba(211, 218, 238, 0.88);
  color: #7b87aa;
  font-size: 0.85rem;
  line-height: 1.5;
}

.planning-focus-empty i {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.planning-focus-empty a {
  color: var(--a-dark);
  font-weight: 700;
  text-decoration: none;
}

.planning-focus-empty a:hover {
  text-decoration: underline;
}

.planning-class-glance div,
.planning-mini-stats article {
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(248, 250, 255, 0.96);
  border: 1px solid rgba(211, 218, 238, 0.88);
  display: grid;
  gap: 4px;
}

.planning-class-glance span,
.planning-mini-stats span {
  color: #7b87aa;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.planning-class-glance strong,
.planning-mini-stats strong {
  color: #33405f;
  font-size: 1rem;
}

.planning-total-chip {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(243, 247, 255, 0.98);
  color: #4d5f86;
  font-size: 0.84rem;
  font-weight: 800;
}

.planning-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.planning-option-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(206, 214, 235, 0.92);
  background: rgba(249, 250, 255, 0.96);
  color: #7482a4;
  font-size: 0.76rem;
  font-weight: 800;
}

.planning-option-chip.is-active {
  border-color: rgba(111, 151, 226, 0.65);
  background: rgba(233, 240, 255, 0.98);
  color: #4e6da7;
}

.planning-form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.planning-form-actions[hidden] {
  display: none !important;
}

.planning-secondary-action {
  border: 1px solid rgba(188, 198, 226, 0.92);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(163, 190, 246, 0.94) 0%, rgba(114, 152, 226, 0.96) 100%);
  color: #fff;
  padding: 12px 14px;
  font-size: 0.88rem;
  font-weight: 900;
  opacity: 0.72;
}

.planning-canvas-shell {
  display: grid;
  gap: 16px;
}

.planning-canvas-card {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: calc(100vh - 350px);
  padding: 18px;
}

.planning-canvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
}

.planning-canvas-header .planning-primary-action {
  margin-left: auto;
}

.planning-canvas-header h3 {
  margin: 0;
  color: #46517b;
  font-size: 1.35rem;
}

.planning-canvas-header p {
  margin: 4px 0 0;
  color: #7f8aad;
  font-size: 0.84rem;
  font-weight: 700;
}

.planning-result-scroll {
  position: relative;
  min-height: max(330px, calc(100vh - 530px));
  max-height: min(74vh, calc(100vh - 260px));
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 6px;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.planning-result-scroll::-webkit-scrollbar {
  width: 10px;
}

.planning-result-scroll::-webkit-scrollbar-track {
  background: rgba(226, 234, 252, 0.76);
  border-radius: 999px;
}

.planning-result-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #8ba9ee 0%, #9f85df 100%);
  border: 2px solid rgba(245, 248, 255, 0.95);
  border-radius: 999px;
}

.planning-result-scroll::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #6f93e5 0%, #8a6dd4 100%);
}

.planning-result-scroll-controls {
  position: absolute;
  right: 24px;
  top: 50%;
  z-index: 6;
  display: grid;
  gap: 8px;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.planning-result-scroll-controls.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.planning-result-scroll-controls button {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(156, 176, 228, 0.82);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #526aa8;
  box-shadow: 0 12px 28px rgba(38, 52, 95, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

.planning-result-scroll-controls button:hover:not(:disabled) {
  background: #eef4ff;
  color: #315bb8;
  transform: translateY(-1px);
}

.planning-result-scroll-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
  box-shadow: none;
}

.planning-recent-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(206, 214, 235, 0.88);
  color: #68779c;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 800;
}

.planning-recent-link span {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(122, 153, 226, 0.16);
  color: #5477b3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

.planning-preview-empty,
.planning-preview-card {
  min-height: max(300px, calc(100vh - 510px));
  height: 100%;
  border-radius: 28px;
  background: rgba(252, 252, 255, 0.88);
  border: 1px solid rgba(226, 231, 246, 0.84);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
  padding: 32px;
}

.planning-preview-icon {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(242, 238, 255, 0.9);
  color: #9b84c9;
  font-size: 1.3rem;
}

.planning-preview-empty strong,
.planning-preview-card strong {
  color: #353d60;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
}

.planning-preview-empty p,
.planning-preview-card p,
.planning-preview-card small {
  margin: 0;
  color: #808bab;
  max-width: 520px;
  font-size: 0.92rem;
  font-weight: 700;
}

.planning-preview-notes {
  margin-top: 8px;
  max-width: 560px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(244, 247, 255, 0.96);
  color: #5a678b;
  font-size: 0.85rem;
  font-weight: 700;
}

.planning-recent-shell {
  padding: 18px;
}

/* ═══════════════════════════════════════════
   MODAL HISTORIAL DE PLANEACIONES
═══════════════════════════════════════════ */

.plan-hist-modal .overview-modal-backdrop {
  background: rgba(49, 56, 82, 0.24);
  backdrop-filter: blur(2px);
}

.plan-hist-dialog {
  position: relative;
  width: min(660px, 100%);
  max-height: min(82vh, 720px);
  border-radius: 24px;
  background: linear-gradient(160deg, #f4f6ff 0%, #fafbff 55%, #fff 100%);
  border: 1px solid rgba(200, 210, 240, 0.7);
  box-shadow: 0 32px 72px rgba(20, 28, 55, 0.24), 0 0 0 1px rgba(255,255,255,0.7) inset;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: auto;
}

/* Header */
.plan-hist-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(206, 214, 240, 0.55);
  background: linear-gradient(135deg, rgba(114, 136, 220, 0.07) 0%, transparent 55%);
  flex-shrink: 0;
}

.plan-hist-header-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, #7e9cf5 0%, #a585e8 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(122, 136, 220, 0.38);
}

.plan-hist-header-text { flex: 1; }

.plan-hist-header-text h3 {
  margin: 0 0 2px;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  color: #2d3452;
  font-weight: 800;
}

.plan-hist-header-text p {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: #8a96be;
}

.plan-hist-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(206, 214, 234, 0.7);
  background: rgba(255, 255, 255, 0.82);
  color: #8189a6;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.plan-hist-close:hover { background: #eef1ff; color: #3d4470; }

/* Body / list */
.plan-hist-body {
  padding: 16px 18px 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.plan-hist-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
}

.plan-hist-item {
  display: flex;
  align-items: stretch;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(214, 220, 244, 0.75);
  overflow: hidden;
  transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
}
.plan-hist-item:hover {
  box-shadow: 0 8px 24px rgba(45, 52, 90, 0.1);
  transform: translateY(-1px);
  border-color: rgba(148, 168, 232, 0.55);
}

.plan-hist-item-accent {
  width: 4px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #7e9cf5 0%, #a585e8 100%);
}

.plan-hist-item-main {
  flex: 1;
  padding: 12px 14px;
  display: grid;
  gap: 5px;
  min-width: 0;
}

.plan-hist-item-school {
  font-size: 0.88rem;
  font-weight: 800;
  color: #353d60;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-hist-item-school i { color: #8a96be; font-size: 0.82rem; }

.plan-hist-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.plan-hist-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
}
.plan-hist-tag.is-campo {
  background: rgba(112, 140, 230, 0.12);
  color: #4f68b3;
}
.plan-hist-tag.is-eje {
  background: rgba(86, 178, 144, 0.14);
  color: #2f8a67;
}
.plan-hist-tag.is-metod {
  background: rgba(155, 132, 205, 0.13);
  color: #7559a8;
}

.plan-hist-item-date {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #9098b8;
}

/* Action buttons column */
.plan-hist-item-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-left: 1px solid rgba(214, 220, 244, 0.6);
  background: rgba(248, 250, 255, 0.72);
  flex-shrink: 0;
}

.plan-hist-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid rgba(210, 218, 240, 0.8);
  background: rgba(255, 255, 255, 0.92);
  color: #6e7fa8;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.plan-hist-action-btn.is-edit:hover {
  background: rgba(100, 148, 228, 0.12);
  border-color: rgba(100, 148, 228, 0.45);
  color: #4a79cc;
  box-shadow: 0 2px 8px rgba(100, 148, 228, 0.2);
}
.plan-hist-action-btn.is-edit.is-disabled,
.plan-hist-action-btn.is-edit:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  background: rgba(242, 245, 252, 0.9);
  border-color: rgba(210, 218, 240, 0.72);
  color: #9aa5c4;
  box-shadow: none;
}
.plan-hist-action-btn.is-edit.is-disabled:hover,
.plan-hist-action-btn.is-edit:disabled:hover {
  transform: none;
  background: rgba(242, 245, 252, 0.9);
  border-color: rgba(210, 218, 240, 0.72);
  color: #9aa5c4;
  box-shadow: none;
}
.plan-hist-action-btn.is-view:hover {
  background: rgba(72, 171, 128, 0.12);
  border-color: rgba(72, 171, 128, 0.42);
  color: #2f8a67;
  box-shadow: 0 2px 8px rgba(72, 171, 128, 0.18);
}
.plan-hist-action-btn.is-download:hover {
  background: rgba(123, 103, 218, 0.12);
  border-color: rgba(123, 103, 218, 0.42);
  color: #6950c8;
  box-shadow: 0 2px 8px rgba(123, 103, 218, 0.18);
}
.plan-hist-action-btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: rgba(242, 245, 252, 0.9);
  color: #9aa5c4;
}
.plan-hist-action-btn.is-delete:hover {
  background: rgba(215, 70, 70, 0.09);
  border-color: rgba(215, 70, 70, 0.35);
  color: #c23e3e;
  box-shadow: 0 2px 8px rgba(215, 70, 70, 0.15);
}

/* Empty state */
.plan-hist-empty {
  padding: 44px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}
.plan-hist-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(122, 136, 222, 0.1), rgba(155, 132, 205, 0.1));
  border: 1px solid rgba(180, 192, 232, 0.4);
  color: #a0aacb;
  font-size: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.plan-hist-empty strong {
  color: #3d4470;
  font-size: 1rem;
  letter-spacing: -0.02em;
  font-weight: 800;
}
.plan-hist-empty p {
  margin: 0;
  color: #8a96be;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.55;
}

/* Confirm modal */
.dashboard-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.dashboard-confirm-modal.is-open {
  display: flex;
}

.dashboard-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(43, 49, 74, 0.34);
  backdrop-filter: blur(3px);
}

.dashboard-confirm-card {
  position: relative;
  width: min(420px, 100%);
  border-radius: 22px;
  padding: 22px;
  background: linear-gradient(160deg, #fbfcff 0%, #f5f7ff 100%);
  border: 1px solid rgba(203, 212, 241, 0.82);
  box-shadow: 0 28px 68px rgba(28, 35, 68, 0.24), 0 0 0 1px rgba(255,255,255,0.72) inset;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
}

.dashboard-confirm-icon {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #c23e3e;
  background: linear-gradient(135deg, rgba(238, 88, 88, 0.13), rgba(168, 111, 224, 0.1));
  border: 1px solid rgba(238, 88, 88, 0.2);
  font-size: 1.24rem;
}

.dashboard-confirm-copy {
  min-width: 0;
}

.dashboard-confirm-kicker {
  display: block;
  margin-bottom: 3px;
  color: #7886b0;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-confirm-copy h3 {
  margin: 0 0 7px;
  color: #2d3452;
  font-size: 1.16rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.dashboard-confirm-copy p {
  margin: 0;
  color: #687599;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.5;
}

.dashboard-confirm-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 8px;
}

.dashboard-confirm-secondary,
.dashboard-confirm-danger {
  min-height: 42px;
  border-radius: 13px;
  border: 1px solid transparent;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.dashboard-confirm-secondary {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(202, 212, 242, 0.86);
  color: #59678e;
}

.dashboard-confirm-secondary:hover {
  background: #eef3ff;
  color: #38466e;
  transform: translateY(-1px);
}

.dashboard-confirm-danger {
  background: linear-gradient(135deg, #d94f5c 0%, #aa5fd8 100%);
  color: #fff;
  box-shadow: 0 14px 28px rgba(187, 74, 110, 0.25);
}

.dashboard-confirm-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(187, 74, 110, 0.32);
}

.groups-form-grid,
.planning-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin-top: 0;
}

.groups-form-grid .is-full,
.planning-form-grid .is-full {
  grid-column: 1 / -1;
}

/* Grado + Letra + Turno en una sola fila compacta */
.groups-row-triple {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}

/* Niños + Niñas — fila corta, máx mitad del ancho */
.groups-row-double {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-width: 50%;
  align-items: start;
}

.groups-row-triple > div,
.groups-row-double > div {
  display: grid;
  gap: 4px;
}

.groups-row-triple label,
.groups-row-double label {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 900;
  color: #6f77a0;
}

.groups-row-triple input,
.groups-row-triple select,
.groups-row-double input,
.groups-row-double select {
  width: 100%;
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 9px 10px;
  font: inherit;
  background: #fbfbfe;
  text-align: center;
}

.groups-row-triple select,
.groups-row-double select {
  text-align: left;
}


.planning-card-list,
.schools-card-list {
  display: grid;
  gap: 12px;
}

.planning-card-item {
  display: grid;
  gap: 8px;
}

.material-option-card {
  position: relative;
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 196px;
  padding: 24px 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(194, 168, 232, 0.24);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.material-option-card:hover {
  transform: translateY(-2px);
  border-color: rgba(144, 104, 199, 0.42);
  box-shadow: 0 18px 36px rgba(144, 104, 199, 0.14);
}

.material-option-card.is-active {
  border-color: rgba(144, 104, 199, 0.6);
  box-shadow: 0 20px 38px rgba(144, 104, 199, 0.18);
}

.material-option-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), var(--a-pale));
  color: var(--a-txt);
  box-shadow: inset 0 0 0 1px rgba(127, 163, 232, 0.14);
}

.material-option-copy {
  display: grid;
  gap: 4px;
}

.material-option-copy strong {
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.2;
}

.material-option-copy span {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.material-option-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(176, 126, 220, 0.14);
  color: #7a4bb0;
  font-size: 0.72rem;
  font-weight: 900;
}

.material-results-panel {
  display: grid;
  gap: 16px;
}

/* ── Material option modal ─────────────────────────── */
.mat-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(55, 45, 78, 0.24);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(2px);
  animation: matOverlayIn 0.2s ease;
}

.mat-modal-overlay[hidden] {
  display: none;
}

@keyframes matOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.mat-modal-box {
  width: 100%;
  max-width: 900px;
  max-height: 88vh;
  background: #fff;
  border-radius: 28px 28px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: matBoxIn 0.26s cubic-bezier(0.34,1.3,0.64,1);
}

@media (min-width: 660px) {
  .mat-modal-overlay {
    align-items: center;
    padding: 24px;
  }
  .mat-modal-box {
    border-radius: 28px;
    max-height: 82vh;
  }
}

@keyframes matBoxIn {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.mat-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.mat-modal-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mat-modal-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(242, 234, 255, 0.96);
  color: #7a4bb0;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#matModalTitle {
  font-size: 1.1rem;
  color: var(--ink);
}

.mat-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.mat-modal-close:hover {
  background: rgba(144, 104, 199, 0.08);
  color: var(--ink);
}

.mat-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 28px;
}

.mat-modal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 48px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.mat-modal-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(144, 104, 199, 0.2);
  border-top-color: #9068c7;
  border-radius: 50%;
  animation: matSpin 0.7s linear infinite;
}

@keyframes matSpin {
  to { transform: rotate(360deg); }
}

.mat-modal-body .material-results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.mat-modal-body .material-results-header .fcard-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.mat-modal-body .material-results-header p {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 4px;
}

.mat-modal-body .mat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.material-results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.material-results-header p {
  margin: 0;
  color: var(--muted);
  max-width: 62ch;
}

.material-resource-grid {
  gap: 14px;
}

.material-catalog-grid {
  gap: 14px;
}

.material-catalog-card {
  min-height: 230px;
  gap: 16px;
  border-color: rgba(194, 168, 232, 0.28);
}

.material-catalog-card.is-owned {
  border-color: rgba(25, 101, 58, 0.16);
}

.material-catalog-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.material-spotlight-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(176, 126, 220, 0.14);
  color: #7a4bb0;
  font-size: 0.7rem;
  font-weight: 900;
}

.material-card-copy {
  display: grid;
  gap: 6px;
  align-content: start;
}

.material-card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.material-card-eyebrow {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.material-card-footer {
  display: grid;
  gap: 12px;
  margin-top: auto;
}

.material-card-actions {
  margin-top: 0;
}

.material-card-actions .dashboard-action-button,
.material-card-actions .dashboard-action-link {
  min-height: 38px;
}

.material-empty-state {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.empty-state-icon {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(244, 247, 253, 0.96);
  color: var(--a-dark);
  font-size: 1.35rem;
}

.empty-state-title {
  display: block;
  color: var(--ink);
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.empty-state-copy {
  margin: 0;
  max-width: 48ch;
  color: var(--muted);
  line-height: 1.55;
}

.material-filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

.material-filter-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  background: #f4f7fd;
  color: #50607d;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 800;
  border: 1px solid transparent;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.material-filter-link strong {
  color: inherit;
}

.material-filter-link.active {
  background: rgba(127, 163, 232, 0.18);
  color: #31528e;
  border-color: rgba(127, 163, 232, 0.28);
}

.material-filter-link:hover {
  transform: translateY(-1px);
  border-color: rgba(127, 163, 232, 0.22);
}

.dashboard-form-grid select,
.dashboard-form-grid textarea,
.dashboard-form-grid input {
  width: 100%;
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 9px 13px;
  font: inherit;
  background: #fbfbfe;
}

.dashboard-form-grid select:focus,
.dashboard-form-grid textarea:focus,
.dashboard-form-grid input:focus {
  outline: 2px solid rgba(127, 163, 232, 0.22);
  border-color: var(--a);
}

/* ══════════════════════════════════════════════════════════
   SELECTOR DE MÓDULOS
   ══════════════════════════════════════════════════════════ */
.selector-shell {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0 20px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(145deg, var(--auth-grad-from) 0%, var(--auth-grad-to) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
}

/* ── Topbar ── */
.selector-topbar {
  width: 100%;
  max-width: 900px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 0 20px;
  min-width: 0;
  box-sizing: border-box;
}

.selector-logo .brand-logo--hero {
  width: clamp(100px, 18vw, 140px);
}

.selector-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-shrink: 1;
}

.user-chip,
.logout-link,
.cta-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  transition: transform 0.15s, box-shadow 0.15s;
}

.user-chip {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--white);
  min-width: 0;
  backdrop-filter: blur(8px);
}

.user-chip-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 900;
  flex-shrink: 0;
}

.user-chip-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
  font-size: 0.88rem;
}

.logout-link {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.84rem;
  backdrop-filter: blur(8px);
}

.logout-link:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* ── Hero ── */
.selector-hero {
  width: 100%;
  max-width: 900px;
  padding: 40px 0 36px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
  min-width: 0;
}

.selector-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.7);
}

.selector-hero-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  flex-shrink: 0;
}

.selector-hero-title {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.06;
  color: var(--white);
}

.selector-hero-sub {
  font-size: clamp(0.9rem, 1.4vw, 1rem);
  color: rgba(255, 255, 255, 0.72);
  max-width: 52ch;
  line-height: 1.6;
}

/* ── Grid ── */
.selector-grid {
  width: 100%;
  max-width: 900px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  box-sizing: border-box;
  min-width: 0;
}

/* ── Card ── */
.selector-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--white);
  border: 1.5px solid transparent;
  border-radius: 24px;
  padding: 28px 24px 22px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 8px 32px rgba(40, 20, 100, 0.16);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  position: relative;
  overflow: hidden;
}

.selector-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, var(--sys-100) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.22s;
  border-radius: inherit;
  pointer-events: none;
}

.selector-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 52px rgba(60, 20, 130, 0.22);
  border-color: var(--sys-200);
}

.selector-card:hover::before {
  opacity: 1;
}

.selector-card.is-current-module {
  border-color: var(--sys-300);
  background: linear-gradient(160deg, #f5f0fe 0%, #ffffff 50%);
}

/* Ícono grande del módulo */
.selector-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--sys-100);
  border: 1px solid var(--sys-200);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: var(--sys-500);
  position: relative;
  z-index: 1;
}

.selector-card.is-current-module .selector-card-icon {
  background: linear-gradient(135deg, var(--sys-200), var(--sys-100));
  color: var(--sys-600);
}

/* Badge de estado */
.selector-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  background: var(--sys-100);
  color: var(--sys-600);
  border: 1px solid var(--sys-200);
  position: relative;
  z-index: 1;
}

.selector-badge--current {
  background: linear-gradient(135deg, var(--sys-600), var(--sys-500));
  color: var(--white);
  border-color: transparent;
}

/* Cuerpo */
.selector-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  z-index: 1;
}

.selector-card-body h2 {
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--ink);
}

.selector-card-range {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
}

/* Footer de la card */
.selector-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.selector-card-section {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cta-link {
  width: fit-content;
  background: linear-gradient(135deg, var(--sys-600), var(--sys-400));
  color: var(--white);
  box-shadow: 0 6px 18px rgba(94, 58, 171, 0.28);
  font-size: 0.86rem;
  padding: 10px 18px;
}

.cta-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(94, 58, 171, 0.36);
}

/* Mantener compatibilidad con elementos del dashboard que usan estas clases */
.selector-card p,
.selector-meta,
.metric-copy p,
.card-body p,
.list-panel li,
.dash-section p {
  color: var(--muted);
}

.selector-header {
  display: grid;
  justify-items: center;
  text-align: center;
}

.selector-header p,
.dash-hero-copy p {
  color: var(--muted);
}



.dash-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.8fr);
  gap: 20px;
  margin-bottom: 22px;
}

.dash-module-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--a-pale);
  color: var(--a-txt);
  font-weight: 800;
  margin-bottom: 16px;
}

.dash-credit-card {
  background: linear-gradient(145deg, rgba(255,255,255,.92), rgba(255,255,255,.66));
  border-radius: 28px;
  padding: 24px;
  border: 1px solid rgba(255,255,255,.65);
}

.dash-credit-card .big-number {
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: -0.06em;
  color: var(--a-dark);
}

.metrics-grid,
.dash-grid {
  display: grid;
  gap: 18px;
}

.metrics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 22px;
}

.metric-card,
.dash-panel,
.list-panel {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  border-radius: 24px;
  padding: 22px;
  box-shadow: var(--shadow-md);
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.metric-copy strong {
  display: block;
  font-size: 1.65rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.dash-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

.panel-header,
.list-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-header h2,
.list-panel-header h2 {
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}

.plan-list,
.school-list,
.level-list {
  display: grid;
  gap: 12px;
}

.plan-item,
.school-item,
.level-item {
  padding: 16px;
  border-radius: 18px;
  background: var(--white);
  border: 1px solid var(--border);
}

.plan-item strong,
.school-item strong,
.level-item strong {
  display: block;
  margin-bottom: 6px;
}

.empty-state {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255,255,255,0.66);
  border: 1px dashed var(--border2);
  color: var(--muted);
}



.selector-context-banner {
  display: inline-grid;
  gap: 6px;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(127, 163, 232, 0.22);
  max-width: 520px;
}

.selector-context-pill,
.selector-state-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 900;
}

.selector-context-pill {
  background: rgba(158, 125, 214, 0.15);
  color: var(--sys-700);
}

.selector-context-banner strong {
  font-size: 1rem;
  color: var(--ink);
}

.selector-context-copy {
  color: var(--muted);
  font-size: 0.9rem;
}

.selector-card-top {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
}

.selector-state-chip {
  background: var(--sys-100);
  color: var(--sys-txt);
  border: 1px solid rgba(158, 125, 214, 0.28);
}

.selector-state-chip.is-current {
  background: linear-gradient(135deg, var(--sys-600), var(--sys-400));
  color: var(--white);
  border-color: transparent;
}

.selector-card-note {
  margin: -10px 0 0;
  font-size: 0.92rem;
  line-height: 1.55;
}

.selector-card .cta-link {
  min-height: 46px;
  justify-content: center;
}



.dashboard-context-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(100%, 370px);
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(127, 163, 232, 0.18);
  box-shadow: 0 10px 18px rgba(45, 45, 78, 0.06);
}

.dashboard-context-card.is-compact {
  width: min(100%, 410px);
  justify-content: flex-start;
}

.dashboard-context-card.is-compact > div {
  display: grid;
  gap: 4px;
}

.dashboard-context-card strong,
.dashboard-context-card span {
  display: block;
}

.dashboard-context-card strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.dashboard-context-card span {
  color: var(--muted);
  font-size: 0.76rem;
}

@media (max-width: 1080px) {
  /* ── Dashboard ── */
  .dash-hero,
  .dash-grid {
    grid-template-columns: 1fr;
  }

  .selector-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .user-chip,
  .logout-link {
    width: 100%;
    justify-content: center;
  }

  .profile-metrics-grid,
  .profile-context-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-layout-grid {
    grid-template-columns: 1fr;
  }

  .schools-layout-grid {
    grid-template-columns: 1fr;
  }

  .overview-metrics-grid,
  .overview-secondary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-layout-grid {
    grid-template-columns: 1fr;
  }

  .profile-summary-card {
    justify-items: start;
    text-align: left;
  }

  .school-summary-card {
    justify-items: start;
    text-align: left;
  }

  .group-summary-card,
  .planning-summary-card {
    justify-items: start;
    text-align: left;
  }

  .overview-summary-card {
    justify-items: start;
    text-align: left;
  }

  .profile-summary-chips {
    justify-content: flex-start;
  }

  .school-summary-stats {
    max-width: 360px;
  }

  .metrics-grid,
  .selector-grid,
  .auth-module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .selector-card-top {
    flex-direction: column;
    align-items: center;
  }

  .material-showcase-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .material-option-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .selector-hero,
  .dash-hero,
  .metric-card,
  .dash-panel,
  .list-panel,
  .selector-card {
    box-shadow: 0 12px 28px rgba(40, 40, 100, 0.1);
  }
}

/* ────────────────────────────────────────────────────
   AUTH ≤ 820px — tablet portrait + móvil vertical
   Hero en la parte superior, panel blanco desliza desde abajo
──────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .auth-shell {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: clamp(210px, 36vh, 310px) 1fr;
    min-height: 100dvh;
    overflow-y: auto;
    padding: 0;
    border-radius: 0;
    align-items: initial;
    justify-content: initial;
  }

  /* En móvil, el --split también colapsa a una sola columna (hero arriba, panel abajo) */
  .auth-shell--split {
    grid-template-columns: 1fr;
    grid-template-rows: clamp(200px, 34vh, 280px) 1fr;
  }

  .auth-shell--split > .auth-hero {
    order: 0;
    grid-row: 1;
    padding: 28px 28px 48px;
    justify-content: space-between;
    min-height: unset;
  }

  .auth-shell--split > .auth-hero .auth-copy {
    padding: 12px 0 0;
    justify-content: flex-start;
    flex: none;
  }

  .auth-shell--split > .auth-hero .auth-copy h1 {
    font-size: clamp(1.1rem, 4vw, 1.45rem);
    margin-bottom: 8px;
  }

  .auth-shell--split > .auth-hero .auth-modules {
    display: none;
  }

  .auth-shell--split > .auth-panel {
    grid-row: 2;
    min-height: unset;
    border-radius: 26px 26px 0 0;
    box-shadow: 0 -14px 52px rgba(40, 40, 100, 0.16);
    margin-top: -26px;
    justify-content: flex-start;
  }

  .auth-shell--split > .auth-panel .auth-panel-inner {
    padding: 28px 24px max(28px, env(safe-area-inset-bottom, 0px));
    max-width: 520px;
    margin-inline: auto;
  }

  .auth-shell--split > .auth-panel .auth-wordmark {
    display: none;
  }

  /* Mostrar el hero en móvil */
  .auth-shell > .auth-hero {
    display: flex;
    grid-row: 1;
    padding: 30px 28px 52px;
    justify-content: space-between;
  }

  /* Mostrar logo y tagline dentro del hero en móvil */
  .auth-shell > .auth-hero .auth-brand,
  .auth-shell > .auth-hero .auth-hero-foot {
    display: block;
  }

  .auth-shell > .auth-hero .auth-brand {
    position: relative;
    z-index: 1;
  }

  /* Los blobs del hero no están sueltos aquí, están dentro del hero */
  .auth-shell > .auth-hero-blobs {
    display: none;
  }

  .auth-shell .auth-panel {
    grid-row: 2;
    max-width: none;
    width: 100%;
    margin-top: -26px;
    border-radius: 26px 26px 0 0;
    box-shadow: 0 -14px 52px rgba(40, 40, 100, 0.16);
  }

  .auth-panel-inner {
    padding: 30px 24px max(28px, env(safe-area-inset-bottom, 0px));
    max-width: 520px;
    margin-inline: auto;
  }

  /* Ocultar wordmark — la marca aparece en el hero */
  .auth-wordmark {
    display: none;
  }

  .auth-card h2 {
    font-size: clamp(1.45rem, 4vw, 1.9rem);
  }

  .auth-hero-foot p {
    font-size: 0.95rem;
  }
}

/* ────────────────────────────────────────────────────
   AUTH landscape en tablet pequeña / móvil landscape
   Panel + hero lado a lado, forma compacta scrollable
   Sólo aplica cuando ya estamos en modo "sheet" (≤ 820px)
──────────────────────────────────────────────────── */
@media (max-width: 820px) and (orientation: landscape) and (max-height: 680px) {
  .auth-shell {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
    grid-template-rows: 1fr;
    min-height: 100dvh;
  }

  .auth-shell > .auth-hero {
    position: static;
    grid-row: 1;
    grid-column: 1;
    margin-top: 0;
    border-radius: 0;
    padding: 28px 24px;
    box-shadow: none;
    justify-content: space-between;
  }

  .auth-shell .auth-panel {
    grid-row: 1;
    grid-column: 2;
    margin-top: 0;
    border-radius: 0;
    box-shadow: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .auth-panel-inner {
    padding: 22px 28px;
    max-width: none;
    margin-inline: 0;
  }

  /* Wordmark útil en landscape (el hero está al costado, no encima) */
  .auth-wordmark {
    display: block;
    margin-bottom: 22px;
  }
}

@media (max-width: 720px) {
  /* Auth ≤ 720px: ajuste de alturas dentro del modo sheet (complementa el 820px) */
  .auth-shell {
    grid-template-rows: clamp(180px, 32vh, 270px) 1fr;
  }

  .auth-shell .auth-hero {
    padding: 24px 22px 46px;
  }

  .auth-shell .auth-panel {
    margin-top: -22px;
    border-radius: 22px 22px 0 0;
  }

  .auth-panel-inner {
    padding: 26px 20px max(24px, env(safe-area-inset-bottom, 0px));
  }

  .selector-shell,
  .dash-shell {
    padding: max(20px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px))
      max(20px, env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
  }

  .dashboard-form-shell {
    padding: 12px 16px 0;
  }

  .material-showcase,
  .overview-hub,
  .profile-hub,
  .schools-hub,
  .groups-hub,
  .planning-hub {
    gap: 14px;
  }

  .material-filter-row {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .material-filter-link {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 8px 11px;
    font-size: 0.79rem;
  }

  .material-option-grid {
    grid-template-columns: 1fr;
  }

  .material-option-card {
    min-height: 0;
    padding: 18px 16px;
  }

  .material-results-header {
    flex-direction: column;
    gap: 10px;
  }

  .material-card-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .metrics-grid,
  .auth-module-grid {
    grid-template-columns: 1fr;
  }

  /* Selector: 1 columna en móvil, conserva diseño de card desktop */
  .selector-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .selector-card {
    padding: 22px 20px 18px;
    border-radius: 20px;
    gap: 12px;
  }

  .selector-card-body h2 {
    font-size: 1.3rem;
  }

  .selector-card .cta-link {
    width: fit-content;
    flex: 0 0 auto;
  }

  .selector-card-footer .selector-card-section {
    flex: 1;
    min-width: 0;
  }

  .selector-hero {
    padding: 24px 0 20px;
  }

  .selector-hero-title {
    font-size: clamp(1.6rem, 6vw, 2.2rem);
  }

  .selector-logo .brand-logo--hero {
    width: clamp(80px, 24vw, 120px);
  }

  .selector-topbar {
    padding: 18px 0 14px;
    gap: 8px;
  }

  .user-chip {
    padding: 8px 10px;
    gap: 6px;
  }

  .user-chip-name {
    max-width: 80px;
    font-size: 0.78rem;
  }

  .logout-link {
    padding: 8px 12px;
    font-size: 0.78rem;
    white-space: nowrap;
  }

  .profile-metrics-grid,
  .overview-metrics-grid,
  .profile-context-grid,
  .overview-secondary-grid,
  .profile-form-grid,
  .profile-summary-stats,
  .profile-password-grid,
  .schools-form-grid,
  .school-summary-stats,
  .groups-form-grid,
  .planning-form-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-section-link,
  .auth-submit,
  .logout-link {
    width: 100%;
    justify-content: center;
  }

  .selector-card .cta-link {
    width: fit-content;
    flex: 0 0 auto;
  }

  .selector-topbar {
    align-items: center;
  }

  .user-chip {
    width: 100%;
    justify-content: center;
  }

  .auth-copy h1,
  .selector-header h1,
  .dash-hero-copy h1 {
    line-height: 1.08;
    font-size: clamp(1.45rem, 4.2vw + 0.5rem, 2.6rem);
  }

  /* Blobs: escalar en móvil */
  .auth-blob--lg {
    width: clamp(130px, 38vw, 220px);
    height: clamp(130px, 38vw, 220px);
  }

  .auth-blob--md {
    width: clamp(80px, 22vw, 140px);
    height: clamp(80px, 22vw, 140px);
  }

  .brand-mark {
    font-size: clamp(1.15rem, 2.5vw + 0.5rem, 1.75rem);
  }

  .password-toggle {
    width: 44px;
    height: 44px;
    right: 8px;
  }

  .password-field input {
    padding-right: 58px;
  }

  .form-row input {
    font-size: 16px;
  }

  .profile-metric-card,
  .profile-summary-stats article,
  .school-summary-stats article,
  .school-summary-note,
  .task-item,
  .efem-item,
  .sch-item,
  .schools-card-item,
  .planning-card-item {
    border-radius: 18px;
  }

  .profile-metric-card {
    padding: 16px 16px;
    gap: 14px;
  }

  .profile-metric-card strong {
    font-size: 1rem;
  }

  .profile-metric-label,
  .profile-context-label {
    font-size: 0.74rem;
  }

  .auth-module-card,
  .auth-side-item {
    padding: 16px;
  }

  .profile-summary-card,
  .profile-panel {
    padding: 20px;
  }

  .school-summary-card {
    padding: 20px;
  }

  .group-summary-card,
  .planning-summary-card {
    padding: 20px;
  }

  .overview-summary-card {
    padding: 20px;
  }

  .profile-summary-card {
    justify-items: center;
    text-align: center;
    gap: 12px;
  }

  .school-summary-card {
    justify-items: center;
    text-align: center;
    gap: 12px;
  }

  .group-summary-card,
  .planning-summary-card {
    justify-items: center;
    text-align: center;
    gap: 12px;
  }

  .overview-summary-card {
    justify-items: center;
    text-align: center;
    gap: 12px;
  }

  .profile-summary-name,
  .school-summary-title {
    font-size: 1.48rem;
  }

  .profile-panel-header h3 {
    font-size: 1.34rem;
    gap: 8px;
  }

  .profile-panel-header p,
  .school-summary-subtitle,
  .school-summary-note span,
  .empty-state-copy {
    font-size: 0.93rem;
  }

  .profile-summary-chips {
    justify-content: center;
    gap: 6px;
  }

  .profile-summary-chips .tag,
  .material-showcase-tags .tag,
  .dashboard-tag-row .tag,
  .tags .tag {
    padding: 7px 10px;
    font-size: 0.78rem;
  }

  .profile-submit {
    max-width: none;
  }

  .dashboard-inline-actions {
    gap: 8px;
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-inline-actions .dashboard-action-link,
  .dashboard-inline-actions .dashboard-action-button,
  .dashboard-inline-actions form {
    width: 100%;
  }

  .dashboard-inline-actions form .dashboard-action-button {
    width: 100%;
  }
}


@media (max-width: 560px) {
  .selector-context-banner,
  .dashboard-context-card,
  .auth-note-card,
  .acknowledge-card,
  .setup-progress {
    border-radius: 18px;
  }

  .material-showcase-tags,
  .tags {
    gap: 6px;
  }

  .profile-summary-card,
  .profile-panel,
  .school-summary-card,
  .group-summary-card,
  .planning-summary-card,
  .overview-summary-card,
  .material-results-panel {
    padding: 18px 16px;
  }

  .profile-metric-card {
    padding: 15px 14px;
  }

  .profile-metric-icon,
  .empty-state-icon {
    width: 46px;
    height: 46px;
    border-radius: 15px;
  }

  .overview-summary-icon,
  .school-summary-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
  }

  .profile-avatar {
    width: 88px;
    height: 88px;
    font-size: 1.72rem;
  }

  .profile-summary-name,
  .school-summary-title {
    font-size: 1.34rem;
  }

  .profile-panel-header h3 {
    font-size: 1.22rem;
  }

  .profile-panel,
  .profile-content-stack,
  .schools-content-stack,
  .overview-content-stack,
  .overview-secondary-grid,
  .school-list,
  .task-list,
  .efem-list,
  .sch-list {
    gap: 12px;
  }

  .profile-summary-stats article,
  .school-summary-stats article,
  .school-summary-note,
  .task-item,
  .efem-item,
  .sch-item,
  .schools-card-item,
  .planning-card-item {
    padding: 14px 12px;
  }

  .dashboard-breadcrumbs {
    gap: 6px;
  }

  .dashboard-breadcrumb {
    font-size: 0.76rem;
  }

  .dashboard-action-link,
  .dashboard-action-button,
  .dashboard-reset-link,
  .dashboard-section-link {
    min-height: 42px;
  }

  .material-filter-link {
    min-height: 40px;
    padding: 8px 10px;
  }

  .material-option-card {
    padding: 18px 14px;
  }

  .empty-state {
    padding: 16px 14px;
  }

  .setup-progress-steps {
    grid-template-columns: 1fr;
  }

  .auth-panel,
  .auth-hero,
  .selector-shell,
  .dash-shell {
    padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
      max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  }

  .material-catalog-hero,
  .selector-hero,
  .auth-card {
    padding-left: 14px;
    padding-right: 14px;
  }

  .material-filter-row {
    margin-right: -2px;
    padding-bottom: 6px;
  }
}

/* ── Móvil pequeño ≤ 480px ── */
@media (max-width: 480px) {
  .auth-shell {
    grid-template-rows: clamp(160px, 28vh, 240px) 1fr;
  }

  .auth-shell .auth-hero {
    padding: 18px 18px 44px;
  }

  .auth-shell .auth-panel {
    margin-top: -20px;
    border-radius: 20px 20px 0 0;
  }

  .auth-panel-inner {
    padding: 22px 18px max(22px, env(safe-area-inset-bottom, 0px));
  }

  .auth-card h2 {
    font-size: clamp(1.25rem, 5vw, 1.65rem);
  }

  .auth-blob--lg {
    width: clamp(100px, 42vw, 165px);
    height: clamp(100px, 42vw, 165px);
  }

  .auth-blob--md {
    width: clamp(62px, 26vw, 105px);
    height: clamp(62px, 26vw, 105px);
  }
}

/* ══════════════════════════════════════════════════════
   PLANNING — Accordion + Mobile responsive (final override)
   NOTE: Placed AFTER base planning styles intentionally so
   media-query rules win in the CSS cascade.
══════════════════════════════════════════════════════ */

/* ── Accordion toggle: desktop — no interaction ──── */
.planning-acc-toggle {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  cursor: default;
  pointer-events: none;
  font: inherit;
}

/* Body: pass-through on desktop so parent grid handles spacing */
.planning-acc-body {
  display: contents;
}

/* Chevron hidden on desktop */
.planning-acc-chevron {
  display: none;
}

/* ── ≤900px: metrics 2×2, accordion active ────────── */
@media (max-width: 900px) {

  /* Fix metrics grid (overrides base repeat(4,1fr)) */
  .planning-top-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
    margin-bottom: 14px;
  }

  .planning-metric-card {
    flex-direction: row;
    align-items: center;
    min-height: 72px;
    padding: 12px 14px;
    gap: 12px;
    border-radius: 18px;
  }

  .planning-metric-icon {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
    border-radius: 12px;
    flex-shrink: 0;
  }

  .planning-metric-copy {
    min-width: 0;
    flex: 1;
  }

  .planning-metric-copy span {
    font-size: 0.65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }

  .planning-metric-copy strong {
    font-size: 1.35rem;
    line-height: 1.1;
  }

  .planning-metric-copy strong.planning-metric-text {
    font-size: 0.9rem;
    line-height: 1.2;
  }

  /* Fix workspace single column */
  .planning-workspace {
    grid-template-columns: 1fr !important;
  }

  /* Accordion: activate toggle interaction */
  .planning-acc-toggle {
    cursor: pointer;
    pointer-events: auto;
    padding: 12px 14px;
    width: 100%;
    align-items: center;
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(219, 225, 242, 0.72);
  }

  .planning-acc-toggle:hover {
    background: rgba(240, 244, 255, 0.7);
  }

  /* Chevron indicator */
  .planning-acc-chevron {
    display: block;
    color: #8a96be;
    font-size: 0.88rem;
    flex-shrink: 0;
    transition: transform 0.22s ease;
  }

  /* Accordion body: visible by default */
  .planning-acc-body {
    display: grid;
    gap: 8px;
    padding: 10px 14px 14px;
  }

  /* Remove card's own padding so toggle+body control it */
  .planning-side-card {
    padding: 0 !important;
    overflow: hidden;
  }

  /* Collapsed state */
  [data-plan-accordion].is-collapsed .planning-acc-body {
    display: none;
  }

  [data-plan-accordion].is-collapsed .planning-acc-toggle {
    border-bottom: 0;
  }

  [data-plan-accordion].is-collapsed .planning-acc-chevron {
    transform: rotate(-90deg);
  }

  /* Canvas: single column */
  .planning-canvas-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .planning-recent-link {
    width: 100%;
    justify-content: center;
  }

  .planning-form-actions {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .planning-secondary-action {
    width: 100%;
    text-align: center;
  }
}

/* ── ≤600px: compact refinements ─────────────────── */
@media (max-width: 600px) {
  .planning-top-metrics {
    gap: 8px !important;
    margin-bottom: 12px;
  }

  .planning-metric-card {
    min-height: 60px;
    padding: 10px 12px;
    gap: 10px;
  }

  .planning-metric-icon {
    width: 34px;
    height: 34px;
    font-size: 0.85rem;
  }

  .planning-metric-copy strong {
    font-size: 1.2rem;
  }

  .planning-metric-copy strong.planning-metric-text {
    font-size: 0.82rem;
  }

  .planning-acc-toggle {
    padding: 13px 14px;
  }

  .planning-acc-body {
    padding: 12px 14px 14px;
  }
}

/* ════════════════════════════════════════════════════════════════
   Motion polish — transiciones y aperturas suaves
════════════════════════════════════════════════════════════════ */
:root {
  --motion-fast: 150ms;
  --motion-base: 220ms;
  --motion-slow: 340ms;
  --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --motion-pop: cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes eduFadeSoft {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes eduPanelRise {
  from {
    opacity: 0;
    transform: translate3d(0, 14px, 0) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes eduPanelSlide {
  from {
    opacity: 0;
    transform: translate3d(-16px, 0, 0) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes eduViewEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dashboard-section-shell > *,
.overview-hub,
.planning-hub,
.material-showcase,
.schools-hub,
.profile-hub,
.dashboard-home-blank {
  animation: eduViewEnter var(--motion-slow) var(--motion-ease);
}

.profile-panel,
.profile-metric-card,
.material-option-card,
.planning-metric-card,
.planning-card-item,
.schools-card-item,
.overview-calendar-card {
  transition:
    transform var(--motion-base) var(--motion-ease),
    box-shadow var(--motion-base) var(--motion-ease),
    border-color var(--motion-base) var(--motion-ease),
    background-color var(--motion-base) var(--motion-ease);
}

.overview-modal.is-open,
.planning-wizard-modal.is-open,
.planning-error-modal.is-open,
.dashboard-confirm-modal.is-open,
.plans-modal.is-open,
.mat-modal-overlay:not([hidden]) {
  animation: eduFadeSoft var(--motion-base) var(--motion-ease) both;
}

.overview-modal.is-open .overview-modal-dialog,
.planning-wizard-modal.is-open .planning-wizard-dialog,
.planning-error-modal.is-open .planning-error-card,
.dashboard-confirm-modal.is-open .dashboard-confirm-card,
.plans-modal.is-open .plans-modal-container,
.mat-modal-overlay:not([hidden]) .mat-modal-box {
  animation: eduPanelRise var(--motion-slow) var(--motion-pop) both;
  will-change: transform, opacity;
}

.planning-wizard-modal.is-open .planning-wizard-dialog {
  animation-fill-mode: none;
  transform: none;
  will-change: auto;
}

.overview-modal-backdrop,
.planning-wizard-backdrop,
.plans-modal-backdrop,
.mat-modal-overlay,
.planning-error-modal {
  transition:
    opacity var(--motion-base) var(--motion-ease),
    backdrop-filter var(--motion-base) var(--motion-ease);
}

.overview-calendar-panel {
  animation: eduViewEnter var(--motion-base) var(--motion-ease) both;
}

.overview-sidebar {
  transition:
    opacity var(--motion-base) var(--motion-ease),
    transform var(--motion-slow) var(--motion-pop),
    visibility var(--motion-base) var(--motion-ease),
    box-shadow var(--motion-base) var(--motion-ease);
}

.overview-main-grid.is-sidebar-open .overview-sidebar {
  animation: eduPanelSlide var(--motion-slow) var(--motion-pop) both;
}

.overview-sidebar-backdrop {
  transition:
    opacity var(--motion-base) var(--motion-ease),
    visibility var(--motion-base) var(--motion-ease),
    backdrop-filter var(--motion-base) var(--motion-ease);
}

.planning-wizard-step,
.overview-calendar-cta,
.dashboard-action-link,
.dashboard-action-button,
.planning-wizard-footer [data-plan-next],
.planning-wizard-footer [data-plan-prev],
.planning-recent-link,
.overview-task-filter,
.overview-task-btn,
.overview-sidebar-scroll-controls button {
  transition:
    transform var(--motion-fast) var(--motion-ease),
    box-shadow var(--motion-fast) var(--motion-ease),
    background-color var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) var(--motion-ease),
    color var(--motion-fast) var(--motion-ease),
    opacity var(--motion-fast) var(--motion-ease);
}

.planning-wizard-step:hover,
.overview-calendar-cta:hover,
.dashboard-action-link:hover,
.dashboard-action-button:hover,
.planning-wizard-footer [data-plan-next]:hover:not(:disabled),
.planning-wizard-footer [data-plan-prev]:hover:not(:disabled),
.planning-recent-link:hover,
.overview-task-filter:hover,
.overview-task-btn:hover,
.overview-sidebar-scroll-controls button:hover:not(:disabled) {
  transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
