/* ============================================================
   SAEP · global.css
   Tokens, reset, componentes compartidos por todas las páginas
   ============================================================ */

/* Fonts are loaded in the HTML via Google Fonts link */

/* ── Tokens ── */
:root {
  /* Paleta principal (Actualizada según DESIGN.md) */
  --navy: #003d9b;
  /* primary */
  --navy-dark: #00215e;
  /* on-primary-fixed / darker */
  --navy-light: #0052cc;
  /* primary-container */
  --navy-faint: #dae2ff;
  /* primary-fixed */

  /* Semánticos (Actualizados según DESIGN.md) */
  --red: #ba1a1a;
  /* error */
  --red-dim: #ffdad6;
  /* error-container */
  --green: #006e2f;
  /* secondary */
  --green-dim: #b6fbc8;
  /* lighter green */
  --amber: #805000;
  /* tertiary-container */
  --amber-dim: #ffddb8;
  /* tertiary-fixed */
  --blue: #0c56d0;
  /* surface-tint */
  --blue-dim: rgba(12, 86, 208, 0.1);

  /* Orientaciones */
  --o-prog: #0c56d0;
  --o-mmo: #ba1a1a;
  --o-tur: #006e2f;
  --o-cb: #805000;

  /* UI */
  --bg: #faf8ff;
  /* surface */
  --surface: #faf8ff;
  --surface-container-low: #eff0fa;
  /* tonal layer for active states */
  --white: #ffffff;
  /* surface-container-lowest */
  --border: #e1e2ec;
  /* outline-variant */
  --outline: #737685;
  --text: #191b23;
  /* on-surface */
  --text2: #434654;
  /* on-surface-variant */
  --muted: #737685;

  /* Aliases */
  --primary: var(--navy);

  /* Tipografía y forma */
  --font: 'DM Sans', 'Inter', sans-serif;
  --font-display: 'Playfair Display', serif;
  --radius: 8px;
  /* inputs, buttons */
  --radius-card: 16px;
  /* stat cards, containers */

  /* Sombras Premium Ambient */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  /* Level 1 */
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  /* Level 2 */
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

.theme-light {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-container-low: #f6f8ff;
  --white: #ffffff;
  --border: #dde3ef;
  --outline: #737a91;
  --text: #111827;
  --text2: #4b5563;
  --muted: #6b7280;
}

/* ── Modo oscuro ── */
.theme-dark {
  --bg: #0b0f17;
  --surface: #141a24;
  --surface-container-low: #1c2333;
  --white: #141a24;
  --border: #263147;
  --outline: #8f9bb8;
  --text: #f1f5f9;
  --text2: #cbd5e1;
  --muted: #94a3b8;
  --navy: #7b9fff;
  --navy-dark: #5a7fe6;
  --navy-light: #a8c0ff;
  --navy-faint: #1e2d4a;
  --primary: var(--navy);
  color-scheme: dark;
}

/* ── Colores de acento (independientes del modo) ── */
.theme-red {
  --navy: #e03535;
  --navy-dark: #b52020;
  --navy-light: #f07070;
  --navy-faint: #fdecea;
  --primary: var(--navy);
}

.theme-dark.theme-red {
  --navy: #ff6b6b;
  --navy-dark: #e04545;
  --navy-light: #ffa5a5;
  --navy-faint: #2e1a1a;
}

.theme-yellow {
  --navy: #c47f00;
  --navy-dark: #8f5c00;
  --navy-light: #f0a800;
  --navy-faint: #fff8e1;
  --primary: var(--navy);
}

.theme-dark.theme-yellow {
  --navy: #f0b429;
  --navy-dark: #c88f00;
  --navy-light: #ffd06b;
  --navy-faint: #2c2100;
}

.theme-green {
  --navy: #1a7a40;
  --navy-dark: #0f5429;
  --navy-light: #34a85a;
  --navy-faint: #e6f7ec;
  --primary: var(--navy);
}

.theme-dark.theme-green {
  --navy: #4cca7c;
  --navy-dark: #29a855;
  --navy-light: #84e0a8;
  --navy-faint: #0d2818;
}

.theme-blue {
  --navy: #1a5fc8;
  --navy-dark: #1045a0;
  --navy-light: #4080e8;
  --navy-faint: #eaf0ff;
  --primary: var(--navy);
}

.theme-dark.theme-blue {
  --navy: #6699ff;
  --navy-dark: #4477e6;
  --navy-light: #99bbff;
  --navy-faint: #0e1e3a;
}

.theme-purple {
  --navy: #7c3aed;
  --navy-dark: #5b21b6;
  --navy-light: #a78bfa;
  --navy-faint: #f5f3ff;
  --primary: var(--navy);
}

.theme-dark.theme-purple {
  --navy: #a78bfa;
  --navy-dark: #7c5ce6;
  --navy-light: #c4b5fd;
  --navy-faint: #1e1333;
}

/* Headings use Playfair Display for a more elegant serif */
h1,h2,h3,h4,h5,h6,
.hdr-brand, .sec-t, .hero h1, .tile-lbl {
  font-family: var(--font-display);
}

/* ── Tamaño de fuente ── */
.font-sm {
  font-size: 12px;
}

.font-md {
  font-size: 14px;
}

.font-lg {
  font-size: 16px;
}

/* ── Espaciado compacto ── */
.compact .pb {
  padding: 0.75rem 1rem;
}

.compact .ph {
  padding: 0.75rem 1rem;
}

.compact .stats {
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.compact .stat {
  padding: 0.75rem 1rem;
}

.compact .dash-stat-card {
  padding: 1rem;
}

.compact .dash-stats-grid {
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* ── Sin animaciones ── */
.no-anim *,
.no-anim *::before,
.no-anim *::after {
  animation-duration: 0ms !important;
  transition-duration: 0ms !important;
}

/* ── Reset ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font);
  color: var(--text);
  font-size: 14px;
  overflow-x: hidden;
}

button {
  font-family: var(--font);
  cursor: pointer;
}

input,
select,
textarea {
  font-family: var(--font);
}

a {
  text-decoration: none;
}

/* Accesibilidad */
.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  background: var(--navy);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  z-index: 9999;
  text-decoration: none;
  transition: top .15s;
}

.skip-link:focus {
  top: 8px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

*:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ── Botones ── */
.btn {
  font-family: var(--font);
  font-size: .78rem;
  font-weight: 600;
  padding: .45rem .9rem;
  border-radius: var(--radius);
  border: 1px solid;
  cursor: pointer;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.btn-navy {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.btn-navy:hover {
  background: var(--navy-dark);
}

.btn-outline {
  background: #fff;
  border-color: var(--border);
  color: var(--text2);
}

.btn-outline:hover {
  border-color: var(--navy);
  color: var(--navy);
}

.btn-red {
  background: #fff;
  border-color: var(--red);
  color: var(--red);
}

.btn-red:hover {
  background: var(--red-dim);
}

.btn-green {
  background: #fff;
  border-color: var(--green);
  color: var(--green);
}

.btn-green:hover {
  background: var(--green-dim);
}

.btn-amber {
  background: #fff;
  border-color: var(--amber);
  color: var(--amber);
}

.btn-amber:hover {
  background: var(--amber-dim);
}

.btn-group {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.theme-options {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}

.theme-swatch {
  font-family: var(--font);
  border: 2px solid var(--border);
  background: var(--white);
  color: var(--text2);
  border-radius: var(--radius);
  padding: .6rem 1rem;
  cursor: pointer;
  transition: all .18s ease;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .78rem;
  font-weight: 500;
  white-space: nowrap;
}

.theme-swatch:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--navy-faint);
}

.theme-swatch.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

/* Color swatches con dot indicator */
.theme-swatch .swatch-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.theme-swatch.red .swatch-dot {
  background: #e03535;
}

.theme-swatch.yellow .swatch-dot {
  background: #c47f00;
}

.theme-swatch.green .swatch-dot {
  background: #1a7a40;
}

.theme-swatch.blue .swatch-dot {
  background: #1a5fc8;
}

.theme-swatch.purple .swatch-dot {
  background: #7c3aed;
}

.theme-swatch.navy .swatch-dot {
  background: #003d9b;
}

.settings-note {
  font-size: .82rem;
  color: var(--muted);
  margin-top: .75rem;
}

/* ── Settings cards ── */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 720px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }

  /* Modal al 95% en mobile */
  .modal {
    width: 95vw !important;
    max-width: 95vw !important;
    padding: 1.25rem;
    border-radius: 12px;
  }
}

.settings-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.25rem 1.4rem;
}

.settings-card-wide {
  grid-column: 1 / -1;
}

.settings-card h4 {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 1rem;
}

.settings-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.settings-summary-text {
  color: var(--text2);
  font-size: .82rem;
  line-height: 1.4;
}

.settings-modal-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(250px, 1fr));
  gap: 1rem;
}

