/* =========================================
   Cơm Lam — POS System Styles
   Replaces Tailwind CDN for POS pages
   Uses CSS variables from styles.css
   ========================================= */

/* ---------- POS Page Base ---------- */
.pos-page {
  font-family: var(--font-body);
  background: radial-gradient(circle at center, #131313 0%, #050505 100%);
  color: var(--on-surface);
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ---------- POS Sub-Navigation ---------- */
.pos-subnav {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}
.pos-subnav a {
  padding: 0.5rem 1.25rem;
  font-weight: 700;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #99907c;
  transition: all 0.3s;
  text-decoration: none;
  font-family: var(--font-headline);
}
.pos-subnav a:hover { color: #d0c5af; background: #2a2a2a; }
.pos-subnav a.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

/* ---------- Glass Panel ---------- */
.pos-glass {
  background: rgba(18, 18, 18, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(212, 175, 55, 0.1);
}
.pos-glass-dark {
  background: rgba(20, 20, 20, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.pos-glass-light {
  background: rgba(32, 31, 31, 0.4);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(77, 70, 53, 0.15);
}

/* ---------- POS Main Layout (3-column) ---------- */
.pos-main {
  display: flex;
  flex: 1;
  overflow: hidden;
  padding: 1rem 1.25rem;
  gap: 1.25rem;
}

/* Left Column: Table Map */
.pos-sidebar-left {
  width: 250px;
  min-width: 250px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
}
.pos-sidebar-left::-webkit-scrollbar { width: 3px; }
.pos-sidebar-left::-webkit-scrollbar-thumb { background: rgba(212, 175, 55, 0.2); border-radius: 3px; }
.pos-sidebar-left .pos-panel {
  border-radius: 0.75rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

/* Center Column: Menu */
.pos-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
}

/* Right Column: Order */
.pos-sidebar-right {
  width: 350px;
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 1rem;
}
.pos-sidebar-right .pos-panel {
  border-radius: 0.75rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ---------- Table Grid (pos.html) ---------- */
.pos-table-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding-right: 0.25rem;
}
.pos-table-btn {
  aspect-ratio: 1;
  border-radius: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  border: 1px solid rgba(212, 175, 55, 0.2);
  background: rgba(18, 18, 18, 0.6);
  backdrop-filter: blur(20px);
  padding: 0.25rem;
}
.pos-table-btn:hover { background: var(--surface-container); }
.pos-table-btn .table-id {
  font-size: 0.75rem;
  font-family: var(--font-body);
  color: #99907c;
}
.pos-table-btn .table-seats {
  font-size: 0.625rem;
  color: #99907c;
}
.pos-table-btn.occupied {
  background: rgba(242, 202, 80, 0.2);
  border: 1px solid rgba(242, 202, 80, 0.4);
}
.pos-table-btn.occupied .table-id,
.pos-table-btn.occupied .table-seats { color: var(--primary); }
.pos-table-btn.active {
  background: linear-gradient(135deg, #f2ca50 0%, #d4af37 100%);
  box-shadow: 0 0 20px rgba(242, 202, 80, 0.2);
}
.pos-table-btn.active .table-id,
.pos-table-btn.active .table-seats { color: #3c2f00 !important; }

.pos-vip-btn {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.375rem;
  border: 1px solid rgba(255, 191, 185, 0.3);
  cursor: pointer;
  transition: all 0.3s;
}
.pos-vip-btn:hover { background: var(--surface-container); }

/* Table Status Bar */
.pos-table-status {
  margin-top: 1rem;
  background: var(--surface-container-lowest);
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(212, 175, 55, 0.1);
}
.pos-table-status .status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--primary);
  animation: pulse-gold 2s ease infinite;
  display: inline-block;
}

/* ---------- Category Bar ---------- */
.pos-cat-bar {
  border-radius: 0.75rem;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pos-cat-nav {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  padding: 0 0.5rem;
}
.pos-cat-nav::-webkit-scrollbar { display: none; }
.pos-cat-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  color: #99907c;
  background: transparent;
  transition: all 0.3s;
}
.pos-cat-btn:hover { background: var(--surface-container-highest); }
.pos-cat-btn.active {
  background: var(--primary) !important;
  color: #3c2f00 !important;
}
.pos-search-box {
  position: relative;
  width: 16rem;
  margin-right: 0.5rem;
}
.pos-search-box .search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #99907c;
  font-size: 0.875rem;
}
.pos-search-box input {
  width: 100%;
  background: var(--surface-container-lowest);
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  font-size: 0.875rem;
  color: var(--on-surface);
}
.pos-search-box input::placeholder { color: #4d4635; }
.pos-search-box input:focus { outline: 1px solid var(--primary); }

/* ---------- Menu Grid ---------- */
.pos-menu-scroll {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.5rem;
  margin-top: 0.25rem;
}
.pos-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  padding: 0.75rem 0.5rem 2rem;
  align-content: start;
}
.pos-menu-card {
  border-radius: 1rem;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: all 0.3s;
}
.pos-menu-card:hover { border-color: rgba(212, 175, 55, 0.4); }
.pos-menu-card .card-img {
  position: relative;
  height: 10rem;
  overflow: hidden;
}
.pos-menu-card .card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}
.pos-menu-card:hover .card-img img { transform: scale(1.1); }
.pos-menu-card .card-img .card-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.125rem 0.5rem;
  border-radius: 0.125rem;
  text-transform: uppercase;
  font-family: var(--font-body);
}
.pos-menu-card .card-img .card-badge.tertiary {
  background: var(--tertiary);
  color: #fff;
}
.pos-menu-card .card-img .card-badge.primary {
  background: var(--primary);
  color: #000;
}
.pos-menu-card .card-img .card-placeholder {
  width: 100%;
  height: 100%;
  background: var(--surface-container-highest);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pos-menu-card .card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 0.375rem;
}
.pos-menu-card .card-body h3 {
  font-family: var(--font-headline);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--on-surface);
}
.pos-menu-card .card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.pos-menu-card .card-price {
  color: var(--primary);
  font-weight: 700;
  font-family: var(--font-headline);
}
.pos-menu-card .card-add {
  color: rgba(242, 202, 80, 0.4);
  font-size: 0.75rem;
  transition: color 0.3s;
}
.pos-menu-card:hover .card-add { color: var(--primary); }

/* Menu card add animation */
.menu-card-added { animation: addPulse 0.4s ease; }
@keyframes addPulse {
  0% { transform: scale(1); }
  50% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* ---------- Order Panel ---------- */
.pos-order-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}
.pos-order-items {
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 0.25rem;
}
.pos-order-items::-webkit-scrollbar { display: none; }

.pos-order-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem;
  border-radius: 0.5rem;
  border-left: 2px solid transparent;
  transition: all 0.3s ease;
}
.pos-order-item:hover {
  background: var(--surface-container-low);
  border-left-color: var(--primary);
}
.pos-order-item.removing {
  opacity: 0;
  transform: translateX(40px);
  max-height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.pos-empty-cart {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  opacity: 0.4;
}
.pos-empty-cart .material-symbols-outlined {
  font-size: 2rem;
  color: #4d4635;
  margin-bottom: 0.75rem;
}

.pos-order-stats {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(77, 70, 53, 0.2);
}
.pos-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: #99907c;
  padding: 0.25rem 0;
}
.pos-stat-row .val { font-weight: 600; color: var(--on-surface); }
.pos-stat-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}
.pos-stat-total .label {
  font-family: var(--font-headline);
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: -0.025em;
}
.pos-stat-total .val {
  font-family: var(--font-headline);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

/* Action Buttons */
.pos-actions {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.pos-btn {
  padding: 0.75rem;
  border-radius: 0.125rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  text-align: center;
}
.pos-btn:active { transform: scale(0.95); }
.pos-btn-ghost {
  background: transparent;
  border: 1px solid rgba(77, 70, 53, 0.4);
  color: #99907c;
}
.pos-btn-ghost:hover { background: var(--surface-container-highest); }
.pos-btn-green {
  background: rgba(76, 175, 80, 0.2);
  color: #4CAF50;
  border: 1px solid rgba(76, 175, 80, 0.3);
}
.pos-btn-green:hover { background: rgba(76, 175, 80, 0.3); }
.pos-btn-gold {
  background: linear-gradient(135deg, #f2ca50 0%, #d4af37 100%);
  color: #3c2f00;
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(242, 202, 80, 0.25);
  grid-column: span 2;
}
.pos-btn-gold:hover { opacity: 0.9; }
.pos-btn-gold:active { transform: scale(0.98); }

/* Qty/Delete buttons */
.pos-qty-btn {
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.125rem;
  border: 1px solid rgba(77, 70, 53, 0.3);
  background: transparent;
  color: rgba(229, 226, 225, 0.6);
  cursor: pointer;
  transition: all 0.3s;
}
.pos-qty-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.pos-del-btn {
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: rgba(255, 150, 141, 0.6);
  cursor: pointer;
  margin-left: 0.25rem;
  transition: color 0.3s;
}
.pos-del-btn:hover { color: #ff968d; }

/* =========================================
   PAYMENT PAGE
   ========================================= */
.pos-payment-layout {
  display: flex;
  overflow: hidden;
  border-radius: 1rem;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(77, 70, 53, 0.2);
  max-width: 960px;
  width: 100%;
}
.pos-pay-left {
  width: 400px;
  background: #131313;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(77, 70, 53, 0.2);
  padding: 2rem;
}
.pos-pay-right {
  flex: 1;
  background: var(--surface-container-low);
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

/* Payment Method Buttons */
.pos-pay-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
.pos-pay-method {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 0.75rem;
  background: var(--surface-container-high);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s;
}
.pos-pay-method:hover { border-color: rgba(77, 70, 53, 0.5); }
.pos-pay-method.active {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 4px rgba(242, 202, 80, 0.1);
}
.pos-pay-method.active .method-icon,
.pos-pay-method.active .method-label { color: var(--primary) !important; }
.pos-pay-method .method-icon { color: #d0c5af; font-size: 1.25rem; }
.pos-pay-method .method-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #d0c5af;
  text-align: center;
  line-height: 1.3;
}

/* Cash Input Display */
.pos-cash-display {
  background: var(--surface-container-lowest);
  padding: 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(77, 70, 53, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pos-cash-display .currency {
  color: var(--primary);
  font-family: var(--font-headline);
  font-size: 1.875rem;
  font-weight: 700;
}
.pos-cash-display .amount {
  color: var(--on-surface);
  font-family: var(--font-headline);
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.05em;
}

/* Quick Amount Buttons */
.pos-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.pos-quick-btn {
  padding: 0.75rem 0.5rem;
  background: var(--surface-container-highest);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--on-surface);
  border: none;
  cursor: pointer;
  transition: all 0.3s;
}
.pos-quick-btn:hover {
  background: var(--primary);
  color: #3c2f00;
}
.pos-quick-btn:active { transform: scale(0.95); }
.pos-quick-btn.span-2 { grid-column: span 2; }

/* Change Display */
.pos-change-box {
  background: rgba(242, 202, 80, 0.05);
  padding: 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(242, 202, 80, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Numpad */
.pos-numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  width: 100%;
  max-width: 180px;
  align-self: flex-start;
}
.pos-numpad-btn {
  width: 3.5rem;
  height: 3.5rem;
  background: #131313;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--on-surface);
  border: none;
  cursor: pointer;
  transition: background 0.3s;
}
.pos-numpad-btn:hover { background: var(--surface-container-highest); }
.pos-numpad-btn:active { transform: scale(0.9); }
.pos-numpad-btn.back {
  background: rgba(164, 2, 19, 0.2);
  color: #ffb3ac;
}
.pos-numpad-btn.back:hover { background: rgba(164, 2, 19, 0.4); }

/* Payment Footer */
.pos-pay-footer {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(77, 70, 53, 0.2);
}
.pos-pay-actions {
  display: flex;
  gap: 1rem;
}
.pos-pay-btn-cancel {
  flex: 1;
  min-height: 60px;
  border: 1px solid rgba(77, 70, 53, 0.3);
  border-radius: 0.75rem;
  font-weight: 700;
  color: #d0c5af;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  background: transparent;
  cursor: pointer;
  transition: all 0.3s;
}
.pos-pay-btn-cancel:hover { background: var(--surface-container-highest); }
.pos-pay-btn-cancel:active { transform: scale(0.95); }
.pos-pay-btn-complete {
  flex: 2.5;
  min-height: 60px;
  background: linear-gradient(135deg, #f2ca50, #d4af37);
  border-radius: 0.75rem;
  font-weight: 700;
  color: #3c2f00;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(242, 202, 80, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: all 0.3s;
}
.pos-pay-btn-complete:hover { transform: scale(1.02); }
.pos-pay-btn-complete:active { transform: scale(0.95); }

/* Receipt animation */
.receipt-print { animation: printSlide 0.6s ease; }
@keyframes printSlide {
  0% { transform: translateY(-30px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* =========================================
   TABLES PAGE
   ========================================= */
.pos-tables-page {
  display: flex;
  overflow: hidden;
  height: 100vh;
}

/* Side nav */
/* Sidebar style (shared with admin.html) */
.admin-sidebar {
  transition: transform 0.3s ease;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: rgba(229, 226, 225, 0.7);
  border-radius: var(--radius-sm);
  transition: all 0.3s;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-decoration: none;
}
.sidebar-link:hover { color: var(--primary); background: var(--surface-variant); }
.sidebar-link.active { background: var(--primary) !important; color: #000 !important; font-weight: 700; }

.pos-side-nav {
  position: fixed;
  left: 0;
  top: 0;
  height: 100%;
  z-index: 40;
  border-right: 1px solid rgba(139, 92, 42, 0.2);
  background: rgba(26, 26, 26, 0.8);
  backdrop-filter: blur(16px);
  width: 16rem;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  gap: 0.5rem;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.3);
}
/* (Deprecating old side nav classes gradually) */
.pos-side-nav a, .pos-side-nav button {
  color: #555;
}

/* Tables Main Content */
.pos-tables-main {
  margin-left: 16rem;
  display: flex;
  flex-direction: column;
  width: calc(100% - 16rem);
}

/* Tables Top Nav */
.pos-tables-topnav {
  background: rgba(5, 5, 5, 0.7);
  backdrop-filter: blur(20px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  height: 5rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

/* Tables Split View */
.pos-tables-split {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Map Section (60%) */
.pos-map-section {
  width: 60%;
  padding: 2rem;
  overflow-y: auto;
  position: relative;
  background: var(--surface-container-lowest);
}

/* Floor Navigation */
.pos-floor-nav {
  display: flex;
  gap: 0.5rem;
}
.pos-floor-btn {
  background: var(--surface-container-high);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  color: var(--on-surface);
  transition: all 0.3s;
}
.pos-floor-btn:hover { background: var(--surface-container-highest); }
.pos-floor-btn.active {
  background: var(--primary) !important;
  color: #3c2f00 !important;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

/* Table Map Container */
.pos-map-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  background: rgba(32, 31, 31, 0.3);
  border-radius: 1.5rem;
  border: 1px solid rgba(77, 70, 53, 0.15);
  padding: 3rem;
  overflow: hidden;
}
.pos-map-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
  height: 100%;
}

/* Table Cells */
.pos-table-cell {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  border: none;
  background: transparent;
}
.pos-table-cell:hover { transform: scale(1.05); }
.pos-table-cell.available { border: 2px solid rgba(76, 175, 80, 0.5); }
.pos-table-cell.available:hover { background: rgba(76, 175, 80, 0.05); }
.pos-table-cell.available .cell-name { color: #4CAF50; }
.pos-table-cell.occupied {
  background: rgba(242, 202, 80, 0.2);
  border: 1px solid rgba(242, 202, 80, 0.5);
  box-shadow: 0 0 15px rgba(242, 202, 80, 0.3) inset;
}
.pos-table-cell.occupied .cell-name { color: var(--primary); }
.pos-table-cell.cleaning {
  background: var(--surface-container-highest);
  border: 1px solid rgba(255, 255, 255, 0.05);
  opacity: 0.5;
}
.pos-table-cell.cleaning .cell-name { color: #d0c5af; }
.pos-table-cell.reserved {
  border: 2px solid rgba(255, 150, 141, 0.6);
  background: rgba(255, 150, 141, 0.05);
}
.pos-table-cell.reserved:hover { background: rgba(255, 150, 141, 0.1); }
.pos-table-cell.reserved .cell-name { color: #ffbfb9; }
.pos-table-cell.selected {
  background: var(--primary) !important;
  border-color: #d4af37 !important;
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(242, 202, 80, 0.3);
}
.pos-table-cell.selected span { color: #3c2f00 !important; }

/* Legend */
.pos-legend {
  margin-top: 3rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  background: rgba(28, 27, 27, 0.5);
  width: fit-content;
  padding: 1rem 2rem;
  border-radius: 1rem;
  border: 1px solid rgba(77, 70, 53, 0.15);
}
.pos-legend-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.pos-legend-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
}
.pos-legend-dot.green { background: #4CAF50; box-shadow: 0 0 8px rgba(76, 175, 80, 0.2); }
.pos-legend-dot.gold { background: var(--primary); box-shadow: 0 0 8px rgba(212, 175, 55, 0.2); }
.pos-legend-dot.red { background: #ffbfb9; box-shadow: 0 0 8px rgba(255, 191, 185, 0.2); }
.pos-legend-dot.grey {
  background: var(--surface-container-highest);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Detail Panel (40%) */
.pos-detail-panel {
  width: 40%;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* =========================================
   REPORTS PAGE
   ========================================= */

/* KPI Cards */
.pos-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.pos-kpi-card {
  padding: 1.5rem;
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.3s;
}
.pos-kpi-card:hover { transform: scale(1.02); }

/* Filter Bar */
.pos-filter-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}
.pos-filter-bar::-webkit-scrollbar { display: none; }
.pos-filter-btn {
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  background: var(--surface-container-high);
  color: #d0c5af;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s;
}
.pos-filter-btn:hover { background: var(--surface-variant); }
.pos-filter-btn.active {
  background: var(--primary) !important;
  color: #3c2f00 !important;
}

/* Order Table */
.pos-order-table {
  width: 100%;
  text-align: left;
  border-collapse: collapse;
}
.pos-order-table thead {
  background: rgba(53, 53, 52, 0.5);
}
.pos-order-table th {
  padding: 1rem 1.5rem;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #d0c5af;
}
.pos-order-table tbody tr {
  border-bottom: 1px solid rgba(77, 70, 53, 0.1);
  transition: background 0.3s;
  cursor: pointer;
}
.pos-order-table tbody tr:hover {
  background: rgba(42, 42, 42, 0.4);
}
.pos-order-table td {
  padding: 1rem 1.5rem;
  font-size: 0.75rem;
}
.pos-status-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 0.125rem;
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.05em;
}
.pos-status-badge.success {
  background: rgba(242, 202, 80, 0.1);
  color: var(--primary);
}
.pos-status-badge.cancelled {
  background: rgba(255, 180, 171, 0.1);
  color: #ffb4ab;
}

/* Row flash animation */
.row-highlight { animation: rowFlash 0.5s ease; }
@keyframes rowFlash {
  0%, 100% { background: transparent; }
  50% { background: rgba(242, 202, 80, 0.08); }
}

/* Hourly Chart */
.pos-hourly-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 6rem;
  gap: 0.25rem;
  padding: 0 0.5rem;
}
.pos-hourly-bar {
  width: 100%;
  border-radius: 0.125rem 0.125rem 0 0;
  transition: all 0.5s;
}

/* Progress Bar */
.pos-progress {
  width: 100%;
  height: 0.25rem;
  background: var(--surface-container-high);
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 0.5rem;
}
.pos-progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.5s;
}

/* Reports Footer */
.pos-rpt-footer {
  background: var(--surface-container-lowest);
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid rgba(77, 70, 53, 0.1);
}
.pos-rpt-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.pos-rpt-btn:active { transform: scale(0.95); }
.pos-rpt-btn.outline {
  border: 2px solid rgba(212, 175, 55, 0.4);
  color: var(--primary);
  background: transparent;
}
.pos-rpt-btn.outline:hover {
  background: var(--primary);
  color: #3c2f00;
}
.pos-rpt-btn.ghost {
  color: #d0c5af;
  background: transparent;
}
.pos-rpt-btn.ghost:hover { color: var(--on-surface); }
.pos-rpt-btn.bordered {
  border: 1px solid rgba(77, 70, 53, 0.3);
  color: #d0c5af;
  background: transparent;
}
.pos-rpt-btn.bordered:hover { border-color: var(--primary); }
.pos-rpt-btn.danger {
  background: #ffb4ab;
  color: #690005;
  box-shadow: 0 4px 12px rgba(255, 180, 171, 0.2);
}
.pos-rpt-btn.danger:hover { transform: scale(1.05); }

/* =========================================
   SHARED UTILITIES
   ========================================= */

/* Typography helpers */
.font-serif { font-family: var(--font-headline); }
.font-mono { font-family: monospace; }
.text-primary { color: var(--primary); }
.text-muted { color: #99907c; }
.text-label {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #d0c5af;
}
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-bold { font-weight: 700; }
.text-semibold { font-weight: 600; }
.italic { font-style: italic; }

/* Spacing */
.mt-auto { margin-top: auto; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }

/* Flex */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.flex-grow { flex-grow: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }

/* Visibility */
.hidden { display: none; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.w-full { width: 100%; }

/* Borders */
.border-t { border-top: 1px solid rgba(77, 70, 53, 0.2); }
.rounded-xl { border-radius: 0.75rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }

/* Scrollbar hide */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Checkbox styling */
.pos-checkbox {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}
.pos-checkbox input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  border-radius: 0.125rem;
  border: 1px solid #99907c;
  accent-color: var(--primary);
  background: #131313;
}
.pos-checkbox span {
  font-size: 0.875rem;
  font-weight: 500;
  color: #d0c5af;
  transition: color 0.3s;
}
.pos-checkbox:hover span { color: var(--on-surface); }

/* Gold gradient background for buttons */
.gold-gradient {
  background: linear-gradient(135deg, #f2ca50 0%, #d4af37 100%);
}

/* =========================================
   RESPONSIVE POS — COMPLETE
   ========================================= */

/* SMALL DESKTOP (1025px - 1250px) */
@media (max-width: 1250px) {
  .pos-sidebar-left { width: 200px !important; min-width: 200px !important; }
  .pos-sidebar-right { width: 280px !important; }
  .pos-menu-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 1rem !important; }
}

/* TABLET (768px - 1024px) */
@media (max-width: 1024px) {
  /* Sidebar nav collapses to icon-only */
  .pos-side-nav {
    width: 4.5rem !important;
    padding: 0.75rem 0.5rem !important;
    align-items: center;
  }
  .pos-side-nav .nav-logo-text { display: none !important; }
  .pos-side-nav .sidebar-link span:not(.material-symbols-outlined) { display: none; }
  .pos-side-nav .sidebar-link { justify-content: center; padding: 0.75rem !important; }
  .pos-side-nav > a:first-child { justify-content: center; }
  .pos-side-nav > a:first-child img { width: 2rem !important; height: 2rem !important; }
  .pos-side-nav > div:nth-last-child(2) { display: none; } /* Hide chef info */
  .pos-side-nav .lang-switcher { flex-direction: column; gap: 0.25rem; }
  .pos-side-nav .lang-switcher .divider { display: none; }

  .pos-tables-main {
    margin-left: 4.5rem !important;
    width: calc(100% - 4.5rem) !important;
  }

  .pos-main { padding: 0.75rem !important; gap: 0.75rem !important; }
  .pos-sidebar-left { width: 180px !important; min-width: 180px !important; }
  .pos-sidebar-right { width: 260px !important; }
  .pos-menu-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 0.75rem !important; }
  .pos-menu-card .card-img { height: 7rem !important; }
  
  .pos-cat-bar { flex-wrap: wrap !important; gap: 0.5rem !important; padding: 0.375rem !important; }
  .pos-cat-nav { flex-wrap: wrap !important; }
  .pos-cat-btn { padding: 0.375rem 0.75rem !important; font-size: 0.6875rem !important; }
  .pos-search-box { width: 100% !important; margin-right: 0 !important; margin-top: 0.25rem; }

  .pos-top-header { padding: 0.5rem 1rem !important; }
}

/* SMALL TABLET / LARGE PHONE (max-width: 767px) */
@media (max-width: 767px) {
  /* Side nav becomes bottom bar */
  .pos-side-nav {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: auto !important;
    flex-direction: row !important;
    padding: 0.5rem 0.75rem !important;
    border-right: none !important;
    border-top: 1px solid rgba(139, 92, 42, 0.3) !important;
    z-index: 100 !important;
    gap: 0 !important;
    justify-content: space-around !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5) !important;
    background: rgba(20, 20, 20, 0.95) !important;
  }
  .pos-side-nav .nav-logo-text { display: none !important; }
  .pos-side-nav > a:first-child { display: none !important; } /* hide logo */
  .pos-side-nav > div:nth-last-child(2) { display: none !important; } /* hide chef info */
  .pos-side-nav .lang-switcher { display: none !important; }
  .pos-side-nav nav {
    display: flex !important;
    flex-direction: row !important;
    gap: 0 !important;
    width: 100% !important;
    justify-content: space-around !important;
  }
  .pos-side-nav .sidebar-link {
    flex-direction: column !important;
    gap: 0.125rem !important;
    padding: 0.375rem 0.5rem !important;
    font-size: 0.5625rem !important;
    text-align: center;
  }
  .pos-side-nav .sidebar-link span:not(.material-symbols-outlined) {
    font-size: 0.5625rem !important;
    white-space: nowrap;
  }
  .pos-side-nav .sidebar-link .material-symbols-outlined {
    font-size: 1.25rem !important;
  }

  /* Main content takes full width */
  .pos-tables-main {
    margin-left: 0 !important;
    width: 100% !important;
    padding-bottom: 4rem; /* space for bottom nav */
  }

  /* Top header compact */
  .pos-top-header {
    padding: 0.5rem 0.75rem !important;
  }
  .pos-lock-btn span:last-child { display: none; }

  /* 3-column layout → stacked vertically */
  .pos-main {
    flex-direction: column !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 0.75rem !important;
    gap: 0.75rem !important;
    height: auto !important;
    min-height: calc(100vh - 4rem);
  }

  /* Left sidebar (tables) — horizontal compact */
  .pos-sidebar-left {
    width: 100% !important;
    min-width: unset !important;
    order: 1;
    overflow-y: visible !important;
  }
  .pos-sidebar-left .pos-panel {
    padding: 0.75rem !important;
  }
  .pos-sidebar-left .pos-panel > div:first-child {
    margin-bottom: 0.75rem !important;
  }
  .pos-table-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 0.375rem !important;
  }
  .pos-table-btn {
    aspect-ratio: 1 !important;
    padding: 0.125rem !important;
  }
  .pos-table-btn .table-id { font-size: 0.625rem !important; }
  .pos-table-btn .table-seats { font-size: 0.5rem !important; }
  
  #vip-section { margin-top: 0.5rem !important; padding-top: 0.5rem !important; }
  .pos-vip-btn { padding: 0.375rem 0.5rem !important; margin-bottom: 0.25rem !important; }
  .pos-vip-btn .text-sm { font-size: 0.75rem !important; }
  .pos-vip-btn .text-xs { font-size: 0.5625rem !important; }
  
  .pos-table-status { margin-top: 0.5rem !important; padding: 0.5rem !important; }

  /* Center — Menu section */
  .pos-center {
    order: 2;
    width: 100% !important;
    overflow: visible !important;
    max-height: none !important;
  }
  .pos-cat-bar {
    flex-wrap: wrap !important;
    gap: 0.375rem !important;
    padding: 0.375rem !important;
  }
  .pos-cat-nav { flex-wrap: wrap !important; gap: 0.25rem !important; }
  .pos-cat-btn { padding: 0.375rem 0.75rem !important; font-size: 0.6875rem !important; }
  .pos-search-box { width: 100% !important; margin-right: 0 !important; margin-top: 0.375rem; }
  
  .pos-menu-scroll {
    max-height: 60vh !important;
    overflow-y: auto !important;
    flex: none !important;
  }
  .pos-menu-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }
  .pos-menu-card .card-img { height: 8rem !important; }
  .pos-menu-card .card-body { padding: 0.625rem !important; }
  .pos-menu-card .card-body h3 { font-size: 0.75rem !important; }

  /* Right sidebar — Order panel */
  .pos-sidebar-right {
    width: 100% !important;
    order: 3;
  }
  .pos-sidebar-right .pos-panel {
    height: auto !important;
    padding: 1rem !important;
  }
  .pos-order-header { margin-bottom: 1rem !important; }
  .pos-order-items { max-height: 30vh; overflow-y: auto; }
  .pos-actions { gap: 0.5rem !important; }
  .pos-btn { padding: 0.625rem !important; font-size: 0.75rem !important; }

  /* Chống tràn ngang */
  .pos-page { overflow-x: hidden !important; }
}

/* VERY SMALL PHONE (max-width: 400px) */
@media (max-width: 400px) {
  .pos-table-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }
  .pos-menu-grid {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }
  .pos-menu-card .card-img { height: 10rem !important; }
  .pos-cat-btn { padding: 0.25rem 0.5rem !important; font-size: 0.625rem !important; }
  .pos-top-header > div { flex-wrap: wrap !important; }
}

/* Payment Page Specific */
@media (max-width: 900px) {
  .pos-payment-layout { flex-direction: column !important; height: auto !important; }
  .pos-pay-left, .pos-pay-right { width: 100% !important; padding: 1.25rem !important; }
  .pos-pay-left { border-right: none !important; border-bottom: 1px solid rgba(77, 70, 53, 0.2); }
}
@media (max-width: 767px) {
  .pos-payment-layout { border-radius: 0 !important; }
  .pos-pay-methods { grid-template-columns: repeat(2, 1fr) !important; gap: 0.5rem !important; }
  .pos-quick-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .pos-numpad { max-width: 100% !important; justify-self: center; }
  .pos-pay-actions { flex-direction: column !important; }
  .pos-pay-btn-cancel, .pos-pay-btn-complete { width: 100% !important; flex: none !important; }
}

/* Tables Page Specific */
@media (max-width: 767px) {
  .pos-tables-split { flex-direction: column !important; overflow-y: auto !important; }
  .pos-map-section { width: 100% !important; padding: 1rem !important; }
  .pos-map-container { padding: 1rem !important; aspect-ratio: auto !important; }
  .pos-map-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 0.75rem !important; }
  .pos-detail-panel { width: 100% !important; border-left: none !important; border-top: 1px solid rgba(77, 70, 53, 0.2); }
  .pos-legend { flex-wrap: wrap; gap: 1rem !important; padding: 0.75rem 1rem !important; }
  .pos-tables-topnav { flex-direction: column !important; height: auto !important; gap: 0.75rem !important; padding: 0.75rem 1rem !important; }
  .pos-floor-nav { flex-wrap: wrap !important; }
}

/* Reports Page Specific */
@media (max-width: 767px) {
  .pos-rpt-footer { flex-direction: column !important; gap: 0.5rem !important; }
  .pos-rpt-btn { width: 100% !important; justify-content: center !important; }
}
