/* ==========================================================================
   Intranet CIEP — hoja de estilos única
   Ruta: /intranet/css/styles.css  (se carga después de bootstrap/css/bootstrap.min.css)

   Índice
     1. Variables
     2. Base y clases heredadas
     3. Utilidades compartidas (sr-only, franjas, botones .btn-ciep, sugerencias de buscadores, animaciones)
     4. Login (index.php, restContrasena.php)
     5. Cabecera y menús (cabecera.php, menus/*)
     6. Boletín de fechas (inicio.php)
     7. Alumnos            (.al-*)
     8. Expedientes        (.exp-*, .doc-*, .btn-exp-*)
     9. Kárdex             (.kx-*)
    10. Módulos/cubículos  (.ciep-cub-*)
    11. Restablecer contraseña (restContrasena.php → body.rc-page)
    12. Tesis              (.ts-*)
   ========================================================================== */


/* ==========================================================================
   1. Variables
   ========================================================================== */
:root {
  /* Colores institucionales */
  --ciep-gray: #d8d8d8;
  --ciep-navy: #014a98;
  --ciep-navy-deep: #013b7a;
  --ciep-cyan: #00b2e3;
  --ciep-cyan-deep: #0092bd;
  --ciep-ink: #0f355a;                          /* azul oscuro de textos y etiquetas */
  --ciep-white: #ffffff;
  --ciep-text: #1d1d1f;
  --ciep-muted: #6e6e73;
  --ciep-soft: rgba(1, 74, 152, .05);
  --ciep-divider-on-navy: rgba(255, 255, 255, .28);
  --ciep-divider-on-white: rgba(1, 74, 152, .12);
  --fondo-gris: #f2f2f2;
  --input-border: #cfd8e3;
  --gold-600: #b3822f;
  --text-red: #eb320e;

  /* Colores de estado ("tracks") */
  --track-blue: #0071e3;
  --track-blue-soft: rgba(0, 113, 227, .12);
  --track-purple: #af52de;
  --track-purple-soft: rgba(175, 82, 222, .12);
  --track-teal-soft: rgba(0, 199, 190, .12);
  --track-green: #34c759;
  --track-green-deep: #1c8a3c;                  /* verde para texto sobre fondo claro */
  --track-green-soft: rgba(52, 199, 89, .12);
  --track-orange: #da711b;
  --track-orange-soft: rgba(199, 140, 52, .12);
  --track-red: #da1b1b;
  --track-red-soft: rgba(199, 52, 52, .12);
  --track-coral: #be4b6b;
  --track-coral-soft: #fbecef;

  /* Movimiento */
  --ease-out: cubic-bezier(.25, .46, .45, .94);
  --ease-apple: cubic-bezier(.32, .72, 0, 1);
  --dur-fast: 150ms;
  --dur-panel-enter: 360ms;
  --dur-panel-exit: 220ms;
  --dur-accordion: 260ms;

  /* Tipografía */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --text-3xs: .72rem;
  --text-2xs: .78rem;
  --text-xs: .86rem;
  --text-sm: .90rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1.3rem;
  --text-xl: 1.6rem;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Expedientes */
  --exp-azul: #004a98;
  --exp-azul-osc: #003670;
  --exp-azul-claro: #e8f0fa;
  --exp-texto: #1f2a37;
  --exp-texto-2: #5b6573;
  --exp-borde: #dde3eb;
  --exp-borde-hover: #c4d5ec;
  --exp-fondo: #ffffff;
  --exp-fondo-2: #f6f8fb;
  --exp-cubierta: rgba(246, 248, 251, .9);      /* capa "cargando" sobre el visor */
  --exp-pista: #e9edf2;                         /* fondo de la barra de progreso */
  --exp-ok: #1e8e5a;
  --exp-ok-claro: #e6f4ed;
  --exp-pend: #b0b8c4;
  --exp-deshabilitado: #d3d8df;
  --exp-icono-vacio: #9aa6b5;
  --exp-peligro: #c0392b;
  --exp-peligro-claro: #fdecea;
  --exp-foco: rgba(0, 74, 152, .15);
  --exp-foco-fuerte: rgba(0, 74, 152, .3);
  --exp-radio: 10px;
  --exp-sombra: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);

  /* Sombras, superposiciones y tonos compartidos (alumnos y botones .btn-ciep) */
  --gold-400: #e0b65e;
  --gold-600-soft: rgba(179, 130, 47, .14);
  --gold-600-tint: rgba(179, 130, 47, .08);
  --ciep-disabled-fill: #9fb4cc;                /* fondo de botón deshabilitado */
  --ciep-text-readonly: #4a4a4a;                /* texto de campos bloqueados */
  --ciep-focus-ring: rgba(0, 178, 227, .2);
  --ciep-overlay: rgba(1, 20, 45, .65);
  --ciep-cubierta: rgba(242, 242, 242, .92);    /* capa "cargando" sobre un visor (tesis) */
  --ciep-white-a18: rgba(255, 255, 255, .18);
  --ciep-white-a96: rgba(255, 255, 255, .96);
  --ciep-shadow-card: 0 2px 14px rgba(1, 74, 152, .08);
  --ciep-shadow-float: 0 6px 20px rgba(1, 74, 152, .12);
  --ciep-shadow-modal: 0 14px 40px rgba(1, 20, 45, .25);
}


/* ==========================================================================
   2. Base y clases heredadas (las que siguen en uso)
   ========================================================================== */

/* Pie de página antiguo (pie.php): fijo al fondo del documento */
html { min-height: 100%; position: relative; }
body { margin: 0 0 80px; }

.piePagina {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 80px;
  font-size: 10px;
  background-color: var(--ciep-navy);
}

label { color: var(--ciep-ink); font-style: italic; }

/* Lista desplegable de los <select>: fondo blanco (algunos navegadores, como Chrome en
   Windows, la pintan gris). Las clases de color de una opción (p. ej. .colorTextRojo) siguen ganando. */
select option,
select optgroup { background-color: var(--ciep-white); color: var(--ciep-text); }
a[disabled] { pointer-events: none; }

.fondoPagina   { background-color: #f9f9f9; }
.fondo         { background-color: var(--ciep-navy); }
.colorTextAzul { color: var(--ciep-ink); }
.colorTextRojo { color: red; }
.asterisco2    { color: #ff0000; padding-left: 2px; }
.colorTextMenu { color: var(--ciep-navy); }

/* Separador punteado antes del enlace "cambiar de usuario" (functions.php → getOtroUsuario()) */
#separador { margin: 10px 20px; border-bottom: 1px dashed #ccc; }


/* ==========================================================================
   3. Utilidades compartidas
   ========================================================================== */

/* Sólo para lectores de pantalla */
.ciep-sr-only,
.kx-sr {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Franja degradada superior de tarjetas y ventanas */
.kx-card::before,
.kx-dialog::before,
.ciep-cub-dialog::before {
  content: "";
  display: block;
  height: 5px;
  background: linear-gradient(90deg, var(--ciep-navy), var(--ciep-cyan));
}
.al-card::before,
.al-modal .modal-header::before,
.exp-modal .modal-header::before,
.ts-card::before,
.ts-modal .modal-header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ciep-navy), var(--ciep-cyan));
}

/* Botones institucionales sobre Bootstrap (.btn .btn-ciep / .btn-ciep-outline).
   Se definen también las variables --bs-btn-* para que los estados :active y
   :disabled de Bootstrap 5 no dejen el botón transparente. */
.btn-ciep {
  --bs-btn-color: var(--ciep-white);
  --bs-btn-bg: var(--ciep-navy);
  --bs-btn-border-color: var(--ciep-navy);
  --bs-btn-hover-color: var(--ciep-white);
  --bs-btn-hover-bg: var(--ciep-cyan-deep);
  --bs-btn-hover-border-color: var(--ciep-cyan-deep);
  --bs-btn-active-color: var(--ciep-white);
  --bs-btn-active-bg: var(--ciep-navy-deep);
  --bs-btn-active-border-color: var(--ciep-navy-deep);
  --bs-btn-disabled-color: var(--ciep-white);
  --bs-btn-disabled-bg: var(--ciep-disabled-fill);
  --bs-btn-disabled-border-color: var(--ciep-disabled-fill);
  --bs-btn-disabled-opacity: 1;
  --bs-btn-focus-shadow-rgb: 0, 178, 227;
  background: var(--ciep-navy);
  border: 1px solid var(--ciep-navy);
  color: var(--ciep-white);
}
.btn-ciep:hover,
.btn-ciep:focus { background: var(--ciep-cyan-deep); border-color: var(--ciep-cyan-deep); color: var(--ciep-white); }
.btn-ciep:disabled { background: var(--ciep-disabled-fill); border-color: var(--ciep-disabled-fill); color: var(--ciep-white); opacity: 1; cursor: not-allowed; }

.btn-ciep-outline {
  --bs-btn-color: var(--ciep-navy);
  --bs-btn-bg: var(--ciep-white);
  --bs-btn-border-color: var(--ciep-navy);
  --bs-btn-hover-color: var(--ciep-white);
  --bs-btn-hover-bg: var(--ciep-navy);
  --bs-btn-hover-border-color: var(--ciep-navy);
  --bs-btn-active-color: var(--ciep-white);
  --bs-btn-active-bg: var(--ciep-navy-deep);
  --bs-btn-active-border-color: var(--ciep-navy-deep);
  --bs-btn-disabled-color: var(--ciep-muted);
  --bs-btn-disabled-bg: var(--ciep-white);
  --bs-btn-disabled-border-color: var(--input-border);
  --bs-btn-disabled-opacity: 1;
  --bs-btn-focus-shadow-rgb: 0, 178, 227;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ciep-white);
  border: 1px solid var(--ciep-navy);
  color: var(--ciep-navy);
}
.btn-ciep-outline:hover,
.btn-ciep-outline:focus { background: var(--ciep-navy); color: var(--ciep-white); }
.btn-ciep-outline:hover img,
.btn-ciep-outline:focus img { filter: brightness(0) invert(1); }
.btn-ciep-outline:disabled { background: var(--ciep-white); border-color: var(--input-border); color: var(--ciep-muted); cursor: not-allowed; }
.btn-ciep-outline:disabled img { opacity: .5; }

/* Sugerencias de los buscadores (combobox propio, sin <datalist>): Alumnos, Expedientes y Tesis.
   Estructura común; el fondo, el color del borde y los textos van en la sección de cada módulo. */
.exp-combo,
.al-combo,
.ts-combo { position: relative; }
.exp-sugerencias,
.al-sugerencias,
.ts-sugerencias {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 1020;                   /* debajo del menú fijo (1030) */
  max-height: 300px;
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  border: 1px solid;
  border-radius: 8px;
  box-shadow: var(--ciep-shadow-float);
}
.exp-sugerencias[hidden],
.al-sugerencias[hidden],
.ts-sugerencias[hidden] { display: none; }
.exp-sug,
.al-sug,
.ts-sug {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.exp-sug-mensaje,
.al-sug-mensaje,
.ts-sug-mensaje { padding: 8px 10px; font-size: var(--text-2xs); font-style: italic; }

/* Fondo de las ventanas <dialog> */
.kx-dialog::backdrop,
.ciep-cub-dialog::backdrop { background: rgba(1, 20, 45, .55); }

/* Animaciones */
@keyframes ciep-girar   { to { transform: rotate(360deg); } }
@keyframes ciep-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ciep-aparecer {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: none; }
}


/* ==========================================================================
   4. Login (index.php, restContrasena.php)
   ========================================================================== */
html:has(> body.login-page),
body.login-page { height: 100%; }
body.login-page { min-height: 100vh; }

.login-page {
  display: flex;
  flex-direction: column;
  background-image: url("../img/cubes.png");
  background-repeat: repeat;
}
.login-page > .container-fluid {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

/* Formulario centrado en el espacio libre entre cabecera y pie */
.login-main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
/* Espaciador invisible: sube el formulario sin encimarlo sobre la cabecera */
.login-main::after { content: ""; flex: 0 1 120px; }
@media (max-width: 768px) {
  .login-main::after { flex-basis: 180px; }
}
.login-box { width: 100%; max-width: 300px; }

/* Barra con el logo en móvil (restContrasena.php) */
.ciep-barra-movil { background-color: var(--ciep-navy); }


/* ==========================================================================
   5. Cabecera y menús (cabecera.php, menus/menu-render.php, menus/menu-sin.php)
   No dependen de los componentes de Bootstrap.
   ========================================================================== */

/* ---------- Reinicio mínimo ---------- */
.ciep-intranet-masthead, .ciep-intranet-nav, .ciep-offcanvas { font-family: var(--font-body); -webkit-font-smoothing: antialiased; }
.ciep-intranet-masthead *, .ciep-intranet-nav *, .ciep-offcanvas * { box-sizing: border-box; }
.ciep-intranet-masthead a, .ciep-intranet-nav a, .ciep-offcanvas a { text-decoration: none; }
.ciep-intranet-masthead svg, .ciep-intranet-nav svg, .ciep-offcanvas svg { flex: none; }
.ciep-intranet-nav ul, .ciep-offcanvas ul { margin: 0; }
.ciep-intranet-nav p, .ciep-offcanvas p { margin-top: 0; }

/* ---------- Visibilidad escritorio / móvil ---------- */
.ciep-solo-escritorio { display: none !important; }
@media (min-width: 992px) {
  .ciep-solo-escritorio { display: block !important; }
  .ciep-solo-movil { display: none !important; }
}

/* ---------- Ancho completo dentro de .container / .container-fluid ----------
   Compensa el relleno lateral del contenedor (BS4: 15px; BS5: --bs-gutter-x). */
.container > .ciep-bleed,
.container-fluid > .ciep-bleed,
.container-fluid > .ciep-ribbon {
  margin-left: calc(-.5 * var(--bs-gutter-x, 30px));
  margin-right: calc(-.5 * var(--bs-gutter-x, 30px));
}

/* ---------- Cabecera azul ---------- */
.ciep-masthead { background: var(--ciep-navy); }

.ciep-masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(16px, 4vw, 64px);
}
.ciep-masthead-inner--compact { gap: 12px; padding-block: 10px; }

.ciep-brand { display: flex; align-items: center; gap: 18px; min-width: 0; }
.ciep-brand-link { display: inline-flex; align-items: center; border-radius: 4px; }
.ciep-brand-link img {
  display: block;
  height: 46px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
}
.ciep-masthead-inner--compact .ciep-brand-link img { height: 34px; }
.ciep-brand-sep { width: 1px; height: 34px; flex: none; background: var(--ciep-divider-on-navy); }

