/* =============================
   TICKET PRINT (USB/BROWSER)
   ============================= */
.print-receipt {
  display: none;
}

@media print {
  @page { 
    margin: 0; 
    size: 80mm auto;
  }
  
  body > *:not(#print-receipt) { 
    display: none !important; 
  }
  
  #print-receipt, .print-receipt {
    display: block !important;
    position: static;
    width: 80mm;
    font-family: 'Courier New', Courier, monospace !important;
    font-size: 13px !important;
    font-weight: 600;
    color: #000000 !important;
    background: #ffffff !important;
    padding: 4mm 3mm;
    margin: 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    box-shadow: none !important;
  }
  
  /* ASEGURAR QUE TODOS LOS TEXTOS SEAN NEGROS EN TICKET NORMAL */
  #print-receipt * { 
    color: #000000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  /* HEADER CON LOGO GRANDE */
  #print-receipt .receipt-header, .print-receipt .receipt-header {
    text-align: center;
    margin-bottom: 3mm;
    padding-bottom: 2mm;
    border-bottom: 1px dashed #000000;
  }
  
  /* LOGO - TAMAÑO MODERADO */
  #print-receipt .receipt-header img, 
  .print-receipt .receipt-header img {
    display: block;
    margin: 0 auto 3mm auto;
    max-width: 45mm;
    max-height: 45mm;
    width: auto;
    height: auto;
    object-fit: contain;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  /* NOMBRE DEL RESTAURANTE */
  #print-receipt .receipt-header h2, 
  .print-receipt .receipt-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #000000 !important;
    margin: 2mm 0 1mm 0;
    letter-spacing: 0.3px;
  }
  
  /* SUBTÍTULO/DIRECCIÓN */
  #print-receipt .receipt-header p, 
  .print-receipt .receipt-header p {
    font-size: 13px;
    font-weight: 600;
    margin: 1mm 0;
    color: #000000 !important;
    line-height: 1.3;
  }
  
  /* TABLA DE ITEMS */
  #print-receipt table, 
  .print-receipt table {
    width: 100%;
    border-collapse: collapse;
    margin: 2mm 0;
  }
  
  #print-receipt td, 
  .print-receipt td {
    padding: 0.8mm 0;
    vertical-align: top;
    color: #000000 !important;
    font-size: 13px;
    font-weight: 600;
  }
  
  #print-receipt th,
  .print-receipt th {
    color: #000000 !important;
    font-size: 11px;
  }
  
  /* LÍNEA DE SEPARACIÓN */
  #print-receipt .separator, 
  .print-receipt .separator {
    border-bottom: 1px dashed #000000;
    margin: 1.5mm 0;
    padding: 0 !important;
    height: 0 !important;
  }
  
  /* TOTAL - ticket solo */
  #print-receipt table[style*="margin-top"] {
    border-collapse: collapse;
    width: 100%;
  }
  
  #print-receipt table[style*="margin-top"] td {
    padding: 1.5mm 0;
    border-top: 1px dashed #000000;
    border-bottom: 1px dashed #000000;
    font-weight: 700;
    font-size: 13px;
    color: #000000 !important;
  }
  
  /* DETALLES DE PAGO */
  #print-receipt .payment-details, 
  .print-receipt .payment-details {
    text-align: center;
    font-size: 10px;
    margin-top: 2mm;
    padding-top: 2mm;
    border-top: 1px dashed #000000;
    color: #000000 !important;
  }
  
  /* ENCABEZADO DE MEDIOS DE PAGO */
  #print-receipt .payment-header,
  .print-receipt .payment-header {
    margin-top: 2mm;
    margin-bottom: 1mm;
    font-size: 13px;
    font-weight: 600;
    color: #000000 !important;
  }
  
  /* LOGO DE PAGO (VISA, MASTERCARD, ETC) */
  #print-receipt .payment-logo, 
  .print-receipt .payment-logo {
    max-width: 30mm;
    max-height: 30mm;
    margin: 2mm auto;
    display: block;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  /* TEXTO FINAL DEL TICKET */
  #print-receipt .receipt-footer-text,
  .print-receipt .receipt-footer-text {
    text-align: center;
    margin-top: 3mm;
    margin-bottom: 0;
    font-size: 19px;
    font-weight: 600;
    color: #000000 !important;
  }

  /* URL DEL SITIO */
  #print-receipt .receipt-url,
  .print-receipt .receipt-url {
    text-align: center;
    margin: 2mm auto 0 auto;
    padding: 0;
    font-size: 10px;
    font-weight: 400;
    color: #000000 !important;
    width: 100%;
  }
  
  /* FOOTER */
  #print-receipt .receipt-footer, 
  .print-receipt .receipt-footer {
    text-align: center;
    font-size: 10px;
    margin-top: 3mm;
    padding-top: 2mm;
    border-top: 1px solid #000000;
    color: #000000 !important;
  }
  
  /* ============================================ */
  /* ESTILOS ESPECIALES PARA COMANDA (KITCHEN) */
  /* ============================================ */
  
  #print-receipt.kitchen, 
  .print-receipt.kitchen {
    width: 80mm;
    padding: 3mm 2mm;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.0;
    color: #000000 !important;
  }
  
  /* ASEGURAR QUE TODO EN COMANDA TAMBIÉN SEA NEGRO */
  #print-receipt.kitchen * {
    color: #000000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  #print-receipt.kitchen .receipt-header, 
  .print-receipt.kitchen .receipt-header {
    margin-bottom: 1mm;
    padding-bottom: 1mm;
    border-bottom: 1px solid #000000;
  }
  
  #print-receipt.kitchen .receipt-header img, 
  .print-receipt.kitchen .receipt-header img {
    max-width: 50mm;
    max-height: 50mm;
    margin: 0 auto 2mm auto;
  }
  
  #print-receipt.kitchen .receipt-header h2, 
  .print-receipt.kitchen .receipt-header h2 {
    font-size: 20px !important;
    font-weight: 700 !important;
    margin: 0.5mm 0 0.2mm 0;
    color: #000000 !important;
  }
  
  #print-receipt.kitchen .receipt-header p,
  .print-receipt.kitchen .receipt-header p {
    font-size: 12px !important;
    color: #000000 !important;
    margin: 0.2mm 0;
    line-height: 1.1;
  }
  
  #print-receipt.kitchen table, 
  .print-receipt.kitchen table {
    margin: 0.2mm 0;
  }
  
  #print-receipt.kitchen td, 
  .print-receipt.kitchen td {
    font-size: 15px !important;
    font-weight: 700 !important;
    padding: 0.3mm 0;
    color: #000000 !important;
  }
  
  /* Modificadores - tanto en comanda como en ticket */
  .item-modifiers {
    font-size: 14px !important;
    font-weight: 500 !important;
    padding: 0.1mm 1mm !important;
    background-color: transparent !important;
    color: #000000 !important;
    line-height: 0.95;
  }
  
  .item-modifiers strong {
    font-weight: 700 !important;
    display: block;
    margin-bottom: -1px;
    font-size: 14px !important;
  }
  
  /* Modificadores en comanda - estilos específicos */
  .kds-modifier-row {
    font-size: 17px !important;
    font-weight: 500 !important;
    padding: 0.3mm 2mm !important;
    background-color: #f9f9f9 !important;
    border-left: 2px solid #000000 !important;
    color: #000000 !important;
  }
  
  .kds-modifier-row strong {
    font-weight: 700 !important;
    display: block;
    margin-bottom: 0;
  }
  
  #print-receipt.kitchen th,
  .print-receipt.kitchen th {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #000000 !important;
  }
  
  #print-receipt.kitchen .separator, 
  .print-receipt.kitchen .separator {
    border-bottom: 2px solid #000000;
    margin: 1.5mm 0;
  }
  
  #print-receipt.kitchen .total-line, 
  .print-receipt.kitchen .total-line {
    font-size: 24px !important;
    font-weight: 700 !important;
    padding: 3mm 0;
    margin: 3mm 0;
    border-top: 2px solid #000000;
    border-bottom: 2px solid #000000;
    color: #000000 !important;
  }
  
  #print-receipt.kitchen .payment-logo, 
  .print-receipt.kitchen .payment-logo {
    max-width: 50mm;
    max-height: 50mm;
    margin: 3mm auto;
  }
  
  #print-receipt.kitchen .receipt-footer, 
  .print-receipt.kitchen .receipt-footer {
    font-size: 16px !important;
    font-weight: 700 !important;
    margin-top: 4mm;
    padding-top: 3mm;
    color: #000000 !important;
  }
}

