/* ==========================================================================
   STYLE.CSS - JSKM POS Desktop Application Theme (PT. Jasa Service Komputer Mart)
   Aesthetics: Sleek Modern Dark/Glassmorphism theme with high-end neon accents.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  /* Colors - Sleek Dark Theme (Default) */
  --bg-app: #090d16;
  --bg-sidebar: #0f1626;
  --bg-card: rgba(22, 30, 49, 0.7);
  --bg-card-hover: rgba(30, 41, 67, 0.85);
  --bg-input: #151e33;
  --border-color: rgba(255, 255, 255, 0.08);
  
  --primary: #2563eb;
  --primary-glow: rgba(37, 99, 235, 0.35);
  --primary-gradient: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-green-glow: rgba(16, 185, 129, 0.2);
  --accent-amber: #f59e0b;
  --accent-amber-glow: rgba(245, 158, 11, 0.2);
  --accent-red: #ef4444;
  --accent-red-glow: rgba(239, 68, 68, 0.2);
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-inverse: #ffffff;
  
  --glass-blur: blur(12px);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --border-radius: 12px;
  --border-radius-lg: 18px;
  
  --font-sans: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition-speed: 0.2s;
}

/* Light Theme overrides */
body.light-theme {
  --bg-app: #f4f6f9;
  --bg-sidebar: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --bg-input: #f1f3f7;
  --border-color: rgba(0, 0, 0, 0.08);
  
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --text-inverse: #000000;
  
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.06);
}

/* Global Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  outline: none;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
/* Ensure brand title gradient works across browsers */
.brand-title {
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

body {
  background: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  overflow: hidden; /* Desktop app layout, custom scrollable containers */
  transition: background var(--transition-speed), color var(--transition-speed);
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* --- Layout Grid --- */
.app-container {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100vh;
  width: 100vw;
}

/* Sidebar navigation */
.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px 16px;
  position: relative;
  z-index: 10;
  transition: background var(--transition-speed);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  padding: 0 8px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 0 15px var(--primary-glow);
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-item-btn {
  width: 100%;
  border: none;
  background: transparent;
  padding: 12px 16px;
  border-radius: var(--border-radius);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all var(--transition-speed);
  text-align: left;
}

.nav-item-btn:hover {
  background: var(--bg-card);
  color: var(--text-main);
  transform: translateX(4px);
}

.nav-item-btn.active {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 15px var(--primary-glow);
  transform: translateX(4px);
}

.nav-item-btn svg {
  width: 18px;
  height: 18px;
}

.sidebar-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--border-radius);
  background: rgba(255, 255, 255, 0.03);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 12px;
  color: var(--accent-cyan);
  border: 1px solid var(--border-color);
}

.user-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-role {
  font-size: 10px;
  color: var(--text-muted);
}

.btn-logout {
  width: 100%;
  border: 1px solid var(--accent-red);
  background: transparent;
  color: var(--accent-red);
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition-speed);
}

.btn-logout:hover {
  background: var(--accent-red);
  color: white;
  box-shadow: 0 4px 12px var(--accent-red-glow);
}

/* --- Main Content Panel --- */
.main-content {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Header section containing Clock, Store info, Shift */
.header-bar {
  height: 70px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-sidebar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  z-index: 9;
}

.header-clock-container {
  display: flex;
  flex-direction: column;
}

.clock-time {
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
}

.clock-date {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.header-store-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  padding: 6px 14px;
  border-radius: 30px;
  border: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 600;
}

.shift-tag {
  background: var(--accent-cyan);
  color: var(--bg-app);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 800;
}

.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition-speed);
}

.theme-toggle-btn:hover {
  color: var(--text-main);
  background: var(--bg-input);
}

/* Dashboard Body containing Views */
.view-viewport {
  flex-grow: 1;
  overflow-y: auto;
  padding: 32px;
  position: relative;
}

.viewport-view {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.viewport-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Dashboard / Home Grid --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--glass-shadow);
  transition: transform var(--transition-speed), background var(--transition-speed);
}

.stat-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 22px;
}

.stat-icon.sales { background: linear-gradient(135deg, #10b981 0%, #059669 100%); box-shadow: 0 4px 14px var(--accent-green-glow); }
.stat-icon.transactions { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); box-shadow: 0 4px 14px var(--primary-glow); }
.stat-icon.items { background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%); box-shadow: 0 4px 14px rgba(6, 182, 212, 0.25); }
.stat-icon.stock { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); box-shadow: 0 4px 14px var(--accent-amber-glow); }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 20px;
  font-weight: 800;
}

.stat-card-large {
  grid-column: span 2;
  height: 380px;
}

.grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  min-height: 250px;
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.panel-title svg {
  color: var(--accent-cyan);
}

.low-stock-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: 250px;
  padding-right: 4px;
}

