/* ============================================================
   Southern Bakers POS — Light / White Theme
   Clean, professional, touch-friendly
   ============================================================ */

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

/* ============================================================
   CSS Variables — Light Theme
   ============================================================ */
:root {
  --primary:        #e85324;
  --primary-dark:   #c7401a;
  --primary-light:  #ff7a54;
  --accent:         #f5a623;
  --success:        #16a34a;
  --danger:         #dc2626;
  --warning:        #d97706;
  --info:           #0891b2;

  /* Light theme backgrounds */
  --bg:             #f3f4f6;
  --surface:        #ffffff;
  --surface-2:      #f9fafb;
  --sidebar-bg:     #ffffff;
  --topbar-bg:      #ffffff;

  /* Text */
  --text-primary:   #111827;
  --text-secondary: #6b7280;
  --text-muted:     #9ca3af;

  /* Borders & Shadows */
  --border:         #e5e7eb;
  --border-md:      #d1d5db;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow:         0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:      0 10px 30px rgba(0,0,0,.12);

  /* Misc */
  --font:           'Inter', sans-serif;
  --radius:         10px;
  --radius-sm:      6px;
  --transition:     all 0.16s ease;
  --touch-target:   48px;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }

/* ============================================================
   Login Page
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fff1ee 0%, #f9fafb 50%, #fef3cd 100%);
  padding: 1rem;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.2rem;
  font-size: 2rem;
  box-shadow: 0 8px 24px rgba(232,83,36,.3);
}

.login-card h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 0 0.3rem;
  color: var(--text-primary);
}

.login-card .subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.form-group { margin-bottom: 1.1rem; text-align: left; }
.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 1rem;
  transition: var(--transition);
  -webkit-appearance: none;
  appearance: none;
  height: var(--touch-target);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(232,83,36,.12);
}
.form-control::placeholder { color: var(--text-muted); }

.btn-login {
  width: 100%;
  height: var(--touch-target);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.04em;
  margin-top: 0.5rem;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(232,83,36,.3);
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(232,83,36,.4);
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
  text-align: left;
}

/* ============================================================
   POS Dashboard Layout
   ============================================================ */
.pos-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

/* Top Navigation Bar */
.pos-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1rem;
  height: 56px;
  flex-shrink: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.pos-topbar .brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.pos-topbar .brand-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.pos-topbar .topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.topbar-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  min-height: 36px;
}

.topbar-btn:hover {
  background: var(--bg);
  color: var(--text-primary);
  border-color: var(--border-md);
}

/* Tab Bar */
.pos-tabbar {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1rem;
  flex-shrink: 0;
}

.pos-tab {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.75rem 1.25rem;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  margin-bottom: -1px;
}

.pos-tab:hover { color: var(--text-primary); }
.pos-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Main content area */
.pos-main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ============================================================
   Left Panel — Categories Sidebar
   ============================================================ */
.cat-sidebar {
  width: 84px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
  gap: 0.25rem;
  scrollbar-width: none;
}
.cat-sidebar::-webkit-scrollbar { display: none; }

.cat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.6rem 0.3rem;
  margin: 0 0.4rem;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.68rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  line-height: 1.2;
  min-height: 58px;
}

.cat-btn .cat-icon { font-size: 1.4rem; margin-bottom: 0.1rem; }
.cat-btn:hover { background: var(--bg); color: var(--text-primary); }
.cat-btn.active {
  background: #fff1ee;
  color: var(--primary);
  font-weight: 700;
  border-left: 3px solid var(--primary);
}

/* ============================================================
   Center Panel — Menu Items Grid
   ============================================================ */
.menu-grid-panel {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  background: var(--bg);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 0.6rem;
}

.menu-item-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
  position: relative;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--shadow-sm);
}

.menu-item-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(232,83,36,.16);
  transform: translateY(-1px);
}

.menu-item-card:active { transform: scale(0.97); }

.item-thumb {
  height: 76px;
  background: linear-gradient(135deg, #fff1ee, #fef9f5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.item-thumb img { width: 100%; height: 100%; object-fit: cover; }

.item-info { padding: 0.5rem 0.6rem 0.6rem; }

.item-name {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-price { font-weight: 700; font-size: 0.88rem; color: var(--primary); }

.item-add-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 0;
  transition: var(--transition);
}

.menu-item-card:hover .item-add-btn { opacity: 1; }

/* ============================================================
   Right Panel — Bill Summary
   ============================================================ */
.bill-panel {
  width: 300px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.bill-header {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: var(--surface);
}

.bill-header h2 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-primary);
}

.bill-badge {
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

.bill-items-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  background: var(--surface-2);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.bill-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
}

.bill-empty .empty-icon { font-size: 3rem; margin-bottom: 0.5rem; opacity: 0.4; }
.bill-empty p { font-size: 0.85rem; margin: 0; }

.bill-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 0.4rem;
  transition: var(--transition);
}

