/* ==========================================================================
   RESTAURANT MANAGEMENT SYSTEM — POS-FIRST DESIGN SYSTEM (MODERN SAAS)
   ========================================================================== */

/* 4.1 — Reset & Base */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv02','cv03','cv04','cv11','tnum';
  transition: background-color 150ms, color 150ms;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

/* 4.2 — CSS Variables (light + dark) */
:root {
  /* --- LIGHT (default) --- */
  
  /* Backgrounds */
  --bg:           #FAFAFA;
  --surface:      #FFFFFF;
  --surface-2:    #F4F4F5;
  --surface-3:    #E4E4E7;
  --overlay:      rgba(24, 24, 27, 0.4);
  
  /* Borders */
  --border:       #E4E4E7;
  --border-strong:#D4D4D8;
  --border-focus: #10B981;
  
  /* Text */
  --text:         #18181B;
  --text-muted:   #71717A;
  --text-subtle:  #A1A1AA;
  --text-inverse: #FAFAFA;
  
  /* Primary (near-black) */
  --primary:       #18181B;
  --primary-hover: #27272A;
  --primary-fg:    #FFFFFF;
  --primary-subtle:#F4F4F5;
  
  /* Accent (emerald) */
  --accent:        #10B981;
  --accent-hover:  #059669;
  --accent-fg:     #FFFFFF;
  --accent-subtle: #ECFDF5;
  --accent-border: #A7F3D0;
  
  /* Status */
  --success:       #10B981;
  --success-subtle:#ECFDF5;
  --success-border:#A7F3D0;
  
  --warning:       #F59E0B;
  --warning-subtle:#FFFBEB;
  --warning-border:#FDE68A;
  
  --danger:        #EF4444;
  --danger-subtle: #FEF2F2;
  --danger-border: #FECACA;
  
  --info:          #3B82F6;
  --info-subtle:   #EFF6FF;
  --info-border:   #BFDBFE;

  /* Restora Multi-color Palette Tokens */
  --violet:        #8B5CF6;
  --violet-subtle: #F5F3FF;
  --violet-border: #DDD6FE;
  --rose:          #F43F5E;
  --rose-subtle:   #FFF1F2;
  --rose-border:   #FECDD3;
  --teal:          #14B8A6;
  --teal-subtle:   #F0FDFA;
  --teal-border:   #99F6E4;
  
  /* Radius */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius:    8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl:20px;
  --radius-full: 9999px;
  
  /* Shadows (subtle, layered) */
  --shadow-xs: 0 1px 2px 0 rgba(24,24,27,0.04);
  --shadow-sm: 0 1px 2px 0 rgba(24,24,27,0.06),
               0 1px 3px 0 rgba(24,24,27,0.04);
  --shadow:    0 4px 6px -1px rgba(24,24,27,0.06),
               0 2px 4px -1px rgba(24,24,27,0.04);
  --shadow-md: 0 10px 15px -3px rgba(24,24,27,0.08),
               0 4px 6px -2px rgba(24,24,27,0.04);
  --shadow-lg: 0 20px 25px -5px rgba(24,24,27,0.10),
               0 10px 10px -5px rgba(24,24,27,0.04);
  
  /* Motion */
  --transition:      150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Type scale */
  --text-xs:   0.75rem;   /* 12px */
  --text-sm:   0.8125rem; /* 13px */
  --text-base: 0.875rem;  /* 14px */
  --text-md:   0.9375rem; /* 15px */
  --text-lg:   1rem;      /* 16px */
  --text-xl:   1.125rem;  /* 18px */
  --text-2xl:  1.375rem;  /* 22px */
  --text-3xl:  1.75rem;   /* 28px */
  --text-4xl:  2.25rem;   /* 36px */
}