/* "Intranet" en la cabecera de escritorio */
.ciep-intranet-label {
  padding: 0;
  border: 0;
  color: var(--ciep-white);
  font-size: 1.35rem;
  font-style: italic;
  font-weight: var(--weight-semibold);
  letter-spacing: .04em;
  line-height: 1;
  text-transform: uppercase;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.ciep-intranet-label:hover { color: var(--ciep-white); opacity: .78; }

/* "Intranet" en la barra compacta (móvil) */
.ciep-intranet-tag {
  margin-right: auto;
  padding-left: 12px;
  border-left: 1px solid var(--ciep-divider-on-navy);
  color: rgba(255, 255, 255, .85);
  font-size: var(--text-sm);
  font-style: italic;
  font-weight: var(--weight-semibold);
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* Botones de abrir / cerrar el panel móvil */
.ciep-menu-toggle,
.ciep-menu-close {
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: none;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ciep-white);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.ciep-menu-toggle { display: none; }
.ciep-menu-close { display: inline-flex; }
.ciep-menu-toggle:hover, .ciep-menu-close:hover { background: rgba(255, 255, 255, .12); }
.ciep-menu-toggle:active, .ciep-menu-close:active { background: rgba(255, 255, 255, .2); }
.ciep-menu-toggle svg { width: 20px; height: 20px; }
.ciep-menu-close svg { width: 19px; height: 19px; }
@media (max-width: 1199.98px) { .ciep-menu-toggle { display: inline-flex; } }

.ciep-ribbon { height: 6px; background: var(--ciep-cyan); }

/* ---------- Contenedor fijo del menú ---------- */
.ciep-intranet-nav {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--ciep-white);
}

/* ---------- Barra de pestañas (escritorio) ---------- */
.ciep-tabsbar { background: var(--ciep-navy); }

.ciep-intranet-tabsbar-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  min-height: 54px;
  padding: 0 clamp(16px, 4vw, 64px);
  border-top: 1px solid rgba(255, 255, 255, .12);
}
.ciep-intranet-tabs { grid-column: 2; min-width: 0; }

.ciep-tabs {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 4px;
  margin: 0;
  padding: 8px 0;
}
.ciep-tabs > li { display: flex; align-items: stretch; position: relative; }

.ciep-tabs .ciep-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: 8px;
  color: rgba(255, 255, 255, .86);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
/* Los desplegables usan <button>: se iguala su aspecto al de los enlaces */
.ciep-tabs button.ciep-tab {
  border: 0;
  background: transparent;
  font-family: inherit;
  line-height: inherit;
  cursor: pointer;
}
.ciep-tabs .ciep-tab svg { width: 12px; height: 12px; opacity: .7; transition: transform var(--dur-fast) var(--ease-out); }
.ciep-tabs .ciep-tab[aria-expanded="true"] svg { transform: rotate(180deg); }
.ciep-tabs .ciep-tab:hover { background: rgba(255, 255, 255, .10); color: var(--ciep-white); }
.ciep-tabs .ciep-tab[aria-expanded="true"] { background: rgba(255, 255, 255, .16); color: var(--ciep-white); }
.ciep-tabs .ciep-tab:focus-visible { outline-offset: -2px; }

/* Sección actual: texto blanco y una barra cian bajo la pestaña */
.ciep-tabs .ciep-tab.is-active,
.ciep-tabs .ciep-tab[aria-current="page"] { color: var(--ciep-white); font-weight: var(--weight-semibold); }
.ciep-tabs .ciep-tab.is-active::after,
.ciep-tabs .ciep-tab[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--ciep-cyan);
}

/* ---------- Desplegables (pestañas y menú de usuario) ---------- */
/* .ciep-intranet-user da la misma prioridad que .ciep-tabs (gana a ".ciep-intranet-nav ul") */
.ciep-tabs .ciep-dropdown-menu,
.ciep-intranet-user .ciep-user-menu {
  position: absolute;
  top: 100%;
  z-index: 1040;
  display: block;
  margin-top: 10px;
  padding: 6px;
  list-style: none;
  text-align: left;
  background: var(--ciep-white);
  border: 0;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(1, 20, 45, .22), 0 2px 6px rgba(1, 20, 45, .08);
  opacity: 0;
  visibility: hidden;
  translate: 0 -4px;
  pointer-events: none;
  transition:
    opacity var(--dur-fast) var(--ease-out),
    translate var(--dur-fast) var(--ease-out),
    visibility 0s linear var(--dur-fast);
}
.ciep-tabs .ciep-dropdown-menu { left: 0; min-width: 220px; }
.ciep-intranet-user .ciep-user-menu { right: 0; left: auto; min-width: 250px; }

.ciep-tabs .ciep-dropdown-menu.is-open,
.ciep-intranet-user .ciep-user-menu.is-open {
  opacity: 1;
  visibility: visible;
  translate: 0 0;
  pointer-events: auto;
  transition:
    opacity var(--dur-fast) var(--ease-out),
    translate var(--dur-fast) var(--ease-out),
    visibility 0s linear 0s;
}

.ciep-tabs .ciep-dropdown-item,
.ciep-user-menu .ciep-dropdown-item {
  padding: .55rem .7rem;
  border-radius: 6px;
  color: var(--ciep-text);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.ciep-tabs .ciep-dropdown-item { display: block; width: 100%; white-space: nowrap; }
.ciep-user-menu .ciep-dropdown-item { display: flex; align-items: center; gap: 8px; }
.ciep-user-menu .ciep-dropdown-item svg { width: 15px; height: 15px; flex: none; }

.ciep-tabs .ciep-dropdown-item:hover,
.ciep-tabs .ciep-dropdown-item:focus,
.ciep-user-menu .ciep-dropdown-item:hover,
.ciep-user-menu .ciep-dropdown-item:focus { background: rgba(1, 74, 152, .07); color: var(--ciep-navy); }
/* Al hacer clic con el ratón no se queda el fondo de foco */
.ciep-intranet-nav .ciep-dropdown-item:focus:not(:focus-visible) { background: transparent; }
.ciep-intranet-nav .ciep-dropdown-item:hover { background: rgba(1, 74, 152, .07); }

.ciep-intranet-nav .ciep-dropdown-item[aria-current="page"] {
  background: rgba(1, 74, 152, .07);
  color: var(--ciep-navy);
  font-weight: var(--weight-semibold);
}
.ciep-tabs .ciep-dropdown-item.disabled { color: var(--ciep-muted); pointer-events: none; }

/* ---------- Menú de usuario ---------- */
.ciep-intranet-user { grid-column: 3; justify-self: end; position: relative; }

.ciep-user-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 280px;
  padding: 4px 10px 4px 4px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: var(--ciep-white);
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.ciep-user-toggle:hover,
.ciep-user-toggle[aria-expanded="true"] { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .4); }
.ciep-user-toggle > svg { width: 12px; height: 12px; flex: none; opacity: .8; transition: transform var(--dur-fast) var(--ease-out); }
.ciep-user-toggle[aria-expanded="true"] > svg { transform: rotate(180deg); }
.ciep-user-toggle .ciep-user-photo { box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.ciep-user-toggle .ciep-user-initials { background: var(--ciep-cyan); color: var(--ciep-navy-deep); }

.ciep-user-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ciep-user-photo {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: var(--fondo-gris);
}
.ciep-user-photo--lg { width: 48px; height: 48px; }
.ciep-user-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ciep-navy);
  color: var(--ciep-white);
  font-size: var(--text-3xs);
  font-weight: var(--weight-bold);
  letter-spacing: .02em;
}
.ciep-user-photo--lg.ciep-user-initials { font-size: var(--text-sm); }

.ciep-user-menu-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: .5rem .7rem .7rem;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--ciep-divider-on-white);
}
.ciep-user-menu-name { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--ciep-text); }
.ciep-user-menu-role { font-size: var(--text-2xs); color: var(--ciep-muted); }
.ciep-user-menu .ciep-dropdown-divider { height: 0; margin: 4px 0; border-top: 1px solid var(--ciep-divider-on-white); }

.ciep-user-menu .ciep-logout { color: var(--text-red); }
.ciep-user-menu .ciep-logout:hover,
.ciep-user-menu .ciep-logout:focus { background: rgba(235, 50, 14, .08); color: var(--text-red); }

/* Lo que imprima getOtroUsuario() (enlace, botón o formulario) */
.ciep-user-menu-switch a,
.ciep-user-menu-switch button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: .55rem .7rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ciep-navy);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-align: left;
}
.ciep-user-menu-switch a:hover,
.ciep-user-menu-switch button:hover { background: rgba(1, 74, 152, .07); }

.ciep-mobile-tabs .ciep-mobile-switch a { display: flex; align-items: center; justify-content: flex-start; gap: 10px; }
.ciep-mobile-switch button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 52px;
  padding: 10px 4px;
  border: 0;
  background: transparent;
  color: var(--ciep-navy);
  font: inherit;
  font-weight: var(--weight-semibold);
  text-align: left;
}
.ciep-user-menu-switch form,
.ciep-mobile-switch form { margin: 0; }
.ciep-user-menu-switch img,
.ciep-mobile-switch img { width: 28px; height: 28px; flex: none; border-radius: 50%; object-fit: cover; }
.ciep-user-menu-switch hr,
.ciep-mobile-switch hr { display: none; }

/* ---------- Barra sin menú (menu-sin.php) ---------- */
.ciep-intranet-title {
  margin: 0;
  padding: 12px clamp(16px, 4vw, 64px);
  border-top: 1px solid rgba(255, 255, 255, .12);
  text-align: center;
  color: var(--ciep-white);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}
.ciep-intranet-title a:hover { opacity: .78; }

/* ---------- Panel lateral móvil ---------- */
.ciep-offcanvas {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1060;
  display: flex;
  flex-direction: column;
  width: min(420px, 100vw);
  background: var(--ciep-white);
  box-shadow: -12px 0 40px rgba(1, 20, 45, .18);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform var(--dur-panel-exit) var(--ease-apple), visibility 0s linear var(--dur-panel-exit);
}
.ciep-offcanvas.is-open {
  transform: none;
  visibility: visible;
  transition: transform var(--dur-panel-enter) var(--ease-apple), visibility 0s linear 0s;
}
.ciep-offcanvas-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1055;
  background: rgba(1, 20, 45, .45);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-panel-exit) var(--ease-out), visibility 0s linear var(--dur-panel-exit);
}
.ciep-offcanvas-backdrop.is-open { opacity: 1; visibility: visible; transition: opacity var(--dur-panel-enter) var(--ease-out); }
body.ciep-scroll-lock { overflow: hidden; }

.ciep-mobile-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  padding: 14px clamp(16px, 4vw, 64px);
  background: var(--ciep-navy);
}
.ciep-mobile-panel-head img { height: 30px; width: auto; filter: brightness(0) invert(1); }

.ciep-mobile-panel-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 24px;
}

.ciep-mobile-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px clamp(16px, 4vw, 28px) 14px;
  border-bottom: 1px solid var(--ciep-divider-on-white);
  background: rgba(1, 74, 152, .03);
}
.ciep-mobile-user-text { display: flex; flex-direction: column; min-width: 0; }
.ciep-mobile-user-name { font-weight: var(--weight-semibold); color: var(--ciep-text); overflow-wrap: anywhere; }
.ciep-mobile-user-role { font-size: var(--text-2xs); color: var(--ciep-muted); }

.ciep-mobile-section {
  margin: 18px 0 0;
  padding: 0 clamp(16px, 4vw, 28px);
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ciep-muted);
}

.ciep-mobile-tabs {
  list-style: none;
  margin: 0;
  padding: 4px clamp(16px, 4vw, 28px) 12px;
}
.ciep-mobile-tabs > li { border-bottom: 1px solid var(--ciep-divider-on-white); }

.ciep-mobile-tabs a,
.ciep-mobile-tabs .ciep-mobile-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
  min-height: 52px;
  padding: 10px 4px;
  color: var(--ciep-navy);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
}
.ciep-mobile-tabs--account a { font-weight: var(--weight-medium); }
.ciep-mobile-tabs .ciep-mobile-logout { color: var(--text-red); }
.ciep-mobile-tabs .ciep-mobile-logout svg { width: 17px; height: 17px; flex: none; }

.ciep-mobile-summary {
  border: 0;
  border-radius: 5px;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.ciep-mobile-summary:hover { background: rgba(1, 74, 152, .06); }
.ciep-mobile-summary svg {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--ciep-muted);
  transition: transform var(--dur-fast) var(--ease-out);
}
.ciep-mobile-summary[aria-expanded="true"] svg { transform: rotate(180deg); }

.ciep-mobile-sub { list-style: none; margin: 0; padding: 0 0 10px 4px; }
.ciep-mobile-sub a,
.ciep-mobile-sub span {
  display: flex;
  align-items: center;
  min-height: 0;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--ciep-text);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1.35;
}
.ciep-mobile-sub a:hover { background: rgba(1, 74, 152, .06); }
.ciep-mobile-sub span { color: var(--ciep-muted); }

.ciep-mobile-sub a[aria-current="page"],
.ciep-mobile-tabs > li > a[aria-current="page"] {
  color: var(--ciep-navy);
  background: rgba(1, 74, 152, .07);
  font-weight: var(--weight-semibold);
}
.ciep-mobile-tabs > li > a[aria-current="page"] { padding-inline: 10px; border-radius: 6px; }

/* Acordeón del panel (técnica grid) */
.ciep-accordion {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur-accordion) var(--ease-out);
}
.ciep-accordion.is-open { grid-template-rows: 1fr; }
.ciep-accordion-inner { overflow: hidden; min-height: 0; }
.ciep-accordion:not(.is-open) .ciep-accordion-inner { visibility: hidden; }

@media (max-width: 991.98px) {
  .ciep-brand-link img { height: 38px; }
  .ciep-tabsbar { display: none; }
}
@media (min-width: 992px) {
  .ciep-offcanvas, .ciep-offcanvas-backdrop { display: none !important; }
}

/* ---------- Submenús fijos de cada página ----------
   intranet-menu.js publica la altura real del menú en --ciep-nav-h. */
.submenu-top { top: var(--ciep-nav-h, 131px); }
@media (max-width: 767.98px) {
  .submenu-top { top: var(--ciep-nav-h, 74px); }
}