.bill-item-name {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bill-qty-controls {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.qty-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--border-md);
  background: var(--surface-2);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  transition: var(--transition);
  flex-shrink: 0;
}

.qty-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.qty-display { font-size: 0.85rem; font-weight: 700; min-width: 20px; text-align: center; }

.bill-item-price {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.bill-remove-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  padding: 0;
  flex-shrink: 0;
}

.bill-remove-btn:hover { background: var(--danger); color: #fff; }

/* Bill Summary */
.bill-summary {
  border-top: 1px solid var(--border);
  padding: 0.75rem 0.85rem;
  flex-shrink: 0;
  background: var(--surface);
}

.bill-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
  margin-bottom: 0.4rem;
  color: var(--text-secondary);
}

.bill-summary-row.total {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  padding-top: 0.5rem;
  border-top: 2px solid var(--border);
  margin-top: 0.25rem;
}

.bill-summary-row .amount { color: var(--text-primary); font-weight: 600; }
.bill-summary-row.total .amount { color: var(--primary); }

/* Discount Row */
.discount-row { display: flex; gap: 0.4rem; margin-bottom: 0.6rem; }

.discount-input {
  flex: 1;
  padding: 0.4rem 0.5rem;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.82rem;
  -webkit-appearance: none;
  appearance: none;
}

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

.discount-type-select {
  padding: 0.4rem 0.35rem;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.78rem;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

/* Bill Action Buttons */
.bill-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  padding: 0.7rem 0.85rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
}