[data-theme="dark"] {
  --bg:           #09090B;
  --surface:      #121214;
  --surface-2:    #18181B;
  --surface-3:    #27272A;
  --overlay:      rgba(0, 0, 0, 0.6);
  
  --border:       #27272A;
  --border-strong:#3F3F46;
  
  --text:         #FAFAFA;
  --text-muted:   #A1A1AA;
  --text-subtle:  #71717A;
  --text-inverse: #18181B;
  
  --primary:       #FAFAFA;
  --primary-hover: #E4E4E7;
  --primary-fg:    #09090B;
  --primary-subtle:#18181B;
  
  --accent:        #34D399;
  --accent-hover:  #6EE7B7;
  --accent-fg:     #09090B;
  --accent-subtle: #064E3B;
  --accent-border: #065F46;
  
  --success:       #34D399;
  --success-subtle:#064E3B;
  --success-border:#065F46;
  
  --warning:       #FBBF24;
  --warning-subtle:#451A03;
  --warning-border:#78350F;
  
  --danger:        #F87171;
  --danger-subtle: #450A0A;
  --danger-border: #7F1D1D;
  
  --info:          #60A5FA;
  --info-subtle:   #172554;
  --info-border:   #1E3A8A;

  --violet:        #A78BFA;
  --violet-subtle: rgba(139, 92, 246, 0.15);
  --violet-border: rgba(139, 92, 246, 0.35);
  --rose:          #FB7185;
  --rose-subtle:   rgba(244, 63, 94, 0.15);
  --rose-border:   rgba(244, 63, 94, 0.35);
  --teal:          #2DD4BF;
  --teal-subtle:   rgba(20, 184, 166, 0.15);
  --teal-border:   rgba(20, 184, 166, 0.35);
  
  --shadow-xs: 0 1px 2px 0 rgba(0,0,0,0.4);
  --shadow-sm: 0 1px 3px 0 rgba(0,0,0,0.5);
  --shadow:    0 4px 6px -1px rgba(0,0,0,0.5);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.6);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.7);
}

/* 4.3 — Typography utilities */
.text-xs   { font-size: var(--text-xs);   line-height: 1.4; }
.text-sm   { font-size: var(--text-sm);   line-height: 1.45; }
.text-base { font-size: var(--text-base); }
.text-md   { font-size: var(--text-md);   line-height: 1.45; }
.text-lg   { font-size: var(--text-lg);   line-height: 1.5; }
.text-xl   { font-size: var(--text-xl);   line-height: 1.4; }
.text-2xl  { font-size: var(--text-2xl);  line-height: 1.3; }
.text-3xl  { font-size: var(--text-3xl);  line-height: 1.2; }
.text-4xl  { font-size: var(--text-4xl);  line-height: 1.1; }

.font-normal   { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

.text-muted   { color: var(--text-muted); }
.text-subtle  { color: var(--text-subtle); }
.text-accent  { color: var(--accent); }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-info    { color: var(--info); }

.tabular { font-variant-numeric: tabular-nums; }

/* 4.4 — Layout utilities */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-1 { flex: 1; }
.gap-1 { gap: 4px; }  .gap-2 { gap: 8px; }  .gap-3 { gap: 12px; }
.gap-4 { gap: 16px; } .gap-5 { gap: 20px; } .gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }

.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* 4.5 — Icons */
.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  width: 20px;
  height: 20px;
}
.icon--sm  { width: 16px; height: 16px; stroke-width: 2; }
.icon--lg  { width: 24px; height: 24px; }
.icon--xl  { width: 32px; height: 32px; stroke-width: 1.5; }
.icon--2xl { width: 48px; height: 48px; stroke-width: 1.25; }

/* 4.6 — Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  font-size: var(--text-base);
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background-color var(--transition), 
              border-color var(--transition),
              color var(--transition),
              transform 100ms;
  white-space: nowrap;
  user-select: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:not(:disabled):active { transform: scale(0.98); }
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn--primary {
  background: var(--primary); color: var(--primary-fg);
}
.btn--primary:hover:not(:disabled) { background: var(--primary-hover); }

.btn--accent {
  background: var(--accent); color: var(--accent-fg);
}
.btn--accent:hover:not(:disabled) { background: var(--accent-hover); }

.btn--ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn--ghost:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.btn--subtle {
  background: transparent; color: var(--text-muted);
}
.btn--subtle:hover:not(:disabled) {
  background: var(--surface-2); color: var(--text);
}

.btn--danger {
  background: var(--danger); color: #FFFFFF;
}
.btn--danger:hover:not(:disabled) { background: #DC2626; }

.btn--danger-ghost {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger-border);
}
.btn--danger-ghost:hover:not(:disabled) {
  background: var(--danger-subtle);
}

.btn--sm { height: 32px; padding: 0 10px; font-size: var(--text-sm); }
.btn--lg { height: 44px; padding: 0 20px; font-size: var(--text-md); }
.btn--icon { width: 38px; padding: 0; }
.btn--icon.btn--sm { width: 32px; height: 32px; }
.btn--full { width: 100%; }

/* 4.7 — Inputs */
.field { display: flex; flex-direction: column; gap: 6px; }
.label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
}
.label__optional {
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 4px;
}