/* ---------- Foco: anillo sólo al navegar con teclado ---------- */
.ciep-intranet-masthead a:focus,
.ciep-intranet-nav a:focus,
.ciep-intranet-nav button:focus,
.ciep-offcanvas a:focus,
.ciep-offcanvas button:focus { outline: none; }
.ciep-intranet-nav button::-moz-focus-inner,
.ciep-offcanvas button::-moz-focus-inner { border: 0; }

.ciep-intranet-masthead a:focus-visible,
.ciep-intranet-nav a:focus-visible,
.ciep-intranet-nav button:focus-visible {
  outline: 2px solid var(--ciep-cyan);
  outline-offset: 2px;
  border-radius: 8px;
}
/* Dentro de las tarjetas blancas, anillo azul por dentro */
.ciep-intranet-nav .ciep-dropdown-menu a:focus-visible,
.ciep-intranet-nav .ciep-dropdown-menu button:focus-visible,
.ciep-offcanvas a:focus-visible,
.ciep-offcanvas button:focus-visible {
  outline: 2px solid var(--ciep-navy);
  outline-offset: -2px;
  border-radius: 6px;
}
.ciep-offcanvas .ciep-mobile-panel-head button:focus-visible { outline-color: var(--ciep-white); }

@media (prefers-reduced-motion: reduce) {
  .ciep-tabs .ciep-dropdown-menu,
  .ciep-user-menu,
  .ciep-user-toggle > svg,
  .ciep-offcanvas,
  .ciep-offcanvas-backdrop,
  .ciep-accordion { transition: none; }
}

@media print {
  .ciep-intranet-nav,
  .ciep-offcanvas,
  .ciep-offcanvas-backdrop { display: none !important; }
  .ciep-intranet-masthead { display: block !important; }
}


/* ==========================================================================
   6. Boletín de fechas importantes (inicio.php → getBoletinInfo())
   ========================================================================== */
.boletin {
  --b-acento: var(--ciep-navy);
  --b-borde: #e2e7ee;
  --b-texto: #1f2a37;
  --b-suave: #5f6b7a;
  --b-pista: #edf1f6;
  font-style: normal;
}

/* ---- Secciones (sólo se muestran títulos si hay más de una) ---- */
.boletin-seccion + .boletin-seccion { margin-top: 1.75rem; }

.boletin-seccion-titulo {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 .65rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--b-acento);
}
.boletin-seccion-titulo::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--b-borde);
}
.boletin-contador {
  min-width: 1.4rem;
  padding: .1rem .45rem;
  border-radius: 999px;
  background: var(--b-pista);
  color: var(--b-suave);
  font-size: .72rem;
  text-align: center;
  letter-spacing: 0;
}

/* ---- Lista ---- */
.boletin-lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

/* ---- Tarjeta de cada actividad ---- */
.boletin-item {
  --b-estado: #2f855a;          /* en curso */
  --b-estado-fondo: #e7f5ed;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .85rem 1rem;
  background: #fff;
  border: 1px solid var(--b-borde);
  border-left: 4px solid var(--b-estado);
  border-radius: .5rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
  transition: box-shadow .15s ease, transform .15s ease;
}
.boletin-item:hover {
  box-shadow: 0 4px 12px rgba(16, 24, 40, .08);
  transform: translateY(-1px);
}

.estado-pronto     { --b-estado: #b7791f; --b-estado-fondo: #fdf3e1; }
.estado-hoy        { --b-estado: #c53030; --b-estado-fondo: #fdeaea; }
.estado-proximo    { --b-estado: #2b6cb0; --b-estado-fondo: #e6effa; }
.estado-finalizado,
.estado-sin-fecha  { --b-estado: #8a94a3; --b-estado-fondo: #f1f3f6; }
.estado-finalizado .boletin-titulo { color: var(--b-suave); }

/* Recuadro de fecha */
.boletin-fecha {
  flex: 0 0 3.6rem;
  padding: .35rem 0 .4rem;
  border-radius: .4rem;
  background: var(--b-estado-fondo);
  color: var(--b-estado);
  text-align: center;
  line-height: 1;
}
.boletin-fecha .et {
  display: block;
  margin-bottom: .25rem;
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .85;
}
.boletin-fecha .dia {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
}
.boletin-fecha .mes {
  display: block;
  margin-top: .2rem;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* Texto */
.boletin-cuerpo { flex: 1 1 auto; min-width: 0; }
.boletin-titulo {
  font-weight: 600;
  color: var(--b-texto);
  line-height: 1.3;
}
.boletin-meta {
  margin-top: .2rem;
  font-size: .84rem;
  color: var(--b-suave);
}
.boletin-meta .sep { margin: 0 .15rem; opacity: .5; }
.boletin-meta .nw  { white-space: nowrap; }
.boletin-aviso {
  display: inline-block;
  margin-top: .4rem;
  padding: .15rem .5rem;
  border-radius: .3rem;
  background: #fdeaea;
  color: #c53030;
  font-size: .78rem;
  font-weight: 600;
}

/* Barra de avance del periodo */
.boletin-progreso {
  height: 4px;
  margin-top: .6rem;
  border-radius: 999px;
  background: var(--b-pista);
  overflow: hidden;
}
.boletin-progreso > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--b-estado);
}

/* Etiqueta de estado */
.boletin-estado {
  flex: 0 0 auto;
  padding: .3rem .7rem;
  border-radius: 999px;
  background: var(--b-estado-fondo);
  color: var(--b-estado);
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Sin registros */
.boletin-vacio {
  padding: 1.5rem 1rem;
  border: 1px dashed var(--b-borde);
  border-radius: .5rem;
  background: #fff;
  color: var(--b-suave);
  text-align: center;
}

/* ---- Celulares ---- */
@media (max-width: 575.98px) {
  .boletin-item { flex-wrap: wrap; align-items: flex-start; gap: .75rem; }
  .boletin-cuerpo { flex-basis: calc(100% - 4.35rem); }
  .boletin-estado { margin-left: 4.35rem; margin-top: -.25rem; }
}


/* ==========================================================================
   7. Alumnos (alumnos/index.php)
   Clases al-*. Todo limitado a .al-page salvo las clases propias al-*.
   Bootstrap 5.3: form-select, row g-2, input-group sin -append.
   La franja de .al-card y de los modales está en la sección 3;
   .btn-ciep / .btn-ciep-outline también (sección 3).
   ========================================================================== */

.al-page {
  /* Verde y naranja un poco más oscuros que los del sitio, para leerse sobre blanco */
  --track-green: #1f9d48;
  --track-green-soft: rgba(52, 199, 89, .14);
  --track-orange: #c45f0f;
  --track-orange-soft: rgba(199, 140, 52, .14);

  font-family: var(--font-body);
  color: var(--ciep-text);
  padding: 4px 4px 24px;
}

.al-page h2,
.al-page .modal-title { font-style: normal; }


/* ---------- Encabezado ---------- */
.al-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 5px 4px 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--ciep-divider-on-white);
}
.al-header h1 { margin: 0; }

.al-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.al-toolbar > select { width: auto; min-width: 150px; max-width: 280px; }
.al-search { min-width: 240px; }
.al-search .input-group { flex-wrap: nowrap; }

/* Botones de la barra con la misma altura que los controles sm */
.al-page .al-toolbar .btn-sm,
.al-page .al-toolbar .input-group-sm > .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  height: calc(1.2rem + .5rem + 2px);   /* = alto de .form-control-sm con letra .8rem */
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1;
}
.al-page .al-toolbar .btn-sm img { display: block; }
.al-page .al-search .btn-sm { padding-left: .6rem; padding-right: .6rem; }

/* Sugerencias del buscador: la estructura (.al-combo, .al-sugerencias, .al-sug,
   .al-sug-mensaje) es compartida y está en la sección 3; aquí colores y contenido.
   Se alinea a la derecha porque el buscador está en el borde derecho de la barra. */
.al-sugerencias {
  left: auto;
  min-width: min(360px, calc(100vw - 24px));
  background: var(--ciep-white);
  border-color: var(--ciep-divider-on-white);
}
.al-sug-lista { margin: 0; padding: 0; list-style: none; }
.al-sug:hover,
.al-sug.is-activo { background: var(--track-blue-soft); }
.al-sug.is-activo { box-shadow: inset 2px 0 0 var(--ciep-cyan); }
.al-sug-nombre { font-size: var(--text-xs); font-weight: var(--weight-semibold); line-height: 1.3; color: var(--ciep-navy); }
.al-sug-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  font-size: var(--text-3xs);
  color: var(--ciep-muted);
}
.al-sug-clave { font-variant-numeric: tabular-nums; font-weight: var(--weight-medium); }
.al-sug-mensaje { margin: 0; color: var(--ciep-muted); }
.al-page .al-search input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }


/* ---------- Controles ---------- */
.al-page .form-control-sm,
.al-page .form-select-sm {
  font-size: .8rem;
  border-color: var(--input-border);
  border-radius: 6px;
  color: var(--ciep-text);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.al-page .form-control-sm { padding-left: .45rem; padding-right: .45rem; }
.al-page .form-select-sm { padding-left: .45rem; }
.al-page .input-group > .form-control-sm { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.al-page .form-control-sm:focus,
.al-page .form-select-sm:focus {
  border-color: var(--ciep-cyan);
  box-shadow: 0 0 0 .18rem var(--ciep-focus-ring);
}
.al-page .form-control-sm:disabled,
.al-page .form-control-sm[readonly],
.al-page .form-select-sm:disabled {
  background-color: var(--fondo-gris);
  color: var(--ciep-text-readonly);
}
.al-page textarea.form-control-sm { resize: vertical; min-height: 64px; }
.al-page input[type="date"].form-control-sm { padding-left: .35rem; padding-right: .2rem; font-size: .76rem; }
.al-page .form-control-sm.is-invalid { border-color: var(--track-red); }
.al-page .invalid-feedback { font-size: var(--text-3xs); }

.al-page .al-label {
  display: block;
  margin: 8px 0 2px;
  font-size: .74rem;
  font-style: normal;                    /* la sección 2 pone label en cursiva */
  font-weight: var(--weight-semibold);
  letter-spacing: .02em;
  color: var(--ciep-muted);
}

.al-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--gold-600);
  background: var(--gold-600-tint);
  border-radius: 0 6px 6px 0;
  font-size: .8rem;
  line-height: 1.5;
  color: var(--ciep-text);
}


/* ---------- Botones (.btn-ciep y .btn-ciep-outline en la sección 3) ---------- */
.al-page .btn-sm { font-size: .8rem; border-radius: 6px; font-weight: var(--weight-semibold); }
.al-page .btn:focus-visible { outline: 2px solid var(--ciep-cyan); outline-offset: 2px; box-shadow: none; }


/* ---------- Lista de alumnos ---------- */
.al-list {
  background: var(--ciep-white);
  border: 1px solid var(--ciep-divider-on-white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--ciep-shadow-card);
}

.al-list-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--ciep-navy);
  color: var(--ciep-white);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}
.al-list-count {
  margin-left: auto;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--ciep-white-a18);
  font-size: var(--text-3xs);
}
.al-list-count:empty { display: none; }

.al-list-body { max-height: 60vh; overflow-y: auto; overscroll-behavior: contain; }

/* En pantalla ancha la lista crece según el número de alumnos, con tope en la
   altura de los formularios; si hay más, se desplaza por dentro. */
@media (min-width: 1200px) {
  .al-list-col { position: relative; min-height: 320px; }
  .al-list {
    position: absolute;
    top: 0;
    left: calc(var(--bs-gutter-x) * .5);
    right: calc(var(--bs-gutter-x) * .5);
    max-height: calc(100% - 16px);   /* 16px = margen inferior de la barra de guardado */
    display: flex;
    flex-direction: column;
  }
  .al-list-head { flex: none; }
  .al-list-body { flex: 1 1 auto; min-height: 0; max-height: none; }
}

.al-item {
  display: block;
  width: 100%;
  padding: 9px 14px 9px 11px;
  border: 0;
  border-left: 3px solid transparent;
  border-bottom: 1px solid var(--ciep-divider-on-white);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.al-item:last-child { border-bottom: 0; }
.al-item:hover { background: var(--ciep-soft); }
.al-item:focus-visible { outline: 2px solid var(--ciep-cyan); outline-offset: -2px; }
.al-item.is-selected { background: var(--track-blue-soft); border-left-color: var(--ciep-cyan); }

.al-item-name {
  display: block;
  font-size: .84rem;
  font-weight: var(--weight-semibold);
  line-height: 1.3;
  color: var(--ciep-navy);
}
.al-item-clave {
  display: inline-block;
  margin-right: 6px;
  font-variant-numeric: tabular-nums;
  color: var(--ciep-muted);
  font-weight: var(--weight-medium);
}
.al-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: .74rem;
  color: var(--ciep-muted);
}

.al-list-empty {
  padding: 22px 16px;
  text-align: center;
  font-size: .84rem;
  color: var(--ciep-muted);
}


/* ---------- Pastillas / estatus ---------- */
.al-pill,
.al-status {
  display: inline-flex;
  align-items: center;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: var(--weight-semibold);
  font-style: normal;
  letter-spacing: .02em;
  white-space: nowrap;
  line-height: 1.6;
}
.al-pill--gold  { background: var(--gold-600-soft); color: var(--gold-600); }
.al-pill--green { background: var(--track-green-soft); color: var(--track-green); margin-left: 4px; }
.al-pill--muted { background: var(--fondo-gris); color: var(--ciep-muted); }

.al-status--al { background: var(--track-green-soft); color: var(--track-green); }
.al-status--eg { background: var(--track-blue-soft); color: var(--track-blue); }
.al-status--bt { background: var(--track-orange-soft); color: var(--track-orange); }
.al-status--ba { background: var(--track-red-soft); color: var(--track-red); }
.al-status--o  { background: var(--fondo-gris); color: var(--ciep-muted); }


/* ---------- Tarjetas del formulario ---------- */
.al-cols { --bs-gutter-x: 12px; }

.al-card {
  position: relative;
  background: var(--ciep-white);
  border: 1px solid var(--ciep-divider-on-white);
  border-radius: 12px;
  padding: 12px 14px 14px;
  margin-bottom: 12px;
  box-shadow: var(--ciep-shadow-card);
  overflow: hidden;
}

.al-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--ciep-divider-on-white);
}
.al-card-title {
  margin: 0;
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ciep-navy);
}
.al-card-head .al-pill,
.al-card-action { margin-left: auto; }
.al-page .al-card-action { padding: 1px 8px; font-size: var(--text-3xs); flex: none; }

