﻿/* Sembacode CSS - by SambutanCode */
:root[data-theme="dark"] {
  --bg-primary: #0b0f19;
  --bg-secondary: #131926;
  --bg-glass: rgba(19,25,38,0.85);
  --border-glass: rgba(255,255,255,0.08);
  --shadow-premium: 0 8px 32px rgba(0,0,0,0.37);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --color-violet: #8b5cf6;
  --color-violet-hover: #7c3aed;
  --color-violet-glow: rgba(139,92,246,0.2);
  --color-emerald: #10b981;
  --color-emerald-hover: #059669;
  --color-emerald-glow: rgba(16,185,129,0.2);
  --color-amber: #f59e0b;
  --color-amber-hover: #d97706;
  --color-amber-glow: rgba(245,158,11,0.2);
  --color-rose: #f43f5e;
  --color-rose-hover: #e11d48;
  --color-rose-glow: rgba(244,63,94,0.2);
  --input-bg: #1e293b;
  --input-border: #334155;
  --input-focus: #475569;
  --sidebar-width: 240px;
  --header-height: 64px;
}
:root[data-theme="light"] {
  --bg-primary: #f1f5f9;
  --bg-secondary: #ffffff;
  --bg-glass: rgba(255,255,255,0.9);
  --border-glass: rgba(0,0,0,0.07);
  --shadow-premium: 0 4px 24px rgba(31,38,135,0.08);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --color-violet: #6d28d9;
  --color-violet-hover: #5b21b6;
  --color-violet-glow: rgba(109,40,217,0.12);
  --color-emerald: #047857;
  --color-emerald-hover: #065f46;
  --color-emerald-glow: rgba(4,120,87,0.12);
  --color-amber: #b45309;
  --color-amber-hover: #92400e;
  --color-amber-glow: rgba(180,83,9,0.12);
  --color-rose: #be123c;
  --color-rose-hover: #9f1239;
  --color-rose-glow: rgba(190,18,60,0.12);
  --input-bg: #f1f5f9;
  --input-border: #cbd5e1;
  --input-focus: #94a3b8;
  --sidebar-width: 240px;
  --header-height: 64px;
}

/* --- Reset & Base --- */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { font-size: 16px; }
body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}
h1,h2,h3,h4,h5,h6 { font-family: 'Outfit', sans-serif; font-weight: 600; }
a { text-decoration: none; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* --- App Layout --- */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  z-index: 200;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), width 0.3s ease;
  overflow: hidden;
}
.sidebar-brand {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  border-bottom: 1px solid var(--border-glass);
  flex-shrink: 0;
}
.brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--color-violet), #4f46e5);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1rem;
  box-shadow: 0 4px 10px var(--color-violet-glow);
  flex-shrink: 0;
}
.brand-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem; font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  white-space: nowrap;
}
.brand-name span { color: var(--color-violet); }

.sidebar-menu {
  flex: 1; padding: 16px 10px;
  display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto;
}
.menu-item {
  display: flex; align-items: center;
  padding: 11px 14px;
  color: var(--text-secondary);
  border-radius: 8px; gap: 12px;
  font-size: 0.9rem; font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.menu-item i { font-size: 1rem; width: 18px; text-align: center; flex-shrink: 0; }
.menu-item:hover { background-color: var(--input-bg); color: var(--text-primary); }
.menu-item.active {
  background: linear-gradient(90deg, var(--color-violet-glow) 0%, transparent 100%);
  color: var(--color-violet);
  border-left: 3px solid var(--color-violet);
  font-weight: 600;
}

.sidebar-footer {
  padding: 14px 10px;
  border-top: 1px solid var(--border-glass);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.user-badge { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-avatar {
  width: 34px; height: 34px;
  background-color: var(--color-violet); color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; flex-shrink: 0;
}
.user-info { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.72rem; color: var(--text-muted); }
.btn-logout {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.1rem; cursor: pointer; padding: 7px; border-radius: 6px;
  transition: all 0.2s ease; flex-shrink: 0;
}
.btn-logout:hover { color: var(--color-rose); background-color: var(--color-rose-glow); }

/* --- Main Content --- */
.main-content {
  flex: 1; display: flex; flex-direction: column;
  height: 100%; overflow: hidden; min-width: 0;
}

/* --- Header --- */
.header {
  height: var(--header-height);
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-glass);
  padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  z-index: 90; flex-shrink: 0; gap: 12px;
}
.header-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.sidebar-toggle {
  background: none; border: none; color: var(--text-secondary);
  font-size: 1.2rem; cursor: pointer; padding: 6px; border-radius: 6px;
  display: none; flex-shrink: 0;
}
.sidebar-toggle:hover { color: var(--text-primary); background: var(--input-bg); }
.page-title { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Theme Toggle */
.theme-toggle {
  background: var(--input-bg); border: 1px solid var(--input-border);
  cursor: pointer; width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); transition: all 0.2s ease; flex-shrink: 0;
}
.theme-toggle:hover { color: var(--text-primary); transform: scale(1.05); }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="light"] .icon-moon { display: none; }

/* Notification */
.notification-dropdown { position: relative; }
.notification-trigger {
  background: var(--input-bg); border: 1px solid var(--input-border);
  cursor: pointer; width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); position: relative; flex-shrink: 0;
}
.notification-trigger:hover { color: var(--text-primary); }
.notification-trigger .badge {
  position: absolute; top: -3px; right: -3px;
  background-color: var(--color-rose); color: #fff;
  font-size: 0.6rem; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
.dropdown-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 300px; background-color: var(--bg-secondary);
  border: 1px solid var(--border-glass); border-radius: 12px;
  box-shadow: var(--shadow-premium); display: none; z-index: 300; overflow: hidden;
}
.dropdown-panel.active { display: block; animation: slideDownFade 0.2s ease; }
.dropdown-header {
  padding: 12px 16px; border-bottom: 1px solid var(--border-glass);
  display: flex; align-items: center; justify-content: space-between;
}
.dropdown-header h3 { font-size: 0.9rem; }
.btn-clear-all { background: none; border: none; color: var(--color-violet); font-size: 0.78rem; cursor: pointer; font-weight: 500; }
.dropdown-list { max-height: 240px; overflow-y: auto; padding: 8px; }
.notif-item {
  display: flex; gap: 10px; padding: 8px 10px; border-radius: 8px;
  cursor: pointer; font-size: 0.8rem; align-items: flex-start;
  margin-bottom: 4px; border-left: 3px solid transparent;
}
.notif-item:hover { background-color: var(--input-bg); }
.notif-item.notif-warning { border-left-color: var(--color-amber); background-color: var(--color-amber-glow); }
.notif-item.notif-danger { border-left-color: var(--color-rose); background-color: var(--color-rose-glow); }
.notif-item.notif-success { border-left-color: var(--color-emerald); background-color: var(--color-emerald-glow); }
.notif-content strong { display: block; margin-bottom: 2px; }
.notif-content p { color: var(--text-secondary); font-size: 0.75rem; }
.empty-state { padding: 20px; text-align: center; color: var(--text-muted); font-size: 0.82rem; }

