/* ============================================
   POS SYSTEM — STYLE.CSS
   Google Fonts: Sarabun (Thai) + Bebas Neue
   ============================================ */

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

/* ============================================
   CSS VARIABLES — DARK THEME (default)
   ============================================ */
:root {
  --primary:      #FF6B35;
  --primary-dim:  #cc5228;
  --accent:       #FFD166;
  --success:      #06D6A0;
  --danger:       #EF476F;
  --warning:      #FFD166;
  --info:         #118AB2;

  /* Dark palette */
  --bg:           #0F0F14;
  --bg2:          #18181F;
  --bg3:          #22222C;
  --bg4:          #2C2C38;
  --surface:      #1E1E28;
  --border:       rgba(255,255,255,0.08);
  --text:         #F0F0F5;
  --text-2:       #A0A0B0;
  --text-3:       #606070;
  --shadow:       0 4px 24px rgba(0,0,0,0.5);
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.3);
  --glow:         0 0 20px rgba(255,107,53,0.3);
  --radius:       12px;
  --radius-sm:    8px;
  --radius-lg:    18px;
  --transition:   0.2s cubic-bezier(0.4,0,0.2,1);
  --font:         'Sarabun', sans-serif;
  --font-display: 'Bebas Neue', cursive;
}

/* ============================================
   LIGHT THEME
   ============================================ */
[data-theme="light"] {
  --bg:           #F5F5FA;
  --bg2:          #FFFFFF;
  --bg3:          #EFEFF5;
  --bg4:          #E5E5EE;
  --surface:      #FFFFFF;
  --border:       rgba(0,0,0,0.08);
  --text:         #1A1A2E;
  --text-2:       #555570;
  --text-3:       #9090A8;
  --shadow:       0 4px 24px rgba(0,0,0,0.1);
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.06);
  --glow:         0 0 20px rgba(255,107,53,0.15);
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
button { cursor: pointer; font-family: var(--font); border: none; }
input, select, textarea { font-family: var(--font); }
img { max-width: 100%; }

/* ============================================
   TYPOGRAPHY
   ============================================ */
.display { font-family: var(--font-display); letter-spacing: 0.05em; }
h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.5rem; font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }
.text-sm  { font-size: 0.875rem; }
.text-xs  { font-size: 0.75rem; }
.text-lg  { font-size: 1.125rem; }
.text-2   { color: var(--text-2); }
.text-3   { color: var(--text-3); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.fw-bold   { font-weight: 700; }
.fw-medium { font-weight: 500; }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* ============================================
   LAYOUT
   ============================================ */
.app-wrap {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 220px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo .shop-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logo .plan-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--primary);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-block;
  margin-top: 4px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.nav-section {
  padding: 8px 16px 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: var(--text-2);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
}

.nav-item:hover {
  color: var(--text);
  background: var(--bg3);
}

.nav-item.active {
  color: var(--primary);
  background: rgba(255,107,53,0.1);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.nav-item .nav-icon { font-size: 1.1rem; width: 22px; text-align: center; }

.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-user .avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}

.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name { font-size: 0.875rem; font-weight: 600; }
.sidebar-user .user-role { font-size: 0.75rem; color: var(--text-2); }

/* Main content */
.main-content {
  flex: 1;
  margin-left: 220px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: 60px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 1.1rem;
  font-weight: 600;
  flex: 1;
}

.page-body {
  flex: 1;
  padding: 24px;
}

/* ============================================
   CARDS & SURFACES
   ============================================ */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

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

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font);
  transition: all var(--transition);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition);
}

.btn:hover::after { background: rgba(255,255,255,0.08); }
.btn:active { transform: scale(0.97); }

.btn-primary  { background: var(--primary); color: #fff; }
.btn-success  { background: var(--success); color: #fff; }
.btn-danger   { background: var(--danger);  color: #fff; }
.btn-warning  { background: var(--warning); color: #1a1a2e; }
.btn-ghost    { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-surface  { background: var(--bg3); color: var(--text); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; border-radius: 6px; }
.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius); }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================
   FORMS
   ============================================ */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }

.form-control {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.9rem;
  font-family: var(--font);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.15);
}

.form-control::placeholder { color: var(--text-3); }

select.form-control { cursor: pointer; }

/* ============================================
   BADGES
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-primary  { background: rgba(255,107,53,0.15);  color: var(--primary); }
.badge-success  { background: rgba(6,214,160,0.15);   color: var(--success); }
.badge-danger   { background: rgba(239,71,111,0.15);  color: var(--danger); }
.badge-warning  { background: rgba(255,209,102,0.15); color: var(--warning); }
.badge-info     { background: rgba(17,138,178,0.15);  color: var(--info); }
.badge-neutral  { background: var(--bg4); color: var(--text-2); }

/* ============================================
   STATS CARD
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--primary);
}

.stat-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  color: var(--text);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-2);
  margin-top: 4px;
}

.stat-change {
  font-size: 0.75rem;
  margin-top: 8px;
  font-weight: 600;
}

/* ============================================
   TABLE
   ============================================ */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th {
  background: var(--bg3);
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg3); }