.al-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--ciep-divider-on-white);
}

/* Beca: acento dorado para distinguir que es información administrativa */
.al-card--beca::before { background: linear-gradient(90deg, var(--gold-600), var(--gold-400)); }
.al-card--beca .al-card-title { color: var(--gold-600); }


/* ---------- Foto ---------- */
.al-person { display: flex; gap: 12px; align-items: flex-start; }
.al-person-names { flex: 1 1 auto; min-width: 0; }

.al-photo {
  position: relative;
  display: block;
  flex: none;
  width: 92px;
  height: 110px;
  margin: 10px 0 0;
  padding: 0;
  border: 1px solid var(--ciep-divider-on-white);
  border-radius: 10px;
  background: var(--fondo-gris);
  overflow: hidden;
  cursor: pointer;
}
.al-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.al-photo.is-disabled { cursor: default; }
/* Input de archivo oculto visualmente pero accesible (no usar display:none) */
.al-photo-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.al-photo-hint {
  position: absolute;
  inset: auto 0 0 0;
  padding: 4px 0;
  background: var(--ciep-overlay);
  color: var(--ciep-white);
  font-size: .68rem;
  font-style: normal;
  font-weight: var(--weight-semibold);
  text-align: center;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.al-photo:not(.is-disabled):hover .al-photo-hint,
.al-photo:not(.is-disabled):focus-within .al-photo-hint { opacity: 1; }
.al-photo:focus-within { outline: 2px solid var(--ciep-cyan); outline-offset: 2px; }


/* ---------- Barra de guardado ---------- */
.al-savebar {
  position: sticky;
  bottom: 10px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin: 4px 0 16px;
  padding: 8px 12px;
  background: var(--ciep-white-a96);
  border: 1px solid var(--ciep-divider-on-white);
  border-radius: 10px;
  box-shadow: var(--ciep-shadow-float);
}
.al-savebar-status { font-size: .8rem; color: var(--ciep-muted); }
.al-savebar-status.is-dirty { color: var(--track-orange); font-weight: var(--weight-semibold); }
.al-savebar-status.is-dirty::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--track-orange);
  vertical-align: middle;
}


/* ---------- Modales (Bootstrap 5) ---------- */
.al-modal .modal-content {
  border: 0;
  border-radius: 14px;
  box-shadow: var(--ciep-shadow-modal);
  overflow: hidden;
}
.al-modal .modal-header {
  position: relative;
  border-bottom: 1px solid var(--ciep-divider-on-white);
  padding: 12px 16px;
}
.al-modal .modal-title {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--ciep-navy);
}
.al-modal .modal-body { padding: 14px 16px; font-size: var(--text-sm); }
.al-modal .modal-footer { border-top: 1px solid var(--ciep-divider-on-white); padding: 8px 16px; gap: 6px; }
.al-modal .modal-footer > * { margin: 0; }
.al-modal .al-mensaje { white-space: pre-line; }     /* los mensajes del servidor usan \n */
.al-modal .al-mensaje p { white-space: normal; }
.al-modal .al-password {
  font-family: var(--bs-font-monospace);
  letter-spacing: .04em;
  user-select: all;
}


/* ---------- Móvil ---------- */
@media (max-width: 575.98px) {
  .al-toolbar,
  .al-search { width: 100%; }
  .al-sugerencias { left: 0; min-width: 0; }
  .al-toolbar > select { flex: 1 1 140px; max-width: none; }
  .al-savebar { justify-content: space-between; }
}


@media (prefers-reduced-motion: reduce) {
  .al-page *,
  .al-page *::before { transition: none !important; }
}


/* ==========================================================================
   8. Expedientes digitales (expedientes/index.php, expedientes/verArchivo.php)
   Clases exp-*, doc-* y btn-exp-*; variables --exp-* en la sección 1.
   Bootstrap 5.3: input-group sin -append, form-select, modales con .btn-close.
   La franja de los modales (.exp-modal) está en la sección 3.
   ========================================================================== */
.exp-pagina { padding: 8px 4px 24px; color: var(--exp-texto); }

/* Íconos SVG de línea */
.exp-ico {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  vertical-align: -3px;
}

/* Panel base */
.exp-panel {
  background: var(--exp-fondo);
  border: 1px solid var(--exp-borde);
  border-radius: var(--exp-radio);
  box-shadow: var(--exp-sombra);
}

/* ---------------------------- Botones ----------------------------
   Variables --bs-btn-* para que :active y :disabled de Bootstrap 5
   no cambien el color del botón. */
.btn-exp-primario,
.btn-exp-secundario,
.btn-exp-icono {
  --bs-btn-font-weight: var(--weight-medium);
  --bs-btn-border-radius: 6px;
  --bs-btn-disabled-opacity: 1;
  --bs-btn-focus-shadow-rgb: 0, 74, 152;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: var(--weight-medium);
  border-radius: 6px;
  transition: background-color var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}
.btn-exp-primario {
  --bs-btn-color: var(--ciep-white);
  --bs-btn-bg: var(--exp-azul);
  --bs-btn-border-color: var(--exp-azul);
  --bs-btn-hover-color: var(--ciep-white);
  --bs-btn-hover-bg: var(--exp-azul-osc);
  --bs-btn-hover-border-color: var(--exp-azul-osc);
  --bs-btn-active-color: var(--ciep-white);
  --bs-btn-active-bg: var(--exp-azul-osc);
  --bs-btn-active-border-color: var(--exp-azul-osc);
  --bs-btn-disabled-color: var(--ciep-white);
  --bs-btn-disabled-bg: var(--exp-pend);
  --bs-btn-disabled-border-color: var(--exp-pend);
  background: var(--exp-azul);
  border: 1px solid var(--exp-azul);
  color: var(--ciep-white);
}
.btn-exp-primario:hover,
.btn-exp-primario:focus { background: var(--exp-azul-osc); border-color: var(--exp-azul-osc); color: var(--ciep-white); }

.btn-exp-secundario {
  --bs-btn-color: var(--exp-azul);
  --bs-btn-bg: var(--exp-fondo);
  --bs-btn-border-color: var(--exp-borde);
  --bs-btn-hover-color: var(--exp-azul);
  --bs-btn-hover-bg: var(--exp-azul-claro);
  --bs-btn-hover-border-color: var(--exp-borde-hover);
  --bs-btn-active-color: var(--exp-azul);
  --bs-btn-active-bg: var(--exp-azul-claro);
  --bs-btn-active-border-color: var(--exp-borde-hover);
  --bs-btn-disabled-color: var(--exp-pend);
  --bs-btn-disabled-bg: var(--exp-fondo);
  --bs-btn-disabled-border-color: var(--exp-borde);
  background: var(--exp-fondo);
  border: 1px solid var(--exp-borde);
  color: var(--exp-azul);
}
.btn-exp-secundario:hover:not(:disabled) { background: var(--exp-azul-claro); border-color: var(--exp-borde-hover); color: var(--exp-azul); }
.btn-exp-secundario:disabled { background: var(--exp-fondo); border-color: var(--exp-borde); color: var(--exp-pend); opacity: 1; }

.btn-exp-icono {
  --bs-btn-color: var(--exp-azul);
  --bs-btn-bg: var(--exp-fondo);
  --bs-btn-border-color: var(--exp-borde);
  --bs-btn-hover-color: var(--exp-azul);
  --bs-btn-hover-bg: var(--exp-azul-claro);
  --bs-btn-hover-border-color: var(--exp-borde);
  --bs-btn-active-color: var(--exp-azul);
  --bs-btn-active-bg: var(--exp-azul-claro);
  --bs-btn-active-border-color: var(--exp-borde);
  --bs-btn-disabled-color: var(--exp-pend);
  --bs-btn-disabled-bg: var(--exp-fondo);
  --bs-btn-disabled-border-color: var(--exp-borde);
  width: 31px;
  height: 31px;
  padding: 0;
  justify-content: center;
  border: 1px solid var(--exp-borde);
  background: var(--exp-fondo);
  color: var(--exp-azul);
}
.btn-exp-icono:hover { background: var(--exp-azul-claro); color: var(--exp-azul); }
.btn-exp-icono.disabled { color: var(--exp-pend); pointer-events: none; opacity: 1; }

.exp-pagina .btn:focus-visible,
.exp-modal .btn:focus-visible { outline: 2px solid var(--ciep-cyan); outline-offset: 2px; box-shadow: none; }

/* Limitado a la página para no cambiar los input-group del resto del sitio (BS5: sin -append) */
.exp-pagina .input-group > .form-control { border-radius: 6px 0 0 6px; }
.exp-pagina .input-group > .btn-exp-primario { border-radius: 0 6px 6px 0; }

/* ---------------------------- Barra de búsqueda ---------------------------- */
.exp-barra {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px;
  margin-bottom: 16px;
}
.exp-barra .form-control,
.exp-barra .form-select { border-color: var(--exp-borde); }
.exp-barra .form-control:focus,
.exp-barra .form-select:focus { border-color: var(--exp-azul); box-shadow: 0 0 0 3px var(--exp-foco); }
.exp-barra__busqueda { flex: 1 1 240px; min-width: 0; }

/* Sugerencias del buscador: la estructura (.exp-combo, .exp-sugerencias, .exp-sug,
   .exp-sug-mensaje) es compartida y está en la sección 3; aquí sólo los colores. */
.exp-sugerencias { background: var(--exp-fondo); border-color: var(--exp-borde); }
.exp-sug:hover,
.exp-sug.is-activo { background: var(--exp-azul-claro); }
.exp-sug.is-activo { box-shadow: inset 2px 0 0 var(--exp-azul); }
.exp-sug__nombre { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--exp-texto); }
.exp-sug__clave { font-size: var(--text-2xs); color: var(--exp-texto-2); font-variant-numeric: tabular-nums; }
.exp-sug-mensaje { color: var(--exp-texto-2); }
.exp-barra__select   { flex: 1 1 240px; min-width: 0; }
.exp-barra__acciones { display: flex; gap: 8px; }

/* ---------------------------- Estados vacío / cargando ---------------------------- */
.exp-vacio {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  color: var(--exp-texto-2);
  border: 1.5px dashed var(--exp-borde);
  border-radius: var(--exp-radio);
  background: var(--exp-fondo-2);
}
.exp-vacio svg {
  width: 40px;
  height: 40px;
  margin-bottom: 10px;
  fill: none;
  stroke: var(--exp-icono-vacio);
  stroke-width: 1.5;
  stroke-linejoin: round;
}
.exp-vacio p { margin: 0; }
.exp-vacio b { display: block; color: var(--exp-texto); font-weight: var(--weight-semibold); margin-bottom: 2px; }
.exp-vacio--visor { border: 0; height: 100%; border-radius: 0; }

.exp-cargando { display: flex; align-items: center; gap: 10px; padding: 18px; color: var(--exp-texto-2); }

/* ---------------------------- Alumno y tarjetas ---------------------------- */
.exp-card__alumno { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 0 0 3px; }
.exp-card__nombre { font-size: .95rem; font-weight: var(--weight-semibold); color: var(--exp-texto); }
.exp-card__clave {
  padding: 0 8px;
  border: 1px solid var(--exp-borde);
  border-radius: 999px;
  background: var(--exp-fondo-2);
  color: var(--exp-texto-2);
  font-size: .76rem;
  font-weight: var(--weight-medium);
}

.exp-card { margin-bottom: 16px; overflow: hidden; }
.exp-card__cabecera {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  background: none;
  border: 0;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.exp-card__cabecera:hover { background: var(--exp-fondo-2); }
.exp-card__cabecera:focus { outline: none; }
.exp-card__cabecera:focus-visible { box-shadow: inset 0 0 0 3px var(--exp-foco-fuerte); }

.exp-foto {
  width: 56px;
  height: 68px;
  flex-shrink: 0;
  object-fit: cover;
  border: 1px solid var(--exp-borde);
  border-radius: 8px;
  background: var(--exp-fondo-2);
}

.exp-card__info { flex: 1; min-width: 0; }
.exp-card__info h3 { margin: 0 0 4px; font-size: 1rem; font-weight: var(--weight-semibold); line-height: 1.3; color: var(--exp-azul); }
.exp-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .85rem; color: var(--exp-texto-2); }
.exp-chip {
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--exp-azul-claro);
  color: var(--exp-azul);
  font-size: .78rem;
  font-weight: var(--weight-semibold);
}

.exp-progreso { display: flex; align-items: center; gap: 8px; max-width: 260px; margin-top: 8px; }
.exp-progreso__barra { flex: 1; height: 6px; border-radius: 999px; background: var(--exp-pista); overflow: hidden; }
.exp-progreso__barra span { display: block; height: 100%; border-radius: inherit; background: var(--exp-ok); transition: width .3s var(--ease-out); }
.exp-progreso__texto { font-size: .78rem; color: var(--exp-texto-2); font-variant-numeric: tabular-nums; }

.exp-card__chevron { color: var(--exp-texto-2); transition: transform .2s var(--ease-out); }
.exp-card__cabecera.collapsed .exp-card__chevron { transform: rotate(-90deg); }

.exp-card__cuerpo { padding: 4px 16px 16px; border-top: 1px solid var(--exp-borde); }

.exp-seccion { margin-top: 14px; }
.exp-seccion h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: .78rem;
  font-weight: var(--weight-bold);
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--exp-texto-2);
}
.exp-seccion__cuenta {
  padding: 0 8px;
  border: 1px solid var(--exp-borde);
  border-radius: 999px;
  background: var(--exp-fondo-2);
  font-weight: var(--weight-semibold);
  letter-spacing: 0;
}

/* ---------------------------- Lista de documentos ---------------------------- */
.exp-docs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.doc-item {
  position: relative;
  display: flex;
  align-items: stretch;
  min-width: 0;
  border: 1px solid var(--exp-borde);
  border-radius: 8px;
  background: var(--exp-fondo);
  transition: border-color var(--dur-fast), background-color var(--dur-fast), box-shadow var(--dur-fast);
}
.doc-item:hover { border-color: var(--exp-borde-hover); }
.doc-item.active { border-color: var(--exp-azul); background: var(--exp-azul-claro); box-shadow: 0 0 0 1px var(--exp-azul); }