/* Status Indicator */
.status-indicator {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 12px; background-color: var(--input-bg);
  border-radius: 20px; font-size: 0.78rem; font-weight: 500;
}
.dot { width: 7px; height: 7px; border-radius: 50%; }
.pulse-success {
  background-color: var(--color-emerald);
  box-shadow: 0 0 0 0 rgba(16,185,129,0.7);
  animation: pulse 1.6s infinite;
}

/* --- View Container --- */
.view-container { flex: 1; overflow: hidden; position: relative; display: flex; flex-direction: column; }
.view-section { display: none; height: 100%; width: 100%; }
.view-section.active { display: flex; flex-direction: column; animation: fadeIn 0.3s ease; }
#view-dashboard, #view-products, #view-stock, #view-purchases, #view-debts, #view-reports {
  overflow-y: auto; padding: 20px; flex: 1; gap: 0;
}
#view-pos { padding: 16px; height: 100%; overflow: hidden; }

/* --- Glass Panel --- */
.glass-panel {
  background-color: var(--bg-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
  border-radius: 12px; padding: 16px;
  box-shadow: var(--shadow-premium);
  margin-bottom: 16px;
}

/* --- Dashboard Grid --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px; margin-bottom: 16px;
}
.stat-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: 12px; padding: 16px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-premium);
  cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover { transform: translateY(-3px); }
.stat-card.card-violet:hover { box-shadow: 0 8px 24px var(--color-violet-glow); }
.stat-card.card-emerald:hover { box-shadow: 0 8px 24px var(--color-emerald-glow); }
.stat-card.card-amber:hover { box-shadow: 0 8px 24px var(--color-amber-glow); }
.stat-card.card-rose:hover { box-shadow: 0 8px 24px var(--color-rose-glow); }
.stat-card .card-body { display: flex; align-items: center; gap: 14px; }
.stat-card .card-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
.card-violet .card-icon { background-color: var(--color-violet-glow); color: var(--color-violet); }
.card-emerald .card-icon { background-color: var(--color-emerald-glow); color: var(--color-emerald); }
.card-amber .card-icon { background-color: var(--color-amber-glow); color: var(--color-amber); }
.card-rose .card-icon { background-color: var(--color-rose-glow); color: var(--color-rose); }
.card-data { display: flex; flex-direction: column; min-width: 0; }
.card-label { font-size: 0.72rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.card-value { font-size: 1.35rem; font-weight: 700; color: var(--text-primary); margin: 3px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-subtext { font-size: 0.72rem; color: var(--text-muted); }

/* --- Charts Row --- */
.charts-row { display: flex; gap: 14px; margin-bottom: 16px; }
.chart-card { min-height: 260px; }
.chart-header { margin-bottom: 12px; }
.chart-header h3 { font-size: 0.95rem; font-weight: 600; }
.chart-body { position: relative; height: 200px; width: 100%; }
.flex-2 { flex: 2; min-width: 0; }
.flex-1 { flex: 1; min-width: 0; }

/* --- Dashboard Bottom Row --- */
.dashboard-bottom-row { display: flex; gap: 14px; }
.max-h-400 { max-height: 400px; }
.overflow-y { overflow-y: auto; }

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 14px; padding: 8px 0; }
.timeline-item {
  display: flex; gap: 12px; position: relative; padding-left: 18px;
}
.timeline-item::before {
  content: ''; position: absolute; left: 3px; top: 5px;
  width: 8px; height: 8px; border-radius: 50%;
  background-color: var(--color-violet);
  box-shadow: 0 0 0 3px var(--color-violet-glow);
}
.timeline-item::after {
  content: ''; position: absolute; left: 6px; top: 15px; bottom: -14px;
  width: 2px; background-color: var(--border-glass);
}
.timeline-item:last-child::after { display: none; }
.timeline-item.mut-in::before { background-color: var(--color-emerald); box-shadow: 0 0 0 3px var(--color-emerald-glow); }
.timeline-item.mut-out::before { background-color: var(--color-rose); box-shadow: 0 0 0 3px var(--color-rose-glow); }
.timeline-content { display: flex; flex-direction: column; font-size: 0.82rem; }
.timeline-time { font-size: 0.7rem; color: var(--text-muted); margin-bottom: 2px; }
.timeline-title { font-weight: 600; }
.timeline-desc { color: var(--text-secondary); }
.timeline-empty { padding: 20px; text-align: center; color: var(--text-muted); font-size: 0.82rem; }

/* Quick Actions */
.quick-actions-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.btn-quick {
  background-color: var(--bg-secondary); border: 1px solid var(--border-glass);
  border-radius: 10px; padding: 18px 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--text-primary); cursor: pointer;
  font-weight: 600; font-size: 0.82rem; transition: all 0.2s ease;
}
.btn-quick i { font-size: 1.4rem; color: var(--color-violet); }
.btn-quick:hover { transform: translateY(-2px); border-color: var(--color-violet); box-shadow: 0 4px 12px var(--color-violet-glow); }
.flex-column { display: flex; flex-direction: column; }
.gap-3 { gap: 12px; }
.justify-center { justify-content: center; }
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.panel-header h3 { font-size: 0.95rem; font-weight: 600; }
.justify-between { justify-content: space-between; }

/* --- Common Components --- */
.actions-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
}
.search-box { position: relative; flex: 1; min-width: 200px; }
.search-box i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.85rem; }
.search-box input {
  width: 100%; padding: 9px 12px 9px 36px;
  background-color: var(--input-bg); border: 1px solid var(--input-border);
  border-radius: 8px; color: var(--text-primary); font-size: 0.88rem; outline: none;
  transition: border-color 0.2s ease;
}
.search-box input:focus { border-color: var(--color-violet); box-shadow: 0 0 0 3px var(--color-violet-glow); }
.filter-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.form-select, .form-input {
  padding: 9px 12px;
  background-color: var(--input-bg); border: 1px solid var(--input-border);
  border-radius: 8px; color: var(--text-primary); font-size: 0.88rem; outline: none;
  transition: border-color 0.2s ease;
}
.form-select:focus, .form-input:focus { border-color: var(--color-violet); box-shadow: 0 0 0 3px var(--color-violet-glow); }
.form-select option { background-color: var(--bg-secondary); }