.low-stock-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: 8px;
}

.low-stock-item:hover {
  background: rgba(239, 68, 68, 0.08);
}

.low-stock-info {
  display: flex;
  flex-direction: column;
}

.low-stock-name {
  font-size: 13px;
  font-weight: 600;
}

.low-stock-code {
  font-size: 11px;
  color: var(--text-muted);
}

.low-stock-count {
  background: var(--accent-red);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

/* Best Sellers List */
.best-seller-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: 250px;
}

.best-seller-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.best-seller-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.best-seller-rank {
  font-weight: 800;
  font-size: 14px;
  color: var(--accent-cyan);
  width: 24px;
}

.best-seller-name {
  font-size: 13px;
  font-weight: 600;
}

.best-seller-sales {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-green);
  text-align: right;
}

/* --- KASIR VIEW --- */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  height: calc(100vh - 150px);
}

.pos-catalogue {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.pos-search-bar {
  display: flex;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: var(--border-radius);
  flex-shrink: 0;
}

.input-group {
  position: relative;
  flex-grow: 1;
}

.input-group svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
}

.pos-input {
  width: 100%;
  height: 44px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  padding-left: 44px;
  padding-right: 14px;
  font-size: 14px;
  transition: all var(--transition-speed);
}

.pos-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn-scan-camera {
  height: 44px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--accent-cyan);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all var(--transition-speed);
}

.btn-scan-camera:hover {
  background: var(--accent-cyan);
  color: var(--bg-app);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

/* Category Quick-filter chips */
.pos-categories-filter {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  flex-shrink: 0;
}

.category-chip {
  padding: 6px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-speed);
}

.category-chip:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.category-chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* Product list container grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  gap: 16px;
  overflow-y: auto;
  flex-grow: 1;
  padding-bottom: 16px;
  min-height: 0;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-speed);
  cursor: pointer;
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.15);
}

.product-card-image {
  height: 120px;
  background: #111827;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-image-fallback {
  font-size: 32px;
  opacity: 0.3;
}

.product-card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  color: var(--accent-cyan);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
}

.product-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-card-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 6px;
  height: 36px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.product-card-price {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent-green);
  margin-top: auto;
}

.product-card.out-of-stock {
  opacity: 0.6;
}

.product-card.out-of-stock::before {
  content: 'STOK HABIS';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  color: var(--accent-red);
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  backdrop-filter: blur(2px);
}

/* Cart Panel (POS Right Column) */
.pos-cart-panel {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: var(--glass-shadow);
}

.cart-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-badge {
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.btn-clear-cart {
  background: transparent;
  border: none;
  color: var(--accent-red);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-clear-cart:hover {
  text-decoration: underline;
}

/* Scrollable Cart Items */
.cart-items-list {
  flex-grow: 1;
  min-height: 220px;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.cart-item-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cart-item-name {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.cart-item-price-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

.cart-item-discount-pill {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  width: fit-content;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.qty-control {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-input);
}

.qty-btn {
  background: transparent;
  border: none;
  color: var(--text-main);
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
}

.qty-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.qty-val {
  width: 28px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--text-main);
}

.cart-item-subtotal {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-green);
}

.btn-remove-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
}

.btn-remove-item:hover {
  color: var(--accent-red);
  background: rgba(239, 68, 68, 0.05);
}

/* Cart calculation and checkout form */
.cart-calculation {
  padding: 10px 14px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 1;
  max-height: 50vh;
  overflow-y: auto;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}

.calc-row.total {
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
  margin-top: 4px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}

.calc-row.total span:last-child {
  color: var(--accent-green);
}

/* Pay methods tabs */
.pay-methods-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.btn-pay-method {
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-muted);
  padding: 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-speed);
}

.btn-pay-method:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.btn-pay-method.active {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}

.btn-pay-method svg {
  width: 18px;
  height: 18px;
}

/* Input fields for payment execution */
.payment-execution-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.checkout-input {
  width: 100%;
  height: 40px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  padding: 0 12px;
  font-size: 13px;
}

.checkout-input:focus {
  border-color: var(--accent-cyan);
}

/* Hide spin buttons on number inputs for cleaner UI */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  appearance: none;
  margin: 0; 
}
input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.btn-checkout {
  width: 100%;
  height: 48px;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 4px 15px var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition-speed);
}

.btn-checkout:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

.btn-checkout:disabled {
  background: var(--border-color);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* --- STOCK / INVENTORY VIEW --- */
.stock-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tab-nav-bar {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  gap: 16px;
}

.tab-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
}

.tab-nav-btn.active {
  color: var(--primary);
}

.tab-nav-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
}

.table-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  flex-wrap: wrap;
  gap: 16px;
}

.controls-left {
  display: flex;
  gap: 12px;
  flex-grow: 1;
}

