/* Crispy Crust POS Industrial Touch Design System */
/* Dark Charcoal, Crimson Red, Cheddar Gold, Forest Green */
/* ZERO UNICODE EMOJIS - STRICT SVG STANDARD */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&family=JetBrains+Mono:wght@400;600;700&display=swap');

:root {
  --bg-primary: #0a0c10;
  --bg-surface: #12151c;
  --bg-card: #181c26;
  --bg-card-hover: #1f2432;
  --bg-overlay: rgba(10, 12, 16, 0.85);

  --border-color: #272d3d;
  --border-focus: #e53e3e;

  --text-main: #f7fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-red: #e53e3e;
  --accent-red-hover: #c53030;
  --accent-gold: #ecc94b;
  --accent-gold-dark: #b7791f;
  --accent-green: #38a169;
  --accent-green-hover: #2f855a;
  --accent-blue: #3182ce;

  --font-arabic: 'Cairo', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  font-family: var(--font-arabic);
  direction: rtl;
  background-color: var(--bg-primary);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Header & Navigation Bar */
.pos-navbar {
  height: 64px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 100;
  flex-shrink: 0;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  height: 42px;
  width: auto;
  object-fit: contain;
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.brand-text p {
  font-size: 0.75rem;
  color: var(--accent-gold);
  font-weight: 600;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-primary);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.nav-tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-arabic);
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-tab-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.nav-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab-btn.active {
  background: var(--accent-red);
  color: #fff;
  box-shadow: 0 2px 8px rgba(229, 62, 62, 0.4);
}

.nav-tab-btn .badge-pill {
  background: rgba(0,0,0,0.3);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-family: var(--font-mono);
}

.header-status-panel {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(56, 161, 105, 0.15);
  color: #68d391;
  border: 1px solid rgba(56, 161, 105, 0.3);
}

.status-badge .indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

.clock-display {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-gold);
  font-weight: 700;
}

/* App View Container */
.main-view-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.view-panel {
  position: absolute;
  inset: 0;
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.view-panel.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  width: 100%;
  min-height: calc(100vh - 75px);
  position: relative;
}

/* ==========================================================
   VIEW 1: CASHIER POS (#tab-pos)
   ========================================================== */
.pos-layout {
  display: flex;
  width: 100%;
  height: 100%;
}

/* POS Left: Sticky Order Cart (35%) */
.pos-cart-panel {
  width: 35%;
  min-width: 380px;
  max-width: 440px;
  height: 100%;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.cart-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.order-type-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--bg-primary);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-top: 0.5rem;
}

.order-type-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.25rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-arabic);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.order-type-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.order-type-btn.active {
  background: var(--bg-card);
  color: var(--accent-gold);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.delivery-fields {
  display: none;
  padding: 0.75rem 1.25rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  gap: 0.5rem;
  flex-direction: column;
}

.delivery-fields.visible {
  display: flex;
}

.delivery-input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-arabic);
  font-size: 0.82rem;
}

.delivery-input:focus {
  outline: none;
  border-color: var(--accent-gold);
}

.cart-items-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.cart-item-row {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: border-color 0.15s;
}

.cart-item-row:hover {
  border-color: var(--accent-red);
}

.cart-item-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.cart-item-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.cart-item-pref {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  margin-top: 2px;
  display: inline-block;
}

.cart-item-pref.spicy {
  background: rgba(229, 62, 62, 0.2);
  color: #fc8181;
}

.cart-item-pref.regular {
  background: rgba(236, 201, 75, 0.2);
  color: #f6e05e;
}

.cart-item-price {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-gold);
}

.cart-item-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.4rem;
}

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: var(--font-mono);
  font-weight: 700;
}

.qty-btn:active {
  background: var(--accent-red);
}

.qty-number {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  min-width: 20px;
  text-align: center;
}

.cart-item-delete {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
}

.cart-item-delete:hover {
  color: var(--accent-red);
}

.cart-item-delete svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* Quick Upsell Bar */
.cart-upsell-bar {
  padding: 0.5rem 1.25rem;
  background: rgba(236, 201, 75, 0.05);
  border-top: 1px solid rgba(236, 201, 75, 0.2);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
}