/* Tables */
.table-responsive { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.85rem; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border-glass); vertical-align: middle; }
.table th { background-color: rgba(0,0,0,0.04); color: var(--text-secondary); font-weight: 600; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.5px; white-space: nowrap; }
:root[data-theme="light"] .table th { background-color: rgba(0,0,0,0.03); }
.table tbody tr { transition: background-color 0.15s ease; }
.table tbody tr:hover { background-color: rgba(139,92,246,0.04); }
.table tbody tr:last-child td { border-bottom: none; }

/* Buttons */
.btn {
  padding: 8px 16px; border-radius: 8px; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; border: none; transition: all 0.2s ease; white-space: nowrap;
}
.btn i { flex-shrink: 0; }
.btn-primary { background-color: var(--color-violet); color: #fff; }
.btn-primary:hover { background-color: var(--color-violet-hover); box-shadow: 0 4px 12px var(--color-violet-glow); }
.btn-emerald { background-color: var(--color-emerald); color: #fff; }
.btn-emerald:hover { background-color: var(--color-emerald-hover); box-shadow: 0 4px 12px var(--color-emerald-glow); }
.btn-violet { background-color: var(--color-violet-glow); color: var(--color-violet); border: 1px solid var(--color-violet); }
.btn-violet:hover { background-color: var(--color-violet); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--input-border); color: var(--text-primary); }
.btn-outline:hover { background-color: var(--input-bg); }
.btn-sm { padding: 5px 10px; font-size: 0.78rem; border-radius: 6px; }
.btn-circle { width: 30px; height: 30px; border-radius: 50%; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: none; cursor: pointer; }
.width-full { width: 100%; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.fs-lg { font-size: 1rem; }
.font-bold { font-weight: 700; }
.mt-4 { margin-top: 16px; }
.mt-3 { margin-top: 12px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-emerald { color: var(--color-emerald); }
.text-rose { color: var(--color-rose); }
.text-amber { color: var(--color-amber); }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.align-self-end { align-self: flex-end; }
.width-grow { flex: 1; }
.width-70 { width: 70px; }
.text-rose { color: var(--color-rose); }

/* Badges */
.badge { padding: 3px 8px; border-radius: 10px; font-size: 0.72rem; font-weight: 600; display: inline-block; white-space: nowrap; }
.badge-success { background-color: var(--color-emerald-glow); color: var(--color-emerald); }
.badge-warning { background-color: var(--color-amber-glow); color: var(--color-amber); }
.badge-danger { background-color: var(--color-rose-glow); color: var(--color-rose); }
.badge-hint { background-color: var(--input-bg); color: var(--text-secondary); cursor: pointer; }
.badge-hint:hover { background-color: var(--input-focus); color: var(--text-primary); }

/* Product Thumbnail */
.prod-thumbnail {
  width: 34px; height: 34px; border-radius: 8px;
  background-color: var(--input-bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-violet); font-size: 1rem; flex-shrink: 0;
}

/* --- POS Layout --- */
.pos-layout { display: flex; gap: 16px; height: 100%; overflow: hidden; }
.pos-left-panel { flex: 3; display: flex; flex-direction: column; height: 100%; min-width: 0; }
.pos-header-actions { display: flex; gap: 10px; margin-bottom: 12px; }
.pos-categories {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px;
  margin-bottom: 12px; scrollbar-width: none; -ms-overflow-style: none;
}
.pos-categories::-webkit-scrollbar { display: none; }
.cat-pill {
  padding: 7px 14px; background-color: var(--bg-secondary);
  border: 1px solid var(--border-glass); border-radius: 20px;
  color: var(--text-secondary); cursor: pointer; font-size: 0.78rem;
  font-weight: 600; transition: all 0.2s ease; white-space: nowrap;
}
.cat-pill:hover { color: var(--text-primary); }
.cat-pill.active { background-color: var(--color-violet); color: #fff; border-color: var(--color-violet); }
.pos-products-grid {
  flex: 1; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px; overflow-y: auto; padding: 2px;
}
.pos-prod-card {
  background-color: var(--bg-secondary); border: 1px solid var(--border-glass);
  border-radius: 10px; padding: 10px; display: flex; flex-direction: column;
  cursor: pointer; position: relative; user-select: none; transition: all 0.2s ease;
}
.pos-prod-card:hover { transform: translateY(-2px); border-color: var(--color-violet); box-shadow: 0 4px 12px var(--color-violet-glow); }
.pos-prod-img {
  height: 52px; background-color: var(--input-bg); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-violet); font-size: 1.5rem; margin-bottom: 8px;
}
.pos-prod-info { flex: 1; display: flex; flex-direction: column; }
.pos-prod-name {
  font-size: 0.8rem; font-weight: 600; color: var(--text-primary);
  margin-bottom: 4px; line-height: 1.3; height: 32px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.pos-prod-price { font-weight: 700; color: var(--color-emerald); font-size: 0.85rem; margin-top: auto; }
.pos-prod-stock { font-size: 0.7rem; color: var(--text-muted); }
.pos-prod-card.low-stock::after {
  content: 'Tipis'; position: absolute; top: 6px; right: 6px;
  background-color: var(--color-amber); color: #fff;
  font-size: 0.6rem; font-weight: 700; padding: 2px 5px; border-radius: 4px;
}
.pos-prod-card.out-of-stock { opacity: 0.45; pointer-events: none; }
.pos-prod-card.out-of-stock::after {
  content: 'Habis'; position: absolute; top: 6px; right: 6px;
  background-color: var(--color-rose); color: #fff;
  font-size: 0.6rem; font-weight: 700; padding: 2px 5px; border-radius: 4px;
}
.pos-right-panel { flex: 1.4; display: flex; flex-direction: column; height: 100%; min-width: 280px; }
.pos-cart-list { flex: 1; overflow-y: auto; padding: 8px 0; }
.cart-empty { padding: 40px 10px; text-align: center; color: var(--text-muted); font-size: 0.85rem; }
.cart-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-glass); }
.cart-item-details { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cart-item-name { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-price { font-size: 0.75rem; color: var(--text-muted); }
.cart-item-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.qty-input { width: 34px; text-align: center; background: none; border: 1px solid var(--input-border); color: var(--text-primary); font-size: 0.8rem; padding: 2px 0; border-radius: 4px; }
.btn-cart-qty {
  width: 22px; height: 22px; border-radius: 50%; background-color: var(--input-bg);
  border: none; color: var(--text-primary); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 0.7rem;
}
.btn-cart-qty:hover { background-color: var(--input-focus); }
.cart-item-total { font-size: 0.82rem; font-weight: 700; color: var(--color-emerald); width: 72px; text-align: right; flex-shrink: 0; }
.btn-remove-item { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 3px; flex-shrink: 0; }
.btn-remove-item:hover { color: var(--color-rose); }
.btn-clear-cart { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 6px; border-radius: 6px; font-size: 0.9rem; }
.btn-clear-cart:hover { color: var(--color-rose); background: var(--color-rose-glow); }
.pos-totals { border-top: 1px solid var(--border-glass); padding-top: 14px; flex-shrink: 0; }
.total-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 0.88rem; color: var(--text-secondary); }
.total-row.main-total { color: var(--text-primary); font-size: 1.2rem; font-weight: 800; margin-top: 8px; }
.total-row.main-total span:last-child { color: var(--color-emerald); }
.divider { border: none; border-top: 1px solid var(--border-glass); margin: 8px 0; }
.checkout-actions { margin-top: 12px; }


/* --- Tabs --- */
.tab-container {
  display: flex; gap: 6px; padding: 6px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.tab-btn {
  padding: 8px 16px; background: none; border: none;
  color: var(--text-secondary); font-weight: 600; font-size: 0.85rem;
  cursor: pointer; border-radius: 8px; transition: all 0.2s ease;
}
.tab-btn:hover { color: var(--text-primary); background-color: var(--input-bg); }
.tab-btn.active { background-color: var(--color-violet); color: #fff; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* --- Purchase Form --- */
.purchase-form-layout { display: flex; gap: 16px; }
.purchase-item-adder {
  display: flex; gap: 10px; align-items: flex-start;
  flex-wrap: wrap; margin-bottom: 16px;
}
.secondary-bg { background-color: rgba(0,0,0,0.12) !important; }
.totals-panel { flex: 1; }
.form-group { display: flex; flex-direction: column; margin-bottom: 12px; }
.form-group label { font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 5px; }
.form-group-row { display: flex; gap: 12px; }
.input-action-group { display: flex; position: relative; width: 100%; }
.input-action-group input, .input-action-group select { flex: 1; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-action-group button { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-icon-group { display: flex; position: relative; width: 100%; }
.input-icon-group i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.input-icon-group input { padding-left: 36px; width: 100%; }

/* --- Modals --- */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background-color: rgba(0,0,0,0.55); backdrop-filter: blur(4px);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-card {
  width: 92%; max-width: 540px;
  background-color: var(--bg-secondary) !important;
  border: 1px solid var(--border-glass); border-radius: 16px; overflow: hidden;
  transform: scale(0.92); transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
  max-height: 90vh; display: flex; flex-direction: column;
}
.modal-overlay.active .modal-card { transform: scale(1); }
.modal-card.modal-lg { max-width: 720px; }
.modal-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border-glass);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-header h3 { font-size: 1.05rem; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.2rem; cursor: pointer; padding: 4px; border-radius: 4px; }
.modal-close:hover { color: var(--color-rose); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 20px; border-top: 1px solid var(--border-glass);
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  flex-shrink: 0;
}
.modal-split-view { display: flex; gap: 20px; min-height: 220px; }
.split-col { flex: 1; min-width: 0; }
.border-right { border-right: 1px solid var(--border-glass); padding-right: 20px; }
.list-groups { list-style: none; max-height: 180px; overflow-y: auto; margin-top: 10px; }
.list-groups li {
  padding: 8px 12px; background-color: var(--input-bg); border-radius: 6px;
  margin-bottom: 6px; display: flex; align-items: center; justify-content: space-between;
  font-size: 0.83rem;
}
.list-groups li button { background: none; border: none; color: var(--text-muted); cursor: pointer; }
.list-groups li button:hover { color: var(--color-rose); }

/* --- Login Screen --- */
.login-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: var(--bg-primary);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000; opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.login-overlay.active { opacity: 1; pointer-events: auto; }
.login-card {
  width: 92%; max-width: 420px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: 20px; padding: 36px 32px;
  box-shadow: var(--shadow-premium);
}
.login-brand {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 28px; justify-content: center;
}
.login-brand .brand-icon { width: 44px; height: 44px; font-size: 1.2rem; }
.login-brand .brand-name { font-size: 1.5rem; }
.login-title { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; text-align: center; }
.login-subtitle { font-size: 0.82rem; color: var(--text-muted); text-align: center; margin-bottom: 24px; }
.login-form .form-group { margin-bottom: 16px; }
.login-form .form-group label { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; display: block; }
.login-form .form-input { width: 100%; }
.login-hints { margin-top: 16px; padding: 12px; background: var(--input-bg); border-radius: 8px; font-size: 0.78rem; color: var(--text-muted); }
.login-hints p { margin-bottom: 6px; font-weight: 600; color: var(--text-secondary); }
.login-hints .hint-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.login-footer { margin-top: 16px; text-align: center; font-size: 0.78rem; color: var(--text-muted); }
.login-footer a { color: var(--color-violet); cursor: pointer; }
.login-footer a:hover { text-decoration: underline; }

/* --- Reports View --- */
.reports-stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px; margin-bottom: 16px;
}
.report-stat-card {
  background-color: var(--bg-secondary); border: 1px solid var(--border-glass);
  border-radius: 12px; padding: 18px; box-shadow: var(--shadow-premium);
}
.report-stat-card .stat-label { font-size: 0.72rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.report-stat-card .stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }
.report-stat-card .stat-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }
.reports-tables-row { display: flex; gap: 14px; }

/* --- Debts View --- */
.debts-summary-row { display: flex; gap: 14px; margin-bottom: 16px; }
.debt-summary-card {
  flex: 1; background-color: var(--bg-secondary); border: 1px solid var(--border-glass);
  border-radius: 12px; padding: 16px; box-shadow: var(--shadow-premium);
}

/* --- Receipt --- */
.receipt-container {
  font-family: 'Courier New', monospace; font-size: 0.82rem;
  color: var(--text-primary); max-width: 320px; margin: 0 auto;
}
.receipt-header { text-align: center; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px dashed var(--border-glass); }
.receipt-header h2 { font-size: 1.1rem; font-weight: 700; }
.receipt-meta { margin-bottom: 12px; }
.receipt-meta-row { display: flex; justify-content: space-between; font-size: 0.78rem; margin-bottom: 4px; }
.receipt-items { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px dashed var(--border-glass); }
.receipt-item-container { margin-bottom: 8px; }
.receipt-item { display: flex; justify-content: space-between; font-weight: 600; }
.receipt-item-row-2 { display: flex; justify-content: space-between; color: var(--text-secondary); font-size: 0.75rem; }
.receipt-totals .receipt-meta-row { font-size: 0.82rem; }
.receipt-totals .receipt-meta-row.grand-total { font-size: 1rem; font-weight: 700; color: var(--color-emerald); border-top: 1px dashed var(--border-glass); padding-top: 8px; margin-top: 4px; }
.receipt-footer { text-align: center; margin-top: 16px; font-size: 0.75rem; color: var(--text-muted); }

/* --- Checkout Modal Payment Tabs --- */
.pay-method-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.btn-pay-method {
  flex: 1; padding: 10px 8px; background: var(--input-bg);
  border: 1px solid var(--input-border); border-radius: 8px;
  color: var(--text-secondary); font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s ease; display: flex;
  align-items: center; justify-content: center; gap: 6px;
}
.btn-pay-method.active { background: var(--color-violet); color: #fff; border-color: var(--color-violet); }
.pay-method-panel { display: none; }
.pay-method-panel.active { display: block; }
.quick-cash-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.btn-quick-cash {
  padding: 6px 12px; background: var(--input-bg); border: 1px solid var(--input-border);
  border-radius: 6px; color: var(--text-primary); font-size: 0.78rem;
  font-weight: 600; cursor: pointer; transition: all 0.2s ease;
}
.btn-quick-cash:hover { background: var(--color-violet-glow); border-color: var(--color-violet); color: var(--color-violet); }
.change-display { font-size: 1.3rem; font-weight: 700; color: var(--color-emerald); margin-top: 8px; }
.checkout-total-display { font-size: 1.6rem; font-weight: 800; color: var(--color-emerald); text-align: center; margin: 12px 0; }

/* --- Animations --- */
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDownFade { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16,185,129,0.7); }
  70% { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Large tablets / small laptops (max 1200px) */
@media (max-width: 1200px) {
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-row { flex-direction: column; }
  .dashboard-bottom-row { flex-direction: column; }
  .reports-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .reports-tables-row { flex-direction: column; }
  .purchase-form-layout { flex-direction: column; }
}

/* Tablets (max 900px) */
@media (max-width: 900px) {
  :root[data-theme="dark"], :root[data-theme="light"] {
    --sidebar-width: 220px;
    --header-height: 58px;
  }
  .sidebar {
    position: fixed; left: 0; top: 0; height: 100%;
    transform: translateX(-100%); z-index: 500;
    box-shadow: 4px 0 24px rgba(0,0,0,0.3);
  }
  .sidebar.mobile-active { transform: translateX(0); }
  .sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); z-index: 499;
  }
  .sidebar.mobile-active ~ .main-content .sidebar-overlay { display: block; }
  .sidebar-toggle { display: flex !important; }
  .main-content { width: 100%; }
  .status-indicator .status-text { display: none; }
  .pos-layout { flex-direction: column; overflow-y: auto; }
  .pos-left-panel { height: auto; min-height: 400px; }
  .pos-right-panel { min-width: unset; height: auto; }
  .pos-products-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); max-height: 320px; }
}

/* Mobile (max 600px) */
@media (max-width: 600px) {
  :root[data-theme="dark"], :root[data-theme="light"] {
    --header-height: 54px;
  }
  #view-dashboard, #view-products, #view-stock,
  #view-purchases, #view-debts, #view-reports { padding: 12px; }
  #view-pos { padding: 10px; }
  .header { padding: 0 12px; gap: 8px; }
  .page-title { font-size: 1rem; }
  .status-indicator { display: none; }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card-value { font-size: 1.1rem; }
  .charts-row { flex-direction: column; }
  .dashboard-bottom-row { flex-direction: column; }
  .actions-header { flex-direction: column; align-items: stretch; }
  .filter-actions { flex-wrap: wrap; }
  .glass-panel { padding: 12px; }
  .tab-container { gap: 4px; padding: 4px; }
  .tab-btn { padding: 7px 10px; font-size: 0.78rem; }
  .reports-stats-grid { grid-template-columns: 1fr; }
  .modal-card { width: 96%; padding: 0; }
  .modal-body { padding: 14px; }
  .modal-footer { padding: 10px 14px; }
  .pos-products-grid { grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)); gap: 8px; }
  .pos-prod-img { height: 44px; font-size: 1.2rem; }
  .pos-prod-name { font-size: 0.72rem; height: 28px; }
  .pos-prod-price { font-size: 0.78rem; }
  .purchase-form-layout { flex-direction: column; }
  .form-group-row { flex-direction: column; }
  .debts-summary-row { flex-direction: column; }
  .quick-actions-grid { grid-template-columns: repeat(2, 1fr); }
  .btn-quick { padding: 14px 8px; font-size: 0.78rem; }
  .btn-quick i { font-size: 1.2rem; }
  .table th, .table td { padding: 8px 8px; font-size: 0.78rem; }
}

