/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  /* Fruity light theme — approved mock-up (Figma "FruitAddict POS — Fruity UI mock-up") */
  --primary: #E8453C;        /* apple red */
  --primary-dark: #C0392B;
  --leaf: #2BB673;
  --gold: #FFC244;
  --orange: #FF8A1F;         /* mango */
  --berry: #FF5D8F;
  --bg: #FFF7EC;             /* cream */
  --bg-elev: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-2: #FFFBF5;
  --bg-input: #FFFFFF;
  --bg-hover: #FFF1E6;
  --text: #2B1B12;           /* deep brown */
  --text-muted: #8A7462;
  --text-dim: #B49F8C;
  --success: #1F9D5C;
  --warning: #E07B00;
  --danger: #E8453C;
  --info: #2F80ED;
  --border: #F1E4D3;
  --border-light: #E8D6C0;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 2px 10px rgba(122, 74, 30, 0.07);
  --shadow: 0 6px 18px rgba(122, 74, 30, 0.10);
  --shadow-lg: 0 12px 32px rgba(122, 74, 30, 0.16);
  --font-display: 'Fredoka', 'Nunito', sans-serif;
  --juicy: linear-gradient(135deg, #E8453C 0%, #FF8A1F 100%);
  --nav-height: 64px;
  --top-bar-height: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
  font-family: 'Nunito', -apple-system, sans-serif;
  color: var(--text);
  height: 100%;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(circle at 92% 4%, rgba(255, 138, 31, 0.12), transparent 32%),
    radial-gradient(circle at 4% 78%, rgba(255, 93, 143, 0.10), transparent 30%),
    radial-gradient(circle at 55% 100%, rgba(43, 182, 115, 0.09), transparent 30%),
    #FFF7EC;
  background-attachment: fixed;
}

a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238892a4' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }

.hidden { display: none !important; }

/* ===== LOGIN ===== */
.screen { position: fixed; inset: 0; z-index: 100; display: none; }
.screen.active { display: flex; }
#login-screen {
  background:
    radial-gradient(circle at 20% 10%, rgba(231, 76, 60, 0.08), transparent 50%),
    radial-gradient(circle at 80% 90%, rgba(255, 204, 0, 0.06), transparent 50%),
    #FFF7EC;
  overflow: hidden;
}
.login-container {
  width: 100%; max-width: 380px; margin: auto; padding: 24px 20px;
  display: flex; flex-direction: column; align-items: center;
  animation: loginFadeIn 0.6s ease-out;
}
@keyframes loginFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.login-logo { text-align: center; margin-bottom: 8px; }
.logo-icon { font-size: 56px; color: var(--primary); }
.logo-img {
  width: 220px; max-width: 70vw; height: auto; display: block;
  margin: 0 auto;
  filter: drop-shadow(0 6px 14px rgba(122, 74, 30, 0.18));
}
.location {
  color: var(--text-muted); font-size: 1rem; letter-spacing: 1.5px;
  margin-bottom: 32px; text-transform: none;
}
.pin-display { text-align: center; margin-bottom: 28px; }
.pin-dots { display: flex; gap: 18px; justify-content: center; margin-bottom: 12px; }
.pin-dot {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border-light); transition: all 0.3s ease;
  background: transparent;
}
.pin-dot.filled {
  background: var(--primary); border-color: var(--primary);
  box-shadow: 0 0 10px rgba(232, 69, 60, 0.45);
}
.pin-label { color: var(--text-muted); font-size: 0.95rem; letter-spacing: 0.5px; }
.pin-pad {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  width: 100%; max-width: 320px;
}
.pin-btn {
  width: 78px; height: 78px; border-radius: 50%;
  background: rgba(122, 74, 30, 0.08);
  color: var(--text); font-size: 2rem; font-weight: 600; font-family: var(--font-display);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto; border: none; cursor: pointer;
  box-shadow:
    0 4px 12px rgba(122, 74, 30, 0.16),
    inset 0 1px 0 rgba(122, 74, 30, 0.08);
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.pin-btn:hover {
  background: rgba(122, 74, 30, 0.14);
}
.pin-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 2px 6px rgba(122, 74, 30, 0.18);
}
.pin-btn-empty { visibility: hidden; }
.pin-btn-del {
  font-size: 1.8rem; background: rgba(122, 74, 30, 0.05);
}
.pin-btn-del .material-icons-round { font-size: 28px; }
.login-error {
  color: var(--danger); font-size: 13px; min-height: 20px; text-align: center;
  margin-top: 18px; letter-spacing: 0.3px;
}
.login-footer {
  margin-top: 32px; color: var(--text-dim); font-size: 0.85rem;
  letter-spacing: 0.5px; text-align: center;
}

/* Compact layout on short screens */
@media (max-height: 720px) {
  .logo-img { width: 170px; }
  .location { margin-bottom: 20px; }
  .pin-display { margin-bottom: 18px; }
  .pin-pad { gap: 14px; }
  .pin-btn { width: 66px; height: 66px; font-size: 1.6rem; }
  .login-footer { margin-top: 18px; }
}

/* ===== APP LAYOUT ===== */
.app {
  display: flex; flex-direction: column; height: 100%;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom));
}
.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; height: var(--top-bar-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(122, 74, 30, 0.06);
  flex-shrink: 0; z-index: 10;
}
.top-bar h2 {
  font-size: 18px; font-weight: 700; letter-spacing: 0.2px;
  font-family: var(--font-display); font-weight: 600; font-size: 21px; color: var(--text);
}
.top-bar-right { display: flex; align-items: center; gap: 8px; }
.staff-badge {
  font-size: 12px; font-weight: 600;
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.2), rgba(255, 204, 0, 0.12));
  border: 1px solid rgba(255, 204, 0, 0.25);
  padding: 5px 12px; border-radius: 20px; color: var(--text);
  box-shadow: 0 0 0 1px rgba(122, 74, 30, 0.09);
}
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center;
  transition: background 0.2s;
}
.icon-btn:hover { background: var(--bg-hover); }
.icon-btn .material-icons-round { font-size: 20px; }

/* ===== PAGE CONTAINER ===== */
.page-container {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.page { display: none; padding: 16px; padding-bottom: 24px; }
.page.active { display: block; }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(122, 74, 30, 0.06);
  box-shadow: 0 -8px 24px rgba(122, 74, 30, 0.18);
  display: flex; align-items: center; justify-content: space-around;
  z-index: 50;
}
.nav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 0; min-width: 56px;
  font-size: 10px; font-weight: 500; color: var(--text-dim);
  transition: all 0.2s ease;
  position: relative;
}
.nav-btn .material-icons-round {
  font-size: 24px; transition: transform 0.2s ease;
}
.nav-btn:active .material-icons-round { transform: scale(0.9); }
.nav-btn.active { color: var(--primary); }
.nav-btn.active::before {
  content: ''; position: absolute; top: 2px;
  width: 28px; height: 3px; border-radius: 0 0 3px 3px;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
}

/* ===== MORE DRAWER ===== */
.more-drawer { position: fixed; inset: 0; z-index: 60; }
.drawer-overlay { position: absolute; inset: 0; background: rgba(122, 74, 30, 0.23); }
.drawer-content {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: var(--bg-card); border-radius: 20px 20px 0 0;
  padding-bottom: calc(16px + var(--safe-bottom));
  max-height: 80vh; overflow-y: auto;
  animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.drawer-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.drawer-header h3 { font-size: 18px; }
.drawer-menu { padding: 8px 0; }
.drawer-item {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 14px 20px; font-size: 15px;
  transition: background 0.2s;
}
.drawer-item:active { background: var(--bg-hover); }
.drawer-item .material-icons-round { font-size: 22px; color: var(--text-muted); }

/* ===== SUB TABS ===== */
.sub-tabs {
  display: flex; gap: 4px; margin-bottom: 16px;
  background: #FFFFFF;
  border: 1px solid rgba(122, 74, 30, 0.05);
  border-radius: var(--radius);
  padding: 5px; overflow-x: auto;
  box-shadow: var(--shadow-sm);
}
.sub-tab {
  flex: 1; padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; white-space: nowrap;
  color: var(--text-muted); transition: all 0.2s;
  letter-spacing: 0.2px;
}
.sub-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.35);
}
.subtab-content { display: none; }
.subtab-content.active { display: block; }

