/* Corner Counter POS — Blue & White Enterprise Point of Sale Design System */
:root {
  /* Default Blue & White Theme (Clean, Crisp, Professional) */
  --bg: #f8fafc;
  --bg-subtle: #f1f5f9;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-hover: #eff6ff;
  --surface-active: #dbeafe;
  --border: #cbd5e1;
  --border-focus: #2563eb;
  --border-light: #e2e8f0;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  /* Blue Palette */
  --blue-brand: #1d4ed8;
  --blue-primary: #2563eb;
  --blue-dark: #1e40af;
  --blue-navy: #1e3a8a;
  --blue-light: #3b82f6;
  --blue-subtle: #eff6ff;
  --blue-glow: rgba(37, 99, 235, 0.25);

  --teal: #0d9488;
  --teal-light: #14b8a6;
  --teal-glow: rgba(13, 148, 136, 0.25);
  --money-green: #059669;
  --money-green-subtle: #ecfdf5;
  --money-green-glow: rgba(5, 150, 105, 0.2);

  --emerald: #1d4ed8;
  --emerald-light: #2563eb;
  --emerald-glow: rgba(37, 99, 235, 0.25);
  --cyan: #2563eb;
  --cyan-glow: rgba(37, 99, 235, 0.25);
  --amber: #d97706;
  --amber-glow: rgba(217, 119, 6, 0.18);
  --rose: #e11d48;
  --rose-glow: rgba(225, 29, 72, 0.18);
  --violet: #6366f1;
  --indigo: #4f46e5;

  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px rgba(37, 99, 235, 0.08), 0 2px 6px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 12px 32px rgba(37, 99, 235, 0.12), 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 0 24px var(--blue-glow);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

[data-theme="dark"] {
  /* Deep Navy Blue & White Theme */
  --bg: #0a1128;
  --bg-subtle: #111d40;
  --surface: #14214d;
  --surface-raised: #1c2e68;
  --surface-hover: #243b82;
  --surface-active: #2f4ba3;
  --border: rgba(96, 165, 250, 0.25);
  --border-focus: #60a5fa;
  --border-light: rgba(255, 255, 255, 0.1);

  --text-primary: #ffffff;
  --text-secondary: #e2e8f0;
  --text-muted: #93c5fd;
  --text-inverse: #0a1128;

  --blue-brand: #3b82f6;
  --blue-primary: #60a5fa;
  --blue-dark: #2563eb;
  --blue-navy: #1e3a8a;
  --blue-light: #93c5fd;
  --blue-subtle: rgba(59, 130, 246, 0.15);
  --blue-glow: rgba(96, 165, 250, 0.35);

  --teal: #2dd4bf;
  --teal-light: #5eead4;
  --teal-glow: rgba(45, 212, 191, 0.3);
  --money-green: #34d399;
  --money-green-subtle: rgba(52, 211, 153, 0.15);
  --money-green-glow: rgba(52, 211, 153, 0.3);

  --emerald: #3b82f6;
  --emerald-light: #60a5fa;
  --emerald-glow: rgba(59, 130, 246, 0.3);
  --cyan: #60a5fa;
  --cyan-glow: rgba(96, 165, 250, 0.3);
  --amber: #fbbf24;
  --amber-glow: rgba(251, 191, 36, 0.25);
  --rose: #f43f5e;
  --rose-glow: rgba(244, 63, 94, 0.25);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 24px var(--blue-glow);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  overflow: hidden;
}

/* Cosmic Continuous Starfield Canvas */
.cosmic-stars-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.95;
}

/* Crisp Clean Look: Hide starfield in light mode */
body:not([data-theme="dark"]) .cosmic-stars-canvas,
[data-theme="light"] .cosmic-stars-canvas {
  display: none !important;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
  border: none;
  background: none;
}

button {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast), background var(--transition-fast), opacity var(--transition-fast), box-shadow var(--transition-fast);
}

button:active {
  transform: scale(0.96);
}

input, select {
  outline: none;
}

/* App Root Shell */
#app {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background: transparent;
  margin: 0 auto;
  max-width: 1600px;
  z-index: 2;
}

@media (max-width: 859px) {
  #app {
    max-width: 100%;
  }
}

/* Top App Header — Signature Royal Blue & White */
.header {
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 55%, #2563eb 100%);
  border-bottom: 2px solid rgba(255, 255, 255, 0.18);
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 18px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-shrink: 0;
  z-index: 25;
  box-shadow: 0 4px 20px rgba(30, 58, 138, 0.25);
  color: #ffffff;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-logo-badge {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.header-logo-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.header-title-wrap {
  display: flex;
  flex-direction: column;
}

.header-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.02em;
}

.header-store-badge {
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.header-subinfo {
  font-size: 11px;
  color: #bfdbfe;
  font-family: var(--font-mono);
  margin-top: 1px;
}

/* Primary Header Navigation Bar (Desktop & Tablet) */
.header-nav {
  display: none;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.28);
  padding: 4px 6px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

@media (min-width: 860px) {
  .header-nav {
    display: flex;
  }
}

.header-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 600;
  color: #dbeafe;
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
  border: 1px solid transparent;
}

.header-nav-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
}