/* Very small screens (max 400px) */
@media (max-width: 400px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .header-right { gap: 6px; }
  .notification-trigger, .theme-toggle { width: 32px; height: 32px; }
}

/* Print styles for receipt */
@media print {
  body * { visibility: hidden; }
  #modal-pos-receipt, #modal-pos-receipt * { visibility: visible; }
  #modal-pos-receipt { position: fixed; top: 0; left: 0; width: 100%; }
  .modal-header, .modal-footer { display: none; }
}


/* --- Sidebar Overlay (mobile) --- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* --- Utility extras --- */
.align-center { align-items: center; }
.text-nowrap { white-space: nowrap; }
.mb-2 { margin-bottom: 8px; }
.p-3 { padding: 12px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.my-2 { margin-top: 8px; margin-bottom: 8px; }
.text-sm { font-size: 0.78rem; }
.fs-md { font-size: 0.95rem; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.width-large { max-width: 680px; }
.width-small { max-width: 380px; }

/* --- Login card improvements --- */
.login-overlay {
  position: fixed; top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: var(--bg-primary);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.login-overlay.active { opacity: 1; pointer-events: auto; }
.login-card {
  width: 92%; max-width: 420px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: 20px; padding: 36px 32px;
  box-shadow: var(--shadow-premium);
  animation: fadeIn 0.4s ease;
}
.login-brand {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 24px; justify-content: center;
}
.login-brand .brand-icon { width: 44px; height: 44px; font-size: 1.2rem; }
.login-brand .brand-name { font-size: 1.5rem; }
.login-title {
  font-size: 1.15rem; font-weight: 700;
  color: var(--text-primary); text-align: center; margin-bottom: 6px;
}
.login-subtitle {
  font-size: 0.82rem; color: var(--text-muted);
  text-align: center; margin-bottom: 24px;
}
.login-form .form-group { margin-bottom: 14px; }
.login-form .form-group label {
  font-size: 0.82rem; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 6px; display: block;
}
.login-form .form-input { width: 100%; }
.login-hints {
  margin-top: 20px; padding: 12px 14px;
  background: var(--input-bg); border-radius: 10px;
  font-size: 0.78rem; color: var(--text-muted);
}
.login-hints p { margin-bottom: 8px; font-weight: 600; color: var(--text-secondary); }
.hint-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Checkout amount panel --- */
.checkout-amount-panel {
  text-align: center; padding: 16px;
  background: var(--color-emerald-glow);
  border-radius: 12px; margin-bottom: 16px;
}
.checkout-amount-panel .lbl { font-size: 0.78rem; color: var(--text-muted); display: block; margin-bottom: 4px; }
.checkout-amount-panel .val { font-size: 2rem; font-weight: 800; color: var(--color-emerald); }

/* --- Quick pay button --- */
.btn-quick-pay {
  padding: 8px 16px; background: var(--color-emerald-glow);
  border: 1px solid var(--color-emerald); border-radius: 8px;
  color: var(--color-emerald); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s ease;
}
.btn-quick-pay:hover { background: var(--color-emerald); color: #fff; }

/* --- Payment methods grid --- */
.payment-methods-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.payment-methods-grid .btn-pay-method { flex: 1; min-width: 80px; }

/* --- QRIS box --- */
.qris-barcode-box {
  width: 120px; height: 120px;
  background: #fff; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #000; margin: 12px auto;
}
.qris-brand { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); margin-top: 6px; text-align: center; }

/* --- Alert box --- */
.alert { padding: 10px 14px; border-radius: 8px; font-size: 0.82rem; }
.alert-warning { background: var(--color-amber-glow); color: var(--color-amber); }

/* --- Receipt paper --- */
.receipt-paper {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: 8px; padding: 20px;
  font-family: 'Courier New', monospace;
}
.divider-dash { border: none; border-top: 1px dashed var(--border-glass); margin: 8px 0; }
.summary-row {
  display: flex; justify-content: space-between;
  font-size: 0.82rem; margin-bottom: 6px;
}

/* --- Quick cash row --- */
.quick-cash-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Responsive: hide status text on small screens --- */
@media (max-width: 768px) {
  .login-card { padding: 28px 20px; }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .login-card { padding: 24px 16px; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .card-value { font-size: 1rem; }
  .card-icon { width: 38px; height: 38px; font-size: 1rem; }
}

/* ==========================================================================
   SEMBACODE - Design by SambutanCode
   ========================================================================== */

/* Watermark tipis di pojok kanan bawah */
body::after {
  content: "SambutanCode";
  position: fixed;
  bottom: 14px;
  right: 18px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.25;
  pointer-events: none;
  z-index: 9999;
  font-family: 'Outfit', sans-serif;
}


/* ==========================================================================
   UI IMPROVEMENTS - SambutanCode
   ========================================================================== */

/* Variabel tambahan */
:root[data-theme="dark"] {
  --radius-card: 14px;
  --radius-btn: 9px;
  --transition: all 0.2s ease;
  --font-mono: 'Courier New', monospace;
}
:root[data-theme="light"] {
  --radius-card: 14px;
  --radius-btn: 9px;
  --transition: all 0.2s ease;
  --font-mono: 'Courier New', monospace;
}

/* Body background lebih hidup */
:root[data-theme="dark"] body {
  background: radial-gradient(ellipse at 20% 0%, rgba(139,92,246,0.06) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 100%, rgba(16,185,129,0.04) 0%, transparent 60%),
              #0b0f19;
}
:root[data-theme="light"] body {
  background: radial-gradient(ellipse at 20% 0%, rgba(109,40,217,0.04) 0%, transparent 60%),
              #f1f5f9;
}

/* Sidebar lebih bersih */
.sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-glass);
}
.sidebar-brand {
  padding: 0 18px;
  gap: 10px;
}
.brand-icon {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  box-shadow: 0 4px 14px rgba(139,92,246,0.35);
}
.brand-name {
  font-size: 1.2rem;
  letter-spacing: -0.3px;
}

/* Menu items lebih rapi */
.menu-item {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  letter-spacing: 0.1px;
}
.menu-item.active {
  background: linear-gradient(90deg, rgba(139,92,246,0.15) 0%, rgba(139,92,246,0.04) 100%);
  border-left: 3px solid var(--color-violet);
  padding-left: 9px;
}
.menu-item:hover {
  background: var(--input-bg);
  transform: translateX(2px);
}

/* Header lebih solid */
.header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-glass);
  padding: 0 22px;
  height: var(--header-height);
}
.page-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