/* ===== DASHBOARD ===== */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.stat-card {
  background:
    linear-gradient(135deg, rgba(122, 74, 30, 0.035), rgba(122, 74, 30, 0.01)),
    var(--bg-card);
  border-radius: var(--radius); padding: 16px;
  display: flex; align-items: flex-start; gap: 12px;
  border: 1px solid rgba(122, 74, 30, 0.06);
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
  opacity: 0.35;
}
.stat-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.stat-card .material-icons-round {
  font-size: 32px; margin-top: 2px;
  padding: 8px; border-radius: 10px;
  background: rgba(122, 74, 30, 0.04);
}
.stat-revenue { color: var(--success); }
.stat-orders { color: var(--info); }
.stat-profit { color: var(--warning); }
.stat-active { color: var(--primary); }
.stat-revenue .material-icons-round { color: var(--success); background: rgba(46, 204, 113, 0.1); }
.stat-orders .material-icons-round { color: var(--info); background: rgba(52, 152, 219, 0.1); }
.stat-profit .material-icons-round { color: var(--warning); background: rgba(243, 156, 18, 0.1); }
.stat-active .material-icons-round { color: var(--primary); background: rgba(231, 76, 60, 0.1); }
.stat-label {
  font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600;
}
.stat-value {
  font-size: 22px; font-weight: 800; margin-top: 4px; color: var(--text);
  letter-spacing: -0.3px;
}
.stat-change { font-size: 11px; margin-top: 2px; font-weight: 600; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

.dash-alerts {
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.12), rgba(243, 156, 18, 0.06));
  border: 1px solid rgba(231, 76, 60, 0.3);
  border-left: 3px solid var(--warning);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.dash-alerts h3 {
  display: flex; align-items: center; gap: 8px; font-size: 14px;
  color: var(--warning); margin-bottom: 8px; font-weight: 700;
}
.dash-alerts h3 .material-icons-round { font-size: 18px; }
.alert-item { font-size: 13px; color: var(--text-muted); padding: 4px 0; }
.alert-item span { color: var(--danger); font-weight: 600; }

.quick-actions { margin-bottom: 20px; }
.quick-actions h3 {
  font-size: 12px; margin-bottom: 12px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700;
}
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 4px;
  background:
    linear-gradient(135deg, rgba(122, 74, 30, 0.04), rgba(122, 74, 30, 0.01)),
    var(--bg-card);
  border-radius: var(--radius);
  font-size: 11px; font-weight: 600; color: var(--text);
  border: 1px solid rgba(122, 74, 30, 0.06);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}
.quick-btn:hover { background: var(--bg-card-2); transform: translateY(-1px); }
.quick-btn:active { transform: scale(0.96); background: var(--bg-hover); }
.quick-btn .material-icons-round {
  font-size: 26px; color: var(--primary);
  padding: 8px; border-radius: 10px;
  background: rgba(231, 76, 60, 0.12);
}

.section-card {
  background:
    linear-gradient(135deg, rgba(122, 74, 30, 0.03), rgba(122, 74, 30, 0.005)),
    var(--bg-card);
  border-radius: var(--radius); padding: 16px 18px;
  border: 1px solid rgba(122, 74, 30, 0.06);
  box-shadow: var(--shadow-sm);
}
.section-card h3 {
  font-size: 12px; margin-bottom: 14px;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.8px; font-weight: 700;
}
.recent-list { display: flex; flex-direction: column; gap: 10px; }
.recent-order-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px; background: var(--bg-input); border-radius: var(--radius-sm);
}
.recent-order-item .order-num { font-weight: 600; font-size: 14px; }
.recent-order-item .order-time { font-size: 12px; color: var(--text-muted); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; transition: all 0.2s;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-outline { border: 1px solid var(--border); color: var(--text); }
.btn-outline:active { background: var(--bg-hover); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; }
.btn .material-icons-round { font-size: 18px; }
.text-btn { font-size: 13px; font-weight: 500; padding: 4px 8px; }
.text-btn.danger { color: var(--danger); }

/* ===== FILTER BAR ===== */
.filter-bar { display: flex; gap: 8px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.filter-bar .input-sm { flex: 1; min-width: 100px; }
.input-sm {
  font-size: 13px; padding: 8px 10px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
}

/* ===== ORDER BUILDER ===== */
.order-info-bar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.order-info-bar .input-sm { flex: 1; min-width: 80px; }

/* ===== POS LAYOUT (Square-style) ===== */
/* ===== POS: 3-COLUMN LAYOUT ===== */
.pos-layout {
  display: grid;
  grid-template-columns: 220px 1fr 290px;
  gap: 0;
  height: calc(100vh - var(--top-bar-height) - var(--nav-height) - var(--safe-bottom) - 44px);
  margin: -8px -16px; /* break out of page padding */
  background: var(--bg);
  overflow: hidden;
}

.pos-col { display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* ===== Column 1: Controls ===== */
.pos-col-controls {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 10px; gap: 8px;
}

.pos-ctl-header {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  flex-wrap: wrap; /* 4 menu tabs fill the row; clock wraps below */
}
.pos-ctl-row { display: flex; gap: 6px; }
.pos-ctl-row .pos-control { flex: 1; min-width: 0; }
.pos-ctl-waiter { justify-content: flex-start; }

.menu-type-toggle {
  display: flex; gap: 0; border-radius: 8px; overflow: hidden;
  border: 2px solid var(--primary); flex: 1 1 100%; min-width: 0;
}
.menu-type-btn {
  padding: 6px 4px; min-width: 0; font-size: 12px; font-weight: 700;
  text-align: center; transition: all 0.2s; color: var(--text-muted);
  white-space: nowrap; flex: 1;
}
.menu-type-btn.active { background: var(--primary); color: #fff; }
.menu-type-btn:not(.active):active { background: var(--bg-hover); }

.pos-control {
  background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 8px 10px;
  font-size: 13px;
}

.pos-waiter-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg-input); border-radius: 8px; padding: 6px 10px;
  font-size: 12px; font-weight: 600; color: var(--info);
  border: 1px solid rgba(52,152,219,0.3);
}
.pos-waiter-badge .material-icons-round { font-size: 16px; }

.pos-clock {
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap;
}

.pos-customer-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: 10px;
}
.pos-customer-bar .material-icons-round { font-size: 18px; color: var(--text-dim); }
.pos-customer-input {
  flex: 1; background: transparent; border: none; color: var(--text);
  font-size: 13px; outline: none; min-width: 0;
}
.pos-customer-input::placeholder { color: var(--text-dim); }

.pos-search-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; background: var(--bg-input);
  border-radius: 10px; border: 1px solid var(--border);
}
.pos-search-bar .material-icons-round { font-size: 20px; color: var(--text-dim); }
.pos-search-input {
  flex: 1; background: transparent; border: none; color: var(--text);
  font-size: 14px; outline: none; min-width: 0;
}
.pos-search-input::placeholder { color: var(--text-dim); }

