/* ============================================================
   style.css — Kibo Waiter Screen
   Brand: Black background · Orange accent · Steel blue surface
   Aesthetic: Industrial-refined dark POS. Square-inspired speed.
   Every target is large. Every colour earns its place.
============================================================ */

/* ── TOKENS ────────────────────────────────────────────── */
:root {
  /* Brand (from customer) */
  --bg:          #000000;
  --bg-raised:   #0d0d0d;
  --surface:     #445468;
  --surface-dim: #2e3a47;
  --surface-hi:  #556070;
  --accent:      #ed7c31;
  --accent-dim:  #c45e18;
  --accent-glow: rgba(237, 124, 49, 0.22);
  --text:        rgba(255,255,255,0.88);
  --text-muted:  rgba(255,255,255,0.45);
  --text-faint:  rgba(255,255,255,0.22);
  --border:      rgba(255,255,255,0.09);
  --border-hi:   rgba(237,124,49,0.40);

  /* Status */
  --success:     #3dd598;
  --danger:      #ff6b6b;
  --warning:     #f9b233;
  --info:        #67b7ff;

  /* Radius */
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  16px;
  --r-xl:  22px;
  --r-pill: 999px;

  /* Header height so main can calc correctly */
  --header-h: 62px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.40);
  --shadow-md: 0 6px 24px rgba(0,0,0,0.52);
  --shadow-accent: 0 4px 22px rgba(237,124,49,0.30);

  /* Transitions */
  --t-fast: 120ms ease;
  --t-base: 200ms ease;
  --t-slow: 320ms ease;

  /* Fonts */
  --font-body:    'Nunito Sans', sans-serif;
  --font-heading: 'Raleway', sans-serif;
}

/* ── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; overflow: hidden; }

body {
  font-family: var(--font-body);
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button { cursor: pointer; font-family: inherit; border: none; background: none; color: inherit; }
input  { font-family: inherit; }
ul, ol { list-style: none; }
a { text-decoration: none; color: inherit; }


/* ============================================================
   LOGIN SCREEN
============================================================ */
.login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
  transition: opacity var(--t-slow), visibility var(--t-slow);
}

.login-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 40px 36px;
  box-shadow: var(--shadow-md);
  animation: loginSlideIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes loginSlideIn {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo-ring {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: var(--r-pill);
  background: var(--accent-glow);
  border: 2px solid var(--border-hi);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--accent);
}

.login-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.login-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Error */
.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,107,107,0.12);
  border: 1px solid rgba(255,107,107,0.35);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--danger);
  margin-bottom: 20px;
}

.login-error.hidden { display: none; }

/* Fields */
.login-field {
  margin-bottom: 18px;
}

.login-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 7px;
}

.login-input-wrap {
  position: relative;
}

.login-input-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: 0.95rem;
  pointer-events: none;
}

.login-input {
  width: 100%;
  height: 48px;
  background: var(--surface-dim);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 0.95rem;
  padding: 0 14px 0 40px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.login-input::placeholder { color: var(--text-faint); }
.login-input:focus {
  outline: none;
  border-color: var(--border-hi);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* PIN dots */
.pin-input {
  letter-spacing: 0.25em;
  font-size: 1.1rem;
}

/* Submit */
.login-btn {
  width: 100%;
  height: 52px;
  background: var(--accent);
  border-radius: var(--r-md);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}

.login-btn:hover  { background: var(--accent-dim); box-shadow: var(--shadow-accent); }
.login-btn:active { transform: scale(0.98); }
.login-btn:disabled { opacity: 0.5; pointer-events: none; }

.login-btn-icon { font-size: 1.1rem; }

.login-footer {
  font-size: 0.72rem;
  color: var(--text-faint);
  text-align: center;
  margin-top: 18px;
}


/* ============================================================
   POS APP SHELL
============================================================ */
.pos-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  opacity: 0;
  transition: opacity var(--t-slow);
}

.pos-app.visible { opacity: 1; }
.pos-app.hidden  { display: none; }
.hidden { display: none !important; }


/* ============================================================
   HEADER
============================================================ */
.pos-header {
  height: var(--header-h);
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  flex-shrink: 0;
  z-index: 100;
}

/* Left */
.pos-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pos-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pos-brand-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
}

