/* ==========================================
   Smart Inventory Assistant
   Light Theme · Kanit Font · SVG Icons
   ========================================== */

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

/* Force Kanit font on ALL elements including buttons, inputs, selects */
*, *::before, *::after,
button, input, select, textarea, optgroup, option {
  font-family: 'Kanit', sans-serif;
}

:root {
  /* Brand */
  --primary:        #4f46e5;
  --primary-dark:   #3730a3;
  --primary-light:  #818cf8;
  --primary-bg:     #eef2ff;
  --primary-border: #c7d2fe;

  --accent:         #0891b2;
  --accent-bg:      #ecfeff;

  /* Semantic */
  --green:          #059669;
  --green-bg:       #d1fae5;
  --green-border:   #6ee7b7;

  --red:            #dc2626;
  --red-bg:         #fee2e2;
  --red-border:     #fca5a5;

  --orange:         #d97706;
  --orange-bg:      #fef3c7;
  --orange-border:  #fcd34d;

  --purple:         #7c3aed;
  --purple-bg:      #ede9fe;

  --blue:           #2563eb;
  --blue-bg:        #dbeafe;

  /* Neutrals — Light */
  --bg:             #f8fafc;
  --bg-2:           #f1f5f9;
  --bg-3:           #e2e8f0;
  --surface:        #ffffff;
  --surface-2:      #f8fafc;

  --border:         #e2e8f0;
  --border-2:       #cbd5e1;

  --text:           #0f172a;
  --text-2:         #334155;
  --text-3:         #64748b;
  --text-4:         #94a3b8;

  /* Typography */
  --font:           'Kanit', sans-serif;

  /* Spacing / Shape */
  --radius:         12px;
  --radius-sm:      8px;
  --radius-xs:      6px;
  --radius-full:    9999px;

  /* Shadow */
  --shadow-xs:  0 1px 2px rgba(0,0,0,.06);
  --shadow-sm:  0 2px 8px rgba(0,0,0,.08);
  --shadow:     0 4px 16px rgba(0,0,0,.1);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.12);

  /* Sidebar */
  --sidebar-w:  240px;

  --transition: .18s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================
   LAYOUT
   ========================================== */

#app { min-height: 100vh; }

/* ── Login ─────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 50%, #f0fdf4 100%);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(79,70,229,.08) 0%, transparent 70%);
  top: -200px; right: -100px;
  pointer-events: none;
}
.login-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(8,145,178,.06) 0%, transparent 70%);
  bottom: -100px; left: -50px;
  pointer-events: none;
}

.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 44px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}
.login-logo .logo-mark {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 8px 20px rgba(79,70,229,.25);
}
.login-logo .logo-mark svg { color: white; }
.login-logo h1 {
  font-size: 22px; font-weight: 700;
  color: var(--text); letter-spacing: -.02em;
}
.login-logo p { font-size: 14px; color: var(--text-3); margin-top: 4px; font-weight: 400; }

.demo-accounts {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.demo-accounts p { font-size: 12px; color: var(--text-3); line-height: 1.8; }
.demo-accounts strong { color: var(--text-2); font-weight: 600; }

/* ── App Shell ─────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-logo .logo-mark-sm {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-logo .logo-mark-sm svg { color: white; }
.logo-text-wrap .logo-text {
  font-size: 14px; font-weight: 700;
  color: var(--text); line-height: 1.2;
  font-family: 'Kanit', sans-serif;
}
.logo-text-wrap .logo-sub {
  font-size: 11px; color: var(--text-4);
  font-weight: 400;
  font-family: 'Kanit', sans-serif;
}

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

.nav-section { margin-bottom: 6px; }
.nav-section-label {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-4);
  padding: 8px 10px 4px;
  font-family: 'Kanit', sans-serif;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer; font-size: 14px; font-weight: 500;
  color: var(--text-3); border: none; background: none;
  width: 100%; text-align: left;
  transition: var(--transition);
  font-family: 'Kanit', sans-serif;
}
.nav-item:hover { background: var(--bg-2); color: var(--text); }
.nav-item.active {
  background: var(--primary-bg);
  color: var(--primary);
  font-weight: 600;
}
.nav-item .nav-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: inherit;
}
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--red); color: white;
  font-size: 10px; font-weight: 700;
  padding: 1px 7px; border-radius: var(--radius-full);
  min-width: 18px; text-align: center;
}

.sidebar-user {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: white;
  flex-shrink: 0;
}
.user-info .user-name { font-size: 13px; font-weight: 600; color: var(--text); font-family: 'Kanit', sans-serif; }
.user-info .user-role { font-size: 11px; color: var(--text-4); font-family: 'Kanit', sans-serif; }
.logout-btn {
  margin-left: auto; background: none; border: none;
  color: var(--text-4); cursor: pointer; padding: 6px;
  border-radius: var(--radius-xs);
  transition: var(--transition);
  display: flex; align-items: center;
}
.logout-btn:hover { color: var(--red); background: var(--red-bg); }

/* ── Main Content ──────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1; min-height: 100vh;
  display: flex; flex-direction: column;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 28px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title h2 {
  font-size: 18px; font-weight: 700;
  color: var(--text); letter-spacing: -.01em;
}
.topbar-title p { font-size: 13px; color: var(--text-3); font-weight: 400; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.page-content { padding: 24px 28px; flex: 1; }

/* ==========================================
   COMPONENTS
   ========================================== */

