/* ========== CSS VARIABLES ========== */
:root {
  --sidebar-bg: #0f172a;
  --sidebar-width: 258px;
  --header-height: 64px;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #0ea5e9;
  --info-light: #e0f2fe;
  --purple: #8b5cf6;
  --purple-light: #ede9fe;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,0.07), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.10);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #f1f5f9;
  color: #1e293b;
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ========== LAYOUT ========== */
#app { display: flex; height: 100vh; overflow: hidden; }

/* ========== SIDEBAR ========== */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(170deg, #0f172a 0%, #1a2744 50%, #1e293b 100%);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, rgba(37,99,235,0.3), transparent);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: white;
  box-shadow: 0 4px 12px rgba(37,99,235,0.4);
  flex-shrink: 0;
}

.logo-name { color: white; font-weight: 700; font-size: 16px; letter-spacing: -0.3px; }
.logo-subtitle { color: #475569; font-size: 10.5px; margin-top: 1px; }

.biz-selector {
  display: flex; align-items: center; gap: 10px;
  margin: 10px 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.07);
  transition: background 0.15s;
}
.biz-selector:hover { background: rgba(255,255,255,0.09); }

.biz-icon {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white;
  flex-shrink: 0;
}
.biz-name { color: #e2e8f0; font-size: 12.5px; font-weight: 600; }
.biz-branch { color: #475569; font-size: 10.5px; margin-top: 1px; }
.biz-info { flex: 1; min-width: 0; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0 12px;
}

.nav-group-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #334155;
  padding: 14px 18px 5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  margin: 1px 10px;
  border-radius: 9px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  user-select: none;
  position: relative;
}

.nav-item i {
  width: 18px;
  text-align: center;
  font-size: 13px;
  flex-shrink: 0;
}

.nav-item span:first-of-type { flex: 1; }

.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: #cbd5e1;
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(37,99,235,0.9), rgba(29,78,216,0.9));
  color: white;
  box-shadow: 0 3px 10px rgba(37,99,235,0.35);
}

.nav-item.active i { color: white; }

.nav-badge {
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid rgba(255,255,255,0.07);
  font-size: 11.5px;
  color: #475569;
}

/* ========== HEADER ========== */
.main-header {
  height: var(--header-height);
  background: white;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  position: relative;
  z-index: 20;
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}