.pos-categories {
  flex: 1;
  display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto; padding-right: 2px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.pos-categories::-webkit-scrollbar { width: 4px; }
.pos-categories::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.pos-cat-btn {
  display: flex; flex-direction: row; align-items: center; justify-content: flex-start;
  gap: 10px; padding: 10px 12px; border-radius: 10px;
  font-size: 13px; font-weight: 600; text-align: left;
  color: var(--text-muted); transition: all 0.15s;
  background: transparent; border: none; cursor: pointer;
  line-height: 1.2; width: 100%; flex-shrink: 0;
}
.pos-cat-btn .material-icons-round { font-size: 20px; }
.pos-cat-btn.active { background: var(--primary); color: #fff; }
.pos-cat-btn:not(.active):active { background: var(--bg-hover); }

/* ===== Column 2: Menu Grid ===== */
.pos-col-menu {
  background: var(--bg);
}

.pos-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  padding: 10px; overflow-y: auto; flex: 1;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
  align-content: start;
}
.pos-grid::-webkit-scrollbar { width: 6px; }
.pos-grid::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.pos-grid::-webkit-scrollbar { width: 4px; }
.pos-grid::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.menu-item-card {
  background: var(--bg-card); border-radius: 10px; padding: 12px 10px;
  border: 2px solid var(--border); cursor: pointer; transition: all 0.12s;
  display: flex; flex-direction: column; gap: 4px;
  position: relative; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.menu-item-card:active { transform: scale(0.95); border-color: var(--primary); background: rgba(231,76,60,0.08); }
.menu-item-card.just-added { animation: popBounce 0.3s ease; border-color: var(--success); }
.menu-item-card .item-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.menu-item-card .item-price { font-size: 14px; color: var(--success); font-weight: 700; }
.menu-item-card .item-desc { font-size: 10px; color: var(--text-dim); line-height: 1.2; }
.menu-item-card .item-qty-badge {
  position: absolute; top: -6px; right: -6px;
  background: var(--primary); color: #fff;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.menu-item-card.inactive { opacity: 0.4; }

@keyframes popBounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* ===== Column 3: Current Order ===== */
.pos-col-order {
  background: var(--bg-card);
  border-left: 1px solid var(--border);
}

.pos-order-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.pos-order-header h3 { font-size: 15px; font-weight: 700; }
.pos-clear-btn {
  background: none; border: none; color: var(--danger);
  cursor: pointer; padding: 4px; border-radius: 6px;
}
.pos-clear-btn:active { background: rgba(231,76,60,0.15); }
.pos-clear-btn .material-icons-round { font-size: 22px; }

.pos-cart-items {
  flex: 1; overflow-y: auto; padding: 0;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.pos-cart-items::-webkit-scrollbar { width: 3px; }
.pos-cart-items::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.pos-empty-cart {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%; color: var(--text-dim);
  gap: 8px; padding: 20px;
}
.pos-empty-cart .material-icons-round { font-size: 36px; }
.pos-empty-cart p { font-size: 13px; }

.cart-item {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-price { font-size: 11px; color: var(--text-muted); }
.cart-qty-controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.qty-btn {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg-input); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: var(--text);
  cursor: pointer;
}
.qty-btn:active { background: var(--primary); color: #fff; }
.cart-qty { font-size: 14px; font-weight: 700; min-width: 16px; text-align: center; }
.cart-item-total { font-size: 12px; font-weight: 700; min-width: 55px; text-align: right; flex-shrink: 0; }

/* Order Footer */
.pos-order-footer {
  border-top: 2px solid var(--border); flex-shrink: 0;
}
.pos-order-summary { padding: 8px 12px; }
.pos-summary-row {
  display: flex; justify-content: space-between; font-size: 13px;
  padding: 2px 0; color: var(--text-muted);
}
.pos-total-row {
  font-size: 18px; font-weight: 800; color: var(--text);
  border-top: 1px solid var(--border); padding-top: 6px; margin-top: 4px;
}

.pos-action-bar { padding: 0 12px 12px; }
.pos-send-btn {
  width: 100%; display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 14px; border-radius: 12px; font-size: 15px;
  font-weight: 700; border: none; cursor: pointer;
  background: var(--primary); color: #fff;
  transition: all 0.15s;
}
.pos-send-btn:disabled {
  background: var(--bg-input); color: var(--text-dim); cursor: not-allowed;
}
.pos-send-btn:not(:disabled):active { transform: scale(0.97); background: var(--primary-dark); }
.pos-send-btn .material-icons-round { font-size: 20px; }

/* ===== ACCOMPANIMENTS MODAL ===== */
.accomp-intro { margin-bottom: 10px; }
.accomp-item-name {
  font-size: 17px; font-weight: 800; color: var(--text);
}
.accomp-hint {
  font-size: 12px; color: var(--text-muted); margin-top: 2px;
}
.accomp-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px;
  margin-bottom: 12px;
}
.accomp-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; background: var(--bg-input);
  border: 2px solid var(--border); border-radius: 10px;
  cursor: pointer; font-size: 14px; font-weight: 600;
  user-select: none; transition: all 0.15s;
  color: var(--text-muted);
}
.accomp-chip input {
  accent-color: var(--primary);
  width: 18px; height: 18px; cursor: pointer; flex-shrink: 0;
}
.accomp-chip.is-checked {
  border-color: var(--primary);
  background: rgba(231,76,60,0.12);
  color: var(--text);
}
.accomp-chip.is-disabled {
  opacity: 0.35; cursor: not-allowed;
}

.accomp-notes { margin-bottom: 4px; }
.accomp-notes-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600;
  color: var(--text-muted); margin-bottom: 6px;
}
.accomp-notes-label .material-icons-round { font-size: 18px; color: var(--warning); }
.accomp-notes-input {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  background: var(--bg-input); border: 2px solid var(--border);
  color: var(--text); font-size: 14px; font-family: inherit;
  resize: vertical; outline: none; min-height: 42px;
}
.accomp-notes-input:focus { border-color: var(--primary); }

.accomp-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  position: sticky; bottom: calc(-20px - var(--safe-bottom));
  margin: 0 -20px calc(-20px - var(--safe-bottom));
  padding: 12px 20px calc(12px + var(--safe-bottom));
  background: var(--bg-card); border-top: 1px solid var(--border);
}
.accomp-actions .btn {
  min-width: 120px; display: inline-flex; align-items: center;
  justify-content: center; gap: 6px;
}
.accomp-actions .btn .material-icons-round { font-size: 18px; }

@media (max-width: 420px) {
  .accomp-grid { grid-template-columns: 1fr; }
  .accomp-actions .btn { flex: 1; min-width: 0; }
}

/* ===== CART: accompaniment chips + notes ===== */
.cart-item.cart-item-complex { align-items: flex-start; padding-top: 10px; padding-bottom: 10px; }
.cart-item-accomp {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px;
}
.cart-chip {
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  background: rgba(52,152,219,0.15); color: var(--info);
  border-radius: 8px; white-space: nowrap;
  border: 1px solid rgba(52,152,219,0.25);
}
.cart-item-notes {
  display: flex; align-items: flex-start; gap: 4px;
  font-size: 11px; color: var(--warning); font-style: italic;
  margin-top: 4px; line-height: 1.3;
}
.cart-item-notes .material-icons-round { font-size: 13px; flex-shrink: 0; margin-top: 1px; }

/* ===== KITCHEN: accompaniment chips + notes ===== */
.kitchen-item { align-items: flex-start; }
.kitchen-item-body { flex: 1; min-width: 0; }
.kitchen-item-name { font-size: 14px; font-weight: 600; }
.kitchen-item-accomp {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px;
}
.kitchen-chip {
  font-size: 11px; font-weight: 700; padding: 3px 9px;
  background: rgba(52,152,219,0.2); color: var(--info);
  border-radius: 10px; white-space: nowrap;
  border: 1px solid rgba(52,152,219,0.35);
}
.kitchen-item-notes {
  display: flex; align-items: flex-start; gap: 6px;
  font-size: 12px; color: var(--warning); font-weight: 600;
  margin-top: 6px; padding: 6px 10px;
  background: rgba(243,156,18,0.10);
  border-left: 3px solid var(--warning);
  border-radius: 4px; line-height: 1.35;
}
.kitchen-item-notes .material-icons-round { font-size: 16px; flex-shrink: 0; }

/* ===== Tablet (narrower columns) ===== */
@media (max-width: 1024px) and (min-width: 761px) {
  .pos-layout { grid-template-columns: 190px 1fr 260px; }
  .pos-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ===== Mobile POS (portrait phones): stack with pinned order sheet ===== */
@media (max-width: 760px) {
  .pos-layout {
    display: flex; flex-direction: column;
    /* Reserve space at bottom for the pinned order sheet peek (96px) */
    padding-bottom: 96px;
    box-sizing: border-box;
  }

  /* Column 1: compact top strip */
  .pos-col-controls {
    border-right: none; border-bottom: 1px solid var(--border);
    padding: 8px; gap: 6px; flex-shrink: 0;
  }
  .pos-ctl-header { gap: 8px; }
  .menu-type-btn { padding: 5px 4px; font-size: 11px; }
  .pos-ctl-row .pos-control { font-size: 12px; padding: 6px 8px; }
  .pos-ctl-waiter { display: none; } /* waiter already shown in app top bar */
  .pos-customer-bar { padding: 6px 10px; }
  .pos-customer-input { font-size: 12px; }
  .pos-search-bar { padding: 6px 10px; }
  .pos-search-input { font-size: 13px; }

  /* Categories → horizontal scroll row */
  .pos-categories {
    flex: none; flex-direction: row; gap: 6px;
    overflow-x: auto; overflow-y: hidden;
    padding: 2px 0 4px;
  }
  .pos-cat-btn {
    width: auto; flex-shrink: 0; padding: 6px 12px;
    font-size: 12px; white-space: nowrap;
  }
  .pos-cat-btn .material-icons-round { font-size: 16px; }

  /* Column 2: menu takes all remaining height */
  .pos-col-menu { flex: 1; min-height: 200px; }
  .pos-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px; padding: 6px;
  }
  .menu-item-card { padding: 10px 8px; }
  .menu-item-card .item-name { font-size: 12px; }
  .menu-item-card .item-price { font-size: 12px; }
  .menu-item-card .item-desc { display: none; }

  /* Column 3: fixed bottom sheet, peek shows summary + SEND button always */
  .pos-col-order {
    position: fixed; left: 0; right: 0;
    bottom: calc(var(--nav-height) + var(--safe-bottom));
    max-height: 70vh;
    border-left: none; border-top: 2px solid var(--primary);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 24px rgba(122, 74, 30, 0.23);
    z-index: 60;
    transform: translateY(calc(100% - 110px)); /* peek height */
    transition: transform 0.28s ease;
  }
  .pos-col-order.expanded {
    transform: translateY(0);
    max-height: 78vh;
  }
  /* Drag handle */
  .pos-col-order::before {
    content: ''; position: absolute; top: 6px; left: 50%;
    transform: translateX(-50%);
    width: 44px; height: 4px; border-radius: 2px;
    background: var(--border); pointer-events: none;
  }
  .pos-order-header {
    padding-top: 16px; cursor: pointer; user-select: none;
  }
  .pos-cart-items { max-height: 40vh; }
  .pos-order-footer {
    background: var(--bg-card);
  }
  /* Make sure the send button is always tall & tappable */
  .pos-send-btn { padding: 14px; font-size: 15px; min-height: 52px; }
}

/* ===== ORDER LIST ===== */
.orders-list, .expenses-list, .purchases-list, .vendors-list,
.customers-list, .staff-list, .menu-manage-list, .inventory-list, .log-list {
  display: flex; flex-direction: column; gap: 8px;
}

.order-card {
  background:
    linear-gradient(135deg, rgba(122, 74, 30, 0.03), rgba(122, 74, 30, 0.005)),
    var(--bg-card);
  border-radius: var(--radius); padding: 16px;
  border: 1px solid rgba(122, 74, 30, 0.06);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative; overflow: hidden;
}
.order-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  border-color: rgba(122, 74, 30, 0.12);
}
.order-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.order-card-header .order-num {
  font-weight: 800; font-size: 16px; letter-spacing: -0.2px;
  font-family: var(--font-display); font-weight: 700; color: var(--text);
}
.order-card-items { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.order-card-customer {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 0 6px; margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.btn-icon {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 4px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.btn-icon:active { background: var(--bg-hover); color: var(--info); }
.order-card-footer { display: flex; justify-content: space-between; align-items: center; }

/* ===== WAITER RECONCILIATION ===== */
.waiter-recon-panel {
  background: var(--bg-card); border-radius: var(--radius);
  border: 2px solid var(--info); margin-bottom: 12px;
  overflow: hidden;
}
.waiter-recon-panel.hidden { display: none; }
.recon-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; background: rgba(52,152,219,0.1);
  border-bottom: 1px solid var(--border);
}
.recon-header h3 {
  font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px;
}
.recon-header h3 .material-icons-round { font-size: 20px; color: var(--info); }

.recon-grand-total {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--border); border-bottom: 1px solid var(--border);
}
.recon-stat {
  background: var(--bg-card); padding: 10px 8px; text-align: center;
}
.recon-stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; display: block; }
.recon-stat-value { font-size: 14px; font-weight: 700; display: block; margin-top: 2px; }