/* Tombol header lebih bulat dan konsisten */
.theme-toggle,
.notification-trigger {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--input-bg);
  border: 1px solid var(--border-glass);
  transition: var(--transition);
}
.theme-toggle:hover,
.notification-trigger:hover {
  background: var(--input-border);
  transform: scale(1.05);
}

/* Status indicator lebih compact */
.status-indicator {
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  gap: 6px;
  background: var(--input-bg);
  border: 1px solid var(--border-glass);
}

/* Glass panel lebih bersih */
.glass-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-card);
  padding: 18px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-bottom: 16px;
}
:root[data-theme="dark"] .glass-panel {
  box-shadow: 0 2px 16px rgba(0,0,0,0.25);
}

/* Stat cards lebih proporsional */
.stat-card {
  border-radius: var(--radius-card);
  padding: 18px 20px;
  border: 1px solid var(--border-glass);
  background: var(--bg-secondary);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: 0.06;
  transform: translate(20px, -20px);
}
.card-violet::before { background: var(--color-violet); }
.card-emerald::before { background: var(--color-emerald); }
.card-amber::before { background: var(--color-amber); }
.card-rose::before { background: var(--color-rose); }

.stat-card:hover { transform: translateY(-2px); }
.card-violet:hover { box-shadow: 0 6px 20px rgba(139,92,246,0.18); }
.card-emerald:hover { box-shadow: 0 6px 20px rgba(16,185,129,0.18); }
.card-amber:hover { box-shadow: 0 6px 20px rgba(245,158,11,0.18); }
.card-rose:hover { box-shadow: 0 6px 20px rgba(244,63,94,0.18); }