.pos-brand-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.pos-waiter-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-dim);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 5px 12px 5px 6px;
}

.pos-waiter-av {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.pos-waiter-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.pos-waiter-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
}

.pos-waiter-role {
  font-size: 0.63rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Centre — table pills */
.pos-header-center {
  min-width: 0;
  overflow: hidden;
}

.pos-table-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.pos-table-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.pos-table-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.pos-table-pills::-webkit-scrollbar { display: none; }

.table-pill {
  height: 32px;
  min-width: 42px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface-dim);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--t-fast);
}

.table-pill:hover {
  border-color: var(--border-hi);
  color: var(--accent);
  background: var(--accent-glow);
}

.table-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-accent);
}

/* Right */
.pos-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pos-status-dot {
  width: 9px;
  height: 9px;
  border-radius: var(--r-pill);
  background: var(--text-faint);
  transition: background var(--t-base), box-shadow var(--t-base);
  flex-shrink: 0;
}

.pos-status-dot.online {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(61,213,152,0.22);
}

.pos-status-dot.offline {
  background: var(--danger);
}

.pos-current-table-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--accent-glow);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-pill);
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
}

.pos-logout-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: all var(--t-fast);
}

.pos-logout-btn:hover {
  border-color: rgba(255,107,107,0.40);
  color: var(--danger);
  background: rgba(255,107,107,0.10);
}

.bar-logout-btn:hover {
  border-color: rgba(255,107,107,0.40);
  color: var(--danger);
  background: rgba(255,107,107,0.10);
}

.bar-home-btn {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-dim);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 0.9rem;
  transition: all var(--t-fast);
}
.bar-home-btn:hover {
  border-color: rgba(61, 133, 213, 0.40);
  color: #0dbfc0; /* coastal teal */
  background: rgba(61, 133, 213, 0.10);
}



/* ============================================================
   MAIN CANVAS
============================================================ */
.pos-main {
  display: grid;
  grid-template-columns: 1fr 320px;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}


/* ============================================================
   MENU PANEL (left 70%)
============================================================ */
.menu-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--border);
  min-height: 0;
}
/* ── WAITER TABS ─────────────────────────────────────── */
.waiter-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 10px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.waiter-tab {
  display: flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface-dim);
  color: var(--text-muted);
  font-size: 0.78rem; font-weight: 700;
  transition: all var(--t-fast);
  position: relative;
}

.waiter-tab:hover { border-color: var(--border-hi); color: var(--accent); }

.waiter-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-accent);
}

.waiter-tab-badge {
  min-width: 18px; height: 18px;
  background: var(--danger);
  color: #fff;
  border-radius: var(--r-pill);
  font-size: 0.62rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
}

/* ── WAITER VIEWS ────────────────────────────────────── */
.waiter-view { display: none; flex: 1; flex-direction: column; overflow: hidden; min-height: 0; }
.waiter-view.active { display: flex; }

/* ── MY TABLES LIST ──────────────────────────────────── */
.my-tables-list {
  flex: 1; overflow-y: auto; padding: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--surface) transparent;
}

.my-tables-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px; padding: 60px 20px;
  color: var(--text-faint); text-align: center;
}
.my-tables-empty i { font-size: 2rem; opacity: 0.3; }
.my-tables-empty p { font-size: 0.82rem; }

/* ── MENU TOOLBAR (category strip + search in one row) ── */
.menu-toolbar {
  display: flex;
  align-items: center;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-width: 0;
}

/* ── CATEGORY STRIP ──────────────────────────────────── */
.category-strip {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  overflow-x: auto;
  flex: 1;
  min-width: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--surface) transparent;
}