.recon-waiter-card {
  border-bottom: 1px solid var(--border); overflow: hidden;
}
.recon-waiter-card:last-child { border-bottom: none; }
.recon-waiter-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; cursor: pointer;
}
.recon-waiter-header:active { background: var(--bg-hover); }
.recon-waiter-name {
  display: flex; align-items: center; gap: 6px; font-size: 14px;
}
.recon-waiter-name .material-icons-round { font-size: 18px; color: var(--info); }
.recon-order-count { font-size: 11px; color: var(--text-dim); font-weight: 400; }

.recon-waiter-detail {
  max-height: 0; overflow: hidden; transition: max-height 0.3s ease;
  padding: 0 14px;
}
.recon-waiter-card.recon-expanded .recon-waiter-detail { max-height: 500px; padding: 0 14px 14px; }
.recon-waiter-card.recon-expanded .recon-waiter-header .material-icons-round:last-child { transform: rotate(180deg); }

.recon-detail-grid { display: flex; flex-direction: column; gap: 6px; }
.recon-detail-item {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; padding: 4px 0;
}
.recon-detail-label { color: var(--text-muted); font-size: 12px; }
.recon-detail-val { font-weight: 600; font-size: 13px; }

.recon-methods {
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border);
}
.recon-method-row {
  display: flex; justify-content: space-between; font-size: 12px;
  padding: 3px 0; color: var(--text-muted);
}
.recon-method-row span:last-child { font-weight: 600; color: var(--text); }

.recon-orders-list {
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border);
}
.recon-orders-scroll {
  max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px;
  padding-right: 2px;
}
.recon-order-row {
  background: var(--surface); border-radius: 6px; padding: 8px 10px;
  border: 1px solid var(--border);
}
.recon-order-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.recon-order-num { font-size: 13px; font-weight: 700; color: var(--text); }
.recon-order-time { font-size: 11px; color: var(--text-muted); }
.recon-order-table { font-size: 11px; color: var(--text-dim); background: var(--bg); padding: 1px 5px; border-radius: 4px; }
.recon-order-total { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--text); }
.recon-order-items-list {
  font-size: 11px; color: var(--text-muted); margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.recon-waiter-card.recon-expanded .recon-waiter-detail { max-height: 900px; }

@media (max-width: 600px) {
  .recon-grand-total { grid-template-columns: repeat(2, 1fr); }
  .recon-stat-value { font-size: 12px; }
}
.order-card-total {
  font-weight: 800; font-size: 16px; letter-spacing: -0.2px;
}

/* Status Badges */
.badge {
  display: inline-block; padding: 4px 11px; border-radius: 14px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid transparent;
  box-shadow: 0 1px 2px rgba(122, 74, 30, 0.09);
}
.badge-new { background: rgba(52,152,219,0.2); color: var(--info); }
.badge-preparing { background: rgba(243,156,18,0.2); color: var(--warning); }
.badge-ready { background: rgba(46,204,113,0.2); color: var(--success); }
.badge-served { background: rgba(142,68,173,0.2); color: #8e44ad; }
.badge-completed { background: rgba(46,204,113,0.15); color: var(--success); }
.badge-cancelled { background: rgba(231,76,60,0.2); color: var(--danger); }
.badge-paid { background: rgba(46,204,113,0.2); color: var(--success); }
.badge-unpaid { background: rgba(231,76,60,0.2); color: var(--danger); }
.badge-pending { background: rgba(243,156,18,0.2); color: var(--warning); }
.badge-received { background: rgba(46,204,113,0.2); color: var(--success); }
.badge-credit { background: rgba(52,152,219,0.2); color: var(--info); }
.badge-pay-unpaid { background: rgba(231,76,60,0.2); color: var(--danger); }
.badge-pay-partial { background: rgba(243,156,18,0.2); color: var(--warning); }
.badge-pay-paid { background: rgba(46,204,113,0.2); color: var(--success); }

/* Overdue PO styling */
.po-card.po-overdue { border-left: 3px solid var(--danger); }
.po-payments-history { padding: 8px 0 4px; border-top: 1px solid var(--border); margin-top: 6px; }
.po-pay-entry { font-size: 11px; color: var(--text-muted); padding: 2px 0; }

/* Payables tab */
.payable-overdue-banner {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  background: rgba(231,76,60,0.15); color: var(--danger); font-weight: 700;
  padding: 10px 14px; border-radius: var(--radius-sm); margin-top: 8px; font-size: 14px;
}
.payable-overdue-banner .material-icons-round { font-size: 20px; }
.payable-po-item {
  background: var(--bg-input); border-radius: var(--radius-sm);
  padding: 10px 12px; margin-bottom: 8px;
}
.payable-po-item.po-overdue-item { border-left: 3px solid var(--danger); }

/* ===== RECEIVABLES ===== */
.receivable-customer {
  background: var(--bg-input); border-radius: var(--radius-sm);
  margin-bottom: 8px; overflow: hidden;
}
.receivable-customer-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px; cursor: pointer;
}
.receivable-customer-header:active { background: var(--bg-hover); }
.receivable-orders { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.receivable-customer.recv-expanded .receivable-orders { max-height: 1000px; }
.receivable-customer.recv-expanded .material-icons-round { transform: rotate(180deg); }
.receivable-order-item {
  padding: 10px 12px; border-top: 1px solid var(--border); font-size: 13px;
}

/* ===== KITCHEN ===== */
.kitchen-grid { display: flex; flex-direction: column; gap: 12px; }
.kitchen-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 16px;
  border-left: 4px solid var(--warning);
}
.kitchen-card.status-new { border-left-color: var(--info); }
.kitchen-card.status-preparing { border-left-color: var(--warning); }
.kitchen-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.kitchen-order-num { font-weight: 700; font-size: 16px; }
.kitchen-time { font-size: 12px; color: var(--text-muted); }
.kitchen-items { margin-bottom: 12px; }
.kitchen-item { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; }
.kitchen-item-qty { font-weight: 700; color: var(--primary); min-width: 30px; }
.kitchen-actions { display: flex; gap: 8px; }

.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; color: var(--text-dim);
}
.empty-state .material-icons-round { font-size: 56px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* ===== INVENTORY ===== */
.inv-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 14px;
  border: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center;
}
.inv-card.low-stock { border-color: var(--danger); background: rgba(231,76,60,0.05); }
.inv-info { flex: 1; }
.inv-name { font-weight: 600; font-size: 14px; }
.inv-category { font-size: 11px; color: var(--text-muted); }
.inv-qty {
  text-align: center; min-width: 70px;
}
.inv-qty-num { font-size: 20px; font-weight: 700; }
.inv-qty-unit { font-size: 11px; color: var(--text-muted); }
.inv-qty-num.low { color: var(--danger); }
.inv-actions { display: flex; gap: 4px; }

/* ===== LOG ===== */
.log-item {
  background: var(--bg-card); border-radius: var(--radius-sm); padding: 12px;
  border: 1px solid var(--border); display: flex; justify-content: space-between;
}
.log-item-info .log-item-name { font-weight: 500; font-size: 13px; }
.log-item-info .log-item-reason { font-size: 12px; color: var(--text-muted); }
.log-item-info .log-item-time { font-size: 11px; color: var(--text-dim); }
.log-item-adj { font-weight: 700; font-size: 14px; }
.log-item-adj.positive { color: var(--success); }
.log-item-adj.negative { color: var(--danger); }

/* ===== VENDOR / EXPENSE / CUSTOMER / STAFF CARDS ===== */
.v-card, .e-card, .c-card, .s-card, .po-card, .mm-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 14px;
  border: 1px solid var(--border);
}
.v-card-header, .e-card-header, .c-card-header, .s-card-header, .po-card-header, .mm-card-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px;
}
.v-card-header h4, .e-card-header h4, .c-card-header h4, .s-card-header h4, .po-card-header h4, .mm-card-header h4 {
  font-size: 15px; font-weight: 600;
}
.v-card-detail, .e-card-detail, .c-card-detail, .s-card-detail, .po-card-detail, .mm-card-detail {
  font-size: 13px; color: var(--text-muted); line-height: 1.6;
}
.v-card-actions, .e-card-actions, .po-card-actions, .mm-card-actions {
  display: flex; gap: 8px; margin-top: 8px;
}
.v-rating { color: var(--warning); font-size: 13px; }