.doc-ver {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 9px;
  border: 0;
  border-radius: 8px;
  background: none;
  text-align: left;
  color: var(--exp-texto);
  font-size: .85rem;
  cursor: pointer;
}
.doc-ver:disabled { cursor: default; color: var(--exp-texto-2); }
.doc-ver:focus { outline: none; }
.doc-ver:focus-visible { box-shadow: inset 0 0 0 2px var(--exp-foco-fuerte); }
.doc-nombre { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Pagos: Ficha y Pago del mismo semestre siempre en el mismo renglón */
.exp-docs--pares { grid-template-columns: auto repeat(2, minmax(0, 1fr)); align-items: center; }
.exp-pago-sem {
  padding-right: 6px;
  color: var(--exp-texto-2);
  font-size: .82rem;
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.doc-item.active .doc-nombre { font-weight: var(--weight-semibold); color: var(--exp-azul); }

.doc-estado { width: 9px; height: 9px; flex-shrink: 0; border: 2px solid var(--exp-pend); border-radius: 50%; background: transparent; }
.doc-item.is-cargado .doc-estado { background: var(--exp-ok); border-color: var(--exp-ok); }

.doc-accion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  border: 0;
  border-left: 1px solid var(--exp-borde);
  background: none;
  color: var(--exp-texto-2);
  cursor: pointer;
}
.doc-accion:last-child { border-radius: 0 8px 8px 0; }
.doc-accion:focus { outline: none; }
.doc-accion:focus-visible { box-shadow: inset 0 0 0 2px var(--exp-foco-fuerte); }
.doc-accion .exp-ico { width: 14px; height: 14px; }
.doc-subir:hover { color: var(--exp-azul); background: var(--exp-azul-claro); }
.doc-item.is-pendiente .doc-subir { color: var(--exp-ok); }
.doc-item.is-pendiente .doc-subir:hover { background: var(--exp-ok-claro); }
.doc-borrar:hover:not(:disabled) { color: var(--exp-peligro); background: var(--exp-peligro-claro); }
.doc-borrar:disabled { color: var(--exp-deshabilitado); cursor: default; }

/* Mientras se sube o elimina */
.doc-item.is-ocupado { pointer-events: none; opacity: .6; }
.doc-item.is-ocupado::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 70px;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border: 2px solid var(--exp-azul);
  border-right-color: transparent;
  border-radius: 50%;
  animation: ciep-girar .7s linear infinite;
}

/* ---------------------------- Visor ---------------------------- */
.exp-visor { display: flex; flex-direction: column; overflow: hidden; }
@media (min-width: 1200px) {
  .exp-visor { position: sticky; top: calc(var(--ciep-nav-h, 0px) + 16px); }
}
.exp-visor__cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--exp-borde);
}
.exp-visor__titulo { min-width: 0; }
.exp-visor__titulo small {
  display: block;
  font-size: var(--text-3xs);
  font-weight: var(--weight-semibold);
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--exp-texto-2);
}
.exp-visor__titulo h2 {
  margin: 0;
  overflow: hidden;
  font-size: 1.05rem;
  font-weight: var(--weight-semibold);
  color: var(--exp-texto);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.exp-visor__acciones { display: flex; flex-shrink: 0; gap: 6px; }

.exp-visor__cuerpo { position: relative; height: calc(100vh - 140px); min-height: 520px; background: var(--exp-fondo-2); }
.exp-visor__cuerpo iframe { display: block; width: 100%; height: 100%; border: 0; }
.exp-visor__cuerpo iframe[hidden] { display: none; }
.exp-visor__cargando {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--exp-cubierta);
  color: var(--exp-texto-2);
}
.exp-visor__cargando[hidden] { display: none; }

/* Página de error que verArchivo.php muestra dentro del visor */
body.exp-error-doc {
  display: flex;
  height: 100vh;
  margin: 0;                       /* anula el hueco del pie antiguo (sección 2) */
  background: var(--exp-fondo-2);
  color: var(--exp-texto);
  font-family: var(--font-body);
}
body.exp-error-doc .exp-vacio { flex: 1; }

@media (max-width: 1199.98px) {
  .exp-visor__cuerpo { height: 75vh; }
}
@media (max-width: 575.98px) {
  .exp-barra__acciones { width: 100%; }
  .exp-barra__acciones .btn { flex: 1; justify-content: center; }
  .exp-docs { grid-template-columns: 1fr; }
  .exp-docs--pares { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exp-pago-sem { grid-column: 1 / -1; padding-top: 4px; }
  .exp-progreso { max-width: none; }
  .exp-visor__cuerpo { min-height: 420px; }
}

/* ---------------------------- Modales (Bootstrap 5) ---------------------------- */
.exp-modal .modal-content {
  overflow: hidden;
  border: 0;
  border-radius: var(--exp-radio);
  box-shadow: var(--ciep-shadow-modal);
}
.exp-modal .modal-header { position: relative; }   /* franja de la sección 3 */
.exp-modal .modal-header,
.exp-modal .modal-footer { border-color: var(--exp-borde); }
.exp-modal .modal-footer { gap: 6px; }
.exp-modal .modal-footer > * { margin: 0; }
.exp-modal .modal-title { font-size: var(--text-md); font-weight: var(--weight-semibold); font-style: normal; color: var(--exp-texto); }
.exp-modal .form-label { font-size: var(--text-xs); font-weight: var(--weight-semibold); font-style: normal; color: var(--exp-texto-2); }

@media (prefers-reduced-motion: reduce) {
  .btn-exp-primario,
  .btn-exp-secundario,
  .btn-exp-icono,
  .doc-item,
  .exp-progreso__barra span,
  .exp-card__chevron { transition: none; }
  .doc-item.is-ocupado::after { animation-duration: 2s; }
}

@media print {
  .exp-barra,
  .exp-sugerencias,
  .exp-visor,
  .doc-accion { display: none !important; }
  .exp-pagina .col-xl-6 { width: 100%; }
  .exp-card { break-inside: avoid; box-shadow: none; }
  .exp-card .collapse { display: block !important; }
}


/* ==========================================================================
   9. Kárdex (kardex/index.php)
   Clases kx-*. Usa las variables generales de la sección 1.
   ========================================================================== */
.kx {
  --kx-shadow: 0 2px 14px rgba(1, 74, 152, .08);

  font-family: var(--font-body);
  color: var(--ciep-text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  padding-bottom: clamp(32px, 5vw, 56px);
}
.kx *, .kx *::before, .kx *::after { box-sizing: border-box; }
.kx p { margin: 0; }
.kx :focus-visible { outline: 2px solid var(--ciep-cyan); outline-offset: 2px; }

/* ----------------------------------------------------------- Encabezado */
.kx-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px 32px;
  padding: clamp(10px, 2.5vw, 14px) 0 clamp(9px, 2.5vw, 12px);
  margin-bottom: clamp(10px, 3vw, 14px);
  border-bottom: 1px solid var(--ciep-divider-on-white);
}
.kx-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}
.kx-filter { display: flex; flex-direction: column; margin: 0; }
.kx-filter--search { width: 210px; }
.kx-filter--alumno { width: 300px; }
.kx-filter--grado  { width: 350px; }

.kx-label {
  display: block;
  margin-bottom: 4px;
  font-size: var(--text-3xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ciep-muted);
}
.kx-input {
  display: block;
  width: 100%;
  height: 32px;
  padding: 0 10px;
  font: inherit;
  font-size: var(--text-xs);
  color: var(--ciep-text);
  background: #fff;
  border: 1px solid rgba(1, 74, 152, .22);
  border-radius: 8px;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.kx-input:hover { border-color: rgba(1, 74, 152, .4); }
.kx-input:focus {
  outline: none;
  border-color: var(--ciep-cyan);
  box-shadow: 0 0 0 3px rgba(0, 178, 227, .2);
}
.kx-input:disabled { background: var(--fondo-gris); color: var(--ciep-muted); cursor: not-allowed; }
.kx-textarea { height: auto; padding: 6px 10px; line-height: 1.45; resize: vertical; }

.kx-search { position: relative; }
.kx-search .kx-input { padding-right: 36px; }
.kx-search-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: var(--ciep-navy);
  color: #fff;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.kx-search-btn:hover { background: var(--ciep-cyan); }
.kx-search-btn svg { width: 14px; height: 14px; }

.kx-opt-verificado { background-color: #00ff3c77; }
.kx-opt-revision   { background-color: #ff9100a9; }

/* ------------------------------------------------------------- Avisos */
.kx-aviso:empty { display: none; }
.kx-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 12px 16px;
  border-radius: 12px;
  border-left: 3px solid;
  font-size: var(--text-sm);
  font-weight: 500;
}
.kx-alert--danger  { background: var(--track-red-soft);    border-color: var(--track-red);    color: #a51414; }
.kx-alert--warning { background: var(--track-orange-soft); border-color: var(--track-orange); color: #9a4d0f; }
.kx-alert--success { background: var(--track-green-soft);   border-color: var(--track-green);  color: #1c7a37; }
.kx-alert-close {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.4rem;
  line-height: 1;
  opacity: .6;
  cursor: pointer;
}
.kx-alert-close:hover { opacity: 1; }

/* ------------------------------------------------------------- Layout */
.kx-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: clamp(24px, 3vw, 40px);
  align-items: start;
}
.kx-aside { display: flex; flex-direction: column; gap: 20px; }

/* ------------------------------------------------------ Tarjeta alumno */
.kx-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--ciep-divider-on-white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--kx-shadow);
}
.kx-photo-wrap { display: flex; justify-content: center; padding: 26px 20px 0; }
.kx-photo {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--fondo-gris);
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px var(--ciep-divider-on-white), 0 4px 10px rgba(1, 74, 152, .12);
}
.kx-card-body { padding: 14px 22px 22px; }
#divCard .kx-card-body { text-align: center; }
.kx-role {
  display: block;
  font-size: var(--text-3xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ciep-muted);
}
.kx-name {
  margin: 4px 0 10px;
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.3;
  color: var(--ciep-text);
  overflow-wrap: anywhere;
}

/* Estatus del kárdex + botón del ojo */
.kx-estado {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
}
.kx-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 14px;
  font-size: var(--text-2xs);
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
}
.kx-badge--ok      { background: var(--track-green-soft);   color: #1c8a3c; }
.kx-badge--rev     { background: var(--track-orange-soft); color: var(--track-orange); }
.kx-badge--pend    { background: var(--track-blue-soft);    color: var(--track-blue); }
.kx-badge--neutral { background: var(--fondo-gris); color: var(--ciep-muted); }

.kx-eye {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--ciep-divider-on-white);
  border-radius: 50%;
  background: #fff;
  color: var(--ciep-navy);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.kx-eye svg { width: 13px; height: 13px; }
.kx-eye:hover:not(:disabled) { background: var(--ciep-navy); border-color: var(--ciep-navy); color: #fff; }
.kx-eye:disabled { opacity: .4; cursor: not-allowed; }

/* Datos */
.kx-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--ciep-divider-on-white);
  text-align: left;
}
.kx-fields > div { min-width: 0; }
.kx-field-wide { grid-column: 1 / -1; }
.kx-fields dt {
  margin: 0 0 2px;
  font-size: var(--text-3xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ciep-muted);
}
.kx-fields dd {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.4;
  color: var(--ciep-text);
  overflow-wrap: anywhere;
}
.kx-email { display: flex; align-items: center; gap: 6px; }
.kx-email a { color: var(--ciep-navy); font-weight: 500; text-decoration: none; }
.kx-email a[href]:hover { text-decoration: underline; }
.kx-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  flex: none;
  border-radius: 50%;
  background: var(--track-green);
  color: #fff;
}
.kx-check[hidden] { display: none; }
.kx-check svg { width: 11px; height: 11px; }