.card-icon {
  width: 44px; height: 44px;
  border-radius: 11px;
  font-size: 1.15rem;
}
.card-label {
  font-size: 0.7rem;
  letter-spacing: 0.6px;
  margin-bottom: 2px;
}
.card-value {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.card-subtext { font-size: 0.7rem; }

/* Tombol lebih konsisten */
.btn {
  padding: 8px 16px;
  border-radius: var(--radius-btn);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.1px;
  transition: var(--transition);
  gap: 6px;
}
.btn-primary {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  box-shadow: 0 2px 8px rgba(139,92,246,0.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  box-shadow: 0 4px 14px rgba(139,92,246,0.35);
  transform: translateY(-1px);
}
.btn-emerald {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 2px 8px rgba(16,185,129,0.25);
}
.btn-emerald:hover {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 4px 14px rgba(16,185,129,0.35);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--input-border);
  color: var(--text-secondary);
}
.btn-outline:hover {
  background: var(--input-bg);
  border-color: var(--input-focus);
  color: var(--text-primary);
}
.btn-violet {
  background: rgba(139,92,246,0.1);
  border: 1px solid rgba(139,92,246,0.3);
  color: var(--color-violet);
}
.btn-violet:hover {
  background: var(--color-violet);
  color: #fff;
  border-color: var(--color-violet);
}

/* Input fields */
.form-input, .form-select {
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}
.form-input:focus, .form-select:focus {
  border-color: var(--color-violet);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.12);
}
:root[data-theme="light"] .form-input:focus,
:root[data-theme="light"] .form-select:focus {
  box-shadow: 0 0 0 3px rgba(109,40,217,0.1);
}