.upsell-chip {
  padding: 4px 10px;
  background: var(--bg-card);
  border: 1px solid rgba(236, 201, 75, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-gold);
  white-space: nowrap;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.upsell-chip:hover {
  background: var(--accent-gold);
  color: #000;
}

/* Cart Footer & Payment */
.cart-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.cart-summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.cart-summary-line.total {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text-main);
  border-top: 1px solid var(--border-color);
  padding-top: 0.5rem;
}

.cart-summary-line .amount {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-gold);
}

/* Cash Denominations */
.cash-tender-row {
  display: flex;
  gap: 6px;
  margin-top: 0.2rem;
}

.cash-chip {
  flex: 1;
  padding: 6px 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.cash-chip:active {
  background: var(--accent-green);
  color: #fff;
}

.change-due-box {
  background: rgba(56, 161, 105, 0.15);
  border: 1px dashed var(--accent-green);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #68d391;
}

.change-due-box .val {
  font-family: var(--font-mono);
  font-size: 1rem;
}

/* Payment Methods Grid */
.payment-methods-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.pay-method-btn {
  padding: 0.6rem 0.2rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-arabic);
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.pay-method-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.pay-method-btn.active {
  background: rgba(229, 62, 62, 0.2);
  color: #fff;
  border-color: var(--accent-red);
}

.btn-checkout-print {
  width: 100%;
  padding: 0.9rem;
  background: linear-gradient(135deg, var(--accent-red), #b91c1c);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-arabic);
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: 0 4px 14px rgba(229, 62, 62, 0.4);
  transition: transform 0.1s ease, filter 0.15s;
}

.btn-checkout-print:active {
  transform: scale(0.98);
}

.btn-checkout-print svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* POS Right: Menu Grid & Quick Bar (65%) */
.pos-menu-panel {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  overflow: hidden;
}

.menu-top-toolbar {
  padding: 1rem 1.5rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 1rem;
  align-items: center;
}

.search-input-box {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-box svg {
  position: absolute;
  right: 12px;
  width: 18px;
  height: 18px;
  stroke: var(--text-dim);
  fill: none;
  stroke-width: 2;
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 0.6rem 2.4rem 0.6rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-arabic);
  font-size: 0.9rem;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-red);
}

.category-filter-pills {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.75rem 1.5rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.cat-pill {
  padding: 0.45rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-family: var(--font-arabic);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.cat-pill:hover {
  color: var(--text-main);
  border-color: var(--accent-gold);
}

.cat-pill.active {
  background: var(--accent-gold);
  color: #000;
  border-color: var(--accent-gold);
}

.menu-items-grid {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  align-content: flex-start;
}

.menu-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, border-color 0.15s;
}

.menu-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-gold);
  box-shadow: var(--shadow-md);
}

.menu-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.menu-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
}

.menu-card-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: rgba(56, 161, 105, 0.2);
  color: #68d391;
  white-space: nowrap;
}

.menu-card-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  flex: 1;
}

.menu-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.6rem;
}

.menu-card-price {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.flavor-toggle-btn {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.flavor-toggle-btn.spicy {
  background: rgba(229, 62, 62, 0.2);
  color: #fc8181;
  border-color: var(--accent-red);
}

/* ==========================================================
   VIEW 2: KITCHEN DISPLAY SYSTEM (#tab-kds)
   ========================================================== */
.kds-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #0d0f15;
  overflow: hidden;
}

.kds-toolbar {
  padding: 0.75rem 1.5rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kds-stats-row {
  display: flex;
  gap: 1.5rem;
}

.kds-stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.kds-stat-item .count {
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.kds-stat-item.cooking .count {
  background: rgba(236, 201, 75, 0.2);
  color: var(--accent-gold);
}

.kds-stat-item.ready .count {
  background: rgba(56, 161, 105, 0.2);
  color: #68d391;
}

.kds-grid {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  align-content: flex-start;
}

.kds-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s;
}

.kds-card.status-cooking {
  border-color: var(--accent-gold);
}

.kds-card.status-ready {
  border-color: var(--accent-green);
}

.kds-card-header {
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kds-order-num {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--text-main);
}

.kds-order-type-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--accent-gold);
}