.header-nav-btn.active {
  background: #ffffff;
  color: #1d4ed8;
  font-weight: 700;
  border-color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.header-nav-btn.active svg {
  stroke: #1d4ed8;
}

.nav-tab-badge {
  font-size: 10px;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  margin-left: 2px;
}

.header-nav-btn.active .nav-tab-badge {
  background: #1d4ed8;
  color: #ffffff;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-action-btn.scan-shortcut-btn {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: #ffffff;
  border: none;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

@media (min-width: 600px) {
  .header-action-btn.scan-shortcut-btn {
    display: inline-flex;
  }
}

.header-action-btn.scan-shortcut-btn:hover {
  background: #eff6ff;
  color: #1e40af;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

/* Quick Action Icons */
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}

.icon-btn.active {
  color: #1d4ed8;
  border-color: #ffffff;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-pill.online {
  background: var(--emerald-glow);
  color: var(--emerald-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-pill.offline {
  background: var(--rose-glow);
  color: var(--rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.status-pill.cloud-synced {
  background: rgba(6, 182, 212, 0.15);
  color: var(--cyan);
  border: 1px solid rgba(6, 182, 212, 0.35);
  cursor: pointer;
}

.status-pill.cloud-pending {
  background: var(--amber-glow);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.4);
  cursor: pointer;
  animation: pulseAmber 2s infinite;
}

.status-pill.cloud-syncing {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.logout-btn {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.15), rgba(244, 63, 94, 0.08));
  color: var(--rose);
  border: 1.5px solid rgba(244, 63, 94, 0.4);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  transition: all var(--transition-fast);
  cursor: pointer;
  width: 100%;
}

.logout-btn:hover {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.25), rgba(244, 63, 94, 0.15));
  color: #ff6b82;
  border-color: rgba(244, 63, 94, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.2);
}

.logout-btn:active {
  transform: translateY(0);
}

/* Mobile Responsive Optimization for Header & Action Buttons */
@media (max-width: 600px) {
  .header {
    padding: calc(env(safe-area-inset-top, 0px) + 8px) 10px 8px;
    gap: 6px;
    flex-wrap: wrap;
  }

  .header-brand {
    gap: 6px;
    min-width: 0;
    flex-shrink: 1;
    overflow: hidden;
  }

  .header-logo-badge {
    width: 32px;
    height: 32px;
  }

  .header-title-wrap {
    max-width: 110px;
    min-width: 0;
  }

  .header-title {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-subinfo {
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-actions {
    gap: 5px;
    flex: 1;
    justify-content: flex-end;
    flex-wrap: wrap;
    align-content: center;
  }

  .install-app-btn {
    padding: 5px 9px;
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .install-app-btn span {
    display: none;
  }

  .icon-btn {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
  }

  .icon-btn svg {
    width: 15px;
    height: 15px;
  }

  .status-pill {
    padding: 4px 7px;
    font-size: 10px;
    flex-shrink: 0;
  }

  .status-pill span {
    display: none;
  }

  .logout-btn {
    padding: 5px 10px;
    font-size: 11px;
    flex-shrink: 0;
    white-space: nowrap;
  }
}

/* Extra-small devices (narrow phones) */
@media (max-width: 400px) {
  .header {
    padding: calc(env(safe-area-inset-top, 0px) + 6px) 8px 6px;
    gap: 4px;
  }

  .header-logo-badge {
    width: 28px;
    height: 28px;
  }

  .header-title-wrap {
    max-width: 90px;
  }

  .header-title {
    font-size: 12px;
  }

  .header-subinfo {
    font-size: 9px;
  }

  .header-actions {
    gap: 4px;
  }

  .install-app-btn {
    padding: 4px 7px;
    font-size: 10px;
  }

  .icon-btn {
    width: 28px;
    height: 28px;
  }

  .icon-btn svg {
    width: 14px;
    height: 14px;
  }

  .status-pill {
    padding: 3px 6px;
    font-size: 9px;
  }

  .logout-btn {
    padding: 4px 8px;
    font-size: 10px;
  }
}

@media (max-width: 500px) {
  .toolbar-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .search-box {
    flex: 1 1 100%;
    padding: 8px 12px;
  }

  .search-box input {
    font-size: 13px;
  }

  .toolbar-row .pill-btn {
    flex: 1;
    justify-content: center;
    padding: 8px 12px;
    font-size: 12px;
    white-space: nowrap;
  }
}

/* Main Workspace Layout (Adaptive Dual-Pane for Desktop/Tablet & Scrollable Mobile) */
.body-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: scroll !important;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 110px);
  display: flex;
  flex-direction: column;
}

@media (max-width: 859px) {
  .pos-dual-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 0;
  }

  .pos-catalog-pane {
    padding: 12px 14px 28px;
    width: 100%;
  }

  .pos-order-pane {
    display: none;
  }
}

@media (min-width: 860px) {
  .body-scroll {
    padding-bottom: 0;
    overflow: hidden;
  }

  .pos-dual-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    height: 100%;
    overflow: hidden;
  }

  .pos-catalog-pane {
    height: 100%;
    overflow-y: auto;
    padding: 20px;
    border-right: 1px solid var(--border);
    -webkit-overflow-scrolling: touch;
  }

  .pos-order-pane {
    height: 100%;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
}

@media (min-width: 1100px) {
  .pos-dual-container {
    grid-template-columns: 1fr 420px;
  }
}

.screen {
  padding: 16px;
  flex: 1;
}

/* Search & Top Toolbar */
.toolbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.search-box {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-box:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--cyan-glow);
}

.search-box input {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-icon {
  color: var(--text-muted);
  display: flex;
}

/* Category Filter Chips */
.category-chips-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 16px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.category-chips-bar::-webkit-scrollbar {
  display: none;
}

.category-chip {
  padding: 7px 14px;
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.category-chip:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.category-chip.active {
  background: linear-gradient(135deg, #1e40af, #2563eb);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.category-chip-count {
  font-size: 10px;
  opacity: 0.8;
  background: rgba(0, 0, 0, 0.2);
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

/* Starred Favorites Row */
.favorites-section {
  margin-bottom: 16px;
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.favorites-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.favorites-strip::-webkit-scrollbar {
  display: none;
}

.fav-tile {
  min-width: 100px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex-shrink: 0;
}

.fav-tile:hover {
  border-color: var(--amber);
  transform: translateY(-2px);
}

.fav-tile .fav-icon {
  font-size: 22px;
  margin-bottom: 4px;
}

.fav-tile .fav-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}

.fav-tile .fav-price {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--blue-brand);
  font-weight: 700;
}

/* Product Catalog Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

@media (min-width: 600px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 14px;
  }
}

.product-tile {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  text-align: left;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.product-tile:hover {
  border-color: var(--border-focus);
  background: var(--surface-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.12);
}

.product-tile:active, .product-tile.pulse {
  transform: scale(0.93);
  border-color: var(--blue-brand);
  box-shadow: 0 0 16px var(--blue-glow);
}

.product-tile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.product-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--blue-subtle);
  color: var(--blue-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.stock-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stock-badge.low {
  background: var(--rose-glow);
  color: var(--rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.stock-badge.unlimited {
  background: var(--blue-subtle);
  color: var(--blue-brand);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.star-toggle-btn {
  color: var(--text-muted);
  padding: 4px;
  border-radius: var(--radius-full);
}

.star-toggle-btn.starred {
  color: var(--amber);
}

.product-name {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 6px;
}

.product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.product-price {
  font-family: var(--font-mono);
  color: var(--blue-brand);
  font-size: 15px;
  font-weight: 800;
}

.product-add-badge {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  background: var(--blue-subtle);
  color: var(--blue-brand);
  border: 1px solid rgba(37, 99, 235, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.product-tile:hover .product-add-badge {
  background: var(--blue-brand);
  color: #fff;
  border-color: var(--blue-brand);
}

/* Quick Custom Item Tile */
.custom-item-tile {
  border: 2px dashed var(--border);
  background: var(--surface);
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 130px;
}

.custom-item-tile:hover {
  border-color: var(--blue-primary);
  background: var(--blue-subtle);
}

.custom-item-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--blue-subtle);
  color: var(--blue-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.custom-item-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-brand);
}

/* Parked Tabs / Order Tabs Bar */
.order-tabs-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.order-tabs-bar::-webkit-scrollbar {
  display: none;
}

.order-tab {
  padding: 6px 12px;
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.order-tab.active {
  background: var(--blue-brand);
  color: #fff;
  border-color: var(--blue-brand);
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.35);
}

.order-tab-add-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px dashed var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.order-tab-add-btn:hover {
  color: var(--cyan);
  border-color: var(--cyan);
}

/* Order Ledger in Desktop/Tablet Right Pane & Mobile Drawer */
.order-ledger-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.order-ledger-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-items-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.cart-row:hover {
  border-color: var(--border-light);
}

.cart-row-icon {
  font-size: 22px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cart-row-info {
  flex: 1;
  min-width: 0;
}

.cart-row-name {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-row-note {
  font-size: 11px;
  color: var(--amber);
  font-style: italic;
  margin-top: 1px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.cart-row-unit {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 11px;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.stepper-btn {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--surface-raised);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stepper-btn:hover {
  background: var(--surface-hover);
}

.stepper-qty {
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}

.remove-btn {
  color: var(--rose);
  padding: 6px;
  border-radius: var(--radius-sm);
}

.remove-btn:hover {
  background: var(--rose-glow);
}

/* Order Adjustments (Discounts, Tips, Taxes) */
.order-modifiers-section {
  padding: 10px 16px;
  background: var(--surface-raised);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modifier-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modifier-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.modifier-pills {
  display: flex;
  gap: 4px;
}

.mod-pill {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.mod-pill.active {
  background: var(--amber);
  color: #000;
  border-color: var(--amber);
  font-weight: 700;
}

/* Order Totals Summary Footer */
.order-summary-footer {
  padding: 14px 18px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

.summary-line.tax, .summary-line.discount, .summary-line.tip {
  font-family: var(--font-mono);
}

.summary-line.discount {
  color: var(--rose);
}

.summary-line.tip {
  color: var(--amber);
}

.summary-total-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px dashed var(--border);
}

.summary-total-label {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.summary-total-value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 800;
  color: var(--emerald-light);
}

.checkout-action-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.btn-park-tab {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.btn-charge-now {
  flex: 1;
  padding: 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}

.btn-charge-now:hover {
  background: linear-gradient(135deg, #3b82f6, #1e40af);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.btn-charge-now[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

/* Mobile Sticky Cart Action Bar */
.cart-bar {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 72px);
  background: linear-gradient(135deg, #1e40af, #2563eb);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.4);
  z-index: 20;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  animation: slideUp 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.cart-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cart-count {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-bar-label {
  font-size: 14px;
  font-weight: 700;
}

.cart-bar-total {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
}

/* Bottom Navigation Dock (Mobile & Compact View) */
.bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(env(safe-area-inset-bottom, 0px) + 62px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 24;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] .bottom-nav {
  background: rgba(20, 33, 77, 0.98);
  border-top: 1px solid rgba(96, 165, 250, 0.25);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

@media (min-width: 860px) {
  .bottom-nav {
    display: none !important;
  }
}

.bottom-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 100%;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  transition: all var(--transition-fast);
  position: relative;
  border-radius: var(--radius-md);
  margin: 4px 2px;
}

.bottom-nav-btn:hover {
  color: var(--blue-brand);
}

.bottom-nav-btn.active {
  color: var(--blue-brand);
}

.bottom-nav-btn.active .bottom-nav-icon-wrap {
  transform: translateY(-2px);
  filter: drop-shadow(0 0 8px var(--blue-glow));
}

.bottom-nav-btn.active::after {
  content: '';
  position: absolute;
  top: 0;
  width: 28px;
  height: 3px;
  border-radius: var(--radius-full);
  background: var(--blue-brand);
  box-shadow: 0 0 8px var(--blue-glow);
}

.bottom-nav-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast);
}

.bottom-nav-icon-wrap svg {
  width: 18px;
  height: 18px;
}

.bottom-nav-badge {
  position: absolute;
  top: -4px;
  right: -9px;
  background: var(--rose);
  color: #fff;
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: 800;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  line-height: 1.2;
}

.bottom-nav-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Modals & Overlays */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}

@media (min-width: 640px) {
  .overlay {
    justify-content: center;
    padding: 20px;
  }
}

.overlay-scrim {
  position: absolute;
  inset: 0;
  background: rgba(9, 13, 22, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.sheet {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  z-index: 101;
  animation: sheetPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 640px) {
  .sheet {
    border-radius: var(--radius-xl);
    padding-bottom: 16px;
    max-height: 85vh;
  }
}

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

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sheet-title {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 700;
}

.sheet-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--surface-raised);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sheet-close:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.sheet-body {
  overflow-y: auto;
  padding: 16px 20px;
  flex: 1;
}

.sheet-footer {
  padding: 14px 20px 6px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Payment Method Tabs & Checkout UI */
.payment-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 18px;
  background: var(--surface-raised);
  padding: 4px;
  border-radius: var(--radius-md);
}

.payment-tab-btn {
  padding: 9px 4px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.payment-tab-btn.active {
  background: var(--blue-primary);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px var(--blue-glow);
}

.due-block {
  text-align: center;
  margin-bottom: 18px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
}

.due-label {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 4px;
}

.due-amount {
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-size: 34px;
  font-weight: 800;
}

.quick-amounts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.quick-amt-btn {
  background: var(--surface-raised);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 4px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
}

.quick-amt-btn:hover {
  background: var(--surface-hover);
  border-color: var(--cyan);
}

.cash-row {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.cash-row-label {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.cash-input {
  flex: 1;
  text-align: right;
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 700;
  background: transparent;
}

.change-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px;
  margin-bottom: 14px;
}

.change-label {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.change-value {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
}

.change-value.ok {
  color: var(--emerald-light);
}

.change-value.short {
  color: var(--rose);
}

/* Card Terminal Simulator */
.card-terminal-box {
  background: var(--surface-raised);
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.nfc-wave-ring {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background: var(--cyan-glow);
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: pulseRing 1.8s infinite;
}

@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.4); }
  70% { box-shadow: 0 0 0 18px rgba(6, 182, 212, 0); }
  100% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0); }
}

.terminal-prompt {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.terminal-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-simulate-tap {
  padding: 12px 24px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--cyan), var(--emerald));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 14px var(--cyan-glow);
}

/* QR Code Payment Simulation */
.qr-payment-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding: 16px 0;
}

.qr-code-frame {
  background: #fff;
  padding: 16px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.btn-teal {
  width: 100%;
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 14px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--emerald), #059669);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px var(--emerald-glow);
}

.btn-teal:hover {
  background: linear-gradient(135deg, var(--emerald-light), var(--emerald));
}

.btn-teal[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

/* Forms & Inputs */
.form-field {
  display: block;
  margin-bottom: 14px;
}

.form-label {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.form-input {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-size: 14px;
  color: var(--text-primary);
  transition: all var(--transition-normal);
}

[data-theme="dark"] .form-input {
  background: rgba(31, 41, 55, 0.8);
  border-color: rgba(96, 165, 250, 0.2);
}

.form-input:focus {
  border-color: var(--border-focus);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--blue-glow);
  outline: none;
}

[data-theme="dark"] .form-input:focus {
  background: rgba(31, 41, 55, 0.95);
  box-shadow: 0 0 16px rgba(96, 165, 250, 0.2), inset 0 0 0 1px rgba(96, 165, 250, 0.15);
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-field.grow {
  flex: 1;
}

.form-row .form-field.icon-field {
  width: 90px;
}

/* Analytics Dashboard Screen */
.analytics-dashboard {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.timeframe-selector {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.timeframe-pill {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.timeframe-pill.active {
  background: var(--cyan);
  color: #fff;
  border-color: var(--cyan);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 600px) {
  .kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--emerald));
}

.kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

.kpi-sub {
  font-size: 11px;
  color: var(--emerald-light);
}

/* Analytics Chart / Top Sellers */
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.chart-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.chart-card-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.top-seller-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.top-seller-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
}

.top-seller-bar-track {
  height: 8px;
  background: var(--surface-raised);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.top-seller-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--emerald));
  border-radius: var(--radius-full);
  transition: width 0.4s ease-out;
}

/* History Screen */
.history-summary {
  background: linear-gradient(135deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.history-summary-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}

.history-summary-value {
  font-family: var(--font-mono);
  color: var(--money-green);
  font-size: 24px;
  font-weight: 800;
}

.sale-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 8px;
  transition: all var(--transition-fast);
}

.sale-card:hover {
  border-color: var(--border-light);
}

.sale-card-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  text-align: left;
}

.sale-time {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
}

.sale-meta {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 2px;
}

.sale-total {
  font-family: var(--font-mono);
  color: var(--money-green);
  font-size: 15px;
  font-weight: 700;
}

.sale-chevron {
  color: var(--text-muted);
  transition: transform var(--transition-fast);
  margin-left: 8px;
  display: flex;
}

.sale-chevron.open {
  transform: rotate(90deg);
}

.sale-detail {
  border-top: 1px solid var(--border);
  background: var(--surface-raised);
  padding: 12px 16px;
}

.sale-detail-item {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 3px 0;
}

.sale-detail-item span:last-child {
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.sale-detail-foot {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px dashed var(--border);
  padding-top: 8px;
  margin-top: 8px;
  font-family: var(--font-mono);
}

.sale-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* Thermal Receipt Modal & Print View */
.thermal-receipt-container {
  background: #ffffff;
  color: #111827;
  border-radius: var(--radius-md);
  padding: 20px 18px 24px;
  font-family: var(--font-mono);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  position: relative;
  max-width: 320px;
  margin: 0 auto;
}

.receipt-store-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.receipt-divider {
  border-top: 1px dashed #9ca3af;
  margin: 10px 0;
}

.receipt-line {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 2px 0;
}

.receipt-line.total {
  font-size: 15px;
  font-weight: 700;
  border-top: 1px dashed #111827;
  padding-top: 6px;
  margin-top: 6px;
}

.receipt-barcode {
  text-align: center;
  font-size: 26px;
  letter-spacing: 4px;
  margin: 12px 0 6px;
  font-family: monospace;
}

.receipt-footer-text {
  text-align: center;
  font-size: 11px;
  color: #6b7280;
  margin-top: 6px;
}

.receipt-serrated-edge {
  position: absolute;
  bottom: -8px;
  left: 0;
  right: 0;
  height: 8px;
  background-image: radial-gradient(circle at 6px 0, transparent 6px, #ffffff 6px);
  background-size: 12px 12px;
}

/* Toast Notification */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 80px);
  transform: translateX(-50%);
  background: var(--surface-raised);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes toastPop {
  from { transform: translate(-50%, 15px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
  opacity: 0.7;
}

.empty-title {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 700;
}

.empty-body {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  max-width: 280px;
}

/* Products Screen List */
.product-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  text-align: left;
  transition: all var(--transition-fast);
}

.product-list-row:hover {
  border-color: var(--border-focus);
}

.product-list-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.product-list-info {
  flex: 1;
  min-width: 0;
}

.product-list-name {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-list-cat {
  color: var(--text-muted);
  font-size: 12px;
}

.product-list-price {
  font-family: var(--font-mono);
  color: var(--blue-brand);
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}

.product-list-edit {
  color: var(--text-muted);
  flex-shrink: 0;
  display: flex;
}

/* Screen Headers */
.screen-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 10px;
}

.screen-title {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--cyan), var(--emerald));
  color: #fff;
  border-radius: var(--radius-full);
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 10px var(--emerald-glow);
}

.pill-btn:hover {
  background: linear-gradient(135deg, var(--emerald-light), var(--emerald));
}

.btn-teal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--blue-brand), var(--blue-primary));
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 14px var(--blue-glow);
  transition: all var(--transition-fast);
}

.btn-teal:hover {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue-brand));
  box-shadow: 0 6px 20px var(--blue-glow);
  transform: translateY(-1px);
}

.btn-teal:active {
  transform: translateY(0);
}

.btn-teal:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.mini-btn {
  border-radius: var(--radius-full);
  background: var(--surface-raised);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
}

.mini-btn:hover {
  background: var(--surface-hover);
}

.mini-btn.danger {
  color: var(--rose);
}

.text-btn {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.text-btn:hover {
  color: var(--text-primary);
}

.text-btn.danger {
  color: var(--rose);
}

.btn-danger-text {
  width: 100%;
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--rose);
  text-align: center;
}

.btn-danger-text:hover {
  background: var(--rose-glow);
}

/* Company / Admin Screen */
.company-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.company-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.company-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.company-name {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.company-meta {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 3px;
}

.company-actions {
  display: flex;
  gap: 8px;
}

.company-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.company-summary-box {
  background: var(--surface-raised);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.company-summary-box span {
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
}

.company-summary-box strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 16px;
}

.staff-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.staff-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface-raised);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.staff-name {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
}

.staff-user {
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--font-mono);
  margin-top: 1px;
}

.staff-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Login Screen */
.login-screen {
  flex: 1;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 50%, #bfdbfe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

[data-theme="dark"] .login-screen {
  background: radial-gradient(circle at 50% 20%, rgba(96, 165, 250, 0.15) 0%, #0a1128 60%);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: #ffffff;
  border: 2px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  box-shadow: 0 20px 60px rgba(37, 99, 235, 0.15), 0 0 40px rgba(37, 99, 235, 0.05);
}

[data-theme="dark"] .login-card {
  background: rgba(17, 24, 39, 0.95);
  border-color: rgba(96, 165, 250, 0.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(96, 165, 250, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.login-brand-mark {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 2px solid rgba(37, 99, 235, 0.3);
  box-shadow: 0 4px 24px rgba(37, 99, 235, 0.2);
  overflow: hidden;
  flex-shrink: 0;
}

[data-theme="dark"] .login-brand-mark {
  background: rgba(31, 41, 55, 0.8);
  border-color: rgba(96, 165, 250, 0.3);
  box-shadow: 0 4px 24px rgba(96, 165, 250, 0.2);
}

.login-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.login-brand-title {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
}

.login-brand-subtitle {
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

/* PWA install floating button — hidden, install available via sidebar */
.pwa-install {
  display: none !important;
}
.pwa-install.show { display: none !important; }

/* small status pill for storage persistence - HIDDEN */
.storage-status {
  display: none !important;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.login-input {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 14px;
  padding: 12px 14px;
  transition: all var(--transition-normal);
}

[data-theme="dark"] .login-input {
  border-color: rgba(96, 165, 250, 0.25);
  background: rgba(31, 41, 55, 0.8);
}

.login-input:focus {
  border-color: var(--border-focus);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--blue-glow);
  outline: none;
}

[data-theme="dark"] .login-input:focus {
  background: rgba(31, 41, 55, 0.95);
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.2), inset 0 0 0 1px rgba(96, 165, 250, 0.15);
}

.login-btn {
  margin-top: 8px;
  width: 100%;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #fff;
  padding: 14px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all var(--transition-normal);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-btn:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.login-btn:active {
  transform: translateY(0);
}

.login-error {
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: var(--radius-sm);
  font-size: 12px;
  padding: 8px 12px;
  font-weight: 600;
}

[data-theme="dark"] .login-error {
  background: rgba(255, 71, 87, 0.15);
  color: #ff6b7a;
  border-color: rgba(255, 71, 87, 0.3);
}

/* Printing Optimization for 80mm POS Thermal Printers */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }

  #app > *:not(.print-only) {
    display: none !important;
  }

  .print-only {
    display: block !important;
    width: 100% !important;
    max-width: 80mm !important;
    margin: 0 auto !important;
    padding: 0 !important;
  }

  .thermal-receipt-container {
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 80mm !important;
  }

  .receipt-serrated-edge, .sheet-close, .modal-actions {
    display: none !important;
  }
}

/* Subscription Alert Banners — theme-aware */
.subscription-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.4;
  position: relative;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.subscription-banner.warning {
  background: rgba(217, 119, 6, 0.1);
  border: 1px solid rgba(217, 119, 6, 0.35);
  color: #92400e;
}

[data-theme="dark"] .subscription-banner.warning {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
}

.subscription-banner.expired {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: #991b1b;
}

[data-theme="dark"] .subscription-banner.expired {
  background: rgba(244, 63, 94, 0.12);
  color: #fda4af;
}

.subscription-banner.deactivated {
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.4);
  color: #7f1d1d;
}

[data-theme="dark"] .subscription-banner.deactivated {
  background: rgba(244, 63, 94, 0.18);
  color: #fecdd3;
}

.sub-banner-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.sub-banner-content {
  flex: 1;
}

.sub-banner-content strong {
  font-weight: 700;
  display: inline;
}

.company-subscription {
  font-size: 12px;
  margin-top: 6px;
}

.sub-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sub-status-pill.active {
  background: var(--emerald-glow);
  color: var(--emerald-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.sub-status-pill.expiring {
  background: var(--amber-glow);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.4);
  animation: pulseAmber 2s infinite;
}

@keyframes pulseAmber {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.sub-status-pill.expired {
  background: var(--rose-glow);
  color: var(--rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.sub-status-pill.deactivated {
  background: rgba(244, 63, 94, 0.25);
  color: #ff8095;
  border: 1px solid var(--rose);
}

.mini-btn.success {
  color: var(--emerald-light);
  border-color: rgba(16, 185, 129, 0.4);
  background: var(--emerald-glow);
}

.mini-btn.success:hover {
  background: rgba(16, 185, 129, 0.3);
}

.quick-extend-chips {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.quick-extend-btn {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.quick-extend-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--cyan);
}

/* Install App Button & Modal Styles */
.install-app-btn {
  background: linear-gradient(135deg, var(--indigo), var(--cyan));
  color: #ffffff !important;
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  animation: pulseGlow 3s infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35); }
  50% { box-shadow: 0 4px 20px rgba(6, 182, 212, 0.6); }
}

.install-app-btn:hover {
  background: linear-gradient(135deg, var(--cyan), var(--emerald));
  transform: translateY(-1px);
}

.install-steps-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0;
}

.install-step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.install-step-number {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--cyan), var(--emerald));
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.install-step-text {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
}

.install-step-text strong {
  color: var(--cyan);
}

/* ============================================================
 * Bluetooth Printer Styles
 * ============================================================ */

/* Status indicator dot */
.bt-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  transition: background 0.3s;
}

.bt-status-dot.connected {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
  animation: bt-pulse 2s ease-in-out infinite;
}

@keyframes bt-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25); }
  50%       { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.08); }
}

