/* =====================================================================
   Sistema Escolar — Hoja de estilos principal (sobre Bootstrap 5.3)
   ===================================================================== */
:root {
  --app-primary: #4f46e5;
  --app-primary-rgb: 79, 70, 229;
  --app-primary-dark: #4338ca;
  --app-bg: #f4f6fb;
  --app-surface: #ffffff;
  --app-border: rgba(15, 23, 42, .08);
  --app-sidebar: #0f172a;
  --app-sidebar-text: #aab4c8;
  --app-sidebar-active: rgba(129, 140, 248, .16);
  --app-radius: 14px;
  --app-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
  --sidebar-w: 264px;

  --bs-primary: var(--app-primary);
  --bs-primary-rgb: var(--app-primary-rgb);
  --bs-link-color: var(--app-primary);
  --bs-link-color-rgb: var(--app-primary-rgb);
  --bs-link-hover-color: var(--app-primary-dark);
  --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-body-font-size: .925rem;
  --bs-border-radius: .55rem;
  --bs-primary-bg-subtle: #eef2ff;
  --bs-primary-border-subtle: #c7d2fe;
  --bs-primary-text-emphasis: #3730a3;

  /* Gráficos: paleta categórica validada (orden fijo) y tinta/rejilla */
  --viz-1: #2a78d6; --viz-2: #eb6834; --viz-3: #1baf7a;
  --viz-grid: #e8e8e3; --viz-axis: #898781; --viz-surface: #ffffff; --viz-ink: #0b0b0b; --viz-ink-2: #52514e;
}
[data-bs-theme="dark"] {
  --viz-1: #3987e5; --viz-2: #d95926; --viz-3: #199e70;
  --viz-grid: #243049; --viz-axis: #898781; --viz-surface: #111a2e; --viz-ink: #ffffff; --viz-ink-2: #c3c2b7;
}
.chart-box { position: relative; height: 280px; }
.chart-box-sm { position: relative; height: 220px; }
.leyenda-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: baseline; }
details.tabla-datos summary { cursor: pointer; font-size: .8rem; color: var(--bs-secondary-color); }
details.tabla-datos table { font-size: .8rem; font-variant-numeric: tabular-nums; }
[data-bs-theme="dark"] {
  --app-bg: #0b1120;
  --app-surface: #111a2e;
  --app-border: rgba(148, 163, 184, .14);
  --app-sidebar: #070d1a;
  --app-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --bs-body-bg: #0b1120;
  --bs-tertiary-bg: #16213a;
  --bs-secondary-bg: #1b2742;
  --bs-border-color: rgba(148, 163, 184, .18);
  --bs-primary-bg-subtle: rgba(99, 102, 241, .15);
  --bs-primary-border-subtle: rgba(99, 102, 241, .35);
  --bs-primary-text-emphasis: #a5b4fc;
  --bs-link-color: #818cf8;
  --bs-link-color-rgb: 129, 140, 248;
}