.settings-modal-layout-extra {
  margin-top: 1rem;
}

.modal-card {
  background: var(--white);
  border-radius: var(--radius-card);
}

.modal-menu-customization {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.menu-custom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .65rem .75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-container-low);
}

.menu-custom-label {
  flex: 1;
  font-size: .78rem;
  font-weight: 700;
  color: var(--text2);
}

.menu-order-actions {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.compact-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text2);
}

.compact-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.settings-preview-surface {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  background: var(--surface-container-low);
  border-radius: var(--radius-card);
  border: 1px dashed var(--border);
}

.mini-sidebar-preview {
  width: min(230px, 90%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem;
}

.mini-sidebar-header {
  font-weight: 800;
  color: var(--primary);
  margin-bottom: .75rem;
}

.mini-sidebar-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: .4rem;
}

.mini-sidebar-item {
  color: var(--text2);
  font-size: .75rem;
  padding: .45rem .55rem;
  border-radius: 6px;
}

.mini-sidebar-item.active {
  background: var(--surface-container-low);
  color: var(--primary);
}

.quick-list {
  display: grid;
  gap: .55rem;
  margin-top: .5rem;
}

.quick-option {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .78rem;
  color: var(--text2);
}

.settings-note {
  margin-top: .85rem;
  font-size: .69rem;
  color: var(--muted);
}