/* Connect button — Bluetooth blue */
.bt-connect-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.4);
  width: 100%;
  justify-content: center;
}

.bt-connect-btn:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.5);
}

.bt-connect-btn:active:not(:disabled) {
  transform: translateY(0);
  opacity: 0.85;
}

/* Disconnect button */
.bt-disconnect-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  width: 100%;
  justify-content: center;
}

.bt-disconnect-btn:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.06);
}

/* Prominent Bluetooth print button in receipt modal */
.bt-print-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 18px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 3px 14px rgba(37, 99, 235, 0.45);
  letter-spacing: 0.01em;
}

.bt-print-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 5px 20px rgba(37, 99, 235, 0.55);
}

.bt-print-btn:active {
  transform: translateY(0);
}

/* Device label inside the BT print button */
.bt-device-label {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.85;
  background: rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 2px 6px;
  margin-left: 2px;
}

/* ================= Sidebar (modern off-canvas nav) ================= */
.hamburger-btn {
  margin-right: 4px;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 89;
  animation: sidebarFadeIn 0.2s ease-out;
}

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

/* Light theme sidebar — blue & white */
.sidebar-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 84vw;
  background: #ffffff;
  border-right: 2px solid rgba(37, 99, 235, 0.15);
  z-index: 90;
  display: flex;
  flex-direction: column;
  box-shadow: 8px 0 40px rgba(37, 99, 235, 0.12), 4px 0 16px rgba(0, 0, 0, 0.06);
  animation: sidebarSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark theme sidebar */
