/* ==========================================================================
   EL MULATO CABARET — ESTILOS ULTRA LUXURY
   Paleta: Obsidiana (#0A0D14), Oro Champaña (#F59E0B), Rojo Terciopelo (#E11D48), Esmeralda (#10B981)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;0,700;0,800;1,600&display=swap');

:root {
  --bg-main: #07090E;
  --bg-card: #0F141F;
  --bg-card-hover: #161D2D;
  --bg-glass: rgba(15, 20, 31, 0.85);
  
  --gold-primary: #F59E0B;
  --gold-glow: #FBBF24;
  --gold-dark: #B45309;
  
  --emerald-free: #10B981;
  --emerald-glow: rgba(16, 185, 129, 0.4);
  
  --ruby-booked: #E11D48;
  --ruby-glow: rgba(225, 29, 72, 0.4);
  
  --amber-locked: #F97316;
  --amber-glow: rgba(249, 115, 22, 0.4);

  --text-main: #F3F4F6;
  --text-muted: #9CA3AF;
  --text-dim: #6B7280;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(245, 158, 11, 0.35);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-gold: 0 10px 25px -5px rgba(245, 158, 11, 0.2);
  --shadow-card: 0 20px 40px rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ── HEADER PRINCIPAL ─────────────────────────────────────────────────── */
header {
  background: rgba(11, 14, 22, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo-crown {
  font-size: 26px;
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.6));
}

.brand-titles h1 {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #FFFFFF;
  margin: 0;
}

.brand-titles h1 span {
  color: var(--gold-primary);
}

.brand-badge {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold-glow);
  font-weight: 600;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-tab-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab-btn.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.3) 100%);
  color: var(--gold-primary);
  border-color: var(--border-gold);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.15);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: var(--radius-full);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  color: #000;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 12px;
  font-weight: 700;
  color: #FFF;
}

.user-role {
  font-size: 10px;
  color: var(--gold-primary);
  text-transform: uppercase;
  font-weight: 600;
}

.btn-logout {
  background: transparent;
  border: 0;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
  display: grid;
  place-items: center;
}

.btn-logout:hover {
  color: var(--ruby-booked);
}

/* ── PÍLDORA DE ESTADO EN TIEMPO REAL (SEMÁFORO) ──────────────────────── */
.realtime-status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  color: #10B981;
  cursor: default;
  user-select: none;
  transition: all 0.3s ease;
}

.realtime-status-pill.is-superadmin {
  cursor: pointer;
}

.realtime-status-pill.is-superadmin:hover {
  transform: scale(1.03);
  filter: brightness(1.2);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.realtime-status-pill .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
  animation: pulseDot 2s infinite ease-in-out;
}

.realtime-status-pill.syncing {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: #F59E0B;
}

.realtime-status-pill.syncing .status-dot {
  background: #F59E0B;
  box-shadow: 0 0 8px #F59E0B;
}

.realtime-status-pill.offline {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #EF4444;
}

.realtime-status-pill.offline .status-dot {
  background: #EF4444;
  box-shadow: 0 0 8px #EF4444;
  animation: none;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.btn-sync-action {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-sync-action:hover {
  background: rgba(245, 158, 11, 0.1);
  border-color: var(--border-gold);
  color: var(--gold-primary);
}

.btn-sync-action.btn-diag:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.5);
  color: #60a5fa;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.btn-sync-action.spinning #syncIconSpin {
  display: inline-block;
  animation: spinIcon 0.8s linear infinite;
}

@keyframes spinIcon {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ── CONTENEDOR PRINCIPAL ─────────────────────────────────────────────── */
.app-container {
  max-width: 1540px;
  margin: 0 auto;
  padding: 20px;
}

/* ── BARRA SUPERIOR DE FILTROS Y ESTADÍSTICAS ─────────────────────────── */
.toolbar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.toolbar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.date-selector-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.date-selector-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.custom-date-input {
  background: var(--bg-main);
  border: 1px solid var(--border-gold);
  color: #FFF;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.custom-date-input::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

.quick-date-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FFF;
}

.chip-btn.active {
  background: var(--gold-primary);
  color: #000;
  font-weight: 700;
  border-color: var(--gold-glow);
}

.chip-btn.event-vip {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.35));
  border: 1px solid var(--gold-primary);
  color: #FDE68A;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
  font-weight: 700;
}

.chip-btn.event-vip:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.35), rgba(217, 119, 6, 0.5));
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.45);
  color: #FFF;
}

