/* ════════════════════════════════════════════════════════════
   GIGTRACK — PREMIUM DARK DASHBOARD
   Design: Deep dark + coral/gold gradient accent
   Fonts: Syne (display) · DM Sans (body) · JetBrains Mono (numbers)
════════════════════════════════════════════════════════════ */

/* ─── RESET ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img, svg { display: block; }
button { cursor: pointer; font-family: inherit; }
a { text-decoration: none; }

/* ─── DESIGN TOKENS ─────────────────────────────────────── */
:root {
  /* Background layers */
  --bg-void:    #040508;
  --bg-deep:    #07090f;
  --bg-base:    #0c0e1a;
  --bg-surface: #101325;
  --bg-raised:  #161929;
  --bg-hover:   #1c2033;
  --bg-modal:   rgba(10, 12, 22, 0.92);

  /* Brand gradient — coral → gold (the "money gradient") */
  --grad-start: #ff6b35;
  --grad-end:   #ffc14a;
  --gradient:   linear-gradient(135deg, var(--grad-start) 0%, var(--grad-end) 100%);
  --gradient-r: linear-gradient(135deg, var(--grad-end) 0%, var(--grad-start) 100%);
  --grad-glow:  rgba(255, 107, 53, 0.18);
  --grad-glow2: rgba(255, 193, 74, 0.10);

  /* App brand colors */
  --flex-clr:  #ff9900;
  --flex-bg:   rgba(255, 153, 0, 0.10);
  --grub-clr:  #f63440;
  --grub-bg:   rgba(246, 52, 64, 0.10);
  --uber-clr:  #06c167;
  --uber-bg:   rgba(6, 193, 103, 0.10);
  --inst-clr:  #43b02a;
  --inst-bg:   rgba(67, 176, 42, 0.10);

  /* Expense category colors */
  --cat-gas:   #4f8ef7;
  --cat-maint: #b57bf5;
  --cat-phone: #34d399;
  --cat-ins:   #fbbf24;
  --cat-other: #fb923c;

  /* Text */
  --text-hi:    #f4f6ff;
  --text:       #d4d8f0;
  --text-dim:   #7c81a8;
  --text-muted: #44475e;

  /* Borders */
  --border:     rgba(255, 255, 255, 0.05);
  --border-mid: rgba(255, 255, 255, 0.08);
  --border-hi:  rgba(255, 255, 255, 0.14);

  /* Feedback */
  --success: #22c55e;
  --danger:  #f43f5e;
  --warn:    #f59e0b;
  --info:    #38bdf8;

  /* Layout */
  --sidebar-w:  228px;
  --topbar-h:   58px;
  --radius:     14px;
  --radius-sm:  8px;
  --radius-lg:  20px;

  /* Fonts */
  --f-display: 'Syne', sans-serif;
  --f-body:    'DM Sans', sans-serif;
  --f-mono:    'JetBrains Mono', monospace;
}

/* ─── BASE ──────────────────────────────────────────────── */
html { font-size: 14px; }
body {
  font-family: var(--f-body);
  background: var(--bg-void);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  /* Atmospheric background mesh */
  background-image:
    radial-gradient(ellipse 70% 50% at -5%  15%, rgba(255,107,53,0.06) 0%, transparent 65%),
    radial-gradient(ellipse 50% 40% at 105% 80%, rgba(79,142,247,0.05) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 60%  50%, rgba(181,123,245,0.03) 0%, transparent 70%);
  background-attachment: fixed;
}

::-webkit-scrollbar              { width: 5px; height: 5px; }
::-webkit-scrollbar-track        { background: transparent; }
::-webkit-scrollbar-thumb        { background: var(--bg-raised); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover  { background: var(--bg-hover); }

/* ─── LOADING SCREEN ────────────────────────────────────── */
.loading-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg-void);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  transition: opacity 0.5s, visibility 0.5s;
}
.loading-screen.fade-out { opacity: 0; visibility: hidden; }