[data-theme="dark"] .sidebar-panel {
  background: linear-gradient(180deg, #111d40 0%, #0a1128 100%);
  border-right: 2px solid rgba(96, 165, 250, 0.18);
  box-shadow: 8px 0 40px rgba(0, 0, 0, 0.5), inset 1px 0 0 rgba(96, 165, 250, 0.08);
}

@keyframes sidebarSlideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

/* Light sidebar header */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(37, 99, 235, 0.12);
  position: relative;
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 55%, #2563eb 100%);
}

[data-theme="dark"] .sidebar-header {
  background: linear-gradient(135deg, #0a1128 0%, #111d40 100%);
  border-bottom-color: rgba(96, 165, 250, 0.18);
}

.sidebar-brand {
  font-weight: 700;
  font-size: 14px;
  color: #ffffff;
  line-height: 1.25;
}

.sidebar-user {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 1px;
}

.sidebar-close {
  position: absolute;
  right: 10px;
  top: 12px;
  color: rgba(255, 255, 255, 0.85) !important;
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

.sidebar-close:hover {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  gap: 3px;
  overflow-y: auto;
}

/* Light sidebar nav buttons */
.sidebar-nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: #334155;
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  transition: all var(--transition-normal);
  position: relative;
  border-left: 3px solid transparent;
}

[data-theme="dark"] .sidebar-nav-btn {
  color: #94a3b8;
}

.sidebar-nav-btn:hover {
  background: #eff6ff;
  color: #1d4ed8;
  padding-left: 16px;
}

[data-theme="dark"] .sidebar-nav-btn:hover {
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
}

.sidebar-nav-btn.active {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: #1d4ed8;
  font-weight: 700;
  border-left: 3px solid #2563eb;
  padding-left: 14px;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}

[data-theme="dark"] .sidebar-nav-btn.active {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.15), rgba(59, 130, 246, 0.1));
  color: #60a5fa;
  border-left: 3px solid #60a5fa;
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.15);
}

