/* ================================================================
   POS RESTAURANTE — Custom overrides sobre AdminLTE 4 + Bootstrap 5
   Solo estilos específicos del restaurante; el resto viene de AdminLTE
   ================================================================ */

/* ── VARIABLES EXTRA ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --pos-font-family: 'Outfit', sans-serif;
    --pos-sidebar-width: 250px;
    --pos-kds-warn:    15min;
}

/* TEMAS DE COLOR CURADOS (Premium Neon Combinations) */
/* --- MODO CLARO (Default) — Inspirado en SmartRestaurante --- */
[data-bs-theme="light"] {
  --bs-body-bg: #F4F6FB;
  --bs-body-color: #1E2235;
  --bs-border-color: #E2E8F0;
  --bs-secondary-color: #64748B;
  --bs-tertiary-bg: #FFFFFF;
  --bs-secondary-bg: #EEF2F9;
  --pos-sidebar-bg: #FFFFFF;
  --pos-sidebar-border: #E2E8F0;
  --pos-header-bg: #FFFFFF;
  --pos-light-mode: 1;
}

[data-bs-theme="dark"] body,
[data-bs-theme="dark"] {
  background: radial-gradient(ellipse at top left, #1a0a3e 0%, #080010 60%, #000008 100%) !important;
  background-attachment: fixed !important;
  --bs-body-bg: transparent !important;
  --bs-body-color: #e8e8ff !important;
  --bs-heading-color: #ffffff !important;
  color: #e8e8ff !important;
}

/* COLORES VIBRANTES GLOBALES */
:root {
  --bs-success: #2ECC71; --bs-success-rgb: 46, 204, 113;
  --bs-warning: #F4831F; --bs-warning-rgb: 244, 131, 31;
  --bs-danger:  #E8453C; --bs-danger-rgb: 232, 69, 60;
  --bs-info:    #00CFFF; --bs-info-rgb: 0, 207, 255;
}

/* TEMAS DE COLOR CURADOS */
:root, [data-pos-color="blue"] {
  --bs-primary: #4A6CF7; --bs-primary-rgb: 74, 108, 247;
  --pos-sidebar-bg: #FFFFFF; --pos-header-bg: #FFFFFF;
}
[data-pos-color="neon"] {
  --bs-primary: #39FF14; --bs-primary-rgb: 57, 255, 20;
  --pos-sidebar-bg: #001a00; --pos-header-bg: #f0fff0;
}
[data-pos-color="plasma"] {
  --bs-primary: #E8453C; --bs-primary-rgb: 232, 69, 60;
  --pos-sidebar-bg: #FFFFFF; --pos-header-bg: #FFFFFF;
}
[data-pos-color="purple"] {
  --bs-primary: #8B5CF6; --bs-primary-rgb: 139, 92, 246;
  --pos-sidebar-bg: #FFFFFF; --pos-header-bg: #FFFFFF;
}
[data-pos-color="cyan"] {
  --bs-primary: #06B6D4; --bs-primary-rgb: 6, 182, 212;
  --pos-sidebar-bg: #FFFFFF; --pos-header-bg: #FFFFFF;
}
[data-pos-color="orange"] {
  --bs-primary: #F4831F; --bs-primary-rgb: 244, 131, 31;
  --pos-sidebar-bg: #FFFFFF; --pos-header-bg: #FFFFFF;
}
[data-pos-color="gold"] {
  --bs-primary: #F59E0B; --bs-primary-rgb: 245, 158, 11;
  --pos-sidebar-bg: #FFFFFF; --pos-header-bg: #FFFFFF;
}
[data-pos-color="black"] {
  --bs-primary: #1E2235; --bs-primary-rgb: 30, 34, 53;
  --pos-sidebar-bg: #1E2235; --pos-header-bg: #ffffff;
}

/* ── FUENTE MODERNA ─────────────────────────────────────────── */
body {
  font-family: 'Inter', 'Outfit', system-ui, -apple-system, sans-serif !important;
}

/* Aplicar Layout Themes */
.app-sidebar { 
  background: var(--pos-sidebar-bg) !important;
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--pos-sidebar-border, rgba(var(--bs-primary-rgb), 0.15));
  box-shadow: 2px 0 15px rgba(0,0,0,0.06);
}