.loading-logo {
  display: flex; align-items: center; gap: 10px;
}
.ll-mark {
  width: 44px; height: 44px;
  background: var(--gradient);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-mono); font-weight: 600; font-size: 20px;
  color: #fff;
  box-shadow: 0 0 30px var(--grad-glow);
}
.ll-text {
  font-family: var(--f-display); font-weight: 800; font-size: 22px;
  letter-spacing: 0.06em; color: var(--text-hi);
}
.ll-text span { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.loading-bar {
  width: 220px; height: 3px;
  background: var(--bg-raised); border-radius: 99px; overflow: hidden;
}
.loading-fill {
  height: 100%; width: 0; border-radius: 99px;
  background: var(--gradient);
  animation: load-bar 2s ease-in-out forwards;
}
@keyframes load-bar { to { width: 100%; } }

.loading-msg { font-size: 12px; color: var(--text-muted); font-family: var(--f-mono); }

.hidden { display: none !important; }

/* ─── AUTH SCREEN ───────────────────────────────────────── */
.auth-screen {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-void);
  padding: 20px;
  background-image:
    radial-gradient(ellipse 60% 50% at 0% 20%, rgba(255,107,53,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 100% 80%, rgba(79,142,247,0.06) 0%, transparent 60%);
}

.auth-bg-glow {
  position: fixed;
  width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,107,53,0.07) 0%, transparent 70%);
  top: -100px; left: -100px;
  pointer-events: none;
  animation: glow-float 8s ease-in-out infinite alternate;
}
.auth-bg-glow2 {
  background: radial-gradient(circle, rgba(79,142,247,0.05) 0%, transparent 70%);
  top: auto; left: auto;
  bottom: -150px; right: -100px;
  animation-delay: -4s;
}
@keyframes glow-float {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(30px, 20px) scale(1.1); }
}

.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%; max-width: 420px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 32px 80px rgba(0,0,0,0.7),
    0 0 100px rgba(255,107,53,0.06);
  position: relative; overflow: hidden;
  animation: fade-up 0.4s ease-out both;
}

/* Gradient top border */
.auth-card::before {
  content: '';
  display: block; height: 2px;
  background: var(--gradient);
  position: absolute; top: 0; left: 0; right: 0;
}

.auth-logo {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 32px;
}

.auth-title {
  font-family: var(--f-display); font-weight: 800; font-size: 22px;
  color: var(--text-hi);
  margin-bottom: 6px;
  line-height: 1.2;
}

.auth-subtitle {
  font-size: 13px; color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

.auth-panel { display: flex; flex-direction: column; }

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

.btn-auth {
  width: 100%;
  background: var(--gradient);
  color: #fff; border: none;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: var(--f-body);
  font-size: 14px; font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 16px var(--grad-glow);
  transition: all 0.18s ease;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer;
  margin-top: 4px;
}
.btn-auth:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(255,107,53,0.35);
}
.btn-auth:active:not(:disabled) { transform: translateY(0); }
.btn-auth:disabled { opacity: 0.7; cursor: not-allowed; }

.spin-icon {
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.auth-alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.5;
  margin-bottom: 4px;
}
.auth-alert-error {
  background: rgba(244, 63, 94, 0.10);
  border: 1px solid rgba(244, 63, 94, 0.25);
  color: #f87096;
}
.auth-alert-success {
  background: rgba(34, 197, 94, 0.10);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #4ade80;
}

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0 4px;
  color: var(--text-muted); font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1; height: 1px;
  background: var(--border-mid);
}

.auth-switch {
  text-align: center;
  font-size: 13px; color: var(--text-muted);
  padding-top: 4px;
}

.auth-link {
  background: none; border: none;
  color: var(--grad-start);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  padding: 0; margin-left: 4px;
  transition: color 0.15s;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: transparent;
}
.auth-link:hover {
  color: var(--grad-end);
  text-decoration-color: var(--grad-end);
}

/* ─── TOPBAR USER / LOGOUT ──────────────────────────────── */
.topbar-user {
  display: flex; align-items: center; gap: 8px;
  padding-left: 8px;
  border-left: 1px solid var(--border-mid);
}

.topbar-email {
  font-size: 11px; color: var(--text-muted);
  font-family: var(--f-mono);
  white-space: nowrap;
}

.btn-logout {
  display: flex; align-items: center; gap: 5px;
  background: transparent;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-family: var(--f-body); font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-logout:hover {
  border-color: rgba(244, 63, 94, 0.35);
  color: #f87096;
  background: rgba(244, 63, 94, 0.06);
}
.btn-logout-text { display: none; }

@media (min-width: 900px) {
  .btn-logout-text { display: inline; }
}

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

/* ─── SIDEBAR ───────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-base);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 200;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Thin gradient line at top of sidebar */
.sidebar::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--gradient);
}

.sidebar-top { padding: 20px 18px 18px; border-bottom: 1px solid var(--border); }

