:root {
  /* ─── SURFACES (CosyPOS Slate Theme) ─── */
  --bg-primary: #13141a;
  --bg-secondary: #1d1e26;
  --bg-card: #1d1e26;
  --bg-card-hover: #262833;
  --bg-hover: #252632;
  --bg-surface: #13141a;
  --bg-toast: #1d1e26;

  /* ─── TEXT ─── */
  --text-primary: #ffffff;
  --text-secondary: #7d7f8c;
  --text-muted: #515361;

  /* ─── BORDERS ─── */
  --border: #252632;
  --border-light: #1f202b;

  /* ─── ACCENT ─── */
  --accent: #ffffff;
  --accent-hover: #f0f0f5;
  --accent-glow: rgba(255, 255, 255, 0.08);
  --accent-bg: #252632;

  /* ─── SEMANTIC ─── */
  --blue: #0ea5e9;
  --blue-bg: rgba(14, 165, 233, 0.1);
  --blue-glow: rgba(14, 165, 233, 0.12);
  --green: #10b981;
  --green-bg: rgba(16, 185, 129, 0.1);
  --green-glow: rgba(16, 185, 129, 0.12);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.1);
  --red-glow: rgba(239, 68, 68, 0.12);
  --orange: #f59e0b;
  --orange-bg: rgba(245, 158, 11, 0.1);
  --purple: #8b5cf6;
  --purple-bg: rgba(139, 92, 246, 0.1);

  /* ─── CATEGORY PASTEL MAP ─── */
  --theme-mint-bg: #d1fae5;
  --theme-mint-accent: #10b981;
  --theme-mint-text: #065f46;
  --theme-mint-count: #047857;

  --theme-lavender-bg: #f3e8ff;
  --theme-lavender-accent: #8b5cf6;
  --theme-lavender-text: #5b21b6;
  --theme-lavender-count: #6d28d9;

  --theme-blue-bg: #e0f2fe;
  --theme-blue-accent: #0ea5e9;
  --theme-blue-text: #0369a1;
  --theme-blue-count: #0284c7;

  --theme-indigo-bg: #e0e7ff;
  --theme-indigo-accent: #6366f1;
  --theme-indigo-text: #3730a3;
  --theme-indigo-count: #4f46e5;

  --theme-pink-bg: #fce7f3;
  --theme-pink-accent: #ec4899;
  --theme-pink-text: #9d174d;
  --theme-pink-count: #be185d;

  --theme-amber-bg: #fef3c7;
  --theme-amber-accent: #f59e0b;
  --theme-amber-text: #92400e;
  --theme-amber-count: #b45309;

  --theme-peach-bg: #ffedd5;
  --theme-peach-accent: #f97316;
  --theme-peach-text: #c2410c;
  --theme-peach-count: #ea580c;

  /* ─── TYPOGRAPHY ─── */
  --font-sans: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-price: 'Source Sans 3', 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Monaco', monospace;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 13px;
  --text-lg: 15px;
  --text-xl: 18px;
  --text-2xl: 22px;
  --text-3xl: 28px;
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-extrabold: 800;
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --tracking-tight: -0.02em;

  /* ─── SPACING ─── */
  --sidebar-width: 172px;

  /* ─── RADII ─── */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* ─── SHADOWS ─── */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.35);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.4);
  --shadow-xl: 0 24px 64px rgba(0,0,0,0.45);

  /* ─── TRANSITIONS ─── */
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Make Dark Mode same luxury theme */
[data-theme="dark"] {
  --bg-primary: #13141a;
  --bg-secondary: #1d1e26;
  --bg-card: #1d1e26;
  --bg-card-hover: #262833;
  --bg-hover: #252632;
  --bg-surface: #13141a;
  --text-primary: #ffffff;
  --text-secondary: #7d7f8c;
  --text-muted: #515361;
}

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

body {
  font-feature-settings: "zero" 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── APP STRUCTURE ─── */
#app {
  display: flex;
  height: 100vh;
  background: var(--bg-primary);
}

/* ─── LOADING ─── */
.loading-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-primary); z-index: 5;
}
.loading-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── SIDEBAR ─── */
#sidebar {
  width: var(--sidebar-width);
  background: var(--bg-primary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px 20px;
  gap: 8px;
  z-index: 10;
  -webkit-app-region: drag;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  width: 100%;
  position: relative;
  -webkit-app-region: no-drag;
}

.sidebar-logo {
  width: 100%;
  max-width: 120px;
  height: auto;
  object-fit: contain;
  transition: transform var(--transition);
}

.sidebar-header:hover .sidebar-logo {
  transform: scale(1.05);
}

.sidebar-header .shortcut-hint {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 22px;
  height: 22px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  color: var(--text-secondary);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition);
  opacity: 0;
  transform: scale(0.85);
}