/* ============================================
   POS SPECIFIC — PRODUCT GRID
   ============================================ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.product-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
  position: relative;
}

.product-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--glow);
}

.product-card:active { transform: scale(0.96); }

.product-card.out-of-stock {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.product-emoji { font-size: 2.2rem; margin-bottom: 8px; }
.product-name  { font-size: 0.8rem; font-weight: 600; line-height: 1.3; }
.product-price { font-size: 0.9rem; font-weight: 700; color: var(--primary); margin-top: 4px; }

/* ============================================
   CART / ORDER PANEL
   ============================================ */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 0;
  height: calc(100vh - 60px);
}

.pos-left {
  overflow-y: auto;
  padding: 16px;
  border-right: 1px solid var(--border);
}

.pos-right {
  display: flex;
  flex-direction: column;
  background: var(--bg2);
}

.cart-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 1rem;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg3);
  margin-bottom: 8px;
  transition: background var(--transition);
}

.cart-item-name { flex: 1; font-size: 0.875rem; font-weight: 600; }
.cart-item-opt  { font-size: 0.72rem; color: var(--text-2); }

.qty-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--bg4);
  color: var(--text);
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}

.qty-btn:hover { background: var(--primary); color: #fff; }
.qty-num { font-weight: 700; min-width: 20px; text-align: center; font-size: 0.9rem; }
.cart-item-price { font-weight: 700; font-size: 0.9rem; color: var(--primary); min-width: 60px; text-align: right; }

.cart-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-2);
  margin-bottom: 6px;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin: 12px 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ============================================
   PIN NUMPAD
   ============================================ */
.pin-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.pin-screen::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(255,107,53,0.12) 0%, transparent 70%);
  top: -100px; right: -100px;
  pointer-events: none;
}

.pin-screen::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255,209,102,0.08) 0%, transparent 70%);
  bottom: -50px; left: -50px;
  pointer-events: none;
}

.pin-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
  z-index: 1;
  animation: fadeUp 0.4s ease;
}

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

.pin-logo {
  text-align: center;
  margin-bottom: 24px;
}

.pin-logo-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
  display: block;
}

.pin-logo-name {
  font-size: 1.3rem;
  font-weight: 700;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
}

.pin-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  transition: all 0.15s ease;
}

.pin-dot.filled {
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(1.1);
}

.pin-dot.error {
  background: var(--danger);
  border-color: var(--danger);
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.numpad-btn {
  aspect-ratio: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
}

.numpad-btn:hover {
  background: var(--bg4);
  border-color: var(--primary);
  color: var(--primary);
}

.numpad-btn:active { transform: scale(0.92); }
.numpad-btn.del  { font-size: 1.1rem; }
.numpad-btn.zero { grid-column: span 1; }

/* ============================================
   CATEGORY TABS
   ============================================ */
.cat-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 16px;
  scrollbar-width: none;
}

.cat-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition);
}

.cat-tab:hover { color: var(--text); background: var(--bg4); }

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

/* ============================================
   TABLE MAP (restaurant)
   ============================================ */
.table-map {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  padding: 20px;
}

.table-btn {
  aspect-ratio: 1;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
}

.table-btn.available {
  background: var(--bg3);
  border-color: var(--border);
  color: var(--text-2);
}

.table-btn.available:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: scale(1.05);
}

.table-btn.occupied {
  background: rgba(255,107,53,0.15);
  border-color: var(--primary);
  color: var(--primary);
}

/* ============================================
   MODAL
   ============================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow);
  animation: slideUp 0.25s ease;
  max-height: 90vh;
  overflow-y: auto;
}

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

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

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

/* ============================================
   TOAST
   ============================================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
  min-width: 260px;
  animation: toastIn 0.3s ease;
  font-size: 0.875rem;
  font-weight: 500;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error   { border-left: 4px solid var(--danger); }
.toast.info    { border-left: 4px solid var(--info); }
.toast.warning { border-left: 4px solid var(--warning); }

/* ============================================
   SEARCH BOX
   ============================================ */
.search-box {
  position: relative;
  margin-bottom: 16px;
}

.search-box input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 10px 16px 10px 40px;
  font-size: 0.9rem;
  color: var(--text);
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition);
}

.search-box input:focus { border-color: var(--primary); }
.search-box::before { content: '🔍'; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 0.9rem; }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-2);
}