.category-strip::-webkit-scrollbar { height: 3px; }
.category-strip::-webkit-scrollbar-thumb { background: var(--surface); border-radius: 4px; }
.category-strip::-webkit-scrollbar-track { background: transparent; }

/* ── SEARCH ──────────────────────────────────────────── */
.menu-search-wrap {
  display: flex;
  align-items: center;
  padding: 10px 12px 10px 0;
  flex-shrink: 0;
  position: relative;
}

.menu-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: 0.82rem;
  pointer-events: none;
  transition: color var(--t-fast);
}

.menu-search-input {
  width: 160px;
  height: 36px;
  background: var(--surface-dim);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--text);
  font-size: 0.8rem;
  padding: 0 32px 0 32px;
  transition: width var(--t-slow) cubic-bezier(0.22,1,0.36,1),
              border-color var(--t-fast),
              box-shadow var(--t-fast);
}

.menu-search-input::placeholder { color: var(--text-faint); }

.menu-search-input:focus {
  outline: none;
  border-color: var(--border-hi);
  box-shadow: 0 0 0 3px var(--accent-glow);
  width: 210px;
}

.menu-search-wrap.has-value .menu-search-icon { color: var(--accent); }

/* Clear × button */
.menu-search-clear {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  transition: all var(--t-fast);
}

.menu-search-clear:hover { background: var(--accent); color: #fff; }
.menu-search-clear.hidden { display: none; }

.cat-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface-dim);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--t-fast);
}

.cat-btn .cat-count {
  background: rgba(255,255,255,0.10);
  border-radius: var(--r-pill);
  padding: 1px 6px;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-faint);
  transition: all var(--t-fast);
}

.cat-btn:hover {
  border-color: var(--border-hi);
  color: var(--accent);
  background: var(--accent-glow);
}

.cat-btn:hover .cat-count {
  background: var(--accent-glow);
  color: var(--accent);
}

/* Active category pill */
.cat-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-accent);
}

.cat-btn.active .cat-count {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* Category dot colours (subtle left-border on menu cards) */
.cat-btn[data-cat="seafood"]   { --cat-color: #67b7ff; }
.cat-btn[data-cat="grills"]    { --cat-color: #ff8c42; }
.cat-btn[data-cat="curries"]   { --cat-color: #f9b233; }
.cat-btn[data-cat="vegetarian"]{ --cat-color: #3dd598; }
.cat-btn[data-cat="swahili"]   { --cat-color: #c778dd; }
.cat-btn[data-cat="cocktails"] { --cat-color: #ff6b9d; }
.cat-btn[data-cat="fruits"]    { --cat-color: #ffd166; }
.cat-btn[data-cat="drinks"]    { --cat-color: #67b7ff; }

.cat-btn.active[data-cat] { background: var(--cat-color); border-color: var(--cat-color); box-shadow: 0 4px 18px color-mix(in srgb, var(--cat-color), transparent 60%); }

/* ── MENU GRID ───────────────────────────────────────── */
.menu-grid {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
  align-content: start;
  scrollbar-width: thin;
  scrollbar-color: var(--surface) transparent;
 grid-auto-rows: min-content; 
}

.menu-grid::-webkit-scrollbar { width: 5px; }
.menu-grid::-webkit-scrollbar-thumb { background: var(--surface); border-radius: 4px; }

/* ── MENU ITEM CARD ─────────────────────────────────── */
.menu-card {
  background: var(--surface-dim);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
  position: relative;
  /* Left accent bar — category colour */
  border-left: 3px solid var(--cat-color, var(--border));
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.menu-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-left-color: var(--cat-color, var(--accent));
}

.menu-card:active { transform: scale(0.97); }

/* Tap flash — shows orange ring on tap */
.menu-card.tapped {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

/* Image area */
.menu-card-img-wrap {
  width: 100%;
  height: 100px;
  overflow: hidden;
  background: var(--surface);
  position: relative;
}

.menu-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
  display: block;
}

.menu-card:hover .menu-card-img { transform: scale(1.06); }

/* Badge showing qty in bill */
.menu-card-qty-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  min-width: 24px;
  height: 24px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--r-pill);
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity var(--t-fast), transform var(--t-fast);
  pointer-events: none;
}

.menu-card.in-bill .menu-card-qty-badge {
  opacity: 1;
  transform: scale(1);
}

/* Card body */
.menu-card-body {
  padding: 9px 11px 11px;
}

.menu-card-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 5px;
  /* Two-line clamp */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.menu-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.menu-card-price {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--accent);
}

.menu-card-add {
  width: 26px;
  height: 26px;
  background: var(--accent);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.8rem;
  transition: background var(--t-fast), transform var(--t-fast);
  flex-shrink: 0;
}

.menu-card:hover .menu-card-add { background: var(--accent-dim); }
.menu-card:active .menu-card-add { transform: scale(0.88); }

/* Empty state when filtered */
.menu-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 60px 20px;
  color: var(--text-muted);
}

.menu-empty i { font-size: 2.2rem; opacity: 0.4; }
.menu-empty p { font-size: 0.84rem; }


/* ============================================================
   BILL PANEL (right 30%)
============================================================ */
.bill-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-raised);
  min-height: 0;
}

/* Bill header */
.bill-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.bill-header-left {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bill-table-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-pill);
  padding: 3px 9px;
}

/* Bill items list */
.bill-items {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--surface) transparent;
  min-height: 0;
}

.bill-items::-webkit-scrollbar { width: 4px; }
.bill-items::-webkit-scrollbar-thumb { background: var(--surface); border-radius: 4px; }

/* Empty state */
.bill-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px 16px;
  color: var(--text-faint);
  text-align: center;
}