.sidebar-header:hover .shortcut-hint {
  opacity: 1;
  transform: scale(1);
}

.sidebar-header .shortcut-hint:hover {
  color: #fff;
  border-color: #fff;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  -webkit-app-region: no-drag;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  transition: all var(--transition);
  position: relative;
  text-align: left;
  width: 100%;
  -webkit-app-region: no-drag;
}

.nav-btn:hover {
  background: var(--bg-hover);
  color: #fff;
}

.nav-btn.active {
  background: var(--bg-hover);
  color: #fff;
  font-weight: var(--weight-semibold);
}

.nav-btn.active::before {
  display: none; /* No vertical line, clean card selection instead */
}

.nav-btn svg {
  flex-shrink: 0;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.nav-btn:hover svg { transform: scale(1.08); color: #fff; }
.nav-btn.active svg { transform: scale(1.08); color: #fff; }

/* ─── SIDEBAR STAFF / USER SECTION ─── */
.sidebar-user {
  margin-top: auto;
  width: 100%;
  padding: 16px 0 0;
  border-top: 1px solid var(--border);
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  -webkit-app-region: no-drag;
}

.sidebar-user-name {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* User avatar circle like in CosyPOS */
.user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border);
  border: 1.5px solid var(--text-secondary);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-name-text {
  font-size: 13px;
  font-weight: var(--weight-semibold);
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: var(--weight-medium);
  padding-left: 40px;
  margin-top: -8px;
}

.sidebar-logout {
  margin-top: 4px;
  padding: 8px 12px;
  font-size: 11px;
  color: var(--red);
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  justify-content: center;
  font-weight: var(--weight-medium);
}

.sidebar-logout:hover {
  background: var(--red-bg);
  border-color: var(--red);
}

/* ─── CONTENT AREA ─── */
#content {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-primary);
}
#content:has(#view-pos.active) { overflow: hidden; }

.view { display: none; }
.view.active { display: block; }
#view-pos.active { display: flex; flex-direction: column; height: 100%; }

.view > .card {
  margin: 0 36px 24px;
}

.view-enter {
  animation: viewIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ─── VIEW HEADER ─── */
.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  padding: 24px 36px 0;
}

.view-header h2 {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  color: #fff;
}

.date-display {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  padding: 8px 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-weight: var(--weight-medium);
}

/* ─── STATS GRID ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin: 0 36px 24px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
  transition: all var(--transition);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: #ffffff;
  opacity: 0.15;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--text-secondary);
}

.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  background: var(--bg-hover);
}

.stat-info { display: flex; flex-direction: column; gap: 3px; }

.stat-label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
}

.stat-value {
  font-size: 24px;
  font-weight: var(--weight-extrabold);
  color: #fff;
  font-family: var(--font-price);
  font-variant-numeric: tabular-nums;
}

/* ─── DASHBOARD GRID ─── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 0 36px 24px;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h3 {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: #fff;
}

.card-body {
  padding: 24px;
}
.card-body canvas { max-height: 220px; }

/* ─── POS VIEW LAYOUT ─── */
#view-pos.view.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.pos-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  background: var(--bg-primary);
}

.pos-products {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

/* ─── SEARCH BAR ─── */
.pos-search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px 10px;
  background: var(--bg-primary);
}

.pos-search-bar svg { color: var(--text-secondary); flex-shrink: 0; }

.pos-search-bar input {
  width: 100%;
  max-width: 320px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 16px;
  background: var(--bg-card);
  color: #fff;
  font-size: 13px;
  font-family: var(--font-sans);
  transition: all var(--transition);
}
.pos-search-bar input:focus {
  border-color: var(--text-secondary);
  outline: none;
}
.pos-search-bar input::placeholder { color: var(--text-muted); }

.pos-shift-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  flex-shrink: 0;
}
.pos-shift-btn:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.pos-shift-btn.active { border-color: var(--blue); color: #fff; background: rgba(14,165,233,0.1); }
.pos-shift-dot {
  width: 7px; height: 7px; border-radius: 50%; display: inline-block;
  background: #6b7280;
}
.pos-shift-btn.active .pos-shift-dot { background: #2563eb; box-shadow: 0 0 6px rgba(37,99,235,0.6); }

/* ─── LOW STOCK ALERT ─── */
.low-stock-alert {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 999;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 500px;
  width: 90%;
}
.low-stock-alert.show { transform: translateX(-50%) translateY(0); }
.low-stock-alert-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--orange);
  color: #000;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(245,158,11,0.35);
  font-size: 13px;
  font-weight: 700;
}
.low-stock-msg { flex: 1; font-size: 12px; line-height: 1.4; }
.low-stock-btn {
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: #000;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  font-family: var(--font-sans);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}
.low-stock-btn:hover { background: #1a1a1a; transform: translateY(-1px); }
.low-stock-close {
  background: none;
  border: none;
  color: rgba(0,0,0,0.5);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.low-stock-close:hover { color: #000; }

/* ─── CATEGORY BAR (Pastel Grid Style) ─── */
.pos-categories {
  display: flex;
  gap: 12px;
  padding: 12px 24px 16px;
  overflow-x: auto;
  white-space: nowrap;
  background: transparent;
  border: none;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.pos-categories::-webkit-scrollbar { display: none; }

.category-chip {
  flex-shrink: 0;
  width: 110px;
  height: 110px;
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.category-chip:hover {
  transform: translateY(-2px);
}

/* Color theme mappings on Category Cards */
.category-chip.theme-mint { background: var(--theme-mint-bg); color: var(--theme-mint-text); }
.category-chip.theme-mint .cat-name { color: var(--theme-mint-text); }
.category-chip.theme-mint .cat-count-sub { color: var(--theme-mint-count); }

.category-chip.theme-lavender { background: var(--theme-lavender-bg); color: var(--theme-lavender-text); }
.category-chip.theme-lavender .cat-name { color: var(--theme-lavender-text); }
.category-chip.theme-lavender .cat-count-sub { color: var(--theme-lavender-count); }

.category-chip.theme-blue { background: var(--theme-blue-bg); color: var(--theme-blue-text); }
.category-chip.theme-blue .cat-name { color: var(--theme-blue-text); }
.category-chip.theme-blue .cat-count-sub { color: var(--theme-blue-count); }

.category-chip.theme-indigo { background: var(--theme-indigo-bg); color: var(--theme-indigo-text); }
.category-chip.theme-indigo .cat-name { color: var(--theme-indigo-text); }
.category-chip.theme-indigo .cat-count-sub { color: var(--theme-indigo-count); }

.category-chip.theme-pink { background: var(--theme-pink-bg); color: var(--theme-pink-text); }
.category-chip.theme-pink .cat-name { color: var(--theme-pink-text); }
.category-chip.theme-pink .cat-count-sub { color: var(--theme-pink-count); }

.category-chip.theme-amber { background: var(--theme-amber-bg); color: var(--theme-amber-text); }
.category-chip.theme-amber .cat-name { color: var(--theme-amber-text); }
.category-chip.theme-amber .cat-count-sub { color: var(--theme-amber-count); }

.category-chip.theme-peach { background: var(--theme-peach-bg); color: var(--theme-peach-text); }
.category-chip.theme-peach .cat-name { color: var(--theme-peach-text); }
.category-chip.theme-peach .cat-count-sub { color: var(--theme-peach-count); }

.category-chip.theme-default { background: var(--bg-hover); color: #fff; }
.category-chip.theme-default .cat-name { color: #fff; }
.category-chip.theme-default .cat-count-sub { color: var(--text-secondary); }

.category-chip .cat-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.category-chip .cat-icon svg {
  width: 22px;
  height: 22px;
}

.category-chip .cat-name {
  font-size: 12px;
  font-weight: var(--weight-bold);
  line-height: 1.2;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.category-chip .cat-count-sub {
  font-size: 10px;
  font-weight: var(--weight-semibold);
  opacity: 0.85;
  flex-shrink: 0;
}

/* Active Highlight on Category Cards */
.category-chip.active {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-md);
  border-color: #ffffff;
}

/* Grid Icon at extreme right of bar */
.pos-categories .grid-icon {
  margin-left: auto;
  align-self: center;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.pos-categories .grid-icon:hover {
  background: var(--bg-hover);
  color: #fff;
}

/* ─── POS PRODUCTS GRID ─── */
.pos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  overflow-y: auto;
  flex: 1;
  align-content: start;
  padding: 4px 24px 24px;
}

.pos-product {
  background: var(--bg-card);
  border: none;
  border-left: 5px solid var(--theme-color);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px;
  height: 140px;
  box-shadow: var(--shadow-xs);
  aspect-ratio: auto;
}

/* Mapping theme accents to cards */
.pos-product.theme-mint { --theme-color: var(--theme-mint-accent); }
.pos-product.theme-lavender { --theme-color: var(--theme-lavender-accent); }
.pos-product.theme-blue { --theme-color: var(--theme-blue-accent); }
.pos-product.theme-indigo { --theme-color: var(--theme-indigo-accent); }
.pos-product.theme-pink { --theme-color: var(--theme-pink-accent); }
.pos-product.theme-amber { --theme-color: var(--theme-amber-accent); }
.pos-product.theme-peach { --theme-color: var(--theme-peach-accent); }
.pos-product.theme-default { --theme-color: var(--text-secondary); }

.pos-product:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  background: var(--bg-card-hover);
}
.pos-product:active { transform: translateY(-1px); }

/* Card Image (if exists) */
.pos-product .prod-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block; z-index: 0;
}
.pos-product.has-image::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(0,0,0,0.55); pointer-events: none; z-index: 1;
}
.pos-product.no-image {
  background: var(--bg-card);
  justify-content: space-between;
}
.pos-product.no-image .prod-name,
.pos-product.no-image .prod-price,
.pos-product.no-image .prod-stock {
  color: var(--text-primary) !important;
  text-shadow: none !important;
}

/* Card details styling */
.pos-product .prod-name,
.pos-product .prod-price,
.pos-product .prod-stock,
.pos-product .prod-card-badge {
  position: relative; z-index: 2;
}

.pos-product.has-image .prod-name,
.pos-product.has-image .prod-price,
.pos-product.has-image .prod-stock {
  color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.pos-product .prod-card-badge {
  font-size: 9px;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: var(--weight-bold);
  letter-spacing: 0.5px;
}

.pos-product .prod-name {
  font-size: 14px;
  font-weight: var(--weight-bold);
  color: #fff;
  margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.3;
}

.pos-product .prod-price {
  font-size: 16px;
  font-weight: var(--weight-extrabold);
  color: #fff;
  font-family: var(--font-price);
  font-variant-numeric: tabular-nums;
}

.pos-product .prod-stock {
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
  margin-top: 2px;
}

.pos-product .exp-card-badge {
  font-size: 9px;
  font-weight: var(--weight-bold);
  border-radius: 4px;
  padding: 1px 6px;
  position: relative;
  z-index: 2;
}
.pos-product .exp-card-badge.exp-red {
  background: #dc2626;
  color: #fff;
}
.pos-product .exp-card-badge.exp-orange {
  background: #f59e0b;
  color: #000;
}

.pos-product .prod-wholesale {
  font-size: 9px;
  color: var(--text-muted);
  position: relative;
  z-index: 2;
  margin-top: 2px;
}

.pos-product .prod-unit {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: var(--weight-normal);
}

.pos-product.out-of-stock { opacity: 0.35; pointer-events: none; }

/* ─── LIVE CARD COUNTERS (CosyPOS style) ─── */
.card-counter {
  position: absolute;
  bottom: 14px;
  right: 14px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--border);
  border-radius: 99px;
  padding: 4px;
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.card-counter-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
}

.card-counter-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.card-counter-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 14px;
  text-align: center;
  font-family: var(--font-mono);
}

/* Active (item is in cart) -> takes on category theme color */
.pos-product.active-in-cart .card-counter {
  background: var(--theme-color);
  border-color: var(--theme-color);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.pos-product.active-in-cart .card-counter-btn {
  color: #fff;
}
.pos-product.active-in-cart .card-counter-btn:hover {
  background: rgba(0,0,0,0.15);
}
.pos-product.active-in-cart .card-counter-val {
  color: #fff;
}

/* ─── CART PANEL (Right side) ─── */
.pos-cart {
  width: 360px;
  min-width: 320px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.cart-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-secondary);
}

.cart-header h3 {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: #fff;
}

.cart-header .cart-actions-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cart-header .cart-actions-right button {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: flex;
}

.cart-header .cart-actions-right button:hover {
  background: var(--bg-hover);
  color: #fff;
}

.cart-count {
  background: #ffffff;
  color: #13141a;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: var(--weight-bold);
  min-width: 20px;
  text-align: center;
  line-height: 1.4;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

/* ─── CART ROWS OVERHAUL (CosyPOS Style) ─── */
.cart-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-primary); /* Contrasting dark rows */
  border-radius: var(--radius-lg);
  margin-bottom: 10px;
  border: 1px solid var(--border);
  transition: all var(--transition);
  gap: 12px;
}

.cart-item:hover {
  transform: translateY(-1px);
  border-color: var(--text-secondary);
}

/* Circular item index badge */
.cart-item-index {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: var(--weight-bold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cart-item-name {
  font-weight: var(--weight-bold);
  font-size: 13px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cart-prod-img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.cart-item-qty-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: var(--weight-semibold);
  margin-left: 2px;
}

.cart-item-qty-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.cart-item-price {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
  font-family: var(--font-price);
  font-variant-numeric: tabular-nums;
}

.cart-item-total {
  font-weight: var(--weight-bold);
  font-size: 13px;
  color: #fff;
  font-family: var(--font-price);
  font-variant-numeric: tabular-nums;
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: all 0.12s;
  display: flex;
}

.cart-item-remove:hover {
  background: var(--red-bg);
  color: var(--red);
}

/* Cart item note */
.cart-item-note {
  font-size: 11px;
  color: var(--orange);
  background: var(--orange-bg);
  padding: 4px 8px;
  border-radius: 6px;
  margin-top: 4px;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cart-item-note:hover {
  background: var(--bg-hover);
  color: #fff;
}
.cart-item-note svg {
  flex-shrink: 0;
}

.cart-item-note-btn {
  font-size: 11px;
  background: none;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 6px;
  margin-top: 4px;
  cursor: pointer;
  transition: all var(--transition);
  display: none;
  line-height: 1;
  align-items: center;
}
.cart-item:hover .cart-item-note-btn {
  display: inline-flex;
}
.cart-item-note-btn:hover {
  border-color: var(--text-secondary);
  color: var(--text-secondary);
}
.cart-item-note-btn svg {
  flex-shrink: 0;
}

.cart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-secondary);
  font-size: 13px;
  flex-direction: column;
  gap: 12px;
}

.cart-empty::before {
  content: '🛒';
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: 1.5px solid var(--border);
}

/* ─── CART SUMMARY & CHEKOUT ─── */
.cart-summary {
  padding: 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  box-shadow: var(--shadow-sm);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: var(--weight-medium);
  font-family: var(--font-price);
  font-variant-numeric: tabular-nums;
}

.summary-row.total {
  font-size: 20px;
  font-weight: var(--weight-extrabold);
  color: #fff;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: 10px;
  margin-bottom: 16px;
  font-family: var(--font-price);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

.cart-actions {
  display: flex;
  gap: 10px;
}

/* Solid white pill button ("Place Order") */
.btn-charge {
  width: 100%;
  padding: 16px;
  font-size: 14px;
  font-weight: var(--weight-bold);
  text-transform: none;
  letter-spacing: normal;
  border: none;
  background: #ffffff;
  color: #13141a;
  cursor: pointer;
  border-radius: 99px;
  transition: all var(--transition);
  box-shadow: 0 10px 30px rgba(255,255,255,0.08);
}

.btn-charge:hover:not(:disabled) { 
  background: #f0f0f5;
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(255,255,255,0.12);
}

.btn-charge:not(:disabled):active { 
  transform: translateY(0); 
}

.btn-save {
  flex: 1;
  padding: 14px;
  font-weight: var(--weight-bold);
  font-size: 13px;
  text-transform: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 99px;
  transition: all var(--transition);
  display: none; /* CosyPOS uses direct payment flow */
}

/* ─── PAYMENT BUTTONS (Checkout Modal) ─── */
.payment-methods {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.payment-btn {
  flex: 1;
  min-width: 80px;
  padding: 14px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  font-weight: var(--weight-bold);
  text-align: center;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.payment-btn:hover { 
  border-color: #fff; 
  color: #fff;
  transform: translateY(-2px);
}

/* Selected Payment Button Highlight */
.payment-btn.active {
  background: #ffffff;
  color: #13141a;
  border-color: #ffffff;
  box-shadow: 0 8px 24px rgba(255,255,255,0.15);
}
.payment-btn.active svg {
  color: #13141a;
}

/* ─── BUTTONS & BADGES ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  font-family: var(--font-sans);
}

.btn-primary {
  background: #ffffff;
  color: #13141a;
  border-color: transparent;
}

.btn-primary:hover {
  background: #f0f0f5;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(255,255,255,0.08);
}

.btn-secondary {
  background: var(--bg-card);
  color: #fff;
  border-color: var(--border);
}

.btn-secondary:hover { 
  background: var(--bg-hover);
  border-color: var(--text-secondary);
}

.btn-danger {
  background: var(--red);
  color: #fff;
  border-color: transparent;
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 11px;
  border-radius: 6px;
}

/* ─── TABLES ─── */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  color: #fff;
}

.table tbody tr {
  transition: background 0.15s;
}

.table tbody tr:hover { background: var(--bg-card); }

/* Badges styling */
.category-badge {
  background: var(--bg-hover);
  color: #fff;
  font-size: 11px;
  padding: 4px 14px;
  border-radius: 999px;
  font-weight: var(--weight-semibold);
  display: inline-block;
}

.stock-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: var(--weight-semibold);
}

.stock-ok { background: var(--green-bg); color: var(--green); }
.stock-low { background: var(--orange-bg); color: var(--orange); }
.stock-out { background: var(--red-bg); color: var(--red); }

/* Expirations */
.exp-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: var(--weight-semibold);
}
.exp-green { background: var(--green-bg); color: #34d399; }
.exp-yellow { background: var(--orange-bg); color: #fbbf24; }
.exp-orange { background: #3b1f05; color: #fb923c; }
.exp-red { background: #3b0a0a; color: #fca5a5; }

/* ─── FORMS ─── */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  margin-bottom: 6px;
}

input, textarea, select {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-feature-settings: "zero" 0;
  background: var(--bg-card);
  color: #fff;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: #fff;
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  font-family: var(--font-sans);
  transition: all var(--transition);
  border-radius: var(--radius);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--text-secondary);
  outline: none;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition);
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(100, 100, 255, 0.15);
}
.form-control::placeholder {
  color: var(--text-muted);
}

/* ─── MODALS ─── */
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  position: relative;
  z-index: 1;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  border-bottom: 1px solid var(--border);
}
.modal-footer {
  border-top: 1px solid var(--border);
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: -1;
}
.modal-sm { max-width: 480px; width: 92%; }
.modal-xs { max-width: 340px; width: 90%; }
.modal-body {
  padding: 24px 28px;
}
.modal-header {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-footer {
  padding: 12px 24px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.modal-close:hover { color: #fff; }
.modal-header h3 {
  font-size: 16px;
  font-weight: var(--weight-bold);
}
.hidden { display: none !important; }

/* ─── FULLSCREEN CHECKOUT ─── */
.checkout-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.checkout-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.checkout-title {
  font-size: 18px;
  font-weight: var(--weight-bold);
  color: #fff;
}
.checkout-close {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.checkout-close:hover { background: var(--red-bg); color: var(--red); border-color: var(--red); }

.checkout-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 32px;
  gap: 20px;
  overflow-y: auto;
}

.checkout-total-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.checkout-total-label {
  font-size: 14px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: var(--weight-semibold);
}
.checkout-total-amount {
  font-size: 56px;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -1px;
  font-family: var(--font-price);
  font-variant-numeric: tabular-nums;
}

.checkout-totals-mini {
  display: flex;
  gap: 24px;
  font-size: 13px;
  color: var(--text-muted);
}
.checkout-totals-mini strong {
  color: var(--text-secondary);
}

.checkout-payment-section {
  width: 100%;
  max-width: 600px;
}
.checkout-payment-label {
  font-size: 13px;
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
  text-align: center;
}

.payment-methods-fullscreen {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.payment-btn-full {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 12px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 15px;
  font-weight: var(--weight-bold);
  transition: all var(--transition);
}
.payment-btn-full svg {
  color: var(--text-secondary);
  transition: all var(--transition);
}
.payment-btn-full:hover {
  border-color: var(--text-secondary);
  color: #fff;
  transform: translateY(-2px);
}
.payment-btn-full:hover svg { color: #fff; }

.payment-btn-full.focused {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.25);
  color: #fff;
}
.payment-btn-full.focused svg { color: #fff; }

.payment-btn-full.active {
  background: #fff;
  color: #13141a;
  border-color: #fff;
  box-shadow: 0 8px 32px rgba(255,255,255,0.12);
}
.payment-btn-full.active svg { color: #13141a; }

.checkout-cash-section {
  width: 100%;
  max-width: 400px;
}
.checkout-cash-section label {
  display: block;
  font-size: 13px;
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-align: center;
}
.checkout-cash-section input {
  width: 100%;
  padding: 18px 24px;
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: #fff;
  font-family: var(--font-sans);
}
.checkout-cash-section input:focus {
  border-color: var(--accent);
  outline: none;
}

.checkout-change-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 400px;
  padding: 14px 20px;
  background: var(--green-bg);
  border: 1px solid var(--green);
  border-radius: var(--radius);
  font-size: 18px;
  font-weight: 700;
}
.checkout-change-row span:first-child { color: var(--green); }

/* ─── SPLIT PAYMENT ─── */
#split-payment-section {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#split-payment-section.hidden { display: none !important; }

.split-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.split-select {
  flex: 0 0 140px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: var(--weight-semibold);
  font-family: var(--font-sans);
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: #fff;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237d7f8c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  transition: all var(--transition);
}
.split-select:focus {
  border-color: var(--accent);
  outline: none;
}

.split-amount {
  flex: 1;
  padding: 14px 18px;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: #fff;
  font-family: var(--font-price);
  font-variant-numeric: tabular-nums;
  transition: all var(--transition);
}
.split-amount:focus {
  border-color: var(--accent);
  outline: none;
}
.split-amount::placeholder { color: var(--text-muted); }

.split-balance {
  text-align: center;
  font-size: 14px;
  font-weight: var(--weight-semibold);
  padding: 10px 16px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--bg-card);
}
.split-balance.ok {
  color: var(--green);
  border-color: var(--green);
  background: var(--green-bg);
}
.split-balance.error {
  color: var(--red);
  border-color: var(--red);
  background: var(--red-bg);
}
.checkout-change-row span:last-child { color: var(--green); font-size: 22px; }

.checkout-bottom-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.checkout-cancel-btn {
  padding: 18px 32px;
  font-size: 15px;
  font-weight: var(--weight-bold);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.checkout-cancel-btn:hover { border-color: var(--text-secondary); color: #fff; }

.checkout-confirm-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 32px;
  font-size: 18px;
  font-weight: 800;
  border-radius: var(--radius-lg);
  border: none;
  background: #fff;
  color: #13141a;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 8px 32px rgba(255,255,255,0.1);
}
.checkout-confirm-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(255,255,255,0.15);
}
.checkout-confirm-btn:active { transform: translateY(0); }

@media (max-width: 600px) {
  .payment-methods-fullscreen { grid-template-columns: repeat(2, 1fr); }
  .checkout-total-amount { font-size: 42px; }
  .checkout-confirm-btn { font-size: 16px; padding: 16px 24px; }
}
/* ─── FULLSCREEN PIN LOGIN ─── */
.pin-login {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0;
}

.pin-login.hidden { display: none !important; }

.pin-login-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  width: 100%;
  max-width: 480px;
  padding: 40px 40px;
}

.pin-logo {
  width: 120px;
  height: auto;
  opacity: 0.9;
}

.pin-title {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
  letter-spacing: 0.5px;
}

/* PIN Display Dots */
.pin-display {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  height: 48px;
}

.pin-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.pin-dot.filled {
  background: #fff;
  border-color: #fff;
  transform: scale(1.15);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}

.pin-dot.error {
  border-color: var(--red);
  background: var(--red);
  animation: pinShake 0.4s ease;
}

.pin-dot.success {
  border-color: var(--green);
  background: var(--green);
}

@keyframes pinShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

/* PIN Error Message */
.pin-error {
  font-size: 13px;
  color: var(--red);
  min-height: 20px;
  opacity: 0;
  transition: opacity 0.2s;
}

.pin-error.visible {
  opacity: 1;
}

/* Numeric Keypad */
.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: 100%;
  max-width: 380px;
}

.pin-key {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 72px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: #fff;
  font-size: 24px;
  font-weight: var(--weight-semibold);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-app-region: no-drag;
}

.pin-key:hover {
  background: var(--bg-hover);
  border-color: var(--text-secondary);
}

.pin-key:active {
  transform: scale(0.95);
  background: var(--border);
}

.pin-key.empty {
  border-color: transparent;
  background: transparent;
  cursor: default;
  pointer-events: none;
}

.pin-key.backspace {
  font-size: 18px;
}

.pin-key.backspace svg {
  width: 22px;
  height: 22px;
  stroke: var(--text-secondary);
}

/* Pin user label below keypad */
.pin-user-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

.pin-toggle-btn {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
  font-family: var(--font-sans);
  transition: color var(--transition);
}
.pin-toggle-btn:hover {
  color: var(--text-primary);
}

#pin-mode, #email-mode {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.pin-user-label strong {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

/* ─── TABLE TOOLBAR & SEARCH ─── */
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 0 16px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  max-width: 420px;
  padding: 10px 16px;
  background: var(--bg-primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}
.search-box:focus-within {
  border-color: var(--text-secondary);
}
.search-box svg {
  color: var(--text-muted);
  flex-shrink: 0;
}
.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-sans);
  outline: none;
}
.search-box input::placeholder { color: var(--text-muted); }

.search-clear {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: none;
  background: var(--bg-hover);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.search-clear:hover { background: var(--red-bg); color: var(--red); }

.filter-select {
  padding: 10px 16px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition);
  min-width: 180px;
}
.filter-select:focus {
  border-color: var(--text-secondary);
  outline: none;
}

/* ─── ACTION BUTTONS ─── */
.actions-cell {
  white-space: nowrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.action-btn svg {
  flex-shrink: 0;
}
.action-btn:hover {
  background: var(--bg-hover);
  color: #fff;
  border-color: var(--text-secondary);
}
.action-btn.danger:hover {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red);
}

/* ─── TOASTS ─── */
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  color: #fff;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid #fff; }

/* ─── UTILITIES & COMPACT CONTROLS ─── */
.qty-btn {
  width: 24px; height: 24px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}
.qty-btn:hover { background: var(--bg-hover); }

.qty-value {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono);
}

/* Circular initials */
.customer-badge {
  background: var(--bg-hover);
  color: #fff;
  border-radius: 999px;
  border: 1px solid var(--border);
}

/* Custom Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ─── FULLSCREEN WELCOME ─── */
.form-error {
  color: var(--red);
  font-size: 12px;
  padding: 8px 0;
}

/* ─── FULLSCREEN REGISTER ─── */
.register-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 40px 20px;
}
.register-fullscreen.hidden { display: none !important; }

.register-card {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.register-title {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #fff;
}

.register-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: -12px;
}

.register-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.register-form .form-group {
  margin-bottom: 0;
}

.register-form .form-group label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
}

.register-form .form-group input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: #fff;
  font-size: 15px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--transition);
}