/* Toggle switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .6rem 0;
  border-bottom: 1px solid var(--border);
}

.toggle-row:last-child {
  border-bottom: none;
}

.toggle-label {
  font-size: .82rem;
  color: var(--text);
  font-weight: 500;
}

.toggle-desc {
  font-size: .72rem;
  color: var(--muted);
  margin-top: .15rem;
}

.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 22px;
  cursor: pointer;
  transition: background .2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  left: 3px;
  top: 3px;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}

.toggle input:checked+.toggle-slider {
  background: var(--primary);
}

.toggle input:checked+.toggle-slider::before {
  transform: translateX(18px);
}

/* Font size buttons */
.font-size-options {
  display: flex;
  gap: .5rem;
}

.font-size-btn {
  flex: 1;
  border: 2px solid var(--border);
  background: var(--white);
  color: var(--text2);
  border-radius: var(--radius);
  padding: .5rem;
  cursor: pointer;
  font-family: var(--font);
  font-weight: 600;
  text-align: center;
  transition: all .15s;
}

.font-size-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.font-size-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

/* Mode swatches with icons */
.mode-options {
  display: flex;
  gap: .65rem;
}

.mode-swatch {
  flex: 1;
  border: 2px solid var(--border);
  background: var(--white);
  color: var(--text2);
  border-radius: var(--radius);
  padding: .75rem .5rem;
  cursor: pointer;
  font-family: var(--font);
  font-size: .78rem;
  font-weight: 500;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  transition: all .18s;
}