.bill-empty i { font-size: 2rem; }
.bill-empty p { font-size: 0.8rem; }

/* ── BILL LINE ITEM ──────────────────────────────────── */
.bill-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  background: var(--surface-dim);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 7px;
  animation: billLineIn 0.18s ease-out both;
}

@keyframes billLineIn {
  from { opacity: 0; transform: translateX(14px); }
  to   { opacity: 1; transform: translateX(0);    }
}

.bill-line-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bill-line-name small {
  display: block;
  font-size: 0.68rem;
  color: var(--accent);
  font-weight: 700;
  margin-top: 1px;
}

/* Qty stepper */
.bill-qty {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.bill-qty-btn {
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
}

.bill-qty-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.bill-qty-num {
  min-width: 20px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 800;
  color: #fff;
}

/* Subtotal */
.bill-line-price {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}

/* Bill footer */
.bill-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.bill-summary {
  margin-bottom: 12px;
}

.bill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 3px 0;
}

.bill-total-row {
  font-size: 1rem;
  color: var(--text);
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 4px;
}

.bill-total-row strong {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent);
}

/* Offline banner */
.bill-offline-banner {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(249,178,51,0.12);
  border: 1px solid rgba(249,178,51,0.30);
  border-radius: var(--r-md);
  padding: 8px 11px;
  font-size: 0.74rem;
  color: var(--warning);
  margin-bottom: 10px;
}

/* ── PLACE ORDER BUTTON ──────────────────────────────── */
.place-order-btn {
  width: 100%;
  height: 54px;
  background: var(--accent);
  border-radius: var(--r-md);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  margin-bottom: 8px;
}

.place-order-btn:hover:not(:disabled) {
  background: var(--accent-dim);
  box-shadow: var(--shadow-accent);
}

.place-order-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.place-order-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.place-order-btn.sending {
  pointer-events: none;
}

.place-order-icon { font-size: 1rem; }

/* Sending pulse */
.place-order-btn.sending .place-order-text::after {
  content: '…';
  animation: ellipsis 1.2s infinite;
}

@keyframes ellipsis {
  0%   { content: '.'; }
  33%  { content: '..'; }
  66%  { content: '...'; }
  100% { content: '.'; }
}

/* Clear order */
.clear-order-btn {
  width: 100%;
  height: 38px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--t-fast);
}

