/* ============================================================
   SmartExpense — Pure Frontend CSS
   Font: Outfit (display) + JetBrains Mono (numbers)
   Theme: Deep navy + electric teal + warm gold
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --navy:        #080e1a;
  --navy2:       #0d1525;
  --navy3:       #111d33;
  --card:        #131e30;
  --card2:       #182540;
  --teal:        #00d4c8;
  --teal-dim:    rgba(0,212,200,.12);
  --gold:        #f5a623;
  --gold-dim:    rgba(245,166,35,.12);
  --rose:        #ff6b6b;
  --rose-dim:    rgba(255,107,107,.12);
  --green:       #2ecc71;
  --green-dim:   rgba(46,204,113,.12);
  --blue:        #4a9eff;
  --text:        #e8edf5;
  --text2:       #8fa3c0;
  --text3:       #4d6280;
  --border:      rgba(255,255,255,.07);
  --border2:     rgba(0,212,200,.2);
  --shadow:      0 8px 40px rgba(0,0,0,.5);
  --radius:      16px;
  --radius-sm:   10px;
  --sidebar-w:   256px;
  --topbar-h:    68px;
  --font:        'Outfit', sans-serif;
  --mono:        'JetBrains Mono', monospace;
}

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

body {
  font-family: var(--font);
  background: var(--navy);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--navy2); }
::-webkit-scrollbar-thumb { background: var(--teal); border-radius: 99px; }

/* ─── SIDEBAR ─── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy2);
  border-right: 1px solid var(--border);
  min-height: 100vh;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}
.sidebar-brand {
  padding: 28px 22px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.brand-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 16px rgba(0,212,200,.3);
}
.brand-name { font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; }
.brand-name span { color: var(--teal); }

.sidebar-section { padding: 20px 14px 8px; }
.sidebar-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--text3);
  text-transform: uppercase;
  padding: 0 10px;
  margin-bottom: 6px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--text2);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  margin-bottom: 3px;
  transition: all .2s;
  position: relative;
}
.nav-link i { width: 20px; text-align: center; font-size: .95rem; }
.nav-link:hover { background: var(--card); color: var(--text); }
.nav-link.active {
  background: var(--teal-dim);
  color: var(--teal);
  border: 1px solid var(--border2);
}
.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--teal);
  border-radius: 0 4px 4px 0;
}
.nav-link.danger { color: var(--rose); }
.nav-link.danger:hover { background: var(--rose-dim); }
.sidebar-footer { margin-top: auto; padding: 16px; border-top: 1px solid var(--border); }
.user-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--card);
  cursor: pointer;
}
.user-ava {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--gold));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .875rem; color: var(--navy);
  flex-shrink: 0;
}
.user-mini-name { font-size: .82rem; font-weight: 600; }
.user-mini-role { font-size: .7rem; color: var(--text3); }

/* ─── 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(8,14,26,.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky; top: 0; z-index: 200;
}
.menu-toggle {
  display: none;
  background: none; border: none;
  color: var(--text); font-size: 1.2rem;
  cursor: pointer; padding: 6px;
}
.topbar-title { font-size: 1.1rem; font-weight: 700; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.icon-btn {
  width: 40px; height: 40px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text2); cursor: pointer;
  font-size: .95rem;
  transition: all .2s;
  position: relative;
}
.icon-btn:hover { border-color: var(--teal); color: var(--teal); }
.notif-dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 8px; height: 8px;
  background: var(--rose);
  border-radius: 50%;
  border: 2px solid var(--navy2);
}
.month-badge {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text2);
}
.month-badge span { color: var(--teal); }

/* ─── PAGE ─── */
.page { padding: 28px; display: none; }
.page.active { display: block; }

/* ─── PAGE HEADER ─── */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap; gap: 12px;
}
.page-head h2 { font-size: 1.5rem; font-weight: 800; }
.page-head p { color: var(--text2); font-size: .875rem; margin-top: 2px; }