/* Search box */
.search-box input {
  padding: 9px 12px 9px 36px;
  border-radius: 9px;
  font-size: 0.875rem;
}
.search-box input:focus {
  border-color: var(--color-violet);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.1);
}

/* Tabel lebih bersih */
.table th {
  font-size: 0.7rem;
  letter-spacing: 0.7px;
  padding: 10px 14px;
  background: transparent;
  border-bottom: 2px solid var(--border-glass);
}
.table td {
  padding: 11px 14px;
  font-size: 0.855rem;
}
.table tbody tr:hover {
  background: rgba(139,92,246,0.03);
}
:root[data-theme="light"] .table tbody tr:hover {
  background: rgba(109,40,217,0.03);
}

/* Badge lebih bulat */
.badge {
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* Tab container */
.tab-container {
  padding: 5px;
  border-radius: 11px;
  gap: 4px;
  background: var(--input-bg);
  border: 1px solid var(--border-glass);
}
.tab-btn {
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  transition: var(--transition);
}
.tab-btn.active {
  background: var(--bg-secondary);
  color: var(--color-violet);
  box-shadow: 0 1px 6px rgba(0,0,0,0.1);
}
:root[data-theme="dark"] .tab-btn.active {
  background: rgba(139,92,246,0.15);
  color: var(--color-violet);
}

/* Quick action buttons */
.btn-quick {
  border-radius: 12px;
  padding: 20px 12px;
  gap: 10px;
  font-size: 0.82rem;
  border: 1px solid var(--border-glass);
  background: var(--bg-secondary);
  transition: var(--transition);
}
.btn-quick:hover {
  border-color: var(--color-violet);
  background: rgba(139,92,246,0.06);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(139,92,246,0.12);
}
.btn-quick i {
  font-size: 1.35rem;
  color: var(--color-violet);
}

/* POS product cards */
.pos-prod-card {
  border-radius: 11px;
  padding: 10px;
  border: 1px solid var(--border-glass);
  transition: var(--transition);
}
.pos-prod-card:hover {
  border-color: rgba(139,92,246,0.4);
  box-shadow: 0 4px 14px rgba(139,92,246,0.12);
  transform: translateY(-2px);
}
.pos-prod-img {
  border-radius: 8px;
  height: 50px;
  font-size: 1.4rem;
}

/* Modal lebih bersih */
.modal-card {
  border-radius: 16px;
  border: 1px solid var(--border-glass);
  background: var(--bg-secondary) !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
:root[data-theme="light"] .modal-card {
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-glass);
}
.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-glass);
  gap: 8px;
}