.chip-btn.event-vip.active {
  background: var(--gold-primary);
  color: #000;
  border-color: var(--gold-glow);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.6);
}

.show-info-badge {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid var(--border-gold);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--gold-glow);
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.btn-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-action:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-action.gold {
  background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
  color: #000;
  border-color: var(--gold-glow);
  font-weight: 700;
}

.btn-action.gold:hover {
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

/* ── BARRA DE KPIS METRICS ────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.stat-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
}

.stat-box .stat-val {
  font-size: 24px;
  font-weight: 800;
  color: #FFF;
}

.stat-box .stat-lbl {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-box .stat-sub {
  font-size: 11px;
  color: #94A3B8;
  margin-top: 4px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.stat-box .stat-sub strong {
  color: #F8FAFC;
  font-weight: 700;
}

.stat-box.green .stat-val { color: var(--emerald-free); }
.stat-box.red .stat-val { color: var(--ruby-booked); }
.stat-box.gold .stat-val { color: var(--gold-glow); }
.stat-box.orange .stat-val { color: var(--amber-locked); }

/* ── LAYOUT PRINCIPAL: PLANO 3D + PANEL DERECHO ───────────────────────── */
.main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 20px;
  align-items: start;
}

/* ── CANVAS DEL MAPA 3D ───────────────────────────────────────────────── */
.map-viewport-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.map-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.map-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
}

.legend-dot.green { background: var(--emerald-free); box-shadow: 0 0 8px var(--emerald-free); }
.legend-dot.red { background: var(--ruby-booked); box-shadow: 0 0 8px var(--ruby-booked); }
.legend-dot.orange { background: var(--amber-locked); box-shadow: 0 0 8px var(--amber-locked); }
.legend-dot.purple { background: #A855F7; box-shadow: 0 0 8px #A855F7; }
.legend-dot.gold { background: var(--gold-primary); box-shadow: 0 0 8px var(--gold-primary); }

.zoom-controls {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 2px 6px;
}

.zoom-btn {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transition: all 0.15s;
}

.zoom-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FFF;
}

/* Área Scrolleable del Mapa */
.map-canvas-wrapper {
  overflow: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: #000;
  position: relative;
  max-height: 780px;
  display: flex;
  justify-content: center;
}

/* ── SELECTOR DE PISOS (PRIMER Y SEGUNDO PISO) ── */
.floor-selector-container {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  width: 100%;
}

.floor-selector-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-muted);
  text-align: left;
}

.floor-selector-btn:hover {
  border-color: rgba(245, 158, 11, 0.4);
  background: var(--bg-card-hover);
  color: var(--text-main);
  transform: translateY(-1px);
}

.floor-selector-btn.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(245, 158, 11, 0.04));
  border: 1.5px solid var(--gold-primary);
  color: #FFFFFF;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.22);
}

.floor-icon {
  font-size: 26px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.floor-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.floor-title {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--gold-primary);
}

.floor-selector-btn.active .floor-title {
  color: #FBBF24;
}

.floor-desc {
  font-size: 11.5px;
  color: var(--text-muted);
}

.map-canvas-wrapper {
  width: 100%;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 10px 0;
  -webkit-overflow-scrolling: touch;
}

.floor-plan-container {
  position: relative;
  width: 800px;
  height: 1150px;
  transform-origin: top center;
  transition: transform 0.2s ease-out;
  flex-shrink: 0;
}

.floor-plan-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  pointer-events: none;
}

.floor-plan-svg-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  user-select: none;
  pointer-events: none;
  z-index: 1;
}

.floor-plan-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ── PINS / HOTSPOTS INTERACTIVOS DE MESAS SOBRE EL PLANO ─────────────── */
.table-hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  font-weight: 800;
  font-size: 11px;
  border-radius: 50%;
  z-index: 10;
  user-select: none;
}

.table-hotspot:hover {
  transform: translate(-50%, -50%) scale(1.35);
  z-index: 30;
}