.clear-order-btn:hover {
  border-color: rgba(255,107,107,0.40);
  color: var(--danger);
  background: rgba(255,107,107,0.07);
}


/* ============================================================
   TOAST NOTIFICATION
============================================================ */
.pos-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 11px 22px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  box-shadow: var(--shadow-md);
  z-index: 500;
  opacity: 0;
  transition: opacity var(--t-base), transform var(--t-base);
  pointer-events: none;
  white-space: nowrap;
}

.pos-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.pos-toast-icon.success { color: var(--success); }
.pos-toast-icon.error   { color: var(--danger);  }
.pos-toast-icon.info    { color: var(--accent);  }


/* ============================================================
   UTILITY
============================================================ */
.spin {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.30);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}


/* ============================================================
   RESPONSIVE — TABLET (portrait, ≤ 900px)
============================================================ */
@media (max-width: 900px) {
  .pos-main {
    grid-template-columns: 1fr 280px;
  }

  .pos-brand-name { display: none; }

  .menu-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
}

/* ============================================================
   RESPONSIVE — MOBILE (≤ 640px)
   Bill slides up as a sheet from bottom.
============================================================ */
@media (max-width: 640px) {
  .pos-header {
    grid-template-columns: auto 1fr auto;
  }

  .pos-header-center .pos-table-label { display: none; }

  .pos-main {
    grid-template-columns: 1fr;
    position: relative;
  }

  .menu-panel {
    border-right: none;
    height: 100%;
  }

  .bill-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 52px;            /* collapsed */
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    border-top: 1px solid var(--border);
    transition: height var(--t-slow) cubic-bezier(0.22,1,0.36,1);
    z-index: 150;
    overflow: hidden;
  }

  .bill-panel.open {
    height: 72vh;
  }

  /* Collapsed handle */
  .bill-header {
    cursor: pointer;
  }

  .bill-header::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 3px;
    background: var(--text-faint);
    border-radius: var(--r-pill);
  }

  .menu-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    padding-bottom: 70px; /* clear bill handle */
  }
}

/* ============================================================
  Waiter view css
============================================================ */

.my-table-card {
  background: var(--surface-dim);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  margin-bottom: 8px;
  border-left: 3px solid var(--status-color, var(--border));
  animation: cardSlideIn 0.2s ease-out both;
}

.my-table-card[data-status="pending"]  { --status-color: var(--warning); }
.my-table-card[data-status="verified"] { --status-color: var(--info); }
.my-table-card[data-status="cooking"]  { --status-color: var(--accent); }
.my-table-card[data-status="done"]     { --status-color: var(--success); }

.my-table-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 5px;
}

.my-table-no {
  font-family: var(--font-heading); font-size: 0.95rem; font-weight: 800; color: #fff;
}

.my-table-status {
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase;
  padding: 2px 7px; border-radius: var(--r-pill);
  background: rgba(255,255,255,0.08); color: var(--status-color, var(--text-muted));
}

.my-table-bottom {
  display: flex; justify-content: space-between;
  font-size: 0.72rem; color: var(--text-muted);
}

.my-table-total {
  font-family: var(--font-heading); font-weight: 700; color: var(--accent);
}

/* ── MY TABLES MODAL ────────────────────────────────────── */
 
.mt-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
  animation: mtOverlayIn 0.2s ease-out both;
}
 
@keyframes mtOverlayIn { from { opacity: 0; } to { opacity: 1; } }
 
.mt-modal {
  width: 100%; max-width: 480px;
  max-height: 85vh;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: mtModalIn 0.28s cubic-bezier(0.22,1,0.36,1) both;
  box-shadow: 0 24px 64px rgba(0,0,0,0.7);
}
 
@keyframes mtModalIn {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
 
.mt-modal-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
 
.mt-modal-title {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-heading);
  font-size: 1.1rem; font-weight: 800; color: #fff;
  flex: 1;
}
 
.mt-modal-title i { color: var(--accent); }
 
