/*
 * Módulo: Estilos Globales — Metrofrenos Elite
 * Descripción: Variables CSS, reset, sistema de diseño completo.
 *              Componentes reutilizables en todo el frontend:
 *              tipografía, botones, cards, badges, formularios,
 *              navbar, sidebar, toasts, modales, tablas y utilidades.
 * Autor: Horeb Apps
 * Fecha: 2024-06-15
 */

/* ══════════════════════════════════════════════════════════
   1. GOOGLE FONTS
══════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Barlow+Condensed:wght@600;700&family=Inter:wght@300;400;500;600;700&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* ══════════════════════════════════════════════════════════
   2. VARIABLES CSS
══════════════════════════════════════════════════════════ */
:root {
  /* ── Paleta oficial Metrofrenos ───────────────────────────────────────────
     Azul predominante (64%), Amarillo de acción, Negro de marca, Blanco, Gris
  ── */

  /* Azules de marca */
  --azul-principal:   #00468C;  /* Azul primario — navbar, headers     */
  --azul-secundario:  #0071B6;  /* Azul claro — acentos, links         */
  --azul-oscuro:      #002C55;  /* Azul oscuro — fondo principal        */

  /* Amarillo de acción */
  --amarillo:         #F4D862;  /* Acción principal — botones, badges   */
  --amarillo-dark:    #d4b83e;  /* Hover del amarillo                   */
  --amarillo-light:   #f8e48a;  /* Amarillo suave                       */

  /* Neutros de marca */
  --negro:            #211915;  /* Negro marca — texto sobre amarillo   */
  --blanco:           #FFFFFF;
  --gris:             #AEADB3;  /* Gris complementario                  */
  --gris-dark:        #7a7980;

  /* Alias de compatibilidad (los componentes siguen usando --gold) */
  --gold:             #F4D862;  /* ← alias de --amarillo                */
  --gold-light:       #f8e48a;  /* ← alias de --amarillo-light          */
  --gold-dark:        #d4b83e;  /* ← alias de --amarillo-dark           */
  --azul:             #00468C;  /* ← alias de --azul-principal          */
  --azul-light:       #0071B6;  /* ← alias de --azul-secundario         */
  --azul-primario:    #00468C;  /* ← alias de --azul-principal          */

  /* Fondo y superficies — todos en tono azul oscuro */
  --bg:               #002C55;  /* Fondo principal                      */
  --bg-card:          #003469;  /* Superficie card                      */
  --bg-elevated:      #003f80;  /* Elemento elevado (modal, dropdown)   */
  --bg-input:         #001d3d;  /* Input field (sunken)                 */
  --bg-hover:         #004a9a;  /* Hover state                          */
  --border:           rgba(0, 113, 182, 0.28);  /* Borde sutil          */
  --border-gold:      rgba(244, 216, 98, 0.35); /* Borde acento         */

  /* Texto */
  --text-primary:     #ffffff;
  --text-secondary:   #AEADB3;  /* Gris de marca                        */
  --text-muted:       rgba(174, 173, 179, 0.55);
  --text-gold:        #F4D862;  /* ← texto en color amarillo            */

  /* Estado */
  --exito:         #22c55e;
  --exito-bg:      rgba(34, 197, 94, 0.15);
  --advertencia:   #f59e0b;
  --advertencia-bg:rgba(245, 158, 11, 0.15);
  --error:         #ef4444;
  --error-bg:      rgba(239, 68, 68, 0.15);
  --info:          #60a5fa;
  --info-bg:       rgba(96, 165, 250, 0.15);

  /* Tipografía */
  --font-titulo:   'Bebas Neue', 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-cuerpo:   'Inter', 'DM Sans', 'Segoe UI', sans-serif;

  /* Espaciado */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-14: 56px;

  /* Bordes */
  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-full:9999px;

  /* Sombras */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow:     0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.6);
  --shadow-gold:0 4px 20px rgba(244,216,98,0.22);

  /* Transiciones */
  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;

  /* Layout */
  --sidebar-w:  260px;
  --navbar-h:   64px;
  --bottomnav-h:68px;
  --container:  1200px;
}