.page-title { font-size: 17px; font-weight: 700; color: #1e293b; }
.page-breadcrumb { font-size: 11.5px; color: #94a3b8; margin-top: 1px; }

.header-right { display: flex; align-items: center; gap: 10px; }

.header-date {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: #64748b;
  padding: 6px 12px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.header-icon-btn {
  width: 38px; height: 38px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: #64748b;
  position: relative;
  transition: all 0.15s;
}
.header-icon-btn:hover { background: #f1f5f9; color: #475569; }

.notif-dot {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--danger);
  color: white;
  font-size: 9px;
  font-weight: 700;
  width: 17px; height: 17px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid white;
}

.notif-panel {
  position: absolute;
  top: 48px; right: 0;
  width: 320px;
  background: white;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  border: 1px solid #e2e8f0;
  z-index: 100;
  overflow: hidden;
}

.notif-header {
  padding: 14px 16px 10px;
  font-weight: 700;
  font-size: 13.5px;
  color: #1e293b;
  border-bottom: 1px solid #f1f5f9;
}

.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f8fafc;
  cursor: pointer;
  transition: background 0.1s;
}
.notif-item:hover { background: #f8fafc; }
.notif-item:last-child { border-bottom: none; }

.notif-item i {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.notif-item.danger i { background: #fee2e2; color: #dc2626; }
.notif-item.warning i { background: #fef3c7; color: #d97706; }
.notif-item.info i { background: #e0f2fe; color: #0284c7; }
.notif-item.success i { background: #d1fae5; color: #059669; }

.notif-title { font-size: 12.5px; font-weight: 600; color: #1e293b; }
.notif-time { font-size: 11.5px; color: #94a3b8; margin-top: 2px; }

.user-menu {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  transition: all 0.15s;
}
.user-menu:hover { background: #f1f5f9; }

.user-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: white;
  flex-shrink: 0;
}
.user-name { font-size: 12.5px; font-weight: 600; color: #1e293b; }
.user-role { font-size: 10.5px; color: #94a3b8; }

/* ========== PAGE CONTENT ========== */
.page-content-wrapper {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: #f1f5f9;
}

.page-inner {
  padding: 24px;
  max-width: 1600px;
  animation: pageIn 0.2s ease;
}

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

/* ========== CARDS ========== */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid #f1f5f9;
}

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #f1f5f9;
}
.card-title {
  font-size: 14.5px; font-weight: 700; color: #1e293b;
  display: flex; align-items: center; gap: 8px;
}
.card-body { padding: 20px; }

/* ========== KPI CARDS ========== */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi-grid-6 { grid-template-columns: repeat(6, 1fr); }

.kpi-card {
  background: white;
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  border: 1px solid #f1f5f9;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: default;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 14px;
}

.kpi-label { font-size: 12px; color: #64748b; font-weight: 500; margin-bottom: 4px; }
.kpi-value { font-size: 21px; font-weight: 800; color: #1e293b; letter-spacing: -0.5px; line-height: 1.1; }
.kpi-value-sm { font-size: 17px; font-weight: 800; }
.kpi-sub { display: flex; align-items: center; gap: 5px; margin-top: 6px; }
.kpi-change { font-size: 11.5px; font-weight: 600; }
.kpi-change.up { color: var(--success); }
.kpi-change.down { color: var(--danger); }
.kpi-compare { font-size: 11px; color: #94a3b8; }

.kpi-blue .kpi-icon { background: #eff6ff; color: #2563eb; }
.kpi-green .kpi-icon { background: #d1fae5; color: #059669; }
.kpi-orange .kpi-icon { background: #fef3c7; color: #d97706; }
.kpi-red .kpi-icon { background: #fee2e2; color: #dc2626; }
.kpi-purple .kpi-icon { background: #ede9fe; color: #7c3aed; }
.kpi-sky .kpi-icon { background: #e0f2fe; color: #0284c7; }
.kpi-teal .kpi-icon { background: #ccfbf1; color: #0d9488; }

/* ========== CHARTS ========== */
.chart-grid { display: grid; gap: 16px; margin-bottom: 20px; }
.chart-grid-2 { grid-template-columns: 2fr 1fr; }
.chart-grid-equal { grid-template-columns: 1fr 1fr; }
.chart-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

.chart-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px 24px 16px;
  box-shadow: var(--shadow);
  border: 1px solid #f1f5f9;
}

.chart-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 16px;
}
.chart-title { font-size: 14px; font-weight: 700; color: #1e293b; }
.chart-subtitle { font-size: 11.5px; color: #94a3b8; margin-top: 2px; }
.chart-canvas-wrap { position: relative; }

/* ========== TABLE ========== */
.table-wrapper {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid #f1f5f9;
  overflow: hidden;
}

.table-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
}

.table-title { font-size: 14.5px; font-weight: 700; color: #1e293b; }
.table-title-sub { font-size: 12px; color: #94a3b8; margin-top: 2px; }

.table-actions { display: flex; align-items: center; gap: 10px; }

.tbl {
  width: 100%;
  border-collapse: collapse;
}
.tbl thead th {
  background: #f8fafc;
  padding: 11px 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
.tbl tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid #f8fafc;
  color: #334155;
  font-size: 13.5px;
}
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: #fafbff; }

.tbl .text-right { text-align: right; }
.tbl .text-center { text-align: center; }

.tbl-num { font-weight: 700; color: #1e293b; }
.tbl-muted { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.tbl-link { color: #2563eb; font-weight: 600; cursor: pointer; }
.tbl-link:hover { text-decoration: underline; }

/* ========== BADGES ========== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; }

.badge-success { background: #d1fae5; color: #065f46; }
.badge-success .badge-dot { background: #10b981; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-warning .badge-dot { background: #f59e0b; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-danger .badge-dot { background: #ef4444; }
.badge-info    { background: #e0f2fe; color: #075985; }
.badge-info .badge-dot { background: #0ea5e9; }
.badge-gray    { background: #f1f5f9; color: #475569; }
.badge-gray .badge-dot { background: #94a3b8; }
.badge-purple  { background: #ede9fe; color: #5b21b6; }
.badge-purple .badge-dot { background: #8b5cf6; }

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn:hover { filter: brightness(0.93); }

.btn-primary { background: var(--primary); color: white; box-shadow: 0 2px 8px rgba(37,99,235,0.3); }
.btn-success { background: var(--success); color: white; box-shadow: 0 2px 8px rgba(16,185,129,0.3); }
.btn-danger  { background: var(--danger); color: white; }
.btn-outline { background: white; color: #475569; border: 1px solid #e2e8f0; }
.btn-outline:hover { background: #f8fafc; }
.btn-ghost { background: transparent; color: #64748b; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 7px; }
.btn-xs { padding: 4px 10px; font-size: 11.5px; border-radius: 6px; }

/* ========== FORMS ========== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12.5px; font-weight: 600; color: #374151; margin-bottom: 5px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 9px;
  font-size: 13.5px;
  color: #1e293b;
  background: white;
  outline: none;
  transition: border 0.15s;
  font-family: inherit;
}
.form-input:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

.search-box {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.search-box i {
  position: absolute; left: 11px;
  color: #94a3b8; font-size: 13px;
  pointer-events: none;
}
.search-box input {
  padding-left: 34px;
  width: 220px;
  border: 1.5px solid #e2e8f0;
  border-radius: 9px;
  padding-top: 8px; padding-bottom: 8px; padding-right: 12px;
  font-size: 13px; color: #1e293b;
  outline: none; transition: all 0.15s;
  background: #f8fafc;
}
.search-box input:focus { border-color: var(--primary); background: white; box-shadow: 0 0 0 3px rgba(37,99,235,0.08); }

/* ========== ALERTS ========== */
.alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 13px;
}
.alert i { margin-top: 1px; flex-shrink: 0; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert-danger { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }

/* ========== PROGRESS ========== */
.progress-bar {
  height: 7px; background: #e2e8f0; border-radius: 10px; overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 10px; transition: width 0.6s ease;
}

/* ========== DIVIDER ========== */
.divider { border: none; border-top: 1px solid #f1f5f9; margin: 16px 0; }

/* ========== SECTION TITLE ========== */
.section-title {
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

/* ========== LOADER ========== */
.loader-spinner {
  width: 40px; height: 40px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== P&L TABLE ========== */
.pl-table { width: 100%; border-collapse: collapse; }
.pl-table td { padding: 9px 16px; font-size: 13.5px; border-bottom: 1px solid #f8fafc; }
.pl-table .pl-label { color: #475569; }
.pl-table .pl-value { text-align: right; font-weight: 600; color: #1e293b; white-space: nowrap; }
.pl-table .pl-indent { padding-left: 36px; color: #64748b; }
.pl-table .pl-section-head td { background: #f8fafc; font-weight: 700; color: #1e293b; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.03em; padding-top: 14px; }
.pl-table .pl-subtotal td { background: #f8fafc; font-weight: 700; color: #1e293b; }
.pl-table .pl-total td { background: #1e40af; color: white; font-weight: 800; font-size: 14.5px; }
.pl-table .pl-gross td { background: #059669; color: white; font-weight: 800; }
.pl-table .pl-spacer td { height: 10px; background: #f1f5f9; }
.pl-table .pl-negative .pl-value { color: #dc2626; }

/* ========== SUMMARY CARDS ========== */
.summary-row { display: grid; gap: 14px; margin-bottom: 20px; }
.summary-2 { grid-template-columns: 1fr 1fr; }
.summary-3 { grid-template-columns: 1fr 1fr 1fr; }
.summary-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

.summary-card {
  background: white;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: var(--shadow);
  border: 1px solid #f1f5f9;
  display: flex; align-items: center; gap: 14px;
}
.summary-icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.summary-label { font-size: 11.5px; color: #64748b; font-weight: 500; }
.summary-value { font-size: 19px; font-weight: 800; color: #1e293b; margin-top: 2px; letter-spacing: -0.3px; }

/* ========== TABS ========== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid #e2e8f0; padding: 0 4px; margin-bottom: 20px; }
.tab {
  padding: 10px 18px;
  font-size: 13.5px; font-weight: 600;
  color: #64748b; cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}
.tab:hover { color: #1e293b; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ========== STOK CARD ========== */
.stok-product-card {
  background: linear-gradient(135deg, #1e40af, #2563eb, #0ea5e9);
  border-radius: 14px;
  padding: 22px;
  color: white;
  margin-bottom: 20px;
  display: flex; align-items: flex-start; justify-content: space-between;
}

/* ========== GRID HELPERS ========== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ========== RESPONSIVE HELPERS ========== */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.fw-700 { font-weight: 700; }
.text-muted { color: #94a3b8; }
.text-sm { font-size: 12px; }
.text-right { text-align: right; }

/* ========== INVOICE DETAIL ========== */
.invoice-header-card {
  background: linear-gradient(135deg, #0f172a, #1e3a5f);
  border-radius: 14px;
  padding: 28px;
  color: white;
  margin-bottom: 20px;
}

/* ========== PRINT HELPERS ========== */
@media print {
  .sidebar, .main-header, .btn, .table-toolbar { display: none !important; }
  .page-content-wrapper { overflow: visible; }
  .page-inner { padding: 0; }
}

/* ============================================================
   MOBILE RESPONSIVE — Full Support
   ============================================================ */

/* Hamburger button — hidden on desktop */
.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  color: #475569;
  flex-shrink: 0;
  transition: all 0.15s;
}
.hamburger-btn:hover { background: #f1f5f9; }

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

/* Bottom nav — hidden on desktop */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 62px;
  background: white;
  border-top: 1px solid #e2e8f0;
  z-index: 100;
  padding: 0 8px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  padding: 8px 4px;
  border-radius: 12px;
  transition: all 0.15s;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 600;
  text-align: center;
}
.bottom-nav-item i { font-size: 18px; }
.bottom-nav-item:hover { color: #2563eb; background: #eff6ff; }
.bottom-nav-item.active { color: #2563eb; }
.bottom-nav-item.active i { color: #2563eb; }

/* ── Tablet / small laptop ──────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar { width: 220px; }
  .biz-branch { display: none; }
}

/* ── Mobile / Tablet ────────────────────────────────────── */
@media (max-width: 860px) {

  /* Sidebar becomes slide-in drawer */
  .sidebar {
    position: fixed;
    left: -270px;
    top: 0; bottom: 0;
    z-index: 1000;
    width: 260px !important;
    transition: left 0.27s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100dvh;
  }
  .sidebar.sidebar-open {
    left: 0;
    box-shadow: 8px 0 40px rgba(0,0,0,0.35);
  }

  /* Show hamburger */
  .hamburger-btn { display: flex !important; }

  /* Header adjustments */
  .header-date { display: none !important; }
  .user-info { display: none !important; }
  .user-menu { padding: 5px 8px; }

  /* Show bottom nav */
  .bottom-nav { display: flex; }

  /* Add padding so content not hidden behind bottom nav */
  .page-content-wrapper { padding-bottom: 68px; }

  /* Page padding */
  .page-inner { padding: 14px; }

  /* ─ Grid overrides ─ */
  /* 6-col KPI → 2-col */
  .page-inner > div[style*="repeat(6,1fr)"],
  .page-inner > div[style*="repeat(5,1fr)"],
  .page-inner > div[style*="repeat(4,1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  /* 3-col → 2-col */
  .page-inner > div[style*="repeat(3,1fr)"],
  .page-inner > div[style*="1fr 1fr 1fr"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  /* 2-col chart layouts → 1-col */
  .page-inner > div[style*="2fr 1fr"],
  .page-inner > div[style*="1.5fr 1fr"],
  .page-inner > div[style*="1.4fr 1fr"],
  .page-inner > div[style*="1.6fr 1fr"],
  .page-inner > div[style*="1fr 1.4fr"],
  .page-inner > div[style*="1fr 1.6fr"],
  .page-inner > div[style*="1fr 2fr"],
  .page-inner > div[style*="1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Nested grids in widgets */
  .page-inner div[style*="grid-template-columns:repeat(3"] {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  .page-inner div[style*="grid-template-columns:1fr 1fr 1fr"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  /* KPI cards smaller on mobile */
  .kpi-card { padding: 14px 16px; }
  .kpi-value { font-size: 18px !important; }
  .kpi-value-sm { font-size: 15px !important; }
  .kpi-icon { width: 38px; height: 38px; font-size: 15px; margin-bottom: 10px; }

  /* Summary cards */
  .summary-card { padding: 12px 14px; gap: 10px; }
  .summary-value { font-size: 17px; }

  /* Chart heights */
  .chart-canvas-wrap[style*="240px"],
  .chart-canvas-wrap[style*="230px"],
  .chart-canvas-wrap[style*="250px"],
  .chart-canvas-wrap[style*="220px"],
  .chart-canvas-wrap[style*="210px"],
  .chart-canvas-wrap[style*="200px"] {
    height: 200px !important;
  }

  /* Table wrapper scrollable */
  .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl { min-width: 560px; }

  /* Table toolbar stacks */
  .table-toolbar { flex-direction: column; gap: 12px; align-items: flex-start !important; }
  .table-actions { flex-wrap: wrap; }

  /* P&L table scrollable */
  .table-wrapper .pl-table { min-width: 420px; }

  /* Alert bars stack */
  .page-inner > div[style*="grid-template-columns:1fr 1fr 1fr 1fr"],
  .page-inner > div[style*="grid-template-columns:1fr 1fr 1fr"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  /* Stok product card */
  .stok-product-card { flex-direction: column; gap: 12px; }

  /* Hide some header elements */
  #page-breadcrumb { display: none; }

  /* Search box width */
  .search-box input { width: 160px !important; }

  /* Form inputs full width */
  .form-input, .form-select { font-size: 16px; } /* Prevent iOS zoom */

  /* Notif panel position */
  .notif-panel { right: -60px; width: 290px; }
}

/* ── Small phones ───────────────────────────────────────── */
@media (max-width: 480px) {

  .page-inner { padding: 10px; }

  /* All multi-col → 1 col */
  .page-inner > div[style*="repeat(6,1fr)"],
  .page-inner > div[style*="repeat(5,1fr)"],
  .page-inner > div[style*="repeat(4,1fr)"],
  .page-inner > div[style*="repeat(3,1fr)"],
  .page-inner > div[style*="1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  /* Alert bar → 1 col */
  .page-inner > div[style*="1fr 1fr 1fr 1fr"],
  .page-inner > div[style*="1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  /* 2-col → 1-col */
  .page-inner > div[style*="repeat(2,1fr)"],
  .page-inner > div[style*="1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .kpi-value { font-size: 16px !important; }
  .tbl { min-width: 480px; }
  .search-box input { width: 130px !important; }

  /* Main header compact */
  .main-header { padding: 0 12px; }
  #page-title { font-size: 15px; }

  /* Bottom nav labels visible */
  .bottom-nav-item { font-size: 9px; }
  .bottom-nav-item i { font-size: 16px; }
}
