/* ============================================================
   FlashPOS — Premium Dark Theme CSS
   ============================================================ */

/* Google Fonts already loaded in base.html */

/* === CSS Variables === */
:root {
  --bg-base: #0a0b14;
  --bg-surface: #111827;
  --bg-card: #1a2236;
  --bg-card-hover: #1e2a42;
  --bg-input: #0f172a;
  --bg-input-focus: #1e293b;

  --border: rgba(255, 255, 255, 0.07);
  --border-focus: rgba(245, 158, 11, 0.5);

  --primary: #f59e0b;
  --primary-hover: #d97706;
  --primary-glow: rgba(245, 158, 11, 0.25);
  --cyan: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.2);
  --green: #10b981;
  --green-glow: rgba(16, 185, 129, 0.2);
  --amber: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.2);
  --red: #ef4444;
  --red-glow: rgba(239, 68, 68, 0.2);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --text-link: #f59e0b;

  --sidebar-width: 250px;
  --topbar-height: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 30px rgba(245,158,11,0.15);

  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(139,92,246,0.4); border-radius: 99px; }

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition), width var(--transition);
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 14px;
  border-bottom: 1px solid var(--border);
  min-height: var(--topbar-height);
  gap: 10px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
  flex: 1;
}

.logo-texts {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.logo-text {
  font-size: 13.5px;
  font-weight: 800;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: 'Noto Sans Tamil', 'Inter', sans-serif;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.logo-sub {
  font-size: 9.5px;
  color: var(--text-muted);
  font-family: 'Inter', monospace;
  margin-top: 1px;
  white-space: nowrap;
}

/* Sidebar Toggle: Hidden on PC/Laptop views */
.sidebar-toggle {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.sidebar-toggle svg { width: 16px; height: 16px; }
.sidebar-toggle:hover {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.3);
}

/* On PC/Laptop / Desktop screens (width >= 769px), hide ALL hamburger buttons completely */
@media (min-width: 769px) {
  .sidebar-toggle,
  #sidebarToggle,
  #topbarToggleBtn {
    display: none !important;
  }
}

/* Navigation Section Labels */
.nav-section-label {
  padding: 14px 16px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
  opacity: 0.5;
}

/* Navigation */
.sidebar-nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 3px 12px;
  padding: 9px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  position: relative;
}

.nav-item:hover {
  background: rgba(245, 158, 11, 0.07);
  color: var(--text-primary);
  transform: translateX(3px);
  border-color: rgba(245, 158, 11, 0.15);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16) 0%, rgba(245, 158, 11, 0.06) 100%);
  color: #f59e0b;
  font-weight: 600;
  border-color: rgba(245, 158, 11, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nav-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.2s ease;
  color: var(--text-secondary);
}

.nav-icon svg { width: 16px; height: 16px; }

.nav-item:hover .nav-icon {
  background: rgba(245, 158, 11, 0.14);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.25);
}

.nav-item.active .nav-icon {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.45);
}

.nav-label {
  flex: 1;
  min-width: 0;
}

/* POS Live Pill Badge */
.pos-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.28);
  padding: 2px 8px;
  border-radius: 99px;
  letter-spacing: 0.04em;
  margin-left: auto;
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: live-pulse 1.8s infinite;
}
@keyframes live-pulse {
  0% { transform: scale(0.95); opacity: 0.8; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); opacity: 0.8; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Sidebar Status Card */
.sidebar-status-card {
  margin: 10px 12px 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.status-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  flex-shrink: 0;
}
.status-indicator-dot.pulse {
  animation: live-pulse 2s infinite;
}
.status-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.status-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}
.status-sub {
  font-size: 9.5px;
  color: var(--text-muted);
  line-height: 1.2;
  margin-top: 2px;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.15);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  overflow: hidden;
  flex: 1;
}

.avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
}

.avatar-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid var(--bg-surface);
}

.user-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.user-role {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.2;
  margin-top: 2px;
}

.sidebar-logout-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: all 0.2s ease;
  text-decoration: none;
  flex-shrink: 0;
}
.sidebar-logout-btn:hover {
  background: rgba(239, 68, 68, 0.14);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.25);
}

/* ============================================================
   Main Content
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  transition: margin-left var(--transition);
}

.main-content.sidebar-collapsed { margin-left: 68px; }

.top-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-height);
  background: rgba(10, 11, 20, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

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

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.time-display {
  font-family: 'Inter', monospace;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.04);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.content-area { padding: 24px; flex: 1; min-width: 0; max-width: 100%; overflow-x: hidden; }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.card:hover { box-shadow: var(--shadow); }

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

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

.card-body { padding: 20px; }
.card-body.p0 { padding: 0; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
}

/* ============================================================
   Stat Cards
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

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

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 120px; height: 120px;
  border-radius: 50%;
  opacity: 0.08;
  transform: translate(30%, -30%);
}

.stat-card--primary::before { background: var(--primary); }
.stat-card--cyan::before { background: var(--cyan); }
.stat-card--purple::before { background: #a855f7; }
.stat-card--green::before { background: var(--green); }

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-card--primary:hover { border-color: rgba(139,92,246,0.4); box-shadow: var(--shadow-glow); }
.stat-card--cyan:hover { border-color: rgba(6,182,212,0.4); box-shadow: 0 0 30px var(--cyan-glow); }
.stat-card--green:hover { border-color: rgba(16,185,129,0.4); box-shadow: 0 0 30px var(--green-glow); }

.stat-icon { font-size: 28px; flex-shrink: 0; }
.stat-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--text-primary); line-height: 1.2; }
.stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ============================================================
   Charts
   ============================================================ */
.charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.chart-card { }
.chart-card--wide { }

.tables-row {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 16px;
  margin-bottom: 24px;
}

/* ============================================================
   Tables
   ============================================================ */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  background: rgba(0,0,0,0.3);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-primary);
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: rgba(139,92,246,0.04); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  box-shadow: 0 6px 20px rgba(139,92,246,0.4);
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-icon { padding: 8px; }
.btn-checkout {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  justify-content: center;
  border-radius: var(--radius);
}

/* ============================================================
   Forms
   ============================================================ */
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-input, .form-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  padding: 10px 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
}

.form-input:focus, .form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: var(--bg-input-focus);
}

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

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 36px;
}

.form-group { margin-bottom: 16px; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-group--wide { grid-column: 1 / -1; }

/* ============================================================
   Badges
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: capitalize;
}

.badge--cash { background: rgba(16,185,129,0.15); color: var(--green); }
.badge--card { background: rgba(6,182,212,0.15); color: var(--cyan); }
.badge--mobile { background: rgba(139,92,246,0.15); color: var(--primary); }
.badge--success { background: rgba(16,185,129,0.15); color: var(--green); }
.badge--muted { background: rgba(100,116,139,0.15); color: var(--text-muted); }

/* ============================================================
   Toolbar
   ============================================================ */
.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Search */
.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 280px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  padding: 9px 12px 9px 38px;
  outline: none;
  transition: all var(--transition);
}