/* ── Buttons ───────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  cursor: pointer; border: none;
  transition: var(--transition);
  font-family: var(--font);
  white-space: nowrap; text-decoration: none;
  line-height: 1;
}
.btn-primary {
  background: var(--primary); color: white;
  box-shadow: 0 2px 8px rgba(79,70,229,.25);
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(79,70,229,.3); }

.btn-secondary {
  background: var(--surface); color: var(--text-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { background: var(--bg-2); border-color: var(--border-2); }

.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #b91c1c; }

.btn-success { background: var(--green); color: white; }
.btn-success:hover { background: #047857; }

.btn-ghost { background: none; color: var(--text-3); border: none; }
.btn-ghost:hover { background: var(--bg-2); color: var(--text); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 16px; width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* ── Forms ─────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-2); margin-bottom: 6px;
}
.form-control {
  width: 100%; padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text); font-size: 14px;
  font-family: var(--font); font-weight: 400;
  transition: var(--transition);
  box-shadow: var(--shadow-xs);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.form-control::placeholder { color: var(--text-4); }
select.form-control { cursor: pointer; }

/* ── Cards ─────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface);
}
.card-title { font-size: 15px; font-weight: 700; color: var(--text); 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: 24px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.kpi-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.kpi-card .kpi-icon-wrap {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.kpi-card.success .kpi-icon-wrap { background: var(--green-bg); color: var(--green); }
.kpi-card.primary .kpi-icon-wrap { background: var(--primary-bg); color: var(--primary); }
.kpi-card.warning .kpi-icon-wrap { background: var(--orange-bg); color: var(--orange); }
.kpi-card.danger .kpi-icon-wrap { background: var(--red-bg); color: var(--red); }

.kpi-card .kpi-label {
  font-size: 12px; color: var(--text-3); font-weight: 500;
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px;
}
.kpi-card .kpi-value {
  font-size: 26px; font-weight: 700; color: var(--text);
  line-height: 1; margin-bottom: 8px; letter-spacing: -.02em;
}
.kpi-card .kpi-change {
  font-size: 12px; font-weight: 600;
  display: flex; align-items: center; gap: 4px;
}
.kpi-change.up { color: var(--green); }
.kpi-change.down { color: var(--red); }
.kpi-change.neutral { color: var(--text-3); }

.kpi-card.success { border-top: 3px solid var(--green); }
.kpi-card.primary { border-top: 3px solid var(--primary); }
.kpi-card.warning { border-top: 3px solid var(--orange); }
.kpi-card.danger  { border-top: 3px solid var(--red); }

/* ── Grid Layouts ──────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }

/* ── Table ─────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  padding: 11px 14px;
  text-align: left;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-3);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-2); }

/* ── Badges ────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11px; font-weight: 700;
  letter-spacing: .02em;
}
.badge-green  { background: var(--green-bg);  color: var(--green); }
.badge-red    { background: var(--red-bg);    color: var(--red); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-blue   { background: var(--blue-bg);   color: var(--blue); }
.badge-purple { background: var(--purple-bg); color: var(--purple); }
.badge-gray   { background: var(--bg-3);      color: var(--text-3); }
.badge-primary{ background: var(--primary-bg); color: var(--primary); }

/* ── Alert Banners ─────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 14px; display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; font-weight: 500;
}
.alert svg { flex-shrink: 0; }
.alert-error   { background: var(--red-bg);    border: 1px solid var(--red-border);    color: var(--red); }
.alert-success { background: var(--green-bg);  border: 1px solid var(--green-border);  color: var(--green); }
.alert-warning { background: var(--orange-bg); border: 1px solid var(--orange-border); color: var(--orange); }
.alert-info    { background: var(--primary-bg);border: 1px solid var(--primary-border);color: var(--primary); }

/* ── Stock Bar ─────────────────────────── */
.stock-bar-wrap { display: flex; align-items: center; gap: 8px; }
.stock-bar {
  height: 6px; border-radius: 3px;
  background: var(--bg-3); flex: 1; overflow: hidden;
}
.stock-bar-fill { height: 100%; border-radius: 3px; transition: width .5s ease; }
.stock-bar-fill.ok       { background: var(--green); }
.stock-bar-fill.low      { background: var(--orange); }
.stock-bar-fill.critical { background: var(--red); animation: pulse-bar 1.5s ease-in-out infinite; }
@keyframes pulse-bar { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ── Chart Container ───────────────────── */
.chart-container { position: relative; height: 250px; }

/* ── Loading ───────────────────────────── */
.loading {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 60px; color: var(--text-3); font-size: 14px;
}
.spinner {
  width: 22px; height: 22px;
  border: 2px solid var(--bg-3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty State ───────────────────────── */
.empty-state {
  text-align: center; padding: 48px 20px;
  color: var(--text-3);
}
.empty-icon {
  width: 52px; height: 52px;
  background: var(--bg-2); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px; color: var(--text-4);
}
.empty-state p { font-size: 14px; }

/* ── Pagination ────────────────────────── */
.pagination {
  display: flex; align-items: center;
  justify-content: space-between; padding: 14px 0;
}
.page-info { font-size: 13px; color: var(--text-3); }
.page-btns { display: flex; gap: 4px; }
.page-btn {
  padding: 6px 12px; border-radius: var(--radius-xs);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-2); font-size: 13px; cursor: pointer;
  transition: var(--transition); font-family: var(--font); font-weight: 500;
}
.page-btn:hover { background: var(--bg-2); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: white; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Upload Zone ───────────────────────── */
.upload-zone {
  border: 2px dashed var(--primary-border);
  border-radius: var(--radius);
  padding: 40px 24px; text-align: center;
  cursor: pointer; transition: var(--transition);
  background: var(--primary-bg);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: #e8eaf6;
}
.upload-zone .upload-icon {
  width: 48px; height: 48px;
  background: var(--surface); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px; color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.upload-zone p { color: var(--text-3); font-size: 14px; }
.upload-zone strong { color: var(--primary); }

/* ── Modal ─────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 999; padding: 20px;
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text); }
.modal-close {
  background: none; border: none; color: var(--text-3);
  font-size: 20px; cursor: pointer; padding: 4px;
  border-radius: var(--radius-xs); line-height: 1;
  transition: var(--transition);
}
.modal-close:hover { color: var(--red); background: var(--red-bg); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ── Tabs ──────────────────────────────── */
.tabs {
  display: flex; gap: 2px;
  background: var(--bg-2); border-radius: var(--radius-sm);
  padding: 4px; margin-bottom: 20px;
  width: fit-content;
  border: 1px solid var(--border);
}
.tab-btn {
  padding: 7px 18px; border-radius: var(--radius-xs);
  background: none; border: none;
  color: var(--text-3);
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  font-family: var(--font);
  display: flex; align-items: center; gap: 6px;
}
.tab-btn:hover { color: var(--text); background: var(--surface); }
.tab-btn.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-xs); }

/* ── Search Bar ────────────────────────── */
.filter-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filter-row .form-control { width: auto; padding: 8px 12px; font-size: 13px; }

.search-input-wrap { position: relative; }
.search-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--text-4); pointer-events: none;
  display: flex; align-items: center;
}
.search-input-wrap .form-control { padding-left: 36px; }