/* ===== REPORTS ===== */
.report-content { display: flex; flex-direction: column; gap: 16px; }
.report-section {
  background: var(--bg-card); border-radius: var(--radius); padding: 16px;
  border: 1px solid var(--border);
}
.report-section h4 { font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
.report-row {
  display: flex; justify-content: space-between; padding: 6px 0;
  font-size: 14px; border-bottom: 1px solid var(--border);
}
.report-row:last-child { border-bottom: none; }
.report-row .label { color: var(--text-muted); }
.report-row .value { font-weight: 600; }
.report-row .value.positive { color: var(--success); }
.report-row .value.negative { color: var(--danger); }
.report-big-number { font-size: 28px; font-weight: 700; text-align: center; margin: 8px 0; }
.report-big-number.positive { color: var(--success); }
.report-big-number.negative { color: var(--danger); }
.report-bar { display: flex; flex-direction: column; gap: 8px; }
.bar-item { display: flex; align-items: center; gap: 8px; }
.bar-label { font-size: 12px; color: var(--text-muted); min-width: 100px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; height: 8px; background: var(--bg-input); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: var(--primary); transition: width 0.4s ease; }
.bar-value { font-size: 12px; font-weight: 600; min-width: 50px; text-align: right; }

/* ===== COGS BREAKDOWN ===== */
.cogs-detail { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.report-section.cogs-expanded .cogs-detail { max-height: 2000px; }
.report-section.cogs-expanded .cogs-toggle .material-icons-round { transform: rotate(180deg); }
.cogs-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cogs-header, .cogs-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 0.5fr 0.8fr 0.8fr 0.6fr;
  gap: 6px; padding: 8px 4px; font-size: 12px;
  align-items: center; min-width: 480px;
}
.cogs-header {
  font-weight: 700; color: var(--text-muted); text-transform: uppercase;
  font-size: 10px; letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border); margin-top: 8px;
}
.cogs-row { border-bottom: 1px solid var(--border); }
.cogs-row:last-child { border-bottom: none; }
.cogs-row .negative { color: var(--danger); }
.cogs-item-name { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cogs-stock { color: var(--text-muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cogs-total {
  font-weight: 700; border-top: 2px solid var(--primary); border-bottom: none;
  color: var(--text); padding-top: 10px; margin-top: 4px;
}

/* ===== EXPENSE TOTAL ===== */
.expense-total-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; background: var(--bg-card); border-radius: var(--radius);
  margin-top: 12px; font-size: 16px; font-weight: 700;
  border: 1px solid var(--border);
}

/* ===== SETTINGS ===== */
.settings-form { max-width: 480px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.input { width: 100%; }

/* ===== MODAL ===== */
.modal { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; }
.modal-overlay { position: absolute; inset: 0; background: rgba(122, 74, 30, 0.25); }
.modal-content {
  position: relative; width: 100%; max-height: 85vh;
  background: var(--bg-card); border-radius: 20px 20px 0 0;
  display: flex; flex-direction: column;
  animation: slideUp 0.25s ease;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.modal-header h3 { font-size: 17px; }
.modal-body {
  padding: 20px; overflow-y: auto; flex: 1;
  padding-bottom: calc(20px + var(--safe-bottom));
}
.modal-body .form-group { margin-bottom: 14px; }
.modal-body .btn-block { margin-top: 8px; }

/* ===== CONFIRM-ORDER MODAL ===== */
.confirm-meta {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px;
}
.confirm-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 10px;
  font-size: 12px; color: var(--text-muted);
}
.confirm-pill .material-icons-round { font-size: 14px; color: var(--primary); }
.confirm-hint {
  display: flex; align-items: flex-start; gap: 8px;
  background: rgba(255,165,0,0.08);
  border: 1px solid rgba(255,165,0,0.25);
  border-radius: 8px; padding: 8px 12px;
  font-size: 12px; color: var(--text-muted);
  margin-bottom: 14px;
}
.confirm-hint .material-icons-round { font-size: 16px; color: var(--warning, #f5a623); flex-shrink: 0; }
.confirm-lines { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.confirm-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.confirm-line-info { min-width: 0; }
.confirm-line-name { font-weight: 600; font-size: 14px; color: var(--text); margin-bottom: 2px; }
.confirm-line-price { font-size: 11px; color: var(--text-muted); }
.confirm-line-acc { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.confirm-line-notes {
  display: flex; align-items: flex-start; gap: 4px;
  margin-top: 6px; font-size: 11px; color: var(--text-muted); font-style: italic;
}
.confirm-line-notes .material-icons-round { font-size: 13px; color: var(--primary); }
.confirm-line-qty {
  display: flex; align-items: center; gap: 6px;
}
.confirm-line-qty .qty-btn { width: 28px; height: 28px; font-size: 16px; }
.confirm-line-qty .cart-qty { min-width: 22px; text-align: center; font-weight: 700; font-size: 14px; }
.confirm-line-amount { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.confirm-line-total { font-weight: 700; font-size: 14px; color: var(--text); }
.confirm-line-rm {
  background: transparent; border: none; cursor: pointer;
  color: var(--danger); padding: 2px 4px; border-radius: 4px;
}
.confirm-line-rm:hover { background: rgba(220,53,69,0.1); }
.confirm-line-rm .material-icons-round { font-size: 18px; }
.confirm-totals {
  border-top: 1px solid var(--border); padding-top: 10px; margin-bottom: 16px;
}
.confirm-totals-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--text-muted); padding: 4px 0;
}
.confirm-grand-row {
  font-size: 18px; font-weight: 800; color: var(--text);
  border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px;
}
.confirm-grand-row span:last-child { color: var(--success); }
.confirm-actions {
  display: grid; grid-template-columns: 1fr 1.5fr; gap: 8px;
  position: sticky; bottom: 0; background: var(--bg);
  padding-top: 8px;
}
.confirm-actions .btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 12px; font-size: 14px; font-weight: 700;
}
.confirm-empty { text-align: center; padding: 24px 12px; color: var(--text-muted); }
.confirm-empty .btn { margin-top: 12px; }
@media (max-width: 480px) {
  .confirm-actions { grid-template-columns: 1fr; }
  .confirm-line { grid-template-columns: 1fr auto; }
  .confirm-line-amount { grid-column: 2; }
}

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 24px;
  border-radius: 24px; font-size: 14px; font-weight: 500;
  z-index: 80; box-shadow: var(--shadow);
  animation: fadeInUp 0.3s ease;
}
@keyframes fadeInUp { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ===== RECEIPT ===== */
.receipt {
  background: #fff; color: #000; padding: 16px; border-radius: var(--radius);
  font-family: 'Courier New', monospace; font-size: 12px; line-height: 1.5;
}
.receipt-header { text-align: center; margin-bottom: 12px; }
.receipt-header h3 { font-size: 16px; }
.receipt-divider { border-top: 1px dashed #999; margin: 8px 0; }
.receipt .receipt-row { display: flex; justify-content: space-between; gap: 8px; }
.receipt-total { font-weight: 700; font-size: 14px; display: flex; justify-content: space-between; }
.receipt-footer { text-align: center; margin-top: 8px; font-size: 11px; color: #666; white-space: pre-line; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ===== ALERT BANNER ===== */
.alert-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  padding: 8px 12px;
  animation: slideDown 0.3s ease;
}
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }
.alert-banner-content {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; line-height: 1.3;
  box-shadow: 0 4px 20px rgba(122, 74, 30, 0.18);
}
.alert-banner-content.new-order {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: #fff;
}
.alert-banner-content.order-ready {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: #fff;
}
.alert-banner-content .material-icons-round { font-size: 24px; flex-shrink: 0; }
.alert-banner-content span:nth-child(2) { flex: 1; }
.alert-banner-close {
  background: rgba(255,255,255,0.2); border: none; border-radius: 50%;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}
.alert-banner-close .material-icons-round { font-size: 16px; color: #fff; }

/* ===== PORTION INFO ===== */
.inv-portion { font-size: 11px; color: var(--info); }

/* ===== SYSTEM AUDIT ===== */
.audit-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; gap: 8px; flex-wrap: wrap;
}
.audit-filters {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.audit-filter {
  padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--border); color: var(--text-muted); transition: all 0.2s;
}
.audit-filter.active {
  background: var(--primary); border-color: var(--primary); color: #fff;
}
.audit-entry {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 8px; overflow: hidden;
}
.audit-entry-alert {
  border-color: var(--warning);
  box-shadow: 0 0 0 1px rgba(243,156,18,0.3);
}
.audit-alert-banner {
  display: flex; align-items: center; gap: 6px;
  background: rgba(243,156,18,0.15); color: var(--warning);
  font-size: 11px; font-weight: 700; padding: 5px 10px;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.audit-alert-banner .material-icons-round { font-size: 14px; }
.audit-entry-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
}
.audit-user {
  display: flex; align-items: center; gap: 8px;
}
.audit-user .material-icons-round { font-size: 20px; color: var(--text-dim); }
.audit-name { font-size: 14px; font-weight: 600; }
.audit-role { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }
.audit-status {
  font-size: 11px; font-weight: 700; padding: 3px 9px;
  border-radius: 12px; text-transform: uppercase; letter-spacing: 0.4px;
}
.audit-status-ok { background: rgba(46,204,113,0.15); color: var(--success); }
.audit-status-fail { background: rgba(231,76,60,0.15); color: var(--danger); }
.audit-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 6px 12px 10px; font-size: 11px; color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.audit-meta .material-icons-round { font-size: 13px; color: var(--text-dim); }

/* ===== RESPONSIVE ===== */
@media (min-width: 768px) {
  .dashboard-grid { grid-template-columns: repeat(4, 1fr); }
  .kitchen-grid { display: grid; grid-template-columns: repeat(2, 1fr); }
  .modal-content { max-width: 500px; margin: auto; border-radius: var(--radius); }
  .modal { align-items: center; }
}
@media (min-width: 1025px) {
  .pos-grid { grid-template-columns: repeat(4, 1fr); }
  .pos-layout { grid-template-columns: 240px 1fr 320px; }
}


/* =====================================================================
   FRUITY THEME — components from the approved Figma mock-up
   ===================================================================== */
h1, h2, h3, h4, .modal-header h3, .drawer-header h3, .stat-value, .report-big-number {
  font-family: var(--font-display); font-weight: 600; letter-spacing: 0;
}
.modal-overlay, .drawer-overlay { background: rgba(43, 27, 18, 0.45); }
.modal-content, .drawer-content { box-shadow: var(--shadow-lg); }

/* Login */
.pin-btn { background: #FFFFFF; box-shadow: var(--shadow-sm), inset 0 0 0 1.5px var(--border); }
.pin-btn:hover { background: var(--bg-hover); }
.pin-btn:active { background: #FFE3E1; color: var(--primary-dark); }
.pin-btn-del { background: transparent; box-shadow: none; color: var(--text-muted); }

/* Top bar + bottom nav */
.top-bar { box-shadow: 0 2px 10px rgba(122, 74, 30, 0.06); border-bottom: none; }
.top-bar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top-bar-logo { height: 34px; width: auto; display: block; }
.staff-badge { background: #FFE3E1; border: none; color: var(--primary-dark); font-weight: 800; box-shadow: none; }
.bottom-nav { border-top: none; }
.nav-btn { font-size: 11px; font-weight: 700; color: var(--text-muted); gap: 2px; border-radius: 999px; padding: 6px 14px; }
.nav-emoji { font-size: 22px; line-height: 1; transition: transform 0.2s ease; }
.nav-btn:active .nav-emoji { transform: scale(0.88); }
.nav-btn.active { color: var(--primary-dark); background: rgba(232, 69, 60, 0.12); }
.nav-btn.active::before { display: none; }

/* Sub tabs (New Order / All Orders) */
.sub-tabs { border-radius: 999px; padding: 4px; border: none; box-shadow: var(--shadow-sm); }
.sub-tab { border-radius: 999px; font-family: var(--font-display); font-weight: 500; font-size: 15px; }
.sub-tab.active { background: var(--primary); box-shadow: 0 4px 12px rgba(232, 69, 60, 0.30); }

/* Buttons */
.btn { border-radius: 999px; font-weight: 700; }
.btn-primary { background: var(--juicy); box-shadow: 0 4px 12px rgba(232, 69, 60, 0.25); }
.btn-primary:active { background: var(--primary-dark); }
.btn-success { background: linear-gradient(135deg, #2BB673, #1F9D5C); }
.btn-warning { background: linear-gradient(135deg, #FFD23F, #FFB21F); color: #5A3B00; }
.btn-outline { border: 1.5px solid var(--border-light); background: #FFFFFF; }
.btn-danger { border-radius: 999px; background: var(--danger); color: #FFFFFF; }

/* Cards & inputs */
.order-card, .section-card, .stat-card, .quick-btn, .kitchen-card { border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.order-card:hover { border-color: var(--border-light); }
input, select, textarea, .input-sm, .pos-control { border: 1.5px solid var(--border); border-radius: var(--radius-sm); }
input:focus, select:focus, textarea:focus { border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(43, 182, 115, 0.15); }
.badge { font-weight: 800; letter-spacing: 0.3px; }

/* ---------- POS ---------- */
.pos-layout { background: transparent; gap: 14px; padding: 10px 14px; margin: -8px -16px; }
.pos-col-controls, .pos-col-order { border: none; }
.pos-col-controls { background: transparent; padding: 0; gap: 10px; }
.pos-col-menu { background: transparent; }
.pos-col-order { background: #FFFFFF; border-radius: 24px; box-shadow: var(--shadow); }

/* Menu tabs → 2×2 fruity tiles */
.menu-type-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border: none; border-radius: 0; overflow: visible; }
.menu-type-btn {
  --mt: var(--orange);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 6px; border-radius: 16px; background: #FFFFFF;
  border: 2px solid color-mix(in srgb, var(--mt) 45%, transparent);
  color: var(--mt); font-family: var(--font-display); font-weight: 600; font-size: 15px;
}
.menu-type-btn[data-menu="community"] { --mt: var(--berry); }
.menu-type-btn[data-menu="glovo"] { --mt: var(--leaf); }
.menu-type-btn[data-menu="glovo_menu"] { --mt: #D99A00; }
.menu-type-btn .mt-emoji { font-size: 20px; line-height: 1; }
.menu-type-btn.active {
  background: linear-gradient(135deg, var(--mt), color-mix(in srgb, var(--mt) 70%, #E8453C));
  border-color: transparent; color: #FFFFFF; box-shadow: 0 4px 12px color-mix(in srgb, var(--mt) 40%, transparent);
}
.menu-type-btn[data-menu="glovo_menu"].active { background: linear-gradient(135deg, #FFD23F, #FFB21F); color: #5A3B00; }
.menu-type-btn:not(.active):active { background: var(--bg-hover); }
.pos-clock { color: var(--text-muted); font-weight: 700; }

.pos-control, .pos-customer-bar, .pos-search-bar { background: #FFFFFF; border: 1.5px solid var(--border); border-radius: 12px; }
.pos-waiter-badge { background: #EAF2FE; border: none; border-radius: 999px; }

/* Emoji in a tinted circle; colour comes from --c (category colour) */
.emoji-dot {
  --c: inherit;
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1;
  background: color-mix(in srgb, var(--c, #FF8A1F) 18%, #FFFFFF);
}

.pos-cat-btn { color: var(--text); font-weight: 700; font-size: 14px; padding: 6px 12px 6px 6px; border-radius: 14px; border: 1.5px solid transparent; }
.pos-cat-btn.active {
  background: color-mix(in srgb, var(--c) 14%, #FFFFFF);
  border-color: color-mix(in srgb, var(--c) 50%, transparent);
  color: var(--primary-dark); font-weight: 800;
}
.pos-cat-btn:not(.active):active { background: var(--bg-hover); }

/* Menu item cards */
.pos-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding: 2px 2px 12px; }
.menu-item-card {
  background: #FFFFFF; border-radius: 20px; padding: 12px; gap: 5px; min-height: 160px;
  border: 1.5px solid color-mix(in srgb, var(--c, #FF8A1F) 22%, transparent);
  box-shadow: var(--shadow-sm);
}
.menu-item-card .item-emoji { width: 44px; height: 44px; font-size: 22px; margin-bottom: 2px; }
.menu-item-card .item-name { font-family: var(--font-display); font-weight: 600; font-size: 15px; line-height: 1.2; color: var(--text); }
.menu-item-card .item-desc {
  font-size: 11px; color: var(--text-muted); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.menu-item-card .item-price {
  margin-top: auto; align-self: flex-start;
  background: #E3F7EC; color: #16804B; font-weight: 800; font-size: 13px;
  padding: 4px 10px; border-radius: 999px;
}
.menu-item-card.in-cart { border: 2.5px solid var(--primary); }
.menu-item-card .item-qty-badge { top: 10px; right: 10px; width: 24px; height: 24px; font-size: 12px; font-weight: 800; box-shadow: 0 2px 6px rgba(232, 69, 60, 0.35); }
.menu-item-card:active { background: #FFF1E6; border-color: var(--primary); }
.menu-item-card.just-added { border-color: var(--leaf); }

/* Current order panel */
.pos-order-header { border-bottom: none; padding: 16px 16px 8px; }
.pos-order-header h3 { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.pos-cart-items { padding: 0 12px; }
.pos-empty-cart { color: var(--text-muted); }
.pos-empty-cart .empty-emoji { font-size: 40px; }
.cart-item {
  background: var(--bg); border: none; border-radius: 16px;
  padding: 10px; margin-bottom: 8px; gap: 8px;
}
.cart-item .cart-emoji { width: 34px; height: 34px; font-size: 17px; }
.cart-item-name { font-family: var(--font-display); font-weight: 600; font-size: 14px; }
.cart-item-price { font-weight: 600; }
.cart-item-total { font-weight: 800; }
.qty-btn { width: 26px; height: 26px; border: none; background: var(--border); }
.cart-qty-controls .qty-btn[data-act="inc"] { background: var(--primary); color: #FFFFFF; }
.cart-chip { background: #FFFFFF; color: var(--primary-dark); border: none; font-weight: 700; }
.pos-order-footer { border-top: none; padding: 0 12px 12px; }
.pos-order-summary { background: #FFF1E6; border-radius: 18px; padding: 10px 14px; margin-bottom: 10px; }
.pos-total-row { border-top: none; align-items: baseline; }
.pos-total-row span:last-child { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--primary-dark); }
.pos-action-bar { padding: 0; }
.pos-send-btn {
  background: var(--juicy); border-radius: 18px; min-height: 56px;
  font-family: var(--font-display); font-size: 18px; font-weight: 700;
  box-shadow: 0 6px 16px rgba(232, 69, 60, 0.30);
}
.pos-send-btn:disabled { background: var(--border); color: var(--text-dim); box-shadow: none; }
.send-emoji { font-size: 18px; }

/* Toppings / flavour pop-up */
.accomp-chip { background: var(--bg); border: 2px solid var(--border); border-radius: 14px; color: var(--text); }
.accomp-chip.is-checked { border-color: var(--berry); background: #FFE3EC; color: #B0215A; }
.accomp-chip input { accent-color: var(--berry); }
.accomp-actions .btn-primary { background: var(--juicy); }

/* Discount pop-up quick buttons */
.disc-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
.disc-quick-btn {
  padding: 6px 12px; border-radius: 999px; background: #FFF1E6; color: #B4570A;
  font-weight: 800; font-size: 12px;
}
.disc-quick-btn:active { background: #FFE0C2; }

/* Order cards */
.order-card .discount-btn { background: #E3F7EC; font-weight: 800; }

/* Receipt */
.receipt { border: 1px solid var(--border); }
.receipt-logo { height: 52px; width: auto; display: block; margin: 0 auto 4px; }
.receipt-header h3 { font-family: var(--font-display); }

/* Mobile: tiles stay 2×2, order sheet gets the rounded white card */
@media (max-width: 760px) {
  .pos-layout { padding: 8px; gap: 8px; }
  .menu-type-toggle { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .menu-type-btn { flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 12px; border-radius: 12px; }
  .menu-type-btn .mt-emoji { font-size: 18px; }
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
  .menu-item-card { min-height: 118px; padding: 10px 8px; }
  .menu-item-card .item-desc { display: none; }
  .menu-item-card .item-name { font-size: 13px; }
  .menu-item-card .item-emoji { width: 36px; height: 36px; font-size: 18px; }
  .pos-col-order { border-top: none; border-radius: 22px 22px 0 0; box-shadow: 0 -8px 24px rgba(122, 74, 30, 0.18); }
  .pos-order-footer { background: #FFFFFF; }
}
@media (max-width: 1024px) and (min-width: 761px) {
  .pos-layout { grid-template-columns: 200px 1fr 280px; gap: 10px; }
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

/* Cart line: emoji | name (wraps) | total stacked over the +/− stepper */
.cart-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "emoji info total" "emoji info qty";
  align-items: center; column-gap: 8px; row-gap: 4px;
}
.cart-item .cart-emoji { grid-area: emoji; }
.cart-item .cart-item-info { grid-area: info; }
.cart-item .cart-item-total { grid-area: total; justify-self: end; min-width: 0; }
.cart-item .cart-qty-controls { grid-area: qty; justify-self: end; }
.cart-item-name {
  white-space: normal; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; line-height: 1.2;
}

/* Icon ligatures are case-sensitive: never inherit uppercase headings */
.material-icons-round { text-transform: none; letter-spacing: normal; }

/* ===== OpenMoji icons (bundled SVGs; sizes from the approved OpenMoji mock-up) ===== */
.om { width: 100%; height: 100%; display: block; pointer-events: none; }
.om-inline { width: 18px; height: 18px; vertical-align: -4px; pointer-events: none; }
.emoji-dot { padding: 3px; }
.menu-item-card { min-height: 184px; }
.menu-item-card .item-desc { flex-shrink: 0; }
.menu-item-card .item-emoji { width: 52px; height: 52px; padding: 4px; }
.cart-item .cart-emoji { width: 40px; height: 40px; padding: 3px; }
.pos-cat-btn .emoji-dot { width: 34px; height: 34px; }
.mt-emoji { width: 28px; height: 28px; display: inline-block; }
.nav-emoji { width: 28px; height: 28px; display: block; }
.send-emoji { width: 26px; height: 26px; display: inline-block; vertical-align: middle; }
.empty-emoji { width: 56px; height: 56px; display: block; }
.settings-credits {
  margin-top: 18px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text-muted); font-size: 12px; line-height: 1.5;
}
.settings-credits strong { display: block; color: var(--text); font-size: 13px; margin-bottom: 2px; }
.settings-credits a { color: var(--primary-dark); font-weight: 700; }
@media (max-width: 760px) {
  .menu-item-card { min-height: 128px; }
  .menu-item-card .item-emoji { width: 42px; height: 42px; }
  .mt-emoji { width: 24px; height: 24px; }
}

/* ===== CASH BOOK (money in vs out, CashBook-app style) ===== */
.cb-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.cb-filters select.input-sm { width: auto; flex: 1 1 160px; }
.cb-range { display: flex; gap: 4px; background: #FFFFFF; border-radius: 999px; padding: 4px; box-shadow: var(--shadow-sm); }
.cb-range-btn { padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; color: var(--text-muted); }
.cb-range-btn.active { background: var(--primary); color: #FFFFFF; }
.cb-custom { display: flex; gap: 6px; align-items: center; color: var(--text-muted); font-size: 13px; }
.cb-custom .input-sm { width: auto; }
.cb-summary { background: #FFFFFF; border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border); overflow: hidden; }
.cb-summary > div { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; }
.cb-net { border-bottom: 1px solid var(--border); }
.cb-net span { font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.cb-net strong { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--text); }
.cb-tot span { font-size: 15px; font-weight: 600; }
.cb-tot strong { font-size: 17px; font-weight: 800; }
.cb-summary .pos { color: var(--success); }
.cb-summary .neg { color: var(--danger) !important; }
.cb-link { width: 100%; display: flex; justify-content: center; align-items: center; gap: 2px; padding: 12px; border-top: 1px solid var(--border); color: var(--primary-dark); font-weight: 800; font-size: 14px; }
.cb-count { text-align: center; color: var(--text-muted); font-size: 13px; margin: 12px 0 4px; }
.cb-day { color: var(--text-muted); font-weight: 700; font-size: 13px; margin: 14px 2px 6px; }
.cb-entry { background: #FFFFFF; border-radius: 16px; border: 1px solid var(--border); padding: 12px 14px; margin-bottom: 8px; box-shadow: var(--shadow-sm); }
.cb-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cb-row + .cb-row { margin-top: 6px; }
.cb-party { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.cb-party span { font-family: 'Nunito', sans-serif; font-weight: 600; font-size: 12px; color: var(--text-muted); }
.cb-amt { font-family: var(--font-display); font-weight: 700; font-size: 18px; white-space: nowrap; }
.cb-amt.in { color: var(--success); }
.cb-amt.out { color: var(--danger); }
.cb-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cb-tag { background: #EEF0FF; color: #4F46E5; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.cb-bal { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.cb-lines { margin-top: 8px; font-size: 13px; line-height: 1.45; color: var(--text); }
.cb-by { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 12px; font-weight: 700; color: var(--success); }
#cb-list { padding-bottom: 76px; }
.cb-actions {
  position: fixed; left: 0; right: 0; bottom: calc(var(--nav-height) + var(--safe-bottom));
  display: flex; gap: 10px; padding: 10px 16px; z-index: 40;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
#page-cashbook:not(.active) .cb-actions { display: none; }
.cb-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 13px; border-radius: 14px; color: #FFFFFF; font-family: var(--font-display); font-weight: 700; font-size: 17px; box-shadow: var(--shadow); }
.cb-btn small { font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 11px; opacity: 0.85; }
.cb-btn-in { background: linear-gradient(135deg, #2BB673, #1F9D5C); }
.cb-btn-out { background: linear-gradient(135deg, #E8453C, #C0392B); }
.cb-dash { margin-bottom: 16px; }
.cb-dash-title { font-size: 12px; margin: 0 0 8px 2px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; font-family: 'Nunito', sans-serif; font-weight: 800; }
@media (min-width: 1025px) { .cb-actions { left: 50%; transform: translateX(-50%); max-width: 720px; } }
@media (max-width: 760px) { .cb-btn small { display: none; } .cb-btn { font-size: 18px; } }

/* ===== Purchase order lines with real prices ===== */
.po-items-label { font-size: 13px; color: var(--text-muted); font-weight: 700; display: block; margin-bottom: 6px; }
.po-line { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 0.9fr) minmax(0, 1.2fr) minmax(0, 1.3fr) 28px; gap: 6px; align-items: center; margin-bottom: 6px; }
.po-line .input-sm { width: 100%; min-width: 0; }
.po-line-head { font-size: 11px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 4px; }
.po-line-rm { width: 28px; height: 28px; border-radius: 50%; color: var(--text-muted); display: flex; align-items: center; justify-content: center; }
.po-line-rm .material-icons-round { font-size: 18px; }
.po-line-rm:active { background: var(--bg-hover); color: var(--danger); }
.po-grand { display: flex; justify-content: space-between; align-items: baseline; background: #FFF1E6; border-radius: 14px; padding: 10px 14px; margin-bottom: 14px; }
.po-grand span { font-weight: 800; }
.po-grand strong { font-family: var(--font-display); font-size: 22px; color: var(--primary-dark); }
.po-card-lines { margin: 2px 0; }
.po-card-lines span { color: var(--text-muted); }
@media (max-width: 520px) {
  .po-line { grid-template-columns: repeat(3, minmax(0, 1fr)) 28px; padding-bottom: 8px; border-bottom: 1px dashed var(--border); }
  .po-line .po-inv-item { grid-column: 1 / 4; grid-row: 1; }
  .po-line .po-line-rm { grid-column: 4; grid-row: 1; }
  .po-line .po-inv-qty { grid-column: 1; grid-row: 2; }
  .po-line .po-unit-price { grid-column: 2; grid-row: 2; }
  .po-line .po-line-total { grid-column: 3; grid-row: 2; }
  .po-line-head { display: none; }
}

/* ===== Branches ===== */
.branch-switch { width: auto; padding: 5px 28px 5px 12px; border-radius: 999px; font-weight: 800; font-size: 12px;
  background-color: #FFF1E6; color: var(--primary-dark); border: 1.5px solid var(--border-light); }
.branch-pill { font-size: 12px; font-weight: 800; background: #FFF1E6; color: var(--primary-dark); padding: 5px 12px; border-radius: 999px; }
.branch-chip { display: inline-flex; align-items: center; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: #EEF0FF; color: #4F46E5; white-space: nowrap; }
.branch-chip.none { background: #F1E4D3; color: var(--text-muted); }
.branch-move { width: auto; font-size: 12px; padding: 5px 26px 5px 10px; border-radius: 999px; }
.branch-hint { background: #FFF6D6; border: 1px solid #F5D77A; color: #7A5A00; border-radius: 12px; padding: 9px 12px; font-size: 13px; font-weight: 700; margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.branch-hint.ok { background: #E3F7EC; border-color: #A7E3C3; color: #16804B; }
.branch-hint select.input-sm { width: auto; }
.inv-branches { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.settings-branches { margin-top: 18px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg); }
.settings-branches strong { display: block; margin-bottom: 8px; }
.sb-row { display: flex; gap: 8px; margin-bottom: 8px; }
.sb-row .input-sm { flex: 1; }
@media (max-width: 760px) { .branch-switch { max-width: 130px; } #staff-name { display: none; } }

/* Orders: date range + bulk move of old orders */
.range-to { color: var(--text-muted); font-size: 13px; font-weight: 700; }
#orders-date-filter, #orders-date-to { flex: 0 1 160px; min-width: 130px; }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: #FFF6D6; border: 1px solid #F5D77A;
  color: #7A5A00; border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; font-size: 13px; font-weight: 700; }
.bulk-bar select.input-sm { width: auto; }
#btn-waiter-summary:disabled { opacity: 0.45; }

/* Select individual old orders to move */
.order-pick { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--text-muted);
  margin-bottom: 8px; cursor: pointer; user-select: none; }
.order-pick input, .bulk-all input { width: 20px; height: 20px; accent-color: var(--primary); }
.order-card.selectable { cursor: default; }
.order-card.picked { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(232, 69, 60, 0.25); }
.bulk-all { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.bulk-count { flex: 1; min-width: 140px; }
.bulk-move-to { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bulk-bar .btn:disabled { opacity: 0.45; }

/* Admin order edit */
.badge-edited { background: #FFF1E6; color: #B4570A; }
.ae-note { background: #FFF6D6; border: 1px solid #F5D77A; color: #7A5A00; border-radius: 12px; padding: 8px 12px; font-size: 12px; font-weight: 700; margin-bottom: 12px; }
.ae-line { display: grid; grid-template-columns: minmax(0, 1fr) 72px 28px; gap: 6px; align-items: center; margin-bottom: 6px; }
.ae-line .input-sm { width: 100%; min-width: 0; }
.ae-extra { grid-column: 1 / -1; font-size: 11px; color: var(--text-muted); margin: -2px 0 2px 4px; }
.ae-credit { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.ae-credit select.input-sm { width: auto; }
#ae-was { font-weight: 600; color: var(--text-muted); font-size: 12px; }

.needs-branch { color: #B4570A; font-weight: 800; }

/* Custom (off-menu) items */
.menu-item-card.custom-tile { border: 2px dashed color-mix(in srgb, #8E5CD9 55%, transparent); background: #FBF8FF; }
.menu-item-card.custom-tile .item-price { background: #EFE7FF; color: #6B3FC4; }
.ci-row { display: grid; grid-template-columns: 1fr 120px; gap: 10px; }
.custom-chip { font-size: 10px; font-weight: 800; background: #EFE7FF; color: #6B3FC4; padding: 1px 6px; border-radius: 999px; vertical-align: middle; }
.ae-custom-fields { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 6px; }

/* ===== MARGIN REPORT + COST CARDS ===== */
.margin-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 8px 0 10px; }
.margin-kpis div { background: var(--bg); border-radius: 12px; padding: 8px 10px; text-align: center; }
.margin-kpis span { display: block; font-size: 11px; color: var(--text-muted); }
.margin-kpis strong { font-family: var(--font-display); font-size: 17px; }
.margin-note { font-size: 12px; color: var(--text-muted); margin: 6px 0; line-height: 1.45; }
.margin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: 12px; }
.margin-table { border-collapse: collapse; width: 100%; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.margin-table th, .margin-table td { padding: 6px 8px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--border); }
.margin-table th { background: var(--bg); font-size: 11px; text-transform: uppercase; letter-spacing: .02em; color: var(--text-muted); position: sticky; top: 0; }
.margin-table .mt-name { text-align: left; position: sticky; left: 0; background: var(--card-bg, #fff); white-space: normal; min-width: 150px; max-width: 220px; z-index: 1; }
.margin-table th.mt-name { background: var(--bg); z-index: 2; }
.margin-table .mt-group td { text-align: left; font-weight: 700; background: #FFF1E0; color: var(--orange, #F97316); font-family: var(--font-display); }
.margin-table .mt-group td.mt-name, .margin-table tr.mt-group td { position: static; }
.margin-table .mt-sub td { font-weight: 700; background: #FAFAF7; }
.margin-table .mt-sub .mt-name { background: #FAFAF7; }
.margin-table .mt-total td { font-weight: 800; background: #FFE9E6; border-top: 2px solid var(--primary); }
.margin-table .mt-total .mt-name { background: #FFE9E6; }
.margin-table .mt-cost { font-weight: 700; }
.margin-table .mt-gross { color: var(--text-muted); }
.margin-table sup { color: var(--primary); font-weight: 700; }
.m-good { color: var(--success); font-weight: 700; }
.m-ok { color: var(--warning, #f39c12); font-weight: 700; }
.m-bad { color: var(--danger, #e74c3c); font-weight: 700; }
.bridge-head .label { font-weight: 700; }
.bridge-sub .label { padding-left: 14px; font-size: 12.5px; color: var(--text-muted); }
.bridge-total { border-top: 2px solid var(--border); margin-top: 6px; padding-top: 8px; font-weight: 800; }
.seg { display: inline-flex; gap: 0; }
.seg .btn { border-radius: 0; }
.seg .btn:first-child { border-radius: 999px 0 0 999px; }
.seg .btn:last-child { border-radius: 0 999px 999px 0; }
.seg .btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.cc-missing { color: var(--danger, #e74c3c); font-weight: 700; }
.cc-totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.cc-totals div { background: var(--bg); border-radius: 10px; padding: 6px; text-align: center; }
.cc-totals span { display: block; font-size: 10.5px; color: var(--text-muted); }
.cc-totals strong { font-size: 14px; }
.cc-margin { font-size: 12.5px; margin: 3px 0; }
.cc-head { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); text-transform: uppercase; margin: 10px 0 4px; }
.cc-line { display: grid; grid-template-columns: 1fr 96px; grid-template-areas: "name amt" "qty kind"; gap: 4px 6px; padding: 8px 30px 8px 0; border-bottom: 1px dashed var(--border); position: relative; }
.cc-line .cc-name { grid-area: name; } .cc-line .cc-amt { grid-area: amt; text-align: right; }
.cc-line .cc-qty { grid-area: qty; font-size: 12px; } .cc-line .cc-kind { grid-area: kind; font-size: 12px; }
.cc-line .input { padding: 6px 8px; min-height: 0; }
.cc-del { position: absolute; right: 0; top: 10px; background: none; border: 0; color: var(--text-muted); cursor: pointer; padding: 2px; }
.cc-del .material-icons-round { font-size: 18px; }
.cc-flavour { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 10px 12px; margin: 6px 0; border: 1px solid var(--border); border-radius: 12px; background: var(--card-bg, #fff); cursor: pointer; font: inherit; text-align: left; }
.cc-flavour small { color: var(--text-muted); }
@media (max-width: 520px) {
  .margin-kpis, .cc-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ===== CUSTOM ORDER BUILDER ===== */
.ci-mode { margin-bottom: 10px; display: flex; }
.ci-mode .btn { flex: 1; }
.cb-label { display: block; font-weight: 700; font-size: 13px; margin: 6px 0 4px; }
.cb-line { display: grid; grid-template-columns: 1fr 130px; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.cb-line .cb-name { font-size: 14px; }
.cb-line .cb-name small { display: block; color: var(--text-muted); font-size: 12px; }
.cb-line .input { padding: 6px 8px; min-height: 0; font-size: 13px; }
.cb-line.cb-changed .cb-name { color: var(--primary); font-weight: 700; }
.cb-line.cb-off .cb-name { color: var(--text-muted); text-decoration: line-through; }
.cb-add { display: grid; grid-template-columns: 1fr 90px auto; gap: 6px; margin: 10px 0; }
.cb-add .input { padding: 6px 8px; min-height: 0; font-size: 13px; }
#cb-cost { margin: 6px 0 10px; }