.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.logo-icon {
  width: 34px; height: 34px;
  background: var(--gradient);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-mono); font-weight: 700; font-size: 15px;
  color: #fff;
  box-shadow: 0 4px 14px var(--grad-glow);
  flex-shrink: 0;
}
.logo-text {
  font-family: var(--f-display); font-weight: 800; font-size: 15px;
  letter-spacing: 0.07em; color: var(--text-hi);
}
.logo-text span { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

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

.nav-group-label {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 10px 10px 5px;
  display: block;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13px; font-weight: 400;
  cursor: pointer;
  transition: all 0.16s ease;
  position: relative;
  user-select: none;
}
.nav-item svg { flex-shrink: 0; opacity: 0.7; transition: opacity 0.16s; }
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item:hover svg { opacity: 1; }

.nav-item.active {
  background: linear-gradient(90deg, rgba(255,107,53,0.14) 0%, rgba(255,107,53,0.04) 100%);
  color: var(--grad-start);
  font-weight: 500;
}
.nav-item.active svg { opacity: 1; color: var(--grad-start); }
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px;
  background: var(--gradient);
  border-radius: 0 3px 3px 0;
}

.sidebar-apps {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 7px;
}
.sapp {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; color: var(--text-dim);
}
.sapp-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.flex-app .sapp-dot { background: var(--flex-clr); box-shadow: 0 0 5px var(--flex-clr); }
.grub-app .sapp-dot { background: var(--grub-clr); box-shadow: 0 0 5px var(--grub-clr); }
.uber-app .sapp-dot { background: var(--uber-clr); box-shadow: 0 0 5px var(--uber-clr); }
.inst-app .sapp-dot { background: var(--inst-clr); box-shadow: 0 0 5px var(--inst-clr); }

.sidebar-db-status {
  padding: 10px 18px 16px;
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; color: var(--text-muted);
  font-family: var(--f-mono);
}
.db-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.3s, box-shadow 0.3s;
}
.db-dot.connected { background: var(--success); box-shadow: 0 0 6px var(--success); }
.db-dot.error     { background: var(--danger);  box-shadow: 0 0 6px var(--danger); }

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

/* ─── TOPBAR ────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: rgba(10, 12, 20, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 100;
  gap: 16px;
}

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

.hamburger {
  display: none;
  flex-direction: column; gap: 4px;
  background: none; border: none;
  padding: 6px; border-radius: 6px;
  transition: background 0.15s;
}
.hamburger:hover { background: var(--bg-hover); }
.hamburger span {
  display: block; width: 18px; height: 2px;
  background: var(--text-dim); border-radius: 2px;
  transition: all 0.2s;
}

.page-breadcrumb {
  font-family: var(--f-display);
  font-weight: 700; font-size: 16px;
  color: var(--text-hi);
}

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

.topbar-date {
  font-family: var(--f-mono); font-size: 11px;
  color: var(--text-muted);
}

.btn-add-top {
  display: flex; align-items: center; gap: 6px;
  background: var(--gradient);
  color: #fff; border: none;
  border-radius: var(--radius-sm);
  padding: 7px 16px;
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.01em;
  transition: all 0.18s ease;
  box-shadow: 0 4px 14px var(--grad-glow);
  white-space: nowrap;
}
.btn-add-top:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255,107,53,0.35);
}
.btn-add-top:active { transform: translateY(0); }

/* ─── HERO CARDS ────────────────────────────────────────── */
.hero-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 20px 24px 0;
}

.hero-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative; overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
  animation: fade-up 0.4s both ease-out;
}
.hero-card:nth-child(1) { animation-delay: 0ms; }
.hero-card:nth-child(2) { animation-delay: 70ms; }
.hero-card:nth-child(3) { animation-delay: 140ms; }
.hero-card:nth-child(4) { animation-delay: 210ms; }

.hero-card:hover { transform: translateY(-3px); border-color: var(--border-hi); }

/* Gradient top accent strip */
.hero-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--border-hi), transparent);
  opacity: 0.6;
}
.hero-card.accent::before {
  background: var(--gradient);
  opacity: 1;
}

.hero-card.accent { border-color: rgba(255,107,53,0.2); }