/* ─── STAT CARDS ─── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex; align-items: flex-start; gap: 16px;
  transition: transform .2s, border-color .2s;
  cursor: default;
}
.stat-card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,.15); }
.stat-ico {
  width: 50px; height: 50px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; flex-shrink: 0;
}
.ico-teal   { background: var(--teal-dim); color: var(--teal); }
.ico-gold   { background: var(--gold-dim); color: var(--gold); }
.ico-rose   { background: var(--rose-dim); color: var(--rose); }
.ico-green  { background: var(--green-dim); color: var(--green); }
.ico-blue   { background: rgba(74,158,255,.12); color: var(--blue); }

.stat-lbl { font-size: .72rem; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .08em; }
.stat-val { font-family: var(--mono); font-size: 1.5rem; font-weight: 700; color: var(--text); margin: 4px 0 2px; }
.stat-sub { font-size: .74rem; color: var(--text3); }
.stat-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .72rem; font-weight: 600;
  padding: 2px 8px; border-radius: 99px; margin-top: 4px;
}
.badge-up   { background: var(--green-dim); color: var(--green); }
.badge-down { background: var(--rose-dim); color: var(--rose); }

/* ─── CARDS ─── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-head h3 { font-size: .95rem; font-weight: 700; }
.card-head .sub { font-size: .8rem; color: var(--text3); }
.card-body { padding: 22px; }

/* ─── BUDGET BAR ─── */
.bud-track {
  height: 6px;
  background: var(--navy3);
  border-radius: 99px;
  overflow: hidden;
  margin: 8px 0;
}
.bud-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--teal), var(--blue));
  transition: width 1s cubic-bezier(.4,0,.2,1);
}
.bud-fill.warn { background: linear-gradient(90deg, var(--gold), var(--rose)); }

/* ─── CHART WRAPPER ─── */
.chart-wrap { position: relative; height: 260px; }

/* ─── GRID 2/3 ─── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.col-span-2 { grid-column: span 2; }

/* ─── TABLE ─── */
.data-table { width: 100%; border-collapse: collapse; font-size: .855rem; }
.data-table th {
  text-align: left;
  padding: 12px 16px;
  color: var(--text3);
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom: 1px solid var(--border);
  background: var(--navy2);
}
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,.02); }
.data-table .amount { font-family: var(--mono); font-weight: 700; }
.data-table .amount.red { color: var(--rose); }
.data-table .amount.green { color: var(--green); }

/* ─── CATEGORY PILL ─── */
.cat-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 600;
  background: var(--teal-dim);
  color: var(--teal);
}

/* ─── ACTION BTNS ─── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: .875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--teal), var(--blue));
  color: var(--navy);
}
.btn-primary:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,212,200,.3); }
.btn-outline {
  background: transparent;
  color: var(--teal);
  border: 1px solid var(--border2);
}
.btn-outline:hover { background: var(--teal-dim); }
.btn-danger { background: var(--rose-dim); color: var(--rose); border: 1px solid rgba(255,107,107,.2); }
.btn-danger:hover { background: rgba(255,107,107,.25); }
.btn-sm { padding: 6px 12px; font-size: .78rem; border-radius: 8px; }
.btn-gold { background: linear-gradient(135deg, var(--gold), #ff9f00); color: var(--navy); }

/* ─── FORM ELEMENTS ─── */
.form-group { margin-bottom: 18px; }
.form-label { font-size: .8rem; font-weight: 600; color: var(--text2); margin-bottom: 7px; display: block; }
.form-control, .form-select {
  width: 100%;
  background: var(--navy3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: .875rem;
  padding: 11px 14px;
  outline: none;
  transition: border-color .2s;
}
.form-control::placeholder { color: var(--text3); }
.form-control:focus, .form-select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,212,200,.1); }
.form-select option { background: var(--navy3); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(6px);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  width: 100%; max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(.95) translateY(10px);
  transition: transform .25s;
  position: relative;
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-head h3 { font-size: 1.1rem; font-weight: 800; }
.modal-close {
  width: 32px; height: 32px;
  background: var(--rose-dim); border: none; border-radius: 8px;
  color: var(--rose); cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.modal-close:hover { background: rgba(255,107,107,.3); }

/* ─── GOAL CARD ─── */
.goal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
  transition: border-color .2s;
}
.goal-card:hover { border-color: rgba(0,212,200,.25); }
.goal-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.goal-name { font-weight: 700; font-size: .95rem; }
.goal-nums { display: flex; gap: 20px; margin-bottom: 10px; }
.goal-num-lbl { font-size: .68rem; color: var(--text3); text-transform: uppercase; font-weight: 700; letter-spacing: .06em; }
.goal-num-val { font-family: var(--mono); font-size: .9rem; font-weight: 700; margin-top: 2px; }
.goal-progress { height: 8px; background: var(--navy3); border-radius: 99px; overflow: hidden; margin: 8px 0; }
.goal-bar { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--teal), var(--blue)); transition: width 1s cubic-bezier(.4,0,.2,1); }
.goal-bar.done { background: linear-gradient(90deg, var(--gold), var(--green)); }
.goal-foot { display: flex; justify-content: space-between; font-size: .74rem; color: var(--text3); }
.pct-badge {
  font-family: var(--mono); font-size: .78rem; font-weight: 700;
  padding: 3px 10px; border-radius: 99px;
  background: var(--teal-dim); color: var(--teal);
}
.pct-badge.done { background: var(--gold-dim); color: var(--gold); }

