/* ============================================
   NEXO - Sistema de Gestión
   Diseño Profesional
   ============================================ */

/* Variables de diseño */
:root {
  /* Colores principales - paleta AZUL PETRÓLEO (acción: botones, links, tab activa, foco) */
  --primary: #1E6F9F;
  --primary-dark: #17587F;
  --primary-light: #4E93BE;
  --primary-bg: #E7F1F8;

  /* Accent - navy (complementario, para detalles puntuales) */
  --accent: #22304D;
  --accent-dark: #182238;
  --accent-light: #3E5275;
  --accent-bg: #EAF0F8;

  /* Colores de estado */
  --success: #10B981;
  --success-bg: #D1FAE5;
  --warning: #F59E0B;
  --warning-bg: #FEF3C7;
  --danger: #EF4444;
  --danger-bg: #FEE2E2;
  --info: #3B82F6;
  --info-bg: #DBEAFE;

  /* Neutros */
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;

  /* Sidebar - azul petróleo */
  --sidebar-bg: #123449;
  --sidebar-hover: #1a4a68;
  --sidebar-active: #4E93BE;
  --sidebar-text: #aebccc;
  --sidebar-text-active: #ffffff;
  --sidebar-border: #1a4a68;

  /* Layout */
  --sidebar-width: 260px;
  --header-height: 64px;
  --border-radius: 6px;
  --border-radius-sm: 8px;
  --border-radius-lg: 10px;
  
  /* Sombras */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  
  /* Transiciones */
  --transition: all 0.2s ease;
  --transition-slow: all 0.3s ease;

  /* Paleta azul: los "gold" del chrome pasan a azul (acción). El dorado real
     de identidad queda hardcodeado solo en login + wordmark del sidebar. */
  --gold: #1E6F9F;              /* (ex dorado) → azul de acción */
  --gold-ink: #1668A0;          /* (ex bronce) → azul-tinta legible sobre blanco (links) */
  --brand-gold: #b89a5e;        /* dorado de identidad (login, wordmark, PDF) */
  --app-bg: #e2e8f0;            /* gris frío un tono más marcado — mayor contraste con las tarjetas blancas */
  --hairline: #e3e8ee;          /* bordes fríos suaves de tarjeta */

  /* Cabecera de tarjeta — ★ cambiar acá recolorea TODOS los headers del sistema.
     Banda oscura (carbón, misma familia que el sidebar): zonificación fuerte y
     sistema unificado. El dorado queda para acciones (botones) e íconos. */
  --cardhead-bg: linear-gradient(135deg, #143B55 0%, #0E2A3D 100%); /* banda petróleo */
  --cardhead-ink: #ffffff;      /* título / links sobre la banda (blanco) */
  --cardhead-icon: #8fd0ee;     /* glifo del ícono (celeste sobre petróleo) */
  --cardhead-line: rgba(0,0,0,.25); /* hairline inferior del header */
}

/* Reset y base */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--gray-700);
  background: var(--gray-50);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  /* Degradé sutil (más luz arriba, junto al wordmark; más profundo abajo) + separación del contenido */
  background: linear-gradient(180deg, #16405B 0%, #103049 52%, #0C2438 100%);
  box-shadow: 2px 0 18px rgba(0,0,0,.22);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: var(--transition-slow);
}

.sidebar-logo {
  padding: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo h1 {
  font-size: 20px;
  font-weight: 700;
  color: white;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo .logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.sidebar-logo small {
  display: block;
  color: var(--sidebar-text);
  font-size: 11px;
  font-weight: 400;
  margin-top: 4px;
  margin-left: 50px;
}

/* Navegación */
.sidebar nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.sidebar-section {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-text-active);
  padding: 20px 16px 8px;
  margin-top: 8px;
}

.sidebar-section:first-child {
  margin-top: 0;
  padding-top: 8px;
}

/* Subsecciones del menú (Reportes, Configuración) */
.sidebar-subsection {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8f959d;
  padding: 12px 16px 4px;
  margin-top: 8px;
}

/* Items de subsección con indentación */
.sidebar nav a.sidebar-subitem {
  padding-left: 24px;
  font-size: 12px;
  opacity: 0.9;
}

.sidebar nav a.sidebar-subitem:hover {
  opacity: 1;
}

/* Color diferente para subitems activos */
.sidebar nav a.sidebar-subitem.active {
  background: rgba(78,147,190,.16); /* tinte azul */
  color: var(--sidebar-active);
  border-left: 3px solid var(--sidebar-active);
  padding-left: 21px; /* Compensar el borde */
}

/* ============================================
   MENÚ COLAPSABLE
   ============================================ */

/* Header del módulo (clickeable) */
.sidebar-module-header {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 12px;
  transition: var(--transition);
  border-radius: var(--border-radius-sm);
  margin: 0 4px;
  border-top: 1px solid rgba(255,255,255,.06); /* separador entre módulos */
}

.sidebar-module-header:hover {
  background: rgba(255,255,255,0.03);
}

.sidebar-module-header .sidebar-section {
  flex: 1;
  margin: 0;
  padding: 16px 12px 8px;
}

.sidebar-module-header.expanded .sidebar-section {
  color: var(--primary-light);
}

/* Icono de toggle */
.module-toggle-icon {
  width: 16px;
  height: 16px;
  color: #b7b2a8;
  opacity: 0.75;
  transition: transform 0.2s ease, opacity 0.2s ease;
  transform: rotate(-90deg);
  flex-shrink: 0;
}

.sidebar-module-header:hover .module-toggle-icon {
  opacity: 0.8;
}

.sidebar-module-header.expanded .module-toggle-icon {
  opacity: 1;
  color: var(--primary-light);
}

/* Contenido del módulo — sangrado + riel a la izquierda (nesting claro) */
.sidebar-module-content {
  overflow: hidden;
  transition: all 0.3s ease;
  margin: 2px 6px 10px 14px;
  padding-left: 6px;
  border-left: 1px solid rgba(255,255,255,.08);
}

.sidebar-module-content a {
  animation: fadeInMenu 0.2s ease;
}

@keyframes fadeInMenu {
  from {
    opacity: 0;
    transform: translateX(-4px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: var(--border-radius-sm);
  font-weight: 500;
  font-size: 13px;
  transition: var(--transition);
  margin-bottom: 2px;
}

.sidebar nav a svg {
  width: 20px;
  height: 20px;
  opacity: 0.7;
}

.sidebar nav a:hover {
  background: var(--sidebar-hover);
  color: white;
}

.sidebar nav a:hover svg {
  opacity: 1;
}

.sidebar nav a.active {
  background: rgba(78,147,190,.20); /* tinte azul más presente */
  color: #ffffff;
  box-shadow: inset 3px 0 0 var(--sidebar-active);
  font-weight: 600;
}

.sidebar nav a.active svg {
  opacity: 1;
  color: var(--sidebar-active);
}

.sidebar nav a .badge {
  margin-left: auto;
  font-size: 10px;
  padding: 3px 8px;
  font-weight: 600;
  background: var(--danger);
  color: white;
  border-radius: 10px;
}

/* Badge de notificaciones en menú */
.menu-badge {
  margin-left: auto;
  font-size: 10px;
  padding: 3px 8px;
  font-weight: 600;
  background: var(--danger);
  color: white;
  border-radius: 10px;
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.sidebar-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin: 16px 0;
}

/* ============================================
   CONTENIDO PRINCIPAL
   ============================================ */

.content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  background: var(--gray-50);
}

.top-header {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 0 32px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-header .page-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--gray-900);
  margin: 0;
}

.top-header .user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gray-600);
  font-size: 13px;
}

.avatar {
  width: 36px;
  height: 36px;
  background: var(--primary-bg);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
}

.container-fluid {
  padding: 28px 32px;
}

/* ============================================
   CARDS
   ============================================ */

.card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
}

/* ============================================
   CABECERA DE TARJETA — COMPONENTE ÚNICO (todo el sistema)
   ★ Para recolorear TODOS los headers cambiá SOLO estos tokens (en :root):
     --cardhead-bg (banda) · --cardhead-ink (título/links) · --cardhead-icon (ícono).
   Cubre: .card-header (Bootstrap plano, hijo directo de .card),
   .lp-cardhead, .resv-head y .resv-cat-bar. Banda carbón oscura,
   título blanco, ícono como glifo dorado suelto.
   Los headers con color semántico (class="… bg-*") quedan excluidos.
   ============================================ */