/* ── Code / Pre ────────────────────────── */
pre {
  background: var(--bg-2); border: 1px solid var(--border);
  padding: 14px; border-radius: var(--radius-sm);
  font-size: 12px; color: var(--text-2);
  overflow-x: auto; line-height: 1.7;
  font-family: 'Consolas', 'Monaco', monospace;
}

/* ── Scrollbar ─────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-2); }

/* ── Badge Dot (SVG status indicator inside badge) ── */
.badge-dot {
  display: inline-flex; align-items: center;
  width: 14px; height: 14px; flex-shrink: 0;
}
.badge-dot svg { width: 14px; height: 14px; }

/* ── KPI Icon ──────────────────────────── */
.kpi-icon {
  display: flex; align-items: center;
  margin-bottom: 14px;
}
.kpi-icon svg { width: 28px; height: 28px; }

/* ── Logo Icon (Login page) ─────────────── */
.login-logo .logo-icon {
  display: flex; align-items: center; justify-content: center;
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 18px;
  margin: 0 auto 16px;
  color: white;
  box-shadow: 0 8px 20px rgba(79,70,229,.25);
}
.login-logo .logo-icon svg { width: 32px; height: 32px; color: white; }

/* ── Sidebar Logo icon ──────────────────── */
.sidebar-logo .logo-em {
  width: 38px; height: 38px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white;
}
.sidebar-logo .logo-em svg { width: 20px; height: 20px; color: white; }
.sidebar-logo .logo-text { font-size: 14px; font-weight: 700; color: var(--text); font-family: 'Kanit', sans-serif; }
.sidebar-logo .logo-sub  { font-size: 11px; color: var(--text-4); font-family: 'Kanit', sans-serif; }

/* ── CSS var aliases (JS uses --text2 / --bg2 shorthand) ── */
:root {
  --text2: var(--text-3);
  --text3: var(--text-4);
  --bg2:   var(--bg-2);
  --gray:  var(--text-4);
  --white: var(--text);
  --primary-light: var(--primary-light);
}

/* ── Helpers ───────────────────────────── */
.text-muted { color: var(--text-3); }
.text-success { color: var(--green); }
.text-danger { color: var(--red); }
.text-primary { color: var(--primary); }
.font-mono { font-family: 'Consolas','Monaco',monospace; }
.font-bold { font-weight: 700; }

.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ── Responsive ────────────────────────── */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2,1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-240px); }
  .sidebar.open { transform: translateX(0); width: 240px; }
  .main-content { margin-left: 0; }
  .page-content { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
}