.mt-modal-meta {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
}
 
.mt-modal-meta span:first-child {
  font-size: 0.68rem; color: var(--text-muted);
}
 
.mt-modal-total {
  font-family: var(--font-heading);
  font-size: 0.95rem; font-weight: 800; color: var(--accent);
}
 
.mt-modal-close {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 0.8rem;
  transition: all var(--t-fast);
}
.mt-modal-close:hover { border-color: rgba(255,107,107,0.4); color: var(--danger); }
 
/* Ticket list */
.mt-ticket-list {
  flex: 1; overflow-y: auto; padding: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--surface) transparent;
}
 
/* ── TICKET CARD ──────────────────────────────────────── */
.mt-ticket {
  background: var(--surface-dim);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 8px;
  overflow: hidden;
}
 
.mt-ticket-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
 
.mt-ticket-header-left {
  display: flex; align-items: center; gap: 8px;
}
 
.mt-ticket-num {
  font-size: 0.72rem; font-weight: 700;
  color: var(--text-faint); min-width: 52px;
}
 
.mt-ticket-time { font-size: 0.7rem; color: var(--text-muted); }
 
.mt-ticket-status {
  font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
  padding: 2px 7px; border-radius: var(--r-pill);
}
 
.mt-ticket-status.pending  { color: var(--warning); background: rgba(249,178,51,0.12); border: 1px solid rgba(249,178,51,0.28); }
.mt-ticket-status.verified { color: var(--info);    background: rgba(103,183,255,0.12); border: 1px solid rgba(103,183,255,0.28); }
.mt-ticket-status.cooking  { color: var(--accent);  background: var(--accent-glow);     border: 1px solid var(--border-hi); }
.mt-ticket-status.done     { color: var(--success); background: rgba(61,213,152,0.12);  border: 1px solid rgba(61,213,152,0.28); }
 
.mt-ticket-subtotal {
  font-family: var(--font-heading);
  font-size: 0.82rem; font-weight: 700; color: var(--text-muted);
}
 
/* Items inside ticket */
.mt-ticket-items { padding: 4px 0; }
 
.mt-ticket-item {
  display: flex; align-items: center;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border-dim);
  gap: 8px;
}
 
.mt-ticket-item:last-child { border-bottom: none; }
 
.mt-item-name {
  flex: 1; font-size: 0.82rem; font-weight: 600; color: var(--text);
}
 
.mt-item-price {
  font-size: 0.75rem; color: var(--text-muted);
  font-family: var(--font-heading); font-weight: 700;
  min-width: 64px; text-align: right;
}
 
/* Qty controls — only on pending tickets */
.mt-item-qty {
  display: flex; align-items: center; gap: 4px;
}
 
.mt-qty-btn {
  width: 24px; height: 24px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-dim);
  background: var(--surface);
  color: var(--text-muted); font-size: 0.72rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t-fast);
}
.mt-qty-btn:hover { border-color: var(--accent); color: var(--accent); }
.mt-qty-btn.danger:hover { border-color: var(--danger); color: var(--danger); }
 
.mt-qty-num {
  min-width: 20px; text-align: center;
  font-size: 0.82rem; font-weight: 800; color: #fff;
}
 
/* Locked state for non-pending tickets */
.mt-ticket.locked .mt-ticket-item {
  opacity: 0.65;
}
 
.mt-ticket-locked-msg {
  padding: 8px 12px;
  font-size: 0.7rem; color: var(--text-faint);
  display: flex; align-items: center; gap: 6px;
  font-style: italic;
}
 
/* Footer */
.mt-modal-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
 
.mt-add-round-btn {
  width: 100%; height: 46px;
  background: var(--accent);
  border-radius: var(--r-md); color: #000;
  font-family: var(--font-heading); font-size: 0.9rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background var(--t-fast), transform var(--t-fast);
}
.mt-add-round-btn:hover { background: var(--accent-dim); }
.mt-add-round-btn:active { transform: scale(0.98); }
