/* ═══════════════════════════════════════════════════
   TrackMyFin — Modern UI v2.0
   2025 Design: Glassmorphism + Gradient Accents
═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

:root {
  /* Brand */
  --brand:         #2563EB;
  --brand-dark:    #1D4ED8;
  --brand-light:   #EFF6FF;
  --brand-glow:    rgba(37,99,235,0.15);

  /* Semantic */
  --income:        #059669;
  --income-light:  #ECFDF5;
  --income-border: #6EE7B7;
  --expense:       #DC2626;
  --expense-light: #FEF2F2;
  --expense-border:#FCA5A5;
  --balance:       #7C3AED;
  --balance-light: #F5F3FF;
  --amber:         #D97706;
  --amber-light:   #FFFBEB;

  /* Neutrals */
  --bg:            #F8FAFC;
  --surface:       #FFFFFF;
  --surface-2:     #F1F5F9;
  --border:        #E2E8F0;
  --border-strong: #CBD5E1;
  --text:          #0F172A;
  --text-2:        #475569;
  --text-3:        #94A3B8;
  --white:         #FFFFFF;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-full: 9999px;

  /* Sidebar */
  --sidebar-w: 240px;
  --topbar-h:  60px;
  --bottom-nav-h: 64px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Base ── */
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ════════════════════════════════════════
   SIDEBAR