.kds-timer-badge {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.kds-timer-badge.green {
  background: rgba(56, 161, 105, 0.2);
  color: #68d391;
}

.kds-timer-badge.amber {
  background: rgba(236, 201, 75, 0.2);
  color: var(--accent-gold);
}

.kds-timer-badge.red {
  background: rgba(229, 62, 62, 0.2);
  color: #fc8181;
  animation: pulse-red 1s infinite alternate;
}

@keyframes pulse-red {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

.kds-card-body {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.kds-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 700;
  padding-bottom: 0.4rem;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}

.kds-item-name {
  color: var(--text-main);
}

.kds-item-qty {
  font-family: var(--font-mono);
  color: var(--accent-gold);
  font-size: 1.05rem;
}

.kds-frying-hint {
  margin-top: 0.5rem;
  background: rgba(229, 62, 62, 0.1);
  border: 1px solid rgba(229, 62, 62, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  color: #feb2b2;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.kds-frying-hint svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

.kds-card-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
}

.btn-kds-advance {
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-arabic);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.15s ease;
}

.btn-kds-advance.cooking {
  background: var(--accent-green);
  color: #fff;
  box-shadow: 0 2px 8px rgba(56, 161, 105, 0.4);
}

.btn-kds-advance.ready {
  background: var(--accent-blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(49, 130, 206, 0.4);
}

.btn-kds-advance svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ==========================================================
   VIEW 3: SELF-ORDERING KIOSK (#tab-kiosk)
   ========================================================== */
.kiosk-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #080a0f;
  position: relative;
  overflow: hidden;
}

.kiosk-hero-banner {
  background: linear-gradient(135deg, #1a202c, #0f1117);
  border-bottom: 2px solid var(--accent-red);
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kiosk-hero-title h2 {
  font-size: 1.5rem;
  font-weight: 900;
  color: #fff;
}

.kiosk-hero-title p {
  color: var(--accent-gold);
  font-size: 0.88rem;
  font-weight: 700;
}

.kiosk-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.kiosk-category-sidebar {
  width: 220px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.kiosk-cat-btn {
  padding: 1rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: var(--font-arabic);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: all 0.15s ease;
}

.kiosk-cat-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.kiosk-cat-btn.active {
  background: var(--accent-red);
  color: #fff;
  border-color: var(--accent-red);
  box-shadow: 0 4px 12px rgba(229, 62, 62, 0.4);
}

.kiosk-items-area {
  flex: 1;
  padding: 1.5rem 2rem;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  align-content: flex-start;
}

.kiosk-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
}

.kiosk-bottom-bar {
  height: 80px;
  background: var(--bg-surface);
  border-top: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
}

.kiosk-cart-summary-text {
  font-size: 1.1rem;
  font-weight: 800;
}

.kiosk-cart-summary-text .amount {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: var(--accent-gold);
}

.btn-kiosk-checkout {
  padding: 0.9rem 2.5rem;
  background: var(--accent-green);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-arabic);
  font-size: 1.15rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 4px 14px rgba(56, 161, 105, 0.4);
}

.btn-kiosk-checkout svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ==========================================================
   VIEW 4: INVENTORY & TRANSFERS (#tab-inventory)
   ========================================================== */
.inventory-container {
  width: 100%;
  height: 100%;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.scanner-toolbar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.scanner-input-row {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.scanner-input-field {
  flex: 1;
  background: var(--bg-primary);
  border: 2px dashed var(--accent-gold);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 1rem;
}

.scanner-input-field:focus {
  outline: none;
  border-style: solid;
}

.btn-scanner-action {
  padding: 0.75rem 1.5rem;
  background: var(--accent-red);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-arabic);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.btn-scanner-action.secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-scanner-action.secondary:hover {
  border-color: var(--accent-gold);
}

.btn-scanner-action svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.inventory-tables-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 1.5rem;
}

.data-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.data-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.data-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.data-card-title svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent-gold);
  fill: none;
  stroke-width: 2;
}

.pos-table-wrapper {
  overflow-x: auto;
}

.pos-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: right;
}

.pos-table th {
  padding: 0.6rem 0.75rem;
  background: var(--bg-card);
  color: var(--text-muted);
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
}

.pos-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.pos-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.stock-badge {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.stock-badge.optimal {
  background: rgba(56, 161, 105, 0.2);
  color: #68d391;
}

.stock-badge.low {
  background: rgba(229, 62, 62, 0.2);
  color: #fc8181;
}

/* ==========================================================
   VIEW 5: DISPATCH & LIVE GPS MAP (#tab-dispatch)
   ========================================================== */
.dispatch-container {
  width: 100%;
  height: 100%;
  display: flex;
  position: relative;
  overflow: hidden;
  background: var(--bg-primary);
}

.map-sidebar {
  width: 380px;
  min-width: 320px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  z-index: 10;
}

.map-viewport {
  flex: 1;
  height: 100%;
  min-height: 400px;
  background: #111;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1rem;
}

#leaflet-map, #dispatch-map, #fleet-map, .dispatch-map-container {
  height: 100%;
  min-height: 400px;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: #1a1a1a;
  border: 1px solid var(--border-color);
}

.leaflet-tile-pane {
  filter: brightness(0.6) invert(1) contrast(3) hue-rotate(200deg) saturate(0.3) brightness(0.7);
}

.driver-status-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.driver-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.driver-name {
  font-size: 0.95rem;
  font-weight: 800;
}

.driver-status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.driver-status-pill.on_delivery {
  background: rgba(236, 201, 75, 0.2);
  color: var(--accent-gold);
}

.driver-status-pill.available {
  background: rgba(56, 161, 105, 0.2);
  color: #68d391;
}

.driver-stats-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.driver-stats-row .val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-main);
}

.btn-settle-custody {
  padding: 0.45rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--accent-green);
  font-family: var(--font-arabic);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 0.3rem;
  text-align: center;
}