.mode-swatch svg {
  opacity: .7;
  transition: opacity .15s;
}

.mode-swatch:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.mode-swatch:hover svg {
  opacity: 1;
}

.mode-swatch.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.mode-swatch.active svg {
  opacity: 1;
}

/* Color swatch grid */
.color-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
}

.color-swatch {
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: .6rem .5rem;
  cursor: pointer;
  font-family: var(--font);
  font-size: .75rem;
  font-weight: 600;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  transition: all .18s;
  background: var(--bg);
}

.color-swatch .swatch-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.color-swatch.active {
  box-shadow: 0 0 0 2px var(--white), 0 0 0 4px currentColor;
}

.color-swatch.c-navy {
  color: #003d9b;
  border-color: #003d9b22;
}

.color-swatch.c-navy .swatch-dot {
  background: #003d9b;
}

.color-swatch.c-navy.active {
  background: #003d9b;
  color: #fff;
}

.color-swatch.c-red {
  color: #e03535;
  border-color: #e0353522;
}

.color-swatch.c-red .swatch-dot {
  background: #e03535;
}

.color-swatch.c-red.active {
  background: #e03535;
  color: #fff;
}

.color-swatch.c-yellow {
  color: #c47f00;
  border-color: #c47f0022;
}

.color-swatch.c-yellow .swatch-dot {
  background: #c47f00;
}

.color-swatch.c-yellow.active {
  background: #c47f00;
  color: #fff;
}

.color-swatch.c-green {
  color: #1a7a40;
  border-color: #1a7a4022;
}

.color-swatch.c-green .swatch-dot {
  background: #1a7a40;
}

.color-swatch.c-green.active {
  background: #1a7a40;
  color: #fff;
}

.color-swatch.c-blue {
  color: #1a5fc8;
  border-color: #1a5fc822;
}

.color-swatch.c-blue .swatch-dot {
  background: #1a5fc8;
}

.color-swatch.c-blue.active {
  background: #1a5fc8;
  color: #fff;
}

.color-swatch.c-purple {
  color: #7c3aed;
  border-color: #7c3aed22;
}

.color-swatch.c-purple .swatch-dot {
  background: #7c3aed;
}

.color-swatch.c-purple.active {
  background: #7c3aed;
  color: #fff;
}

/* Live preview bar */
.settings-preview {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--navy-faint);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  margin-top: 1rem;
}

.settings-preview-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.settings-preview-text {
  font-size: .8rem;
  color: var(--text2);
  line-height: 1.4;
}

.settings-preview-text strong {
  color: var(--primary);
  font-weight: 700;
}

/* ── Badges ── */
.badge {
  font-size: .68rem;
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: 20px;
}

.badge-green {
  background: var(--green-dim);
  color: var(--green);
}

.badge-red {
  background: var(--red-dim);
  color: var(--red);
}

.badge-amber {
  background: var(--amber-dim);
  color: var(--amber);
}

.badge-blue {
  background: var(--blue-dim);
  color: var(--blue);
}

.badge-gray {
  background: #f3f4f6;
  color: var(--muted);
}

/* ── Tabla ── */
.tbl-wrap {
  overflow-x: auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}

th {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--muted);
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  text-transform: uppercase;
  background: var(--surface-container-low);
}

td {
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--surface-container-low);
}

.tbl-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.td-act {
  display: flex;
  gap: .35rem;
  align-items: center;
}

/* ── Formularios ── */
.fgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

.ffull {
  grid-column: 1 / -1;
}

.field label {
  display: block;
  font-size: .7rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: .3rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .55rem .75rem;
  font-family: var(--font);
  font-size: .82rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--navy);
}

.field select {
  cursor: pointer;
}

.field textarea {
  resize: vertical;
  min-height: 80px;
}

.modal {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .38);
}

.modal-header {
  border-bottom-color: var(--border);
}

.modal-footer {
  border-top-color: var(--border);
}