/* Estados de las Mesas */
.table-hotspot.disponible {
  background: rgba(16, 185, 129, 0.88);
  color: #FFFFFF;
  border: 1.5px solid #A7F3D0;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

.table-hotspot.disponible:hover {
  box-shadow: 0 0 18px var(--emerald-free);
  background: #10B981;
}

.table-hotspot.ocupada {
  background: rgba(225, 29, 72, 0.92);
  color: #FFFFFF;
  border: 1.5px solid #FECDD3;
  box-shadow: 0 0 10px rgba(225, 29, 72, 0.6);
}

.table-hotspot.bloqueada-temporal {
  background: rgba(249, 115, 22, 0.92);
  color: #FFFFFF;
  border: 1.5px solid #FFEDD5;
  box-shadow: 0 0 12px var(--amber-locked);
  animation: pulse-orange 1.8s infinite ease-in-out;
}

.table-hotspot.bloqueada-indefinida {
  background: rgba(147, 51, 234, 0.92);
  color: #FFFFFF;
  border: 1.5px solid #F3E8FF;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.6);
}

.table-hotspot.bloqueada-indefinida:hover {
  background: #9333EA;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.9);
}

.table-hotspot.seleccionada {
  background: #F59E0B !important;
  color: #000000 !important;
  border: 2.5px solid #FFFFFF !important;
  box-shadow: 0 0 25px #F59E0B !important;
  transform: translate(-50%, -50%) scale(1.4) !important;
  z-index: 40 !important;
}

/* Variaciones de forma según tipo de mesa */
.table-hotspot.palco {
  border-radius: var(--radius-sm);
  letter-spacing: -0.5px;
}

.table-hotspot.vip {
  border-radius: 50%;
  font-size: 10px;
}

.table-hotspot.balcon {
  border-radius: 50%;
  font-size: 10px;
}

.table-hotspot.lobby {
  border-radius: 50%;
  font-size: 10px;
}

/* Montaje Gala San Silvestre: Tablones rectangulares de 8 PAX */
.table-hotspot.tablon {
  border-radius: 6px;
  font-weight: 800;
  letter-spacing: -0.3px;
  border-width: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

@keyframes pulse-orange {
  0%, 100% { box-shadow: 0 0 8px rgba(249, 115, 22, 0.4); }
  50% { box-shadow: 0 0 20px rgba(249, 115, 22, 0.8); }
}

/* ── LIVE VIEWER PRESENCE (USUARIOS EN VIVO VIENDO MESAS) ───────────────── */
.table-hotspot.viewed-live {
  border-color: #22D3EE !important;
  animation: pulse-live-viewer 2s infinite ease-in-out;
}

@keyframes pulse-live-viewer {
  0% {
    box-shadow: 0 0 0 1.5px #22D3EE, 0 0 10px rgba(34, 211, 238, 0.65);
  }
  50% {
    box-shadow: 0 0 0 4.5px #22D3EE, 0 0 22px rgba(34, 211, 238, 0.95);
  }
  100% {
    box-shadow: 0 0 0 1.5px #22D3EE, 0 0 10px rgba(34, 211, 238, 0.65);
  }
}

.table-hotspot.viewed-live.seleccionada {
  box-shadow: 0 0 0 3px #22D3EE, 0 0 25px #F59E0B !important;
}

/* Badge flotante con micro-animación sobre la mesa */
.live-viewer-chip {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, #0891B2, #06B6D4);
  color: #FFFFFF;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  padding: 2.5px 5px;
  border-radius: 9px;
  border: 1px solid #A5F3FC;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.75);
  pointer-events: none;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 2px;
  animation: bounce-live-chip 2.2s infinite ease-in-out;
}

.live-viewer-chip.self {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  border-color: #FDE68A;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.85);
}

@keyframes bounce-live-chip {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* Alerta de urgencia / social proof en el Panel Lateral y Mobile Bottom Sheet */
.live-viewer-alert {
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.22), rgba(6, 182, 212, 0.12));
  border: 1px solid #0891B2;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 11.5px;
  color: #A5F3FC;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  animation: fadeInLiveAlert 0.3s ease-out;
}

.live-viewer-alert.self-viewing {
  background: rgba(6, 182, 212, 0.12);
  border: 1px dashed rgba(34, 211, 238, 0.45);
  color: #A5F3FC;
}

.live-viewer-alert.active-collision {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.22), rgba(249, 115, 22, 0.22));
  border: 1.5px solid #F97316;
  color: #FFEDD5;
  animation: pulseCollision 1.5s infinite ease-in-out;
}

@keyframes pulseCollision {
  0%, 100% { box-shadow: 0 0 8px rgba(249, 115, 22, 0.4); }
  50% { box-shadow: 0 0 20px rgba(249, 115, 22, 0.85); }
}