.empty-state .icon { font-size: 3.5rem; margin-bottom: 12px; }
.empty-state h3    { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.empty-state p     { font-size: 0.875rem; }

/* ============================================
   THEME TOGGLE
   ============================================ */
.theme-toggle {
  width: 40px; height: 22px;
  border-radius: 11px;
  background: var(--bg4);
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  transition: background var(--transition);
}

.theme-toggle.on { background: var(--primary); }

.theme-toggle::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  top: 2px; left: 2px;
  transition: transform var(--transition);
}

.theme-toggle.on::after { transform: translateX(18px); }

/* ============================================
   MEMBER SEARCH
   ============================================ */
.member-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(6,214,160,0.1);
  border: 1px solid rgba(6,214,160,0.3);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.member-badge .level {
  font-size: 1.2rem;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-content { margin-left: 0; }
  body { background: white; color: black; }
  .card { box-shadow: none; border: 1px solid #ddd; }

  .receipt { max-width: 300px; margin: 0 auto; font-family: 'Courier New', monospace; }
  .receipt-divider { border-top: 1px dashed #000; margin: 8px 0; }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-220px); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
  .main-content { margin-left: 0; }
  .pos-layout { grid-template-columns: 1fr; }
  .pos-right {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 50vh;
    border-top: 1px solid var(--border);
    z-index: 200;
  }
  .menu-toggle { display: flex !important; }
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg3);
  border: 1px solid var(--border);
  font-size: 1.1rem;
  cursor: pointer;
}

/* Utility */
.flex        { display: flex; }
.flex-col    { display: flex; flex-direction: column; }
.items-center{ align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mb-8   { margin-bottom: 8px; }
.mb-12  { margin-bottom: 12px; }
.mb-16  { margin-bottom: 16px; }
.mb-24  { margin-bottom: 24px; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }
.p-0    { padding: 0; }
.hidden { display: none; }
.w-full { width: 100%; }

/* =============================================
   v3 ADDITIONS
   ============================================= */

/* ── Cart Collapse (mobile) ── */
@media (max-width: 900px) {
  .pos-right { transition: height var(--transition); }
  .pos-right.cart-collapsed {
    height: 52px !important;
    overflow: hidden;
  }
  .cart-toggle-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 0;
    user-select: none;
  }
}
@media (min-width: 901px) {
  .cart-toggle-bar { display: none; }
}

/* ── Table Status ── */
.table-btn { transition: all var(--transition); }
.table-btn.reserved {
  background: rgba(17,138,178,0.15);
  border-color: var(--info);
  color: var(--info);
}
.table-timer-badge {
  position: absolute;
  top: 6px; right: 6px;
  font-size: 0.6rem;
  background: var(--bg4);
  color: var(--text-2);
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
}

/* ── Promo badge in cart ── */
#cart-promo-label {
  font-size: 0.72rem;
  color: var(--success);
  font-weight: 600;
  padding: 4px 10px;
  background: rgba(6,214,160,0.1);
  border: 1px solid rgba(6,214,160,0.3);
  border-radius: 20px;
  margin: 4px 12px 0;
  display: none;
}

/* ── Member points ── */
.points-redeem {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255,209,102,0.08);
  border: 1px solid rgba(255,209,102,0.25);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

/* ── Log table ── */
.log-action-sell   { color: var(--success); }
.log-action-edit   { color: var(--info); }
.log-action-delete { color: var(--danger); }
.log-action-login  { color: var(--text-2); }

/* ── Settings tabs ── */
.settings-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
  overflow-x: auto;
}
.settings-tab {
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: all var(--transition);
  margin-bottom: -1px;
}
.settings-tab:hover { color: var(--text); }
.settings-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.settings-panel { display: none; }
.settings-panel.active { display: block; }

/* ── Toggle switch ── */
.toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.toggle-wrap:last-child { border-bottom: none; }
.toggle-label { font-size: 0.875rem; font-weight: 500; }
.toggle-desc  { font-size: 0.75rem; color: var(--text-2); margin-top: 2px; }
.sw {
  position: relative;
  width: 44px; height: 24px;
  flex-shrink: 0;
}
.sw input { opacity: 0; width: 0; height: 0; }
.sw-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg4);
  border-radius: 24px;
  transition: all .2s;
  border: 1px solid var(--border);
}
.sw-slider::before {
  content: '';
  position: absolute;
  height: 18px; width: 18px;
  left: 2px; bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
}
.sw input:checked + .sw-slider { background: var(--primary); border-color: var(--primary); }
.sw input:checked + .sw-slider::before { transform: translateX(20px); }

/* ── Color preview dot ── */
.color-preview {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: transform .15s;
}
.color-preview:hover { transform: scale(1.15); }

/* ── Export button ── */
.export-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* ── Log timeline ── */
.log-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.log-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.log-meta { font-size: 0.72rem; color: var(--text-3); }