/* ══════════════════════════════════════════════════════════
   3. RESET Y BASE
══════════════════════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-cuerpo);
  background-color: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-light); }
button { cursor: pointer; font-family: var(--font-cuerpo); }
input, select, textarea { font-family: var(--font-cuerpo); }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 { line-height: 1.2; }

/* ══════════════════════════════════════════════════════════
   4. TIPOGRAFÍA
══════════════════════════════════════════════════════════ */
.titulo-xl  { font-family: var(--font-titulo); font-size: clamp(2.5rem, 6vw, 4.5rem); letter-spacing: 1px; }
.titulo-lg  { font-family: var(--font-titulo); font-size: clamp(2rem, 4vw, 3rem); letter-spacing: 1px; }
.titulo-md  { font-family: var(--font-titulo); font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: 0.5px; }
.titulo-sm  { font-family: var(--font-titulo); font-size: 1.25rem; letter-spacing: 0.5px; }

.texto-lg   { font-size: 1.125rem; }
.texto-sm   { font-size: 0.875rem; }
.texto-xs   { font-size: 0.75rem; }

.texto-gold      { color: var(--gold); }
.texto-gris      { color: var(--text-secondary); }
.texto-muted     { color: var(--text-muted); }
.texto-exito     { color: var(--exito); }
.texto-error     { color: var(--error); }
.texto-advertencia { color: var(--advertencia); }

.peso-300   { font-weight: 300; }
.peso-400   { font-weight: 400; }
.peso-500   { font-weight: 500; }
.peso-600   { font-weight: 600; }
.peso-700   { font-weight: 700; }

/* ══════════════════════════════════════════════════════════
   5. LAYOUT — PÁGINA CLIENTE
══════════════════════════════════════════════════════════ */

/* Wrapper principal — reserva espacio para bottom nav en móvil */
.page-wrapper {
  min-height: 100vh;
  padding-bottom: var(--bottomnav-h);
}

/* Área de contenido principal */
.main-content {
  padding: var(--sp-4);
  max-width: var(--container);
  margin: 0 auto;
}

/* Encabezado de página con título + acción */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
  padding-top: var(--sp-4);
}

.page-title {
  font-family: var(--font-titulo);
  font-size: 1.75rem;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

/* ══════════════════════════════════════════════════════════
   6. LAYOUT — PÁGINA ADMIN
══════════════════════════════════════════════════════════ */

/* Wrapper admin: sidebar fija + contenido a la derecha */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Zona de contenido del admin */
.admin-main {
  flex: 1;
  min-width: 0;
  padding: var(--sp-6);
  background: var(--bg);
}

@media (min-width: 768px) {
  .admin-main {
    margin-left: var(--sidebar-w);
  }
}

/* ══════════════════════════════════════════════════════════
   7. NAVBAR — BARRA SUPERIOR (CLIENTE DESKTOP)
══════════════════════════════════════════════════════════ */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--navbar-h);
  background: var(--azul-principal);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-5);
  gap: var(--sp-4);
}

.navbar-brand {
  font-family: var(--font-titulo);
  font-size: 1.5rem;
  color: var(--gold);
  letter-spacing: 2px;
  white-space: nowrap;
}

.navbar-brand span {
  color: var(--text-secondary);
  font-size: 0.65rem;
  display: block;
  letter-spacing: 3px;
  font-family: var(--font-cuerpo);
  font-weight: 300;
  margin-top: -2px;
}

.navbar-spacer { flex: 1; }

.navbar-user {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  cursor: pointer;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius);
  transition: background var(--transition);
}

.navbar-user:hover { background: var(--bg-hover); }

.navbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gold);
  overflow: hidden;
}

.navbar-avatar img { width: 100%; height: 100%; object-fit: cover; }