.input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  font-size: var(--text-base);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition),
              box-shadow var(--transition);
}
.input::placeholder { color: var(--text-subtle); }
.input:hover:not(:disabled) { border-color: var(--border-strong); }
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}
.input:disabled {
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: not-allowed;
}
.input--error {
  border-color: var(--danger);
}
.input--error:focus {
  box-shadow: 0 0 0 3px var(--danger-subtle);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.input-wrap .input { padding-left: 36px; }
.input-wrap__icon {
  position: absolute;
  left: 12px;
  color: var(--text-subtle);
  pointer-events: none;
  display: grid;
  place-items: center;
}
.input-wrap__action {
  position: absolute;
  right: 8px;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
}
.input-wrap__action:hover { background: var(--surface-2); }

.field__error {
  font-size: var(--text-sm);
  color: var(--danger);
}
.field__hint {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* 4.8 — Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition),
              box-shadow var(--transition),
              transform var(--transition);
}
.card--interactive { cursor: pointer; }
.card--interactive:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.card__header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card__title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text);
}
.card__subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 2px;
}
.card__body { padding: 20px; }
.card__footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* 4.9 — Stat Cards (with icon chips) */
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.stat__label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
}
.stat__icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text-muted);
}
.stat__icon--accent  { background: var(--accent-subtle);  color: var(--accent); }
.stat__icon--success { background: var(--success-subtle); color: var(--success); }
.stat__icon--warning { background: var(--warning-subtle); color: var(--warning); }
.stat__icon--danger  { background: var(--danger-subtle);  color: var(--danger); }
.stat__icon--info    { background: var(--info-subtle);    color: var(--info); }

.stat__value {
  font-size: var(--text-3xl);
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.stat__delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-sm);
  font-weight: 500;
}
.stat__delta--up   { color: var(--success); }
.stat__delta--down { color: var(--danger); }
.stat__delta--flat { color: var(--text-muted); }

/* 4.10 — Tables */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}
.table { width: 100%; border-collapse: collapse; }
.table thead th {
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-base);
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background-color var(--transition); }
.table tbody tr:hover { background: var(--surface-2); }
.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* 4.11 — Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: var(--radius-full);
  line-height: 1.4;
  white-space: nowrap;
}
.badge--neutral { background: var(--surface-2); color: var(--text-muted); }
.badge--success { background: var(--success-subtle); color: var(--success); }
.badge--warning { background: var(--warning-subtle); color: var(--warning); }
.badge--danger  { background: var(--danger-subtle);  color: var(--danger); }
.badge--info    { background: var(--info-subtle);    color: var(--info); }
.badge--accent  { background: var(--accent-subtle);  color: var(--accent); }