.card > .card-header:not([class*="bg-"]),
.lp-cardhead, .resv-head, .resv-cat-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--cardhead-bg);
  color: var(--cardhead-ink);
  border: 0;
  border-bottom: 1px solid var(--cardhead-line);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}
/* card-header manda la acción (botón/enlace) a la derecha */
.card > .card-header:not([class*="bg-"]) { justify-content: space-between; }

/* Título — todas las variantes de heading + spans de título */
.card > .card-header:not([class*="bg-"]) h5,
.card > .card-header:not([class*="bg-"]) h6,
.lp-cardhead h5, .lp-cardhead h4,
.lp-cardhead-title, .resv-head-title, .resv-cat-title {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--cardhead-ink);
  line-height: 1.15;
}

/* Ícono como glifo dorado suelto (sin tile): más liviano sobre la banda carbón */
.card > .card-header:not([class*="bg-"]) .ch-ico,
.lp-cardhead-icon, .resv-head-icon, .resv-cat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--cardhead-icon);
  font-size: 17px;
  flex-shrink: 0;
  margin: 0;
}

/* Links / acciones a la derecha (bronce, sin inline) */
.card > .card-header:not([class*="bg-"]) a:not(.btn),
.lp-cardhead a:not(.btn), .resv-cat-link, a.lp-cardhead-actions {
  color: var(--cardhead-ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
}
.card > .card-header:not([class*="bg-"]) a:not(.btn):hover,
.lp-cardhead a:not(.btn):hover, .resv-cat-link:hover,
a.lp-cardhead-actions:hover { text-decoration: underline; }

/* Texto secundario dentro del header (banda oscura → claro) */
.card > .card-header:not([class*="bg-"]) .text-muted,
.lp-cardhead .text-muted, .resv-head .text-muted { color: rgba(255,255,255,.72) !important; }
/* Badges gris dentro de la banda: translúcido claro para que se lean */
.lp-cardhead .badge-gray, .resv-head .badge-gray,
.card > .card-header:not([class*="bg-"]) .badge-gray { background: rgba(255,255,255,.2); color: #fff; }

.card-body {
  padding: 20px;
}

/* Buscador embebido dentro de una tarjeta, entre la banda de header y la tabla.
   Sin padding inferior para que se apoye sobre la tabla (patrón de listados). */
.card-search {
  padding: 16px 16px 0;
}

/* Housekeeping — grilla de unidades compacta + leyenda de colores.
   En app.css (no en el partial hk-scope) para que aplique también en el
   layout móvil, que no carga el partial. */
.hk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
}
.hk-unidad-card {
  border-radius: 14px;
  border: 1px solid var(--hairline);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.hk-unidad-card:hover { box-shadow: 0 4px 12px rgba(16, 24, 40, .10); }
.hk-unidad-card .card-body { padding: 8px 11px 9px; }
.hk-unidad-card .hk-bar { display: none; }
.hk-unidad-card .hk-unidad-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.hk-unidad-card .hk-num { font-size: 14px; font-weight: 700; color: var(--gray-800); line-height: 1.1; }
.hk-unidad-card .hk-estado-dot { width: 9px; height: 9px; }
.hk-unidad-card .hk-estado-badge { font-size: 10px; padding: 1px 7px; }
.hk-unidad-card .hk-ocup-badge { margin-top: 3px; }

.hk-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  padding: 11px 14px;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 10px;
}
.hk-legend-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--gray-500); }
.hk-legend-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.hk-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gray-700); }
.hk-legend-dot { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; }
.hk-legend-sep { width: 1px; align-self: stretch; min-height: 18px; background: var(--hairline); }

/* ============================================
   KPI CARDS
   ============================================ */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.kpi-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
  padding: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gray-200);
  transition: var(--transition);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-card:hover::before {
  background: var(--primary);
}

.kpi-card.primary::before { background: var(--primary); }
.kpi-card.success::before { background: var(--success); }
.kpi-card.warning::before { background: var(--warning); }
.kpi-card.danger::before { background: var(--danger); }

.kpi-value {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 6px;
  color: var(--gray-900);
}