/* ============================================ */
/* ESTILOS PARA PANTALLA (NO IMPRESIÓN) */
/* ============================================ */

#print-receipt, .print-receipt {
  color: #000000;
}

#print-receipt *, .print-receipt * {
  color: #000000;
}
/* --- Animación pulse para producto agregado --- */
.pulse-added {
  animation: pulse-added 0.5s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 0 2px var(--primary), 0 2px 12px rgba(233,69,96,.12);
}
@keyframes pulse-added {
  0% { transform: scale(1); box-shadow: 0 0 0 0 var(--primary); }
  60% { transform: scale(1.08); box-shadow: 0 0 0 6px var(--primary); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 var(--primary); }
}

/* Toast SweetAlert2 custom */
.swal2-popup.mirest-toast {
  font-size: 1.05rem;
  border-radius: 8px;
  min-width: 220px;
  box-shadow: 0 4px 24px rgba(0,0,0,.13);
}
/* ========================================================
   MiRest – AdminLTE-inspired SaaS Theme
   ======================================================== */
:root {
  --primary: #e94560;
  --primary-dark: #c73650;
  --secondary: #0f3460;
  --dark: #1a1a2e;
  --dark-light: #16213e;
  --accent: #533483;
  --success: #28a745;
  --warning: #ffc107;
  --danger: #dc3545;
  --info: #17a2b8;
  --light: #f4f6f9;
  --white: #fff;
  --text: #333;
  --text-muted: #6c757d;
  --sidebar-width: 260px;
  --header-height: 56px;
  --gradient-brand: linear-gradient(135deg, var(--primary), var(--secondary));
  --gradient-dark: linear-gradient(135deg, var(--dark), var(--dark-light));
  --gradient-accent: linear-gradient(135deg, var(--accent), var(--secondary));
  --shadow: 0 2px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.12);
  --radius: 10px;
  --radius-sm: 6px;
  --transition: .25s ease;
}