.badge__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* 4.12 — Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.is-open { display: flex; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  animation: fadeIn var(--transition-slow) ease-out;
}
.modal__panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  animation: modalIn var(--transition-slow) cubic-bezier(0.16,1,0.3,1);
}
.modal__panel--lg { max-width: 640px; }
.modal__header {
  padding: 20px 24px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.modal__title {
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.modal__subtitle {
  font-size: var(--text-base);
  color: var(--text-muted);
  margin-top: 4px;
}
.modal__body { padding: 20px 24px; }
.modal__footer {
  padding: 16px 24px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* 4.13 — Toast */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 300px;
  max-width: 400px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: toastIn var(--transition-slow) cubic-bezier(0.16,1,0.3,1);
}
.toast__icon { flex-shrink: 0; margin-top: 1px; }
.toast__body { flex: 1; }
.toast__title {
  font-size: var(--text-base);
  font-weight: 500;
}
.toast__message {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 2px;
}
.toast--success .toast__icon { color: var(--success); }
.toast--error   .toast__icon { color: var(--danger); }
.toast--warning .toast__icon { color: var(--warning); }
.toast--info    .toast__icon { color: var(--info); }

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

/* 4.14 — App Shell */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: 56px 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main";
  min-height: 100vh;
}

.sidebar {
  grid-area: sidebar;
  width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  box-sizing: border-box;
}

.topbar {
  grid-area: topbar;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.main {
  grid-area: main;
  padding: 24px;
  overflow-x: hidden;
}

/* 4.15 — Sidebar */
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.sidebar__brand-mark {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-fg);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: var(--text-md);
  flex-shrink: 0;
}
.sidebar__brand-name {
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.sidebar__brand-sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.sidebar__nav {
  flex: 1;
  padding: 0 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar__section {
  padding: 12px 8px 6px;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
}
.sidebar__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  height: 38px;
  box-sizing: border-box;
  flex-shrink: 0;
  border-radius: var(--radius);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-muted);
  transition: background-color var(--transition), 
              color var(--transition);
  position: relative;
}
.sidebar__item .icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.sidebar__item:hover {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 500;
}
.sidebar__item.is-active {
  background: var(--primary);
  color: var(--primary-fg);
  font-weight: 500;
}
.sidebar__item.is-active .icon { color: var(--primary-fg); }
.sidebar__badge {
  margin-left: auto;
  font-size: var(--text-xs);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: var(--surface-3);
  color: var(--text);
}
.sidebar__item.is-active .sidebar__badge {
  background: rgba(255,255,255,0.15);
  color: var(--primary-fg);
}

.sidebar__footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar__user {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: var(--radius);
  min-width: 0;
}
.sidebar__user:hover { background: var(--surface-2); }

/* 4.16 — Avatar */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-subtle);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: var(--text-sm);
  flex-shrink: 0;
  overflow: hidden;
}
.avatar--lg { width: 40px; height: 40px; font-size: var(--text-md); }
.avatar--xl { width: 56px; height: 56px; font-size: var(--text-xl); }
.avatar--primary { background: var(--primary); color: var(--primary-fg); }
.avatar--info { background: var(--info-subtle); color: var(--info); }
.avatar--warning { background: var(--warning-subtle); color: var(--warning); }
.avatar--danger { background: var(--danger-subtle); color: var(--danger); }

/* 4.17 — Category Chips (POS) */
.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.chips::-webkit-scrollbar { height: 4px; }
.chips::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition: all var(--transition);
  flex-shrink: 0;
}
.chip:hover {
  border-color: var(--border-strong);
  color: var(--text);
}
.chip.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-fg);
}
.chip__count {
  font-size: var(--text-xs);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--text-muted);
}
.chip.is-active .chip__count {
  background: rgba(255,255,255,0.15);
  color: var(--primary-fg);
}

/* 4.18 — Menu Grid (POS) */
.grid--menu {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.menu-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 110px;
  transition: all var(--transition);
  cursor: pointer;
}
.menu-card:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.menu-card:active { transform: scale(0.99); }
.menu-card.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.menu-card__name {
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.menu-card__category {
  font-size: var(--text-xs);
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.menu-card__price {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  margin-top: auto;
}
.menu-card__sold-out {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: var(--text-xs);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--danger-subtle);
  color: var(--danger);
  font-weight: 500;
}

/* 4.19 — Table Grid (POS) */
.grid--tables {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 8px;
}
.table-chip {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-weight: 600;
  transition: all var(--transition);
  cursor: pointer;
  padding: 6px;
}
.table-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.table-chip__label { font-size: var(--text-lg); }
.table-chip__meta {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-muted);
}
.table-chip.is-free     { border-color: var(--border); }
.table-chip.is-occupied {
  border-color: var(--warning-border);
  background: var(--warning-subtle);
  color: var(--warning);
}
.table-chip.is-mine {
  border-color: var(--accent);
  background: var(--accent-subtle);
  color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}
.table-chip.is-selected {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-fg);
}

/* 4.20 — POS Layout & Cart */
body[data-page="pos"] .main {
  padding: 0;
  overflow: hidden;
  height: calc(100vh - 56px);
  box-sizing: border-box;
}