.register-form .form-group input:focus {
  border-color: var(--blue);
}

.register-form .form-group small {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

.register-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn-register {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: none;
  background: var(--accent);
  color: var(--bg-primary);
  font-size: 16px;
  font-weight: 800;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-md);
  margin-top: 8px;
}
.btn-register:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.btn-register:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.register-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: -4px;
}

/* ─── QR LINK MODAL ─── */
.qr-link-box {
  width: 100%;
  display: flex;
  gap: 8px;
}

.qr-link-input {
  flex: 1;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: #fff;
  font-size: 14px;
  font-family: var(--font-mono);
  outline: none;
}

.qr-copy-btn {
  padding: 14px 20px;
  border-radius: var(--radius);
  border: none;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.qr-copy-btn:hover {
  opacity: 0.9;
}

.qr-code-container {
  width: 200px;
  height: 200px;
  background: #fff;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.qr-code-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-register.secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn-register.secondary:hover {
  background: var(--bg-card-hover);
}

/* ─── RESTOCK MODAL ─── */
.restock-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.1s;
}
.restock-item:last-child { border-bottom: none; }
.restock-item:hover { background: var(--bg-primary); margin: 0 -16px; padding: 10px 16px; border-radius: var(--radius-sm); }
.restock-item-info { flex: 1; min-width: 0; }
.restock-item-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.restock-item-stock { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.restock-item-stock.low { color: var(--orange); font-weight: 600; }
.restock-item-stock.out { color: var(--red); font-weight: 600; }
.restock-qty-input {
  width: 70px;
  padding: 8px 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color 0.15s;
}
.restock-qty-input:focus { border-color: var(--green); }
.restock-qty-input::placeholder { color: var(--text-muted); font-weight: 400; }
.restock-new-stock { font-size: 11px; color: var(--green); font-weight: 700; min-width: 60px; text-align: right; }
.restock-empty { text-align: center; padding: 40px 16px; color: var(--text-muted); font-size: 13px; }
.restock-barcode-hint { font-size: 11px; color: var(--text-muted); text-align: center; padding: 8px 16px 4px; border-top: 1px solid var(--border-light); }

/* ─── PURCHASE ORDER SYSTEM ─── */
#po-candidates {
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--bg-surface);
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 12px;
}
#po-candidates > div:hover {
  background: var(--bg-hover);
}
#po-items-list {
  max-height: 300px;
  overflow-y: auto;
}
#po-items-list > div:last-child {
  border-bottom: none !important;
}
.receive-po-qty {
  width: 60px;
  padding: 4px 6px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text);
  font-size: 12px;
  text-align: center;
}
.receive-po-qty:focus {
  border-color: var(--accent);
  outline: none;
}
#receive-po-payment-options .btn {
  transition: all 0.15s;
  font-size: 12px;
  font-weight: 600;
}
#receive-po-payment-options .btn-primary {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
}
#receive-po-payment-options .btn-secondary {
  background: var(--bg-surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border-light) !important;
}
#receive-po-payment-options .btn-secondary:hover {
  background: var(--bg-hover) !important;
}
.btn-success {
  background: var(--green) !important;
  color: #fff !important;
  border-color: var(--green) !important;
}
.btn-success:hover {
  background: var(--green-hover, #16a34a) !important;
}
/* Provider/PO table tweaks */
#view-providers .table td,
#view-purchase-orders .table td {
  vertical-align: middle;
}
#po-status-filter {
  padding: 6px 10px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text);
  font-size: 12px;
  outline: none;
}