.controls-right {
  display: flex;
  gap: 12px;
}

.btn-icon-label {
  height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.btn-icon-label:hover {
  background: var(--bg-card-hover);
}

.btn-icon-label.primary {
  background: var(--primary-gradient);
  border: none;
  color: white;
  box-shadow: 0 4px 10px var(--primary-glow);
}

.btn-icon-label.primary:hover {
  transform: translateY(-2px);
}

/* Database Table Styles */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg-card);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  background: var(--bg-sidebar);
  color: var(--text-muted);
  padding: 14px 16px;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border-color);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  transition: background var(--transition-speed);
}

.data-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr:hover {
  background: rgba(6, 182, 212, 0.08); /* Cyan hover highlight */
}

.thumbnail-cell {
  width: 40px;
  height: 40px;
  background: #111827;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.thumbnail-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.price-text {
  font-family: var(--font-mono);
  font-weight: 600;
}

.price-text.sell {
  color: var(--accent-green);
}

.price-text.buy {
  color: var(--accent-amber);
}

.badge-status {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.badge-status.success { background: rgba(16, 185, 129, 0.1); color: var(--accent-green); }
.badge-status.pending { background: rgba(245, 158, 11, 0.1); color: var(--accent-amber); }
.badge-status.cancel { background: rgba(239, 68, 68, 0.1); color: var(--accent-red); }
.badge-status.po { background: rgba(6, 182, 212, 0.1); color: var(--accent-cyan); }

.table-actions {
  display: flex;
  gap: 8px;
}

.btn-action {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.btn-action:hover {
  color: var(--text-main);
  background: var(--bg-card-hover);
}

.btn-action.edit:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.05);
}

.btn-action.delete:hover {
  color: var(--accent-red);
  border-color: var(--accent-red);
  background: rgba(239, 68, 68, 0.05);
}

/* SO Stock Opname Cards */
.so-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.so-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 20px;
}

.so-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.so-title {
  font-weight: 700;
  font-size: 14px;
}

.so-date {
  font-size: 11px;
  color: var(--text-muted);
}

.so-meta-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
}

.so-meta-label {
  color: var(--text-muted);
}

.so-meta-value {
  font-weight: 600;
}

.so-meta-value.diff-plus { color: var(--accent-green); }
.so-meta-value.diff-minus { color: var(--accent-red); }

/* --- MODAL DIALOGS --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeInModal 0.2s ease-out;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  width: 550px;
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
}

.modal-content.wide {
  width: 800px;
}

.modal-content.small {
  width: 380px;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-speed);
}

.btn-close-modal:hover {
  color: var(--accent-red);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

@keyframes fadeInModal {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.col-span-2 {
  grid-column: span 2;
}

.form-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input-wrapper {
  display: flex;
  gap: 8px;
}

.form-select {
  height: 40px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  padding: 0 12px;
  font-size: 13px;
  flex-grow: 1;
}

.btn-inline-add {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--accent-cyan);
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed);
}

.btn-inline-add:hover {
  background: var(--accent-cyan);
  color: var(--bg-app);
}

.photo-upload-container {
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color var(--transition-speed);
}

.photo-upload-container:hover {
  border-color: var(--primary);
}

.photo-preview {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  margin: 0 auto 8px auto;
  border: 1px solid var(--border-color);
}

.upload-placeholder {
  font-size: 12px;
  color: var(--text-muted);
}

/* Security Pin Form */
.pin-input-grid {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
}

.pin-digit {
  width: 45px;
  height: 45px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  color: var(--text-main);
}

.pin-digit:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

/* Camera Scanner Container */
.scanner-viewport {
  width: 100%;
  height: 250px;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.scanner-viewport video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-laser {
  position: absolute;
  top: 50%;
  left: 10%;
  width: 80%;
  height: 2px;
  background: var(--accent-red);
  box-shadow: 0 0 8px var(--accent-red);
  animation: laserScan 2s linear infinite;
  z-index: 10;
}

@keyframes laserScan {
  0% { top: 10%; }
  50% { top: 90%; }
  100% { top: 10%; }
}

/* --- SETTINGS / CONFIG VIEW --- */
.settings-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
}

.settings-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 12px;
  height: fit-content;
}

.settings-nav-btn {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 14px;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all var(--transition-speed);
}

.settings-nav-btn:hover {
  background: var(--bg-input);
  color: var(--text-main);
}

.settings-nav-btn.active {
  background: var(--primary);
  color: white;
}

.settings-content-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  display: none;
  animation: fadeIn 0.2s ease-out;
}

.settings-content-card.active {
  display: block;
}

.toggle-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.toggle-input {
  display: none;
}

.toggle-slider {
  width: 44px;
  height: 22px;
  background: var(--border-color);
  border-radius: 12px;
  position: relative;
  transition: background var(--transition-speed);
}