.hc-label {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.hc-value {
  font-size: 30px; font-weight: 600;
  color: var(--text-hi);
  line-height: 1;
  margin-bottom: 6px;
  transition: all 0.3s;
}
.hero-card.accent .hc-value {
  background: var(--gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hc-sub { font-size: 11px; color: var(--text-muted); }

.hc-glow {
  position: absolute; bottom: -30px; right: -20px;
  width: 100px; height: 100px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.02) 0%, transparent 70%);
  pointer-events: none;
}
.hc-glow.accent-glow {
  background: radial-gradient(circle, rgba(255,107,53,0.08) 0%, transparent 70%);
  width: 140px; height: 140px;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── CONTENT AREA ──────────────────────────────────────── */
.content-area {
  flex: 1;
  padding: 20px 24px 40px;
  display: flex; flex-direction: column; gap: 0;
}

/* ─── TAB PANELS ────────────────────────────────────────── */
.tab-panel {
  display: none;
  flex-direction: column;
  gap: 16px;
  animation: tab-in 0.25s ease-out both;
}
.tab-panel.active { display: flex; }

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

.tab-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  padding: 16px 0 4px;
}
.toolbar-hint { font-size: 13px; color: var(--text-muted); }

/* ─── CARDS ─────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--border-hi); }

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-family: var(--f-display); font-weight: 600; font-size: 14px;
  color: var(--text-hi);
}

.tab-grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}

/* ─── PERIOD PILLS ──────────────────────────────────────── */
.period-pills {
  display: flex; gap: 4px;
  background: var(--bg-raised);
  border: 1px solid var(--border-mid);
  border-radius: 99px;
  padding: 3px;
}
.ppill {
  background: transparent; border: none;
  padding: 4px 14px;
  border-radius: 99px;
  font-size: 12px; font-weight: 500;
  color: var(--text-dim);
  transition: all 0.16s;
}
.ppill:hover { color: var(--text); }
.ppill.active {
  background: var(--gradient);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px var(--grad-glow);
}

/* ─── BUTTONS ───────────────────────────────────────────── */
.btn-primary {
  background: var(--gradient);
  color: #fff; border: none;
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-family: var(--f-body);
  font-size: 13px; font-weight: 600;
  box-shadow: 0 3px 12px var(--grad-glow);
  transition: all 0.18s ease;
  white-space: nowrap;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 5px 18px rgba(255,107,53,0.3); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text-dim); border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-family: var(--f-body); font-size: 13px;
  transition: all 0.15s;
}
.btn-ghost:hover { border-color: var(--border-hi); color: var(--text); }

.btn-danger {
  background: var(--danger); color: #fff; border: none;
  border-radius: var(--radius-sm);
  padding: 8px 18px; font-size: 13px; font-weight: 600;
  transition: all 0.15s;
}
.btn-danger:hover { opacity: 0.85; }

.btn-icon-edit, .btn-icon-del {
  background: none; border: none;
  padding: 4px 7px; border-radius: 5px;
  font-size: 12px; font-weight: 500;
  transition: all 0.12s;
}
.btn-icon-edit { color: var(--text-muted); }
.btn-icon-edit:hover { background: rgba(255,193,74,0.12); color: var(--grad-end); }
.btn-icon-del  { color: var(--text-muted); }
.btn-icon-del:hover  { background: rgba(244,63,94,0.12); color: var(--danger); }

/* ─── CHARTS ────────────────────────────────────────────── */
.chart-wrap {
  padding: 16px 18px 18px;
  position: relative;
  min-height: 200px;
}
.chart-donut-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 220px; padding: 18px;
  position: relative;
}
.chart-donut-wrap canvas { max-width: 200px; max-height: 200px; }
.donut-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none;
}
.donut-val {
  font-family: var(--f-mono); font-weight: 600; font-size: 22px;
  background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.donut-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }

/* ─── DATA TABLE ────────────────────────────────────────── */
.table-container { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  text-align: left; padding: 9px 16px;
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-mid);
  white-space: nowrap;
  background: var(--bg-raised);
}
.data-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  vertical-align: middle;
}
.data-table tbody tr { transition: background 0.12s; }
.data-table tbody tr:hover td { background: var(--bg-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }

.mono { font-family: var(--f-mono); }
.positive { color: #22c55e !important; }
.negative { color: var(--danger) !important; }
.neutral  { color: var(--text-dim); }

/* App badges */
.app-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 5px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.app-badge::before { content: '●'; font-size: 8px; }
.ab-flex { background: var(--flex-bg); color: var(--flex-clr); }
.ab-grub { background: var(--grub-bg); color: var(--grub-clr); }
.ab-uber { background: var(--uber-bg); color: var(--uber-clr); }
.ab-inst { background: var(--inst-bg); color: var(--inst-clr); }

/* Expense category badge */
.cat-badge {
  display: inline-block; padding: 2px 9px; border-radius: 5px;
  font-size: 11px; font-weight: 600;
}

/* ─── EMPTY STATE ───────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
}
.empty-icon {
  width: 56px; height: 56px;
  background: var(--bg-raised); border: 1px solid var(--border-mid);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}
.empty-title { font-family: var(--f-display); font-weight: 600; font-size: 15px; color: var(--text-dim); }
.empty-sub   { font-size: 12px; color: var(--text-muted); max-width: 260px; line-height: 1.6; }

/* ─── SKELETON LOADER ───────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-raised) 25%, var(--bg-hover) 50%, var(--bg-raised) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skel-row { height: 14px; margin-bottom: 10px; }
.skel-row:last-child { width: 60%; }

/* ─── RECENT ACTIVITY ───────────────────────────────────── */
.recent-list { padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 2px; }
.recent-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.recent-item:last-child { border-bottom: none; }
.ri-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ri-body { flex: 1; min-width: 0; }
.ri-title { font-size: 13px; color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ri-meta  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.ri-amount { font-family: var(--f-mono); font-size: 13px; font-weight: 600; white-space: nowrap; }

/* ─── STAT LIST (deliveries summary) ───────────────────── */
.stat-list { padding: 8px 18px 18px; display: flex; flex-direction: column; gap: 0; }
.stat-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 0; border-bottom: 1px solid var(--border);
}
.stat-item:last-child { border-bottom: none; }
.stat-item-label { font-size: 13px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; }
.stat-item-val { font-family: var(--f-mono); font-weight: 600; font-size: 14px; color: var(--text-hi); }

/* ─── CATEGORY BREAK LIST ───────────────────────────────── */
.cat-break-list { padding: 8px 18px 18px; display: flex; flex-direction: column; gap: 0; }
.cb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.cb-item:last-child { border-bottom: none; }
.cb-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.cb-label { flex: 1; font-size: 13px; color: var(--text-dim); }
.cb-pct   { font-size: 11px; color: var(--text-muted); font-family: var(--f-mono); }
.cb-bar-track { width: 60px; height: 4px; background: var(--bg-raised); border-radius: 99px; overflow: hidden; }
.cb-bar-fill  { height: 100%; border-radius: 99px; transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
.cb-amount { font-family: var(--f-mono); font-size: 13px; font-weight: 600; color: var(--text-hi); min-width: 60px; text-align: right; }

/* ─── ROUTES MINI STATS ─────────────────────────────────── */
.routes-stats-mini { display: flex; gap: 18px; flex-wrap: wrap; }
.rsm-item { display: flex; flex-direction: column; }
.rsm-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 2px; }
.rsm-val { font-family: var(--f-mono); font-weight: 600; font-size: 16px; color: var(--text-hi); }

/* ─── GOALS GRID ────────────────────────────────────────── */
.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  padding-top: 4px;
}

.goal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  padding: 22px;
  position: relative; overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
  animation: fade-up 0.35s both ease-out;
}
.goal-card:hover { transform: translateY(-3px); border-color: var(--border-hi); }

.goal-card::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  opacity: 0; transition: opacity 0.2s;
}
.goal-card:hover::after { opacity: 1; }
.goal-card.complete::after { background: var(--gradient); opacity: 1; }