/* SIDEBAR MODO CLARO — Limpio con acentos de color */
[data-bs-theme="light"] .app-sidebar {
  background: #FFFFFF !important;
  border-right: 1px solid #E2E8F0 !important;
  box-shadow: 4px 0 20px rgba(0,0,0,0.06) !important;
}
[data-bs-theme="light"] .app-sidebar .nav-link {
  color: #64748B !important;
  border-radius: 10px;
  margin: 2px 10px;
}
[data-bs-theme="light"] .app-sidebar .nav-link.active {
  background: linear-gradient(135deg, var(--bs-primary), color-mix(in srgb, var(--bs-primary) 80%, #000)) !important;
  color: #FFFFFF !important;
  border-left: none !important;
  box-shadow: 0 4px 15px rgba(var(--bs-primary-rgb), 0.4) !important;
  border-radius: 10px !important;
}
[data-bs-theme="light"] .app-sidebar .nav-link:hover:not(.active) {
  background: rgba(var(--bs-primary-rgb), 0.08) !important;
  color: var(--bs-primary) !important;
}
[data-bs-theme="light"] .nav-header {
  color: #94A3B8 !important;
}
[data-bs-theme="light"] .brand-text {
  color: #1E2235 !important;
  font-weight: 700;
}

/* SIDEBAR MODO OSCURO — Neón */
[data-bs-theme="dark"] .app-sidebar {
  background: linear-gradient(180deg, var(--pos-sidebar-bg, #0A0015) 0%, color-mix(in srgb, var(--pos-sidebar-bg, #0A0015) 85%, var(--bs-primary)) 100%) !important;
}
.app-sidebar .nav-link.active {
  background: linear-gradient(90deg, rgba(var(--bs-primary-rgb), 0.25), rgba(var(--bs-primary-rgb), 0.05)) !important;
  border-left: 3px solid var(--bs-primary);
  font-weight: 600;
  color: var(--bs-primary) !important;
}
.app-sidebar .nav-link:hover:not(.active) {
  background: rgba(var(--bs-primary-rgb), 0.08);
  color: var(--bs-primary) !important;
}

/* HEADER */
[data-bs-theme="dark"] .app-header { 
  background-color: rgba(8, 0, 16, 0.8) !important;
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(var(--bs-primary-rgb), 0.2);
}
[data-bs-theme="light"] .app-header { 
  background-color: #FFFFFF !important;
  border-bottom: 1px solid #E2E8F0 !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06) !important;
}

/* CARDS — MODO CLARO */
[data-bs-theme="light"] .card {
  background: #FFFFFF !important;
  border: 1px solid #E2E8F0 !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important;
  border-radius: 14px !important;
}
[data-bs-theme="light"] .card:hover {
  box-shadow: 0 6px 24px rgba(var(--bs-primary-rgb), 0.12) !important;
  border-color: rgba(var(--bs-primary-rgb), 0.3) !important;
}

/* BOTONES — MODO CLARO MÁS VIBRANTES */
[data-bs-theme="light"] .btn-primary {
  background: linear-gradient(135deg, var(--bs-primary), color-mix(in srgb, var(--bs-primary) 80%, #000)) !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(var(--bs-primary-rgb), 0.4) !important;
}
[data-bs-theme="light"] .btn-success {
  background: linear-gradient(135deg, #2ECC71, #27AE60) !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4) !important;
}
[data-bs-theme="light"] .btn-danger {
  background: linear-gradient(135deg, #E8453C, #C0392B) !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(232, 69, 60, 0.4) !important;
}
[data-bs-theme="light"] .btn-warning {
  background: linear-gradient(135deg, #F4831F, #D35400) !important;
  border: none !important;
  color: #fff !important;
  box-shadow: 0 4px 15px rgba(244, 131, 31, 0.4) !important;
}

/* TABLAS — MODO CLARO */
[data-bs-theme="light"] .pos-table thead th {
  background: var(--bs-primary);
  color: #fff !important;
}
[data-bs-theme="light"] .pos-table tbody tr:hover {
  background: rgba(var(--bs-primary-rgb), 0.05) !important;
}

/* BADGES — MODO CLARO */
[data-bs-theme="light"] .stat-value {
  color: var(--bs-primary) !important;
  text-shadow: none !important;
}
[data-bs-theme="light"] .stat-card {
  box-shadow: 0 4px 20px rgba(var(--bs-primary-rgb), 0.1) !important;
}


/* VARIANTES DE MODO OSCURO */
[data-bs-theme="dark"][data-pos-dark-variant="oled"],
[data-bs-theme="dark"][data-pos-dark-variant="oled"] body {
  background: #000000 !important;
  --bs-body-bg: #000000 !important;
  --bs-tertiary-bg: #0a0a0a !important;
  --bs-secondary-bg: #111111 !important;
  --bs-border-color: #222222 !important;
  --pos-sidebar-bg: #000000 !important;
  --pos-header-bg: #000000 !important;
}
[data-bs-theme="dark"][data-pos-dark-variant="nord"],
[data-bs-theme="dark"][data-pos-dark-variant="nord"] body {
  background: radial-gradient(circle at top left, #3b4252 0%, #2e3440 100%) !important;
  background-attachment: fixed !important;
  --bs-body-bg: transparent !important;
  --bs-body-color: #f8f9fa !important;
  --bs-heading-color: #ffffff !important;
  color: #f8f9fa !important;
  --bs-tertiary-bg: rgba(59, 66, 82, 0.7) !important;
  --bs-secondary-bg: #434c5e !important;
  --bs-border-color: rgba(76, 86, 106, 0.5) !important;
  --pos-sidebar-bg: rgba(46, 52, 64, 0.8) !important;
  --pos-header-bg: rgba(46, 52, 64, 0.8) !important;
}
[data-bs-theme="dark"][data-pos-dark-variant="dracula"],
[data-bs-theme="dark"][data-pos-dark-variant="dracula"] body {
  background: radial-gradient(circle at top, #44475a 0%, #282a36 100%) !important;
  background-attachment: fixed !important;
  --bs-body-bg: transparent !important;
  --bs-body-color: #f8f9fa !important;
  --bs-heading-color: #ffffff !important;
  color: #f8f9fa !important;
  --bs-tertiary-bg: rgba(68, 71, 90, 0.7) !important;
  --bs-secondary-bg: #6272a4 !important;
  --bs-border-color: rgba(189, 147, 249, 0.3) !important;
  --pos-sidebar-bg: rgba(40, 42, 54, 0.8) !important;
  --pos-header-bg: rgba(40, 42, 54, 0.8) !important;
}
[data-bs-theme="dark"][data-pos-dark-variant="ocean"],
[data-bs-theme="dark"][data-pos-dark-variant="ocean"] body {
  background: radial-gradient(circle at bottom right, #0a2d2d 0%, #041a1a 100%) !important;
  background-attachment: fixed !important;
  --bs-body-bg: transparent !important;
  --bs-body-color: #f8f9fa !important;
  --bs-heading-color: #ffffff !important;
  color: #f8f9fa !important;
  --bs-tertiary-bg: rgba(10, 45, 45, 0.7) !important;
  --bs-secondary-bg: #134e4e !important;
  --bs-border-color: rgba(26, 90, 90, 0.5) !important;
  --bs-primary: #2dd4bf !important;
  --pos-sidebar-bg: rgba(4, 26, 26, 0.8) !important;
  --pos-header-bg: rgba(4, 26, 26, 0.8) !important;
}
[data-pos-dark-variant] .app-main,
[data-pos-dark-variant] .app-content,
[data-pos-dark-variant] .content-wrapper {
  background-color: transparent !important;
  box-shadow: none !important;
}

body {
    font-family: var(--pos-font-family) !important;
}

h1, h2, h3, h4, h5, h6, .card-title, .modal-title {
    font-family: var(--pos-font-family);
    font-weight: 700;
}

/* --- SIDEBAR CUSTOMIZATIONS --- */
.app-sidebar {
    font-family: var(--pos-font-family);
    letter-spacing: -0.2px;
}

.nav-header {
    font-family: var(--pos-font-family);
    font-weight: 700 !important;
    font-size: 0.7rem !important;
    letter-spacing: 0.8px !important;
    text-transform: uppercase;
    opacity: 0.6;
    margin-top: 1.5rem !important;
    padding-left: 1.5rem !important;
}

.nav-item > .nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.7rem 1rem !important;
    border-radius: 3px;
    margin: 2px 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item > .nav-link i {
    font-size: 1.1rem;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.nav-item > .nav-link p {
    margin-bottom: 0;
    display: inline-block;
}

.nav-link.active {
    font-weight: 600 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Estilo para los badges en el menú */
.nav-link .badge {
    font-weight: 600;
    font-size: 10px;
    padding: 3px 6px;
    border-radius: 6px;
}

/* Animación de flechas en el menú */
.nav-arrow {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.75rem !important;
    opacity: 0.5;
}
.menu-open > .nav-link .nav-arrow,
.menu-is-opening > .nav-link .nav-arrow {
    transform: rotate(90deg);
    opacity: 1;
    color: var(--bs-primary);
}

/* CARDS CON EFECTO NEON */
[data-pos-dark-variant] .card,
[data-pos-dark-variant] .modal-content {
  background-color: rgba(255,255,255,0.03) !important;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(var(--bs-primary-rgb), 0.2) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(var(--bs-primary-rgb), 0.05) !important;
  border-radius: 14px !important;
}
[data-bs-theme="dark"] .card {
  box-shadow: 0 4px 24px rgba(var(--bs-primary-rgb), 0.1) !important;
}

/* Variable Global para el Avatar */
:root { --pos-avatar-bg: var(--bs-primary); }

/* ── BRAND / AVATAR ──────────────────────────────────────────── */
.pos-brand-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--pos-avatar-bg); color: #fff;
  font-size: 16px; flex-shrink: 0;
}
.pos-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--pos-avatar-bg); color: #fff;
  font-size: 13px; font-weight: 600; flex-shrink: 0;
}

/* ── DECORACIONES DEL SALON (Barra, Cocina, etc) ───────────────── */
.salon-decor {
  position: absolute;
  padding: 8px 24px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px dashed rgba(255, 255, 255, 0.4);
  color: var(--bs-body-color);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 2px;
  border-radius: 8px;
  backdrop-filter: blur(4px);
  cursor: grab;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  text-align: center;
}
.salon-decor:active {
  cursor: grabbing;
}
.view-mode-grid .salon-decor {
  display: none !important; /* Ocultar decoraciones en vista cuadrícula */
}

/* ── MAPA DE MESAS PREMIUM REDONDAS (PEQUEÑAS) ───────────────── */
.mesa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
  gap: 12px;
  padding: 12px;
}
.mesa-card {
  background: linear-gradient(145deg, var(--bs-tertiary-bg), var(--bs-body-bg));
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  overflow: visible;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 6px 15px rgba(0,0,0,0.2), inset 0 0 10px rgba(255,255,255,0.02);
  padding: 6px;
  z-index: 5;
}
/* SILLAS DECORATIVAS */
.view-mode-salon .mesa-card::before,
.view-mode-salon .mesa-card::after,
.view-mode-salon .mesa-card .silla-lateral {
  content: '';
  position: absolute;
  background: #3d2b1f;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
  z-index: -1;
  transition: transform 0.3s;
}

.view-mode-salon .mesa-card::before {
  top: -4px; left: 50%; transform: translateX(-50%);
  width: 12px; height: 8px; border-radius: 2px 2px 0 0;
}
.view-mode-salon .mesa-card::after {
  bottom: -4px; left: 50%; transform: translateX(-50%);
  width: 12px; height: 8px; border-radius: 0 0 2px 2px;
}
.view-mode-salon .mesa-card .silla-lateral {
  top: 50%; width: 8px; height: 12px;
}
.view-mode-salon .mesa-card .silla-izq { left: -4px; transform: translateY(-50%); border-radius: 2px 0 0 2px; }
.view-mode-salon .mesa-card .silla-der { right: -4px; transform: translateY(-50%); border-radius: 0 2px 2px 0; }

.view-mode-salon .mesa-card:hover::before { transform: translateX(-50%) translateY(-3px); }
.view-mode-salon .mesa-card:hover::after  { transform: translateX(-50%) translateY(3px); }
.view-mode-salon .mesa-card:hover .silla-izq { transform: translateY(-50%) translateX(-3px); }
.view-mode-salon .mesa-card:hover .silla-der { transform: translateY(-50%) translateX(3px); }

.mesa-card-inner {
  position: relative; z-index: 2; width: 100%; height: 100%;
  display: flex; flex-direction: column; padding: 2px; text-align: center;
}
.mesa-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0px; width: 100%; }
.mesa-numero { font-size: 14px; font-weight: 800; color: var(--bs-body-color); }
.mesa-capacidad { font-size: 11px; color: var(--bs-secondary-color); font-weight: 600; }
.mesa-icon { font-size: 28px; margin: 4px 0; color: var(--bs-secondary-color); }
.mesa-area { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--bs-secondary-color); font-weight: 600; }
.mesa-folio { font-size: 11px; color: var(--bs-primary); font-weight: 700; margin-top: 2px; }

.mesa-status {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px; color: #fff;
}

.mesa-card:hover { 
  transform: translateY(-8px) scale(1.05);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  border-color: var(--bs-primary);
}
.mesa-card.libre { border-color: var(--bs-success); }
.mesa-card.ocupada { border-color: var(--bs-warning); background: radial-gradient(circle, rgba(var(--bs-warning-rgb),0.12) 0%, transparent 70%); }
.mesa-card.reservada { border-color: var(--bs-info); background: radial-gradient(circle, rgba(var(--bs-info-rgb),0.12) 0%, transparent 70%); }
.mesa-card.bloqueada { opacity: 0.5; pointer-events: none; filter: grayscale(100%); }

.mesa-numero { font-size: 9px; font-weight: 800; color: var(--bs-body-color); letter-spacing: 0.2px; }
.mesa-capacidad { font-size: 7px; font-weight: 600; color: var(--bs-secondary-color); margin-top: 0; padding: 0 4px; border-radius: 10px; background: var(--bs-tertiary-bg); }

.mesa-card-body {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1px;
}
.mesa-icon {
  font-size: 16px;
  margin-top: 1px;
  margin-bottom: 1px;
  opacity: 0.9;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
  transition: transform 0.3s;
}
.mesa-card:hover .mesa-icon { transform: scale(1.1); }
.mesa-area { font-size: 7px; color: var(--bs-secondary-color); font-weight: 600; text-transform: uppercase; letter-spacing: 0.2px; }
.mesa-folio { font-size: 8px; font-weight: 700; color: var(--bs-body-color); }

.mesa-card-footer {
  margin-top: 0;
}
.mesa-status {
  padding: 0 6px;
  border-radius: 15px;
  font-size: 7px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.mesa-status.bg-success { background: var(--bs-success) !important; color: #fff !important; }
.mesa-status.bg-warning { background: var(--bs-warning) !important; color: #000 !important; }
.mesa-status.bg-info { background: var(--bs-info) !important; color: #000 !important; }

/* ── TOMA DE ORDEN ───────────────────────────────────────────── */
.order-screen {
  display: grid;
  grid-template-columns: 1fr 370px;
  gap: 14px;
  height: calc(100vh - 130px);
}
.catalog-panel { display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.cat-tabs {
  display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; padding-bottom: 10px;
  scrollbar-width: none; flex-shrink: 0; width: 100%; position: relative;
  -webkit-overflow-scrolling: touch;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 8px 10px; border-radius: var(--bs-border-radius);
  border: 1px solid var(--bs-border-color);
  cursor: pointer; transition: all .15s; min-width: 85px; max-width: 110px;
  white-space: normal; font-size: 11px; font-weight: 600;
  background: var(--bs-body-bg); color: var(--bs-secondary-color);
  text-align: center; line-height: 1.1;
}
.cat-tab:hover  { border-color: var(--bs-primary); color: var(--bs-primary); }
.cat-tab.active { background: rgba(var(--bs-primary-rgb),.15); border-color: var(--bs-primary); color: var(--bs-primary); }
.cat-tab i { font-size: 17px; }

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  align-items: start;
  gap: 9px; overflow-y: auto; flex: 1;
}
.product-card {
  background: var(--bs-body-bg); border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius); padding: 0;
  cursor: pointer; transition: border-color .15s, transform .15s; position: relative;
  display: flex; flex-direction: column; overflow: hidden;
}
.product-card:hover   { border-color: var(--bs-primary); transform: translateY(-1px); }
.product-card.no-disponible { opacity: .38; pointer-events: none; }
.product-img {
  height: 85px; background: var(--bs-tertiary-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: var(--bs-secondary-color);
  background-size: cover; background-position: center; border-bottom: 1px solid var(--bs-border-color);
}
.product-info { padding: 8px 10px; flex: 1; display: flex; flex-direction: column; }
.product-name  { font-size: 13px; font-weight: 500; line-height: 1.2; margin-bottom: 4px; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-price { font-size: 14px; font-weight: 700; color: var(--bs-success); margin-bottom: 2px; }
.product-time  { font-size: 11px; color: var(--bs-secondary-color); }

/* Panel derecho de la orden */
.order-panel {
  background: var(--bs-body-bg); border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius-lg);
  display: flex; flex-direction: column; overflow: hidden; min-height: 0;
}
.order-panel-header {
  padding: 12px 14px; border-bottom: 1px solid var(--bs-border-color);
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.order-items-list  { flex: 1; overflow-y: auto; padding: 8px; }
.order-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 9px 8px; border-radius: var(--bs-border-radius);
  border-bottom: 1px solid var(--bs-border-color); margin-bottom: 3px;
  transition: background .12s;
}
.order-item:hover      { background: var(--bs-tertiary-bg); }
.order-item-qty        { background: var(--bs-primary); color: #fff; border-radius: 6px; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.order-item-name       { flex: 1; font-size: 13px; }
.order-item-price      { font-size: 13px; font-weight: 600; color: var(--bs-success); white-space: nowrap; }
.order-item-del        { color: var(--bs-danger); cursor: pointer; padding: 3px; opacity: .65; }
.order-item-del:hover  { opacity: 1; }
.order-item-notes      { font-size: 11px; color: var(--bs-secondary-color); font-style: italic; }
.order-totals { padding: 10px 14px; border-top: 1px solid var(--bs-border-color); background: var(--bs-tertiary-bg); flex-shrink: 0; }
.total-row    { display: flex; justify-content: space-between; font-size: 13px; color: var(--bs-secondary-color); padding: 2px 0; }
.total-row.grand { font-size: 18px; font-weight: 700; color: var(--bs-body-color); border-top: 1px solid var(--bs-border-color); margin-top: 5px; padding-top: 5px; }
.order-actions { padding: 10px; display: flex; gap: 7px; flex-shrink: 0; }
.order-actions .btn { flex: 1; }

/* ── KDS COCINA / BARRA ──────────────────────────────────────── */
.kds-header {
  background: var(--bs-body-bg); border-bottom: 1px solid var(--bs-border-color);
  padding: 12px 20px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.kds-titulo { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.kds-reloj  { font-size: 22px; font-weight: 300; font-variant-numeric: tabular-nums; }
.kds-grid   { display: grid; grid-template-columns: repeat(auto-fill, minmax(295px,1fr)); gap: 14px; padding: 14px; }

.ticket-card {
  background: var(--bs-body-bg); border: 2px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius-lg); overflow: hidden; transition: border-color .25s;
}
.ticket-card.urgente    { border-color: var(--bs-danger); }
.ticket-card.advertencia{ border-color: var(--bs-warning); }
.ticket-card.nueva      { border-color: var(--bs-primary); }
.ticket-header {
  padding: 11px 14px; display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--bs-border-color);
}
.ticket-folio  { font-size: 16px; font-weight: 700; }
.ticket-mesa   { font-size: 12px; color: var(--bs-secondary-color); }
.ticket-timer  { margin-left: auto; }
.timer-badge   { padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.timer-ok   { background: rgba(var(--bs-success-rgb),.18); color: var(--bs-success); }
.timer-warn { background: rgba(var(--bs-warning-rgb),.18); color: var(--bs-warning); }
.timer-late { background: rgba(var(--bs-danger-rgb),.18);  color: var(--bs-danger);  animation: pos-pulse 1s infinite; }

.ticket-items   { padding: 7px; }
.ticket-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 7px;
  border-radius: 7px; border: 1px solid transparent;
  cursor: pointer; transition: all .13s; margin-bottom: 3px;
}
.ticket-item:hover         { background: var(--bs-tertiary-bg); }
.ticket-item.en_proceso    { background: rgba(var(--bs-warning-rgb),.1);  border-color: rgba(var(--bs-warning-rgb),.3); }
.ticket-item.listo         { background: rgba(var(--bs-success-rgb),.08); border-color: rgba(var(--bs-success-rgb),.3); opacity: .55; }
.item-qty    { background: var(--bs-secondary-bg); border-radius: 6px; padding: 3px 8px; font-weight: 700; font-size: 15px; }
.item-nombre { flex: 1; font-size: 14px; }
.item-notas  { font-size: 11px; color: var(--bs-warning-text-emphasis); font-style: italic; }
.item-estado-btn { background: none; border: none; cursor: pointer; font-size: 19px; padding: 3px 6px; transition: transform .18s; }
.item-estado-btn:hover { transform: scale(1.2); }
.ticket-footer { padding: 9px; border-top: 1px solid var(--bs-border-color); }

/* ── CAJA ────────────────────────────────────────────────────── */
.cobro-total { font-size: 42px; font-weight: 700; color: var(--bs-success); text-align: center; padding: 18px; }
.metodos-pago { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 14px 14px; }
.metodo-btn {
  padding: 13px 8px; border-radius: var(--bs-border-radius); border: 2px solid var(--bs-border-color);
  background: var(--bs-tertiary-bg); cursor: pointer; transition: all .14s;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 15px; }
.numpad-btn {
  padding: 18px; border: 1px solid #ddd;
  background: #fff; border-radius: 3px;
  cursor: pointer; font-size: 20px; font-weight: 600; color: #444;
  box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}
.numpad-btn:hover { background: #f4f4f4; }
.numpad-btn:active { background: #eee; box-shadow: inset 0 3px 5px rgba(0,0,0,0.125); }

/* ── ESTADÍSTICAS (dashboard) con Neon ──────────────────────── */
.admin-stats { display: grid; grid-template-columns: repeat(auto-fill,minmax(195px,1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card  { 
  background: var(--bs-body-bg); 
  border: 1px solid rgba(var(--bs-primary-rgb), 0.3); 
  border-radius: var(--bs-border-radius-lg); 
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--bs-primary), var(--bs-info));
}
.stat-card:nth-child(2)::before { background: linear-gradient(90deg, var(--bs-success), var(--bs-primary)); }
.stat-card:nth-child(3)::before { background: linear-gradient(90deg, var(--bs-warning), var(--bs-danger)); }
.stat-card:nth-child(4)::before { background: linear-gradient(90deg, var(--bs-info), var(--bs-success)); }
.stat-label { font-size: 11px; color: var(--bs-secondary-color); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--bs-primary); text-shadow: 0 0 20px rgba(var(--bs-primary-rgb), 0.4); }
.stat-sub   { font-size: 12px; color: var(--bs-secondary-color); margin-top: 2px; }

/* ── TABLAS PERSONALIZADAS ───────────────────────────────────── */
.pos-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pos-table thead th {
  padding: 9px 13px; text-align: left; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--bs-secondary-color); border-bottom: 1px solid var(--bs-border-color);
}
.pos-table tbody td { padding: 11px 13px; border-bottom: 1px solid var(--bs-border-color); }
.pos-table tbody tr:hover { background: var(--bs-tertiary-bg); }
.pos-table tbody tr:last-child td { border-bottom: none; }
.table-wrapper { overflow-x: auto; }

/* Paginación AdminLTE */
.pagination .page-link { border-radius: 0 !important; color: #777; border: 1px solid #ddd; }
.pagination .page-item.active .page-link { background-color: var(--admin-blue); border-color: var(--admin-blue); color: #fff; }

/* ── TABS CUSTOM ─────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--bs-border-color); margin-bottom: 18px; }
.tab-btn {
  padding: 9px 16px; background: transparent; border: none;
  border-bottom: 2px solid transparent; cursor: pointer;
  font-size: 14px; color: var(--bs-secondary-color); transition: all .14s;
}
.tab-btn:hover  { color: var(--bs-body-color); }
.tab-btn.active { color: var(--bs-primary); border-bottom-color: var(--bs-primary); font-weight: 500; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── LOGIN ───────────────────────────────────────────────────── */
.login-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius-xl); padding: 36px; width: 370px; max-width: 90vw; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo i { font-size: 38px; color: var(--bs-primary); }
.login-logo h1 { font-size: 20px; font-weight: 700; margin-top: 8px; }
.pin-pad { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin-top: 14px; }
.pin-btn { padding: 16px; background: var(--bs-tertiary-bg); border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius); font-size: 19px; font-weight: 600; cursor: pointer; text-align: center; transition: background .1s; color: var(--bs-body-color); }
.pin-btn:hover  { background: var(--bs-primary); color: #fff; }
.pin-btn:active { transform: scale(.93); }
.pin-display { display: flex; justify-content: center; gap: 10px; margin: 14px 0; font-size: 28px; letter-spacing: 8px; color: var(--bs-primary); font-weight: 700; }

/* ── TOASTS ──────────────────────────────────────────────────── */
.pos-toast { min-width: 260px; }

/* ── UTILIDADES EXTRA ────────────────────────────────────────── */
.flex-1 { flex: 1; }
.fs-sm  { font-size: 12px !important; }
.fw-bold{ font-weight: 700 !important; }
.gap-1  { gap: 4px !important; }
.gap-2  { gap: 8px !important; }
.gap-3  { gap: 12px !important; }
.gap-4  { gap: 16px !important; }

/* ── SALÓN LAYOUT ────────────────────────────────────────────── */
.salon-layout {
  background: #1e1e1e;
  border: 12px solid #3d2b1f; /* Marco de madera */
  border-radius: 24px;
  padding: 60px 40px 40px; /* Reducido espacio superior */
  position: relative;
  min-height: 500px; /* Reducida altura mínima */
  box-shadow: inset 0 0 100px rgba(0,0,0,0.5), 0 20px 50px rgba(0,0,0,0.3);
  overflow: auto;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
}
[data-bs-theme="light"] .salon-layout {
  background: #fdf5e6;
  border-color: #5d4037;
  background-image: 
    linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
}

.view-mode-salon .mesa-grid {
  grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
  gap: 20px 15px;
  padding: 20px 10px;
  position: relative; /* Base para posicionamiento absoluto */
}

/* Cuando se han guardado posiciones, usamos absoluto */
.view-mode-salon .mesa-grid.is-positioned {
  display: block;
  min-height: 500px;
}
.view-mode-salon .mesa-grid.is-positioned .mesa-card {
  position: absolute;
  width: 95px;
}

.salon-decor {
  position: absolute;
  background: rgba(var(--bs-primary-rgb), 0.1);
  border: 2px solid var(--bs-primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--bs-primary);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 14px;
  pointer-events: none;
  backdrop-filter: blur(4px);
  z-index: 10;
}

/* Modo Diseño */
.design-mode .mesa-card, 
.design-mode .salon-decor {
  cursor: move !important;
  pointer-events: auto !important;
  box-shadow: 0 0 0 3px var(--bs-warning) !important;
  opacity: 0.8;
}
.design-mode .mesa-card:hover, 
.design-mode .salon-decor:hover {
  opacity: 1;
  transform: scale(1.05);
}
.design-mode .mesa-card::after {
  content: 'DRAG';
  position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-size: 8px; font-weight: 900; color: var(--bs-warning);
}

.decor-barra   { top: 15px; left: 40px; width: 220px; height: 45px; border-bottom-width: 4px; }
.decor-cocina  { top: 15px; right: 40px; width: 150px; height: 45px; background: rgba(var(--bs-warning-rgb), 0.1); border-color: var(--bs-warning); color: var(--bs-warning); }
.decor-entrada { bottom: 0; left: 50%; transform: translateX(-50%); width: 120px; height: 20px; border-radius: 10px 10px 0 0; background: var(--bs-danger); border: none; color: #fff; font-size: 10px; }

.salon-light {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.05) 0%, transparent 50%),
              radial-gradient(circle at 70% 70%, rgba(255,255,255,0.05) 0%, transparent 50%);
  pointer-events: none;
}

.view-mode-grid .salon-layout {
  background: none;
  border: none;
  padding: 0;
  box-shadow: none;
}
.view-mode-grid .salon-decor, .view-mode-grid .salon-light { display: none; }

.loading-spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.3); border-top-color: #fff;
  border-radius: 50%; animation: spin .6s linear infinite;
}

/* ── ANIMACIONES ─────────────────────────────────────────────── */
@keyframes spin     { to { transform: rotate(360deg); } }
@keyframes pos-pulse{ 0%,100%{opacity:1} 50%{opacity:.45} }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET (≤992px) + MÓVIL (≤576px)
   Optimizado para tablets de meseros y teléfonos
   ══════════════════════════════════════════════════════════════ */

/* ── TABLET (≤992px) ─────────────────────────────────────────── */
@media (max-width: 992px) {

  /* SIDEBAR: se comporta como drawer */
  .app-sidebar {
    position: fixed !important;
    top: 0; left: 0; height: 100vh;
    z-index: 1055;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 260px !important;
  }
  body.sidebar-open .app-sidebar {
    transform: translateX(0) !important;
  }
  /* Overlay oscuro detrás del sidebar */
  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1050;
    backdrop-filter: blur(2px);
  }
  body.sidebar-open .sidebar-overlay { display: block; }

  /* CONTENIDO: usar todo el ancho */
  .app-main { margin-left: 0 !important; }
  .app-content { padding: 10px !important; }

  /* HEADER: más compacto */
  .app-header { padding: 0 10px !important; }
  .app-content-header { padding: 8px 0 !important; }
  .app-content-header h3 { font-size: 16px !important; }

  /* BOTONES: touch-friendly (mínimo 44px alto) */
  .btn { min-height: 48px; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; transition: transform 0.1s active; }
  .btn:active { transform: scale(0.96); }
  .btn-sm { min-height: 40px; }

  /* Indicador de scroll horizontal en categorías */
  .cat-tabs::after {
    content: '';
    position: absolute;
    right: 0; top: 0; bottom: 10px;
    width: 30px;
    background: linear-gradient(90deg, transparent, var(--bs-body-bg));
    pointer-events: none;
    z-index: 5;
  }

  /* ── PANTALLA TOMA DE ORDEN (el más importante) ── */
  .order-screen {
    display: block !important;
    height: calc(100vh - 105px);
    position: relative;
    overflow: hidden;
  }
  .catalog-panel,
  .order-panel {
    position: absolute !important;
    inset: 0;
    bottom: 60px; /* Espacio para la tab bar */
    display: flex !important;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .catalog-panel.tab-active,
  .order-panel.tab-active {
    opacity: 1;
    pointer-events: all;
  }
  /* Tab bar inferior */
  .mobile-tab-bar {
    display: flex !important;
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 60px;
    background: var(--bs-body-bg);
    border-top: 1px solid var(--bs-border-color);
    z-index: 20;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  }
  .mobile-tab {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px; background: none; border: none;
    color: var(--bs-secondary-color);
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
    cursor: pointer; transition: all 0.2s;
    position: relative;
  }
  .mobile-tab i { font-size: 20px; }
  .mobile-tab.active {
    color: var(--bs-primary);
  }
  .mobile-tab.active::after {
    content: '';
    position: absolute;
    top: 0; left: 15%; right: 15%;
    height: 3px;
    background: var(--bs-primary);
    border-radius: 0 0 4px 4px;
  }
  .mobile-tab .tab-badge {
    position: absolute;
    top: 6px; right: 20%;
    background: var(--bs-danger);
    color: #fff;
    font-size: 10px; font-weight: 700;
    min-width: 18px; height: 18px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px;
  }
  .mobile-tab .tab-badge.hidden { display: none; }

  /* Productos: 2 columnas en tablet */
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
  }
  /* Categorías: scroll horizontal más amplio */
  .cat-tab { padding: 10px 16px !important; min-width: 90px !important; }

  /* ── MESAS: cuadrícula táctil ── */
  /* Las mesas se ven mejor en grid en tablet */
  .mesa-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
    gap: 14px !important;
  }
  .mesa-card {
    width: auto !important;
    position: relative !important;
  }

  /* ── KDS COCINA/BARRA ── */
  .kds-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 10px !important;
    padding: 10px !important;
  }
  .kds-header { padding: 10px 14px !important; }
  .kds-titulo { font-size: 16px !important; }

  /* ── CAJA ── */
  .cobro-total { font-size: 32px !important; padding: 12px !important; }
  .metodos-pago { grid-template-columns: repeat(2, 1fr) !important; }

  /* ── ESTADÍSTICAS ── */
  .admin-stats {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* ── TABLAS: scroll horizontal con sombra indicadora ── */
  .card-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .pos-table { min-width: 600px; }
  
  /* Ajuste de fuentes para dashboard en móvil */
  .stat-value { font-size: 24px !important; }
  .stat-card { padding: 12px !important; }

  /* Evitar zoom en inputs al enfocar (iOS) */
  input[type="text"], input[type="number"], textarea {
    font-size: 16px !important;
  }

  /* ── MODALES: pantalla completa en tablet ── */
  .modal-dialog { margin: 10px !important; max-width: calc(100% - 20px) !important; }
}

/* ── MÓVIL (≤576px) ──────────────────────────────────────────── */
@media (max-width: 576px) {
  /* KDS: una sola columna */
  .kds-grid { grid-template-columns: 1fr !important; }

  /* Estadísticas: una columna */
  .admin-stats { grid-template-columns: 1fr !important; }

  /* Productos: 2 columnas compactas */
  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }
  .product-img { height: 70px !important; }

  /* Mesas: más compactas */
  .mesa-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)) !important;
    gap: 10px !important;
  }

  /* Tab bar más grande para dedos */
  .mobile-tab { font-size: 10px; }
  .mobile-tab i { font-size: 22px; }

  /* Métodos de pago: 2x2 */
  .metodos-pago { grid-template-columns: repeat(2, 1fr) !important; gap: 6px !important; }

  /* Cobro: total más pequeño */
  .cobro-total { font-size: 26px !important; }

  /* Tablas en móvil: más espacio para dedos en acciones */
  .pos-table td .btn {
    padding: 8px 12px;
    margin: 2px;
  }
  
  /* Asegurar que el sidebar no se desborde */
  .app-sidebar .nav-link p {
    font-size: 14px;
  }
}

/* ── MENU QR (público, tema claro forzado) ───────────────────── */
.qr-header { background: #c0392b; color: #fff; padding: 18px; text-align: center; }
.qr-cat-tabs { display: flex; gap: 7px; overflow-x: auto; padding: 10px 14px; background: #fff; border-bottom: 1px solid #e8e2d8; position: sticky; top: 0; z-index: 10; scrollbar-width: none; }
.qr-cat-tab { white-space: nowrap; padding: 6px 13px; border-radius: 20px; border: 1px solid #e8e2d8; background: #fff; color: #555; cursor: pointer; font-size: 13px; font-weight: 500; transition: all .14s; }
.qr-cat-tab.active { background: #c0392b; color: #fff; border-color: #c0392b; }
.qr-prod-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(155px,1fr)); gap: 9px; }
.qr-prod-card { background: #fff; border: 1px solid #e8e2d8; border-radius: 12px; overflow: hidden; cursor: pointer; transition: transform .14s; }
.qr-prod-card:hover { transform: translateY(-2px); }
.qr-prod-img  { width: 100%; height: 110px; background: #f5efe8; display: flex; align-items: center; justify-content: center; }
.qr-prod-img i{ font-size: 32px; color: #ccc; }
.qr-prod-info { padding: 9px 11px; }
.qr-prod-name { font-size: 13px; font-weight: 600; color: #1a1a1a; line-height: 1.3; }
.qr-prod-desc { font-size: 11px; color: #666; margin-top: 2px; line-height: 1.4; }
.qr-prod-price{ font-size: 15px; font-weight: 700; color: #c0392b; margin-top: 5px; }
.qr-prod-unavail { opacity: .38; pointer-events: none; }