.pos-layout {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 16px;
  height: calc(100vh - 56px);      /* topbar height */
  max-height: calc(100vh - 56px);
  overflow: hidden;
  box-sizing: border-box;
  padding: 12px 16px;
}
@media (max-width: 1100px) {
  body[data-page="pos"] .main {
    height: auto;
    overflow: visible;
    padding: 12px 16px;
  }
  .pos-layout {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 0;
  }
  .cart {
    height: auto;
    max-height: 80vh;
  }
}

.pos-menu {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  gap: 12px;
}
.pos-menu__toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}
.pos-menu__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 16px;
}

.cart {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;                    /* critical for nested scroll */
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.cart__header {
  flex-shrink: 0;                   /* never shrink */
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface-2);
}
.cart__number {
  font-size: var(--text-base);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.cart__body {
  flex: 1 1 auto;
  min-height: 0;                    /* critical */
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 0;
}
.cart__empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}
.cart__item {
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  transition: background-color var(--transition);
}
.cart__item:last-child { border-bottom: none; }
.cart__item:hover { background: var(--surface-2); }
.cart__item-main { flex: 1; min-width: 0; }
.cart__item-name {
  font-size: var(--text-base);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart__item-meta {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.cart__item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cart__qty {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 2px;
}
.cart__qty-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition);
}
.cart__qty-btn:hover {
  background: var(--surface);
  color: var(--text);
}
.cart__qty-value {
  min-width: 24px;
  text-align: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: var(--text-base);
}
.cart__item-total {
  font-size: var(--text-base);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 64px;
  text-align: right;
  align-self: center;
}

.cart__summary {
  flex-shrink: 0;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cart__row {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-base);
  color: var(--text-muted);
}
.cart__row--total {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text);
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px dashed var(--border);
}
.cart__row .num { font-variant-numeric: tabular-nums; }

.cart__actions,
.action-bar {
  flex-shrink: 0;
}

/* If action-bar is INSIDE .cart */
.cart > .action-bar {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.cart__actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* 4.21 — Payment Grid (POS) */
.payment-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.payment-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 64px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
  cursor: pointer;
}
.payment-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}
.payment-btn.is-active {
  border-color: var(--accent);
  background: var(--accent-subtle);
  color: var(--accent);
}

/* 4.22 — Empty State */
.empty-state {
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  color: var(--text-muted);
}
.empty-state__icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-xl);
  background: var(--surface-2);
  color: var(--text-subtle);
  margin-bottom: 4px;
}
.empty-state__title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text);
}
.empty-state__text {
  font-size: var(--text-base);
  max-width: 320px;
  line-height: 1.5;
}

/* 4.23 — Skeleton */
.skeleton {
  background: linear-gradient(90deg,
    var(--surface-2) 0%,
    var(--surface-3) 50%,
    var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius);
}
.skeleton--text   { height: 12px; border-radius: var(--radius-sm); }
.skeleton--avatar { width: 32px; height: 32px; border-radius: 50%; }
.skeleton--card   { height: 100px; border-radius: var(--radius-lg); }

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}

/* 4.24 — Dropdown */
.dropdown { position: relative; }
.dropdown__panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 4px;
  z-index: 30;
  display: none;
  animation: fadeIn var(--transition) ease-out;
}
.dropdown.is-open .dropdown__panel { display: block; }
.dropdown__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: var(--text-base);
  color: var(--text);
  width: 100%;
  transition: background-color var(--transition);
  text-align: left;
}
.dropdown__item:hover { background: var(--surface-2); }
.dropdown__item--danger { color: var(--danger); }
.dropdown__divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* 4.25 — Page header pattern */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.page-header__title {
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.page-header__subtitle {
  font-size: var(--text-base);
  color: var(--text-muted);
  margin-top: 4px;
}
.page-header__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* 4.26 — Bottom nav (mobile) */
.bottom-nav {
  grid-area: bottomnav;
  display: none;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0));
  position: sticky;
  bottom: 0;
  z-index: 20;
}
@media (max-width: 900px) {
  .bottom-nav { display: grid; grid-template-columns: repeat(4, 1fr); }
}
.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px;
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
}
.bottom-nav__item.is-active { color: var(--accent); }

