/* ================================================================
   ExpenseFlow — Premium Dark Design System
   ================================================================ */

/* ---- CSS Variables ---- */
:root {
  --bg-base: #0a0b0f;
  --bg-surface: #111318;
  --bg-card: #161a23;
  --bg-card-hover: #1c2130;
  --bg-elevated: #1e2435;
  --bg-input: #1a1f2e;

  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.25);

  --secondary: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --text-disabled: #334155;

  --border: rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.12);
  --border-focus: rgba(99, 102, 241, 0.5);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 32px rgba(99, 102, 241, 0.15);

  --sidebar-width: 256px;
  --topbar-height: 64px;

  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 14px;
  min-height: 100vh;
  overflow-x: hidden;
}
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; }
a { cursor: pointer; text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ---- Utility ---- */
.hidden { display: none !important; }
.loading-shimmer { animation: shimmer 1.5s infinite; }

@keyframes shimmer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

/* ================================================================
   AUTH SCREEN
   ================================================================ */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0a0b14 0%, #0d0f1a 50%, #0a0b0f 100%);
}

.auth-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  animation: float 6s ease-in-out infinite;
}

.auth-orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #6366f1, transparent);
  top: -100px; left: -100px;
  animation-delay: 0s;
}

.auth-orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #8b5cf6, transparent);
  bottom: -100px; right: -50px;
  animation-delay: 2s;
}

.auth-orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #06b6d4, transparent);
  top: 50%; left: 60%;
  animation-delay: 4s;
}

.auth-container {
  width: 100%;
  max-width: 440px;
  padding: 24px;
  z-index: 1;
  animation: fadeIn 0.6s ease;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
  justify-content: center;
}

.auth-logo { display: flex; }

.auth-title {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  backdrop-filter: blur(20px);
}

.auth-tabs {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 28px;
}

.auth-tab {
  flex: 1;
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.auth-tab.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.4);
}

.auth-tab:not(.active):hover { color: var(--text-primary); }

.auth-form { display: flex; flex-direction: column; gap: 18px; }

.demo-accounts {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.demo-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

.demo-btns {
  display: flex;
  gap: 8px;
}

.demo-btn {
  flex: 1;
  padding: 6px 10px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-sm);
  color: var(--primary-light);
  font-size: 12px;
  font-weight: 500;
  transition: all var(--transition);
}

.demo-btn:hover {
  background: rgba(99, 102, 241, 0.25);
  transform: translateY(-1px);
}

.auth-error {
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  color: #fca5a5;
  font-size: 13px;
}

/* ================================================================
   FORMS
   ================================================================ */
.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  transition: all var(--transition);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
  background: rgba(26, 31, 46, 0.8);
}

.form-input::placeholder { color: var(--text-muted); }

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.input-wrapper { position: relative; display: flex; align-items: center; }

.input-prefix {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 15px;
  z-index: 1;
  pointer-events: none;
}

.with-prefix { padding-left: 30px; }

.toggle-password {
  position: absolute;
  right: 12px;
  color: var(--text-muted);
  transition: color var(--transition);
}

.toggle-password:hover { color: var(--text-primary); }

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.25);
  color: var(--primary-light);
}

.btn-secondary:hover {
  background: rgba(99, 102, 241, 0.18);
  transform: translateY(-1px);
}

.btn-ghost {
  color: var(--text-secondary);
  border-color: var(--border);
  background: transparent;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.btn-success {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.btn-success:hover {
  background: rgba(16, 185, 129, 0.25);
  transform: translateY(-1px);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  transform: translateY(-1px);
}

.btn-full { width: 100%; }

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ================================================================
   APP LAYOUT
   ================================================================ */
.app {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition-slow);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
}

.brand-name {
  font-size: 17px;
  font-weight: 800;
  background: linear-gradient(135deg, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
  flex: 1;
}

.sidebar-close {
  color: var(--text-muted);
  display: none;
  padding: 4px;
  border-radius: 6px;
  transition: all var(--transition);
}

.sidebar-close:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-disabled);
  padding: 0 8px;
  margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
  cursor: pointer;
}