.navbar-username {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  display: none;
}

@media (min-width: 480px) {
  .navbar-username { display: block; }
}

/* ══════════════════════════════════════════════════════════
   8. NAVEGACIÓN INFERIOR (CLIENTE MOBILE)
══════════════════════════════════════════════════════════ */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--bottomnav-h);
  background: rgba(0, 44, 85, 0.97);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(0, 113, 182, 0.3);
  display: flex;
  align-items: stretch;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: var(--sp-2) var(--sp-1);
  color: var(--text-muted);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  transition: color var(--transition);
  position: relative;
  text-decoration: none;
}

.bottom-nav-item svg {
  width: 22px;
  height: 22px;
  transition: transform var(--transition);
}

.bottom-nav-item.activo {
  color: var(--gold);
}

.bottom-nav-item.activo::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 2px;
  background: var(--gold);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.bottom-nav-item.activo svg {
  transform: translateY(-2px);
}

/* ══════════════════════════════════════════════════════════
   9. SIDEBAR ADMIN
══════════════════════════════════════════════════════════ */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  z-index: 200;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform var(--transition-slow);
  overflow-y: auto;
}

.sidebar.abierto { transform: translateX(0); }

@media (min-width: 768px) {
  .sidebar { transform: translateX(0); }
}

/* Overlay que cierra el sidebar en móvil */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 199;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.visible { display: block; }

/* Encabezado del sidebar */
.sidebar-header {
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  font-family: var(--font-titulo);
  font-size: 1.4rem;
  color: var(--gold);
  letter-spacing: 2px;
}

.sidebar-logo span {
  display: block;
  font-family: var(--font-cuerpo);
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Sección de navegación en el sidebar */
.sidebar-section {
  padding: var(--sp-3) var(--sp-3);
}

.sidebar-section-label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  padding: var(--sp-2) var(--sp-3);
  margin-bottom: var(--sp-1);
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-3);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 400;
  transition: all var(--transition);
  text-decoration: none;
  margin-bottom: 2px;
}

.sidebar-nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-nav-item:hover svg { opacity: 1; }

.sidebar-nav-item.activo {
  background: rgba(197, 160, 89, 0.12);
  color: var(--gold);
  font-weight: 500;
}

.sidebar-nav-item.activo svg { opacity: 1; color: var(--gold); }

/* Footer del sidebar con info del usuario */
.sidebar-footer {
  margin-top: auto;
  padding: var(--sp-4);
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.sidebar-user-info { flex: 1; min-width: 0; }

.sidebar-user-name {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.7rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Botón hamburger para abrir sidebar en móvil */
.btn-sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  transition: all var(--transition);
}

.btn-sidebar-toggle:hover { background: var(--bg-hover); border-color: var(--gold); }

@media (min-width: 768px) {
  .btn-sidebar-toggle { display: none; }
}

/* ══════════════════════════════════════════════════════════
   9b. LAYOUT — CONTENIDO CLIENTE (espejo de .admin-main)
══════════════════════════════════════════════════════════ */

/* .client-main es el equivalente de .admin-main para el área cliente.
   nav-cliente.js envuelve todo el contenido en este div tras inyectar la sidebar. */
.client-main {
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

@media (min-width: 768px) {
  .client-main { margin-left: var(--sidebar-w); }
}

/* ── Sidebar colapsada — solo iconos (64px) ────────────────────────────── */
/* La clase .sidebar.colapsada se aplica al aside#sidebar-cliente y al aside#sidebar.
   La clase body.sidebar-colapsada actualiza los márgenes del contenido. */

.sidebar.colapsada {
  width: 64px;
  overflow: hidden;
}

/* Ocultar texto cuando está colapsada */
.sidebar.colapsada .sidebar-logo-marca,
.sidebar.colapsada .sidebar-logo-sub,
.sidebar.colapsada .sidebar-seccion,
.sidebar.colapsada .sidebar-nav-label,
.sidebar.colapsada .sidebar-usuario-info,
.sidebar.colapsada .sidebar-colapsar-txt { display: none; }

/* Centrar íconos cuando está colapsada */
.sidebar.colapsada .sidebar-nav-item {
  justify-content: center;
  padding: 12px;
  border-left: none;
}

.sidebar.colapsada .sidebar-footer { padding: var(--sp-3); }

.sidebar.colapsada .sidebar-logo { padding: var(--sp-4) var(--sp-3); }

/* Botón de colapsar — visible dentro del sidebar */
.sidebar-colapsar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-3) var(--sp-5);
  background: transparent;
  border: none;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-cuerpo);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: left;
}