.live-viewer-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22D3EE;
  box-shadow: 0 0 8px #22D3EE;
  flex-shrink: 0;
  animation: pulse-live-dot 1.2s infinite ease-in-out;
}

@keyframes pulse-live-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.5; }
}

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

/* ── PANEL LATERAL DERECHO DE DETALLE DE RESERVA ──────────────────────── */
.side-panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 90px;
}

.side-panel-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.side-panel-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: #FFF;
}

.side-panel-header p {
  font-size: 12px;
  color: var(--text-muted);
}

.mesa-preview-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mesa-preview-empty {
  text-align: center;
  padding: 30px 10px;
  color: var(--text-dim);
  font-size: 13px;
}

.mesa-preview-empty span {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}

.mesa-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
}

.mesa-info-row .label {
  color: var(--text-muted);
}

.mesa-info-row .value {
  font-weight: 700;
  color: #FFF;
}

.mesa-info-row .value.gold {
  color: var(--gold-glow);
}

.status-pill {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-pill.disponible { background: rgba(16, 185, 129, 0.2); color: var(--emerald-free); border: 1px solid var(--emerald-free); }
.status-pill.ocupada { background: rgba(225, 29, 72, 0.2); color: var(--ruby-booked); border: 1px solid var(--ruby-booked); }
.status-pill.bloqueada-temporal { background: rgba(249, 115, 22, 0.2); color: var(--amber-locked); border: 1px solid var(--amber-locked); }

.side-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-reserve-trigger {
  background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
  color: #000;
  border: 0;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-gold);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-reserve-trigger:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.btn-reserve-trigger:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-release-table {
  background: transparent;
  color: var(--ruby-booked);
  border: 1px solid rgba(225, 29, 72, 0.4);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.btn-release-table:hover {
  background: rgba(225, 29, 72, 0.15);
  border-color: var(--ruby-booked);
  transform: translateY(-1px);
}

.btn-whatsapp-action {
  background: rgba(37, 211, 102, 0.12);
  color: #25D366;
  border: 1px solid rgba(37, 211, 102, 0.4);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-whatsapp-action:hover {
  background: rgba(37, 211, 102, 0.22);
  border-color: #25D366;
  transform: translateY(-1px);
}

.btn-extend-lock {
  background: rgba(249, 115, 22, 0.12);
  color: var(--amber-locked);
  border: 1px solid rgba(249, 115, 22, 0.4);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-extend-lock:hover {
  background: rgba(249, 115, 22, 0.22);
  border-color: var(--amber-locked);
  transform: translateY(-1px);
}

.btn-edit-reservation {
  background: rgba(212, 160, 23, 0.12);
  color: var(--gold-glow);
  border: 1px solid rgba(212, 160, 23, 0.4);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-edit-reservation:hover {
  background: rgba(212, 160, 23, 0.22);
  border-color: var(--gold-primary);
  transform: translateY(-1px);
}

/* ── MODAL DE RESERVA VIP ─────────────────────────────────────────────── */
.modal-overlay,
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  place-items: center;
  padding: 20px;
  z-index: 200;
}

.modal-overlay.active,
.modal-backdrop.active {
  display: grid;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  width: min(540px, 100%);
  padding: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: modal-pop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

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

.modal-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  color: #FFF;
}

.modal-header h3 span {
  color: var(--gold-primary);
}

.modal-close-btn {
  background: transparent;
  border: 0;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
}

.modal-close-btn:hover {
  color: #FFF;
}

.modal-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full {
  grid-column: span 2;
}

.form-group label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.form-control {
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  color: #FFF;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  outline: none;
  font-family: inherit;
  transition: border 0.15s;
}

.form-control:focus {
  border-color: var(--gold-primary);
}

.wompi-box {
  grid-column: span 2;
  background: rgba(245, 158, 11, 0.08);
  border: 1px dashed var(--border-gold);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.wompi-info {
  font-size: 12px;
  color: var(--gold-glow);
}

.btn-generate-wompi {
  background: var(--gold-primary);
  color: #000;
  border: 0;
  font-weight: 700;
  font-size: 11px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
}

/* ── TABLA DE AUDITORÍA Y REPORTES ────────────────────────────────────── */
.audit-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.audit-table-wrap {
  overflow-x: auto;
  margin-top: 16px;
}

.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.audit-table th {
  background: rgba(0, 0, 0, 0.5);
  color: var(--gold-glow);
  text-align: left;
  padding: 12px 14px;
  border-bottom: 2px solid var(--border-gold);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.audit-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.audit-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* ── PANTALLA DE LOGIN ────────────────────────────────────────────────── */
.login-view-wrapper {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at center, #161D2D 0%, #07090E 100%);
  padding: 20px;
}

.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  width: min(420px, 100%);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: center;
}

.login-crown {
  font-size: 38px;
  margin-bottom: 4px;
}

.login-box h2 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: #FFF;
}

.login-box h2 span {
  color: var(--gold-primary);
}

.login-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.quick-user-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}

.user-quick-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
}

.user-quick-chip:hover {
  background: var(--gold-primary);
  color: #000;
  font-weight: 700;
}

/* ── RESPONSIVE ───────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  .side-panel-card {
    position: static;
  }
}

@media (max-width: 768px) {
  header {
    padding: 10px 16px;
  }
  .brand-titles h1 {
    font-size: 17px;
  }
  .toolbar-header {
    flex-direction: column;
    align-items: stretch;
  }
  .modal-form {
    grid-template-columns: 1fr;
  }
  .form-group.full {
    grid-column: span 1;
  }
}

/* ── NOTIFICACIONES TOAST LUXURY ───────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.luxury-toast {
  background: rgba(15, 20, 31, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in 0.3s ease-out;
  pointer-events: auto;
  max-width: 380px;
}

.luxury-toast.success { border-color: var(--emerald-free); }
.luxury-toast.warning { border-color: var(--gold-primary); }
.luxury-toast.error { border-color: var(--ruby-booked); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── MODO SELECCIÓN MÚLTIPLE (GRUPOS GRANDES) ─────────────────────────── */
.multi-select-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid var(--border-gold);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--gold-glow);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
}