/* ---------- Reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 15px; scroll-behavior: smooth; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--light); color: var(--text); line-height: 1.55; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* ---------- Splash / Skeleton Screen (Facebook-style) ---------- */
#splash {
  position: fixed; inset: 0; z-index: 99999;
  background: var(--light);
  transition: opacity .4s ease, visibility .4s ease;
  overflow: hidden;
}
#splash.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

/* Skeleton header bar */
#splash .sk-header {
  height: var(--header-height); background: var(--white);
  box-shadow: var(--shadow); display: flex; align-items: center; padding: 0 1.25rem; gap: 1rem;
}
#splash .sk-circle {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
}
#splash .sk-bar {
  border-radius: 4px;
}

/* Skeleton sidebar (desktop) */
#splash .sk-sidebar {
  position: fixed; top: var(--header-height); left: 0; bottom: 0;
  width: var(--sidebar-width); background: var(--dark);
  padding: 1.25rem; display: flex; flex-direction: column; gap: .85rem;
}
#splash .sk-sidebar .sk-bar { background: rgba(255,255,255,.06); }

/* Skeleton content area */
#splash .sk-content {
  margin-left: var(--sidebar-width); padding: 1.5rem;
  padding-top: calc(var(--header-height) + 1.5rem);
}
#splash .sk-row { display: flex; gap: 1rem; margin-bottom: 1rem; }
#splash .sk-card {
  flex: 1; background: var(--white); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--shadow);
}
#splash .sk-card .sk-bar { margin-bottom: .65rem; }
#splash .sk-card .sk-bar:last-child { margin-bottom: 0; }

/* Skeleton pulse animation */
.sk-pulse {
  background: #e9ecef;
  background: linear-gradient(90deg, #e9ecef 25%, #f4f6f9 50%, #e9ecef 75%);
  background-size: 400% 100%;
  animation: skPulse 1.5s ease-in-out infinite;
}
@keyframes skPulse {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Skeleton for guest pages (login/setup) */
#splash .sk-guest {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--gradient-dark); padding: 1rem;
}
#splash .sk-guest-card {
  background: var(--white); border-radius: var(--radius); padding: 2.5rem 2rem;
  width: 100%; max-width: 420px; box-shadow: var(--shadow-lg);
}

/* Splash brand overlay (brief, fades into skeleton) */
#splash .sk-brand-overlay {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--gradient-dark);
  transition: opacity .5s ease;
}
#splash .sk-brand-overlay.fade-out { opacity: 0; pointer-events: none; }
#splash .sk-brand-overlay .logo { font-size: 2.8rem; font-weight: 800; color: var(--white); letter-spacing: 2px; }
#splash .sk-brand-overlay .logo span { color: var(--primary); }
#splash .sk-brand-overlay .tagline { color: rgba(255,255,255,.55); margin-top: .4rem; font-size: .9rem; }
#splash .sk-brand-overlay .sk-progress {
  margin-top: 1.8rem; width: 140px; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,.1); overflow: hidden;
}
#splash .sk-brand-overlay .sk-progress-bar {
  height: 100%; width: 0; border-radius: 2px;
  background: var(--gradient-brand);
  animation: skProgress .9s ease-out forwards;
}
@keyframes skProgress { to { width: 100%; } }