.search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: var(--bg-input-focus);
}

.search-input::placeholder { color: var(--text-muted); }
.search-kbd {
  position: absolute;
  right: 10px;
  font-size: 10px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 5px;
}

/* ============================================================
   POS Terminal Layout
   ============================================================ */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 390px;
  gap: 12px;
  height: calc(100vh - var(--topbar-height) - 24px);
  max-height: calc(100vh - var(--topbar-height) - 24px);
  min-height: 0;
}

.pos-products-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.pos-search-bar { flex-shrink: 0; }
.pos-search-bar .search-input { width: 100%; }

/* Category filters */
.category-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  flex-shrink: 0;
  padding-bottom: 4px;
}
.category-filters::-webkit-scrollbar { height: 0; }

.cat-btn {
  padding: 6px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--text-secondary);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}

.cat-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.cat-btn.active {
  background: var(--primary-glow);
  border-color: var(--primary);
  color: var(--primary);
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  overflow-y: auto;
  padding: 2px;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  user-select: none;
}

.product-card:hover:not(.out-of-stock) {
  border-color: rgba(139,92,246,0.5);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--primary-glow);
}

.product-card.out-of-stock {
  opacity: 0.5;
  cursor: not-allowed;
}

.product-emoji { font-size: 28px; margin-bottom: 8px; }
.product-name { font-size: 13px; font-weight: 500; color: var(--text-primary); margin-bottom: 6px; line-height: 1.3; }
.product-meta { display: flex; flex-direction: column; gap: 2px; }
.product-price { font-size: 15px; font-weight: 700; color: var(--primary); }
.product-stock { font-size: 11px; color: var(--text-muted); }
.product-stock.low { color: var(--amber); }

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  color: var(--text-muted);
  grid-column: 1 / -1;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(139,92,246,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Cart Panel
   ============================================================ */
.pos-cart-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  position: relative;
}

.cart-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.cart-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
}

.cart-count {
  background: var(--primary);
  color: white;
  border-radius: 99px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Customer select */
.cart-customer {
  flex-shrink: 0;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.12);
}
.cart-customer-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 6px;
  align-items: center;
}
.cart-customer-grid label {
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 2px;
  display: block;
}
.cart-customer-grid .form-select,
.cart-customer-grid .form-control {
  padding: 2px 8px;
  font-size: 11px;
}

/* Cart Items: THE ONLY SCROLLABLE AREA */
.cart-items {
  flex: 1 1 0;
  min-height: 40px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 12px;
}

.cart-items::-webkit-scrollbar {
  width: 4px;
}
.cart-items::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.18);
  border-radius: 4px;
}

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
  min-height: 60px;
  color: var(--text-muted);
}

.cart-empty-icon { font-size: 28px; }

/* Pinned Cart Footer */
.pos-cart-footer {
  flex-shrink: 0;
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  z-index: 10;
}

.checkout-actions-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.checkout-sub-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.btn-print-action {
  background: #2563eb !important;
  color: #ffffff !important;
  border: none !important;
  padding: 8px 6px !important;
  font-weight: 600 !important;
  font-size: 12px !important;
  border-radius: 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  cursor: pointer !important;
  transition: all var(--transition) !important;
}
.btn-print-action:hover:not(:disabled) {
  background: #1d4ed8 !important;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.4) !important;
}

.btn-whatsapp-action {
  background: #25D366 !important;
  color: #ffffff !important;
  border: none !important;
  padding: 8px 6px !important;
  font-weight: 600 !important;
  font-size: 12px !important;
  border-radius: 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  cursor: pointer !important;
  transition: all var(--transition) !important;
}
.btn-whatsapp-action:hover:not(:disabled) {
  background: #20bd5a !important;
  box-shadow: 0 2px 10px rgba(37, 211, 102, 0.4) !important;
}

.btn-print-action:disabled,
.btn-whatsapp-action:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  animation: slideIn 0.2s ease;
  margin-bottom: 3px;
}