.nav-item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary-light);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--accent-amber);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 100px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 10px;
  border-top: 1px solid var(--border);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius);
  transition: background var(--transition);
}

.user-profile:hover { background: var(--bg-elevated); }

.user-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.user-avatar.sm {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 11px;
}

.user-info { flex: 1; overflow: hidden; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }

.logout-btn {
  color: var(--text-muted);
  padding: 6px;
  border-radius: 6px;
  transition: all var(--transition);
}

.logout-btn:hover { color: var(--accent-red); background: rgba(239, 68, 68, 0.1); }

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

/* ---- Topbar ---- */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(20px);
}

.topbar-left { display: flex; align-items: center; gap: 16px; }

.menu-btn {
  color: var(--text-secondary);
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: none;
}

.menu-btn:hover { color: var(--text-primary); background: var(--bg-elevated); }

.page-title { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.page-subtitle { font-size: 12px; color: var(--text-muted); }

.topbar-right { display: flex; align-items: center; gap: 12px; }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }

/* ---- Page Content ---- */
.page-content { flex: 1; padding: 28px 24px; overflow-y: auto; }

.view { display: none; }
.view.active { display: block !important; }

/* ================================================================
   CARDS
   ================================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition);
  margin-bottom: 20px;
}

.card:hover { border-color: var(--border-hover); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.card-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 3px 8px;
  border-radius: 100px;
  border: 1px solid var(--border);
}

/* ================================================================
   STATS GRID
   ================================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.stat-card-total::before { background: linear-gradient(90deg, #6366f1, #8b5cf6); }
.stat-card-pending::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-card-approved::before { background: linear-gradient(90deg, #10b981, #34d399); }
.stat-card-rejected::before { background: linear-gradient(90deg, #ef4444, #f87171); }

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border-hover);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card-total .stat-icon { background: rgba(99, 102, 241, 0.15); color: var(--primary-light); }
.stat-card-pending .stat-icon { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.stat-card-approved .stat-icon { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.stat-card-rejected .stat-icon { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }

.stat-info { display: flex; flex-direction: column; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text-primary); line-height: 1.2; }
.stat-change { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ================================================================
   DASHBOARD GRID
   ================================================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.chart-card { margin-bottom: 0; }

.chart-container {
  position: relative;
  height: 220px;
}

.chart-container.tall { height: 280px; }

/* ================================================================
   TABLES
   ================================================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead tr {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

tbody tr:last-child { border-bottom: none; }

tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

td {
  padding: 14px 16px;
  color: var(--text-secondary);
  vertical-align: middle;
}

td:first-child, th:first-child { color: var(--text-primary); }

/* ---- Status Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-pending {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-approved {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-rejected {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* ---- Table Controls ---- */
.table-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.form-input.sm {
  padding: 7px 12px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  min-width: 120px;
}

/* ---- Action buttons in table ---- */
.action-btns {
  display: flex;
  gap: 6px;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all var(--transition);
}

.icon-btn:hover { color: var(--text-primary); background: var(--bg-elevated); border-color: var(--border-hover); }
.icon-btn.approve:hover { color: var(--accent-green); border-color: rgba(16, 185, 129, 0.3); background: rgba(16, 185, 129, 0.08); }
.icon-btn.reject:hover { color: var(--accent-red); border-color: rgba(239, 68, 68, 0.3); background: rgba(239, 68, 68, 0.08); }
.icon-btn.delete:hover { color: var(--accent-red); border-color: rgba(239, 68, 68, 0.3); background: rgba(239, 68, 68, 0.08); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state svg { margin-bottom: 16px; opacity: 0.3; }
.empty-state h4 { font-size: 16px; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ================================================================
   SUBMIT EXPENSE
   ================================================================ */
.submit-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}

.submit-card { margin-bottom: 0; }

.expense-form { display: flex; flex-direction: column; gap: 18px; }

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ---- File Upload ---- */
.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.file-upload-area:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.04);
}