@media (max-width: 992px) {
  #splash .sk-sidebar { display: none; }
  #splash .sk-content { margin-left: 0; }
}

/* ---------- Offline / Online banner ---------- */
#offline-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 99998;
  background: var(--warning); color: #333; text-align: center;
  padding: .5rem; font-weight: 600; font-size: .85rem;
  transform: translateY(-100%); transition: transform .3s ease;
}
#offline-banner.visible { transform: translateY(0); }

/* ---------- Guest layout ---------- */
.guest-wrapper {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--gradient-dark); padding: 1rem;
}
.guest-card {
  background: var(--white); border-radius: var(--radius); padding: 2.5rem 2rem;
  width: 100%; max-width: 420px; box-shadow: var(--shadow-lg);
}
.guest-card .brand { text-align: center; margin-bottom: 1.5rem; }
.guest-card .brand h1 { font-size: 2rem; font-weight: 800; }
.guest-card .brand h1 span { color: var(--primary); }
.guest-card .brand p { color: var(--text-muted); font-size: .88rem; }

/* ---------- Fixed Header ---------- */
.main-header {
  position: fixed; top: 0; left: var(--sidebar-width); right: 0; height: var(--header-height);
  background: var(--white); display: flex; align-items: center;
  padding: 0 1.25rem; box-shadow: var(--shadow); z-index: 1030;
  transition: left var(--transition);
}
.main-sidebar.collapsed ~ .main-header {
  left: 0;
}
.main-header .toggle-sidebar { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--text); margin-right: 1rem; }
.main-header .page-title { font-weight: 700; font-size: 1.05rem; flex: 1; }
.main-header .header-actions { display: flex; align-items: center; gap: .75rem; }
.main-header .user-badge {
  display: flex; align-items: center; gap: .5rem;
  background: var(--light); border-radius: 20px; padding: .3rem .8rem .3rem .3rem;
}
.main-header .user-badge .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gradient-brand); display: flex; align-items: center; justify-content: center;
  color: var(--white); font-weight: 700; font-size: .85rem;
}
.main-header .user-badge span { font-size: .85rem; color: var(--text); }

/* ---------- Fixed Sidebar ---------- */
.main-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-width);
  background: var(--gradient-dark); color: var(--white); overflow-y: auto;
  z-index: 1040; transition: transform var(--transition);
  display: flex; flex-direction: column; 
  transform: translateX(0);
}
.main-sidebar.collapsed {
  transform: translateX(-100%);
}
.main-sidebar .brand-link {
  height: var(--header-height); display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 800; letter-spacing: 1px; color: var(--white);
  border-bottom: 1px solid rgba(255,255,255,.07); flex-shrink: 0; text-decoration: none;
}
.main-sidebar .brand-link:hover { text-decoration: none; color: var(--white); }
.main-sidebar .brand-link span { color: var(--primary); }
.main-sidebar nav { flex: 1; padding: .75rem 0; }
.main-sidebar .nav-section { padding: .5rem 1.25rem; font-size: .7rem; text-transform: uppercase; letter-spacing: 1.5px; color: rgba(255,255,255,.35); margin-top: .6rem; }
.main-sidebar .nav-item {
  display: flex; align-items: center; gap: .7rem;
  padding: .65rem 1.25rem; color: rgba(255,255,255,.7); font-size: .92rem;
  transition: background var(--transition), color var(--transition); cursor: pointer;
}
.main-sidebar .nav-item:hover { background: rgba(255,255,255,.06); color: var(--white); text-decoration: none; }
.main-sidebar .nav-item.active { background: rgba(233,69,96,.15); color: var(--primary); font-weight: 600; border-left: 3px solid var(--primary); }
.main-sidebar .nav-item .icon { width: 22px; text-align: center; font-size: 1.05rem; }

/* ---------- Content wrapper ---------- */
.content-wrapper {
  margin-left: var(--sidebar-width); padding-top: var(--header-height);
  min-height: 100vh; transition: margin-left var(--transition);
}
.main-sidebar.collapsed ~ .content-wrapper {
  margin-left: 0;
}
.content-wrapper .content { padding: 1.25rem; }