.multi-select-toggle:hover {
  background: rgba(245, 158, 11, 0.16);
  border-color: var(--gold-primary);
}

.multi-select-toggle input {
  accent-color: var(--gold-primary);
  cursor: pointer;
  width: 14px;
  height: 14px;
}

.multi-select-toggle.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(217, 119, 6, 0.35) 100%);
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

/* ── SECCIÓN EDITOR Y CALIBRADOR DE MESAS (100% CONFIGURABLE) ─────────── */
.editor-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.3s ease;
}

.editor-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

.editor-actions-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.editor-grid-layout {
  display: grid;
  grid-template-columns: 1fr 390px;
  gap: 16px;
  align-items: start;
}

@media (max-width: 1100px) {
  .editor-grid-layout {
    grid-template-columns: 1fr;
  }
}

.editor-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.editor-table-filter {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.25);
  flex-wrap: wrap;
  align-items: center;
}

.editor-table-filter input, .editor-table-filter select {
  background: #0D1117;
  border: 1px solid var(--border-subtle);
  color: #FFF;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.editor-table-scroll {
  max-height: 620px;
  overflow-x: auto;
  overflow-y: auto;
}

.config-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 12px;
}

.config-table th {
  background: rgba(0, 0, 0, 0.6);
  padding: 10px 14px;
  text-align: left;
  color: var(--text-muted);
  font-weight: 700;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--border-subtle);
}

.config-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  white-space: nowrap;
}

.config-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.config-table tr.selected {
  background: rgba(245, 158, 11, 0.14) !important;
  border-left: 3px solid var(--gold-primary);
}

.config-input-sm {
  background: #0B0E14;
  border: 1px solid var(--border-subtle);
  color: #FFF;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  width: 100%;
  box-sizing: border-box;
}

.config-input-sm:focus {
  border-color: var(--gold-primary);
  outline: none;
}

/* ── MODO ARRASTRE DE MESAS (DRAG & DROP CON MOUSE / DEDO) ─────────────── */
.drag-calibrar-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.4);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  color: #60A5FA;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
}

.drag-calibrar-toggle:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: #60A5FA;
}

.drag-calibrar-toggle input {
  accent-color: #3B82F6;
  cursor: pointer;
  width: 14px;
  height: 14px;
}

.drag-calibrar-toggle.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(37, 99, 235, 0.4) 100%);
  border-color: #60A5FA;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.table-hotspot.draggable-active {
  cursor: grab !important;
  outline: 2px dashed #60A5FA;
  outline-offset: 3px;
  animation: pulse-drag 1.8s infinite ease-in-out;
}

.table-hotspot.dragging {
  cursor: grabbing !important;
  transform: translate(-50%, -50%) scale(1.5) !important;
  z-index: 100 !important;
  box-shadow: 0 0 30px #60A5FA !important;
  outline: 2px solid #FFFFFF !important;
  transition: none !important;
}