/* Mobile App Shell Overrides */
@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 56px 1fr auto;
    grid-template-areas:
      "topbar"
      "main"
      "bottomnav";
  }
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    width: 240px;
    z-index: 50;
    transition: left var(--transition-slow);
  }
  .sidebar.is-open { left: 0; }
  .main { padding: 16px; }
}

/* 5.1 — LOGIN LAYOUT (2-column desktop split) */
.login-layout {
  min-height: 100vh;
  display: flex;
  width: 100%;
}
.login-brand {
  width: 45%;
  max-width: 520px;
  background: var(--accent);
  color: #FFFFFF;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-brand__mark {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #FFFFFF;
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 700;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.15);
  margin-bottom: 24px;
}
.login-brand__title {
  font-size: 32px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 8px;
}
.login-brand__tagline {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
  margin-bottom: 32px;
}
.login-brand__features {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 48px;
}
.login-brand__feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #FFFFFF;
}
.login-brand__footer {
  margin-top: auto;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.login-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  background: var(--bg);
}
.login-form-box {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.login-mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

@media (max-width: 900px) {
  .login-brand { display: none; }
  .login-mobile-brand { display: flex; }
  .login-form-panel { padding: 24px 16px; }
}

/* Quick Fill Pills (subtle, clean) */
.role-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.role-pill {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.role-pill:hover {
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--border-strong);
}

/* Print Receipt Styles */
@media print {
  body * {
    visibility: hidden;
  }
  #printableReceipt, #printableReceipt * {
    visibility: visible;
  }
  #printableReceipt {
    position: absolute;
    left: 0;
    top: 0;
    width: 80mm;
    margin: 0;
    padding: 10px;
    font-size: 12px;
    line-height: 1.4;
    color: #000;
  }
}

/* ==========================================================================
   PHASE 7 — RESTORA-INSPIRED, MODERNIZED POS COMPONENTS
   ========================================================================== */

/* 5.1 — Stat cards with modern color accents */
.stat--sales     { border-left: 3px solid var(--accent); }
.stat--orders    { border-left: 3px solid var(--info); }
.stat--customers { border-left: 3px solid var(--warning); }
.stat--total     { border-left: 3px solid var(--violet); }
.stat--avg       { border-left: 3px solid var(--rose); }
.stat--top       { border-left: 3px solid var(--teal); }

.stat--sales .stat__icon     { background: var(--accent-subtle); color: var(--accent); }
.stat--orders .stat__icon    { background: var(--info-subtle);   color: var(--info); }
.stat--customers .stat__icon { background: var(--warning-subtle); color: var(--warning); }
.stat--total .stat__icon     { background: var(--violet-subtle); color: var(--violet); }
.stat--avg .stat__icon       { background: var(--rose-subtle);   color: var(--rose); }
.stat--top .stat__icon       { background: var(--teal-subtle);   color: var(--teal); }

/* Top Mode Tabs */
.mode-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: var(--text-sm);
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.mode-tab:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.mode-tab.is-active {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
  font-weight: 600;
}
.mode-tab svg {
  width: 16px;
  height: 16px;
}

/* Category Underline Tab Variant */
.chips--tabs .chip {
  border-radius: 0;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
  background: transparent;
  color: var(--text-muted);
}
.chips--tabs .chip:hover {
  background: transparent;
  color: var(--text);
}
.chips--tabs .chip.is-active {
  border-bottom-color: var(--accent);
  color: var(--accent);
  background: transparent;
  font-weight: 600;
}

/* KDS (Kitchen Display System) Board */
.kds-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 900px) {
  .kds-board { grid-template-columns: 1fr; }
}
.kds-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  padding: 14px;
  border: 1px solid var(--border);
  min-height: 520px;
}
.kds-column__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.kds-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition);
}
.kds-card--warning {
  border-color: var(--warning);
  box-shadow: 0 0 0 1px var(--warning);
}
.kds-card--urgent {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px var(--danger);
  animation: pulse-urgent 2s infinite ease-in-out;
}
@keyframes pulse-urgent {
  0%, 100% { box-shadow: 0 0 0 1px var(--danger); }
  50% { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.4); }
}
.kds-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.kds-card__title {
  font-weight: 700;
  font-size: 14px;
}
.kds-card__meta {
  font-size: 12px;
  color: var(--text-muted);
}
.kds-card__items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0;
  border-top: 1px dashed var(--border);
  border-bottom: 1px dashed var(--border);
}
.kds-card__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.kds-card__actions {
  display: flex;
  gap: 8px;
}