/* Notas */
.kx-note {
  margin-top: 16px;
  padding: 10px 14px;
  border-left: 3px solid;
  border-radius: 0 10px 10px 0;
  text-align: left;
  font-size: var(--text-xs);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.kx-note[hidden] { display: none; }
.kx-note--alumno    { border-color: var(--track-coral); background: var(--track-coral-soft); }
.kx-note--respuesta { border-color: var(--ciep-cyan); background: rgba(0, 178, 227, .08); }
.kx-note-title {
  display: block;
  margin-bottom: 2px;
  font-size: var(--text-3xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ciep-muted);
}
.kx-revision {
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  background: var(--fondo-gris);
  text-align: left;
}
.kx-revision[hidden] { display: none; }
.kx-revision .kx-btn { margin-top: 8px; }

/* Botones */
.kx-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 18px; }
.kx-actions form { margin: 0; }
.kx-actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.kx-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  padding: 6px 12px;
  border: 1.5px solid var(--ciep-navy);
  border-radius: 999px;
  background: var(--ciep-navy);
  color: #fff;
  font: inherit;
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.3;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.kx-btn svg { width: 13px; height: 13px; flex: none; }
.kx-btn:hover:not(:disabled) { background: var(--ciep-cyan); border-color: var(--ciep-cyan); }
.kx-btn:disabled { opacity: .45; cursor: not-allowed; }
.kx-btn--outline { background: #fff; color: var(--ciep-navy); }
.kx-btn--outline:hover:not(:disabled) { background: var(--ciep-navy); border-color: var(--ciep-navy); color: #fff; }
.kx-btn--ok { background: #1c8a3c; border-color: #1c8a3c; }
.kx-btn--auto { width: auto; display: inline-flex; padding-inline: 24px; margin-top: 14px; }
.kx-btn[hidden] { display: none; }
.kx-btn--tutoria { background: #1c8a3c; border-color: #1c8a3c; }
.kx-btn--tutoria:hover:not(:disabled) { background: #23a249; border-color: #23a249; }

/* Verificación (alumno) */
.kx-verify-title { margin: 0 0 4px; font-size: var(--text-md); font-weight: 700; color: var(--ciep-text); }
.kx-verify-text { font-size: var(--text-xs); color: var(--ciep-muted); line-height: 1.5; margin-bottom: 14px !important; }
.kx-options { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 6px; }
.kx-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 12px;
  border: 1px solid var(--ciep-divider-on-white);
  border-radius: 8px;
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.kx-option:hover { border-color: rgba(1, 74, 152, .35); }
.kx-option input { width: 14px; height: 14px; margin: 0; accent-color: var(--ciep-navy); }
.kx-option:has(input:checked) { border-color: var(--ciep-navy); background: rgba(1, 74, 152, .05); }
#grupoComent { margin-bottom: 14px; }
#grupoComent[hidden] { display: none; }
.kx-counter { display: block; text-align: right; margin-top: 4px; font-size: var(--text-3xs); color: var(--ciep-muted); }

/* ------------------------------------------------------------ Resumen */
.kx-stats {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: clamp(24px, 3vw, 32px);
  border-top: 1px solid var(--ciep-divider-on-white);
  border-bottom: 1px solid var(--ciep-divider-on-white);
}
.kx-stats[hidden] { display: none; }
.kx-stat {
  flex: 1 1 160px;
  padding: 18px clamp(16px, 3vw, 28px);
  border-left: 1px solid var(--ciep-divider-on-white);
}
.kx-stat:first-child { border-left: 0; padding-left: 0; }
.kx-stat-value {
  display: block;
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ciep-navy);
  font-variant-numeric: tabular-nums;
}
.kx-stat-label { display: block; margin-top: 2px; font-size: var(--text-xs); color: var(--ciep-muted); }

/* ---------------------------------------------------------- Semestres */
.kx-sem {
  margin-bottom: clamp(14px, 4vw, 20px);
  border: 1px solid var(--ciep-divider-on-white);
  border-radius: 12px;
  background: #fff;
  padding: 14px 18px 8px;
  overflow: hidden;
  box-shadow: var(--kx-shadow);
}

@media (max-width: 767.98px) {
  .kx-sem { padding: 12px 12px 6px; }
}
.kx-sem-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px;
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--ciep-text);
}
.kx-sem-title::before {
  content: "";
  width: 4px;
  height: 1.1em;
  border-radius: 2px;
  background: var(--ciep-cyan);
}

.kx-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.kx-table { width: 100%; border-collapse: collapse; }
.kx-table th, .kx-table td { padding: 11px 14px; text-align: left; vertical-align: middle; }
.kx-table th:first-child, .kx-table td:first-child { padding-left: 0; }
.kx-table th:last-child,  .kx-table td:last-child  { padding-right: 0; }
.kx-table thead th {
  font-size: var(--text-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ciep-muted);
  white-space: nowrap;
  border-bottom: 2px solid var(--ciep-navy);
}
.kx-table tbody tr { border-bottom: 1px solid var(--ciep-divider-on-white); transition: background-color var(--dur-fast) var(--ease-out); }
.kx-table tbody tr:hover { background: rgba(1, 74, 152, .03); }
.kx-table tbody td { font-size: var(--text-xs); color: var(--ciep-muted); }
.kx-table .kx-materia { font-size: var(--text-sm); font-weight: 500; color: var(--ciep-text); }
.kx-num { text-align: center !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Columnas fijas: todas las tablas de semestre quedan alineadas */
.kx-table--kardex { table-layout: fixed; min-width: 720px; }
.kx-table--kardex .kx-materia { overflow-wrap: anywhere; }
.kx-col-no    { width: 48px; }
.kx-col-tipo  { width: 160px; white-space: nowrap; }
.kx-col-calif { width: 120px; }
.kx-col-fecha { width: 120px; }
.kx-col-cred  { width: 92px; }
.kx-nowrap { white-space: nowrap; }

/* Pie de cada semestre: promedios y créditos del periodo */
.kx-table tfoot tr:first-child th, .kx-table tfoot tr:first-child td { border-top: 2px solid var(--ciep-divider-on-white); padding-top: 12px; }
.kx-table tfoot th, .kx-table tfoot td { padding-top: 6px; padding-bottom: 6px; }
.kx-pie-label {
  text-align: right !important;
  font-size: var(--text-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ciep-muted);
}
.kx-pie-valor { font-size: var(--text-sm); font-weight: 700; color: var(--ciep-navy); }

/* Calificaciones */
.kx-calif {
  display: inline-block;
  min-width: 2.6em;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--ciep-text);
}
.kx-calif--mal  { background: var(--track-red-soft); color: var(--text-red); }
.kx-calif--pend { color: #b5b5ba; font-weight: 400; }
.kx-recursada { color: var(--track-orange); font-weight: 700; margin-left: -4px; }
.kx-avance td { font-style: italic; }

/* Etiquetas de tipo (colores de los tracks del sitio) */
.kx-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: var(--text-2xs);
  font-weight: 600;
  font-style: normal;
  white-space: nowrap;
}
.kx-tag--xs { padding: 1px 8px; font-size: var(--text-3xs); margin-left: 6px; vertical-align: 1px; }
.kx-tag--blue   { background: var(--track-blue-soft);    color: var(--track-blue); }
.kx-tag--purple { background: var(--track-purple-soft); color: var(--track-purple); }
.kx-tag--teal   { background: var(--track-teal-soft);    color: #00908a; }
.kx-tag--orange { background: var(--track-orange-soft); color: var(--track-orange); }
.kx-tag--coral  { background: var(--track-coral-soft);                  color: var(--track-coral); }
.kx-tag--green  { background: var(--track-green-soft);   color: #1c8a3c; }
.kx-tag--red    { background: var(--track-red-soft);     color: var(--track-red); }
.kx-tag--gray   { background: var(--fondo-gris); color: var(--ciep-muted); }

/* Leyenda */
.kx-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  font-size: var(--text-xs);
  color: var(--ciep-muted);
}
.kx-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.kx-legend-item .kx-recursada { margin: 0; }
.kx-table--kardex tfoot .kx-pie-label { white-space: nowrap; }
.kx-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-red);
}

/* -------------------------------------------------- Vacío / cargando */
.kx-empty, .kx-loading {
  padding: clamp(40px, 6vw, 64px) 20px;
  border: 1px dashed rgba(1, 74, 152, .22);
  border-radius: 16px;
  text-align: center;
  color: var(--ciep-muted);
}
.kx-empty-title { margin-bottom: 4px !important; font-size: var(--text-md); font-weight: 600; color: var(--ciep-text); }
.kx-empty-text  { font-size: var(--text-sm); }
.kx-empty-cell  { text-align: center !important; padding: 28px 0 !important; color: var(--ciep-muted); }
.kx-loading { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: var(--text-sm); }
.kx-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(1, 74, 152, .2);
  border-top-color: var(--ciep-navy);
  border-radius: 50%;
  animation: ciep-girar .8s linear infinite;
}

/* ------------------------------------------------------------ Ventanas */
.kx-dialog {
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 0;
  border-radius: 16px;
  color: var(--ciep-text);
  box-shadow: 0 24px 60px rgba(1, 20, 45, .3);
  overflow: auto;
}
.kx-dialog--sm { width: min(460px, calc(100vw - 32px)); }
.kx-dialog[open] { animation: ciep-aparecer 260ms var(--ease-apple); }
.kx-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--ciep-divider-on-white);
}
.kx-dialog-title { margin: 0; font-size: var(--text-md); font-weight: 700; color: var(--ciep-text); }
.kx-dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ciep-muted);
  cursor: pointer;
}
.kx-dialog-close:hover { background: var(--fondo-gris); color: var(--ciep-text); }
.kx-dialog-close svg { width: 15px; height: 15px; }
.kx-dialog-body { padding: 18px 24px 24px; font-size: var(--text-sm); line-height: 1.6; }
.kx-dialog-lead { margin-bottom: 8px !important; font-size: var(--text-md); font-weight: 700; color: var(--text-red); }
.kx-center { text-align: center; }

/* Formularios dentro de ventanas (periodos vacacionales y tutorías) */
.kx-dialog-help { margin-bottom: 14px !important; font-size: var(--text-xs); color: var(--ciep-muted); }
.kx-dialog-help strong { color: var(--ciep-text); }
.kx-periodo { border: 0; padding: 0; margin: 0 0 14px; }
.kx-periodo-fechas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kx-periodo-fechas label { display: flex; align-items: center; gap: 8px; margin: 0; font-size: var(--text-xs); color: var(--ciep-muted); }
.kx-opcional { font-weight: 400; text-transform: none; letter-spacing: 0; }
.kx-field-error { margin: 0 0 12px !important; padding: 8px 12px; border-radius: 8px; background: var(--track-red-soft); color: #a51414; font-size: var(--text-xs); }
.kx-field-error[hidden] { display: none; }
.kx-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.kx-dialog-actions .kx-btn--auto { margin-top: 0; }
.kx-tut-datos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: var(--fondo-gris); }
.kx-tut-alumno { grid-column: 1 / -1; }
.kx-tut-datos dt { margin: 0 0 2px; font-size: var(--text-3xs); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ciep-muted); }
.kx-tut-datos dd { margin: 0; font-size: var(--text-sm); font-weight: 600; color: var(--ciep-text); }
.kx-tut-aviso { margin: 0 0 12px !important; padding: 8px 12px; border-left: 3px solid var(--track-orange); border-radius: 0 8px 8px 0; background: var(--track-orange-soft); color: #9a4d0f; font-size: var(--text-xs); }
.kx-tut-aviso[hidden] { display: none; }
.kx-table--hist td { white-space: normal; vertical-align: top; }
.kx-table--hist td:nth-child(4), .kx-table--hist td:nth-child(5) { min-width: 220px; color: var(--ciep-text); }
.kx-table--tutorias td:nth-child(4) { min-width: 320px; color: var(--ciep-text); }
.kx-table--tutorias td:nth-child(5) { min-width: 0; color: var(--ciep-muted); }

/* ----------------------------------------------------------- Responsivo */
@media (max-width: 991.98px) {
  .kx-layout { grid-template-columns: minmax(0, 1fr); }
  .kx-aside { max-width: 560px; width: 100%; margin: 0 auto; }
}
@media (max-width: 767.98px) {
  .kx-head { align-items: stretch; }
  .kx-filters, .kx-filter { width: 100%; }
  .kx-stat { flex-basis: 100%; border-left: 0; border-top: 1px solid var(--ciep-divider-on-white); padding-left: 0; }
  .kx-stat:first-child { border-top: 0; }
  .kx-table th, .kx-table td { padding: 10px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .kx-dialog[open], .kx-spinner { animation: none; }
}

/* ------------------------------------------------------------ Impresión */
@media print {
  .kx-filters, .kx-actions, .kx-verify, .kx-revision, .kx-eye, #kxAviso { display: none !important; }
  .kx-layout { grid-template-columns: minmax(0, 1fr); }
  .kx-card { box-shadow: none; }
  .kx-sem { break-inside: avoid; }
}
.kx-content { min-width: 0; }
@media (min-width: 1400px) {
  .kx-content {
    padding-right: clamp(24px, 8vw, 200px);
  }
}

/* La columna del alumno se queda arriba al hacer scroll del kárdex */
@media (min-width: 992px) {
  .kx-aside {
    position: sticky;
    top: 65px;                     /* distancia desde el borde superior */
    align-self: start;
    max-height: calc(100vh - 48px);
    overflow-y: auto;              /* si no cabe en la pantalla, se desplaza por dentro */
    padding: 2px 4px 4px 2px;      /* evita que se corte la sombra de las tarjetas */
  }
}


/* ==========================================================================
   10. Módulos / préstamo de cubículos (modulos/index.php)
   Base limitada a .ciep-cub-page y .ciep-cub-dialog.
   ========================================================================== */
/* ---- Base: limitada a la página y al diálogo ---- */
.ciep-cub-page,
.ciep-cub-dialog {
  color: var(--ciep-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  text-align: left;
  -webkit-font-smoothing: antialiased;
}

.ciep-cub-page { display: block; background: var(--ciep-white); }

/* :where() deja estas reglas con la menor prioridad posible: le ganan a
   Bootstrap (se cargan después) pero no a las clases .ciep-* de abajo. */
:where(.ciep-cub-page, .ciep-cub-dialog) * { box-sizing: border-box; }

:where(.ciep-cub-page, .ciep-cub-dialog) :focus-visible {
  outline: 2px solid var(--ciep-cyan);
  outline-offset: 2px;
}

:where(.ciep-cub-page, .ciep-cub-dialog) h2,
:where(.ciep-cub-page, .ciep-cub-dialog) h3 { font-family: var(--font-body); color: var(--ciep-text); margin: 0 0 .6em; }
:where(.ciep-cub-page) h2 { font-size: var(--text-xl); font-weight: var(--weight-bold); line-height: 1.2; }
:where(.ciep-cub-page, .ciep-cub-dialog) h3 { font-size: var(--text-lg); font-weight: var(--weight-semibold); line-height: 1.3; }
:where(.ciep-cub-page, .ciep-cub-dialog) p { font-size: var(--text-base); line-height: 1.6; color: var(--ciep-text); }

/* Bootstrap 4 pone un contorno punteado en los botones al hacer clic */
.ciep-cub-page button:focus:not(:focus-visible),
.ciep-cub-dialog button:focus:not(:focus-visible) { outline: none; }

/* ---- Encabezado pequeño (se usa en los diálogos) ---- */
.ciep-pagehead-eyebrow {
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ciep-muted);
  margin: 0 0 8px;
}

/* ---- Secciones ---- */
.ciep-program-section {
  padding: clamp(10px, 2vw, 15px) clamp(16px, 4vw, 64px);
  border-bottom: 1px solid var(--ciep-divider-on-white);
}

.ciep-program-section:last-child { border-bottom: 0; }

.ciep-program-section h2 {
  font-size: var(--text-xl);
  margin-bottom: 14px;
}

.ciep-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.ciep-section-head h2 { margin-bottom: 0; }
.ciep-section-head--tabs { align-items: center; }
.ciep-section-head--tabs .t-tabs { margin-bottom: 0; }

/* ---- Pestañas ---- */
.t-tabs {
  --tabs-dur: 250ms;
  --tabs-ease: cubic-bezier(.22, 1, .36, 1);
  --tabs-text-muted: var(--ciep-muted);
  --tabs-text-active: var(--ciep-text);
  --tabs-bar-bg: #f1f1f1;
  --tabs-pill-bg: #ffffff;

  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 48px;
  background: var(--tabs-bar-bg);
  margin-bottom: 24px;
}

.t-tab {
  position: relative;
  appearance: none;
  border: 0;
  background: transparent;
  height: 30px;
  padding: 4px 16px;
  color: var(--tabs-text-muted);
  cursor: pointer;
  border-radius: 48px;
  z-index: 1;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  font-family: var(--font-body);
  transition: color var(--tabs-dur) var(--tabs-ease);
}

.t-tab:not([aria-selected="true"]):hover,
.t-tab[aria-selected="true"] {
  color: var(--tabs-text-active);
}

.t-tab:focus-visible {
  outline: 2px solid var(--ciep-cyan);
  outline-offset: 2px;
}

.t-tabs-pill {
  position: absolute;
  top: 3px;
  left: 0;
  height: 30px;
  width: 0;
  background: var(--tabs-pill-bg);
  border-radius: 48px;
  transform: translateX(0);
  transition: transform var(--tabs-dur) var(--tabs-ease), width var(--tabs-dur) var(--tabs-ease);
  will-change: transform, width;
  z-index: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .t-tabs-pill, .t-tab { transition: none !important; }
}

.ciep-plan-panel { display: none; }
.ciep-plan-panel.is-active { display: block; }

/* ---- Leyenda ---- */
.ciep-legend { display: flex; flex-wrap: wrap; gap: 14px 24px; margin-bottom: 20px; color: var(--ciep-muted); font-size: var(--text-xs); }
.ciep-legend-item { display: inline-flex; align-items: center; gap: 8px; }
.ciep-legend-swatch { width: 9px; height: 9px; border-radius: 50%; flex: none; }

/* ---- Indicadores ---- */
.ciep-stat-strip {
  display: flex;
  flex-wrap: wrap;
  border-top: 1px solid var(--ciep-divider-on-white);
  border-bottom: 1px solid var(--ciep-divider-on-white);
}

.ciep-stat {
  flex: 1 1 130px;
  padding: 5px clamp(16px, 3vw, 28px);
  border-left: 1px solid var(--ciep-divider-on-white);
}

.ciep-stat:first-child { border-left: 0; }

.ciep-stat-value { display: block; font-size: var(--text-xl); font-weight: var(--weight-bold); color: var(--ciep-navy); }
.ciep-stat-label { display: block; font-size: var(--text-xs); color: var(--ciep-muted); margin-top: 2px; }

/* ---- Notas ---- */
.ciep-note { font-size: var(--text-xs); color: var(--ciep-muted); margin-top: 16px;  }
.ciep-note--first { margin-top: 0; }

/* ---- Tarjeta de formulario ---- */
.ciep-tarjeta-formulario {
  background: #ffffff;
  border: 1px solid rgba(1, 74, 152, .12);
  border-radius: 14px;
  padding: 24px 26px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(1, 74, 152, .10);
}

/* ---- Tablas ---- */
.ciep-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ciep-table { width: 100%; border-collapse: collapse; white-space: nowrap; }

.ciep-table th, .ciep-table td { padding: 12px 16px; text-align: left; }
.ciep-table th:first-child, .ciep-table td:first-child { padding-left: 0; }
.ciep-table th:last-child, .ciep-table td:last-child { padding-right: 0; }

.ciep-table thead th {
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ciep-muted);
  border-bottom: 2px solid var(--ciep-navy);
}

.ciep-table tbody th {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--ciep-text);
}