.sidebar-nav-btn svg {
  flex-shrink: 0;
}

.sidebar-divider {
  height: 1px;
  background: rgba(37, 99, 235, 0.1);
  margin: 8px 14px;
}

[data-theme="dark"] .sidebar-divider {
  background: rgba(96, 165, 250, 0.12);
}

.sidebar-nav-secondary {
  padding-top: 4px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 16px calc(env(safe-area-inset-bottom, 0px) + 14px);
  border-top: 1px solid rgba(37, 99, 235, 0.1);
  background: #f8fafc;
}

[data-theme="dark"] .sidebar-footer {
  border-top: 1px solid rgba(96, 165, 250, 0.12);
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.3));
}

@media (min-width: 860px) {
  .sidebar-panel { width: 300px; }
}

/* ================= Barcode field + scanner ================= */
.barcode-field-row {
  display: flex;
  gap: 8px;
}
.barcode-field-row .form-input {
  flex: 1;
}
.barcode-field-row .mini-btn {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.barcode-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.barcode-sheet {
  width: 100%;
  max-width: 380px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.barcode-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.barcode-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}
.barcode-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}
#barcode-video {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: #000;
  display: block;
}
.barcode-status {
  padding: 10px 16px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}
.barcode-manual-row {
  display: flex;
  gap: 8px;
  padding: 0 16px 16px;
}
.barcode-manual-row input {
  flex: 1;
}