.kpi-label {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ============================================
   FILTROS
   ============================================ */

.filter-bar {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 20px;
}

.filter-bar .form-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

/* ============================================
   TABLAS
   ============================================ */

.table {
  margin: 0;
  font-size: 13px;
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.table thead th {
  background: var(--gray-50);
  border-bottom: 2px solid var(--gray-200);
  color: var(--gray-600);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 14px 16px;
  text-align: left;
  white-space: nowrap;
}

.table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
  color: var(--gray-700);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr:hover {
  background: var(--gray-50);
}

.table tbody tr.row-clickable {
  cursor: pointer;
}

.table tbody tr.row-clickable:hover {
  background: var(--primary-bg);
}

/* Fila con mensajes sin leer */
.table tbody tr.row-unread {
  background: #FEF3C7;
  border-left: 3px solid var(--warning);
}

.table tbody tr.row-unread:hover {
  background: #FDE68A;
}

.table tbody tr.row-unread td:first-child {
  padding-left: 13px;
}

/* ============================================
   FORMULARIOS
   ============================================ */

.form-label {
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
  font-size: 13px;
}

.form-control, .form-select {
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  transition: var(--transition);
  width: 100%;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
  outline: none;
}

.form-control::placeholder {
  color: var(--gray-400);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* ============================================
   BOTONES
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--border-radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

/* Normalizar botones <button> para que coincidan con <a> */
button.btn {
  font-family: inherit;
  line-height: inherit;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

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

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: white;
}

/* Estado deshabilitado: gris neutro legible (el azul al 50% quedaba lavado/ilegible) */
.btn-primary:disabled,
.btn-primary.disabled {
  background: var(--gray-200);
  color: var(--gray-500);
  border-color: var(--gray-200);
  opacity: 1;
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
}

.btn-secondary:hover {
  background: var(--gray-200);
  color: var(--gray-900);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #059669;
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.btn-danger:hover {
  background: #DC2626;
  color: #fff;
  border-color: #DC2626;
}

/* Botón destructivo RELLENO (rojo pleno), para acciones peligrosas destacadas */
.btn-danger-solid { background: var(--danger); color: #fff; border: 1px solid var(--danger); }
.btn-danger-solid:hover { background: #DC2626; color: #fff; border-color: #DC2626; }

.btn-outline, .btn-outline-secondary {
  background: transparent;
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
}

.btn-outline:hover, .btn-outline-secondary:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
  color: var(--gray-900); /* fija el color: evita que Bootstrap meta blanco y el ícono quede ilegible */
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-primary { background: var(--primary-bg); color: var(--primary); }
.badge-success { background: var(--success-bg); color: #047857; }
.badge-warning { background: var(--warning-bg); color: #B45309; }
.badge-danger { background: var(--danger-bg); color: #B91C1C; }
.badge-info { background: var(--info-bg); color: #1D4ED8; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }
.badge-purple { background: rgba(139, 92, 246, 0.1); color: #7C3AED; }

/* Estados de estancias (Recepción) */
.estado-estancia-arribada { background: var(--warning-bg); color: #B45309; }
.estado-estancia-ingresada { background: var(--success-bg); color: #047857; }
.estado-estancia-egresada { background: var(--gray-100); color: var(--gray-600); }
.estado-estancia-cancelada { background: var(--gray-100); color: var(--gray-600); }

/* Estados de unidades (ocupación / limpieza) */
.estado-ocupacion-libre { background: var(--gray-100); color: var(--gray-600); }
.estado-ocupacion-arribada { background: var(--info-bg); color: #1D4ED8; }
.estado-ocupacion-ingresada { background: rgba(139, 92, 246, 0.1); color: #7C3AED; }
.estado-limpieza-sucia { background: var(--danger-bg); color: #B91C1C; }
.estado-limpieza-limpieza_profunda { background: var(--warning-bg); color: #B45309; }
.estado-limpieza-repasada { background: var(--info-bg); color: #1D4ED8; }
.estado-limpieza-chequeada { background: var(--success-bg); color: #047857; }

/* Estados de reclamos */
.estado-activo { background: var(--success-bg); color: #047857; }
.estado-pendiente { background: var(--warning-bg); color: #B45309; }
.estado-finalizado { background: var(--gray-100); color: var(--gray-600); }
.estado-bloqueado { background: var(--danger-bg); color: #B91C1C; }
.estado-inactivo { background: var(--gray-100); color: var(--gray-600); }

/* Estados de documentos */
.estado-vigente { background: var(--success-bg); color: #047857; }
.estado-por_vencer { background: var(--warning-bg); color: #B45309; }
.estado-vencido { background: var(--danger-bg); color: #B91C1C; }

/* Estados de Tickets */
.estado-ticket-nuevo { background: var(--info-bg); color: #1D4ED8; }
.estado-ticket-en_proceso { background: var(--primary-bg); color: var(--primary); }
.estado-ticket-pendiente_cliente { background: var(--warning-bg); color: #B45309; }
.estado-ticket-resuelto { background: var(--success-bg); color: #047857; }
.estado-ticket-listo_facturar { background: #FEF3C7; color: #92400E; }
.estado-ticket-cerrado { background: var(--gray-100); color: var(--gray-600); }

/* Tipos de Ticket */
.tipo-remoto { background: #DBEAFE; color: #1D4ED8; }
.tipo-visita { background: #FEF3C7; color: #B45309; }
.tipo-mixto { background: #E0E7FF; color: #4338CA; }

/* Prioridades */
.prioridad-baja { background: var(--gray-100); color: var(--gray-600); }
.prioridad-media { background: var(--info-bg); color: #1D4ED8; }
.prioridad-alta { background: var(--warning-bg); color: #B45309; }
.prioridad-urgente { background: var(--danger-bg); color: #B91C1C; }

/* Estados de Propiedades (Real Estate) */
.estado-borrador { background: var(--gray-100); color: var(--gray-600); }
.estado-activa { background: var(--success-bg); color: #047857; }
.estado-reservada { background: var(--warning-bg); color: #B45309; }
.estado-vendida { background: var(--primary-bg); color: var(--primary); }
.estado-alquilada { background: var(--info-bg); color: #1D4ED8; }
.estado-suspendida { background: var(--danger-bg); color: #B91C1C; }
.estado-retirada { background: var(--gray-100); color: var(--gray-600); }

/* Tipos de Contacto (Real Estate) */
.tipo-comprador { background: var(--primary-bg); color: var(--primary); }
.tipo-vendedor { background: var(--success-bg); color: #047857; }
.tipo-propietario { background: var(--gray-100); color: var(--gray-600); }
.tipo-inquilino { background: var(--gray-100); color: var(--gray-600); }
.tipo-lead { background: var(--info-bg); color: #1D4ED8; }

/* Calificaciones de Contacto (Real Estate) */
.calificacion-frio { background: var(--gray-100); color: var(--gray-600); }
.calificacion-tibio { background: var(--info-bg); color: #1D4ED8; }
.calificacion-caliente { background: var(--warning-bg); color: #B45309; }
.calificacion-muy_caliente { background: var(--danger-bg); color: #B91C1C; }

/* Estados de Contacto (Real Estate) */
.estado-contacto-activo { background: var(--success-bg); color: #047857; }
.estado-contacto-inactivo { background: var(--gray-100); color: var(--gray-600); }
.estado-contacto-convertido { background: var(--primary-bg); color: var(--primary); }
.estado-contacto-perdido { background: var(--gray-100); color: var(--gray-600); }

/* Estados de Oportunidad (Real Estate) */
.estado-oportunidad-nueva { background: var(--info-bg); color: #1D4ED8; }
.estado-oportunidad-en_seguimiento { background: var(--primary-bg); color: var(--primary); }
.estado-oportunidad-negociacion { background: var(--warning-bg); color: #B45309; }
.estado-oportunidad-ganada { background: var(--success-bg); color: #047857; }
.estado-oportunidad-perdida { background: var(--danger-bg); color: #B91C1C; }

/* Estados de Muestra (Real Estate) */
.estado-muestra-agendada { background: var(--warning-bg); color: #B45309; }
.estado-muestra-confirmada { background: var(--success-bg); color: #047857; }
.estado-muestra-en_curso { background: var(--primary-bg); color: var(--primary); }
.estado-muestra-completada { background: var(--info-bg); color: #1D4ED8; }
.estado-muestra-cancelada { background: var(--danger-bg); color: #B91C1C; }
.estado-muestra-no_presentado { background: var(--gray-100); color: var(--gray-600); }
.estado-muestra-reagendada { background: var(--warning-bg); color: #B45309; }

/* ============================================
   ALERTAS
   ============================================ */

.alert {
  padding: 14px 18px;
  border-radius: var(--border-radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-success { background: var(--success-bg); color: #047857; }
.alert-danger { background: var(--danger-bg); color: #B91C1C; }
.alert-warning { background: var(--warning-bg); color: #B45309; }
.alert-info { background: var(--info-bg); color: #1D4ED8; }

/* ============================================
   TIMELINE (Comentarios)
   ============================================ */

.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gray-200);
}

.timeline-item {
  position: relative;
  padding: 16px 20px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius-sm);
  margin-bottom: 16px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -23px;
  top: 22px;
  width: 12px;
  height: 12px;
  background: white;
  border: 3px solid var(--primary);
  border-radius: 50%;
}

.timeline-item.interno {
  background: var(--gray-50);
  border-style: dashed;
}

.timeline-item.interno::before {
  border-color: var(--gray-400);
}

.timeline-item.sistema {
  background: var(--info-bg);
  border-color: var(--info);
}

.timeline-item.sistema::before {
  border-color: var(--info);
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-500);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  color: var(--gray-300);
  margin-bottom: 20px;
}

.empty-state p {
  font-size: 15px;
  margin-bottom: 24px;
}

/* ============================================
   MODALES (tema global — todos los modales Bootstrap
   del sistema heredan este estilo automáticamente)
   ============================================ */

.modal-content {
  border: none;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.modal-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-bottom: none;
  color: #fff;
  padding: 16px 20px;
}

.modal-header .modal-title {
  color: #fff;
  font-weight: 700;
}

/* Vuelve blanca la X de cierre por defecto de Bootstrap */
.modal-header .btn-close {
  filter: brightness(0) invert(1);
  opacity: 0.9;
}
.modal-header .btn-close:hover { opacity: 1; }

.modal-footer {
  border-top: 1px solid var(--gray-100);
}

/* ============================================
   LOGIN
   ============================================ */

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--sidebar-bg) 0%, var(--accent-dark) 100%);
  padding: 20px;
}

.login-box {
  background: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  padding: 48px 40px;
}

.login-box h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-900);
  text-align: center;
  margin-bottom: 8px;
}

.login-box .subtitle {
  text-align: center;
  color: var(--gray-500);
  margin-bottom: 32px;
}

.login-box .logo {
  text-align: center;
  margin-bottom: 32px;
}

/* Marca del edificio en el login (logo Le Parc) */
.login-marca {
  display: block;
  margin: 8px auto 18px;
  width: 100%;
  max-width: 260px;
  height: auto;
}

.login-sistema {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gray-400);
  margin: 0 0 36px;
}

.login-box .logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.login-box .logo-icon svg {
  width: 32px;
  height: 32px;
  color: white;
}

/* ============================================
   UTILIDADES
   ============================================ */

.text-muted { color: var(--gray-500); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }

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

.actions-cell {
  white-space: nowrap;
  text-align: right;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Botón menú móvil - oculto en desktop */
.mobile-menu-btn {
  display: none !important;
  background: none;
  border: none;
  padding: 8px;
  margin-right: 12px;
  cursor: pointer;
  color: var(--gray-700);
  border-radius: var(--border-radius-sm);
  transition: var(--transition);
}

.mobile-menu-btn:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

/* Overlay para cerrar menú */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
  opacity: 1;
}

@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 100;
  }

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

  .content {
    margin-left: 0;
  }

  .container-fluid {
    padding: 20px;
  }

  .top-header {
    padding: 0 20px;
  }

  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }

  /* Mostrar botón menú en móvil */
  .mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  /* Mostrar overlay cuando está activo */
  .sidebar-overlay.show {
    display: block;
  }

  /* Ajustar header para incluir botón menú */
  .top-header {
    display: flex;
    align-items: center;
  }

  .page-title {
    flex: 1;
  }
}

/* ============================================
   TABS
   ============================================ */

.nav-tabs {
  display: flex;
  flex-wrap: wrap;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
  border-bottom: 2px solid var(--gray-200);
}

.nav-item {
  margin-bottom: -2px;
}

.nav-link {
  display: block;
  padding: 0.75rem 1.25rem;
  color: var(--gray-600);
  text-decoration: none;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
  font-weight: 500;
}

.nav-link:hover {
  color: var(--primary);
  border-bottom-color: var(--gray-300);
}

.nav-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ============================================
   ANIMACIONES
   ============================================ */

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

.card, .kpi-card, .alert {
  animation: fadeIn 0.25s ease-out;
}

/* ============================================
   UTILIDADES DE LAYOUT
   ============================================ */

/* Anchos de columna */
.col-xs { width: 40px; }
.col-sm { width: 60px; }
.col-md { width: 100px; }
.col-lg { width: 150px; }
.col-xl { width: 200px; }
.col-actions { width: 80px; text-align: right; }

/* Alineación de texto */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Flexbox utilities */
.d-flex { display: flex; }
.flex-row { flex-direction: row; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.align-items-start { align-items: flex-start; }
.align-items-center { align-items: center; }
.align-items-end { align-items: flex-end; }
.justify-content-start { justify-content: flex-start; }
.justify-content-center { justify-content: center; }
.justify-content-end { justify-content: flex-end; }
.justify-content-between { justify-content: space-between; }

/* Gaps */
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }

/* Padding utilities */
.p-0 { padding: 0; }
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 16px; }
.p-4 { padding: 24px; }

.px-1 { padding-left: 4px; padding-right: 4px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-3 { padding-left: 16px; padding-right: 16px; }
.px-4 { padding-left: 24px; padding-right: 24px; }

.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 16px; padding-bottom: 16px; }
.py-4 { padding-top: 24px; padding-bottom: 24px; }

/* Margin utilities */
.m-0 { margin: 0; }
.m-1 { margin: 4px; }
.m-2 { margin: 8px; }
.m-3 { margin: 16px; }
.m-4 { margin: 24px; }

.mx-1 { margin-left: 4px; margin-right: 4px; }
.mx-2 { margin-left: 8px; margin-right: 8px; }
.mx-3 { margin-left: 16px; margin-right: 16px; }
.mx-4 { margin-left: 24px; margin-right: 24px; }

.my-1 { margin-top: 4px; margin-bottom: 4px; }
.my-2 { margin-top: 8px; margin-bottom: 8px; }
.my-3 { margin-top: 16px; margin-bottom: 16px; }
.my-4 { margin-top: 24px; margin-bottom: 24px; }

/* ============================================
   BREADCRUMBS
   ============================================ */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  padding: 0;
  margin: 0 0 8px 0;
  list-style: none;
  font-size: 13px;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-item + .breadcrumb-item {
  padding-left: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  padding: 0 8px;
  color: var(--gray-400);
}

.breadcrumb-item a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb-item a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.breadcrumb-item.active {
  color: var(--gray-500);
}

/* ============================================
   GRID SYSTEM (Bootstrap-like)
   ============================================ */

.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -12px;
  margin-left: -12px;
}

.row > * {
  padding-right: 12px;
  padding-left: 12px;
}

.col { flex: 1 0 0%; }
.col-auto { flex: 0 0 auto; width: auto; }
.col-1 { flex: 0 0 auto; width: 8.333333%; }
.col-2 { flex: 0 0 auto; width: 16.666667%; }
.col-3 { flex: 0 0 auto; width: 25%; }
.col-4 { flex: 0 0 auto; width: 33.333333%; }
.col-5 { flex: 0 0 auto; width: 41.666667%; }
.col-6 { flex: 0 0 auto; width: 50%; }
.col-7 { flex: 0 0 auto; width: 58.333333%; }
.col-8 { flex: 0 0 auto; width: 66.666667%; }
.col-9 { flex: 0 0 auto; width: 75%; }
.col-10 { flex: 0 0 auto; width: 83.333333%; }
.col-11 { flex: 0 0 auto; width: 91.666667%; }
.col-12 { flex: 0 0 auto; width: 100%; }

/* Grid columns for larger screens */
@media (min-width: 768px) {
  .col-md-1 { flex: 0 0 auto; width: 8.333333%; }
  .col-md-2 { flex: 0 0 auto; width: 16.666667%; }
  .col-md-3 { flex: 0 0 auto; width: 25%; }
  .col-md-4 { flex: 0 0 auto; width: 33.333333%; }
  .col-md-5 { flex: 0 0 auto; width: 41.666667%; }
  .col-md-6 { flex: 0 0 auto; width: 50%; }
  .col-md-7 { flex: 0 0 auto; width: 58.333333%; }
  .col-md-8 { flex: 0 0 auto; width: 66.666667%; }
  .col-md-9 { flex: 0 0 auto; width: 75%; }
  .col-md-10 { flex: 0 0 auto; width: 83.333333%; }
  .col-md-11 { flex: 0 0 auto; width: 91.666667%; }
  .col-md-12 { flex: 0 0 auto; width: 100%; }
}

@media (min-width: 992px) {
  .col-lg-1 { flex: 0 0 auto; width: 8.333333%; }
  .col-lg-2 { flex: 0 0 auto; width: 16.666667%; }
  .col-lg-3 { flex: 0 0 auto; width: 25%; }
  .col-lg-4 { flex: 0 0 auto; width: 33.333333%; }
  .col-lg-5 { flex: 0 0 auto; width: 41.666667%; }
  .col-lg-6 { flex: 0 0 auto; width: 50%; }
  .col-lg-7 { flex: 0 0 auto; width: 58.333333%; }
  .col-lg-8 { flex: 0 0 auto; width: 66.666667%; }
  .col-lg-9 { flex: 0 0 auto; width: 75%; }
  .col-lg-10 { flex: 0 0 auto; width: 83.333333%; }
  .col-lg-11 { flex: 0 0 auto; width: 91.666667%; }
  .col-lg-12 { flex: 0 0 auto; width: 100%; }
}

/* Grid gap utilities */
.g-1 { gap: 4px; }
.g-2 { gap: 8px; }
.g-3 { gap: 16px; }
.g-4 { gap: 24px; }
.g-5 { gap: 32px; }

/* Display utilities */
.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-grid { display: grid; }

/* Width utilities */
.w-100 { width: 100%; }
.w-auto { width: auto; }

/* Form check (checkbox) */
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.form-check-input {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
}

.form-check-label {
  cursor: pointer;
  font-size: 14px;
  color: var(--gray-700);
}

/* Table responsive */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Pagination */
.pagination {
  display: flex;
  padding-left: 0;
  list-style: none;
  gap: 4px;
}

.page-item .page-link {
  display: block;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--gray-700);
  text-decoration: none;
  background-color: white;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius-sm);
  transition: var(--transition);
}

.page-item .page-link:hover {
  background-color: var(--gray-100);
  border-color: var(--gray-400);
}

.page-item.active .page-link {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
}

.page-item.disabled .page-link {
  color: var(--gray-400);
  pointer-events: none;
  background-color: var(--gray-50);
}

.justify-content-center {
  justify-content: center;
}

/* ============================================
   SOLAPAS DE MÓDULO (subnavegación interna)
   Clase propia para no chocar con .nav-tabs de Bootstrap.
   ============================================ */

.modulo-tabs {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  /* Scrolleable pero SIN barra visible (las pestañas no se cortan y siguen
     accesibles por rueda/gesto). */
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* Edge/IE viejo */
  gap: 4px;
  padding: 0;
  margin: 0 0 24px;
  list-style: none;
  /* Franja dorado oscuro: la pestaña activa "apoya" sobre la línea y se funde con ella */
  border-bottom: 3px solid var(--primary-dark);
}
.modulo-tabs::-webkit-scrollbar { display: none; } /* Chrome/Safari/Edge */

.modulo-tab {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  white-space: nowrap;
  padding: 10px 18px;
  margin-bottom: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  text-decoration: none;
  background: transparent;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  transition: var(--transition);
}

.modulo-tab:hover {
  /* Tinte azul claro visible sobre el fondo (sin acercarse a la pestaña activa) */
  color: var(--primary-dark);
  background: var(--primary-bg);
}

.modulo-tab.active {
  /* Pestaña activa = ficha dorado oscuro; su base toca la franja del mismo color */
  color: #fff;
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

/* Filas resaltadas en tablas (alertas operativas) */
.table tr.tr-danger > td { background: var(--danger-bg); }
.table tr.tr-warning > td { background: var(--warning-bg); }
.table tr.tr-important > td { background: rgba(245,158,11,.07); }

/* Un badge del mismo tono que su fila (badge-danger sobre tr-danger, etc.) se
   funde con el fondo. Dentro de filas coloreadas, se le da un borde sutil en su
   propio color para que se despegue. Scoped a la tabla: no afecta otros badges. */
.table tr.tr-danger .badge,
.table tr.tr-warning .badge,
.table tr.tr-important .badge {
  box-shadow: inset 0 0 0 1px currentColor;
}

/* Callout / aviso (banda con acento a la izquierda) — reemplaza banners con color inline */
.callout { border-left: 4px solid var(--gray-300); background: var(--gray-50); }
.callout-warning { border-left-color: var(--warning); background: var(--warning-bg); }
/* Código inline (token/valor a copiar) */
.code-box { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: #fff; border: 1px solid var(--gray-300); border-radius: 8px; padding: 10px 12px; word-break: break-all; }

/* ============================================
   Paginador de listados (cliente) — tablas `.js-paginate`, 15/hoja
   ============================================ */
.pg-out { display: none !important; }
.lp-pager { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; padding: 14px 10px 6px; }
.lp-page { min-width: 32px; height: 32px; padding: 0 10px; border: 1px solid var(--gray-300); background: #fff; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--gray-700); cursor: pointer; font-variant-numeric: tabular-nums; transition: var(--transition); }
.lp-page:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-ink); }
.lp-page.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.lp-page:disabled { opacity: .4; cursor: default; }
.lp-pager-info { width: 100%; text-align: center; font-size: 12px; color: var(--gray-500); padding-top: 4px; }

/* ============================================
   Autocompletar (dropdown de búsqueda) — reemplaza los grises hardcodeados en JS
   ============================================ */
.ac-list { position: absolute; z-index: 20; left: 0; right: 0; margin-top: 4px; max-height: 240px; overflow-y: auto; background: #fff; border: 1px solid var(--gray-200); border-radius: 10px; }
.ac-opt { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--gray-100); }
.ac-opt:last-child { border-bottom: 0; }
.ac-opt:hover { background: var(--gray-50); }
.ac-opt .ac-sub { color: var(--gray-500); font-size: 12px; }
.ac-empty { padding: 12px; font-size: 13px; color: var(--gray-400); }

/* Paginación de livesearch (Bootstrap .pagination) unificada al look del paginador Trump */
.pagination { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; list-style: none; padding: 14px 10px 4px; margin: 0; }
.page-link { display: inline-flex; align-items: center; min-width: 32px; height: 32px; justify-content: center; margin: 0; padding: 0 10px; border: 1px solid var(--gray-300); border-radius: 8px; color: var(--gray-700); font-size: 13px; font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums; transition: var(--transition); }
.page-link:hover { border-color: var(--gold); color: var(--gold-ink); background: transparent; }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-item.disabled .page-link { opacity: .4; pointer-events: none; }

/* Checkbox + label en línea (reutilizable, ej. filtros en cabeceras) */
.check-inline { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; }
.check-inline input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--gold); cursor: pointer; }

/* ============================================
   LIVE SEARCH (livesearch.js)
   ============================================ */

.ls-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  max-height: 280px;
  overflow-y: auto;
}

.ls-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--gray-700);
  text-decoration: none;
  border-bottom: 1px solid var(--gray-100);
}

.ls-item:last-child { border-bottom: none; }

a.ls-item:hover { background: var(--primary-bg); color: var(--primary-dark); }

.ls-item-vacio { color: var(--gray-400); }

.ls-sub { color: var(--gray-500); font-size: 12px; }

button.ls-item {
  width: 100%;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

/* Variante estática: la lista de resultados fluye en el documento
   (para modales, donde el dropdown flotante queda cortado) */
.ls-estatico .ls-dropdown {
  position: static;
  margin-top: 8px;
  box-shadow: none;
  max-height: 320px;
}

button.ls-item:hover { background: var(--primary-bg); color: var(--primary-dark); }

/* ============================================
   CÓDIGOS QR / NFC POR APARTAMENTO
   ============================================ */

.qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.qr-celda {
  background: white;
  border: 2px dashed var(--gray-300);
  border-radius: var(--border-radius);
  padding: 16px;
  text-align: center;
  page-break-inside: avoid;
}

.qr-titulo { font-size: 20px; font-weight: 800; color: var(--gray-900); }

.qr-sub { font-size: 11px; color: var(--gray-500); letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 10px; }

.qr-canvas { display: flex; justify-content: center; margin: 0 auto; }

.qr-canvas img, .qr-canvas canvas { margin: 0 auto; }

.qr-leyenda { font-size: 12px; color: var(--gray-600); margin-top: 10px; }

.qr-url { font-size: 9px; color: var(--gray-400); word-break: break-all; margin-top: 6px; }

/* Impresión: solo el contenido (sirve para la hoja de QRs y reportes) */
@media print {
  .no-imprimir { display: none !important; }
  .sidebar, .top-header { display: none !important; }
  .content { margin-left: 0 !important; padding: 0 !important; }
  .qr-celda { border-color: var(--gray-400); }
}

/* ============================================
   PORTAL DE PROPIETARIOS (/portal)
   ============================================ */

.pp-body { background: var(--gray-50); }

.pp-topbar {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
}

.pp-topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pp-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

.pp-topbar .pp-wrap { padding: 14px 16px; }

.pp-titulo { font-weight: 700; line-height: 1; }

.pp-subtitulo { font-size: 12px; opacity: 0.85; }

.pp-salir { background: rgba(255, 255, 255, 0.2); color: #fff; }

.pp-salir:hover { background: rgba(255, 255, 255, 0.35); color: #fff; }

.pp-nav {
  display: flex;
  gap: 18px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--gray-200);
}

.pp-nav a {
  color: var(--gray-600);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 4px;
  border-bottom: 2px solid transparent;
}

.pp-nav a:hover { color: var(--primary); }

.pp-nav a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.pp-chips { display: flex; gap: 8px; flex-wrap: wrap; }

.pp-chip {
  padding: 5px 14px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  background: var(--gray-100);
  text-decoration: none;
  transition: var(--transition);
}

.pp-chip:hover { background: var(--primary-bg); color: var(--primary); }

.pp-chip.active { background: var(--primary); color: #fff; }

.pp-expensa-destacada { border-left: 4px solid var(--primary); }

/* Gráfico de barras: tiempo de limpieza por día (portal propietario) */
.pp-graf {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 150px;
  padding-top: 8px;
}

.pp-graf-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 4px;
  min-width: 0;
}

.pp-graf-val {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary-dark);
  white-space: nowrap;
}

.pp-graf-barra {
  width: 100%;
  max-width: 28px;
  background: var(--primary);
  border-radius: 5px 5px 0 0;
  transition: var(--transition);
}

.pp-graf-col.sin .pp-graf-barra {
  background: var(--gray-200);
  height: 3px !important;
}

.pp-graf-col.hoy .pp-graf-barra { background: var(--primary-dark); }

.pp-graf-dia {
  font-size: 9px;
  color: var(--gray-400);
  text-align: center;
  line-height: 1.3;
}

.pp-graf-col.hoy .pp-graf-dia { color: var(--primary-dark); font-weight: 700; }

/* Sección "Hoy" del historial del apartamento */
.pp-hoy {
  border-left: 4px solid var(--primary);
  background: linear-gradient(to right, var(--primary-bg), #fff 40%);
}

.pp-hoy-item {
  display: grid;
  grid-template-columns: 48px 112px 1fr;
  align-items: start;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}

.pp-hoy-item:last-child { border-bottom: none; }

.pp-hoy-hora {
  color: var(--primary-dark);
  font-size: 14px;
  line-height: 1.6;
}

/* Badge de tipo de evento con ancho fijo (alinea las columnas) */
.pp-badge-tipo {
  width: 112px;
  justify-content: center;
}

/* ============================================
   DISTRIBUCIÓN DIARIA (planilla de mucamas)
   ============================================ */

.dist-tabla { table-layout: fixed; }

.dist-tabla th.dist-col-equipo { width: 190px; }

.dist-tabla th.dist-col-hora { text-align: center; }

.dist-equipo-nombres { font-weight: 600; font-size: 13px; }

.dist-equipo-nombres div { padding: 1px 0; }

.dist-celda {
  text-align: center;
  vertical-align: middle;
  padding: 4px !important;
  height: 64px;
}

.dist-apto {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 6px 4px;
}

/* Fondo de la celda según ocupación del apartamento (tipo de trabajo) */
.dist-apto.oc-libre { background: #FFEDD5; border-color: #FDBA74; }
.dist-apto.oc-arribada { background: #DBEAFE; border-color: #93C5FD; }
.dist-apto.oc-ingresada { background: #FBCFE8; border-color: #F9A8D4; }

.dist-apto-numero { font-weight: 700; font-size: 14px; line-height: 1; }

.dist-apto .badge { font-size: 9px; padding: 2px 6px; }

.dist-quitar {
  position: absolute;
  top: 2px;
  right: 4px;
  border: 0;
  background: none;
  color: var(--gray-400);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  padding: 2px;
}

.dist-quitar:hover { color: var(--danger); }

.dist-celda-vacia {
  width: 100%;
  height: 100%;
  min-height: 52px;
  border: 1px dashed var(--gray-300);
  border-radius: 8px;
  background: none;
  color: var(--gray-300);
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition);
}

.dist-celda-vacia:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-bg);
}

.dist-personal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
}

.dist-personal-col h6 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-500);
  border-bottom: 2px solid var(--gray-200);
  padding-bottom: 6px;
  margin-bottom: 8px;
}

/* ============================================
   FICHA DE DETALLE (propietarios, etc.)
   ============================================ */

.ficha-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 991px) {
  .ficha-grid { grid-template-columns: 1fr; }
}

.ficha-col { display: flex; flex-direction: column; gap: 20px; }

.ficha-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.stat-box {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
  padding: 12px 16px;
}

.stat-box-label {
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 4px;
}

.stat-box-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--gray-900);
  font-variant-numeric: tabular-nums;
}

.saldo-debe { color: var(--danger); font-variant-numeric: tabular-nums; }
.saldo-favor { color: var(--success); font-variant-numeric: tabular-nums; }

.kv-list { display: flex; flex-direction: column; }
/* Grilla de 2 columnas para datos (tarjetas anchas); colapsa a 1 col en pantallas chicas */
.kv-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
@media (max-width: 640px) { .kv-grid2 { grid-template-columns: 1fr; } }

.kv-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}

.kv-item:last-child { border-bottom: none; }

.kv-label { color: var(--gray-500); white-space: nowrap; }

.kv-value { color: var(--gray-800); font-weight: 500; text-align: right; }

.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}

.list-row:last-child { border-bottom: none; }

.list-row a { text-decoration: none; color: var(--gray-700); }

.card-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-header-flex h5 { margin: 0; }

.link-sm { font-size: 13px; color: var(--primary); text-decoration: none; }

.link-sm:hover { color: var(--primary-dark); text-decoration: underline; }

/* Link que hereda el color del texto (nombres en tablas): clickable sin resaltar en dorado. */
.link-plain { color: inherit; text-decoration: none; }
.link-plain:hover { color: var(--primary-dark); text-decoration: underline; }

/* Heading styles */
.h1, h1 { font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--gray-900); }
.h2, h2 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--gray-900); }
.h3, h3 { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--gray-900); }
.h4, h4 { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--gray-900); }
.h5, h5 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--gray-900); }
.h6, h6 { font-size: 0.875rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--gray-900); }

/* ============================================
   Mapa de ocupación (Recepción)
   ============================================ */
.mapa-piso { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.mapa-piso-label { width: 56px; flex-shrink: 0; text-align: right; font-size: 12px; font-weight: 600; color: var(--gray-500); padding-top: 14px; }
.mapa-unidades { display: flex; flex-wrap: wrap; gap: 8px; }
.mapa-unidad { width: 68px; height: 48px; border-radius: var(--border-radius-sm); display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; background: var(--gray-200); border: 1px solid var(--gray-300); color: var(--gray-500); }
.mapa-unidad small { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; opacity: .8; }
.mapa-unidad.ocupada { background: #15803D; border-color: #166534; color: #fff; }
.mapa-unidad.arribada { background: var(--warning-bg); border-color: var(--warning); color: #92400E; }
.mapa-leyenda { display: flex; gap: 18px; align-items: center; font-size: 13px; color: var(--gray-600); }
.mapa-leyenda .muestra { display: inline-block; width: 18px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; border: 1px solid var(--gray-300); }
.mapa-leyenda .muestra.libre { background: var(--gray-200); }
.mapa-leyenda .muestra.ocupada { background: #15803D; border-color: #166534; }
.mapa-leyenda .muestra.arribada { background: var(--warning-bg); border-color: var(--warning); }

/* ============================================
   Páginas legales públicas (/privacidad)
   ============================================ */
.legal-page { max-width: 760px; margin: 0 auto; padding: 40px 24px 64px; }
.legal-marca { display: block; max-width: 180px; margin: 0 auto 8px; }
.legal-page > header { text-align: center; margin-bottom: 36px; }
.legal-page > header p { color: var(--gray-500); font-size: 14px; margin: 4px 0 0; }
.legal-page section { margin-bottom: 28px; }
.legal-page h2 { font-size: 1.15rem; margin-bottom: 8px; }
.legal-page p, .legal-page li { font-size: 14px; line-height: 1.7; color: var(--gray-700); }
.legal-page ul { padding-left: 20px; margin: 8px 0; }
.legal-page footer { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--gray-200); text-align: center; font-size: 12px; color: var(--gray-400); }

/* ============================================
   .lp-cardhead / .resv-head — EXTRAS propios.
   La apariencia base (banda, título, ícono, links) está en el
   "COMPONENTE ÚNICO de cabecera" (sección CARDS). Acá sólo lo específico.
   ============================================ */
/* Agrupa ícono+título como un solo item (headers con acción/contador a la derecha) */
.lp-cardhead-grp { display: flex; align-items: center; gap: 9px; }
/* Botón outline dentro del header, sobre banda carbón oscura */
.lp-cardhead .btn-outline { color: #f0e6cf; border-color: rgba(255,255,255,.35); background: transparent; }
.lp-cardhead .btn-outline:hover { background: rgba(255,255,255,.12); color: #fff; }
/* Slot de acciones a la derecha */
.resv-head .resv-head-actions, .lp-cardhead .lp-cardhead-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
/* La tarjeta recorta el header a sus esquinas redondeadas */
.lp-card-accent { overflow: hidden; }

/* ============================================
   Tema Trump — oro + carbón (aplicado directo, sin capas que se pisen)
   ============================================ */

/* Fondo neutro cálido + bordes hairline + filete dorado en KPIs */
body, .content { background: var(--app-bg); }
.card { border-color: var(--hairline); }
/* Filete azul superior en las tarjetas PLANAS (acento de acción). */
.card { border-top: 2px solid var(--primary); }
/* Las tarjetas con banda de header NO lo llevan: la banda ya es el acento y el
   filete recto arriba las hacía ver cuadradas. Vuelven al borde hairline normal. */
.card:has(> .lp-cardhead),
.card:has(> .card-header),
.card:has(> .resv-head) { border-top: 1px solid var(--hairline); }
.kpi-card::before { background: var(--gold); }

/* .card-header-flex = encabezado de sección de página (Recepción), no es tarjeta rellena:
   fila plana, título oscuro; el link a la derecha en bronce. */
.card-header-flex { margin-bottom: 14px; }
.card-header-flex .link-sm, .card-header-flex a:not(.btn) { color: var(--gold-ink); font-weight: 500; text-decoration: none; }
.card-header-flex .link-sm:hover, .card-header-flex a:not(.btn):hover { text-decoration: underline; }

/* ============================================
   Retema Trump — botones dorados + menú carbón
   ============================================ */
/* Botones primarios: relleno azul petróleo + texto blanco */
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }

/* Títulos de sección del menú: gris cálido tenue (el wordmark es el único héroe dorado) */
.sidebar-section { color: #c7cbd2; } /* módulos: gris claro legible (jerarquía); el oro queda para el activo/expandido */

/* Login: fondo carbón elegante (en vez del gradiente navy) */
.login-container { background: linear-gradient(135deg, #2e2e2e 0%, #0d0d0d 100%); }

/* ============================================
   Mini sistema de diseño Trump (coherencia)
   ============================================ */
/* Botones secundarios: contorno limpio (no beige lavado), hover con borde dorado */
.btn-secondary, .btn-light { background: #fff; color: #2e2e2e; border: 1px solid var(--gray-300); }
.btn-secondary:hover, .btn-light:hover { background: #fff; color: #151515; border-color: var(--gold); }
/* Tipografía: Montserrat en todo el sistema (geométrica, look premium/hotelero).
   La serif (Playfair) queda reservada SOLO al wordmark del logo. */
h1, h2, h3, h4, h5, h6, .page-title { font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; line-height: 1.25; text-wrap: balance; }

/* ============================================
   Pulido premium — profundidad + definición
   ============================================ */
/* Tarjetas como "papel de calidad": borde casi imperceptible + sombra suave */
.card, .kpi-card { border: 1px solid rgba(0,0,0,.05); box-shadow: 0 1px 2px rgba(0,0,0,.03), 0 8px 22px rgba(0,0,0,.05); }
/* Barra superior blanca limpia sobre el fondo gris frío */
.top-header { background: #fff; border-bottom: 1px solid var(--gray-200); }
/* Estados vacíos: más aire y tono sobrio */
td.text-center.text-muted { color: var(--gray-400); font-style: italic; padding: 2.75rem 1rem !important; }

/* ============================================
   Wordmark TRUMP TOWER (recreación del logo oficial, en serif sobre el carbón)
   ============================================ */
.tt-wordmark { text-align: center; padding: 10px 6px 6px; }
.tt-1 { display: block; font-family: 'Playfair Display', Georgia, serif; font-weight: 600; font-size: 27px; letter-spacing: .12em; color: #f4efe6; line-height: .92; }
.tt-2 { display: block; font-family: 'Playfair Display', Georgia, serif; font-weight: 500; font-size: 15px; letter-spacing: .26em; color: #f4efe6; margin-top: 3px; padding-left: .26em; }
.tt-rule { display: block; height: 1px; width: 86%; margin: 9px auto 7px; background: var(--brand-gold); opacity: .75; }
.tt-sub { display: block; font-family: 'Playfair Display', Georgia, serif; font-size: 10px; letter-spacing: .3em; color: #d6bd93; padding-left: .3em; }

/* ============================================
   Consistencia: otros encabezados al mismo lenguaje (serif + filete dorado)
   ============================================ */
.section-title, .dash-widget-header h5, .dash-widget-header h4, .stat-card-header h5 {
    font-family: 'Montserrat', -apple-system, 'Segoe UI', Roboto, sans-serif; font-weight: 700;
}
.dash-widget-header { border-bottom: 2px solid var(--gold); padding-bottom: 9px; margin-bottom: 12px; }

/* ============================================
   Fix azul de Bootstrap — estados :active/:focus y anillos de foco → dorado
   ============================================ */
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:focus-visible,
.btn-primary:active,
.btn-primary.active,
.btn-primary:first-child:active,
.btn-check:checked + .btn-primary,
.btn-check:active + .btn-primary {
    background-color: var(--primary-dark) !important;
    color: #fff !important;
    border-color: var(--primary-dark) !important;
}
/* Anillo de foco dorado (no azul) en botones/controles tipo botón */
.btn:focus-visible, .btn-primary:focus-visible, .btn-secondary:focus-visible,
.lp-page:focus-visible, .modulo-tab:focus-visible, .sidebar nav a:focus-visible {
    box-shadow: 0 0 0 .2rem rgba(30,111,159,.35) !important;
    outline: none;
}
/* Links de texto: contorno dorado (accesibilidad, todo el sistema) */
a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 3px; }
.form-control:focus, .form-select:focus, .form-check-input:focus,
input:focus, textarea:focus, select:focus {
    border-color: var(--gold) !important;
    box-shadow: 0 0 0 .2rem rgba(30,111,159,.25) !important;
    outline: none;
}
.form-check-input:checked { background-color: var(--gold) !important; border-color: var(--gold) !important; }

/* Ícono dorado inline para cabeceras PLANAS (.card-header claro, no rellenas) */
.ch-ico { color: var(--cardhead-icon); font-size: 16px; margin-right: 8px; vertical-align: -1px; line-height: 1; }
/* La cabecera rellena agrupa ícono+título a la izquierda; la acción va a la derecha
   con .resv-head-actions/.lp-cardhead-actions (margin-left:auto). */
/* Ícono + título SIEMPRE juntos a la izquierda (la acción va a la derecha con margin-left:auto).
   Se sube la especificidad para ganarle a `.card > .card-header { space-between }`. */
.card > .card-header.resv-head, .card > .card-header.lp-cardhead,
.resv-head, .lp-cardhead, .resv-cat-bar { justify-content: flex-start; }

/* Tarjetas de métrica (Recepción .stat-box = Control de Acceso .stat-card):
   filete azul superior (acento de acción) + borde fino y sombra suave. */
.stat-card { border-top: 2px solid var(--primary); border-radius: 12px; }
.stat-box {
    border: 1px solid var(--gray-200);
    border-top: 2px solid var(--primary);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,.03), 0 8px 22px rgba(0,0,0,.05);
    position: relative;
}
.stat-box .stat-ico { display: none; }
.stat-box a { color: inherit; text-decoration: none; display: block; }
.stat-box.is-active { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(30,111,159,.28), 0 8px 22px rgba(0,0,0,.05); }

/* ============================================
   Utilitarias globales (reemplazan inline repetido — regla: nunca inline)
   ============================================ */
.u-m0 { margin: 0; }
.u-m0-fs14 { margin: 0; font-size: 14px; }
.u-tar { text-align: right; }
.u-tac { text-align: center; }
.u-fw5 { font-weight: 500; }
.u-fw6 { font-weight: 600; }
.u-fw7 { font-weight: 700; }
.u-danger { color: var(--danger); }
.u-nowrap { white-space: nowrap; }
.u-fs11 { font-size: 11px; }
.u-fs12 { font-size: 12px; }
.u-fs13 { font-size: 13px; }
.u-muted12 { font-size: 12px; color: var(--gray-500); }
.u-muted13 { font-size: 13px; color: var(--gray-500); }
.u-dinline { display: inline; }
.u-ico16 { width: 16px; height: 16px; }
.u-ico14 { width: 14px; height: 14px; }
/* Botón-ícono de acción destructiva: neutro, se pone rojo al hover */
.act-danger { color: var(--gray-400) !important; }
.act-danger:hover { color: var(--danger) !important; border-color: var(--danger) !important; background: #FEF2F2 !important; }
.u-ico20 { width: 20px; height: 20px; }
.u-p16 { padding: 16px; }
.u-flexg8 { display: flex; gap: 8px; }
.u-flex-center { display: flex; align-items: center; }
.u-p0 { padding: 0; }
.u-flex1 { flex: 1; }
.u-mb8 { margin-bottom: 8px; }
.u-mb16 { margin-bottom: 16px; }
.u-mt16 { margin-top: 16px; }
.u-ico24 { width: 24px; height: 24px; }
.u-w100 { width: 100%; }
.u-fs14 { font-size: 14px; }
.u-p1216 { padding: 12px 16px; }
.u-fs12-mb8 { font-size: 12px; margin-bottom: 8px; }
.u-fs11up { font-size: 11px; text-transform: uppercase; }
.u-muted11 { font-size: 11px; color: var(--gray-500); }

/* ============================================
   Reservas de áreas (.resv-*) — paleta Trump (calendario + chips + barra categoría)
   ============================================ */
.resv-layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .resv-layout { grid-template-columns: 1fr; } }

/* Calendario */
.resv-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.resv-cal-title { font-weight: 700; font-size: 15px; text-transform: capitalize; }
.resv-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.resv-dow { text-align: center; font-size: 11px; font-weight: 600; color: var(--gray-500); padding: 2px 0; text-transform: uppercase; }
.resv-day { position: relative; min-height: 50px; border: 1px solid var(--hairline); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--gray-700); font-size: 14px; transition: background .15s, border-color .15s; }
.resv-day:hover { background: var(--primary-bg); }
.resv-day.empty { border: 0; background: transparent; }
.resv-day.today { border-color: var(--gold); }
.resv-day.sel { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.resv-badge { font-size: 10px; font-weight: 700; background: var(--gold); color: #fff; border-radius: 10px; padding: 0 6px; min-width: 16px; text-align: center; line-height: 16px; }
.resv-day.sel .resv-badge { background: #fff; color: var(--primary); }

/* Chips de reserva / libre */
.resv-turno-cell { min-height: 30px; }
.resv-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--primary-bg); border: 1px solid var(--hairline); border-radius: 20px; padding: 4px 10px; font-size: 12.5px; cursor: pointer; transition: background .15s; text-align: left; }
.resv-chip:hover { background: #efe6d4; }
.resv-chip .resv-chip-h { font-weight: 700; color: var(--gold-ink); }
.resv-chip .resv-chip-n { color: var(--gray-600); }
.resv-libre { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px dashed var(--gray-300); border-radius: 20px; padding: 4px 12px; font-size: 12.5px; color: var(--gray-500); cursor: pointer; }
.resv-libre:hover { border-color: var(--gold); color: var(--gold-ink); }
.resv-libre.locked { cursor: default; border-style: solid; }
.resv-libre.locked:hover { border-color: var(--gray-300); color: var(--gray-500); }

/* Resumen / leyenda */
.resv-leyenda { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--gray-600); }
.resv-leyenda .m { display: inline-block; width: 16px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 8px; }
.resv-resumen-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--gray-100); font-size: 14px; }
.resv-resumen-row:last-child { border-bottom: 0; }

/* Reservas de áreas: la barra de categoría usa el componente único de header;
   sólo conserva el recorte de esquinas y la acción a la derecha. */
.resv-area-card { overflow: hidden; }
.resv-cat-link { margin-left: auto; white-space: nowrap; }

/* ============================================
   LOGIN — layout partido (foto + panel), estilo Le Parc/Solanas en paleta Trump
   (el .login-container viejo lo sigue usando el portal de propietarios)
   ============================================ */
/* La foto cubre TODO el contenedor: el hero la oscurece a la izquierda y
   el panel-vidrio la deja ver difuminada a la derecha (no queda negro plano). */
.lg-wrap { display: flex; min-height: 100vh; background: #1e1e1e url('/assets/img/login-trump.jpg') center 58% / cover no-repeat; }

/* Lado foto (desktop) — degradé más suave para que la foto tenga vida,
   con base inferior para que el wordmark siga legible */
.lg-hero { position: relative; flex: 1.15; }
.lg-hero::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(105deg, rgba(18,18,18,.46) 0%, rgba(18,18,18,.10) 44%, rgba(18,18,18,.30) 100%),
                linear-gradient(180deg, rgba(18,18,18,.32) 0%, rgba(18,18,18,0) 26%, rgba(18,18,18,0) 52%, rgba(18,18,18,.74) 100%);
}
.lg-brand { position: absolute; left: 56px; bottom: 52px; z-index: 1; color: #fff; }
.lg-b1 { font-family: 'Playfair Display', Georgia, serif; font-weight: 600; letter-spacing: .34em; font-size: 15px; opacity: .95; }
.lg-b2 { font-family: 'Playfair Display', Georgia, serif; font-weight: 600; font-size: 40px; line-height: 1.05; margin-top: 8px; }
.lg-rule { width: 64px; height: 2px; background: var(--brand-gold); margin: 16px 0 12px; }
.lg-b3 { font-size: 12px; letter-spacing: .28em; text-transform: uppercase; opacity: .82; }

/* Panel del formulario */
.lg-panel { flex: 0 0 480px; background: rgba(18,18,18,.73); backdrop-filter: blur(14px) saturate(1.05); -webkit-backdrop-filter: blur(14px) saturate(1.05); display: flex; align-items: center; justify-content: center; padding: 48px 44px; }
.lg-card { width: 100%; max-width: 360px; }

/* Logo oficial (dorado) sobre el panel de vidrio */
.lg-logo { display: block; width: 100%; max-width: 168px; margin: 0 auto; border-radius: 8px; box-shadow: 0 10px 34px rgba(0,0,0,.5); }

/* Bienvenida (reemplaza el "Sistema de Gestión" repetido y llena el aire muerto) */
.lg-welcome { text-align: center; font-family: 'Playfair Display', Georgia, serif; font-weight: 600; font-size: 24px; color: #f3efe8; margin: 22px 0 4px; }
.lg-welcome-sub { text-align: center; color: rgba(255,255,255,.55); font-size: 13px; margin: 0 0 28px; }

.lg-alert { margin-bottom: 20px; }

/* Campos oscuros translúcidos (cohesión con el panel de vidrio) */
.lg-card .form-label { font-weight: 600; font-size: 13px; color: #d8d3ca; }
.lg-card .form-control {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.16);
    color: #f2efe9;
}
.lg-card .form-control::placeholder { color: rgba(255,255,255,.38); }
.lg-card .form-control:focus {
    background: rgba(255,255,255,.09);
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(30,111,159,.30);
}
/* Autocompletar del navegador: mantener el campo oscuro con texto claro.
   Se usa !important y se cubren TODOS los estados (incl. :focus/:active) porque
   la regla .form-control:focus define su propio box-shadow y, sin esto, al
   enfocar el campo autocompletado volvía a mostrarse el fondo claro nativo. */
.lg-card input:-webkit-autofill,
.lg-card input:-webkit-autofill:hover,
.lg-card input:-webkit-autofill:active {
    -webkit-text-fill-color: #f2efe9 !important;
    -webkit-box-shadow: 0 0 0 40px #24231f inset !important;
    box-shadow: 0 0 0 40px #24231f inset !important;
    caret-color: #f2efe9;
    border: 1px solid rgba(255,255,255,.16);
}
.lg-card input:-webkit-autofill:focus {
    -webkit-text-fill-color: #f2efe9 !important;
    -webkit-box-shadow: 0 0 0 40px #24231f inset, 0 0 0 3px rgba(30,111,159,.30) !important;
    box-shadow: 0 0 0 40px #24231f inset, 0 0 0 3px rgba(30,111,159,.30) !important;
    caret-color: #f2efe9;
    border-color: var(--primary-light);
}
.lg-field { margin-bottom: 18px; }

/* Link recuperar clave */
.lg-forgot { display: block; text-align: right; font-size: 12.5px; color: rgba(255,255,255,.55); text-decoration: none; margin: -6px 0 18px; }
.lg-forgot:hover { color: var(--primary-light); text-decoration: underline; }

/* Recordarme con checkbox en el azul de la app */
.lg-remember { display: flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(255,255,255,.72); cursor: pointer; margin: 2px 0 22px; }
.lg-remember input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

/* CTA: azul petróleo de la app (sin btn-primary para no chocar con !important) */
.lg-submit { width: 100%; padding: 13px; justify-content: center; font-size: 14px; font-weight: 700; letter-spacing: .02em; background: linear-gradient(180deg, #2a86bd 0%, #1E6F9F 100%); color: #fff; border: 0; }
.lg-submit:hover { background: linear-gradient(180deg, #3494cc 0%, #2379ab 100%); color: #fff; }
.lg-foot { margin-top: 30px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); text-align: center; }
.lg-foot p { font-size: 12px; color: rgba(255,255,255,.45); margin: 0; }
.lg-foot a { color: var(--primary-light); text-decoration: none; font-weight: 600; }

/* Móvil: se oculta el hero y la foto pasa a ser el fondo del panel */
@media (max-width: 880px) {
    .lg-hero { display: none; }
    .lg-wrap {
        background: linear-gradient(180deg, rgba(18,18,18,.38), rgba(18,18,18,.72)),
                    url('/assets/img/login-trump.jpg') center 58% / cover no-repeat fixed;
    }
    .lg-panel { flex: 1; background: transparent; padding: 24px; }
    .lg-card { background: rgba(18,18,18,.73); backdrop-filter: blur(14px) saturate(1.05); -webkit-backdrop-filter: blur(14px) saturate(1.05); border-radius: 18px; padding: 34px 26px; box-shadow: 0 24px 70px rgba(0,0,0,.55); }
}