.sidebar-colapsar svg { width: 18px; height: 18px; flex-shrink: 0; transition: transform 0.3s ease; }
.sidebar-colapsar:hover { background: var(--bg-hover); color: var(--text-primary); }

/* Rotar chevron cuando está colapsada */
.sidebar.colapsada .sidebar-colapsar { padding: 12px; justify-content: center; border-top: 1px solid var(--border); }
.sidebar.colapsada .sidebar-colapsar svg { transform: rotate(180deg); }

/* Ajuste de márgenes cuando el sidebar está colapsado */
@media (min-width: 768px) {
  body.sidebar-colapsada .admin-main  { margin-left: 64px; }
  body.sidebar-colapsada .client-main { margin-left: 64px; }
}

/* ══════════════════════════════════════════════════════════
   9c. INPUTS GLOBALES — ESTILO OSCURO GARANTIZADO
══════════════════════════════════════════════════════════ */

/* Aplica estilo oscuro a TODOS los campos dentro de las áreas de contenido.
   Esto evita que el UA stylesheet del navegador muestre inputs blancos
   independientemente de si se usa .form-input, .form-control, o ninguna clase. */
.main-content input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]),
.main-content select,
.main-content textarea,
.admin-content input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]),
.admin-content select,
.admin-content textarea,
.modal-box input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]),
.modal-box select,
.modal-box textarea,
.form-seccion input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]),
.form-seccion select,
.form-seccion textarea {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-cuerpo);
  font-size: 0.9rem;
  padding: 11px var(--sp-4);
  outline: none;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.main-content input:focus,
.main-content select:focus,
.main-content textarea:focus,
.admin-content input:focus,
.admin-content select:focus,
.admin-content textarea:focus,
.modal-box input:focus,
.modal-box select:focus,
.modal-box textarea:focus,
.form-seccion input:focus,
.form-seccion select:focus,
.form-seccion textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(244,216,98,0.12);
}

.main-content input::placeholder,
.main-content textarea::placeholder,
.admin-content input::placeholder,
.admin-content textarea::placeholder,
.modal-box input::placeholder,
.modal-box textarea::placeholder,
.form-seccion input::placeholder,
.form-seccion textarea::placeholder {
  color: var(--text-muted);
}

.main-content input:disabled,
.main-content select:disabled,
.main-content textarea:disabled,
.admin-content input:disabled,
.form-seccion input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg-elevated);
}

/* date input — quitar estilos nativos del picker */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(0.6);
  cursor: pointer;
}

/* number input — quitar flechas de incremento */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
input[type="number"] { -moz-appearance: textfield; }

/* select — custom chevron */
.main-content select,
.admin-content select,
.form-seccion select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23AEADB3' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

/* ══════════════════════════════════════════════════════════
   10. CARDS
══════════════════════════════════════════════════════════ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover { border-color: var(--border-gold); }

.card-gold {
  border-color: var(--border-gold);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(244,216,98,0.06) 100%);
}

.card-sm { padding: var(--sp-4); border-radius: var(--radius); }
.card-lg { padding: var(--sp-6) var(--sp-8); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-family: var(--font-titulo);
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.card-body { /* espacio de contenido libre */ }

/* Tarjeta de métrica (dashboard) */
.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  transition: all var(--transition);
}