/* ================= Inventory History ================= */
.inventory-log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.inventory-log-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}
.inventory-log-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--surface-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.inventory-log-info {
  min-width: 0;
}
.inventory-log-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.inventory-log-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}
.inv-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 999px;
}

/* ==========================================================================
   Modern POS UI Component Enhancements (Phase 4)
   ========================================================================== */

/* Live Real-Time Pulse Indicator in Header */
.header-sync-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.header-sync-status:hover {
  border-color: var(--border-focus);
  background: var(--surface-hover);
}

.live-pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

.live-pulse-dot.synced {
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 2s infinite;
}

.live-pulse-dot.syncing {
  background: #3b82f6;
  box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
  animation: pulseBlue 1s infinite;
}

.live-pulse-dot.pending {
  background: #f59e0b;
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  animation: pulseAmber 2s infinite;
}

.live-pulse-dot.offline {
  background: #ef4444;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulseBlue {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

@keyframes pulseAmber {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* Touch POS Cash Numpad for Rapid Entry */
.cash-numpad-wrap {
  margin-top: 12px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px;
}

.cash-numpad-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.numpad-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 6px;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  user-select: none;
}

.numpad-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-focus);
}

.numpad-btn:active {
  background: var(--surface-active);
  transform: scale(0.95);
}