════════════════════════════════════════ */
.app-wrap { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 200;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

/* Sidebar Logo */
.logo-wrap {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.logo-mark { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--brand), #6366F1);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}
.logo-text { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }
.logo-sub  { font-size: 10px; color: var(--text-3); margin-top: 1px; font-weight: 400; }

/* Nav */
.nav-section { padding: 12px 0 4px; }
.nav-label {
  font-size: 10px;
  color: var(--text-3);
  padding: 0 20px 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  margin: 1px 8px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s var(--ease);
  position: relative;
}
.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nav-item.active {
  background: var(--brand-light);
  color: var(--brand);
  font-weight: 600;
}
.nav-item.active i { color: var(--brand); }
.nav-item.admin-item.active {
  background: #F5F3FF;
  color: #7C3AED;
}
.nav-item.admin-item.active i { color: #7C3AED; }
.nav-item i { font-size: 17px; width: 20px; text-align: center; flex-shrink: 0; }

/* Nav badge for pending count */
.nav-badge {
  margin-left: auto;
  background: var(--expense);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--r-full);
  min-width: 18px;
  text-align: center;
}

/* Nav bottom user block */
.nav-bottom {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 12px 0;
}
.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  margin: 0 8px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 0.15s;
}
.nav-user:hover { background: var(--surface-2); }
.nav-user-info { flex: 1; min-width: 0; }
.nav-user-name { font-size: 12px; font-weight: 600; color: var(--text); truncate: ellipsis; white-space: nowrap; overflow: hidden; }
.nav-user-role { font-size: 10px; color: var(--text-3); }

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

/* ════════════════════════════════════════
   MAIN AREA
════════════════════════════════════════ */
.main-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: var(--topbar-h);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-title { font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

/* Hamburger (mobile) */
.hamburger {
  display: none;
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-2);
  cursor: pointer;
  flex-shrink: 0;
}

.date-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--r-full);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.avatar {
  width: 34px; height: 34px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, #BFDBFE, #93C5FD);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #1D4ED8;
  border: 2px solid #fff;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.avatar.admin {
  background: linear-gradient(135deg, #DDD6FE, #C4B5FD);
  color: #6D28D9;
}

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

/* ════════════════════════════════════════
   METRIC CARDS
════════════════════════════════════════ */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  box-shadow: var(--shadow-xs);
}
.metric:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.metric::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.metric.m-inc::before { background: linear-gradient(90deg, var(--income), #34D399); }
.metric.m-exp::before { background: linear-gradient(90deg, var(--expense), #F87171); }
.metric.m-bal::before { background: linear-gradient(90deg, var(--balance), #A78BFA); }
.metric.m-cnt::before { background: linear-gradient(90deg, var(--brand), #60A5FA); }

.metric-icon {
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 12px;
}
.metric.m-inc .metric-icon { background: var(--income-light); color: var(--income); }
.metric.m-exp .metric-icon { background: var(--expense-light); color: var(--expense); }
.metric.m-bal .metric-icon { background: var(--balance-light); color: var(--balance); }
.metric.m-cnt .metric-icon { background: var(--brand-light);   color: var(--brand); }

.metric-label { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.metric-val   { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; color: var(--text); }
.metric-val.inc { color: var(--income); }
.metric-val.exp { color: var(--expense); }
.metric-val.bal { color: var(--balance); }

/* ════════════════════════════════════════
   CARDS
════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-xs);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}

/* ════════════════════════════════════════
   FILTER TABS
════════════════════════════════════════ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  background: var(--surface-2);
  padding: 4px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  width: fit-content;
}
.ftab {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--r-sm);
  border: none;
  cursor: pointer;
  color: var(--text-2);
  background: transparent;
  transition: all 0.15s var(--ease);
  white-space: nowrap;
}
.ftab:hover { color: var(--text); background: rgba(255,255,255,0.7); }
.ftab.active {
  background: var(--surface);
  color: var(--brand);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.custom-range {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--brand-light);
  border-radius: var(--r-md);
  border: 1px solid #BFDBFE;
}
.custom-range label { font-size: 11px; font-weight: 600; color: var(--brand); }
.custom-range input[type=date] {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  border: 1px solid #BFDBFE;
  background: var(--white);
  color: var(--text);
  font-family: inherit;
}

/* ════════════════════════════════════════
   ENTRY ROWS
════════════════════════════════════════ */
.entry-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.entry-row:last-child { border-bottom: none; }
.entry-row:hover { background: var(--surface-2); margin: 0 -22px; padding: 11px 22px; border-radius: var(--r-sm); border-bottom-color: transparent; }

.entry-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.entry-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}
.entry-icon.inc { background: var(--income-light); color: var(--income); }
.entry-icon.exp { background: var(--expense-light); color: var(--expense); }
.entry-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.entry-sub  { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.entry-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.entry-amt { font-size: 14px; font-weight: 700; letter-spacing: -0.3px; }
.entry-amt.pos { color: var(--income); }
.entry-amt.neg { color: var(--expense); }
.entry-del {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 5px;
  border-radius: var(--r-sm);
  line-height: 1;
  font-size: 14px;
  transition: all 0.15s;
  display: flex; align-items: center;
}
.entry-del:hover { color: var(--expense); background: var(--expense-light); }

/* ════════════════════════════════════════
   CHARTS GRID
════════════════════════════════════════ */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.leg-item { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; color: var(--text-2); }
.leg-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* ════════════════════════════════════════
   FORMS
════════════════════════════════════════ */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.01em;
}
.form-control {
  font-size: 13px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}
.form-control:hover { border-color: var(--border-strong); }
.form-control:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394A3B8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
textarea.form-control { resize: vertical; min-height: 70px; }

/* ════════════════════════════════════════
   BUTTONS
════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all 0.15s var(--ease);
  background: var(--surface);
  color: var(--text);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.btn:hover { background: var(--surface-2); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), #4F46E5);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--brand-dark), #4338CA); box-shadow: 0 4px 12px rgba(37,99,235,0.4); }
.btn-success {
  background: linear-gradient(135deg, var(--income), #10B981);
  color: #fff; border-color: transparent;
  box-shadow: 0 2px 8px rgba(5,150,105,0.3);
}
.btn-success:hover { box-shadow: 0 4px 12px rgba(5,150,105,0.4); }
.btn-danger {
  background: linear-gradient(135deg, var(--expense), #EF4444);
  color: #fff; border-color: transparent;
  box-shadow: 0 2px 8px rgba(220,38,38,0.25);
}
.btn-danger:hover { box-shadow: 0 4px 12px rgba(220,38,38,0.35); }
.btn-purple {
  background: linear-gradient(135deg, #7C3AED, #6D28D9);
  color: #fff; border-color: transparent;
}
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { font-size: 11px; padding: 5px 12px; }
.btn-lg { font-size: 15px; padding: 12px 24px; }
.btn-block { width: 100%; }

/* ════════════════════════════════════════
   BADGES
════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--r-full);
  letter-spacing: 0.02em;
}
.badge-pending  { background: var(--amber-light);   color: var(--amber);   border: 1px solid #FDE68A; }
.badge-approved { background: var(--income-light);  color: var(--income);  border: 1px solid var(--income-border); }
.badge-rejected { background: var(--expense-light); color: var(--expense); border: 1px solid var(--expense-border); }
.badge-admin    { background: var(--balance-light);  color: var(--balance); border: 1px solid #DDD6FE; }
.badge-user     { background: var(--surface-2);      color: var(--text-3);  border: 1px solid var(--border); }

/* ════════════════════════════════════════
   TABLE
════════════════════════════════════════ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--surface-2);
}
.data-table th:first-child { border-radius: var(--r-sm) 0 0 0; }
.data-table th:last-child  { border-radius: 0 var(--r-sm) 0 0; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-2); }

/* ════════════════════════════════════════
   ALERTS
════════════════════════════════════════ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  border: 1px solid;
}
.alert-success { background: var(--income-light);  color: #065F46; border-color: var(--income-border); }
.alert-error   { background: var(--expense-light); color: #991B1B; border-color: var(--expense-border); }
.alert-info    { background: var(--brand-light);   color: #1E40AF; border-color: #BFDBFE; }
.alert-warning { background: var(--amber-light);   color: #92400E; border-color: #FDE68A; }

/* ════════════════════════════════════════
   SUPER ADMIN BANNER
════════════════════════════════════════ */
.superadmin-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  background: linear-gradient(90deg, #F5F3FF, #EDE9FE);
  border-bottom: 1px solid #DDD6FE;
  font-size: 12px;
  font-weight: 600;
  color: #6D28D9;
}

/* ════════════════════════════════════════
   AUTH PAGES
════════════════════════════════════════ */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #EFF6FF 0%, #F5F3FF 50%, #ECFDF5 100%);
  padding: 20px;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 36px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-xl);
}
.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.auth-logo .logo-icon { width: 42px; height: 42px; font-size: 22px; border-radius: 12px; }
.auth-logo .logo-text { font-size: 20px; }
.auth-card h2 { font-size: 22px; font-weight: 800; margin-bottom: 6px; letter-spacing: -0.5px; }
.auth-card p.sub { font-size: 13px; color: var(--text-2); margin-bottom: 24px; }
.auth-footer { text-align: center; font-size: 12px; color: var(--text-3); margin-top: 20px; }
.auth-footer a { color: var(--brand); font-weight: 600; }

/* ════════════════════════════════════════
   EMPTY STATES
════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-3);
}
.empty-state i {
  font-size: 42px;
  display: block;
  margin-bottom: 12px;
  opacity: 0.4;
}
.empty-state p { font-size: 13px; font-weight: 500; }

/* ════════════════════════════════════════
   STAT CARDS (admin)
════════════════════════════════════════ */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-num { font-size: 28px; font-weight: 800; letter-spacing: -1px; }
.stat-lbl { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; }

/* ════════════════════════════════════════
   EXPORT BUTTONS
════════════════════════════════════════ */
.export-btns { display: flex; gap: 10px; flex-wrap: wrap; }

/* ════════════════════════════════════════
   UTILITIES
════════════════════════════════════════ */
.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}
.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}
.text-muted{color:var(--text-2)}.text-sm{font-size:12px}
.max-600{max-width:600px}.max-480{max-width:480px}
.d-flex{display:flex}.align-center{align-items:center}
.gap-1{gap:8px}.gap-2{gap:16px}
.w-full{width:100%}
.font-bold{font-weight:700}
.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* Custom category add area */
.custom-cat-panel {
  background: var(--brand-light);
  border: 1.5px dashed #BFDBFE;
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-top: 4px;
}
.add-cat-link {
  font-size: 11px;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  margin-left: 8px;
  transition: opacity 0.15s;
}
.add-cat-link:hover { opacity: 0.75; }

/* ════════════════════════════════════════
   BOTTOM NAV (Mobile only)
════════════════════════════════════════ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-h);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  z-index: 150;
  padding: 0 8px;
  align-items: center;
  justify-content: space-around;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
}
.bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 12px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 0.15s;
  min-width: 56px;
  text-decoration: none;
  color: var(--text-3);
}
.bnav-item:hover { background: var(--surface-2); }
.bnav-item.active { color: var(--brand); }
.bnav-item i { font-size: 20px; }
.bnav-item span { font-size: 10px; font-weight: 600; }
.bnav-item.active i { color: var(--brand); }

/* ════════════════════════════════════════
   LOADING SPINNER
════════════════════════════════════════ */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { animation: spin 0.8s linear infinite; display: inline-block; }

/* ════════════════════════════════════════
   SCROLL AREA
════════════════════════════════════════ */
.scroll-area { max-height: 320px; overflow-y: auto; }
.scroll-area::-webkit-scrollbar { width: 4px; }
.scroll-area::-webkit-scrollbar-track { background: transparent; }
.scroll-area::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

/* ════════════════════════════════════════
   RESPONSIVE — TABLET (≤1024px)
════════════════════════════════════════ */
@media (max-width: 1024px) {
  :root { --sidebar-w: 200px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
}

/* ════════════════════════════════════════
   RESPONSIVE — MOBILE (≤768px)
════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Hide desktop sidebar, show bottom nav + hamburger */
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
    width: 260px;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }
  .main-area { margin-left: 0; }
  .hamburger { display: flex; }
  .date-badge { display: none; }
  .bottom-nav { display: flex; }
  .page-content {
    padding: 16px;
    padding-bottom: calc(var(--bottom-nav-h) + 16px);
  }
  .topbar { padding: 0 16px; }
  .charts-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.full { grid-column: 1; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric { padding: 14px 16px; }
  .metric-val { font-size: 18px; }
  .stat-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .auth-card { padding: 28px 22px; border-radius: var(--r-lg); }
  .superadmin-banner { padding: 10px 16px; }
  .card { padding: 16px; }
  .export-btns { flex-direction: column; }
  .export-btns .btn { width: 100%; justify-content: center; }
  .filter-bar { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .data-table th, .data-table td { padding: 8px 10px; font-size: 12px; }
}

/* ════════════════════════════════════════
   RESPONSIVE — SMALL MOBILE (≤480px)
════════════════════════════════════════ */
@media (max-width: 480px) {
  .metrics { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .topbar-title { font-size: 14px; }
  .card-title { font-size: 13px; }
}

/* ════════════════════════════════════════
   PRINT
════════════════════════════════════════ */
@media print {
  .sidebar, .topbar, .bottom-nav, .hamburger { display: none !important; }
  .main-area { margin-left: 0; }
  .page-content { padding: 0; }
}
