/* Ruta: public/assets/css/app.css */

:root {
  --ink: #12241c;
  --paper: #ffffff;
  --canvas: #fcfaf7;
  --forest: #0c2b22;
  --forest-deep: #061612;
  --gold: #c4a35a;
  --orange: #c56a0a;
  --muted: #6b6560;
  --muted-soft: #8a847c;
  --border: #e4e0d8;
  --danger: #9f1d1d;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

a {
  color: var(--forest);
}

button,
input,
select {
  font: inherit;
}

.sae-stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: radial-gradient(ellipse 86% 64% at 50% 22%, #1a6b48 0%, #0d3d2c 38%, #072018 70%, #020a08 100%);
}

.sae-stage-canvas {
  min-height: 100vh;
  background: #f6f4ee;
  padding: 24px;
}

.sae-home {
  width: 100%;
  max-width: 560px;
  text-align: left;
}

.sae-home h1 {
  margin: 0;
  font-size: 52px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: #fff;
}

.sae-home p {
  margin: 12px 0 0;
  font-size: 22px;
  color: rgba(255, 255, 255, 0.95);
}

.sae-home-grid {
  margin-top: 40px;
  display: grid;
  gap: 16px;
}

@media (min-width: 640px) {
  .sae-home-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.sae-glass-link,
.sae-glass-card {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  color: #fff;
}

.sae-glass-link {
  display: block;
  padding: 28px;
  text-decoration: none;
}

.sae-glass-link:hover {
  background: rgba(0, 0, 0, 0.4);
}

.sae-glass-card {
  width: 100%;
  max-width: 24rem;
  padding: 32px;
}

.sae-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

.sae-glass-link .sae-kicker + div,
.sae-glass-card h1 + p {
  margin-top: 8px;
}

.sae-glass-link div:last-child {
  margin-top: 8px;
  font-size: 18px;
  color: #fff;
}

.sae-glass-card h1 {
  margin: 0;
  text-align: center;
  font-size: 30px;
  color: #fff;
}

.sae-glass-card .lead {
  margin: 4px 0 24px;
  text-align: center;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}

.sae-glass-card label {
  display: block;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

.sae-glass-card .hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.sae-glass-card .back {
  display: block;
  margin-top: 16px;
  text-align: center;
  color: var(--gold);
  text-decoration: none;
  font-size: 14px;
}

.sae-glass-card .back:hover {
  text-decoration: underline;
}

.sae-field {
  margin-bottom: 12px;
}

.sae-field .sae-input {
  margin-top: 4px;
}

.sae-shell {
  display: flex;
  min-height: 100vh;
  background: var(--canvas);
}

.sae-nav-toggle {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 40;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: var(--forest);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sae-nav-toggle svg {
  width: 20px;
  height: 20px;
  display: none;
}

.sae-shell.is-nav-open .sae-nav-icon-close,
.sae-shell.is-nav-collapsed .sae-nav-icon-open {
  display: block;
}

.sae-sidebar {
  width: 232px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  color: #f4f0e6;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0) 22%),
    linear-gradient(180deg, #123d30 0%, #0c2b22 46%, #061612 100%);
  transition: transform 0.2s ease, width 0.2s ease;
}

.sae-shell.is-nav-open .sae-nav-toggle {
  left: 196px;
}

.sae-shell.is-nav-collapsed .sae-sidebar {
  transform: translateX(-100%);
  width: 0;
  overflow: hidden;
}

.sae-shell.is-nav-collapsed .sae-nav-toggle {
  left: 12px;
}

.sae-shell.is-nav-collapsed .sae-main {
  padding-left: 64px;
}

@media (max-width: 768px) {
  .sae-sidebar {
    position: fixed;
    z-index: 30;
    height: 100vh;
    transform: translateX(-100%);
    width: 232px;
  }
  .sae-shell.is-nav-open .sae-sidebar {
    transform: none;
    width: 232px;
  }
  .sae-shell.is-nav-collapsed .sae-sidebar {
    transform: translateX(-100%);
    width: 232px;
  }
  .sae-main {
    padding: 64px 16px 24px;
  }
  .sae-shell.is-nav-collapsed .sae-main,
  .sae-shell.is-nav-open .sae-main {
    padding-left: 16px;
    padding-top: 64px;
  }
}

.sae-main {
  min-width: 0;
  flex: 1;
  padding: 28px;
}

.sae-brand {
  display: block;
  padding: 24px 20px 16px;
  text-decoration: none;
  color: inherit;
}

.sae-brand strong {
  display: block;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: #fff;
}

.sae-brand small {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
}

.sae-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 0 12px 16px;
}

.sae-nav-link,
.sae-logout {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.sae-nav-link:hover,
.sae-logout:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sae-nav-link.is-active {
  background: var(--orange);
  color: #fff;
  font-weight: 600;
}

.sae-nav-link svg,
.sae-logout svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.9;
}

.sae-nav-foot {
  margin-top: 8px;
}

.icon-btn {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: #eef1ee;
  color: #3f4a45;
  text-decoration: none;
  cursor: pointer;
}

.icon-btn[title="Editar"],
.icon-btn-edit { color: #0c2b22; background: #d7ebe3; }
.icon-btn[title="Calificaciones"],
.icon-btn-grades { color: #b45309; background: #fde8c8; }
.icon-btn[title="Cambio"],
.icon-btn-swap { color: #1d4ed8; background: #dbe7ff; }
.icon-btn[title="Baja"],
.icon-btn[title="Eliminar"],
.icon-btn-danger { color: #b42318; background: #fde2e0; }
.icon-btn[title="Ver"],
.icon-btn-eye { color: #0f766e; background: #d5f0ec; }
.icon-btn[title="Descargar"],
.icon-btn[title="Imprimir"],
.icon-btn-download { color: #c56a0a; background: #f8edd9; }
.icon-btn[title="Horario"],
.icon-btn-clock { color: #475569; background: #e4e9f0; }
.icon-btn[title="Documentos"],
.icon-btn-file { color: #6d28d9; background: #ece4fb; }
.icon-btn[title="Tomar lista"],
.icon-btn-list { color: #0c2b22; background: #d7ebe3; }

.icon-btn:hover {
  filter: brightness(0.92);
  transform: scale(1.12);
}

.icon-btn.is-disabled,
.icon-btn[aria-disabled="true"] {
  opacity: 0.35;
  pointer-events: none;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.icon-btn-danger:hover,
.icon-btn[title="Baja"]:hover,
.icon-btn[title="Eliminar"]:hover {
  background: #f8c9c6;
  color: #7f1d1d;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.sae-official-warn {
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 2px solid #b42318;
  border-radius: 8px;
  background: #fff4f4;
  color: #7f1d1d;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  line-height: 1.25;
}

.asig-doc {
  max-width: 8.5in;
  margin: 16px auto 32px;
  padding: 12px 20px 24px;
  background: #fff;
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
}

/* Encabezado oficio (constancias) en horarios / asignaciones: sin pie, logos en flujo. */
.asig-doc .saej-oficio-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 88px;
  margin-bottom: 10px;
  justify-content: stretch;
}
.asig-doc .saej-oficio-logo-left {
  position: static;
  transform: none;
  height: 72px;
  max-width: 200px;
  width: auto;
}
.asig-doc .saej-oficio-logo-right {
  height: 72px;
  max-width: 88px;
  width: auto;
}
.asig-doc .saej-oficio-brand {
  position: static;
  left: auto;
  top: auto;
  transform: none;
  text-align: center;
  justify-self: center;
  max-width: none;
  width: auto;
  pointer-events: auto;
}

.asig-head {
  display: grid;
  grid-template-columns: 72px 1fr 72px;
  gap: 8px;
  align-items: start;
  margin-bottom: 8px;
}

.asig-head img {
  width: 68px;
  height: 68px;
  object-fit: contain;
}

.asig-head div {
  text-align: right;
  line-height: 1.25;
}

.asig-head-center {
  align-items: center;
}

.asig-head-center div {
  text-align: center;
}

.asig-head strong,
.asig-head span,
.asig-head small {
  display: block;
  font-size: 12px;
}

.asig-doc h1 {
  text-align: center;
  font-size: 18px;
  letter-spacing: 0.04em;
  margin: 12px 0 4px;
}

.asig-cycle {
  text-align: center;
  margin: 2px 0;
  font-weight: 700;
}

.asig-teacher {
  text-align: left;
  font-weight: 800;
  margin: 14px 0 8px;
}

.asig-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 14px 0 8px;
}
.asig-meta-row .asig-teacher {
  margin: 0;
  flex: 1;
  min-width: 0;
}
.asig-date-inline {
  margin: 0;
  font-weight: 600;
  white-space: nowrap;
  text-align: right;
}

.asig-doc table {
  width: 100%;
  border-collapse: collapse;
}

.asig-doc th,
.asig-doc td {
  border: 1px solid #111;
  padding: 3px 6px;
  font-size: 11px;
  text-align: left;
}

.asig-close {
  text-align: left;
  margin-top: 22px;
  line-height: 1.4;
}

.asig-sign {
  text-align: left;
  margin-top: 28px;
  font-weight: 700;
}

.asig-date {
  text-align: right;
  margin-top: 8px;
}

table.sae-table thead th[data-dir="asc"]::after { content: " ↑"; }
table.sae-table thead th[data-dir="desc"]::after { content: " ↓"; }

@media print {
  @page { size: letter portrait; margin: 10mm 12mm; }
  .asig-doc { margin: 0; padding: 0; max-width: none; width: 100%; }
  .horario-print-doc { width: 100%; }
}

.sae-nav-rule {
  margin: 0 12px 8px;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.sae-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 12px 8px;
}

.sae-avatar {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #9b2c2c;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.sae-user strong,
.sae-user small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sae-user strong {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.sae-user small {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.sae-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.sae-heading h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  color: var(--forest);
}

.sae-heading p {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.sae-heading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sae-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.sae-card-pad {
  padding: 20px;
}

.sae-card h2 {
  margin: 0;
  font-size: 18px;
  color: var(--forest);
}

.sae-card .muted {
  margin: 4px 0 16px;
  font-size: 14px;
  color: var(--muted);
}

.sae-peer-mark {
  display: inline-block;
  width: 1.1em;
  margin-right: 6px;
  font-weight: 700;
  font-size: 1.05em;
  line-height: 1;
  vertical-align: -1px;
}
.sae-peer-ok { color: #1b7a3d; }
.sae-peer-bad { color: #c62828; cursor: help; }

.sae-table-wrap {
  overflow-x: auto;
}

.sae-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.sae-table th {
  text-align: left;
  font-weight: 600;
  color: var(--muted-soft);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.sae-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #eeeae3;
  vertical-align: middle;
}

.sae-input,
.sae-select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 8px 11px;
  color: var(--ink);
}

.sae-input:focus,
.sae-select:focus {
  outline: none;
  border-color: var(--forest);
  box-shadow: 0 0 0 2px rgba(12, 43, 34, 0.12);
}

.sae-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.75rem;
  font-weight: 700;
}

.sae-pill-ok {
  background: #e8f6ee;
  color: #166534;
}

.sae-pill-no {
  background: #fde8e8;
  color: #991b1b;
}

.sae-pill-wait {
  background: #fff4d6;
  color: #92400e;
}

.sae-pill-warn {
  background: #fff4d6;
  color: #92400e;
}

.excel-update-box .excel-update-block + .excel-update-block {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e8d7a8;
}

.excel-update-list {
  margin: 4px 0 6px;
  padding-left: 1.1rem;
}

.excel-act-baja {
  color: #b91c1c;
  font-weight: 700;
}

.excel-act-alta {
  color: #15803d;
  font-weight: 700;
}

.excel-act-nombre-change {
  color: #c2410c;
  font-weight: 700;
}

.excel-update-hint {
  margin: 0;
  font-size: 14px;
}

.attend-months-wrap {
  overflow-x: auto;
}

.attend-months-table th,
.attend-months-table td {
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
}

.attend-months-table .attend-sticky {
  position: sticky;
  left: 0;
  background: #fff;
  text-align: left;
  z-index: 1;
  min-width: 12rem;
}

.attend-month-head {
  background: #f3f6f4;
}

.attend-classes {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  font-size: 12px;
}

.attend-day-cell {
  padding: 4px 6px;
}

.attend-mark-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.attend-mark-btn {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border, #c5d0c8);
  border-radius: 6px;
  background: #fff;
  font: 700 1rem/1 ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
  color: #0f172a;
  padding: 0;
}

.attend-mark-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.attend-mark-btn.is-mark-2 {
  color: #b91c1c;
  border-color: #f1a8a8;
  background: #fef2f2;
}

.attend-mark-btn.is-mark-1 {
  color: #c2410c;
  border-color: #fdba74;
  background: #fff7ed;
}

.attend-mark-btn.is-mark-j {
  color: #1d4ed8;
  border-color: #93c5fd;
  background: #eff6ff;
}

.sae-pill-auto {
  background: #e8f1fb;
  color: #1d4ed8;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 6px 12px;
  background: var(--forest);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(1.08);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

.btn-lg {
  min-height: 40px;
  width: 100%;
}

.btn-sm {
  min-height: 28px;
  padding: 2px 8px;
  font-size: 13px;
}

.btn-outline {
  background: #fff;
  border-color: var(--border);
  color: var(--forest);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-ok {
  background: #166534;
  color: #fff;
}

.btn-ok:hover {
  background: #14532d;
}

.alert {
  margin-bottom: 16px;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}

.alert-ok,
.alert-success {
  background: #e8f6ee;
  color: #166534;
}

.alert-error,
.alert-danger {
  background: #fde8e8;
  color: #991b1b;
}

.sae-search {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.sae-search .sae-input {
  max-width: 36rem;
  flex: 1;
}

.sae-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.grade-delivery {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  cursor: help;
}
.grade-delivery svg {
  width: 18px;
  height: 18px;
}
.grade-delivery-pending { color: #b42318; }
.grade-delivery-ok { color: #15803d; }
.grade-delivery-count.is-complete {
  color: #15803d;
  font-weight: 700;
}

.sae-pager {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  color: var(--muted-soft);
}

.sae-pager-btns {
  display: flex;
  gap: 6px;
}

.mono {
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

.grid-2 {
  display: grid;
  gap: 12px;
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.dl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
  padding: 16px;
  font-size: 14px;
}

.dl-grid dt {
  color: var(--muted);
}

.form-stack {
  display: grid;
  gap: 12px;
}

.form-stack label {
  display: block;
  font-size: 14px;
}

.form-stack .sae-input,
.form-stack .sae-select {
  margin-top: 4px;
}

.sae-sim {
  margin-top: 24px;
  border: 1px dashed #cfc9bd;
  border-radius: 8px;
  padding: 16px;
}

.sae-sim p {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-soft);
}

.sae-sim-grid {
  display: grid;
  gap: 8px;
}

@media (min-width: 900px) {
  .sae-sim-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.warn-box {
  margin-bottom: 20px;
  border: 1px solid #f1b0b0;
  background: #fdecec;
  color: #991b1b;
  border-radius: 8px;
  padding: 12px 16px;
}

.warn-box p {
  margin: 0;
}

.warn-box ul {
  margin: 4px 0 0;
  padding-left: 20px;
}

.teacher-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

.teacher-row + .teacher-row {
  margin-top: 12px;
}

.max-xl {
  max-width: 36rem;
}

.nowrap {
  white-space: nowrap;
}

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

.text-center {
  text-align: center;
}

.ml-2 {
  margin-left: 8px;
}

.sae-semester {
  margin-bottom: 16px;
  overflow: hidden;
}

.sae-semester-title {
  margin: 0;
  padding: 12px 16px;
  font-size: 16px;
  background: #f3efe6;
  border-bottom: 1px solid var(--border);
}

.observe-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff4e5;
  border: 1px solid #efc27a;
  color: #7a4b08;
  font-size: 14px;
}

.doc-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #fff;
}

.doc-icon svg { width: 16px; height: 16px; }
.doc-icon-yes { background: #166534; }
.doc-icon-no { background: #9f1d1d; pointer-events: none; }

.audit-login { background: #eef4fb; }
.audit-alta { background: #e8f6ee; }
.audit-baja { background: #fde8e8; }
.audit-calificaciones { background: #fff6e8; }
.audit-asignacion { background: #f3eefb; }

.carga-history-table tbody tr.carga-hist-docente td { background: #e8f1fb; }
.carga-history-table tbody tr.carga-hist-horas td { background: #fff6e8; }
.carga-history-table tbody tr.carga-hist-asignatura td { background: #f3eefb; }
.carga-history-table tbody tr.carga-hist-nueva td { background: #e8f6ee; }
.carga-history-table tbody tr.carga-hist-eliminada td { background: #fde8e8; }
.carga-history-table tbody tr.carga-hist-excel td { background: #eef8f7; }
.carga-history-table tbody tr.carga-hist-otro td { background: #f4f4f2; }
.carga-history-table tbody tr.carga-hist-undone td { opacity: 0.62; }
.carga-history-table .carga-hist-arrow {
  text-align: center;
  font-weight: 700;
  color: #444;
  width: 2rem;
  padding-left: 4px;
  padding-right: 4px;
}
.carga-history-table tbody tr.carga-hist-docente td:first-child { box-shadow: inset 4px 0 0 #2563eb; }
.carga-history-table tbody tr.carga-hist-horas td:first-child { box-shadow: inset 4px 0 0 #d97706; }
.carga-history-table tbody tr.carga-hist-asignatura td:first-child { box-shadow: inset 4px 0 0 #7c3aed; }
.carga-history-table tbody tr.carga-hist-nueva td:first-child { box-shadow: inset 4px 0 0 #15803d; }
.carga-history-table tbody tr.carga-hist-eliminada td:first-child { box-shadow: inset 4px 0 0 #b91c1c; }
.carga-history-table tbody tr.carga-hist-excel td:first-child { box-shadow: inset 4px 0 0 #0f766e; }

.x-btn {
  border: 0;
  background: transparent;
  color: #9f1d1d;
  font-size: 18px;
  cursor: pointer;
  width: 28px;
}

.x-btn.is-disabled {
  color: #c4c4c4;
  cursor: not-allowed;
  opacity: 0.55;
  pointer-events: none;
}
/* EL-IMCCREPLOADOEMDR-DENIEL-TAGSISDOOTEM-E-A-EN-PS-JAGROSEOSO-ALTOPBER-DITO-ELEROD-ATRIGNOAUEZ-2R-UL02ILOA6O-123 */

.brand-registered {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 40;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--muted);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
}

.brand-registered-tip {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  padding: 6px 10px;
  border-radius: 8px;
  background: #1f2a23;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.brand-registered:hover .brand-registered-tip,
.brand-registered:focus-visible .brand-registered-tip {
  opacity: 1;
  transform: translateY(0);
}

/* Manual del docente */
.manual-doc {
  max-width: 52rem;
  line-height: 1.55;
  color: #1f2a23;
}

.manual-cover {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border, #d7ddd6);
}

.manual-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5b6b5f;
}

.manual-title {
  margin: 0 0 0.4rem;
  font-size: 1.75rem;
}

.manual-lead {
  margin: 0;
  color: #4a574e;
}

.manual-toc h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.manual-toc ol {
  margin: 0;
  padding-left: 1.25rem;
}

.manual-toc a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.manual-section {
  margin: 1.75rem 0;
}

.manual-section h2 {
  margin: 0 0 0.6rem;
  font-size: 1.25rem;
}

.manual-section ul {
  margin: 0.6rem 0 1rem;
  padding-left: 1.25rem;
}

.manual-section li {
  margin-bottom: 0.35rem;
}

.manual-figure {
  margin: 1rem 0 0;
  padding: 0;
}

.manual-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border, #d7ddd6);
  border-radius: 10px;
  background: #fff;
}

.manual-figure figcaption {
  margin-top: 0.45rem;
  font-size: 0.88rem;
  color: #5b6b5f;
}

.manual-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border, #d7ddd6);
  font-size: 0.9rem;
  color: #5b6b5f;
}

@media print {
  .sae-shell {
    display: block !important;
  }

  .sae-sidebar,
  .sae-nav-toggle,
  .observe-bar,
  .manual-print-hide,
  .alert {
    display: none !important;
  }

  .sae-main {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
  }

  .manual-doc {
    max-width: none;
  }

  .manual-section,
  .manual-figure {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .manual-figure img {
    border-radius: 0;
    max-height: 11cm;
    object-fit: contain;
    object-position: left top;
  }

  .manual-toc a {
    text-decoration: none;
  }
}

.impresiones-nav {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}
.impresiones-nav-card {
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.impresiones-nav-card:hover {
  border-color: var(--accent, #3b5bdb);
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.impresiones-nav-card h2 {
  margin: 0;
  font-size: 1.05rem;
}
.impresiones-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.print-search-results {
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 220px;
  overflow: auto;
  margin-top: 6px;
}
.print-search-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.print-search-item:hover { background: #f4f4f2; }

.oficial-sheet {
  max-width: 21cm;
  margin: 12px auto;
  padding: 24px 28px 6.5cm;
  background: #fff;
  color: #111;
  font-family: "Times New Roman", Times, serif;
  font-size: 11pt;
  line-height: 1.35;
  position: relative;
  overflow: visible;
  min-height: 27.5cm;
  box-sizing: border-box;
}
.oficial-sheet--anchored {
  /* Margen izq. ~3cm; el logo Nayarit se sale hacia el borde sin mover el brand */
  padding-left: 3cm;
}
.saej-oficio-header {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 110px;
  margin-bottom: 10px;
  overflow: visible;
}
.saej-oficio-logo {
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}
/* Fuera del margen (~1.1cm del borde), detrás del texto: no desplaza brand ni logo der. */
.saej-oficio-logo-left {
  position: absolute;
  left: -2.02cm;
  top: 50%;
  /* 0.5cm arriba − 0.20cm = 0.3cm neto hacia arriba del centro */
  transform: translateY(calc(-50% - 0.3cm));
  height: 78px;
  width: auto;
  max-width: 268px;
  z-index: 0;
}
.saej-oficio-logo-right {
  position: relative;
  z-index: 1;
  width: 96px;
  height: 96px;
  max-width: 96px;
}
.saej-oficio-brand {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: max-content;
  max-width: min(100%, 420px);
  text-align: center;
  z-index: 2;
  pointer-events: none;
}
.saej-oficio-brand p,
.oficio-header-brand p {
  margin: 0;
  line-height: 1.15;
  font-family: "Times New Roman", Times, serif;
}
.saej-oficio-brand strong {
  display: inline;
  font-size: inherit;
  letter-spacing: .02em;
  line-height: 1.15;
  margin: 0;
  font-weight: 700;
}
.saej-oficio-brand strong + strong { margin-top: 1px; }
.saej-oficio-brand-meta {
  margin-top: 2px !important;
  font-size: 8pt !important;
  line-height: 1.15 !important;
}

/* Config: encabezado de oficios */
.oficio-header-box {
  border: 1px solid var(--border, #d7ddd6);
  border-radius: 8px;
  padding: 14px 16px 16px;
  margin: 12px 0 4px;
}
.oficio-header-box legend {
  font-weight: 700;
  padding: 0 6px;
}
.oficio-logo-row {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 14px;
}
.oficio-logo-preview {
  display: block;
  height: 72px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  background: #f7f7f5;
  border: 1px solid var(--border, #d7ddd6);
  border-radius: 6px;
  padding: 6px;
}
.rte-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}
.rte-toolbar button[data-cmd] {
  min-width: 2rem;
  padding: 4px 8px;
  border: 1px solid var(--border, #d7ddd6);
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
}
.rte-toolbar button[data-cmd]:hover { background: #f4f4f2; }
.rte-sep {
  width: 1px;
  height: 22px;
  background: var(--border, #d7ddd6);
  margin: 0 2px;
}
.oficio-rte {
  min-height: 140px;
  border: 1px solid var(--border, #d7ddd6);
  border-radius: 6px;
  padding: 12px;
  background: #fff;
  font-family: "Times New Roman", Times, serif;
  line-height: 1.25;
}
.oficio-rte:focus { outline: 2px solid #c5d0c4; }
@media (max-width: 700px) {
  .oficio-logo-row { grid-template-columns: 1fr; }
}
.oficial-body { position: relative; z-index: 1; }
.oficial-bottom {
  position: absolute;
  left: 3cm;
  right: 28px;
  bottom: 2.75cm; /* otro renglón más arriba del pie */
  z-index: 2;
}
.saej-oficio-pie {
  position: absolute;
  left: 3cm;
  right: 28px;
  bottom: 0;
  margin: 0;
  padding: 0;
  height: 1.35cm;
  z-index: 1;
  pointer-events: none;
}
.saej-oficio-pie-img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 1.35cm;
  object-fit: fill;
}
.oficial-asunto { text-align: right; font-weight: 700; margin-top: 2.2em; }
.oficial-nombre {
  text-align: center;
  font-weight: 700;
  font-size: 12.5pt;
  margin: 1.35em 0; /* 1 renglón arriba y abajo */
}
.oficial-grid {
  width: calc(100% - 4mm);
  max-width: calc(100% - 4mm);
  box-sizing: border-box;
  border-collapse: collapse;
  margin: 8px 2mm 12px;
  font-size: 10.5pt;
}
.oficial-grid td, .oficial-grid th {
  border: 1px solid #333;
  padding: 4px 6px 4px 2mm; /* 2mm desde la raya izq. */
  vertical-align: top;
}
.oficial-atentamente {
  text-align: center;
  font-weight: 700;
  letter-spacing: .12em;
  margin: 0 0 3.2em; /* ~3 renglones hasta la línea/firma */
}
.oficial-firma-linea {
  width: 260px;
  margin: 0 auto 4px;
  border-top: 1px solid #111;
}
.oficial-firma {
  text-align: center;
  margin: 0 0 1.1em;
  font-weight: 700;
  line-height: 1.2;
}
.oficial-firmas-tabla {
  width: calc(100% - 4mm);
  max-width: calc(100% - 4mm);
  box-sizing: border-box;
  border-collapse: collapse;
  table-layout: fixed;
  margin: 4px 2mm 0;
  font-size: 6.5pt;
}
.oficial-firmas-tabla td,
.oficial-firmas-tabla th {
  border: 1px solid #333;
  padding: 2px 4px 2px 2mm; /* 2mm desde la raya izq. */
  vertical-align: middle;
  font-size: 6.5pt;
}
.oficial-firmas-tabla th:nth-child(1),
.oficial-firmas-tabla td:nth-child(1) { width: 12%; }
.oficial-firmas-tabla th:nth-child(2),
.oficial-firmas-tabla td:nth-child(2) { width: 28%; }
.oficial-firmas-tabla th:nth-child(3),
.oficial-firmas-tabla td:nth-child(3) { width: 24%; }
.oficial-firmas-tabla th:nth-child(4),
.oficial-firmas-tabla td:nth-child(4) {
  width: 36%; /* espacio restante para firma */
  min-height: 1.8em;
}
.grade-fail { color: #b91c1c; font-weight: 700; }
.grade-ok { color: #15803d; font-weight: 700; }
.historial-title {
  text-align: center;
  font-size: 12pt;
  margin: 0.15em 0 0.35em;
  font-weight: 700;
  letter-spacing: .04em;
}
.historial-alumno {
  text-align: center;
  margin: 0 0 0.45em;
  line-height: 1.15;
}
.historial-alumno p { margin: 0; font-size: 10pt; }
.historial-nombre {
  font-size: 11.5pt !important;
  font-weight: 700;
  margin: 0.15em 0 !important;
}
.historial-promedio { text-align: right; font-weight: 700; margin: 0.25em 0 0.4em; font-size: 10pt; }
.historial-sem {
  break-inside: avoid;
  page-break-inside: avoid;
  margin: 0 0 0.45em;
  padding: 4px 6px 5px;
  border: 1px solid #d8d8d4;
  background: #fcfcfb;
}
.historial-sem-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: baseline;
  margin-bottom: 2px;
  font-size: 9.5pt;
  border-bottom: 1px solid #ebebe8;
  padding-bottom: 2px;
}
.historial-sem-avg { margin-left: auto; }
.historial-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 9pt;
  line-height: 1.2;
  margin: 0;
}
.historial-asig { flex: 0 1 auto; max-width: 85%; }
.historial-dots {
  flex: 1 1 auto;
  border-bottom: 1px dotted #bbb;
  min-width: 12px;
  height: 0.7em;
}
.historial-cal {
  flex: 0 0 2.4cm;
  text-align: right;
  white-space: nowrap;
}
.historial-cierre { margin: 0.35em 0 0.4em; text-align: justify; font-size: 10pt; line-height: 1.25; }
.oficial-sheet--historial { padding-bottom: 1.6cm; }
.oficial-sheet--historial .oficial-bottom--flow .oficial-atentamente { margin-bottom: 3.6em; }
.oficial-sheet--historial .oficial-firma { margin-bottom: 0.45em; }
.kardex-alumno {
  text-align: center;
  font-size: 9.5pt;
  line-height: 1.2;
  margin: 0 0 8px;
}
.kardex-doc-title {
  text-align: center;
  font-size: 13pt;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 0 0 6px;
}
.kardex-id-box {
  border: 1.6px solid #111;
  margin: 0 0 10px;
  padding: 4px 6px 5px;
  box-sizing: border-box;
}
.kardex-id-row {
  display: grid;
  gap: 4px 10px;
  margin: 0 0 3px;
}
.kardex-id-row:last-child { margin-bottom: 0; }
.kardex-id-row--2 { grid-template-columns: 1fr 4cm; }
.kardex-id-row--3 { grid-template-columns: 1fr 1fr 1.55fr; }
.kardex-id-cell {
  padding: 0;
  min-width: 0;
  border: 0;
}
.kardex-id-lab {
  display: block;
  font-size: 5.5pt;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin-bottom: 0;
}
.kardex-id-val {
  display: block;
  font-size: 10pt;
  font-weight: 700;
  line-height: 1.15;
  word-break: break-word;
  min-height: 1.15em;
}
.kardex-block { margin-bottom: 6px; break-inside: avoid; page-break-inside: avoid; }
.kardex-block-grid {
  display: grid;
  grid-template-columns: 1fr 1.4cm;
  gap: 3px;
  align-items: stretch;
}
.kardex-main { min-width: 0; }
.kardex-head {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 8px;
  font-size: 7.5pt;
  margin-bottom: 1px;
  align-items: baseline;
}
.kardex-tabla {
  font-size: 7.5pt !important;
  width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed;
  margin: 0 !important;
  height: 100%;
}
.kardex-tabla col.kx-cla { width: 0.55cm; }
.kardex-tabla col.kx-asig { width: auto; }
.kardex-tabla col.kx-cal { width: 0.85cm; }
.kardex-tabla col.kx-asis { width: 0.75cm; }
.kardex-tabla col.kx-fecha { width: 1.15cm; }
.kardex-tabla col.kx-calif { width: 0.75cm; }
.kardex-tabla th {
  font-size: 6.5pt !important;
  padding: 0 !important;
  vertical-align: middle;
  line-height: 1.12;
}
.kardex-tabla td {
  font-size: 7.5pt !important;
  padding: 0 !important;
  vertical-align: middle;
  line-height: 1.15;
}
.kardex-sem-avg {
  margin-left: auto;
  font-size: 7.5pt;
  font-weight: 700;
  white-space: nowrap;
}
.kardex-sem-avg + .kardex-baja {
  margin-left: 10px;
}
.kardex-baja {
  margin-left: auto;
  font-size: 6pt;
  white-space: nowrap;
}
.kardex-baja-blank {
  display: inline-block;
  width: 1.4cm;
  border-bottom: 1px solid #333;
  vertical-align: baseline;
  margin: 0 4px 0 2px;
}
.kardex-tabla .kx-cla,
.kardex-tabla td.kx-cla,
.kardex-tabla th:first-child {
  text-align: center;
  padding: 0 !important;
  white-space: nowrap;
  width: 0.55cm;
  max-width: 0.55cm;
  overflow: hidden;
}
.kardex-asig { text-align: left !important; font-size: 7.5pt !important; padding-left: 2px !important; }
.kardex-side {
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  align-items: stretch;
  width: 1.4cm;
  padding-top: 0;
}
.kardex-rev {
  border: 1px solid #333;
  padding: 4px 1px;
  text-align: center;
  font-size: 4pt;
  line-height: 1.15;
  width: 1.35cm;
  flex: 1 1 auto;
  height: 100%;
  min-height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.kardex-rev-line {
  border-top: 1px solid #111;
  margin: 3px 2px 1px;
}
.kardex-rev-amd { font-size: 3.5pt; }
.kardex-footer-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  position: relative;
  margin-top: 14px;
  font-size: 9pt;
  min-height: 3.5cm;
}
.kardex-promedio-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  position: absolute;
  right: 0;
  top: 0;
}
.kardex-promedio-label {
  font-size: 8pt;
  font-weight: 700;
  line-height: 1.15;
  text-align: right;
}
.kardex-promedio-box {
  border: 1.2px solid #111;
  width: 1cm;
  height: 1cm;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8pt;
  font-weight: 700;
  flex-shrink: 0;
}
.kardex-director {
  text-align: center;
  width: 8cm;
}
.kardex-firma-spacer {
  height: 10em;
}
.oficial-sheet--kardex {
  padding: 0.2cm 1.5cm 0.8cm 1.5cm !important;
  max-width: none;
  width: auto;
  box-sizing: border-box;
}
.oficial-sheet--kardex.oficial-sheet--anchored {
  padding-left: 1.5cm !important;
  padding-right: 1.5cm !important;
}
.oficial-sheet--kardex .saej-oficio-header {
  min-height: 88px;
  margin-bottom: 4px;
}
.oficial-sheet--kardex .saej-oficio-pie {
  left: 1.5cm;
  right: 1.5cm;
}
.oficial-sheet--kardex .saej-oficio-logo-left {
  /* +1cm a la derecha para que no se corte con el margen de impresión */
  left: -0.2cm;
}
.oficial-bottom--flow {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  margin-top: 0.5em;
}
.escolaridad-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 6px;
}
.escolaridad-meta { font-size: 9pt; margin-bottom: 0; flex: 1; }
.escolaridad-stats-box {
  width: auto;
  font-size: 8pt !important;
  margin: 0 !important;
  white-space: nowrap;
}
.escolaridad-stats-box th,
.escolaridad-stats-box td {
  padding: 2px 8px !important;
  text-align: center;
}
.escolaridad-wrap { overflow-x: auto; }
.historial-closing {
  /* Mensaje + ATENTAMENTE + firma + Elaboró/Revisó siempre en la misma hoja. */
  break-inside: avoid;
  page-break-inside: avoid;
  margin-top: 0.25em;
}
.historial-closing .historial-cierre {
  break-after: avoid;
  page-break-after: avoid;
  margin-bottom: 0.15em;
}
.historial-closing .oficial-bottom--flow {
  break-inside: avoid;
  page-break-inside: avoid;
  break-before: avoid;
  page-break-before: avoid;
  margin-top: 0;
}
.escolaridad-tabla {
  font-size: 5.5pt !important;
  width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
.escolaridad-tabla th,
.escolaridad-tabla td {
  padding: 1px 0 !important; /* sin 2mm: columnas al ancho del dígito/texto */
  vertical-align: middle;
  word-wrap: break-word;
}
.esc-n { width: 0.38cm; text-align: center; }
.esc-nac { width: 0.4cm; text-align: center; font-size: 5pt; }
.esc-curp { width: 2.35cm; white-space: nowrap; font-size: 4.5pt; }
.esc-ape { width: 1.15cm; white-space: nowrap; font-size: 4.5pt; }
.esc-nom { width: 2.15cm; white-space: nowrap; font-size: 4.5pt; }
.esc-sex { width: 0.28cm; text-align: center; font-size: 5pt; padding: 0 !important; }
.esc-sit { width: 0.7cm; text-align: center; }
.escolaridad-cal, .escolaridad-reg {
  width: 0.4cm;
  text-align: center;
  padding: 1px 0 !important;
  font-size: 5pt;
}
.escolaridad-warn td { text-decoration: underline; background: #fff8e6; }
.escolaridad-firmas {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 12px;
  font-size: 7.5pt;
}
.escolaridad-firmas-main {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.escolaridad-firmas--keep {
  break-inside: avoid;
  page-break-inside: avoid;
}
.escolaridad-firma-box {
  border: 1px solid #333;
  padding: 6px 8px 10px;
}
.escolaridad-firma-title { font-weight: 700; text-align: center; margin-bottom: 10px; font-size: 7pt; }
.escolaridad-firma-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; text-align: center; }
.escolaridad-firma-cols .oficial-firma-linea { width: 90%; margin: 18px auto 4px; }
.escolaridad-sello {
  flex: 0 0 2.5cm;
  width: 2.5cm;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 2px;
}
.escolaridad-sello-box {
  position: relative;
  width: 100%;
  text-align: center;
  font-size: 8pt;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0 2px 5px;
  border: none;
  border-bottom: 1.5px solid #222;
  line-height: 1.2;
}
/* Esquineros inferiores └ … ┘ pegados a la línea de abajo */
.escolaridad-sello-box::before,
.escolaridad-sello-box::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 0.45cm;
  height: 0.45cm;
  border-bottom: 1.5px solid #222;
  box-sizing: border-box;
}
.escolaridad-sello-box::before {
  left: 0;
  border-left: 1.5px solid #222;
}
.escolaridad-sello-box::after {
  right: 0;
  border-right: 1.5px solid #222;
}
.boleta-fecha {
  text-align: right;
  margin: 1.15em 0 0;
  font-size: 11pt;
}
.boleta-title {
  text-align: center;
  font-size: 14pt;
  font-weight: 700;
  margin: 1.15em 0 10px;
  letter-spacing: 0.02em;
}
.boleta-meta {
  margin: 0 0 0;
  font-size: 11pt;
  line-height: 1.12;
}
.boleta-meta > div { margin: 0; }
.boleta-meta-avg { text-align: right; }
.boleta-meta-avg:last-child { margin-bottom: 1.15em; }
.boleta-intro {
  text-align: justify;
  margin: 0 0 1.15em;
  font-size: 11pt;
  line-height: 1.3;
}
.boleta-grades-block {
  break-inside: avoid;
  page-break-inside: avoid;
}
.oficial-boleta-tabla {
  width: 100%;
  margin: 0 0 2px !important;
}
.oficial-boleta-tabla th,
.oficial-boleta-tabla td {
  padding: 1px 4px !important;
  font-size: 10.5pt;
  vertical-align: middle;
  line-height: 1.15;
}
.oficial-boleta-tabla .boleta-cal-col {
  width: 2.2cm;
  text-align: center;
  white-space: nowrap;
}
.boleta-nota {
  margin: 2px 0 0;
  font-size: 10pt;
  line-height: 1.2;
  text-align: center;
}
.oficial-sheet--boleta .oficial-bottom--flow .oficial-atentamente--boleta {
  letter-spacing: 0.06em;
  margin-top: 2.2em;
  margin-bottom: 3.8em;
}
.oficial-page-break { page-break-before: always; height: 0; }
.firmante-checks {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}
.firmante-checks label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 14px;
  cursor: pointer;
}
.grid-3 {
  display: grid;
  gap: 12px;
}
@media (min-width: 768px) {
  .grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media print {
  .oficial-sheet,
  .saej-oficio {
    margin: 0 !important;
    padding: 0 0 5.6cm 3cm !important;
    max-width: none !important;
    min-height: auto !important;
    width: auto !important;
  }
  /* Historial/Boleta: firma en flujo. Kardex: márgenes 1.5cm por lado. */
  .oficial-sheet--historial,
  .oficial-sheet--boleta {
    padding-bottom: 1.7cm !important;
  }
  .historial-closing {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
  .historial-closing .historial-cierre,
  .historial-closing .oficial-bottom--flow {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
  .oficial-sheet--kardex.saej-oficio,
  .oficial-sheet--kardex,
  .oficial-sheet--kardex.oficial-sheet--anchored {
    padding: 0 0 0.45cm 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .oficial-sheet--kardex .saej-oficio-header {
    min-height: 72px !important;
    margin-bottom: 2px !important;
  }
  .oficial-sheet--kardex .saej-oficio-logo-left {
    left: -0.15cm !important;
  }
  .oficial-sheet--kardex .saej-oficio-pie {
    left: 0 !important;
    right: 0 !important;
    height: 1.1cm !important;
  }
  /* Escolaridad landscape: margen inferior suficiente para no tapar filas con el pie. */
  .oficial-sheet--escolar.saej-oficio,
  .oficial-sheet--escolar {
    padding: 0.25cm 0.70cm 2.5cm 0.70cm !important;
  }
  .oficial-page-break { break-before: page; }
  .saej-oficio-logo-left {
    left: -1.9cm;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .saej-oficio-logo-right {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .oficial-bottom {
    position: fixed !important;
    left: 3cm !important;
    right: 2mm !important;
    bottom: 2.6cm !important;
    z-index: 3;
  }
  .oficial-bottom--flow {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
  }
  .saej-oficio-pie {
    position: fixed !important;
    left: 3cm !important;
    right: 0 !important;
    bottom: 0 !important;
    width: auto !important;
    max-width: none !important;
    height: 1.35cm !important;
    margin: 0 !important;
    z-index: 2;
  }
  .saej-oficio-pie-img {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: fill !important;
  }
}

/* Gráfico de disponibilidad docente (pares Horarios asignaturas) */
.avail-chart {
  margin-bottom: 16px;
}
.avail-chart[hidden] {
  display: none !important;
}
.avail-chart-title {
  font-weight: 700;
  margin-bottom: 6px;
}
.avail-chart-legend {
  display: flex;
  gap: 16px;
  font-size: 0.88rem;
  color: var(--muted, #5a6a5e);
  margin-bottom: 12px;
}
.avail-swatch {
  display: inline-block;
  width: 14px;
  height: 10px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}
.avail-swatch-ok { background: #2e9b4f; }
.avail-swatch-no { background: #c43c3c; }
.avail-chart-grid {
  display: grid;
  grid-template-columns: 5.2rem minmax(0, 1fr) 12px minmax(0, 1fr);
  gap: 4px 0;
  align-items: stretch;
}
.avail-chart-corner { min-height: 0; }
.avail-chart-band {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 4px;
  margin-bottom: 2px;
}
.avail-chart-band-m {
  background: #e8f4ec;
  color: #1d6b38;
}
.avail-chart-band-v {
  background: #eef0f8;
  color: #3a4580;
}
.avail-chart-gap {
  width: 12px;
}
.avail-chart-gap-line {
  background: linear-gradient(to bottom, transparent 10%, #9aa3b2 10%, #9aa3b2 90%, transparent 90%);
  width: 3px;
  justify-self: center;
  border-radius: 2px;
  margin: 0 4px;
}
.avail-chart-labels {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 2px;
  font-size: 0.62rem;
  color: var(--muted, #5a6a5e);
  text-align: center;
  line-height: 1.1;
  margin-bottom: 2px;
}
.avail-chart-day {
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  padding-right: 6px;
}
.avail-chart-cells {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 2px;
  min-height: 18px;
}
.avail-cell {
  height: 16px;
  border-radius: 3px;
  min-width: 0;
}
.avail-cell-ok { background: #2e9b4f; }
.avail-cell-no { background: #c43c3c; }
@media (max-width: 720px) {
  .avail-chart-labels { font-size: 0.55rem; }
  .avail-chart-day { font-size: 0.75rem; }
}

/* Archivos Dig. */
.dig-group-wrap { overflow-x: auto; }
.dig-group-table .dig-col {
  font-size: 0.72rem;
  line-height: 1.15;
  text-align: center;
  max-width: 4.6rem;
  white-space: normal;
  vertical-align: bottom;
}
.dig-col-count { font-weight: 600; color: var(--muted, #5a6a5e); margin-top: 2px; }
.dig-cell { text-align: center; }
.dig-name-link { color: inherit; text-decoration: none; }
.dig-name-link:hover { text-decoration: underline; }
.dig-mini { margin-left: 6px; font-size: 0.65rem; }
.dig-ico {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid transparent;
}
.dig-ico svg { width: 16px; height: 16px; }
.dig-ico-ok { color: #166534; background: #e8f6ee; }
.dig-ico-pend { color: #92400e; background: #fff4d6; }
.dig-ico-bad { color: #991b1b; background: #fde8e8; }
.dig-ico-miss { color: #94a3b8; background: #f1f5f9; }
.dig-doc-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: flex-start;
}
.dig-doc-actions { flex-wrap: wrap; }
.dig-doc-card { margin-bottom: 12px; }
.dig-viewer { margin-top: 12px; }
.dig-viewer iframe {
  width: 100%;
  min-height: 70vh;
  border: 1px solid #d7e0d9;
  border-radius: 8px;
  background: #fff;
}
.dig-viewer-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.dig-curp-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
}
.dig-curp-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.dig-curp-list li {
  font-size: 0.92rem;
  line-height: 1.35;
}
.dig-student-list { max-width: 56rem; }

.sae-semester-current {
  opacity: 0.65;
  pointer-events: none;
  cursor: default;
}

/* Posibles Bajas: asignatura en riesgo, como marcatextos rojo (solo lectura) */
.grade-risk-row td {
  background: #fecaca !important;
}

/* Subida de Excel: arrastrar + Cargar (envío automático) */
.sae-file-upload {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 16px;
}

.sae-file-upload.is-uploading {
  pointer-events: none;
  opacity: 0.72;
}

.sae-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sae-file-drop {
  flex: 1 1 12rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  user-select: none;
}

.sae-file-drop:hover,
.sae-file-drop:focus-visible {
  border-color: var(--forest);
  color: var(--forest);
  outline: none;
}

.sae-file-drop.is-dragover {
  border-color: var(--forest);
  background: #eef5f1;
  color: var(--forest);
}

.sae-file-drop-label,
.sae-file-drop-status {
  font-size: 14px;
}

.sae-file-browse {
  flex: 0 0 auto;
  align-self: center;
  cursor: pointer;
}

.sae-file-upload-hint {
  flex-basis: 100%;
  margin: 0;
}