.numpad-btn.action-exact {
  background: var(--money-green-subtle);
  color: var(--money-green);
  border-color: var(--money-green);
  font-size: 13px;
  font-weight: 800;
}

.numpad-btn.action-clear {
  background: rgba(225, 29, 72, 0.08);
  color: var(--rose);
  border-color: var(--rose);
  font-size: 14px;
}

/* Visual Change Due State Badges */
.change-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-left: 8px;
}

.change-status-pill.exact {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #10b981;
}

.change-status-pill.change {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #3b82f6;
}

.change-status-pill.short {
  background: #fff1f2;
  color: #e11d48;
  border: 1px solid #f43f5e;
}

[data-theme="dark"] .change-status-pill.exact {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.3);
}

[data-theme="dark"] .change-status-pill.change {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.3);
}

[data-theme="dark"] .change-status-pill.short {
  background: rgba(225, 29, 72, 0.15);
  color: #fb7185;
  border-color: rgba(251, 113, 133, 0.3);
}

/* Revenue 7-Day Interactive SVG Chart */
.revenue-chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
}

.revenue-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.revenue-chart-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.revenue-chart-compare {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.revenue-chart-compare.up {
  background: #ecfdf5;
  color: #059669;
}

.revenue-chart-compare.down {
  background: #fff1f2;
  color: #e11d48;
}

[data-theme="dark"] .revenue-chart-compare.up {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

[data-theme="dark"] .revenue-chart-compare.down {
  background: rgba(225, 29, 72, 0.15);
  color: #fb7185;
}

.svg-chart-container {
  width: 100%;
  height: 140px;
}

.chart-bar-rect {
  fill: url(#blueBarGradient);
  rx: 4px;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.chart-bar-rect:hover {
  fill: var(--blue-brand);
  filter: drop-shadow(0 2px 6px var(--blue-glow));
}

.chart-bar-rect.active-day {
  fill: var(--blue-brand);
}

/* Grouped Date Sections in History Screen */
.history-date-group {
  margin-bottom: 18px;
}

.history-date-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
}

.history-date-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.history-date-total {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--money-green);
}

/* History Refund & Void Sale Action */
.btn-refund-sale {
  border-radius: var(--radius-full);
  background: rgba(225, 29, 72, 0.08);
  color: var(--rose);
  border: 1px solid rgba(225, 29, 72, 0.25);
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  transition: all var(--transition-fast);
}

.btn-refund-sale:hover {
  background: var(--rose);
  color: #ffffff;
}

.sale-refunded-badge {
  background: rgba(225, 29, 72, 0.12);
  color: var(--rose);
  border: 1px solid rgba(225, 29, 72, 0.3);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  margin-left: 6px;
}

/* Clean Settings Modal Section Cards */
.settings-section-card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 14px;
}

.settings-section-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
}
.inv-added { background: rgba(20, 184, 166, 0.16); color: var(--teal); }
.inv-updated { background: rgba(245, 158, 11, 0.16); color: var(--amber); }
.inv-removed { background: rgba(244, 63, 94, 0.16); color: var(--rose); }