.metric-card:hover {
  border-color: var(--border-gold);
  box-shadow: var(--shadow-gold);
  transform: translateY(-2px);
}

.metric-label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.metric-value {
  font-family: var(--font-titulo);
  font-size: 2.5rem;
  color: var(--text-primary);
  line-height: 1;
}

.metric-value.gold { color: var(--gold); }
.metric-value.exito { color: var(--exito); }
.metric-value.error { color: var(--error); }
.metric-value.advertencia { color: var(--advertencia); }

.metric-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Grid de métricas */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
}

@media (min-width: 640px) {
  .metrics-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .metrics-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ══════════════════════════════════════════════════════════
   11. BOTONES
══════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 11px var(--sp-5);
  border-radius: var(--radius);
  font-family: var(--font-cuerpo);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  border: 1.5px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
}

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

/* Botón principal — amarillo de marca con texto negro */
.btn-primary {
  background: var(--amarillo);
  color: var(--negro);
  border-color: var(--amarillo);
}

.btn-primary:hover {
  background: var(--amarillo-light);
  border-color: var(--amarillo-light);
  color: var(--negro);
  box-shadow: var(--shadow-gold);
  transform: translateY(-1px);
}

/* Botón secundario — contorno */
.btn-outline {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold);
}

.btn-outline:hover {
  background: rgba(244,216,98,0.12);
  color: var(--amarillo-light);
}

/* Botón ghost — sin borde */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Botón de peligro */
.btn-danger {
  background: transparent;
  color: var(--error);
  border-color: var(--error);
}

.btn-danger:hover {
  background: var(--error-bg);
}

/* Botón de éxito */
.btn-success {
  background: var(--exito);
  color: #000;
  border-color: var(--exito);
}

.btn-success:hover {
  background: #16a34a;
  transform: translateY(-1px);
}

/* Tamaños */
.btn-sm { padding: 7px var(--sp-4); font-size: 0.8rem; }
.btn-lg { padding: 14px var(--sp-8); font-size: 1rem; }
.btn-full { width: 100%; }

/* Botón con icono solo */
.btn-icon {
  padding: var(--sp-2);
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
}

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-lg svg { width: 18px; height: 18px; }

/* Estado de carga dentro del botón */
.btn.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0,0,0,0.3);
  border-top-color: #000;
  border-radius: 50%;
  animation: girar 0.7s linear infinite;
}

.btn-outline.loading::after,
.btn-ghost.loading::after,
.btn-danger.loading::after {
  border-color: rgba(197,160,89,0.3);
  border-top-color: var(--gold);
}

/* ══════════════════════════════════════════════════════════
   12. FORMULARIOS
══════════════════════════════════════════════════════════ */

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

.form-label {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
}

.form-label.requerido::after {
  content: ' *';
  color: var(--gold);
}

.form-control {
  width: 100%;
  padding: 11px var(--sp-4);
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-cuerpo);
  font-size: 0.925rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
}

.form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(197,160,89,0.12);
}

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

.form-control:read-only {
  opacity: 0.6;
  cursor: not-allowed;
}

textarea.form-control {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}

select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-control.error { border-color: var(--error); }
.form-control.exito { border-color: var(--exito); }

/* .form-input — mismo estilo que .form-control (alias para páginas cliente) */
.form-input {
  width: 100%;
  padding: 12px var(--sp-4);
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-cuerpo);
  font-size: 0.925rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.form-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(244,216,98,0.12);
}

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

.form-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg-elevated);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.form-error {
  font-size: 0.75rem;
  color: var(--error);
  display: none;
}

.form-error.visible { display: block; }

/* Grid para formularios de 2 columnas */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 var(--sp-4);
}