.cart-item:hover { background: rgba(255,255,255,0.05); }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 13px; font-weight: 600; color: #ffffff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.cart-item-price { font-size: 11px; color: #cbd5e1; margin-top: 2px; }
.item-unit-price { font-weight: 600; color: #f1f5f9; }
.item-gst-tag { color: var(--cyan); font-weight: 600; font-size: 10px; background: rgba(6,182,212,0.12); padding: 1px 4px; border-radius: 3px; }
.cart-item-controls { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.qty-btn {
  width: 22px; height: 22px;
  background: rgba(255,255,255,0.08);
  border: none;
  border-radius: 4px;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.qty-btn:hover { background: var(--primary-glow); }
.qty-value { font-size: 13px; font-weight: 600; min-width: 18px; text-align: center; }
.cart-item-total { font-size: 13px; font-weight: 700; flex-shrink: 0; min-width: 48px; text-align: right; color: var(--green); }
.cart-item-remove { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 2px 4px; font-size: 12px; flex-shrink: 0; transition: color var(--transition); border-radius: 4px; }
.cart-item-remove:hover { color: var(--red); background: var(--red-glow); }

@keyframes slideIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }

/* Cart Summary */
.cart-summary {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.summary-total {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}

.discount-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
}

.discount-input {
  width: 70px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  padding: 4px 8px;
  text-align: right;
  outline: none;
}
.discount-input:focus { border-color: var(--border-focus); }

/* Payment */
.payment-section { padding: 12px 16px; }

.payment-methods {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.pay-btn {
  flex: 1;
  padding: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.pay-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.pay-btn.active { background: var(--primary-glow); border-color: var(--primary); color: var(--primary); }

.amount-paid-section { margin-bottom: 10px; }

.amount-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  margin-bottom: 8px;
  transition: border-color var(--transition);
}
.amount-input-wrap:focus-within { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--primary-glow); }
.amount-currency { color: var(--text-muted); font-size: 16px; }
.amount-input { flex: 1; background: none; border: none; color: var(--text-primary); font-size: 18px; font-weight: 600; font-family: inherit; padding: 10px 8px; outline: none; }

.quick-amounts { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.quick-amount-btn {
  padding: 5px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.quick-amount-btn:hover { background: var(--primary-glow); border-color: var(--primary); color: var(--primary); }

.change-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 8px;
}
.change-amount { font-size: 18px; font-weight: 700; }

/* ============================================================
   Receipt
   ============================================================ */
.receipt {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 12px;
  color: #0f172a;
}

.receipt-header { text-align: center; margin-bottom: 12px; }
.receipt-logo { font-size: 18px; font-weight: 800; font-family: 'Inter', sans-serif; margin-bottom: 4px; color: #0f172a; letter-spacing: -0.02em; }
.receipt-id { font-weight: 800; font-size: 14px; color: #0f172a; margin-top: 4px; }
.receipt-date, .receipt-customer, .receipt-payment { color: #64748b; font-size: 11px; margin-top: 2px; }
.receipt-divider { border-top: 1px dashed #cbd5e1; margin: 10px 0; }

.receipt-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 12px;
  font-size: 12px;
}

.receipt-totals { margin-top: 6px; }
.receipt-row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 12px; color: #475569; }
.receipt-row--total { font-size: 15px; font-weight: 800; color: #0f172a; border-top: 1.5px solid #0f172a; border-bottom: 1.5px solid #0f172a; padding: 6px 0; margin-top: 4px; }
.receipt-footer { text-align: center; color: #64748b; font-size: 11px; margin-top: 14px; font-family: 'Inter', sans-serif; }

/* ============================================================
   Modals
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-backdrop.open { opacity: 1; pointer-events: auto; }

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  z-index: 2001;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: 90%;
  max-width: 560px;
}

.modal.open { display: block !important; opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid rgba(139,92,246,0.3);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(139,92,246,0.15);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto !important;
}

.modal-sm { max-width: 420px; }

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

.modal-header h3 { font-size: 16px; font-weight: 700; }

.modal-close {
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: all var(--transition);
}
.modal-close:hover { background: rgba(239,68,68,0.15); color: var(--red); border-color: var(--red); }

.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; flex-shrink: 0; }

/* ============================================================
   Dashboard Specific
   ============================================================ */
.top-products-list { display: flex; flex-direction: column; gap: 12px; }
.top-product-item { display: flex; align-items: center; gap: 12px; }
.top-product-rank { font-size: 13px; font-weight: 700; color: var(--primary); min-width: 24px; }
.top-product-info { flex: 1; min-width: 0; }
.top-product-name { font-size: 13px; font-weight: 500; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress-bar { height: 6px; background: rgba(255,255,255,0.07); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--cyan)); border-radius: 99px; transition: width 0.6s ease; }
.top-product-revenue { font-size: 13px; font-weight: 700; color: var(--text-primary); flex-shrink: 0; }

.low-stock-list { padding: 4px 0; }
.low-stock-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background var(--transition);
}
.low-stock-item:hover { background: rgba(255,255,255,0.02); }
.low-stock-name { font-size: 13px; font-weight: 500; }
.low-stock-sku { font-size: 11px; color: var(--text-muted); }
.low-stock-count { font-size: 12px; font-weight: 700; }

.sale-id { font-weight: 600; color: var(--primary); }

/* ============================================================
   Products Page
   ============================================================ */
.products-stats {
  display: flex;
  gap: 20px;
  font-size: 13px;
  margin-bottom: 14px;
}
.stat-strip-item { color: var(--text-secondary); }
.product-name-cell { display: flex; align-items: center; gap: 10px; }
/* ============================================================
   Products Inventory Table & Sticky Header
   ============================================================ */
.products-card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
}

.table-responsive-container {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
  position: relative;
  scrollbar-width: thin;
}

.products-inventory-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 0;
}

.products-inventory-table thead th {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #151c2e;
  color: #94a3b8;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 11px 14px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

.products-inventory-table tbody td {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
  font-size: 13px;
}

.products-inventory-table tbody tr:hover td {
  background: rgba(139, 92, 246, 0.06);
}

.product-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

.product-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.product-meta {
  min-width: 0;
}

.product-title-text {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.25;
}

.product-barcode-text {
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
  margin-top: 1px;
}

.sku-code {
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  white-space: nowrap;
}

.hsn-code-cell {
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
  font-family: monospace;
}

.badge-gst {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-block;
  white-space: nowrap;
}

.badge-gst-zero {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.badge-gst-tax {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.product-price-cell {
  font-size: 14px;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
}

.profit-good {
  color: #34d399;
  font-weight: 600;
  font-size: 12px;
}

.profit-normal {
  color: #94a3b8;
  font-size: 12px;
}

.stock-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
}

.stock-ok {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.stock-low {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.stock-out {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}

.status-active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-inactive {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.action-btns {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
}

.btn-action-edit {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
}
.btn-action-edit:hover {
  background: rgba(59, 130, 246, 0.25);
  color: #ffffff;
}

.btn-action-stock {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
}
.btn-action-stock:hover {
  background: rgba(245, 158, 11, 0.25);
  color: #ffffff;
}

.btn-action-delete {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 6px;
}
.btn-action-delete:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ffffff;
}

/* ============================================================
   Customers Grid
   ============================================================ */
.customers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.customer-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all var(--transition);
}

.customer-card:hover {
  border-color: rgba(139,92,246,0.3);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.customer-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
  flex-shrink: 0;
}

.customer-name { font-size: 15px; font-weight: 700; }
.customer-email, .customer-phone { font-size: 12px; color: var(--text-muted); }

.customer-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px;
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-sm);
}

.customer-stat { text-align: center; }
.customer-stat-value { font-size: 14px; font-weight: 700; }
.customer-stat-label { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

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

/* ============================================================
   Reports
   ============================================================ */
.reports-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.period-selector {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.04);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.period-btn {
  padding: 6px 14px;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}
.period-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.07); }
.period-btn.active { background: var(--primary); color: white; box-shadow: 0 2px 8px var(--primary-glow); }

/* ============================================================
   Pagination
   ============================================================ */
.pagination { display: flex; gap: 6px; align-items: center; }
.page-btn {
  padding: 6px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.page-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ============================================================
   Toast Notifications
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  min-width: 260px;
  transform: translateX(110%);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.visible { transform: none; }
.toast--success { border-left: 3px solid var(--green); }
.toast--error { border-left: 3px solid var(--red); }
.toast--warning { border-left: 3px solid var(--amber); }
.toast--info { border-left: 3px solid var(--cyan); }
.toast-icon { font-size: 16px; }
.toast-msg { color: var(--text-primary); font-weight: 500; }

/* ============================================================
   Utility Classes
   ============================================================ */
.text-primary { color: var(--primary); }
.text-success { color: var(--green); }
.text-warning { color: var(--amber); }
.text-danger { color: var(--red); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-sm { font-size: 12px; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.p-4 { padding: 16px; }
.p0 { padding: 0; }

/* ============================================================
   Print Styles — Bulletproof Single Page & Clean Modal Print
   ============================================================ */
@page {
  size: portrait;
  margin: 6mm 10mm;
}

@media print {
  /* Hide all app chrome, layout containers, and background views */
  .sidebar,
  .top-bar,
  .pos-mobile-nav,
  .pos-mobile-floating-bar,
  .page-toolbar,
  .toast-container,
  .modal-backdrop,
  .modal-header,
  .modal-footer,
  .pos-layout,
  .dashboard,
  .reports-toolbar,
  .stats-grid,
  .charts-row,
  .tables-row,
  .settings-container,
  .settings-action-bar,
  .card:not(#receiptModal .card):not(.receipt) {
    display: none !important;
  }

  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 11px !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  .main-content {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  .content-area {
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  /* When modal is printed */
  .modal.open {
    position: static !important;
    display: block !important;
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 380px !important;
    box-shadow: none !important;
    border: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .modal.open .modal-dialog {
    position: static !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 auto !important;
    background: transparent !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  .modal.open .modal-body {
    padding: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    background: transparent !important;
  }

  .receipt {
    background: #ffffff !important;
    color: #000000 !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .receipt-header, .receipt-items, .receipt-totals, .receipt-footer {
    color: #000000 !important;
  }

  .receipt-logo {
    color: #000000 !important;
    font-size: 16px !important;
    font-weight: 800 !important;
  }

  .receipt-row--total {
    color: #000000 !important;
    font-weight: 800 !important;
    border-top: 1px solid #000000 !important;
  }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .charts-row, .tables-row { grid-template-columns: 1fr; }
  .pos-layout { grid-template-columns: 1fr; grid-template-rows: auto auto; height: auto; }
  .pos-cart-panel { height: auto; }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }

  /* Mobile Drawer Sidebar (Always sits above backdrop at z-index 2100) */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 280px !important;
    max-width: 85vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    transform: translateX(-100%) !important;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.28s !important;
    z-index: 2100 !important;
    visibility: hidden;
    background: var(--bg-surface) !important;
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0) !important;
    visibility: visible !important;
    box-shadow: 8px 0 36px rgba(0, 0, 0, 0.75) !important;
  }

  .main-content {
    margin-left: 0 !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  .content-area {
    padding: 14px 12px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
  .stats-grid { grid-template-columns: 1fr 1fr; }

  /* Top Bar & Mobile Hamburger Button */
  .top-bar {
    padding: 0 12px !important;
    gap: 8px !important;
  }

  .top-bar-left {
    min-width: 0;
    flex: 1;
    overflow: hidden;
  }

  .page-title {
    font-size: 15px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  #topbarToggleBtn {
    display: inline-flex !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    color: var(--text-primary) !important;
    cursor: pointer;
    flex-shrink: 0;
  }

  #topbarToggleBtn svg {
    width: 20px !important;
    height: 20px !important;
  }

  #topbarToggleBtn:hover,
  #topbarToggleBtn:active {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #f59e0b !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
  }

  /* Close Button in Sidebar Header */
  #sidebarToggle {
    display: inline-flex !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    align-items: center;
    justify-content: center;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: var(--text-primary) !important;
    cursor: pointer;
    flex-shrink: 0;
  }

  #sidebarToggle:hover,
  #sidebarToggle:active {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.35) !important;
  }

  @media (max-width: 600px) {
    .time-display { display: none !important; }
    .gst-badge { display: none !important; }
    .top-bar-right { gap: 6px !important; }
    .demo-btn-text { display: none !important; }
    #demoConsoleBtn { padding: 5px 8px !important; font-size: 13px !important; }
  }

  @media (max-width: 480px) {
    .content-area { padding: 8px 6px !important; }
    .top-bar { padding: 0 8px !important; }
    .page-title { font-size: 13px !important; max-width: 140px !important; }
  }
}

/* ============================================================
   Mobile POS (<= 768px) Segmented Navigation & Full-Width Ticket
   ============================================================ */
.pos-mobile-nav {
  display: none;
}
.pos-mobile-floating-bar {
  display: none;
}
.mobile-back-to-menu-btn {
  display: none;
}

@media (max-width: 768px) {
  /* Mobile Segmented Navigation Tabs */
  .pos-mobile-nav {
    display: flex !important;
    gap: 6px;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.22);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--border);
    flex-shrink: 0;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .pos-mobile-tab-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
  }

  .pos-mobile-tab-btn.active {
    background: linear-gradient(135deg, var(--warm-amber, #e67e22), var(--warm-amber-deep, #d35400)) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(230, 126, 34, 0.35);
  }

  .pos-mobile-cart-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    border-radius: 99px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 800;
    min-width: 18px;
    text-align: center;
  }

  .pos-mobile-tab-btn.active .pos-mobile-cart-badge {
    background: #ffffff;
    color: var(--warm-amber-deep, #d35400);
  }

  /* POS Layout in mobile */
  .pos-layout {
    display: block !important;
    height: calc(100dvh - var(--topbar-height, 48px) - 64px) !important;
    max-height: calc(100dvh - var(--topbar-height, 48px) - 64px) !important;
    min-height: 0 !important;
    overflow: hidden !important;
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Toggle between Menu and Cart */
  .pos-layout.mobile-show-menu .pos-products-panel {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    overflow-y: auto !important;
  }
  .pos-layout.mobile-show-menu .pos-cart-panel {
    display: none !important;
  }

  .pos-layout.mobile-show-cart .pos-products-panel {
    display: none !important;
  }
  .pos-layout.mobile-show-cart .pos-cart-panel {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    border-radius: 12px !important;
  }

  /* Default (if neither class is present yet, show menu) */
  .pos-layout:not(.mobile-show-cart) .pos-products-panel {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
  }
  .pos-layout:not(.mobile-show-cart) .pos-cart-panel {
    display: none !important;
  }

  /* Products Grid in Mobile */
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
    gap: 8px !important;
    padding: 2px !important;
  }

  /* Mobile floating cart bar (appears on menu view when cart has items) */
  .pos-mobile-floating-bar {
    position: fixed;
    bottom: 12px;
    left: 12px;
    right: 12px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 1.5px solid var(--warm-amber, #e67e22);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 16px rgba(230, 126, 34, 0.25);
    border-radius: 14px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1050;
    cursor: pointer;
    animation: slideUpFloat 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  }

  @keyframes slideUpFloat {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }

  .floating-bar-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
  }
  .floating-bar-count {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
  }
  .floating-bar-total {
    font-size: 16px;
    font-weight: 800;
    color: var(--warm-amber, #e67e22);
  }
  .floating-bar-action {
    background: linear-gradient(135deg, var(--warm-amber, #e67e22), var(--warm-amber-deep, #d35400));
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(230, 126, 34, 0.3);
  }

  /* Cart Panel Inside Mobile View */
  .pos-cart-panel {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    flex-direction: column !important;
  }

  .cart-header {
    padding: 10px 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
  }

  .mobile-back-to-menu-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 3px;
    font-size: 11px !important;
    padding: 4px 8px !important;
    border-radius: 6px !important;
    border: 1px solid var(--border) !important;
    color: var(--text-secondary) !important;
    background: rgba(255, 255, 255, 0.06) !important;
    cursor: pointer;
  }

  .cart-customer {
    padding: 8px 10px !important;
  }

  .cart-customer-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
  }

  .cart-customer-grid label {
    font-size: 10px !important;
    margin-bottom: 2px !important;
  }

  .cart-customer-grid .form-select,
  .cart-customer-grid .form-control {
    width: 100% !important;
    box-sizing: border-box !important;
    height: 28px !important;
    font-size: 11px !important;
  }

  .cart-items {
    padding: 6px 8px !important;
    min-height: 40px !important;
    flex: 1 1 auto !important;
    overflow-y: auto !important;
  }

  .cart-item {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 8px 10px !important;
    gap: 4px 6px !important;
    margin-bottom: 6px !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .cart-item-info {
    flex: 1 1 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: baseline !important;
    margin-bottom: 2px !important;
  }

  .cart-item-name {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    white-space: normal !important;
    line-height: 1.25 !important;
  }

  .cart-item-price {
    font-size: 11px !important;
    color: var(--text-muted) !important;
    white-space: nowrap !important;
  }

  .cart-item-controls {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
  }

  .cart-item-total {
    font-size: 13px !important;
    font-weight: 800 !important;
    color: var(--warm-amber, #e67e22) !important;
    margin-left: auto !important;
    padding-right: 6px !important;
    text-align: right !important;
  }

  .cart-summary {
    padding: 8px 12px !important;
    box-sizing: border-box !important;
  }

  .summary-row {
    padding: 3px 0 !important;
    font-size: 12px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .summary-total {
    font-size: 16px !important;
    font-weight: 800 !important;
  }

  .discount-input-wrap {
    gap: 2px !important;
  }

  .discount-input {
    width: 60px !important;
    height: 24px !important;
    font-size: 12px !important;
    padding: 2px 4px !important;
  }

  .payment-section {
    padding: 8px 12px !important;
    box-sizing: border-box !important;
  }

  .payment-methods {
    display: flex !important;
    gap: 4px !important;
    margin-bottom: 6px !important;
    width: 100% !important;
  }

  .pay-btn {
    flex: 1 1 0 !important;
    padding: 7px 4px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
    text-align: center !important;
    min-width: 0 !important;
    border-radius: 8px !important;
  }

  .amount-paid-section {
    margin-bottom: 6px !important;
  }

  .quick-amounts {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
  }

  .quick-amount-btn {
    padding: 3px 7px !important;
    font-size: 11px !important;
    border-radius: 6px !important;
  }

  .amount-input-wrap {
    height: 32px !important;
    padding: 0 8px !important;
    margin-bottom: 4px !important;
  }

  .amount-input {
    height: 28px !important;
    font-size: 14px !important;
    padding: 2px 6px !important;
  }

  .change-display {
    padding: 4px 8px !important;
    font-size: 12px !important;
    margin-bottom: 4px !important;
  }

  .checkout-actions-wrapper {
    gap: 5px !important;
    margin-top: 6px !important;
  }

  .btn-checkout {
    padding: 10px 14px !important;
    font-size: 13px !important;
    border-radius: 10px !important;
    width: 100% !important;
  }

  .checkout-sub-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .btn-print-action, .btn-whatsapp-action {
    padding: 8px 6px !important;
    font-size: 11px !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
    justify-content: center !important;
  }
}

@media (max-width: 340px) {
  .pos-mobile-tab-btn {
    padding: 6px 4px !important;
    font-size: 11px !important;
  }
  .pay-btn {
    padding: 6px 2px !important;
    font-size: 10px !important;
  }
  .btn-print-action, .btn-whatsapp-action {
    font-size: 10px !important;
    padding: 7px 2px !important;
  }
  .quick-amount-btn {
    font-size: 10px !important;
    padding: 2px 5px !important;
  }
}

@media (min-width: 769px) {
  .pos-mobile-nav { display: none !important; }
  .pos-mobile-floating-bar { display: none !important; }
  .mobile-back-to-menu-btn { display: none !important; }
  .pos-layout .pos-products-panel { display: flex !important; }
  .pos-layout .pos-cart-panel { display: flex !important; }
}

/* ============================================================
   Tamil Nadu / India Specific Styles
   ============================================================ */
.gst-badge { font-size:11px; font-weight:600; color:var(--green); background:rgba(16,185,129,0.12); border:1px solid rgba(16,185,129,0.3); padding:4px 10px; border-radius:99px; letter-spacing:0.04em; }
.upi-section { background:rgba(139,92,246,0.08); border:1px solid rgba(139,92,246,0.25); border-radius:var(--radius-sm); padding:12px; margin-bottom:10px; text-align:center; }
.upi-id { font-size:15px; font-weight:700; color:var(--primary); margin-bottom:4px; }
.gst-breakdown { margin:0 16px 4px; padding:8px 12px; background:rgba(6,182,212,0.06); border:1px solid rgba(6,182,212,0.2); border-radius:var(--radius-sm); }
.gst-row { display:flex; justify-content:space-between; font-size:12px; color:var(--cyan); padding:2px 0; }
.product-gst-badge { display:inline-block; font-size:10px; font-weight:600; color:var(--cyan); background:rgba(6,182,212,0.1); border:1px solid rgba(6,182,212,0.2); border-radius:4px; padding:1px 6px; margin-bottom:4px; }
.gst-summary-strip { display:flex; align-items:center; background:rgba(6,182,212,0.06); border:1px solid rgba(6,182,212,0.2); border-radius:var(--radius); margin-bottom:20px; overflow:hidden; }
.gst-strip-item { flex:1; display:flex; flex-direction:column; align-items:center; padding:12px 16px; gap:4px; }
.gst-strip-label { font-size:11px; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.06em; }
.gst-strip-val { font-size:16px; font-weight:700; color:var(--cyan); }
.gst-strip-divider { width:1px; height:40px; background:rgba(6,182,212,0.2); }
.gst-calc-preview { display:flex; gap:16px; flex-wrap:wrap; padding:10px 12px; background:rgba(6,182,212,0.06); border:1px solid rgba(6,182,212,0.2); border-radius:var(--radius-sm); font-size:12px; color:var(--cyan); margin-top:8px; }
.badge--upi { background:rgba(139,92,246,0.15); color:var(--primary); }
.badge--cyan { background:rgba(6,182,212,0.15); color:var(--cyan); }
.nav-label, .page-title, .stat-label, .form-label { font-family:'Noto Sans Tamil','Inter',sans-serif; }

/* ============================================================
   Bootstrap 5 Compatibility Styles
   ============================================================ */
.modal-backdrop.fade.show {
  opacity: 0.6 !important;
}
.modal.fade.show {
  background: rgba(0,0,0,0.4);
}
.card {
  background-color: var(--bg-card) !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
}
.text-muted {
  color: var(--text-secondary) !important;
}
.table {
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
}
.table th, .table td {
  background-color: transparent !important;
  border-bottom-color: var(--border) !important;
  color: var(--text-primary) !important;
}
.progress {
  background-color: rgba(255,255,255,0.07) !important;
}
.form-control, .form-select {
  background-color: var(--bg-input) !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
}
.form-control:focus, .form-select:focus {
  border-color: var(--border-focus) !important;
  background-color: var(--bg-input-focus) !important;
  color: var(--text-primary) !important;
  box-shadow: 0 0 0 3px var(--primary-glow) !important;
}

/* ============================================================
   Language Visibility Rules
   ============================================================ */
html.lang-en .lang-ta { display: none !important; }
html.lang-ta .lang-en { display: none !important; }

/* ============================================================
   Light Theme Variable Overrides
   ============================================================ */
html.theme-light {
  --bg-base: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input: #f8fafc;
  --bg-input-focus: #ffffff;

  --border: rgba(0, 0, 0, 0.08);
  --border-focus: rgba(245, 158, 11, 0.6);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-link: #d97706;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 12px rgba(0,0,0,0.05);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
  --shadow-glow: 0 0 20px rgba(245,158,11,0.1);
}

/* Specific Light Theme Overrides */
html.theme-light body {
  background: var(--bg-base);
  color: var(--text-primary);
}

html.theme-light .text-white {
  color: var(--text-primary) !important;
}

html.theme-light .top-bar {
  background: rgba(241, 245, 249, 0.8) !important;
  border-bottom-color: var(--border) !important;
}

html.theme-light .time-display {
  background: rgba(0,0,0,0.03) !important;
  border-color: var(--border) !important;
  color: var(--text-secondary) !important;
}

html.theme-light .sidebar {
  background: #ffffff !important;
  border-right-color: #e2e8f0 !important;
  box-shadow: 1px 0 6px rgba(0, 0, 0, 0.03);
}

html.theme-light .sidebar-header {
  border-bottom-color: #f1f5f9 !important;
}

html.theme-light .nav-section-label {
  color: #94a3b8 !important;
}
html.theme-light .nav-section-label::after {
  background: #e2e8f0 !important;
}

html.theme-light .nav-item {
  color: #64748b !important;
}

html.theme-light .nav-item:hover {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: #e2e8f0 !important;
}

html.theme-light .nav-item.active {
  background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 100%) !important;
  color: #b45309 !important;
  border-color: #fde68a !important;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.12) !important;
}

html.theme-light .nav-icon {
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
  color: #64748b !important;
}

html.theme-light .nav-item:hover .nav-icon {
  background: #fef3c7 !important;
  color: #d97706 !important;
  border-color: #fde68a !important;
}

html.theme-light .nav-item.active .nav-icon {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: #ffffff !important;
  border-color: #d97706 !important;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.35) !important;
}

html.theme-light .pos-live-pill {
  color: #047857 !important;
  background: #d1fae5 !important;
  border-color: #a7f3d0 !important;
}

html.theme-light .sidebar-status-card {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}
html.theme-light .status-title {
  color: #0f172a !important;
}
html.theme-light .status-sub {
  color: #64748b !important;
}

html.theme-light .sidebar-footer {
  background: #f8fafc !important;
  border-top-color: #e2e8f0 !important;
}
html.theme-light .avatar-online-dot {
  border-color: #ffffff !important;
}
html.theme-light .user-name {
  color: #0f172a !important;
}
html.theme-light .user-role {
  color: #64748b !important;
}
html.theme-light .sidebar-logout-btn {
  color: #64748b !important;
}
html.theme-light .sidebar-logout-btn:hover {
  background: #fee2e2 !important;
  color: #dc2626 !important;
  border-color: #fca5a5 !important;
}

html.theme-light .sidebar-toggle {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}
html.theme-light .sidebar-toggle:hover {
  background: #fef3c7 !important;
  color: #d97706 !important;
  border-color: #f59e0b !important;
}

html.theme-light .table th {
  background: rgba(0, 0, 0, 0.02) !important;
  color: var(--text-secondary) !important;
}

html.theme-light .cat-btn {
  background: rgba(0, 0, 0, 0.04) !important;
  color: var(--text-secondary) !important;
  border-color: var(--border) !important;
}

html.theme-light .cat-btn:hover {
  background: rgba(0, 0, 0, 0.07) !important;
  color: var(--text-primary) !important;
}

html.theme-light .cat-btn.active {
  background: var(--primary-glow) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

html.theme-light .product-card {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

html.theme-light .product-card:hover:not(.out-of-stock) {
  background: #f8fafc !important;
  border-color: #6366f1 !important;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15) !important;
}

html.theme-light .product-name {
  color: #0f172a !important;
  font-weight: 700 !important;
}

html.theme-light .product-price {
  color: #0f172a !important;
  font-weight: 800 !important;
}

html.theme-light .product-stock {
  color: #15803d !important;
  font-weight: 600 !important;
}

html.theme-light .product-gst-badge {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
  font-weight: 700 !important;
}

html.theme-light .pos-cart-panel {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
}

html.theme-light .cart-header, html.theme-light .cart-customer {
  border-bottom-color: var(--border) !important;
}

html.theme-light .cart-item {
  border-bottom-color: rgba(0,0,0,0.06) !important;
  background: #f8fafc !important;
}

html.theme-light .cart-item:hover {
  background: rgba(139,92,246,0.05) !important;
}

html.theme-light .cart-item-name {
  color: #0f172a !important;
}

html.theme-light .cart-item-price {
  color: #475569 !important;
}

html.theme-light .item-unit-price {
  color: #0f172a !important;
}

html.theme-light .cart-summary {
  background: rgba(0,0,0,0.01) !important;
  border-top-color: var(--border) !important;
}

html.theme-light .modal-dialog {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
  box-shadow: var(--shadow-lg) !important;
}

html.theme-light .modal-header {
  border-bottom-color: var(--border) !important;
}

html.theme-light .modal-footer {
  border-top-color: var(--border) !important;
}

html.theme-light .stat-card {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
}

html.theme-light .stat-card::before {
  opacity: 0.04 !important;
}

html.theme-light .stat-card--primary:hover {
  border-color: rgba(139,92,246,0.3) !important;
}

html.theme-light .stat-card--cyan:hover {
  border-color: rgba(6,182,212,0.3) !important;
}

html.theme-light .stat-card--green:hover {
  border-color: rgba(16,185,129,0.3) !important;
}

html.theme-light .gst-summary-strip {
  background: rgba(6,182,212,0.03) !important;
  border-color: rgba(6,182,212,0.15) !important;
}

html.theme-light .gst-strip-divider {
  background: rgba(6,182,212,0.15) !important;
}

/* Light Theme Inventory Table Overrides (CRISP CONTRAST FOR LAPTOP & MONITOR) */
html.theme-light .products-card {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04) !important;
}

html.theme-light .products-inventory-table thead th {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  font-weight: 800 !important;
  border-bottom: 2px solid #cbd5e1 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

html.theme-light .products-inventory-table tbody td {
  border-bottom: 1px solid #e2e8f0 !important;
  color: #1e293b !important;
}

html.theme-light .products-inventory-table tbody tr:hover td {
  background: #f8fafc !important;
}

html.theme-light .product-title-text {
  color: #0f172a !important;
  font-weight: 700 !important;
}

html.theme-light .product-barcode-text {
  color: #64748b !important;
}

/* Light theme SKU: bold royal purple on pale violet - 7.5:1 ratio */
html.theme-light .sku-code {
  background: #ede9fe !important;
  color: #5b21b6 !important;
  border: 1px solid #c4b5fd !important;
  font-weight: 700 !important;
}

/* Light theme HSN: crisp dark slate */
html.theme-light .hsn-code-cell {
  color: #334155 !important;
  font-weight: 600 !important;
}

/* Light theme GST 0% (Toor Dal, Ponni Rice, Atta) */
html.theme-light .badge-gst-zero {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
  font-weight: 700 !important;
}

/* Light theme GST taxable (5%, 12%, 18%, 28%) */
html.theme-light .badge-gst-tax {
  background: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #86efac !important;
  font-weight: 700 !important;
}

/* Light theme Price */
html.theme-light .product-price-cell {
  color: #0f172a !important;
  font-weight: 800 !important;
}

/* Light theme Profit */
html.theme-light .profit-good {
  color: #166534 !important;
  font-weight: 700 !important;
}
html.theme-light .profit-normal {
  color: #475569 !important;
  font-weight: 600 !important;
}

/* Light theme Stock Pills */
html.theme-light .stock-ok {
  background: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #86efac !important;
}
html.theme-light .stock-low {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border: 1px solid #fcd34d !important;
}
html.theme-light .stock-out {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border: 1px solid #fca5a5 !important;
}

/* Light theme Status */
html.theme-light .status-active {
  background: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #86efac !important;
}
html.theme-light .status-inactive {
  background: #f1f5f9 !important;
  color: #64748b !important;
  border: 1px solid #cbd5e1 !important;
}

/* Light theme Action Buttons */
html.theme-light .btn-action-edit {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1px solid #bfdbfe !important;
}
html.theme-light .btn-action-edit:hover {
  background: #dbeafe !important;
  color: #1e40af !important;
}

html.theme-light .btn-action-stock {
  background: #fffbeb !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
}
html.theme-light .btn-action-stock:hover {
  background: #fef3c7 !important;
  color: #92400e !important;
}

html.theme-light .btn-action-delete {
  background: #fef2f2 !important;
  color: #b91c1c !important;
  border: 1px solid #fecaca !important;
}
html.theme-light .btn-action-delete:hover {
  background: #fee2e2 !important;
  color: #991b1b !important;
}

/* Transitions for Theme Switch Smoothness */
body, aside, main, .card, .stat-card, input, select, button, .top-bar, .table, th, td, .nav-item, .nav-icon {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease !important;
}

/* ============================================================
   Laptop & Monitor Responsive Rules
   ============================================================ */
@media (min-width: 769px) and (max-height: 860px) {
  :root {
    --topbar-height: 48px;
  }
  .top-bar {
    padding: 6px 16px;
    min-height: 48px;
    height: 48px;
  }
  .content-area {
    padding: 6px 12px;
  }
  .pos-layout {
    height: calc(100vh - 48px - 14px);
    max-height: calc(100vh - 48px - 14px);
    min-height: 0;
    gap: 8px;
    grid-template-columns: 1fr 380px;
  }
  .cart-header { padding: 8px 12px; }
  .cart-title { font-size: 14px; }
  .cart-customer { padding: 6px 10px; }
  .cart-empty { min-height: 45px; gap: 2px; }
  .cart-empty-icon { font-size: 20px; }
  .cart-summary { padding: 6px 10px; }
  .summary-row { padding: 1px 0; font-size: 12px; }
  .summary-total { font-size: 14px; padding-top: 3px; margin-top: 2px; }
  .payment-section { padding: 6px 10px; }
  .payment-methods { margin-bottom: 5px; gap: 4px; }
  .pay-btn { padding: 5px 6px; font-size: 11px; }
  .amount-paid-section { margin-bottom: 4px; }
  .amount-input-wrap { padding: 0 8px; margin-bottom: 3px; }
  .amount-currency { font-size: 14px; }
  .amount-input { padding: 3px 6px; font-size: 14px; height: 28px; }
  .quick-amounts { gap: 3px; margin-bottom: 0; }
  .quick-amount-btn { padding: 2px 6px; font-size: 11px; }
  .checkout-actions-wrapper { gap: 5px; margin-top: 5px; }
  .btn-checkout { padding: 7px 8px !important; font-size: 12px !important; }
  .btn-print-action, .btn-whatsapp-action { padding: 6px 6px !important; font-size: 11px !important; }
  .product-card { padding: 10px 8px; }
  .product-emoji { font-size: 22px; margin-bottom: 2px; }
  .product-name { font-size: 12px; margin-bottom: 2px; }
  .product-price { font-size: 13px; }
}

@media (min-width: 769px) and (max-height: 700px) {
  :root {
    --topbar-height: 42px;
  }
  .top-bar {
    padding: 4px 12px;
    min-height: 42px;
    height: 42px;
  }
  .content-area {
    padding: 4px 8px;
  }
  .pos-layout {
    height: calc(100vh - 42px - 10px);
    max-height: calc(100vh - 42px - 10px);
    min-height: 0;
    gap: 6px;
    grid-template-columns: 1fr 370px;
  }
  .cart-header { padding: 6px 10px; }
  .cart-customer { padding: 5px 8px; }
  .cart-customer .form-select,
  .cart-customer input { height: 26px !important; font-size: 11px !important; padding: 2px 6px !important; }
  .cart-empty { min-height: 35px; gap: 0; }
  .cart-empty-icon { font-size: 18px; }
  .cart-empty p { font-size: 11px; }
  .cart-summary { padding: 4px 8px; }
  .summary-row { padding: 1px 0; font-size: 11px; }
  .summary-total { font-size: 13px; padding-top: 2px; margin-top: 1px; }
  .payment-section { padding: 5px 8px; }
  .payment-methods { margin-bottom: 3px; gap: 3px; }
  .pay-btn { padding: 3px 4px; font-size: 10px; }
  .amount-input-wrap { padding: 0 6px; margin-bottom: 2px; }
  .amount-input { height: 24px; font-size: 13px; padding: 2px 4px; }
  .checkout-actions-wrapper { gap: 4px; margin-top: 4px; }
  .btn-checkout { padding: 6px 6px !important; font-size: 11px !important; }
  .btn-print-action, .btn-whatsapp-action { padding: 5px 4px !important; font-size: 11px !important; }
}

@media (min-width: 769px) and (max-width: 1100px) {
  .pos-layout {
    grid-template-columns: 1fr 340px;
  }
}

@media (min-width: 769px) and (max-height: 550px) {
  :root {
    --topbar-height: 38px;
  }
  .top-bar {
    padding: 2px 12px;
    min-height: 38px;
    height: 38px;
  }
  .content-area {
    padding: 3px 8px;
  }
  .pos-layout {
    height: calc(100vh - 38px - 6px);
    max-height: calc(100vh - 38px - 6px);
    min-height: 0;
    gap: 6px;
    grid-template-columns: 1fr 360px;
  }
  .product-card {
    padding: 6px 4px !important;
  }
  .product-emoji {
    font-size: 16px !important;
    margin-bottom: 2px !important;
  }
  .product-name {
    font-size: 11px !important;
    margin-bottom: 1px !important;
    line-height: 1.15 !important;
  }
  .product-gst-badge {
    font-size: 8px !important;
    padding: 0 3px !important;
    margin-bottom: 2px !important;
  }
  .product-price {
    font-size: 12px !important;
  }
  .product-stock {
    font-size: 9px !important;
  }
  .cart-header {
    padding: 4px 10px !important;
  }
  .cart-title {
    font-size: 13px !important;
  }
  .cart-customer {
    padding: 3px 8px !important;
  }
  .cart-items {
    padding: 4px 6px !important;
    min-height: 30px !important;
  }
  .cart-empty {
    min-height: 28px !important;
    gap: 0 !important;
  }
  .cart-empty-icon {
    font-size: 14px !important;
  }
  .cart-empty p {
    font-size: 10px !important;
  }
  .cart-item {
    padding: 4px 6px !important;
    margin-bottom: 2px !important;
  }
  .cart-item-name {
    font-size: 12px !important;
  }
  .cart-item-price {
    font-size: 10px !important;
  }
  .cart-item-total {
    font-size: 12px !important;
    min-width: 42px !important;
  }
  .cart-summary {
    padding: 3px 8px !important;
  }
  .summary-row {
    padding: 1px 0 !important;
    font-size: 11px !important;
  }
  .summary-total {
    font-size: 13px !important;
    padding-top: 1px !important;
    margin-top: 1px !important;
  }
  .discount-input {
    width: 50px !important;
    height: 20px !important;
    font-size: 11px !important;
    padding: 1px 4px !important;
  }
  .payment-section {
    padding: 3px 8px !important;
  }
  .payment-methods {
    margin-bottom: 3px !important;
    gap: 3px !important;
  }
  .pay-btn {
    padding: 2px 4px !important;
    font-size: 10px !important;
  }
  .amount-paid-section {
    margin-bottom: 2px !important;
  }
  .quick-amounts {
    display: none !important;
  }
  .amount-input-wrap {
    height: 24px !important;
    padding: 0 6px !important;
    margin-bottom: 2px !important;
  }
  .amount-currency {
    font-size: 12px !important;
  }
  .amount-input {
    height: 22px !important;
    font-size: 12px !important;
    padding: 1px 4px !important;
  }
  .change-display {
    padding: 2px 6px !important;
    margin-bottom: 2px !important;
    font-size: 11px !important;
  }
  .change-amount {
    font-size: 12px !important;
  }
  .checkout-actions-wrapper {
    gap: 3px !important;
    margin-top: 3px !important;
  }
  .btn-checkout {
    height: 28px !important;
    padding: 2px 6px !important;
    font-size: 11px !important;
  }
  .checkout-sub-actions {
    gap: 3px !important;
  }
  .btn-print-action,
  .btn-whatsapp-action {
    height: 26px !important;
    padding: 2px 4px !important;
    font-size: 10px !important;
  }
}

/* ============================================================
   Inventory Table Laptop & Compact Display Adjustments
   ============================================================ */
@media (max-width: 1200px) {
  .content-area {
    padding: 8px 12px !important;
  }
  .page-toolbar {
    margin-bottom: 8px !important;
  }
  .products-stats {
    margin-bottom: 8px !important;
  }
  .products-inventory-table {
    table-layout: auto !important;
  }
  .products-inventory-table thead th {
    padding: 7px 6px !important;
    font-size: 10px !important;
  }
  .products-inventory-table tbody td {
    padding: 6px 6px !important;
    font-size: 12px !important;
  }
  .product-name-cell {
    min-width: 120px !important;
    max-width: 150px !important;
    gap: 6px !important;
  }
  .product-icon {
    font-size: 16px !important;
  }
  .product-title-text {
    font-size: 12px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .product-barcode-text {
    font-size: 10px !important;
  }
  .sku-code {
    padding: 1px 4px !important;
    font-size: 11px !important;
  }
  .action-btns {
    gap: 3px !important;
    justify-content: flex-end !important;
  }
  .action-btns .btn-lbl {
    display: none !important;
  }
  .action-btns .btn-sm {
    padding: 3px 6px !important;
    font-size: 12px !important;
    min-width: 26px !important;
    justify-content: center !important;
  }
  .table-responsive-container {
    max-height: calc(100vh - 165px) !important;
  }
}

@media (max-height: 700px) {
  .table-responsive-container {
    max-height: calc(100vh - 145px) !important;
  }
}

/* ============================================================
   Strict Global Print Overrides (Ensures zero bleed from app)
   ============================================================ */
@media print {
  body > *:not(#receiptModal),
  .sidebar,
  .top-bar,
  .main-content > header,
  .pos-layout,
  .pos-products-panel,
  .products-grid,
  .product-card,
  .pos-cart-panel,
  .pos-mobile-nav,
  .pos-mobile-floating-bar,
  .page-toolbar,
  .toast-container,
  .modal-backdrop,
  .modal-header,
  .modal-footer,
  #demoConsoleModal,
  #receiptPrintIframe {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
  }
}