.ciep-table tbody td { font-size: var(--text-xs); color: var(--ciep-muted); white-space: normal; }

.ciep-table tbody tr { border-bottom: 1px solid var(--ciep-divider-on-white); }
.ciep-table tbody tr:last-child { border-bottom: 0; }

/* ---- Préstamo de cubículos ---- */
.ciep-cub-alert {
  margin: 20px clamp(16px, 4vw, 64px) 0;
  padding: 12px 16px;
  border-left: 3px solid;
  border-radius: 10px;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}
.ciep-cub-alert--ok { background: var(--track-green-soft); border-color: var(--track-green); color: #1e7a37; }
.ciep-cub-alert--error { background: var(--track-red-soft); border-color: var(--track-red); color: var(--track-red); }

/* Barra de leyenda + buscador */
.ciep-cub-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 20px;
}
.ciep-cub-toolbar .ciep-legend { margin-bottom: 0; }
.ciep-legend-swatch.ciep-legend-libre { background: transparent; border: 1px dashed var(--ciep-navy); }
.ciep-legend-swatch.ciep-legend-ocupado { background: var(--track-blue); }

.ciep-cub-search { position: relative; flex: 0 1 320px; min-width: 0; }
.ciep-cub-search svg {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 16px;
  height: 16px;
  translate: 0 -50%;
  color: var(--ciep-muted);
  pointer-events: none;
}
.ciep-cub-search .ciep-cub-input { padding-left: 36px; border-radius: 999px; }

.ciep-cub-stats { margin-bottom: 24px; }

/* Rejilla de cubículos */
.ciep-cub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.ciep-cub {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  min-height: 148px;
  padding: 14px 16px;
  border-radius: 12px;
  font-family: inherit;
  text-align: left;
}
.ciep-cub[hidden] { display: none; }

.ciep-cub-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }

.ciep-cub-num {
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ciep-muted);
}

.ciep-cub-estado {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: var(--text-3xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.ciep-cub--libre {
  width: 100%;
  border: 1px dashed rgba(1, 74, 152, .28);
  background: var(--ciep-white);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.ciep-cub--libre:hover { border-color: var(--ciep-navy); background: rgba(1, 74, 152, .04); }
.ciep-cub--libre .ciep-cub-estado { background: var(--track-green-soft); color: #1e7a37; }

.ciep-cub-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--ciep-navy);
}
.ciep-cub-cta svg { width: 14px; height: 14px; }

.ciep-cub--ocupado { background: var(--track-blue-soft); }
.ciep-cub--ocupado .ciep-cub-estado { background: var(--track-blue); color: var(--ciep-white); }

.ciep-cub-nombre {
  margin: 4px 0 0;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1.3;
  color: var(--ciep-text);
  overflow-wrap: anywhere;
}

.ciep-cub-meta { margin: 0; font-size: var(--text-2xs); line-height: 1.4; color: var(--ciep-muted); }

.ciep-cub-obs {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  font-size: var(--text-2xs);
  font-style: italic;
  line-height: 1.4;
  color: var(--ciep-muted);
}

.ciep-cub form { margin-top: auto; }

/* Pie de la tarjeta ocupada: Liberar + carta en Word */
.ciep-cub-pie { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.ciep-cub-pie form { margin-top: 0; }

.ciep-cub-doc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  color: var(--ciep-navy);
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.ciep-cub-doc:hover,
.ciep-cub-doc:focus-visible { background: var(--ciep-white); color: var(--track-blue); text-decoration: none; }
.ciep-cub-doc svg { width: 17px; height: 17px; }

.ciep-cub-liberar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--ciep-navy);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out);
}
.ciep-cub-liberar:hover { color: var(--track-red); }
.ciep-cub-liberar svg { width: 14px; height: 14px; }

/* Campos y botones */
.ciep-cub-label {
  display: block;
  margin-bottom: 6px;
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ciep-muted);
}

.ciep-cub-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid rgba(1, 74, 152, .22);
  border-radius: 8px;
  background: var(--ciep-white);
  font-family: inherit;
  font-size: var(--text-sm);
  color: var(--ciep-text);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.ciep-cub-input:focus { outline: none; border-color: var(--ciep-cyan); box-shadow: 0 0 0 3px rgba(0, 178, 227, .18); }
.ciep-cub-input--num { width: 100px; }
.ciep-cub-config .ciep-cub-input--num:invalid { border-color: var(--track-red); box-shadow: 0 0 0 3px var(--track-red-soft); }
textarea.ciep-cub-input { resize: vertical; }

.ciep-cub-config .ciep-table td,
.ciep-cub-config .ciep-table th { vertical-align: middle; }
.ciep-cub-config .ciep-table td .ciep-cub-input:not(.ciep-cub-input--num) { min-width: 180px; }

.ciep-cub-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.ciep-cub-actions--end { justify-content: flex-end; margin-top: 4px; }
.ciep-cub-actions--between { justify-content: space-between; align-items: center; margin-top: 4px; }
.ciep-cub-actions-group { display: flex; flex-wrap: wrap; gap: 10px; }

/* Pestañas + botón Config */
.ciep-cub-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.ciep-cub-btn--icon svg { width: 15px; height: 15px; flex: none; }

.ciep-cub-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border: 1.5px solid var(--ciep-navy);
  border-radius: 999px;
  background: var(--ciep-navy);
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--ciep-white);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.ciep-cub-btn:hover { background: var(--ciep-cyan); border-color: var(--ciep-cyan); }
.ciep-cub-btn:disabled { background: var(--ciep-gray); border-color: var(--ciep-gray); color: var(--ciep-muted); cursor: not-allowed; }
.ciep-cub-btn--outline { background: var(--ciep-white); color: var(--ciep-navy); }
.ciep-cub-btn--outline:hover { background: var(--ciep-navy); border-color: var(--ciep-navy); color: var(--ciep-white); }

/* Diálogo */
.ciep-cub-dialog {
  width: min(440px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--ciep-white);
  color: var(--ciep-text);
  box-shadow: 0 24px 60px rgba(1, 20, 45, .3);
}
.ciep-cub-dialog[open] { animation: ciep-fade-in var(--dur-panel-enter) var(--ease-apple); }

.ciep-cub-dialog--wide { width: min(900px, calc(100% - 32px)); }

.ciep-cub-dialog-form { display: flex; flex-direction: column; gap: 16px; padding: 20px 24px 24px; }
.ciep-cub-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ciep-cub-dialog-head .ciep-pagehead-eyebrow { margin-bottom: 4px; }
.ciep-cub-dialog-head h3 { margin: 0; }

.ciep-cub-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: var(--fondo-gris);
  color: var(--ciep-text);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.ciep-cub-close:hover { background: var(--ciep-gray); }
.ciep-cub-close svg { width: 18px; height: 18px; }

/* Búsqueda de alumno (clave, nombre o apellido) */
.ciep-cub-combo { position: relative; }

.ciep-cub-resultados {
  list-style: none;
  margin: 6px 0 0;
  padding: 4px;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid rgba(1, 74, 152, .22);
  border-radius: 10px;
  background: var(--ciep-white);
  box-shadow: 0 8px 24px rgba(1, 20, 45, .12);
}
.ciep-cub-resultados[hidden] { display: none; }

.ciep-cub-resultado {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.ciep-cub-resultado:hover,
.ciep-cub-resultado.is-activo { background: var(--track-blue-soft); }
.ciep-cub-resultado.is-bloqueado { cursor: not-allowed; }
.ciep-cub-resultado.is-bloqueado .ciep-cub-resultado-nombre { color: var(--ciep-muted); }
.ciep-cub-resultado.is-bloqueado:hover,
.ciep-cub-resultado.is-bloqueado.is-activo { background: var(--fondo-gris); }

.ciep-cub-resultado-nombre { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--ciep-text); }
.ciep-cub-resultado-meta { font-size: var(--text-2xs); color: var(--ciep-muted); }
.ciep-cub-resultado-motivo { font-size: var(--text-2xs); font-weight: var(--weight-semibold); color: var(--track-red); }
.ciep-cub-resultado-mas { padding: 8px 10px; font-size: var(--text-2xs); font-style: italic; color: var(--ciep-muted); }

.ciep-cub-lookup { min-height: 1.4em; margin: 6px 0 0; font-size: var(--text-xs); color: var(--ciep-muted); }
.ciep-cub-lookup.is-ok { color: #1e7a37; font-weight: var(--weight-semibold); }
.ciep-cub-lookup.is-error { color: var(--track-red); }

@media (max-width: 575.98px) {
  .ciep-cub-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .ciep-cub { min-height: 132px; padding: 12px; }
  .ciep-cub-search { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .ciep-cub-dialog[open] { animation: none; }
}


/* ==========================================================================
   11. Restablecer contraseña (restContrasena.php)
   Tomado de /info/assets/css/style.css: sólo lo que usa esta página.
   La base va limitada a body.rc-page para no tocar el resto de la intranet;
   :where() deja esas reglas con la misma prioridad que tenían en style.css.
   ========================================================================== */

/* ---- Base del sitio info ---- */
html:has(> body.rc-page) {
  background: var(--ciep-gray);
  overscroll-behavior: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, .32) transparent;
}
body.rc-page {
  min-height: 100vh;
  min-height: 100dvh;
  margin-bottom: 0;                   /* anula el hueco del pie antiguo (sección 2) */
  display: flex;
  flex-direction: column;
  background: var(--ciep-gray);
  color: var(--ciep-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
:where(.rc-page) main { flex: 1 0 auto; background: var(--ciep-white); }
:where(.rc-page) a { color: inherit; text-decoration: none; }
:where(.rc-page) ul { margin: 0; }
:where(.rc-page) img { -webkit-user-drag: none; user-select: none; }
:where(.rc-page) :focus-visible { outline: 2px solid var(--ciep-cyan); outline-offset: 2px; }
:where(.rc-page) .container-fluid { max-width: 1440px; }
:where(.rc-page) label { font-style: normal; }   /* anula la etiqueta en cursiva de la sección 2 */

:where(.rc-page) h1, :where(.rc-page) h2, :where(.rc-page) h3,
:where(.rc-page) h4, :where(.rc-page) h5, :where(.rc-page) h6 { font-family: var(--font-body); color: var(--ciep-text); margin: 0 0 .6em; }
:where(.rc-page) h2 { font-size: var(--text-xl); font-weight: var(--weight-bold); line-height: 1.2; }
:where(.rc-page) p { font-size: var(--text-base); line-height: 1.6; color: var(--ciep-text); }

.rc-page *::-webkit-scrollbar { width: 10px; height: 10px; }
.rc-page *::-webkit-scrollbar-track,
.rc-page *::-webkit-scrollbar-corner { background: transparent; }
.rc-page *::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, .28);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}
.rc-page *::-webkit-scrollbar-thumb:hover { background-color: rgba(0, 0, 0, .45); }

/* ---- Clases heredadas con el aspecto del sitio info ---- */
.rc-page .colorTextAzul { color: var(--ciep-navy); }
.rc-page .asterisco2 { padding-left: 0; color: var(--text-red); font-weight: var(--weight-bold); }
.rc-page .fondo { background-color: var(--ciep-navy) !important; border-color: var(--ciep-navy) !important; }
.rc-page .fondo:hover,
.rc-page .fondo:focus { background-color: var(--ciep-cyan) !important; border-color: var(--ciep-cyan) !important; }

/* ---- Componentes de la página ----
   .ciep-tarjeta-formulario y .ciep-note--first ya están en la sección 10. */
.rc-page .ciep-program-section { padding: clamp(32px, 5vw, 48px) clamp(16px, 4vw, 64px); }
.rc-page .ciep-note { max-width: 60ch; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  font-family: 'OpenSans-SemiBold', 'Segoe UI', system-ui, sans-serif;
  font-size: .72rem;
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #004a98;
}
.eyebrow::before { content: ""; display: inline-block; width: 22px; height: 1.5px; background: var(--gold-600); }

.ciep-inline-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--ciep-navy);
  white-space: nowrap;
}
.ciep-inline-link:hover { opacity: .78; }
.ciep-inline-link svg { width: 12px; height: 12px; }