.badge-gray {
  background: var(--surface-container-low);
  color: var(--text2);
}


.inline-form {
  display: flex;
  gap: .5rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.inline-form .field {
  flex: 1;
  min-width: 140px;
}

.err-msg {
  color: var(--red);
  font-size: .75rem;
  margin-top: .5rem;
  display: none;
}

/* ── Modal ── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fi .15s ease;
  padding: 1rem;
}

.modal {
  background: var(--white);
  border-radius: 6px;
  padding: 1.75rem;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
}

.modal h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}

.modal-footer {
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
}

/* ── Tabs ── */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.25rem;
  overflow-x: auto;
}

.tab {
  font-size: .8rem;
  font-weight: 500;
  padding: .6rem 1rem;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
  white-space: nowrap;
}

.tab:hover {
  color: var(--navy);
}

.tab.active {
  color: var(--navy);
  border-bottom-color: var(--navy);
  font-weight: 600;
}

.tab-content {
  display: none;
}

.tab-content.visible {
  display: block;
}

/* ── Utilitarios ── */
.empty {
  text-align: center;
  color: var(--muted);
  font-size: .82rem;
  padding: 2.5rem;
}

.mb1 {
  margin-bottom: .85rem;
}

.section-title {
  font-size: .85rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .75rem;
}

.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  font-size: .8rem;
  margin-bottom: .85rem;
}

.alert-amber {
  background: var(--amber-dim);
  border: 1px solid var(--amber);
  color: var(--amber);
}

@keyframes fi {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal: bottom sheet en pantallas pequeñas */
@media (max-width: 480px) {
  .overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    width: 100vw !important;
    max-width: 100vw !important;
    border-radius: 16px 16px 0 0;
    max-height: 92vh;
  }
}

/* ============================================================
   SAEP · Cookie Consent Banner
   ============================================================ */

#cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(calc(100% + 32px));
  z-index: 9999;
  width: min(680px, calc(100vw - 32px));
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.35s ease;
  pointer-events: none;
}

#cookie-banner.cb-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.cb-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,.04);
  position: relative;
}

.cb-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy-faint);
  color: var(--primary);
  border-radius: 50%;
}

.cb-text {
  flex: 1;
  min-width: 0;
}

.cb-title {
  font-family: var(--font);
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 2px;
}

.cb-desc {
  font-family: var(--font);
  font-size: .78rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
}

.cb-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.cb-btn {
  font-family: var(--font);
  font-size: .8rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
}

.cb-btn--primary {
  background: var(--primary);
  color: #fff;
}
.cb-btn--primary:hover {
  background: var(--navy-dark);
  box-shadow: 0 2px 8px rgba(0,61,155,.25);
}

.cb-btn--secondary {
  background: var(--surface-container-low);
  color: var(--text2);
  border: 1px solid var(--border);
}
.cb-btn--secondary:hover {
  background: var(--border);
}

.cb-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 50%;
  transition: background .15s, color .15s;
}
.cb-close:hover {
  background: var(--border);
  color: var(--text);
}

/* Mobile */
@media (max-width: 600px) {
  #cookie-banner {
    bottom: 16px;
  }

  .cb-inner {
    flex-wrap: wrap;
    padding: 14px 16px 12px;
    gap: 10px;
  }

  .cb-icon { display: none; }

  .cb-actions {
    width: 100%;
  }

  .cb-btn {
    flex: 1;
    text-align: center;
  }
}

/* ── Ajustes para tamaño de fuente grande (.font-lg) ── */
.font-lg .cards {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
@media (min-width: 1200px) {
  .font-lg .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.font-lg .data-cards-grid {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
@media (min-width: 1200px) {
  .font-lg .data-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.font-lg .reservas-grid {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
@media (min-width: 1200px) {
  .font-lg .reservas-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.font-lg .dash-stats-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
@media (min-width: 1200px) {
  .font-lg .dash-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.font-lg .stats {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.font-lg .kpi-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.font-lg .stats-strip {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