@media (min-width: 540px) {
  .form-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ══════════════════════════════════════════════════════════
   13. BADGES Y PILLS
══════════════════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Estados de membresía */
.badge-activa    { background: var(--exito-bg);    color: var(--exito);    border: 1px solid rgba(34,197,94,0.25); }
.badge-activa::before { background: var(--exito); }

.badge-por-vencer { background: var(--advertencia-bg); color: var(--advertencia); border: 1px solid rgba(245,158,11,0.25); }
.badge-por-vencer::before { background: var(--advertencia); }

.badge-vencida   { background: var(--error-bg);    color: var(--error);    border: 1px solid rgba(239,68,68,0.25); }
.badge-vencida::before { background: var(--error); }

/* Estados de cupón y beneficio */
.badge-disponible { background: var(--info-bg);    color: var(--info);     border: 1px solid rgba(59,130,246,0.25); }
.badge-disponible::before { background: var(--info); }

.badge-usado     { background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border); }
.badge-usado::before { background: var(--text-muted); }

.badge-gold      { background: rgba(197,160,89,0.15); color: var(--gold); border: 1px solid var(--border-gold); }
.badge-gold::before { background: var(--gold); }

/* Alias de utilidad — verde / naranja / rojo / gris */
.badge-exito       { background: var(--exito-bg);        color: var(--exito);        border: 1px solid rgba(34,197,94,0.25); }
.badge-exito::before { background: var(--exito); }

.badge-error       { background: var(--error-bg);        color: var(--error);        border: 1px solid rgba(239,68,68,0.25); }
.badge-error::before { background: var(--error); }

.badge-advertencia { background: var(--advertencia-bg);  color: var(--advertencia);  border: 1px solid rgba(245,158,11,0.25); }
.badge-advertencia::before { background: var(--advertencia); }

.badge-inactiva    { background: var(--bg-elevated);     color: var(--text-muted);   border: 1px solid var(--border); }
.badge-inactiva::before { background: var(--text-muted); }

/* Pill — sin punto indicador */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* ══════════════════════════════════════════════════════════
   14. BARRA DE PROGRESO DE DÍAS
══════════════════════════════════════════════════════════ */

.progress-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.progress-bar {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

.progress-fill.exito     { background: var(--exito); }
.progress-fill.advertencia { background: var(--advertencia); }
.progress-fill.error     { background: var(--error); }
.progress-fill.gold      { background: var(--gold); }

/* ══════════════════════════════════════════════════════════
   15. TOAST NOTIFICATIONS
══════════════════════════════════════════════════════════ */

#toast-container {
  position: fixed;
  top: var(--sp-5);
  right: var(--sp-5);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
  max-width: min(360px, calc(100vw - 40px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius);
  border: 1px solid transparent;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastEntrar 0.3s ease;
  backdrop-filter: blur(8px);
  min-width: 280px;
}

.toast.saliendo { animation: toastSalir 0.3s ease forwards; }

.toast-icono {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-texto { flex: 1; font-size: 0.875rem; line-height: 1.4; }
.toast-titulo { font-weight: 600; margin-bottom: 2px; }
.toast-mensaje { color: inherit; opacity: 0.85; font-size: 0.8rem; }

.toast-cerrar {
  background: none;
  border: none;
  color: inherit;
  opacity: 0.5;
  font-size: 1.1rem;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  transition: opacity var(--transition);
}

.toast-cerrar:hover { opacity: 1; }

/* Variantes */
.toast-exito     { background: rgba(22,28,22,0.95); border-color: rgba(34,197,94,0.35);  color: var(--exito); }
.toast-error     { background: rgba(28,16,16,0.95); border-color: rgba(239,68,68,0.35);  color: var(--error); }
.toast-advertencia { background: rgba(28,24,14,0.95); border-color: rgba(245,158,11,0.35); color: var(--advertencia); }
.toast-info      { background: rgba(14,20,28,0.95); border-color: rgba(59,130,246,0.35); color: var(--info); }

/* ══════════════════════════════════════════════════════════
   16. LOADING OVERLAY
══════════════════════════════════════════════════════════ */

#loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(4px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
}

#loading-overlay.visible { display: flex; }

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(197,160,89,0.15);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: girar 0.8s linear infinite;
}

.spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.loading-texto {
  font-size: 0.875rem;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s ease infinite;
  border-radius: var(--radius);
}

.skeleton-text  { height: 14px; margin-bottom: var(--sp-2); }
.skeleton-title { height: 24px; margin-bottom: var(--sp-3); }
.skeleton-card  { height: 120px; border-radius: var(--radius-lg); }

/* ══════════════════════════════════════════════════════════
   17. MODALES
══════════════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
}

.modal-overlay.visible { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalEntrar 0.25s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--border);
}

.modal-titulo {
  font-family: var(--font-titulo);
  font-size: 1.2rem;
  letter-spacing: 0.5px;
}

.modal-cerrar {
  width: 32px;
  height: 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.modal-cerrar:hover { background: var(--bg-hover); color: var(--text-primary); }

.modal-body   { padding: var(--sp-5) var(--sp-6); }
.modal-footer {
  display: flex;
  gap: var(--sp-3);
  justify-content: flex-end;
  padding: var(--sp-4) var(--sp-6) var(--sp-5);
  border-top: 1px solid var(--border);
}

/* Modal grande */
.modal-lg { max-width: 720px; }

/* ══════════════════════════════════════════════════════════
   18. TABLAS ADMIN
══════════════════════════════════════════════════════════ */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead {
  background: var(--bg-elevated);
  position: sticky;
  top: 0;
}

thead th {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }

tbody td {
  padding: var(--sp-3) var(--sp-4);
  color: var(--text-primary);
  vertical-align: middle;
}

.td-muted { color: var(--text-secondary); font-size: 0.8rem; }

/* Acciones en tabla */
.td-acciones {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

/* ══════════════════════════════════════════════════════════
   19. ALERTAS EN LÍNEA
══════════════════════════════════════════════════════════ */

.alerta {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.875rem;
  line-height: 1.5;
}

.alerta svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

.alerta-exito       { background: var(--exito-bg);      border-color: rgba(34,197,94,0.3);  color: var(--exito); }
.alerta-error       { background: var(--error-bg);      border-color: rgba(239,68,68,0.3);  color: var(--error); }
.alerta-advertencia { background: var(--advertencia-bg);border-color: rgba(245,158,11,0.3); color: var(--advertencia); }
.alerta-info        { background: var(--info-bg);       border-color: rgba(59,130,246,0.3); color: var(--info); }

/* ══════════════════════════════════════════════════════════
   20. ESTADO VACÍO
══════════════════════════════════════════════════════════ */

.estado-vacio {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-12) var(--sp-6);
  gap: var(--sp-4);
  color: var(--text-muted);
}

.estado-vacio svg {
  width: 56px;
  height: 56px;
  opacity: 0.3;
  color: var(--gold);
}

.estado-vacio-titulo { font-size: 1.1rem; font-weight: 500; color: var(--text-secondary); }
.estado-vacio-texto  { font-size: 0.875rem; max-width: 320px; line-height: 1.5; }

/* ══════════════════════════════════════════════════════════
   21. AVATAR / FOTO DE PERFIL
══════════════════════════════════════════════════════════ */

.avatar {
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--gold);
  overflow: hidden;
  flex-shrink: 0;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }

.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-md { width: 48px; height: 48px; font-size: 1rem; }
.avatar-lg { width: 72px; height: 72px; font-size: 1.5rem; border-width: 3px; border-color: var(--gold); }
.avatar-xl { width: 100px; height: 100px; font-size: 2rem; border-width: 3px; border-color: var(--gold); }

/* ══════════════════════════════════════════════════════════
   22. DIVIDER
══════════════════════════════════════════════════════════ */

.divider {
  height: 1px;
  background: var(--border);
  margin: var(--sp-4) 0;
}

.divider-text {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--text-muted);
  font-size: 0.75rem;
}

.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ══════════════════════════════════════════════════════════
   23. PAGINACIÓN