body { background: var(--app-bg); -webkit-font-smoothing: antialiased; }
.min-w-0 { min-width: 0; }
.fw-medium { font-weight: 500; }
.cursor-pointer { cursor: pointer; }
.small-xs { font-size: .75rem; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
.btn:hover, .nav-item:hover, .dropdown-item:hover, .page-link:hover, .list-group-item:hover, .card-link:hover, .notif-item:hover, .clase-card:hover, .stat-card:hover { text-decoration: none; }

/* Botones */
.btn-primary {
  --bs-btn-bg: var(--app-primary); --bs-btn-border-color: var(--app-primary);
  --bs-btn-hover-bg: var(--app-primary-dark); --bs-btn-hover-border-color: var(--app-primary-dark);
  --bs-btn-active-bg: #3730a3; --bs-btn-active-border-color: #3730a3;
  --bs-btn-disabled-bg: var(--app-primary); --bs-btn-disabled-border-color: var(--app-primary);
}
.btn-outline-primary {
  --bs-btn-color: var(--app-primary); --bs-btn-border-color: var(--app-primary);
  --bs-btn-hover-bg: var(--app-primary); --bs-btn-hover-border-color: var(--app-primary);
  --bs-btn-active-bg: var(--app-primary); --bs-btn-active-border-color: var(--app-primary);
}
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: #a5b4fc; --bs-btn-border-color: #6366f1; }
.btn { font-weight: 500; }
.btn-icon {
  width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; color: var(--bs-secondary-color); border: 0; background: transparent;
}
.btn-icon:hover { background: var(--bs-tertiary-bg); color: var(--bs-body-color); }
.btn-soft { background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); border: 0; }
.btn-soft:hover { background: var(--bs-primary-border-subtle); color: var(--bs-primary-text-emphasis); }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: #a5b4fc; box-shadow: 0 0 0 .2rem rgba(var(--app-primary-rgb), .15); }
.form-check-input:checked { background-color: var(--app-primary); border-color: var(--app-primary); }
.form-label { font-weight: 500; font-size: .85rem; margin-bottom: .3rem; }
.form-text { font-size: .78rem; }
.text-primary { color: var(--app-primary) !important; }
[data-bs-theme="dark"] .text-primary { color: #818cf8 !important; }
.bg-primary { background-color: var(--app-primary) !important; }

/* ---------------------------------------------------------------------
   Estructura
   --------------------------------------------------------------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--app-sidebar);
  color: var(--app-sidebar-text); display: flex; flex-direction: column; z-index: 1040;
  transition: transform .25s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: .75rem; padding: 1.1rem 1.1rem 1rem; color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.sidebar-brand:hover { color: #fff; }
.brand-icon {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; font-size: 1.25rem; box-shadow: 0 6px 18px rgba(99, 102, 241, .35);
}
.brand-icon-lg { width: 56px; height: 56px; font-size: 1.75rem; border-radius: 16px; }
.brand-logo { width: 40px; height: 40px; object-fit: contain; border-radius: 10px; background: #fff; padding: 3px; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-weight: 700; font-size: .92rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.brand-sub { font-size: .72rem; color: #7c8aa5; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .5rem .75rem 1rem; scrollbar-width: thin; scrollbar-color: #334155 transparent; }
.nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; color: #5b6b86; padding: 1rem .75rem .35rem; }
.nav-item {
  display: flex; align-items: center; gap: .7rem; padding: .52rem .75rem; margin: 1px 0; border-radius: 9px;
  color: var(--app-sidebar-text); font-size: .88rem; font-weight: 500; transition: background .15s, color .15s;
}
.nav-item i { font-size: 1.05rem; width: 1.2rem; text-align: center; opacity: .85; }
.nav-item:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav-item.active { background: var(--app-sidebar-active); color: #fff; box-shadow: inset 3px 0 0 #818cf8; }
.nav-item.active i { color: #a5b4fc; opacity: 1; }
.sidebar-footer { padding: .8rem 1.1rem; font-size: .75rem; color: #7c8aa5; border-top: 1px solid rgba(255, 255, 255, .06); }
.sidebar-backdrop { display: none; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 1020; height: 64px; display: flex; align-items: center; gap: .75rem;
  padding: 0 1.5rem; background: color-mix(in srgb, var(--app-bg) 82%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--app-border);
}
.topbar-search { position: relative; align-items: center; width: min(420px, 45vw); }
.topbar-search i { position: absolute; left: .8rem; color: var(--bs-secondary-color); }
.topbar-search .form-control { padding-left: 2.2rem; border-radius: 10px; background: var(--app-surface); border-color: var(--app-border); }
.dot-badge {
  position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: #ef4444; color: #fff; font-size: .62rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--app-bg);
}
.user-chip { display: flex; align-items: center; gap: .55rem; padding: .25rem .5rem .25rem .25rem; border-radius: 12px; border: 0; }
.user-chip:hover { background: var(--bs-tertiary-bg); }
[data-bs-theme="light"] .tema-claro-icono, [data-bs-theme="dark"] .tema-oscuro-icono { display: none; }

.dropdown-menu { border-color: var(--app-border); border-radius: 12px; }
.dropdown-notif { width: 360px; max-width: 92vw; padding: 0; overflow: hidden; }
.notif-item { display: flex; gap: .7rem; padding: .7rem 1rem; color: var(--bs-body-color); border-bottom: 1px solid var(--app-border); }
.notif-item:hover { background: var(--bs-tertiary-bg); color: var(--bs-body-color); }
.notif-item.no-leida { background: rgba(var(--app-primary-rgb), .05); }
.notif-item.no-leida .fw-semibold::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--app-primary); margin-right: 6px; vertical-align: middle; }
.notif-icon {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis);
}

.content { flex: 1; padding: 1.5rem; max-width: 1480px; width: 100%; margin: 0 auto; }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding: 1rem 1.5rem; font-size: .78rem; color: var(--bs-secondary-color); border-top: 1px solid var(--app-border); }

.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-title { font-size: 1.45rem; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.page-subtitle { color: var(--bs-secondary-color); margin-top: .2rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.breadcrumb { font-size: .8rem; --bs-breadcrumb-divider-color: var(--bs-secondary-color); }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .4); }
  .sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 1035; }
  .main { margin-left: 0; }
  .topbar { padding: 0 .75rem; }
  .content { padding: 1rem; }
}

/* ---------------------------------------------------------------------
   Componentes
   --------------------------------------------------------------------- */
.card { border-color: var(--app-border); border-radius: var(--app-radius); box-shadow: var(--app-shadow); background: var(--app-surface); }
.card-header { background: transparent; border-bottom-color: var(--app-border); padding: .9rem 1.1rem; font-weight: 600; }
.card-header:first-child { border-radius: var(--app-radius) var(--app-radius) 0 0; }
.card-footer { background: transparent; border-top-color: var(--app-border); }
.card-body { padding: 1.1rem; }
.card-title-sm { font-size: .95rem; font-weight: 600; margin: 0; }
.card-header .card-title-sm { display: flex; align-items: center; gap: .5rem; }

.avatar {
  display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 600;
  flex-shrink: 0; object-fit: cover; letter-spacing: .02em;
}

.stat-card { position: relative; overflow: hidden; display: block; color: inherit; height: 100%; container-type: inline-size; }
.stat-card .card-body { display: flex; align-items: center; gap: 1rem; }
.stat-icon {
  width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem;
}
/* El valor se adapta al ancho de la tarjeta para que los montos grandes quepan en una línea */
.stat-value { font-size: clamp(1rem, 6.8cqi, 1.5rem); font-weight: 700; line-height: 1.1; letter-spacing: -.02em; white-space: nowrap; }
.stat-label { color: var(--bs-secondary-color); font-size: .8rem; font-weight: 500; }
.stat-foot { font-size: .75rem; color: var(--bs-secondary-color); }
a.stat-card:hover { transform: translateY(-1px); color: inherit; box-shadow: 0 6px 22px rgba(15, 23, 42, .09); }
.ic-indigo { background: #eef2ff; color: #4f46e5; } .ic-emerald { background: #ecfdf5; color: #059669; }
.ic-amber { background: #fffbeb; color: #d97706; } .ic-rose { background: #fff1f2; color: #e11d48; }
.ic-sky { background: #f0f9ff; color: #0284c7; } .ic-violet { background: #f5f3ff; color: #7c3aed; }
.ic-slate { background: #f1f5f9; color: #475569; } .ic-teal { background: #f0fdfa; color: #0d9488; }
[data-bs-theme="dark"] .ic-indigo { background: rgba(99,102,241,.15); color: #a5b4fc; }
[data-bs-theme="dark"] .ic-emerald { background: rgba(16,185,129,.15); color: #6ee7b7; }
[data-bs-theme="dark"] .ic-amber { background: rgba(245,158,11,.15); color: #fcd34d; }
[data-bs-theme="dark"] .ic-rose { background: rgba(244,63,94,.15); color: #fda4af; }
[data-bs-theme="dark"] .ic-sky { background: rgba(14,165,233,.15); color: #7dd3fc; }
[data-bs-theme="dark"] .ic-violet { background: rgba(139,92,246,.15); color: #c4b5fd; }
[data-bs-theme="dark"] .ic-slate { background: rgba(148,163,184,.15); color: #cbd5e1; }
[data-bs-theme="dark"] .ic-teal { background: rgba(20,184,166,.15); color: #5eead4; }

/* Tablas */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .65rem .8rem; border-bottom-color: var(--app-border); }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; color: var(--bs-secondary-color); background: var(--bs-tertiary-bg); white-space: nowrap; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: rgba(var(--app-primary-rgb), .035); }
.table-card { border-radius: var(--app-radius); overflow: hidden; }
.table-card .table thead th:first-child { padding-left: 1.1rem; } .table-card .table td:first-child { padding-left: 1.1rem; }
.table-card .table thead th:last-child, .table-card .table td:last-child { padding-right: 1.1rem; }
.table-sm > :not(caption) > * > * { padding: .4rem .55rem; }
.td-acciones { white-space: nowrap; text-align: right; width: 1%; }
.persona { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.persona-nombre { font-weight: 600; color: var(--bs-body-color); }
a.persona:hover .persona-nombre { color: var(--app-primary); }
.persona-sub { font-size: .76rem; color: var(--bs-secondary-color); }

.filtros { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; }
.filtros .form-control, .filtros .form-select { min-width: 150px; }

.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--bs-secondary-color); }
.empty-state i { font-size: 2.4rem; display: block; margin-bottom: .5rem; opacity: .55; }

.nav-tabs-app { border-bottom: 1px solid var(--app-border); gap: .25rem; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.nav-tabs-app .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--bs-secondary-color); font-weight: 500; padding: .7rem .75rem; white-space: nowrap; border-radius: 0; }
.nav-tabs-app .nav-link:hover { color: var(--bs-body-color); text-decoration: none; }
.nav-tabs-app .nav-link.active { color: var(--app-primary); border-bottom-color: var(--app-primary); background: transparent; }
[data-bs-theme="dark"] .nav-tabs-app .nav-link.active { color: #a5b4fc; border-bottom-color: #818cf8; }

.pill-select { display: flex; flex-wrap: wrap; gap: .4rem; }
.pill-select a { padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--app-border); color: var(--bs-body-color); font-size: .83rem; background: var(--app-surface); }
.pill-select a.active { background: var(--app-primary); color: #fff; border-color: var(--app-primary); }

.info-list { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: .45rem 1rem; font-size: .88rem; margin: 0; }
.info-list dt { color: var(--bs-secondary-color); font-weight: 500; }
.info-list dd { margin: 0; word-break: break-word; }

.progress { background: var(--bs-tertiary-bg); }
.progress-thin { height: 6px; }

.list-clean { list-style: none; padding: 0; margin: 0; }
.list-clean > li { padding: .7rem 1.1rem; border-bottom: 1px solid var(--app-border); }
.list-clean > li:last-child { border-bottom: 0; }

.fecha-box { width: 48px; flex-shrink: 0; text-align: center; border-radius: 10px; background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); padding: .25rem 0; line-height: 1.1; }
.fecha-box .d { font-size: 1.1rem; font-weight: 700; } .fecha-box .m { font-size: .65rem; text-transform: uppercase; font-weight: 600; }

/* Aula virtual */
.clase-card { display: block; color: inherit; overflow: hidden; height: 100%; transition: transform .15s, box-shadow .15s; }
.clase-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(15, 23, 42, .1); color: inherit; }
.clase-card .banda { height: 86px; padding: 1rem 1.1rem; color: #fff; position: relative; background-size: cover; }
.clase-card .banda::after { content: ''; position: absolute; right: -18px; bottom: -30px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.clase-card .banda h3 { font-size: 1.05rem; font-weight: 700; margin: 0; position: relative; z-index: 1; }
.clase-card .banda div { font-size: .8rem; opacity: .9; position: relative; z-index: 1; }
.clase-banner { border-radius: var(--app-radius); color: #fff; padding: 1.5rem 1.6rem; margin-bottom: 1rem; position: relative; overflow: hidden; }
.clase-banner::after { content: ''; position: absolute; right: -40px; top: -40px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.clase-banner h1 { font-size: 1.6rem; font-weight: 700; margin: 0; position: relative; z-index: 1; }
.clase-banner .meta { opacity: .9; position: relative; z-index: 1; }

.post { border-radius: var(--app-radius); }
.adjunto { display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .75rem; border: 1px solid var(--app-border); border-radius: 10px; color: var(--bs-body-color); font-size: .85rem; background: var(--bs-tertiary-bg); max-width: 100%; }
.adjunto:hover { border-color: var(--bs-primary-border-subtle); color: var(--bs-body-color); }
.adjunto span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.item-actividad { display: flex; align-items: center; gap: .9rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--app-border); color: inherit; }
.item-actividad:last-child { border-bottom: 0; }
a.item-actividad:hover { background: var(--bs-tertiary-bg); color: inherit; }
.item-icono { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; }

/* Timeline */
.timeline { position: relative; padding-left: 1.6rem; }
.timeline::before { content: ''; position: absolute; left: .45rem; top: .3rem; bottom: .3rem; width: 2px; background: var(--app-border); }
.timeline-item { position: relative; padding-bottom: 1.1rem; }
.timeline-item::before { content: ''; position: absolute; left: -1.44rem; top: .3rem; width: 12px; height: 12px; border-radius: 50%; background: var(--app-surface); border: 3px solid var(--app-primary); }

/* Horario */
.horario { table-layout: fixed; min-width: 760px; }
.horario th, .horario td { text-align: center; vertical-align: middle; }
.horario .col-bloque { width: 118px; text-align: left; }
.horario .celda { border-radius: 8px; padding: .4rem .45rem; font-size: .78rem; line-height: 1.25; color: #fff; min-height: 46px; display: flex; flex-direction: column; justify-content: center; }
.horario .celda small { opacity: .9; font-size: .7rem; }
.horario .receso td { background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); font-size: .75rem; font-weight: 600; letter-spacing: .08em; }
.horario select.form-select { font-size: .78rem; padding: .3rem 1.6rem .3rem .45rem; }
.horario .conflicto { outline: 2px solid #ef4444; }

/* Calendario */
.calendario { table-layout: fixed; }
.calendario th { text-align: center; }
.calendario td { height: 112px; vertical-align: top; padding: .35rem !important; }
.calendario .num { font-size: .8rem; font-weight: 600; color: var(--bs-secondary-color); }
.calendario .hoy .num { background: var(--app-primary); color: #fff; border-radius: 50%; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; }
.calendario .fuera { background: var(--bs-tertiary-bg); opacity: .55; }
.calendario .ev { display: block; font-size: .7rem; padding: 2px 6px; margin-top: 3px; border-radius: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; }
.ev-academico { background: #4f46e5; } .ev-feriado { background: #dc2626; } .ev-reunion { background: #0891b2; }
.ev-actividad { background: #059669; } .ev-evaluacion { background: #d97706; } .ev-otro { background: #64748b; }
.ev-tarea { background: #7c3aed; } .ev-cita { background: #db2777; }

/* Cuaderno de notas */
.gradebook { font-size: .82rem; }
.gradebook th, .gradebook td { white-space: nowrap; vertical-align: middle; }
.gradebook .sticky-col { position: sticky; left: 0; background: var(--app-surface); z-index: 2; min-width: 220px; }
.gradebook thead .sticky-col { background: var(--bs-tertiary-bg); }
.gradebook input.nota { width: 64px; text-align: center; padding: .2rem .3rem; font-size: .82rem; }
.gradebook .act-head { max-width: 110px; white-space: normal; line-height: 1.2; text-transform: none; letter-spacing: 0; font-size: .74rem; }
.gradebook .total { font-weight: 700; }

/* Examen */
.pregunta { border-radius: var(--app-radius); }
.pregunta .opcion { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border: 1px solid var(--app-border); border-radius: 10px; margin-bottom: .4rem; cursor: pointer; }
.pregunta .opcion:hover { background: var(--bs-tertiary-bg); }
.pregunta .opcion.correcta { border-color: #10b981; background: rgba(16, 185, 129, .08); }
.pregunta .opcion.incorrecta { border-color: #ef4444; background: rgba(239, 68, 68, .08); }
.cronometro { position: sticky; top: 76px; z-index: 5; }

/* Autenticación */
.auth-body { background: var(--app-bg); }
.auth-wrap { min-height: 100vh; display: flex; }
.auth-hero {
  flex: 1.1; color: #fff; align-items: center; justify-content: center; padding: 3rem;
  background: radial-gradient(circle at 20% 20%, rgba(139, 92, 246, .55), transparent 45%), radial-gradient(circle at 85% 80%, rgba(14, 165, 233, .45), transparent 45%), linear-gradient(135deg, #1e1b4b, #312e81 55%, #1e3a8a);
}
.auth-hero-inner { max-width: 520px; }
.auth-logo { width: 56px; height: 56px; border-radius: 14px; background: #fff; padding: 4px; object-fit: contain; }
.auth-features li { display: flex; gap: .75rem; align-items: center; padding: .45rem 0; opacity: .92; }
.auth-features i { width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .12); display: inline-flex; align-items: center; justify-content: center; }
.auth-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 420px; }

/* Errores */
.error-icono { width: 84px; height: 84px; border-radius: 24px; margin: 0 auto; display: flex; align-items: center; justify-content: center; font-size: 2.3rem; background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); }

/* Alertas */
.alert { border-radius: 12px; }

/* ---------------------------------------------------------------------
   Manual de usuario (ayuda)
   --------------------------------------------------------------------- */
.manual { max-width: 880px; font-size: .95rem; }
.manual > :first-child { margin-top: 0; }
.manual h2 { font-size: 1.12rem; font-weight: 700; margin: 1.9rem 0 .7rem; padding-bottom: .35rem; border-bottom: 1px solid var(--bs-border-color); }
.manual h3 { font-size: 1rem; font-weight: 700; margin: 1.3rem 0 .5rem; }
.manual p, .manual li { line-height: 1.7; }
.manual ul { padding-left: 1.2rem; }
.manual ol.pasos { counter-reset: paso; list-style: none; padding-left: 0; margin-bottom: 1rem; }
.manual ol.pasos > li { counter-increment: paso; position: relative; padding: .1rem 0 .55rem 2.3rem; }
.manual ol.pasos > li::before { content: counter(paso); position: absolute; left: 0; top: .15rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); font-weight: 700; font-size: .8rem; display: flex; align-items: center; justify-content: center; }
.manual .nota, .manual .importante, .manual .verificar { border-left: 4px solid; border-radius: .5rem; padding: .7rem 1rem; margin: 1rem 0; }
.manual .nota { border-color: var(--bs-info); background: var(--bs-info-bg-subtle); }
.manual .importante { border-color: var(--bs-warning); background: var(--bs-warning-bg-subtle); }
.manual .verificar { border-color: var(--bs-success); background: var(--bs-success-bg-subtle); }
.manual .nota > :last-child, .manual .importante > :last-child, .manual .verificar > :last-child { margin-bottom: 0; }
.manual .verificar-titulo { font-weight: 700; margin-bottom: .3rem; }
.manual table.tabla-ayuda { width: 100%; border-collapse: collapse; margin: .75rem 0 1rem; font-size: .9rem; }
.manual table.tabla-ayuda th, .manual table.tabla-ayuda td { border: 1px solid var(--bs-border-color); padding: .4rem .6rem; vertical-align: top; }
.manual table.tabla-ayuda th { background: var(--bs-tertiary-bg); text-align: left; font-weight: 600; }
.ui-menu, .ui-btn, .ui-tab { display: inline-block; padding: 0 .4em; border-radius: .35rem; font-size: .88em; font-weight: 600; line-height: 1.6; }
.ui-menu { background: var(--bs-secondary-bg); border: 1px solid var(--bs-border-color); }
.ui-btn { background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); border: 1px solid var(--bs-primary-border-subtle); }
.ui-tab { border-bottom: 2px solid var(--bs-primary); border-radius: 0; padding: 0 .15em; }
.ui-campo { font-style: italic; }
.ayuda-indice .list-group-item { font-size: .88rem; }
.ayuda-indice .list-group-item.active { font-weight: 600; }
.tema-card { display: flex; gap: .85rem; align-items: flex-start; height: 100%; color: inherit; }
.tema-card:hover { color: inherit; box-shadow: 0 6px 22px rgba(15, 23, 42, .08); transform: translateY(-1px); }
.tema-card .tema-icono { width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); }
.verif-item { display: flex; gap: .75rem; align-items: flex-start; padding: .65rem .9rem; border-bottom: 1px solid var(--bs-border-color); }
.verif-item:last-child { border-bottom: 0; }
.verif-item.hecho .verif-texto { opacity: .6; }
.verif-item .form-check-input { margin-top: .3rem; flex-shrink: 0; }
.manual-portada { min-height: 230mm; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: .5rem; }
.manual-tema-impreso { break-before: page; page-break-before: always; }
.manual-tema-impreso:first-child { break-before: auto; page-break-before: auto; }
.manual-tema-impreso h1 { font-size: 1.35rem; font-weight: 700; color: #1e1b4b; border-bottom: 2px solid #1e1b4b; padding-bottom: .4rem; margin-bottom: 1rem; }
.print-body .manual { max-width: none; font-size: 12.5px; }
.print-body .manual .ui-menu, .print-body .manual .ui-btn { border: 1px solid #999; background: #f3f4f6; color: #111; }

/* ---------------------------------------------------------------------
   Impresión (boletas, recibos, constancias)
   --------------------------------------------------------------------- */
.print-body { background: #e5e7eb; color: #111; font-size: 13px; }
.print-toolbar { position: sticky; top: 0; z-index: 10; display: flex; gap: .5rem; justify-content: center; padding: .75rem; background: rgba(229, 231, 235, .92); backdrop-filter: blur(6px); }
.hoja { background: #fff; width: 216mm; min-height: 279mm; margin: 0 auto 2rem; padding: 14mm 16mm; box-shadow: 0 4px 24px rgba(0, 0, 0, .12); }
.hoja-horizontal { width: 279mm; min-height: 216mm; }
.membrete { display: flex; align-items: center; gap: 14px; border-bottom: 2px solid #1e1b4b; padding-bottom: 10px; margin-bottom: 16px; }
.membrete-logo { width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; color: #4338ca; flex-shrink: 0; }
.membrete-logo img { max-width: 64px; max-height: 64px; object-fit: contain; }
.membrete-nombre { font-size: 1.25rem; font-weight: 700; color: #1e1b4b; text-transform: uppercase; letter-spacing: .02em; }
.membrete-lema { font-style: italic; font-size: .8rem; color: #555; }
.membrete-datos { font-size: .75rem; color: #444; }
.doc-titulo { text-align: center; font-size: 1.1rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin: 10px 0 16px; }
.doc-texto { font-size: 14px; line-height: 1.9; text-align: justify; }
.firmas { display: flex; justify-content: space-around; gap: 2rem; margin-top: 70px; }
.firma { text-align: center; min-width: 200px; border-top: 1px solid #333; padding-top: 6px; font-size: .8rem; }
.tabla-doc { width: 100%; border-collapse: collapse; font-size: 12px; }
.tabla-doc th, .tabla-doc td { border: 1px solid #555; padding: 4px 6px; }
.tabla-doc th { background: #eef2ff; text-align: center; font-weight: 600; }
.recibo { max-width: 170mm; margin: 0 auto; }
@media print {
  .no-print, .print-toolbar { display: none !important; }
  .print-body { background: #fff; }
  .hoja { box-shadow: none; margin: 0; padding: 0; width: auto; min-height: 0; }
  a { color: inherit; text-decoration: none; }
  .tabla-doc th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