.btn-pos {
  padding: 0.62rem 0.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 42px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.btn-cancel {
  background: var(--surface-2);
  color: var(--danger);
  border: 1.5px solid #fecaca;
}
.btn-draft {
  background: #eff6ff;
  color: #2563eb;
  border: 1.5px solid #bfdbfe;
}
.btn-kitchen {
  background: rgba(239,68,68,.12);
  color: #ef4444;
  border: 1.5px solid rgba(239,68,68,.3);
}
.btn-print {
  background: rgba(251,146,60,.12);
  color: #fb923c;
  border: 1.5px solid rgba(251,146,60,.35);
}
.btn-settle {
  background: linear-gradient(135deg, var(--success), #22c55e);
  color: #fff;
  border: none;
}
.btn-cancel:hover  { background: #fef2f2; }
.btn-draft:hover   { background: #dbeafe; }
.btn-kitchen:hover { background: rgba(239,68,68,.22); }
.btn-print:hover   { background: rgba(251,146,60,.22); }
.btn-settle:hover  { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(22,163,74,.3); }

/* ============================================================
   Slot / Table Grid Views
   ============================================================ */
.slot-grid-panel {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.slot-grid-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
}

.slot-card {
  aspect-ratio: 1;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.5rem;
  user-select: none;
  box-shadow: var(--shadow-sm);
}

.slot-card.available { border-color: var(--border); }
.slot-card.occupied  { border-color: var(--warning); background: #fffbeb; }
.slot-card:hover { transform: scale(1.04); box-shadow: var(--shadow); border-color: var(--primary); }

.slot-number { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); line-height: 1; }
.slot-label  { font-size: 0.62rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 0.2rem; }

.slot-status-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 0.4rem; }
.slot-card.available .slot-status-dot { background: var(--success); }
.slot-card.occupied  .slot-status-dot { background: var(--warning); }

.slot-amount { font-size: 0.68rem; font-weight: 600; color: var(--primary); margin-top: 0.15rem; }

/* Table Grid */
.table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.75rem;
}

.table-card {
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.75rem 0.5rem;
  user-select: none;
  min-height: 100px;
  box-shadow: var(--shadow-sm);
}

.table-card .table-icon { font-size: 1.8rem; margin-bottom: 0.3rem; }
.table-card .table-num  { font-size: 1.1rem; font-weight: 800; color: var(--text-primary); }
.table-card .table-lbl  { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); }
.table-card.available   { border-color: var(--border); }
.table-card.occupied    { border-color: var(--warning); background: #fffbeb; }
.table-card:hover { transform: scale(1.04); box-shadow: var(--shadow); border-color: var(--primary); }

/* ============================================================
   Payment Modal
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

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

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.22s ease;
  overflow: hidden;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
}

.modal-header h3 { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }

.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.modal-body { padding: 1.5rem; background: var(--surface); }

.payment-tabs {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 1.25rem;
  gap: 2px;
}

.pay-tab {
  flex: 1;
  padding: 0.5rem;
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.pay-tab.active { background: var(--primary); color: #fff; }

.payment-total-display {
  background: linear-gradient(135deg, #fff1ee, #fef9f5);
  border: 1px solid #fcd5c7;
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.payment-total-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary); margin-bottom: 0.3rem; }
.payment-total-amount { font-size: 2rem; font-weight: 800; color: var(--primary); }

.modal-input-group { margin-bottom: 1rem; }

.modal-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 1rem;
  transition: var(--transition);
  -webkit-appearance: none;
  appearance: none;
  height: var(--touch-target);
}

.modal-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232,83,36,.10);
  background: var(--surface);
}

.change-display {
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  color: #16a34a;
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
}

.modal-footer {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.btn-pay {
  flex: 1;
  height: var(--touch-target);
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--success), #22c55e);
  color: #fff;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  box-shadow: 0 4px 12px rgba(22,163,74,.25);
}

.btn-pay:hover { filter: brightness(1.08); transform: translateY(-1px); }

.btn-modal-cancel {
  height: var(--touch-target);
  padding: 0 1.25rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-modal-cancel:hover { background: var(--bg); color: var(--text-primary); }

/* ============================================================
   Toast Notifications
   ============================================================ */
.toast-container {
  position: fixed;
  top: 64px;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: slideIn 0.25s ease, fadeOut 0.3s ease 2.7s forwards;
  max-width: 280px;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
}

.toast.success { border-color: #86efac; background: #f0fdf4; color: #15803d; }
.toast.error   { border-color: #fca5a5; background: #fef2f2; color: #b91c1c; }
.toast.info    { border-color: #93c5fd; background: #eff6ff; color: #1d4ed8; }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-8px); } }

/* ============================================================
   Receipt Preview (Screen)
   ============================================================ */
.receipt-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem;
  min-height: 100vh;
  background: var(--bg);
}

.receipt-preview {
  background: #fff;
  color: #000;
  width: 304px;
  max-width: 100%;
  padding: 1rem 0.75rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.receipt-preview .r-center { text-align: center; }
.receipt-preview .r-title { font-size: 14px; font-weight: bold; }
.receipt-preview .r-divider { border-top: 1px dashed #000; margin: 6px 0; }
.receipt-preview .r-row { display: flex; justify-content: space-between; margin: 2px 0; }
.receipt-preview .r-row.bold { font-weight: bold; }

.receipt-print-btn {
  display: block;
  width: 304px;
  margin: 1rem auto 0;
  padding: 0.85rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  box-shadow: 0 4px 12px rgba(232,83,36,.25);
}

.receipt-print-btn:hover { background: var(--primary-dark); }

/* ============================================================
   Admin Layout
   ============================================================ */
.admin-layout { display: flex; min-height: 100vh; background: var(--bg); }

.admin-sidebar {
  width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.admin-logo { padding: 1.2rem; border-bottom: 1px solid var(--border); }
.admin-logo h2 { font-size: 1rem; font-weight: 700; margin: 0; color: var(--primary); }
.admin-logo p  { font-size: 0.75rem; color: var(--text-secondary); margin: 0.1rem 0 0; }

.admin-nav { padding: 1rem 0; }
.admin-nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1.2rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  transition: var(--transition);
  border-left: 3px solid transparent;
}
.admin-nav a:hover { color: var(--text-primary); background: var(--bg); }
.admin-nav a.active { color: var(--primary); border-left-color: var(--primary); background: #fff1ee; font-weight: 600; }

.admin-content { flex: 1; padding: 1.5rem; overflow-y: auto; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.admin-header h1 { font-size: 1.4rem; font-weight: 700; margin: 0; color: var(--text-primary); }

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.stat-card .s-label { font-size: 0.78rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; }
.stat-card .s-value { font-size: 1.6rem; font-weight: 800; color: var(--text-primary); margin-top: 0.3rem; }
.stat-card .s-sub   { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.15rem; }

/* Data Table */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
.data-table th {
  text-align: left;
  padding: 0.65rem 0.85rem;
  background: var(--surface-2);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1.5px solid var(--border);
}
.data-table td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}
.data-table tr:hover td { background: var(--surface-2); }

.badge-success { background: #dcfce7; color: #15803d; padding: 0.15rem 0.5rem; border-radius: 20px; font-size: 0.73rem; font-weight: 600; }
.badge-warning { background: #fef3c7; color: #92400e; padding: 0.15rem 0.5rem; border-radius: 20px; font-size: 0.73rem; font-weight: 600; }
.badge-primary { background: #ffedd5; color: #c2410c; padding: 0.15rem 0.5rem; border-radius: 20px; font-size: 0.73rem; font-weight: 600; }

/* ============================================================
   Loading Spinner
   ============================================================ */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  .cat-sidebar { width: 66px; }
  .bill-panel {
    position: fixed;
    right: -100%;
    top: 0;
    height: 100%;
    z-index: 500;
    transition: right 0.3s ease;
    width: 85vw;
    max-width: 310px;
    box-shadow: none;
  }
  .bill-panel.open { right: 0; box-shadow: -4px 0 20px rgba(0,0,0,.12); }
  .menu-grid { grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); }
  .pos-topbar .brand-text { display: none; }
  .slot-grid { grid-template-columns: repeat(5, 1fr); }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; }
}

@media (max-width: 480px) {
  .menu-grid { grid-template-columns: repeat(2, 1fr); }
  .login-card { padding: 1.75rem 1.25rem; }
}