/* Ongoing Order Cards (Tablet & Desktop Grid) */
.ongoing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.ongoing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.ongoing-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.ongoing-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.ongoing-card__icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--text);
}
.ongoing-card__total {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.ongoing-card__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}
.ongoing-card__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.ongoing-btn {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ongoing-btn--cancel {
  color: var(--danger);
  background: var(--danger-subtle);
  border-color: var(--danger-border);
}
.ongoing-btn--cancel:hover {
  background: var(--danger);
  color: #FFFFFF;
}
.ongoing-btn--token {
  color: var(--info);
  background: var(--info-subtle);
  border-color: var(--info-border);
}
.ongoing-btn--token:hover {
  background: var(--info);
  color: #FFFFFF;
}
.ongoing-btn--edit {
  color: var(--violet);
  background: var(--violet-subtle);
  border-color: var(--violet-border);
}
.ongoing-btn--edit:hover {
  background: var(--violet);
  color: #FFFFFF;
}
.ongoing-btn--merge {
  color: var(--teal);
  background: var(--teal-subtle);
  border-color: var(--teal-border);
}
.ongoing-btn--merge:hover {
  background: var(--teal);
  color: #FFFFFF;
}
.ongoing-btn--complete {
  background: var(--accent);
  color: #FFFFFF;
  font-weight: 700;
}
.ongoing-btn--complete:hover {
  background: var(--accent-hover);
}

/* Full-width POS Action Bar */
.action-bar {
  display: flex;
  flex-wrap: wrap;        /* allow wrapping */
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.action-bar__btn {
  flex: 1 1 calc(25% - 8px);   /* 4 per row */
  min-width: 72px;
  height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: var(--radius);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: transform 120ms, filter 120ms;
}
.action-bar__btn:hover { filter: brightness(1.08); }
.action-bar__btn:active { transform: scale(0.97); }
.action-bar__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.5);
  transform: none !important;
}
.action-bar__btn .icon,
.action-bar__btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

@media (min-width: 1400px) {
  .action-bar__btn {
    flex: 1 1 calc(16.66% - 8px);   /* 6 per row */
  }
}

.action-bar__btn--complete { background: var(--accent); }
.action-bar__btn--today    { background: var(--info); }
.action-bar__btn--print    { background: var(--violet); }
.action-bar__btn--qr       { background: var(--teal); }
.action-bar__btn--kitchen  { background: #F97316; }
.action-bar__btn--toserve  { background: #EAB308; }
.action-bar__btn--ongoing  { background: #14B8A6; }
.action-bar__btn--paylater { background: #64748B; }
.action-bar__btn--mobile   { background: #8B5CF6; }
.action-bar__btn--card     { background: #3B82F6; }
.action-bar__btn--cash     { background: var(--accent); }

/* Split Bill Modal Layout */
.split-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.split-chunk {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 160px;
}
.split-chunk__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: var(--primary-fg);
  font-size: 12px;
  font-weight: 700;
}
.split-item-chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}
.split-item-chip:hover {
  border-color: var(--accent);
}

/* Support Pill Button */
.btn-support-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
}
.btn-support-pill:hover {
  background: var(--accent);
  color: #FFFFFF;
}

/* Phase 9 — Inventory & Recipes Components */
.tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

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

.tab--active {
  color: var(--accent);
  font-weight: 600;
  border-bottom-color: var(--accent);
  background: transparent;
}

.tab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  background: var(--surface-secondary, rgba(0,0,0,0.06));
  color: var(--text-muted);
}

.tab--active .tab__count {
  background: var(--accent-subtle);
  color: var(--accent);
}

.tab__count--warning {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.row--warning {
  border-left: 3px solid #f59e0b !important;
  background-color: rgba(245, 158, 11, 0.04) !important;
}

.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.stock-badge--ok {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.stock-badge--low {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.stock-badge--negative {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

.recipe-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.recipe-row .input, .recipe-row .select {
  font-size: 13px;
  padding: 6px 10px;
}