@keyframes pulse-drag {
  0%, 100% { outline-color: rgba(96, 165, 250, 0.5); }
  50% { outline-color: rgba(96, 165, 250, 1); }
}

.table-hotspot.group-dragging {
  cursor: grabbing !important;
  outline: 2px solid #F59E0B !important;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.8) !important;
  z-index: 95 !important;
  transition: none !important;
}

.drag-mode-banner {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.2) 0%, rgba(37, 99, 235, 0.25) 100%);
  border: 1px solid #60A5FA;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  color: #BFDBFE;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

/* Panel Calibrador de Posición Nudge */
.nudge-controls-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.nudge-dpad-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.nudge-dpad {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-gap: 6px;
  justify-content: center;
}

.nudge-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: #FFF;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s;
}

.nudge-btn:hover {
  background: var(--gold-primary);
  color: #000;
  border-color: var(--gold-glow);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.badge-aforo {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-free);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  display: inline-block;
}

/* ==========================================================================
   RESPONSIVIDAD ULTRA LUXURY (TABLETS, MÓVILES Y PANTALLAS TÁCTILES)
   ========================================================================== */

/* ── TABLETS Y PANTALLAS MEDIANAS (<= 1120px) ─────────────────────────── */
@media (max-width: 1120px) {
  .main-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .side-panel-card {
    width: 100%;
    position: static;
  }

  .app-container {
    padding: 16px 12px;
  }

  .map-canvas-wrapper {
    max-height: 560px;
  }
}

/* ── MÓVILES (<= 768px) ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Header Móvil */
  header {
    padding: 10px 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .brand-section {
    width: 100%;
    justify-content: space-between;
  }

  .brand-titles h1 {
    font-size: 17px;
    letter-spacing: 1px;
  }

  .brand-badge {
    font-size: 9.5px;
  }

  .header-center {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    justify-content: flex-start;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .header-center::-webkit-scrollbar {
    display: none;
  }

  .nav-tab-btn {
    padding: 6px 14px;
    font-size: 12px;
    flex-shrink: 0;
  }

  .user-profile-badge {
    position: absolute;
    top: 10px;
    right: 14px;
    padding: 4px 10px;
    gap: 8px;
  }

  .user-info {
    display: none; /* Ocultar texto en móviles para priorizar el avatar táctil */
  }

  /* Toolbar Móvil y Selector de Fechas */
  .toolbar-card {
    padding: 12px;
    gap: 12px;
    border-radius: var(--radius-md);
  }

  .toolbar-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .date-selector-group {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .custom-date-input {
    width: 100%;
    text-align: center;
  }

  .quick-date-chips {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .quick-date-chips::-webkit-scrollbar {
    display: none;
  }

  .chip-btn {
    flex-shrink: 0;
    padding: 6px 14px;
    font-size: 12px;
  }

  /* KPIs Móviles en 2 Columnas */
  .toolbar-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
  }

  .stat-box {
    padding: 10px 8px;
  }

  .stat-box .stat-val {
    font-size: 18px;
  }

  /* Controles del Mapa */
  .map-viewport-card {
    padding: 10px;
    border-radius: var(--radius-md);
  }

  .map-controls-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .map-legend {
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 11px;
  }

  .zoom-controls {
    align-self: center;
  }

  .map-canvas-wrapper {
    max-height: 440px;
  }

  /* Panel de Detalle en Móvil */
  .side-panel-card {
    border-radius: var(--radius-md);
    padding: 14px;
    border: 1px solid var(--border-gold);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
  }

  .side-panel-header h2 {
    font-size: 16px;
  }

  .btn-reserve-trigger {
    padding: 12px 18px;
    font-size: 14px;
    min-height: 48px; /* Touch target estándar móvil */
  }

  /* Modal de Reserva Móvil (Estilo Bottom Sheet) */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-card {
    width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
    animation: slideUpMobile 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes slideUpMobile {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .modal-body {
    max-height: calc(92vh - 130px);
    overflow-y: auto;
    padding: 16px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .modal-footer {
    padding: 12px 16px;
    position: sticky;
    bottom: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-subtle);
  }

  /* Editor de Mesas Móvil */
  .editor-header-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .nudge-controls-card {
    padding: 12px;
  }

  .nudge-dpad {
    grid-template-columns: repeat(3, 48px);
  }

  .nudge-btn {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }
}

/* ── MÓVILES PEQUEÑOS (<= 420px) ──────────────────────────────────────── */
@media (max-width: 420px) {
  .brand-titles h1 {
    font-size: 15px;
  }
  
  .stat-box .stat-val {
    font-size: 16px;
  }

  .btn-reserve-trigger {
    font-size: 13px;
  }
}

/* ── MOBILE BOTTOM SHEET DRAWER LUXURY (INTERACCIÓN TÁCTIL EN MÓVILES) ──── */
.bottom-sheet-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1040;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.bottom-sheet-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, #181E2C 0%, #0D111A 100%);
  border-top: 1px solid var(--border-gold);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.85);
  z-index: 1050;
  transform: translateY(105%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.mobile-bottom-sheet.active {
  transform: translateY(0);
}

.bottom-sheet-handle-bar {
  width: 100%;
  padding: 10px 0 6px;
  display: flex;
  justify-content: center;
  cursor: pointer;
  touch-action: pan-y;
}

.bottom-sheet-handle {
  width: 44px;
  height: 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.25);
  transition: background 0.2s;
}

.bottom-sheet-handle-bar:hover .bottom-sheet-handle {
  background: var(--gold-primary);
}

.bottom-sheet-content {
  padding: 8px 18px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bottom-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.bottom-sheet-title {
  font-size: 18px;
  font-weight: 800;
  color: #FFF;
  letter-spacing: 0.5px;
}

.bottom-sheet-title span {
  color: var(--gold-glow);
}

.bottom-sheet-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.bottom-sheet-close-btn:hover {
  background: rgba(225, 29, 72, 0.2);
  color: #FECDD3;
  border-color: var(--ruby-booked);
}

/* ── RIBBON DE CHIPS DINÁMICOS DE ZONAS CON DISPONIBILIDAD EN VIVO ────── */
.zone-chips-ribbon {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  -webkit-overflow-scrolling: touch;
}

.zone-chips-ribbon::-webkit-scrollbar {
  height: 4px;
}

.zone-chips-ribbon::-webkit-scrollbar-thumb {
  background: var(--border-gold);
  border-radius: 4px;
}

.zone-chip-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  user-select: none;
}

.zone-chip-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FFF;
  border-color: rgba(255, 255, 255, 0.2);
}

.zone-chip-btn.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(180, 83, 9, 0.35) 100%);
  border-color: var(--gold-primary);
  color: var(--gold-glow);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
  font-weight: 700;
}