/* ─── LICENSE SCREEN (fullscreen, matches PIN elegance) ─── */
.license-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.license-screen.hidden { display: none !important; }

.license-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: 480px;
  padding: 40px;
}

.license-title {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
  letter-spacing: 0.5px;
}

.license-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: -16px;
}

.license-input-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.license-input-wrap input {
  width: 100%;
  padding: 16px 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  color: #fff;
  font-size: 18px;
  font-family: 'Courier New', monospace;
  text-align: center;
  letter-spacing: 3px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.license-input-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.license-input-wrap input::placeholder {
  color: var(--text-muted);
  font-size: 14px;
  letter-spacing: 2px;
}

.license-format-hint {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.license-error {
  font-size: 13px;
  color: var(--red);
  min-height: 20px;
  opacity: 0;
  transition: opacity 0.2s;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--red-bg);
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}
.license-error.visible {
  opacity: 1;
}

.license-activate-btn {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--accent);
  color: var(--bg-primary);
  font-size: 15px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
  font-family: var(--font-sans);
}
.license-activate-btn:hover {
  opacity: 0.9;
}
.license-activate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.license-trial-btn-main {
  width: 100%;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: #ffffff;
  color: #111111;
  font-size: 17px;
  font-weight: 700;
  border: 2px solid #ffffff;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  font-family: var(--font-sans);
  letter-spacing: 0.3px;
}
.license-trial-btn-main:hover {
  opacity: 0.9;
  transform: scale(1.01);
}
.license-trial-btn-main:active {
  transform: scale(0.99);
}

.license-or-activate {
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s;
  margin-top: -12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.license-or-activate:hover {
  color: var(--text-secondary);
}

.license-input-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.license-input-section.hidden { display: none !important; }

.license-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
  margin-top: -16px;
  white-space: pre-line;
}