.gc-period {
  display: inline-block;
  padding: 2px 9px; border-radius: 5px;
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  background: var(--bg-raised); color: var(--text-muted);
  margin-bottom: 12px;
}
.gc-label  { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.gc-values { display: flex; align-items: baseline; gap: 7px; margin-bottom: 14px; }
.gc-current {
  font-family: var(--f-mono); font-weight: 700; font-size: 30px;
  color: var(--text-hi);
}
.goal-card.complete .gc-current {
  background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.gc-target { font-family: var(--f-mono); font-size: 14px; color: var(--text-muted); }
.gc-pct { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.goal-card.complete .gc-pct { color: var(--grad-start); }

.progress-track {
  height: 5px; background: var(--bg-raised); border-radius: 99px; overflow: hidden;
  margin-bottom: 8px;
}
.progress-fill {
  height: 100%; border-radius: 99px; width: 0;
  background: linear-gradient(90deg, var(--text-muted), var(--text-dim));
  transition: width 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.progress-fill.on-track  { background: var(--gradient); }
.progress-fill.complete  { background: var(--gradient); box-shadow: 0 0 8px var(--grad-glow); }
.progress-fill.behind    { background: linear-gradient(90deg, var(--danger), #ff8c69); }

.gc-remaining { font-size: 11px; color: var(--text-muted); }
.gc-remaining.done { color: var(--grad-start); }

/* ─── MODALS ────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(4, 5, 8, 0.80);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  padding: 0;
  width: 100%; max-width: 500px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 24px 60px rgba(0,0,0,0.7),
    0 0 80px rgba(255,107,53,0.05);
  animation: modal-in 0.22s ease-out;
  overflow: hidden;
}

/* Gradient top border on modals */
.modal::before {
  content: '';
  display: block; height: 2px;
  background: var(--gradient);
}

.modal-sm { max-width: 360px; }

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.94) translateY(-12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-hdr h3 {
  font-family: var(--f-display); font-weight: 700; font-size: 16px;
  color: var(--text-hi);
}
.modal-x {
  background: none; border: none;
  color: var(--text-muted); font-size: 14px;
  padding: 4px 7px; border-radius: 5px;
  transition: all 0.12s;
}
.modal-x:hover { background: var(--bg-hover); color: var(--text); }

.modal-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }

/* ─── FORM FIELDS ───────────────────────────────────────── */
.field-row { display: flex; flex-direction: column; gap: 5px; }
.field-row label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.field-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.field-row input,
.field-row select {
  background: var(--bg-raised);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text-hi);
  font-family: var(--f-body); font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  -webkit-appearance: none;
}
.field-row input:focus,
.field-row select:focus {
  border-color: var(--grad-start);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.12);
}
.field-row input::placeholder { color: var(--text-muted); }
.field-row select option { background: var(--bg-raised); color: var(--text-hi); }

.net-preview {
  flex-direction: row; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-muted);
  padding: 8px 12px;
  background: var(--bg-raised);
  border-radius: var(--radius-sm);
}
.net-val { font-weight: 600; color: var(--success); }

.modal-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  padding-top: 6px; border-top: 1px solid var(--border);
  margin-top: 4px;
}

.delete-msg { font-size: 13px; color: var(--text-dim); line-height: 1.7; margin-bottom: 4px; }

/* ─── QUICK ADD GRID ─────────────────────────────────────── */
.quick-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  padding: 6px 22px 22px;
}
.quick-btn {
  background: var(--bg-raised);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  padding: 20px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--text-dim); font-size: 12px; font-weight: 500;
  transition: all 0.16s;
}
.quick-btn:hover {
  border-color: var(--grad-start);
  color: var(--grad-start);
  background: rgba(255,107,53,0.06);
  transform: translateY(-2px);
}
.quick-btn svg { transition: transform 0.16s; }
.quick-btn:hover svg { transform: scale(1.12); }

/* ─── TOAST NOTIFICATIONS ───────────────────────────────── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9000;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  font-size: 13px; color: var(--text);
  min-width: 260px; max-width: 360px;
  pointer-events: all;
  animation: toast-in 0.3s ease-out;
}
.toast.removing { animation: toast-out 0.25s ease-in forwards; }
@keyframes toast-in  { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { from { opacity: 1; transform: translateX(0); }    to { opacity: 0; transform: translateX(20px); } }

.toast-icon { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.toast.success .toast-icon { background: var(--success); box-shadow: 0 0 6px var(--success); }
.toast.error   .toast-icon { background: var(--danger);  box-shadow: 0 0 6px var(--danger); }
.toast.info    .toast-icon { background: var(--info);    box-shadow: 0 0 6px var(--info); }
.toast-msg { flex: 1; }

/* ─── NET PREVIEW POSITIVE/NEGATIVE ─────────────────────── */
.net-pos { color: var(--success) !important; }
.net-neg { color: var(--danger)  !important; }

/* ─── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 1100px) {
  .tab-grid-2 { grid-template-columns: 1fr; }
  .hero-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 800px) {
  :root { --sidebar-w: 0px; }
  .sidebar {
    width: 228px;
    transform: translateX(-228px);
    box-shadow: 4px 0 30px rgba(0,0,0,0.6);
  }
  .sidebar.sidebar-open { transform: translateX(0); }
  .main { margin-left: 0; }
  .hamburger { display: flex; }
  .topbar-date { display: none; }
  .topbar-email { display: none; }
  .hero-cards { padding: 14px 14px 0; }
  .content-area { padding: 14px 14px 40px; }
}

@media (max-width: 480px) {
  .auth-card { padding: 32px 22px; }
  .auth-title { font-size: 19px; }
}

@media (max-width: 540px) {
  .hero-cards { grid-template-columns: 1fr 1fr; }
  .goals-grid { grid-template-columns: 1fr; }
  .field-2col { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 380px) {
  .hero-cards { grid-template-columns: 1fr; }
}