.btn-settle-custody:hover {
  background: var(--accent-green);
  color: #fff;
}

/* ==========================================================
   VIEW 6: END OF SHIFT Z-REPORT (#tab-zreport)
   ========================================================== */
.zreport-container {
  width: 100%;
  height: 100%;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.kpi-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.kpi-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 700;
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.kpi-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.zreport-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.actual-cash-input-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.variance-alert-badge {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.variance-alert-badge.match {
  background: rgba(56, 161, 105, 0.15);
  border: 1px solid var(--accent-green);
  color: #68d391;
}

.variance-alert-badge.discrepancy {
  background: rgba(229, 62, 62, 0.15);
  border: 1px solid var(--accent-red);
  color: #fc8181;
}

.btn-submit-zreport {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--accent-red), #9b2c2c);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-arabic);
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  box-shadow: 0 4px 14px rgba(229, 62, 62, 0.4);
}

.btn-submit-zreport svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-overlay.open {
  display: flex;
}

.modal-content-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 520px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
}

.modal-close-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* 80mm ESC/POS Thermal Receipt Layout */
#receipt-print-zone {
  display: none;
}

@media print {
  body * {
    visibility: hidden;
  }
  #receipt-print-zone, #receipt-print-zone * {
    visibility: visible;
  }
  #receipt-print-zone {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 72mm;
    margin: 0;
    padding: 2mm;
    color: #000;
    background: #fff;
    font-family: 'Cairo', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.3;
    direction: rtl;
  }
  .receipt-logo {
    display: block;
    margin: 0 auto 6px auto;
    max-width: 48mm;
    filter: grayscale(100%) contrast(150%);
  }
  .receipt-header-center {
    text-align: center;
    border-bottom: 1px dashed #000;
    padding-bottom: 6px;
    margin-bottom: 6px;
  }
  .receipt-order-box {
    border: 2px solid #000;
    padding: 6px;
    text-align: center;
    font-size: 20px;
    font-weight: 900;
    margin: 6px 0;
  }
  .receipt-table {
    width: 100%;
    border-collapse: collapse;
    margin: 6px 0;
    font-size: 11px;
  }
  .receipt-table th {
    border-bottom: 1px solid #000;
    padding: 3px 0;
    text-align: right;
  }
  .receipt-table td {
    padding: 3px 0;
  }
  .receipt-summary-block {
    border-top: 1px dashed #000;
    padding-top: 6px;
    margin-top: 6px;
  }
  .receipt-barcode-svg {
    display: block;
    margin: 8px auto 0 auto;
    width: 50mm;
    height: 15mm;
  }
}