══════════════════════════════════════════════════════════ */

.paginacion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4) 0;
}

.paginacion-info {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.paginacion-controles {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.pag-btn {
  width: 36px;
  height: 36px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  cursor: pointer;
}

.pag-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.pag-btn.activo { background: var(--gold); color: #000; border-color: var(--gold); font-weight: 600; }
.pag-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════════
   24. FILTROS DE BÚSQUEDA
══════════════════════════════════════════════════════════ */

.filtros {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-4) 0;
}

.filtro-input {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.filtro-input svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.filtro-input .form-control { padding-left: 38px; }

/* ══════════════════════════════════════════════════════════
   25. UTILIDADES
══════════════════════════════════════════════════════════ */

/* Flex */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.flex-wrap     { flex-wrap: wrap; }
.flex-1        { flex: 1; }
.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }

/* Grid */
.grid         { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* Espaciado */
.mt-2  { margin-top: var(--sp-2); }
.mt-4  { margin-top: var(--sp-4); }
.mt-6  { margin-top: var(--sp-6); }
.mb-2  { margin-bottom: var(--sp-2); }
.mb-4  { margin-bottom: var(--sp-4); }
.mb-6  { margin-bottom: var(--sp-6); }
.p-4   { padding: var(--sp-4); }
.p-6   { padding: var(--sp-6); }

/* Texto */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.truncate    { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.break-word  { word-break: break-word; }

/* Visibilidad */
.hidden        { display: none !important; }
.visible       { display: block; }
.invisible     { visibility: hidden; }
.opacity-50    { opacity: 0.5; }

@media (max-width: 480px) {
  .hidden-mobile { display: none !important; }
}

/* Dimensiones */
.w-full   { width: 100%; }
.h-full   { height: 100%; }
.min-w-0  { min-width: 0; }

/* Scroll */
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }

/* ══════════════════════════════════════════════════════════
   26. ANIMACIONES Y KEYFRAMES
══════════════════════════════════════════════════════════ */

@keyframes girar {
  to { transform: rotate(360deg); }
}

@keyframes toastEntrar {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastSalir {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to   { opacity: 0; transform: translateX(100%) scale(0.9); }
}

@keyframes modalEntrar {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes skeleton {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes pulso {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

@keyframes entrarAbajo {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animar { animation: entrarAbajo 0.3s ease both; }
.animar-1 { animation-delay: 0.05s; }
.animar-2 { animation-delay: 0.1s; }
.animar-3 { animation-delay: 0.15s; }
.animar-4 { animation-delay: 0.2s; }
.animar-5 { animation-delay: 0.25s; }

/* ══════════════════════════════════════════════════════════
   27. RESPONSIVE
══════════════════════════════════════════════════════════ */

@media (min-width: 768px) {
  .page-wrapper { padding-bottom: 0; }
  .bottom-nav   { display: none; }
  .main-content { padding: var(--sp-6); }

  /* Solo mostrar la navbar superior en desktop */
  .navbar { display: flex; }

  .metrics-grid { grid-template-columns: repeat(3, 1fr); }

  /* ── Layout con sidebar de cliente en desktop ── */
  /* Cuando nav-cliente.js inyecta la sidebar, el body recibe .has-client-sidebar */
  body.has-client-sidebar .navbar     { display: none; }   /* sidebar reemplaza la navbar */
  body.has-client-sidebar .page-wrapper { margin-left: var(--sidebar-w); }
  body.has-client-sidebar .main-content { padding: var(--sp-6) var(--sp-8); }
}

@media (min-width: 1024px) {
  .main-content { padding: var(--sp-8); }
  .metrics-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Ocultar navbar en móvil si hay bottom-nav */
@media (max-width: 767px) {
  .solo-desktop { display: none !important; }
  .modal { max-width: 100%; margin: 0; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }
}

@media (min-width: 768px) {
  .solo-mobile { display: none !important; }
}