.zone-chip-count {
  background: rgba(0, 0, 0, 0.5);
  padding: 1px 7px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  color: var(--emerald-free);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.zone-chip-btn.active .zone-chip-count {
  background: var(--gold-primary);
  color: #000;
  border-color: var(--gold-glow);
}

/* ── INDICADOR VISUAL DEL ESCENARIO PRINCIPAL Y PISTA DE BAILE ───────── */
.stage-orientation-badge {
  position: absolute;
  top: 9%;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(225, 29, 72, 0.9) 0%, rgba(180, 83, 9, 0.92) 100%);
  border: 1.5px solid var(--gold-glow);
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-full);
  padding: 5px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 8;
  pointer-events: none;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #FFFFFF;
  text-transform: uppercase;
  white-space: nowrap;
  animation: stagePulse 3s infinite ease-in-out;
}

.stage-glow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-glow);
  box-shadow: 0 0 8px #FFF, 0 0 14px var(--gold-primary);
  display: inline-block;
  animation: pingDot 1.5s infinite;
}

@keyframes stagePulse {
  0%, 100% { box-shadow: 0 0 18px rgba(245, 158, 11, 0.4); }
  50% { box-shadow: 0 0 28px rgba(245, 158, 11, 0.7); }
}

@keyframes pingDot {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* Animación de pulso dorado al enfocar mesa vía enlace directo */
.table-hotspot.pulse-focus {
  animation: tablePulseGold 1.2s infinite ease-in-out !important;
}

@keyframes tablePulseGold {
  0% { transform: translate(-50%, -50%) scale(1.3); box-shadow: 0 0 15px var(--gold-primary); }
  50% { transform: translate(-50%, -50%) scale(1.6); box-shadow: 0 0 35px var(--gold-glow), 0 0 50px #FFF; }
  100% { transform: translate(-50%, -50%) scale(1.3); box-shadow: 0 0 15px var(--gold-primary); }
}

/* ── MOBILE BOTTOM SHEET DRAWER (LUXURY UX MÓVIL) ────────────────────── */
.mobile-bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 20, 31, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1.5px solid var(--border-gold);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.85), 0 0 25px rgba(245, 158, 11, 0.2);
  z-index: 1000;
  transform: translateY(115%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
}

.mobile-bottom-sheet.active {
  transform: translateY(0);
}

.bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.bottom-sheet-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet-handle-bar {
  width: 100%;
  padding: 12px 0 6px;
  display: flex;
  justify-content: center;
  cursor: pointer;
}

.bottom-sheet-handle {
  width: 48px;
  height: 5px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.3);
}