.ciep-checklist { columns: 2; column-gap: 32px; list-style: none; padding: 0; }
.ciep-checklist li { display: flex; align-items: flex-start; gap: 10px; break-inside: avoid; margin-bottom: 14px; font-size: var(--text-sm); }
.ciep-checklist svg { width: 17px; height: 17px; flex: none; margin-top: 2px; color: var(--ciep-navy); }
.ciep-checklist--single { columns: 1; }
@media (max-width: 575.98px) { .ciep-checklist { columns: 1; } }

/* Pasos 1 – 2 */
.rc-steps {
  list-style: none;
  display: flex;
  gap: 20px;
  padding: 0;
  margin: 0 0 16px;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--ciep-muted);
}
.rc-steps li { display: inline-flex; align-items: center; gap: 8px; }
.rc-steps span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--ciep-divider-on-white);
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
}
.rc-steps li.is-current { color: var(--ciep-navy); }
.rc-steps li.is-current span { background: var(--ciep-navy); border-color: var(--ciep-navy); color: var(--ciep-white); }
.rc-steps li.is-done span { background: var(--track-green-soft); border-color: transparent; color: var(--track-green); }

/* Medidor de seguridad de la contraseña */
.rc-meter { height: 6px; margin-top: 10px; border-radius: 999px; background: var(--fondo-gris); overflow: hidden; }
.rc-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width var(--dur-accordion) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}

/* Requisitos */
.rc-reqs { margin-bottom: 18px; }
.rc-reqs li { margin-bottom: 8px; color: var(--ciep-muted); transition: color var(--dur-fast) var(--ease-out); }
.rc-reqs li svg { color: var(--ciep-muted); }
.rc-reqs .rc-check { opacity: 0; transition: opacity var(--dur-fast) var(--ease-out); }
.rc-reqs li.is-ok,
.rc-reqs li.is-ok svg { color: var(--track-green); }
.rc-reqs li.is-ok .rc-check { opacity: 1; }

.rc-toggle { font-size: var(--text-xs); font-weight: var(--weight-semibold); }
.rc-ok-icon { width: 64px; height: 64px; color: var(--track-green); }

@media (prefers-reduced-motion: reduce) {
  .rc-meter span, .rc-reqs li, .rc-reqs .rc-check { transition: none; }
}

/* ---- Pie de la intranet (pie.php) dentro de esta página ----
   Aquí el body es flex en columna y <main> ocupa el espacio libre, así que el
   pie va en el flujo normal en lugar de quedar "absolute" al fondo del documento. */
.rc-page .piePagina {
  position: static;
  flex: none;
  width: auto;
  margin: 0;
}
.rc-page .piePagina p { margin: 0 0 1rem; font-size: inherit; line-height: 1.5; }


/* ==========================================================================
   12. Tesis (tesis/index.php, tesis/verArchivo.php)
   Clases ts-*. Todo limitado a .ts-page / .ts-modal salvo las clases propias ts-*.
   Bootstrap 5.3. En la sección 3 están la franja de .ts-card y .ts-modal y la
   estructura del buscador (.ts-combo, .ts-sugerencias, .ts-sug, .ts-sug-mensaje).
   ========================================================================== */
.ts-page {
  font-family: var(--font-body);
  color: var(--ciep-text);
  padding: 4px 4px 24px;
}
.ts-page h1,
.ts-page h2,
.ts-modal .modal-title { font-style: normal; }

/* Íconos SVG de línea */
.ts-ico {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Encabezado y barra de búsqueda ---------- */
.ts-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 5px 4px 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--ciep-divider-on-white);
}
.ts-titulo { margin: 0; font-size: var(--text-xl); font-weight: var(--weight-bold); color: var(--ciep-navy); }

.ts-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; }
.ts-filtro { display: flex; flex-direction: column; flex: 1 1 180px; min-width: 180px; max-width: 260px; }
.ts-filtro--buscar { min-width: 240px; max-width: 300px; }

.ts-page .ts-label {
  display: block;
  margin: 8px 0 2px;
  font-size: .74rem;
  font-style: normal;                    /* la sección 2 pone label en cursiva */
  font-weight: var(--weight-semibold);
  letter-spacing: .02em;
  color: var(--ciep-muted);
}
.ts-page .ts-toolbar .ts-label { margin-top: 0; }

/* El combo va dentro de .input-group junto al botón Buscar */
.ts-page .input-group > .ts-combo { flex: 1 1 auto; width: 1%; min-width: 0; }
.ts-page .ts-combo > .form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.ts-page .input-group > .btn { display: inline-flex; align-items: center; padding: 0 .6rem; }

/* Sugerencias: colores y contenido (la estructura está en la sección 3) */
.ts-sugerencias {
  min-width: min(340px, calc(100vw - 24px));
  background: var(--ciep-white);
  border-color: var(--ciep-divider-on-white);
}
.ts-sug:hover,
.ts-sug.is-activo { background: var(--track-blue-soft); }
.ts-sug.is-activo { box-shadow: inset 2px 0 0 var(--ciep-cyan); }
.ts-sug-nombre { font-size: var(--text-xs); font-weight: var(--weight-semibold); line-height: 1.3; color: var(--ciep-navy); }
.ts-sug-clave { font-size: var(--text-3xs); font-variant-numeric: tabular-nums; color: var(--ciep-muted); }
.ts-sug-mensaje { margin: 0; color: var(--ciep-muted); }

/* ---------- Controles ---------- */
.ts-page .form-control-sm,
.ts-page .form-select-sm {
  font-size: .8rem;
  border-color: var(--input-border);
  border-radius: 6px;
  color: var(--ciep-text);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.ts-page .form-control-sm:focus,
.ts-page .form-select-sm:focus {
  border-color: var(--ciep-cyan);
  box-shadow: 0 0 0 .18rem var(--ciep-focus-ring);
}
.ts-page .form-control-sm:disabled,
.ts-page .form-control-sm[readonly],
.ts-page .form-select-sm:disabled {
  background-color: var(--fondo-gris);
  color: var(--ciep-text-readonly);
}
.ts-page textarea.form-control-sm { resize: vertical; }
.ts-page .form-control-sm.is-invalid,
.ts-page .form-select-sm.is-invalid { border-color: var(--track-red); }
.ts-page .invalid-feedback { font-size: var(--text-3xs); }
.ts-page .ts-nota-campo { color: var(--text-red); }

/* ---------- Indicaciones ---------- */
.ts-nota {
  margin-bottom: 12px;
  padding: 10px 12px 10px 4px;
  border-left: 3px solid var(--gold-600);
  border-radius: 0 6px 6px 0;
  background: var(--gold-600-tint);
  font-size: .8rem;
  line-height: 1.5;
  color: var(--ciep-text);
}
.ts-nota ul { margin: 0; padding-left: 1.4rem; }
.ts-nota li + li { margin-top: 4px; }

/* ---------- Tarjetas ---------- */
.ts-cols { --bs-gutter-x: 12px; }

.ts-card {
  position: relative;
  margin-bottom: 12px;
  padding: 12px 14px 14px;
  overflow: hidden;
  background: var(--ciep-white);
  border: 1px solid var(--ciep-divider-on-white);
  border-radius: 12px;
  box-shadow: var(--ciep-shadow-card);
}
.ts-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--ciep-divider-on-white);
}
.ts-card-title {
  margin: 0;
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ciep-navy);
}
.ts-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--ciep-divider-on-white);
}

/* Estatus de la tesis */
.ts-pill {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: var(--weight-semibold);
  letter-spacing: .02em;
  line-height: 1.6;
  white-space: nowrap;
}
.ts-pill[hidden] { display: none; }
.ts-pill--p { background: var(--track-blue-soft); color: var(--track-blue); }
.ts-pill--t { background: var(--track-green-soft); color: var(--track-green-deep); }
.ts-pill--a { background: var(--fondo-gris); color: var(--ciep-muted); }

/* ---------- Documentos ---------- */
.ts-docs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.ts-doc {
  position: relative;
  display: flex;
  align-items: stretch;
  min-width: 0;
  background: var(--ciep-white);
  border: 1px solid var(--ciep-divider-on-white);
  border-radius: 8px;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.ts-doc:hover { border-color: var(--input-border); }

.ts-doc-ver {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  text-align: left;
  color: var(--ciep-text);
  font-size: .85rem;
  cursor: pointer;
}
.ts-doc-ver:hover:not(:disabled) .ts-doc-nombre { color: var(--ciep-navy); text-decoration: underline; }
.ts-doc-ver:disabled { color: var(--ciep-muted); cursor: default; }
.ts-doc-nombre { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ts-doc-estado { width: 9px; height: 9px; flex: none; border: 2px solid var(--ciep-gray); border-radius: 50%; }
.ts-doc.is-cargado .ts-doc-estado { background: var(--track-green); border-color: var(--track-green); }

.ts-doc-accion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  flex: none;
  border: 0;
  border-left: 1px solid var(--ciep-divider-on-white);
  background: none;
  color: var(--ciep-muted);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.ts-doc-accion:last-child { border-radius: 0 8px 8px 0; }
.ts-doc-accion .ts-ico { width: 15px; height: 15px; }
.ts-doc-bajar:hover,
.ts-doc-subir:hover { background: var(--track-blue-soft); color: var(--ciep-navy); }
.ts-doc.is-pendiente .ts-doc-subir { color: var(--track-green-deep); }
.ts-doc.is-pendiente .ts-doc-subir:hover { background: var(--track-green-soft); }
.ts-doc-borrar:hover:not(:disabled) { background: var(--track-red-soft); color: var(--track-red); }
.ts-doc-borrar:disabled { color: var(--ciep-gray); cursor: default; }
.ts-doc-ver:focus-visible,
.ts-doc-accion:focus-visible { outline: 2px solid var(--ciep-cyan); outline-offset: -2px; }

/* Mientras se sube o elimina */
.ts-doc.is-ocupado { pointer-events: none; opacity: .6; }
.ts-doc.is-ocupado::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 112px;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border: 2px solid var(--ciep-navy);
  border-right-color: transparent;
  border-radius: 50%;
  animation: ciep-girar .7s linear infinite;
}

/* Vacío / cargando */
.ts-vacio-texto {
  margin: 10px 0 0;
  padding: 18px 14px;
  border: 1px dashed var(--input-border);
  border-radius: 10px;
  text-align: center;
  font-size: .84rem;
  color: var(--ciep-muted);
}
.ts-cargando {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 10px 0 0;
  padding: 18px;
  font-size: .84rem;
  color: var(--ciep-muted);
}
.ts-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: none;
  border: 2px solid var(--ciep-divider-on-white);
  border-top-color: var(--ciep-navy);
  border-radius: 50%;
  animation: ciep-girar .8s linear infinite;
}

/* ---------- Botones (.btn-ciep y .btn-ciep-outline en la sección 3) ---------- */
.ts-page .btn-sm,
.ts-modal .btn-sm { font-size: .8rem; border-radius: 6px; font-weight: var(--weight-semibold); }
.ts-modal .btn-ciep { display: inline-flex; align-items: center; gap: 6px; }
.ts-modal .btn-sm .ts-ico { width: 14px; height: 14px; }
.ts-page .btn:focus-visible,
.ts-modal .btn:focus-visible { outline: 2px solid var(--ciep-cyan); outline-offset: 2px; box-shadow: none; }

/* ---------- Modales (Bootstrap 5) ---------- */
.ts-modal .modal-content {
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  box-shadow: var(--ciep-shadow-modal);
}
.ts-modal .modal-header {
  position: relative;                    /* franja de la sección 3 */
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ciep-divider-on-white);
}
.ts-modal .modal-title { margin: 0; font-size: var(--text-base); font-weight: var(--weight-bold); color: var(--ciep-navy); }
.ts-modal .modal-body { padding: 14px 16px; font-size: var(--text-sm); }
.ts-modal .modal-footer { gap: 6px; padding: 8px 16px; border-top: 1px solid var(--ciep-divider-on-white); }
.ts-modal .modal-footer > * { margin: 0; }
.ts-mensaje { margin: 0; white-space: pre-line; }

/* Visor de PDF (iframe → verArchivo.php) */
.ts-visor-titulo { flex: 1 1 auto; min-width: 0; }
.ts-visor-titulo small {
  display: block;
  overflow: hidden;
  font-size: var(--text-3xs);
  font-weight: var(--weight-semibold);
  letter-spacing: .05em;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ciep-muted);
}
.ts-visor-titulo .modal-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-visor-acciones { display: flex; flex: none; align-items: center; gap: 6px; }
.ts-visor-acciones .btn-close { margin: 0 0 0 4px; }

.ts-modal .ts-visor-cuerpo {
  position: relative;
  height: calc(100vh - 160px);
  min-height: 420px;
  padding: 0;
  background: var(--fondo-gris);
}
.ts-visor-cuerpo iframe { display: block; width: 100%; height: 100%; border: 0; }
.ts-visor-cargando {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--ciep-cubierta);
  color: var(--ciep-muted);
  font-size: var(--text-sm);
  pointer-events: none;
}
.ts-visor-cargando[hidden] { display: none; }

/* Página de error que verArchivo.php muestra dentro del visor */
body.ts-error-doc {
  display: flex;
  height: 100vh;
  margin: 0;                             /* anula el hueco del pie antiguo (sección 2) */
  background: var(--fondo-gris);
  color: var(--ciep-text);
  font-family: var(--font-body);
}
.ts-vacio {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--ciep-muted);
}
.ts-vacio svg {
  width: 40px;
  height: 40px;
  margin-bottom: 10px;
  fill: none;
  stroke: var(--ciep-muted);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ts-vacio p { margin: 0; }
.ts-vacio b { display: block; margin-bottom: 2px; font-weight: var(--weight-semibold); color: var(--ciep-text); }

/* ---------- Móvil ---------- */
@media (max-width: 575.98px) {
  .ts-toolbar,
  .ts-filtro,
  .ts-filtro--buscar { width: 100%; max-width: none; }
  .ts-sugerencias { min-width: 0; }
  .ts-modal .ts-visor-cuerpo { height: calc(100vh - 130px); min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ts-page .form-control-sm,
  .ts-page .form-select-sm,
  .ts-doc,
  .ts-doc-accion { transition: none; }
  .ts-spinner,
  .ts-doc.is-ocupado::after { animation-duration: 2s; }
}

@media print {
  .ts-toolbar,
  .ts-sugerencias,
  .ts-doc-accion,
  .ts-card-actions { display: none !important; }
  .ts-card { box-shadow: none; break-inside: avoid; }
}