.file-upload-icon { color: var(--text-muted); margin-bottom: 10px; display: flex; justify-content: center; }
.file-upload-text { font-size: 14px; color: var(--text-secondary); font-weight: 500; }
.file-upload-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.file-preview {
  margin-top: 12px;
  padding: 8px 12px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-sm);
  color: var(--accent-green);
  font-size: 13px;
}

/* ---- Submit Sidebar ---- */
.submit-sidebar { display: flex; flex-direction: column; gap: 16px; }

.info-card { margin-bottom: 0; }

.info-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-list li {
  font-size: 13px;
  color: var(--text-secondary);
  padding-left: 16px;
  position: relative;
}

.info-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--primary);
}

.category-guide {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cat-item span { font-size: 13px; color: var(--text-primary); font-weight: 500; }
.cat-item small { font-size: 11px; color: var(--text-muted); }

/* ================================================================
   REPORTS
   ================================================================ */
.reports-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.reports-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.reports-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}

.summary-card .summary-value { font-size: 24px; font-weight: 800; color: var(--text-primary); }
.summary-card .summary-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.reports-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* ================================================================
   MODALS
   ================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 540px;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-title { font-size: 17px; font-weight: 700; }

.modal-close {
  color: var(--text-muted);
  padding: 6px;
  border-radius: 8px;
  transition: all var(--transition);
}

.modal-close:hover { color: var(--text-primary); background: var(--bg-elevated); }

.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Expense detail in modal */
.expense-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.detail-item { display: flex; flex-direction: column; gap: 4px; }
.detail-label { font-size: 12px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.detail-value { font-size: 14px; color: var(--text-primary); font-weight: 500; }
.detail-value.amount { font-size: 20px; font-weight: 800; color: var(--accent-green); }

/* ================================================================
   TOAST NOTIFICATIONS
   ================================================================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 360px;
  pointer-events: all;
  animation: slideIn 0.3s ease;
}

.toast.success { border-left: 3px solid var(--accent-green); }
.toast.error { border-left: 3px solid var(--accent-red); }
.toast.info { border-left: 3px solid var(--primary); }
.toast.warning { border-left: 3px solid var(--accent-amber); }

.toast.hide { animation: fadeOut 0.3s ease forwards; }

@keyframes fadeOut {
  to { opacity: 0; transform: translateX(20px); }
}

/* ================================================================
   SIDEBAR OVERLAY (mobile)
   ================================================================ */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .reports-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .submit-layout { grid-template-columns: 1fr; }
  .submit-sidebar { display: none; }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 256px; }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .sidebar-close { display: flex; }
  .menu-btn { display: flex; }

  .main-content { margin-left: 0; }

  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .expense-detail-grid { grid-template-columns: 1fr; }
  .reports-summary { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
  .topbar { padding: 0 16px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 24px 20px; }
  .table-controls { flex-direction: column; align-items: flex-start; }
}

/* ================================================================
   SCROLLBAR
   ================================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ================================================================
   ROLE BADGE
   ================================================================ */
.role-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  text-transform: capitalize;
}

.role-employee { background: rgba(99, 102, 241, 0.12); color: var(--primary-light); border: 1px solid rgba(99, 102, 241, 0.25); }
.role-manager { background: rgba(245, 158, 11, 0.12); color: var(--accent-amber); border: 1px solid rgba(245, 158, 11, 0.25); }
.role-admin { background: rgba(239, 68, 68, 0.12); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.25); }

/* ================================================================
   AMOUNT
   ================================================================ */
.amount-positive { color: var(--accent-green); font-weight: 600; }
.amount-cell { font-weight: 600; color: var(--text-primary); }

/* ================================================================
   EXPENSE CARD (for report)
   ================================================================ */
.cat-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.cat-breakdown-row:last-child { border-bottom: none; }

.cat-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.cat-count { font-size: 12px; color: var(--text-muted); }
.cat-amount { font-size: 16px; font-weight: 700; color: var(--accent-green); }

.progress-bar {
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 100px;
  margin-top: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 100px;
  transition: width 0.8s ease;
}