/* ---------- Cards ---------- */
.card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 1.25rem; overflow: hidden;
}
.card .card-header {
  padding: .85rem 1.1rem; font-weight: 700; font-size: .95rem;
  border-bottom: 1px solid rgba(0,0,0,.06); display: flex; align-items: center; justify-content: space-between;
}
.card .card-body { padding: 1.1rem; }
.card .card-footer { padding: .75rem 1.1rem; border-top: 1px solid rgba(0,0,0,.06); }

/* Gradient header cards */
.card-gradient { border: none; }
.card-gradient .card-header { color: var(--white); border: none; }
.card-gradient .card-header.bg-brand { background: var(--gradient-brand); }
.card-gradient .card-header.bg-accent { background: var(--gradient-accent); }
.card-gradient .card-header.bg-dark { background: var(--gradient-dark); }

/* Stat cards */
.stat-card {
  border-radius: var(--radius); color: var(--white); padding: 1.25rem;
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute; top: -30%; right: -15%;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.stat-card .stat-value { font-size: 2rem; font-weight: 800; line-height: 1.1; }
.stat-card .stat-label { font-size: .82rem; opacity: .8; margin-top: .25rem; }
.stat-card .stat-icon { font-size: 2.5rem; opacity: .25; position: absolute; right: 1rem; top: 1rem; }

/* ---------- Grid helpers ---------- */
.row { display: flex; flex-wrap: wrap; margin: -.625rem; }
.row > [class*="col-"] { padding: .625rem; }
.col-3  { width: 25%; }
.col-4  { width: 33.333%; }
.col-6  { width: 50%; }
.col-8  { width: 66.666%; }
.col-12 { width: 100%; }

/* ---------- Tables ---------- */
.table-responsive { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.table th { background: var(--light); font-weight: 600; text-align: left; padding: .6rem .75rem; border-bottom: 2px solid #dee2e6; white-space: nowrap; }
table.table td { padding: .55rem .75rem; border-bottom: 1px solid #eee; vertical-align: middle; }
table.table tr:hover td { background: rgba(233,69,96,.03); }

/* ---------- Forms ---------- */
.form-group { margin-bottom: .85rem; }
.form-group label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: .3rem; color: var(--text); }
.form-control {
  width: 100%; padding: .55rem .75rem; font-size: .92rem;
  border: 1px solid #ced4da; border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--white); color: var(--text);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(233,69,96,.12); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236c757d' viewBox='0 0 16 16'%3e%3cpath d='M8 11L3 6h10z'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right .75rem center; padding-right: 2rem; }
.form-check { display: flex; align-items: center; gap: .4rem; margin-bottom: .5rem; }
.form-check input[type="checkbox"] { accent-color: var(--primary); width: 16px; height: 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .5rem 1.1rem; font-size: .9rem; font-weight: 600; border: none;
  border-radius: var(--radius-sm); cursor: pointer; transition: all var(--transition);
  text-decoration: none;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); transform: translateY(-1px); }
.btn-brand { background: var(--gradient-brand); color: var(--white); }
.btn-accent { background: var(--gradient-accent); color: var(--white); }
.btn-success { background: var(--success); color: var(--white); }
.btn-warning { background: var(--warning); color: #333; }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-dark { background: var(--gradient-dark); color: var(--white); }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn-sm { padding: .3rem .7rem; font-size: .82rem; }
.btn-lg { padding: .7rem 1.5rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: .2rem .55rem; font-size: .75rem; font-weight: 600;
  border-radius: 20px; line-height: 1.2;
}
.badge-success { background: rgba(40,167,69,.12); color: var(--success); }
.badge-warning { background: rgba(255,193,7,.15); color: #856404; }
.badge-danger { background: rgba(220,53,69,.12); color: var(--danger); }
.badge-info { background: rgba(23,162,184,.12); color: var(--info); }
.badge-dark { background: rgba(26,26,46,.1); color: var(--dark); }

/* Payment method tags */
.pay-tag {
  display: inline-block;
  background: #e8f0fe;
  color: #1a56db;
  font-size: .78rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  margin: 1px 2px;
  white-space: nowrap;
}

/* ---------- Alerts ---------- */
.alert {
  padding: .75rem 1rem; border-radius: var(--radius-sm); font-size: .88rem;
  margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem;
}
.alert-success { background: rgba(40,167,69,.1); color: #155724; border-left: 4px solid var(--success); }
.alert-danger { background: rgba(220,53,69,.08); color: #721c24; border-left: 4px solid var(--danger); }
.alert-warning { background: rgba(255,193,7,.1); color: #856404; border-left: 4px solid var(--warning); }
.alert-info { background: rgba(23,162,184,.1); color: #0c5460; border-left: 4px solid var(--info); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 9000;
  display: none; align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.active { display: flex; }
.modal-dialog, .modal-content {
  background: var(--white); border-radius: var(--radius); width: 100%; max-width: 720px;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); animation: modalIn .25s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
.modal-dialog .modal-header, .modal-content .modal-header {
  padding: 1rem 1.25rem; font-weight: 700; border-bottom: 1px solid rgba(0,0,0,.06);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; gap: .5rem;
}
.modal-dialog .modal-header h3, .modal-content .modal-header h3 { margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.1rem; }
.modal-dialog .modal-header .close-modal, .modal-content .modal-header .close-modal { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); line-height: 1; padding: .25rem .5rem; flex-shrink: 0; }
.modal-dialog .modal-header .close-modal:hover, .modal-content .modal-header .close-modal:hover { color: var(--danger); }
.modal-dialog .modal-body, .modal-content .modal-body { padding: 1.25rem; overflow-y: auto; flex: 1 1 auto; }
.modal-dialog .modal-footer, .modal-content .modal-footer { padding: .75rem 1.25rem; border-top: 1px solid rgba(0,0,0,.06); display: flex; justify-content: flex-end; gap: .5rem; flex-shrink: 0; }
/* Modal two-column row for compact fields */
.modal-row { display: flex; gap: 1rem; }
.modal-row > .form-group { flex: 1; min-width: 0; }
@media (max-width: 576px) {
  .modal-dialog, .modal-content { max-width: 100%; max-height: 95vh; border-radius: .5rem; }
  .modal-row { flex-direction: column; gap: 0; }
}

/* Multi-payment rows */
.payment-row { display: flex; gap: .4rem; align-items: center; }
.payment-row .pay-amount { max-width: 110px; }
.payment-row .pay-remove { padding: .25rem .5rem; line-height: 1; font-size: 1.1rem; color: var(--danger); border-color: var(--danger); }
.payment-row .pay-remove:hover { background: var(--danger); color: #fff; }

/* ---------- Open Tickets / Tables Grid ---------- */
.tables-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .75rem; }
.table-tile {
  padding: 1rem; border-radius: var(--radius); text-align: center; cursor: pointer;
  font-weight: 700; transition: all var(--transition); border: 2px solid transparent;
}
.table-tile.available { background: rgba(40,167,69,.1); color: #155724; border-color: var(--success); }
.table-tile.occupied { background: rgba(220,53,69,.12); color: #721c24; border-color: var(--danger); }
.table-tile.occupied:hover { background: rgba(220,53,69,.25); transform: translateY(-2px); }
.table-tile .table-name { font-size: 1rem; }
.table-tile .table-info { font-size: .75rem; font-weight: 400; margin-top: .25rem; opacity: .8; }

/* ---------- Device Config ---------- */
.device-config-bar { display: flex; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.device-badge { font-size: .72rem; padding: .2rem .5rem; border-radius: 20px; }

/* ---------- Cash dashboard ---------- */
.cash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}
.cash-kpi-item {
  background: linear-gradient(135deg, #ffffff, #f7fbff);
  border: 1px solid #e8edf3;
  border-radius: var(--radius-sm);
  padding: .75rem .85rem;
}
.cash-kpi-label {
  color: var(--text-muted);
  font-size: .78rem;
  margin-bottom: .2rem;
}
.cash-kpi-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--dark);
}

.cash-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .75rem;
  background: #f9fbfd;
  border: 1px solid #e9eef4;
  border-radius: var(--radius-sm);
  padding: .85rem;
  margin-bottom: .85rem;
}
.cash-filters .form-group { margin-bottom: 0; }

.cash-detail-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .65rem;
  margin-bottom: 1rem;
}
.cash-detail-stat {
  border-radius: var(--radius-sm);
  background: #f7f9fc;
  border: 1px solid #e8edf3;
  padding: .65rem .7rem;
}
.cash-detail-stat span {
  display: block;
  font-size: .75rem;
  color: var(--text-muted);
}
.cash-detail-stat strong {
  display: block;
  margin-top: .2rem;
  font-size: 1rem;
}
.cash-detail-stat-brand {
  background: linear-gradient(135deg, rgba(233,69,96,.13), rgba(83,52,131,.1));
  border-color: rgba(233,69,96,.35);
}

/* ---------- Receipts detail modal ---------- */
.receipt-modal-content {
  background: var(--white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 920px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalIn .25s ease;
}
.receipt-modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.receipt-modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1 1 auto;
}

/* ---------- POS grid ---------- */
.pos-container { display: flex; gap: 1rem; flex-wrap: wrap; }
.pos-products { flex: 1; min-width: 0; }
.pos-cart { width: 360px; flex-shrink: 0; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
.product-tile {
  background: var(--white); border: 2px solid transparent; border-radius: var(--radius);
  padding: .85rem .65rem; text-align: center; cursor: pointer;
  transition: all var(--transition); box-shadow: var(--shadow);
}
.product-tile:hover { border-color: var(--primary); transform: translateY(-2px); }
.product-tile .product-name { font-weight: 700; font-size: .85rem; margin-bottom: .25rem; }
.product-tile .product-price { color: var(--primary); font-weight: 800; font-size: 1rem; }
.product-tile .product-category { font-size: .72rem; color: var(--text-muted); }
.product-tile-img {
  width: 100%; height: 72px; object-fit: cover; border-radius: 6px;
  margin-bottom: .4rem; background: var(--light);
}
/* Product thumbnail in CRUD table */
.product-thumb {
  width: 40px; height: 40px; object-fit: cover; border-radius: 6px;
  background: var(--light); display: block;
}

/* Image preview row (new uploads) */
.img-preview-row {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: .4rem;
}
.img-preview-item {
  width: 60px; height: 60px; object-fit: cover; border-radius: 6px;
  border: 2px solid var(--light);
}

/* Image gallery row (existing images in edit) */
.img-gallery-row {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: .4rem;
}
.img-gallery-item {
  text-align: center; font-size: .75rem;
}
.img-gallery-item img {
  width: 70px; height: 70px; object-fit: cover; border-radius: 6px;
  display: block; margin-bottom: 2px; border: 2px solid var(--light);
}
.img-gallery-item label {
  display: flex; align-items: center; gap: 3px; font-size: .72rem;
  cursor: pointer; color: var(--danger);
}

/* Skeleton product tiles */
.product-skeleton { background: var(--light); border-color: transparent; pointer-events: none; }
.product-skeleton .sk-bar { background: #e0e0e0; border-radius: 4px; }

/* Category filter tabs in POS */
.pos-category-tabs {
  display: flex; gap: 0; padding: .5rem 1rem; overflow-x: auto;
  border-bottom: 1px solid #eee; background: var(--light);
}
.cat-tab {
  background: transparent; border: none; padding: .35rem .8rem;
  font-size: .8rem; cursor: pointer; border-radius: 6px; white-space: nowrap;
  color: var(--text-muted); transition: all .2s;
}
.cat-tab:hover { background: rgba(0,0,0,.05); }
.cat-tab.active { background: var(--primary); color: #fff; font-weight: 600; }

/* POS header controls */
.pos-header-controls { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }

/* Modifier modal */
.mod-group { margin-bottom: 1rem; }
.mod-group label.fw-bold { display: block; margin-bottom: .35rem; font-size: .9rem; }
.mod-group .form-check {
  display: flex; align-items: center; gap: .4rem; padding: .25rem 0;
  font-size: .88rem; cursor: pointer;
}
.mod-group .form-check input { width: 16px; height: 16px; cursor: pointer; }
.mod-group .form-check label { cursor: pointer; }

.cart-item {
  display: flex; align-items: center; gap: .5rem; padding: .5rem 0;
  border-bottom: 1px solid #eee; font-size: .88rem;
}
.cart-item .item-name { flex: 1; font-weight: 600; }
.cart-item .qty-controls { display: flex; align-items: center; gap: .3rem; }
.cart-item .qty-controls button {
  width: 26px; height: 26px; border: none; border-radius: 4px;
  background: var(--light); font-weight: 700; cursor: pointer; font-size: .9rem;
}
.cart-item .qty-controls span { min-width: 20px; text-align: center; font-weight: 600; }
.cart-item .item-total { font-weight: 700; min-width: 65px; text-align: right; }
.cart-item .remove-item { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 1rem; }

.cart-summary { margin-top: .75rem; padding-top: .75rem; border-top: 2px solid var(--dark); }
.cart-summary .total-line { display: flex; justify-content: space-between; font-size: 1.1rem; font-weight: 800; }

/* ---------- Session expiry overlay ---------- */
#session-alert {
  position: fixed; inset: 0; z-index: 99990;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,.7);
}
#session-alert.active { display: flex; }
#session-alert .alert-box {
  background: var(--white); border-radius: var(--radius); padding: 2rem;
  text-align: center; max-width: 380px; box-shadow: var(--shadow-lg);
}
#session-alert .alert-box h2 { color: var(--danger); margin-bottom: .5rem; }

/* ---------- Print-specific ---------- */
.print-receipt { display: none; }
@media print {
  @page { margin: 0; }
  body > *:not(#print-receipt) { display: none !important; }
  .print-receipt {
    display: block !important; position: static;
    width: var(--ticket-width, 80mm); font-family: 'Courier New', monospace; font-size: 13px;
    font-weight: 600; color: #000 !important; background: #fff; padding: 4mm;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
    margin: 0;
  }
  .print-receipt .receipt-header { text-align: center; margin-bottom: 4mm; color: #000 !important; }
  .print-receipt .receipt-header h2 { font-size: 18px; font-weight: 800; color: #000 !important; }
  .print-receipt table { width: 100%; border-collapse: collapse; }
  .print-receipt td { padding: 1mm 0; vertical-align: top; color: #000 !important; }
  .print-receipt .total-line { font-weight: 800; border-top: 1px dashed #000; padding-top: 2mm; margin-top: 2mm; color: #000 !important; }
  .print-receipt .payment-logo { max-height: 24px; margin-top: 2mm; }
  .print-receipt.kitchen { font-size: 17px; font-weight: 800; line-height: 1.35; }
  .print-receipt.kitchen .receipt-header h2 { font-size: 24px; }
  .print-receipt.kitchen td { font-size: 17px; font-weight: 800; }
}

/* ---- Pagination ---- */
.pagination {
  display: flex; gap: 4px; justify-content: center; align-items: center;
  padding: .75rem 0; flex-wrap: wrap;
}
.page-link {
  display: inline-block; padding: .35rem .65rem; border-radius: 6px;
  font-size: .82rem; text-decoration: none; color: var(--secondary);
  border: 1px solid #dee2e6; background: var(--white); transition: all .15s;
}
.page-link:hover { background: var(--light); border-color: var(--primary); color: var(--primary); }
.page-link.active { background: var(--primary); color: var(--white); border-color: var(--primary); pointer-events: none; }

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
  .main-sidebar { transform: translateX(-100%); }
  .main-sidebar.collapsed { transform: translateX(0); }
  .main-header { left: 0; }
  .content-wrapper { margin-left: 0; }
  .main-sidebar.collapsed ~ .main-header { left: 0; }
  .main-sidebar.collapsed ~ .content-wrapper { margin-left: 0; }
  .col-3, .col-4 { width: 50%; }
  .pos-cart { width: 100%; }
  .cash-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cash-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cash-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
  .cash-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cash-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cash-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 576px) {
  .col-3, .col-4, .col-6 { width: 100%; }
  .guest-card { padding: 1.5rem 1.25rem; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .cash-kpi-grid { grid-template-columns: 1fr; }
  .cash-filters { grid-template-columns: 1fr; }
  .cash-detail-grid { grid-template-columns: 1fr; }
}

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.fw-bold { font-weight: 700; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.d-flex { display: flex; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }
.hidden { display: none !important; }

/* ---- DataTables Bootstrap 5 adjustments ---- */
.dataTables_wrapper { padding: .5rem .75rem .75rem; font-size: .85rem; }
table.dataTable { border-collapse: collapse !important; }
table.dataTable thead th { background: #f8f9fa; font-weight: 600; font-size: .82rem; white-space: nowrap; }
table.dataTable.table-striped > tbody > tr.odd > * { box-shadow: inset 0 0 0 9999px rgba(0,0,0,.02); }
table.dataTable tbody td { vertical-align: middle; font-size: .84rem; }
div.dt-buttons { margin-bottom: .5rem; }
div.dt-buttons .btn { font-size: .78rem; padding: .3rem .65rem; }
.dt-search input { border-radius: var(--radius) !important; font-size: .85rem; }
.dt-info { font-size: .8rem; color: var(--muted); }
.dt-paging .page-link { font-size: .82rem; }
.dt-paging .page-item.active .page-link { background-color: var(--primary); border-color: var(--primary); }