.toggle-slider::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform var(--transition-speed);
}

.toggle-input:checked + .toggle-slider {
  background: var(--accent-green);
}

.toggle-input:checked + .toggle-slider::after {
  transform: translateX(22px);
}

.chart-container {
  height: 300px;
  position: relative;
  margin-top: 16px;
}

/* Role checkboxes */
.authority-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 8px;
}

.auth-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  font-size: 12px;
  cursor: pointer;
}

.auth-checkbox-label input {
  cursor: pointer;
}

/* --- PRINT RECEIPT / STRUK A2 THERMAL --- */
#receipt-container {
  background: white;
  color: black;
  width: 250px; /* Thermal 80mm format */
  padding: 16px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  margin: 0 auto;
  border: 1px solid #ddd;
}

#receipt-container .receipt-center {
  text-align: center;
}

#receipt-container .receipt-logo {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 2px;
}

#receipt-container .receipt-address {
  font-size: 9px;
  color: #555;
  margin-bottom: 8px;
  line-height: 1.3;
}

#receipt-container .receipt-divider {
  border-top: 1px dashed black;
  margin: 8px 0;
}

#receipt-container .receipt-meta {
  font-size: 10px;
  margin-bottom: 8px;
  line-height: 1.4;
}

#receipt-container .receipt-table {
  width: 100%;
  border-collapse: collapse;
}

#receipt-container .receipt-table td {
  padding: 2px 0;
  vertical-align: top;
}

#receipt-container .receipt-item-name {
  word-break: break-all;
  font-size: 10px;
}

#receipt-container .receipt-item-calc {
  font-size: 9px;
  color: #333;
}

#receipt-container .receipt-item-total {
  text-align: right;
  font-size: 10px;
}

#receipt-container .receipt-row-summary {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  font-size: 10px;
}

#receipt-container .receipt-row-summary.bold {
  font-weight: bold;
  font-size: 11px;
}

#receipt-container .receipt-footer {
  text-align: center;
  margin-top: 16px;
  font-size: 9px;
  line-height: 1.4;
}

#receipt-container .receipt-barcode-placeholder {
  text-align: center;
  font-size: 8px;
  letter-spacing: 2px;
  margin-top: 12px;
  font-weight: bold;
}

/* Hiding Print Struk from Main Screen when not needed */
.print-only {
  display: none;
}

/* Print CSS Stylesheet */
@media print {
  body * {
    visibility: hidden;
  }
  
  #receipt-container, #receipt-container * {
    visibility: visible;
  }
  
  #receipt-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 80mm; /* Force size standard */
    box-shadow: none;
    border: none;
  }
}

/* Cleaned up stray CSS block */

/* ====================
   Additional Theme Definitions
   ==================== */

/* Orange primary button with flash effect */
.btn-icon-label.primary,
.button-primary,
.btn-primary {
  background: #ff6b00; /* orange */
  color: #ffffff;
  font-weight: 700;
  border: none;
  border-radius: var(--border-radius);
  padding: 8px 16px;
  cursor: pointer;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

/* Flash animation on click */
.btn-icon-label.primary:active,
.button-primary:active,
.btn-primary:active {
  animation: flash 150ms ease-out;
}

@keyframes flash {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.9; }
  100% { transform: scale(1); opacity: 1; }
}

/* Light theme overrides for white bold text */
body.light-theme {
  --text-main: #ffffff; /* white text */
  --text-bold: #ffffff;
  /* Ensure readability on light background – optional darker bg if needed */
  --bg-app: #fafafa;
  --bg-card: rgba(255,255,255,0.9);
  --bg-card-hover: rgba(255,255,255,0.95);
}

/* Apply bold to headings and important text */
body.light-theme h1, body.light-theme h2, body.light-theme h3, body.light-theme .login-title, body.light-theme .brand-title {
  color: var(--text-bold);
  font-weight: 800;
}

/* Glassmorphism theme */
body.glass-theme {
  --bg-app: rgba(255,255,255,0.6);
  --bg-card: rgba(255,255,255,0.4);
  --bg-card-hover: rgba(255,255,255,0.5);
  --glass-blur: blur(12px);
  --glass-shadow: 0 8px 32px 0 rgba(0,0,0,0.2);
}

/* Warm (orange accent) theme */
body.warm-theme {
  --primary: #ff6b00;
  --primary-gradient: linear-gradient(135deg, #ff6b00 0%, #ff8c00 100%);
  --accent-cyan: #ffb300;
  --accent-green: #ffa500;
  --accent-amber: #ff8c00;
  --text-main: #1f2937;
  --bg-app: #fdf6e3;
}

/* Ensure buttons in warm theme inherit orange primary */
body.warm-theme .btn-icon-label.primary {
  background: var(--primary);
}

/* End of additional theme definitions */