/* Login card */
.login-card {
  border-radius: 20px;
  padding: 40px 36px;
  border: 1px solid var(--border-glass);
  background: var(--bg-secondary);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
:root[data-theme="light"] .login-card {
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}
.login-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.login-subtitle {
  font-size: 0.82rem;
  line-height: 1.5;
}
.login-hints {
  border-radius: 10px;
  border: 1px solid var(--border-glass);
  background: var(--input-bg);
}

/* Dropdown notif */
.dropdown-panel {
  border-radius: 14px;
  border: 1px solid var(--border-glass);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
:root[data-theme="light"] .dropdown-panel {
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* Checkout total display */
.checkout-amount-panel {
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(16,185,129,0.1), rgba(16,185,129,0.05));
  border: 1px solid rgba(16,185,129,0.2);
}
.checkout-amount-panel .val {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -1px;
}

/* Pay method tabs */
.btn-pay-method {
  border-radius: 9px;
  font-size: 0.82rem;
  padding: 10px 8px;
  gap: 6px;
  flex-direction: column;
  height: 64px;
}
.btn-pay-method i { font-size: 1.1rem; }
.btn-pay-method.active {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(139,92,246,0.3);
}

/* Receipt */
.receipt-container {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
}
.receipt-header h2 {
  font-size: 1rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Scrollbar lebih tipis */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb {
  background: var(--border-glass);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Panel header */
.panel-header h3 {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.1px;
}

/* Chart header */
.chart-header h3 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
}

/* User badge di sidebar */
.user-avatar {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  box-shadow: 0 2px 8px rgba(139,92,246,0.3);
}
.user-name { font-size: 0.84rem; }
.user-role { font-size: 0.7rem; }

/* Animasi lebih halus */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideDownFade {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.view-section.active {
  animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-overlay.active .modal-card {
  animation: fadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Produk thumbnail */
.prod-thumbnail {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--input-bg);
  border: 1px solid var(--border-glass);
}

/* Form label */
.form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}

/* Textarea */
textarea.form-input {
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
}

/* Divider */
.divider {
  border: none;
  border-top: 1px solid var(--border-glass);
  margin: 10px 0;
}

/* Total row di POS */
.total-row.main-total {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}

/* Cat pill */
.cat-pill {
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  transition: var(--transition);
}
.cat-pill.active {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(139,92,246,0.25);
}

/* Notif items */
.notif-item {
  border-radius: 8px;
  font-size: 0.8rem;
}

/* Timeline */
.timeline-item::before {
  width: 9px; height: 9px;
  box-shadow: 0 0 0 3px rgba(139,92,246,0.15);
}

/* Responsive tambahan */
@media (max-width: 900px) {
  .sidebar {
    box-shadow: 4px 0 30px rgba(0,0,0,0.25);
  }
}
@media (max-width: 600px) {
  .glass-panel { padding: 14px; border-radius: 12px; }
  .stat-card { padding: 14px 16px; }
  .card-icon { width: 38px; height: 38px; font-size: 1rem; }
  .card-value { font-size: 1.1rem; }
  .btn { padding: 7px 13px; font-size: 0.82rem; }
  .modal-card { border-radius: 14px; }
  .login-card { padding: 28px 20px; border-radius: 16px; }
}


/* ============================================================
   FIX: Modal product SKU + Gen button
   ============================================================ */

/* Input action group - SKU + Gen button */
.input-action-group {
  display: flex;
  width: 100%;
  gap: 0;
}
.input-action-group input,
.input-action-group select {
  flex: 1;
  min-width: 0;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  border-right: none !important;
}
.input-action-group button {
  flex-shrink: 0;
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  padding: 9px 14px;
  font-size: 0.82rem;
  white-space: nowrap;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  border-top-right-radius: 8px !important;
  border-bottom-right-radius: 8px !important;
}
.input-action-group button:hover {
  background: var(--color-violet);
  color: #fff;
  border-color: var(--color-violet);
}

/* Form group row - pastikan tidak overflow */
.form-group-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.form-group-row .form-group {
  min-width: 0;
}
.form-group-row .flex-1 { flex: 1 1 120px; }
.form-group-row .flex-2 { flex: 2 1 200px; }

/* ============================================================
   FIX: Purchase item adder - layout lebih rapi
   ============================================================ */

.purchase-item-adder {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border-radius: 10px;
  margin-bottom: 16px;
}
.purchase-item-adder .form-group {
  margin-bottom: 0;
}
.purchase-item-adder .form-select,
.purchase-item-adder .form-input {
  width: 100%;
}
.purchase-item-adder button {
  align-self: end;
  white-space: nowrap;
  height: 38px;
}

/* Responsive: purchase adder jadi 2 kolom di layar kecil */
@media (max-width: 900px) {
  .purchase-item-adder {
    grid-template-columns: 1fr 1fr;
  }
  .purchase-item-adder button {
    grid-column: 1 / -1;
    width: 100%;
    height: auto;
    padding: 10px;
  }
}
@media (max-width: 600px) {
  .purchase-item-adder {
    grid-template-columns: 1fr;
  }
}

/* Modal body scroll agar tidak overflow layar */
.modal-card {
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.modal-body {
  overflow-y: auto;
  flex: 1;
}

/* Form input width 100% di dalam modal */
.modal-body .form-input,
.modal-body .form-select {
  width: 100%;
}




/* ============================================================
   MODAL COMPACT - kurangi padding agar muat di layar 100%
   ============================================================ */

.modal-body {
  padding: 14px 18px !important;
}

.modal-body .form-group {
  margin-bottom: 10px !important;
}

.modal-body .form-group label {
  font-size: 0.75rem !important;
  margin-bottom: 4px !important;
}

.modal-body .form-input,
.modal-body .form-select {
  padding: 8px 10px !important;
  font-size: 0.85rem !important;
}

.modal-body .form-group-row {
  gap: 10px !important;
  margin-bottom: 0 !important;
}

.modal-body .input-action-group input {
  padding: 8px 10px !important;
}

.modal-body .input-action-group button {
  padding: 8px 12px !important;
  font-size: 0.8rem !important;
}

.modal-header {
  padding: 13px 18px !important;
}

.modal-header h3 {
  font-size: 0.95rem !important;
}

.modal-footer {
  padding: 11px 18px !important;
}

/* ============================================================
   MODAL - Clean Final Rules
   ============================================================ */

.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-card {
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 32px);
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
}
.modal-overlay.active .modal-card {
  transform: scale(1);
}
.modal-card.modal-lg { max-width: 680px; }
.modal-header {
  flex-shrink: 0;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 0.95rem; font-weight: 700; }
.modal-close {
  background: none; border: none;
  color: var(--text-muted); font-size: 1.1rem;
  cursor: pointer; padding: 4px; border-radius: 4px;
}
.modal-close:hover { color: var(--color-rose); }
.modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 18px;
  min-height: 0;
}
.modal-footer {
  flex-shrink: 0;
  padding: 12px 18px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  background: var(--bg-secondary);
}

/* Form di dalam modal lebih compact */
.modal-body .form-group { margin-bottom: 10px; }
.modal-body .form-group label { font-size: 0.75rem; margin-bottom: 4px; display: block; }
.modal-body .form-input,
.modal-body .form-select { padding: 8px 10px; font-size: 0.85rem; width: 100%; }
.modal-body .form-group-row { gap: 10px; }
.modal-body .input-action-group input { padding: 8px 10px; font-size: 0.85rem; }
.modal-body .input-action-group button { padding: 8px 12px; font-size: 0.8rem; }


/* ============================================================
   BASE FONT SIZE - fix semua elemen proporsional
   ============================================================ */

html {
  font-size: 14px !important;
}

/* Modal overlay pastikan center dan ada ruang */
.modal-overlay {
  align-items: center !important;
  justify-content: center !important;
  padding: 12px !important;
  overflow-y: auto !important;
}

/* Modal card tidak boleh lebih tinggi dari viewport */
.modal-card {
  max-height: calc(100vh - 24px) !important;
  margin: auto !important;
}