.bottom-sheet-content {
  padding: 6px 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bottom-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

.bottom-sheet-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  color: #FFF;
  font-weight: 700;
}

.bottom-sheet-title span {
  color: var(--gold-primary);
}

.bottom-sheet-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 15px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

/* ── 12. LOCALIZADOR RÁPIDO Y ANIMACIÓN PULSE ────────────────────────────── */
@keyframes tableLocatePulse {
  0% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.9); }
  50% { transform: translate(-50%, -50%) scale(1.4); box-shadow: 0 0 25px 8px rgba(245, 158, 11, 1); border-color: #FFF; }
  100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.table-hotspot.locate-pulse {
  animation: tableLocatePulse 0.8s ease-in-out 3 !important;
  z-index: 99 !important;
  border-color: #FFF !important;
}

.table-search-input {
  background: rgba(15, 20, 31, 0.85);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  color: #FFF;
  padding: 5px 12px;
  font-size: 12px;
  width: 175px;
  outline: none;
  transition: all 0.2s ease;
}

.table-search-input:focus {
  width: 220px;
  border-color: var(--gold-glow);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
}

.table-search-input::placeholder {
  color: var(--text-dim);
}

/* ── 13. PLANILLA DE PUERTA / CHECK-IN Y ESTILOS DE IMPRESIÓN ─────────────── */
.checkin-kpi-badge {
  background: rgba(15, 20, 31, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.checkin-kpi-badge .num {
  font-size: 18px;
  font-weight: 700;
  font-family: 'Playfair Display', serif;
}
.checkin-kpi-badge .lbl {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
}

@media print {
  header, .floor-selector-container, .map-controls-bar, .toolbar-actions, .stats-grid, #mapCanvasWrapper, .side-panel, .toast-container, .modal-backdrop {
    display: none !important;
  }
  body, html {
    background: #FFF !important;
    color: #000 !important;
  }
  #doorCheckinModal {
    display: block !important;
    position: static !important;
    background: #FFF !important;
    color: #000 !important;
  }
  #doorCheckinModal .modal-dialog {
    max-width: 100% !important;
    margin: 0 !important;
    box-shadow: none !important;
    border: none !important;
    background: #FFF !important;
    color: #000 !important;
    padding: 0 !important;
  }
  #doorCheckinModal .btn-action, #doorCheckinModal .modal-close {
    display: none !important;
  }
  #doorCheckinModal table {
    color: #000 !important;
    border-collapse: collapse !important;
  }
  #doorCheckinModal th, #doorCheckinModal td {
    border-bottom: 1px solid #CCC !important;
    color: #000 !important;
    padding: 6px !important;
  }
}



/* ── CAJA DE SELECCIÓN DE ÁREA CON EL MOUSE (MARQUEE SELECTION BOX) ── */
.selection-marquee-box {
  position: absolute;
  border: 1.5px dashed #F59E0B;
  background: rgba(245, 158, 11, 0.18);
  backdrop-filter: blur(1px);
  pointer-events: none;
  z-index: 90;
  border-radius: 4px;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.35);
  display: none;
}

.structural-svg-group {
  pointer-events: all !important;
  cursor: pointer;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.structural-svg-group:hover {
  filter: drop-shadow(0 0 12px rgba(245, 158, 11, 0.8)) brightness(1.15);
}

.structural-svg-group.selected {
  filter: drop-shadow(0 0 20px #F59E0B) brightness(1.25);
}

.structural-svg-group.selected .struct-shape {
  stroke: #F59E0B !important;
  stroke-width: 3.5px !important;
  stroke-dasharray: 6,4;
  animation: pulse-struct-border 1.5s infinite linear;
}

@keyframes pulse-struct-border {
  to { stroke-dashoffset: -20; }
}