/* ---------- Units & Packs Selling Format Section ---------- */
.packaging-mode-bar {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast);
}

.packaging-mode-bar:focus-within,
.packaging-mode-bar:hover {
  border-color: rgba(37, 99, 235, 0.35);
}

.packaging-mode-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.packaging-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: rgba(37, 99, 235, 0.1);
  color: var(--blue-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.packaging-title-wrap {
  display: flex;
  flex-direction: column;
}

.packaging-mode-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.packaging-mode-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.packaging-mode-pills {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.pkg-pill {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.pkg-pill:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.pkg-pill.active {
  background: linear-gradient(135deg, #1e40af, #2563eb);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.pkg-pill-count {
  font-size: 10px;
  background: rgba(0, 0, 0, 0.15);
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

/* Dual Unit & Pack Buttons on Product Tiles */
.product-dual-btns {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  width: 100%;
}

.btn-tile-opt {
  flex: 1;
  padding: 5px 6px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-tile-opt:hover {
  border-color: var(--blue-brand);
  background: rgba(37, 99, 235, 0.08);
  color: var(--blue-brand);
  transform: translateY(-1px);
}

.btn-tile-opt.pack-opt {
  background: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.25);
  color: var(--blue-brand);
}

.btn-tile-opt.pack-opt:hover {
  background: var(--blue-brand);
  color: #ffffff;
  border-color: var(--blue-brand);
}

.opt-sub {
  font-size: 9px;
  font-weight: 600;
  opacity: 0.85;
}

.pkg-savings-pill {
  font-size: 9px;
  background: var(--money-green);
  color: #ffffff;
  padding: 1px 4px;
  border-radius: var(--radius-full);
  font-weight: 800;
}

/* Cart Item Unit/Pack Segmented Toggle */
.cart-pkg-toggle {
  display: inline-flex;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 2px;
  gap: 2px;
  margin-top: 4px;
}

.cart-pkg-btn {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cart-pkg-btn.active {
  background: var(--blue-brand);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
}

.cart-pkg-btn:hover:not(.active) {
  color: var(--text-primary);
}

.cart-row-pack-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 800;
  background: rgba(37, 99, 235, 0.1);
  color: var(--blue-brand);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  margin-left: 4px;
  text-transform: uppercase;
}