/* ─── CATEGORY ICON ─── */
.cat-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}

/* ─── ALERT / NOTIFICATION ─── */
.notif-card {
  display: flex; gap: 14px; padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  border-left: 3px solid;
}
.notif-warn  { background: var(--gold-dim); border-color: var(--gold); }
.notif-danger{ background: var(--rose-dim); border-color: var(--rose); }
.notif-success{ background: var(--green-dim); border-color: var(--green); }
.notif-info  { background: var(--teal-dim); border-color: var(--teal); }
.notif-ico   { font-size: 1.2rem; flex-shrink: 0; padding-top: 2px; }
.notif-msg   { font-size: .84rem; font-weight: 500; }
.notif-time  { font-size: .72rem; color: var(--text3); margin-top: 3px; }

/* ─── EMPTY STATE ─── */
.empty {
  text-align: center; padding: 50px 20px; color: var(--text3);
}
.empty i { font-size: 3rem; margin-bottom: 14px; display: block; opacity: .3; }
.empty p { font-size: .875rem; }

/* ─── AUTH ─── */
.auth-page {
  min-height: 100vh;
  background: var(--navy);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  position: relative; overflow: hidden;
}
.auth-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 60% at 80% 20%, rgba(0,212,200,.06) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 10% 80%, rgba(74,158,255,.05) 0%, transparent 70%);
  pointer-events: none;
}
.auth-card {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px;
  width: 100%; max-width: 430px;
  box-shadow: var(--shadow);
  position: relative; z-index: 1;
}
.auth-logo {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-bottom: 32px;
}
.auth-logo .brand-icon { width: 48px; height: 48px; font-size: 1.4rem; }
.auth-logo-name { font-size: 1.4rem; font-weight: 900; }
.auth-logo-name span { color: var(--teal); }
.auth-title { font-size: 1.4rem; font-weight: 800; margin-bottom: 6px; }
.auth-sub { color: var(--text2); font-size: .875rem; margin-bottom: 28px; }
.auth-foot { text-align: center; margin-top: 20px; font-size: .84rem; color: var(--text3); }
.auth-foot a { color: var(--teal); font-weight: 600; text-decoration: none; cursor: pointer; }

/* ─── TOAST ─── */
.toast-wrap {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  min-width: 280px;
  box-shadow: var(--shadow);
  animation: toastIn .3s ease;
  font-size: .875rem;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--rose); }
.toast.info    { border-left: 3px solid var(--teal); }
@keyframes toastIn { from { transform: translateX(60px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ─── REPORT SUMMARY ROW ─── */
.rep-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.rep-row:last-child { border-bottom: none; }
.rep-bar-bg { flex: 1; height: 6px; background: var(--navy3); border-radius: 99px; overflow: hidden; }
.rep-bar-fill { height: 100%; border-radius: 99px; }
.rep-name { font-size: .84rem; font-weight: 600; min-width: 110px; }
.rep-amt { font-family: var(--mono); font-size: .82rem; font-weight: 700; min-width: 90px; text-align: right; }
.rep-pct { font-size: .72rem; color: var(--text3); min-width: 40px; text-align: right; }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .col-span-2 { grid-column: span 1; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: flex; }
  .page { padding: 16px; }
  .topbar { padding: 0 16px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 22px; }
}
