/* ===================================================
   FinTrack – Main Stylesheet
   =================================================== */

/* ── RESET & BASE ──────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  background: #F1F5F9;
  color: #1E293B;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 99px; }

input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ── LAYOUT HEADER ─────────────────────────────── */
.desktop-header {
  display: none;
  background: #fff;
  border-bottom: 1px solid #E2E8F0;
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid #E2E8F0;
  padding: 0 16px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 50;
}

@media (min-width: 768px) {
  .desktop-header { display: block; }
  .mobile-header  { display: none; }
}

/* ── BRAND ─────────────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.brand-icon.sm { width: 30px; height: 30px; border-radius: 8px; }
.brand-icon svg { width: 18px; height: 18px; stroke: #fff; }
.brand-icon.sm svg { width: 14px; height: 14px; }
.brand-name { font-family: 'Urbanist', sans-serif; font-size: 18px; font-weight: 800; color: #1E293B; }
.brand-badge {
  font-size: 10px;
  background: #EEF2FF;
  color: #6366F1;
  padding: 2px 7px;
  border-radius: 99px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* ── NAV ───────────────────────────────────────── */
.main-nav { display: flex; gap: 4px; background: #F1F5F9; border-radius: 10px; padding: 3px; }
.nav-link {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px; font-weight: 600; color: #64748B;
  transition: all 0.15s;
}
.nav-link svg { width: 14px; height: 14px; }
.nav-link:hover { color: #1E293B; background: #fff; }
.nav-link.active { background: #fff; color: #6366F1; box-shadow: 0 1px 4px rgba(0,0,0,0.1); }

/* ── MOBILE BOTTOM NAV ─────────────────────────── */
.bottom-nav {
  display: flex;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid #E2E8F0;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bnav-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 0 8px;
  font-size: 10px; font-weight: 600;
  color: #94A3B8;
  transition: color 0.15s;
}
.bnav-btn svg { width: 21px; height: 21px; stroke: #94A3B8; stroke-width: 1.8; transition: stroke 0.15s; }
.bnav-btn.active { color: #6366F1; }
.bnav-btn.active svg { stroke: #6366F1; stroke-width: 2.5; }

@media (min-width: 768px) { .bottom-nav { display: none; } }

/* ── MOBILE FAB ────────────────────────────────── */
.fab {
  display: flex;
  position: fixed;
  bottom: calc(64px + env(safe-area-inset-bottom, 0) + 12px);
  right: 18px;
  width: 50px; height: 50px;
  border-radius: 50%;
  background: #6366F1; color: #fff; border: none;
  align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(99,102,241,0.45);
  z-index: 101; cursor: pointer;
  transition: all 0.2s;
}
.fab svg { width: 22px; height: 22px; stroke: #fff; stroke-width: 2.5; }
.fab:hover { background: #5558E8; transform: scale(1.07); }
@media (min-width: 768px) { .fab { display: none; } }

/* ── PAGE CONTENT ──────────────────────────────── */
.page-content { max-width: 1280px; margin: 0 auto; }
.page-pad {
  padding: 20px 16px 90px;
}
@media (min-width: 768px)  { .page-pad { padding: 28px 32px 32px; } }
@media (min-width: 1280px) { .page-pad { padding: 32px 40px 40px; } }

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}
.page-title { font-family: 'Urbanist', sans-serif; font-size: 22px; font-weight: 800; }
.page-sub   { color: #94A3B8; font-size: 13px; margin-top: 3px; }

/* ── CARDS ─────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  padding: 20px;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.card-title { font-size: 14px; font-weight: 700; color: #1E293B; margin-bottom: 0; }
.chart-card .card-title { margin-bottom: 16px; }
.link-btn {
  display: flex; align-items: center; gap: 3px;
  font-size: 12px; font-weight: 600; color: #6366F1;
  background: none; border: none; cursor: pointer;
}
.link-btn svg { width: 13px; height: 13px; }

/* ── KPI CARDS ─────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
@media (min-width: 768px) { .kpi-grid { grid-template-columns: repeat(4,1fr); gap: 16px; } }

.kpi-card {
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  transition: all 0.2s;
}
.kpi-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.09); transform: translateY(-2px); }
.kpi-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.kpi-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.kpi-icon svg { width: 19px; height: 19px; stroke-width: 2; }
.kpi-sub  { font-size: 11px; color: #94A3B8; font-weight: 500; }
.kpi-value { font-family: 'Urbanist', sans-serif; font-size: 22px; font-weight: 800; color: #1E293B; line-height: 1; }
.kpi-value.positive { color: #10B981; }
.kpi-value.negative { color: #EF4444; }
.kpi-label { font-size: 12px; color: #94A3B8; margin-top: 6px; }

/* ── GRIDS ─────────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (min-width: 1024px) { .dash-grid { grid-template-columns: 1fr 340px; } }

.two-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (min-width: 768px) { .two-grid { grid-template-columns: 1fr 1fr; } }

/* ── CHARTS ────────────────────────────────────── */
.chart-wrap { height: 220px; position: relative; }
.donut-wrap { height: 150px; position: relative; }

/* ── CATEGORY LEGEND ───────────────────────────── */
.cat-legend { display: flex; flex-direction: column; gap: 9px; margin-top: 10px; }
.cat-leg-row { display: flex; align-items: center; gap: 9px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: block; }
.cat-leg-icon {
  width: 24px; height: 24px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cat-leg-icon svg { width: 12px; height: 12px; stroke-width: 2.5; }
.cat-leg-name { flex: 1; font-size: 12px; color: #475569; }
.cat-leg-val  { font-size: 12px; font-weight: 700; color: #1E293B; }

/* ── TRANSACTION LIST ──────────────────────────── */
.txn-list { display: flex; flex-direction: column; gap: 0; }
.txn-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid #F8FAFC;
  transition: background 0.1s;
}
.txn-row:last-child { border-bottom: none; }
.txn-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.txn-icon svg { width: 18px; height: 18px; stroke-width: 2; }
.txn-info  { flex: 1; min-width: 0; }
.txn-remarks { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.txn-meta    { font-size: 11px; color: #94A3B8; margin-top: 2px; }
.txn-amount  { font-size: 13px; font-weight: 700; flex-shrink: 0; }
.txn-amount.income  { color: #10B981; }
.txn-amount.expense { color: #EF4444; }

/* ── BUTTONS ───────────────────────────────────── */
.btn {
  border: none; border-radius: 10px; padding: 10px 18px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: all 0.15s; white-space: nowrap; line-height: 1;
  text-decoration: none;
}
.btn svg { width: 15px; height: 15px; stroke-width: 2.5; flex-shrink: 0; }
.btn-primary {
  background: #6366F1; color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}
.btn-primary:hover { background: #5558E8; box-shadow: 0 4px 16px rgba(99,102,241,0.4); transform: translateY(-1px); }
.btn-ghost {
  background: transparent; color: #64748B;
  border: 1.5px solid #E2E8F0;
}
.btn-ghost:hover { background: #F8FAFC; border-color: #CBD5E1; color: #1E293B; }
.btn-danger  { background: #FEF2F2; color: #EF4444; border: 1.5px solid #FECACA; }
.btn-danger:hover { background: #FEE2E2; }
.btn-sm { padding: 7px 12px; font-size: 12px; border-radius: 8px; gap: 5px; }
.btn-sm svg { width: 13px; height: 13px; }
.hide-mobile { display: none; }
@media (min-width: 768px) { .hide-mobile { display: inline-flex; } }

/* ── FORMS ─────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 11px; font-weight: 700;
  color: #94A3B8; letter-spacing: 0.5px; text-transform: uppercase;
  margin-bottom: 8px;
}
.form-input {
  background: #fff; border: 1.5px solid #E2E8F0; border-radius: 10px;
  padding: 11px 14px; color: #1E293B;
  font-family: inherit; font-size: 14px; width: 100%;
  outline: none; transition: border 0.2s, box-shadow 0.2s;
  display: block;
}
.form-input:focus { border-color: #6366F1; box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.form-input::placeholder { color: #94A3B8; }
.form-select { appearance: none; padding-right: 32px; cursor: pointer; }

.select-wrap { position: relative; display: inline-block; width: 100%; }
.select-wrap .form-select { width: 100%; }
.select-icon {
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; stroke: #94A3B8; pointer-events: none;
}

.amount-wrap { position: relative; }
.amount-prefix {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 20px; color: #94A3B8; font-weight: 700; line-height: 1;
}
.amount-input { padding-left: 34px; font-size: 24px; font-weight: 800; }

/* Type toggle */
.type-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.type-btn {
  padding: 12px 16px; border: 2px solid #E2E8F0; border-radius: 12px;
  background: #fff; color: #94A3B8;
  font-family: inherit; font-weight: 700; font-size: 14px;
  cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.type-btn svg { width: 16px; height: 16px; stroke-width: 2; }
.type-btn[data-type="expense"].active {
  border-color: #FCA5A5; background: #FEF2F2; color: #EF4444;
}
.type-btn[data-type="income"].active {
  border-color: #6EE7B7; background: #ECFDF5; color: #10B981;
}

/* Category preview */
.cat-preview {
  display: none; align-items: center; gap: 9px;
  margin-top: 8px; padding: 8px 12px; border-radius: 9px;
}
.cat-preview.visible { display: flex; }
.cat-preview-icon {
  width: 28px; height: 28px; background: #fff; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.cat-preview-icon svg { width: 14px; height: 14px; stroke-width: 2.5; }
.cat-preview-name { font-size: 13px; font-weight: 700; }

/* ── MODAL ─────────────────────────────────────── */
.overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.45); backdrop-filter: blur(6px);
  z-index: 200; align-items: flex-end; justify-content: center;
}
.overlay.open { display: flex; }
@media (min-width: 640px) { .overlay { align-items: center; } }

.modal {
  background: #fff; border-radius: 24px 24px 0 0;
  width: 100%; max-width: 520px; padding: 24px 24px 32px;
  max-height: 92vh; overflow-y: auto;
  animation: mUp 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}
@media (min-width: 640px) { .modal { border-radius: 20px; margin: 16px; } }

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

.modal-handle {
  width: 36px; height: 4px; background: #E2E8F0;
  border-radius: 99px; margin: 0 auto 20px;
}
@media (min-width: 640px) { .modal-handle { display: none; } }

.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 22px;
}
.modal-title { font-family: 'Urbanist', sans-serif; font-size: 19px; font-weight: 800; }
.modal-close {
  width: 32px; height: 32px; border-radius: 9px;
  background: #F1F5F9; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.modal-close svg { width: 15px; height: 15px; stroke: #64748B; }
.modal-footer { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 22px; }
.modal-footer .btn { justify-content: center; }

/* ── DELETE CONFIRM ────────────────────────────── */
.confirm-dialog {
  background: #fff; border-radius: 16px;
  padding: 28px 24px; width: 320px; max-width: 90vw;
  text-align: center;
  animation: mUp 0.25s ease;
}
.confirm-icon {
  width: 52px; height: 52px; background: #FEF2F2; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
}
.confirm-icon svg { width: 24px; height: 24px; stroke: #EF4444; stroke-width: 2; }
.confirm-title { font-family: 'Urbanist', sans-serif; font-size: 17px; font-weight: 800; margin-bottom: 8px; }
.confirm-body  { font-size: 13px; color: #94A3B8; line-height: 1.6; margin-bottom: 22px; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.confirm-actions .btn { justify-content: center; }
.btn-delete-confirm {
  background: #EF4444; color: #fff; border: none;
  border-radius: 10px; padding: 10px;
  font-family: inherit; font-weight: 700; font-size: 14px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px;
}
.btn-delete-confirm svg { width: 14px; height: 14px; stroke: #fff; stroke-width: 2.5; }

/* ── TOAST ─────────────────────────────────────── */
.toast {
  position: fixed; top: 16px; right: 16px; z-index: 9999;
  padding: 12px 16px; border-radius: 12px; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.14);
  background: #fff; max-width: 300px;
  animation: tIn 0.3s ease;
}
.toast.hidden { display: none; }
.toast.success { border-left: 4px solid #10B981; }
.toast.error   { border-left: 4px solid #EF4444; }
.toast-icon { width: 15px; height: 15px; flex-shrink: 0; }
.toast-icon.success-icon { stroke: #10B981; }
.toast-icon.error-icon   { stroke: #EF4444; display: none; }
.toast.error .success-icon { display: none; }
.toast.error .error-icon   { display: block; }
@keyframes tIn { from { opacity:0; transform:translateX(30px); } to { opacity:1; transform:translateX(0); } }

/* ── FILTER BAR ────────────────────────────────── */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 14px; margin-bottom: 14px;
}
.filter-search { position: relative; flex: 1 1 160px; min-width: 0; }
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; stroke: #94A3B8;
}
.search-input { padding-left: 34px; font-size: 13px; }
.filter-bar .select-wrap { flex: 0 0 auto; width: auto; }
.filter-bar .select-wrap .form-select { width: 160px; font-size: 13px; }
.filter-bar .select-wrap:nth-child(4) .form-select { width: 140px; }

.seg-group {
  display: flex; background: #F1F5F9;
  border-radius: 9px; padding: 3px; gap: 2px; flex-shrink: 0;
}
.seg-btn {
  flex: 1; padding: 7px 12px; border: none; background: none;
  border-radius: 7px; font-family: inherit; font-size: 13px; font-weight: 600;
  color: #64748B; cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.seg-btn.active { background: #fff; color: #6366F1; box-shadow: 0 1px 4px rgba(0,0,0,0.1); }

/* ── TABLE ─────────────────────────────────────── */
.table-card { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead tr {
  background: #F8FAFC; border-bottom: 1px solid #F1F5F9;
}
.data-table th {
  padding: 11px 16px; text-align: left;
  font-size: 11px; color: #94A3B8; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase; white-space: nowrap;
}
.data-table tbody tr {
  border-bottom: 1px solid #F8FAFC;
  transition: background 0.1s;
}
.data-table tbody tr:hover { background: #FAFAFA; }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table td { padding: 11px 16px; font-size: 13px; vertical-align: middle; }

.row-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.row-icon svg { width: 16px; height: 16px; stroke-width: 2; }

.date-cell { font-size: 12px; color: #64748B; margin-bottom: 4px; }

.badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 9px; border-radius: 99px;
  font-size: 11px; font-weight: 600;
}
.badge-income  { background: #ECFDF5; color: #059669; }
.badge-expense { background: #FEF2F2; color: #DC2626; }

.cat-chip { display: flex; align-items: center; gap: 7px; }
.chip-icon {
  width: 26px; height: 26px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.chip-icon.sm { width: 30px; height: 30px; border-radius: 9px; }
.chip-icon svg { width: 13px; height: 13px; stroke-width: 2; }
.chip-icon.sm svg { width: 15px; height: 15px; }
.chip-label { font-size: 12px; font-weight: 600; color: #475569; }
.remarks-cell { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #475569; }
.amount-cell { text-align: right; font-weight: 700; white-space: nowrap; }
.amount-cell.income  { color: #10B981; }
.amount-cell.expense { color: #EF4444; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.hide-sm { display: none; }
@media (min-width: 640px) { .hide-sm { display: table-cell; } }

/* ── ANALYTICS ─────────────────────────────────── */
.cat-bar-row { margin-bottom: 14px; }
.cat-bar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.cat-bar-name { display: flex; align-items: center; gap: 9px; font-size: 13px; color: #475569; font-weight: 500; }
.cat-bar-amount { font-size: 13px; font-weight: 700; }
.pct-label { font-size: 11px; color: #94A3B8; margin-left: 6px; font-weight: 500; }
.progress-outer { height: 6px; background: #F1F5F9; border-radius: 99px; overflow: hidden; }
.progress-inner { height: 100%; border-radius: 99px; transition: width 0.6s ease; }

.donut-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.donut-leg-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #64748B; overflow: hidden; }
.donut-leg-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot.sm { width: 8px; height: 8px; flex-shrink: 0; }

/* ── MOBILE BALANCE ────────────────────────────── */
.mobile-balance { text-align: right; }
.bal-label { font-size: 10px; color: #94A3B8; font-weight: 600; }
.bal-value { font-size: 15px; font-weight: 800; font-family: 'Urbanist', sans-serif; }

/* ── EMPTY STATE ───────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; padding: 40px 20px;
  color: #94A3B8; font-size: 13px; text-align: center;
}
.empty-state.big { padding: 52px 20px; }
.empty-state svg { width: 28px; height: 28px; stroke: #CBD5E1; stroke-width: 1.5; }

/* ── UTILITIES ─────────────────────────────────── */
.positive { color: #10B981; }
.negative { color: #EF4444; }

/* ── TYPOGRAPHY REFINEMENTS (Urbanist + DM Sans) ── */

/* Antialiasing for crisp rendering */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

/* Brand — Urbanist 900 tight */
.brand-name {
  font-family: "Urbanist", sans-serif;
  font-weight: 900;
  letter-spacing: -0.045em;
  font-size: 19px;
}
@media (min-width: 768px) { .brand-name { font-size: 20px; } }

/* Page titles */
.page-title {
  font-family: "Urbanist", sans-serif;
  font-weight: 900;
  font-size: 23px;
  letter-spacing: -0.035em;
  line-height: 1.1;
}
@media (min-width: 480px) { .page-title { font-size: 26px; } }

.page-sub {
  font-size: 13px;
  color: #94A3B8;
  font-weight: 400;
  letter-spacing: 0;
  margin-top: 4px;
}

/* KPI values — Urbanist tabular nums */
.kpi-value {
  font-family: "Urbanist", sans-serif;
  font-weight: 900;
  font-size: clamp(17px, 4.5vw, 26px);
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kpi-label {
  font-size: 11px;
  color: #94A3B8;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-top: 7px;
}
.kpi-sub {
  font-size: 10px;
  color: #94A3B8;
  font-weight: 500;
  text-align: right;
  max-width: 72px;
  line-height: 1.3;
}

/* Card titles */
.card-title {
  font-family: "Urbanist", sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: #1E293B;
  letter-spacing: -0.025em;
}

/* Modal / dialog titles */
.modal-title {
  font-family: "Urbanist", sans-serif;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.035em;
}
.confirm-title {
  font-family: "Urbanist", sans-serif;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

/* Amount figures everywhere */
.txn-amount,
.mti-amount,
.amount-cell {
  font-family: "Urbanist", sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
  font-weight: 700;
}
.mti-amount {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.amount-cell {
  font-size: 14px;
  font-weight: 700;
}
.cat-leg-val {
  font-family: "Urbanist", sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  font-weight: 700;
  font-size: 13px;
}
.cat-bar-amount {
  font-family: "Urbanist", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* Mobile balance */
.bal-value {
  font-family: "Urbanist", sans-serif;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.bal-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94A3B8;
}

/* Amount input in modal */
.amount-input {
  font-family: "Urbanist", sans-serif;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.amount-prefix {
  font-family: "Urbanist", sans-serif;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

/* Buttons — tighter tracking */
.btn {
  letter-spacing: -0.01em;
  font-size: 13px;
  font-weight: 600;
}
.btn-primary { font-weight: 700; }

/* Nav links */
.nav-link {
  letter-spacing: -0.01em;
  font-weight: 600;
}
.bnav-btn {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Form labels */
.form-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #94A3B8;
}
.form-input {
  font-family: "DM Sans", "Segoe UI", sans-serif;
  font-size: 14px;
  letter-spacing: -0.01em;
}

/* Seg buttons */
.seg-btn {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Table */
.data-table th {
  font-size: 10px;
  letter-spacing: 0.07em;
  font-weight: 700;
}
.data-table td {
  font-size: 13px;
  letter-spacing: -0.01em;
}
.chip-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.remarks-cell { letter-spacing: -0.01em; }

/* Badges */
.badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* Mobile transaction items */
.mti-remarks {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.mti-meta {
  font-size: 11px;
  color: #94A3B8;
  letter-spacing: 0;
}

/* Dashboard recent txn */
.txn-remarks {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.txn-meta {
  font-size: 11px;
  color: #94A3B8;
  letter-spacing: 0;
}

/* Analytics */
.cat-bar-name {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.pct-label {
  font-family: "Urbanist", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #94A3B8;
}
.donut-leg-item { font-size: 11px; font-weight: 500; }

/* AUTH PAGES */
.auth-page { min-height:100vh; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,#EEF2FF 0%,#F8FAFC 50%,#F0F9FF 100%); padding:20px 16px; }
.auth-card { background:#fff; border-radius:24px; padding:40px 36px; width:100%; max-width:420px; box-shadow:0 8px 48px rgba(99,102,241,0.12),0 2px 8px rgba(0,0,0,0.05); border:1px solid #E2E8F0; }
@media(max-width:480px){.auth-card{padding:28px 20px;border-radius:20px;}}
.auth-logo { display:flex; align-items:center; gap:10px; margin-bottom:28px; }
.auth-logo-icon { width:42px; height:42px; background:linear-gradient(135deg,#6366F1,#8B5CF6); border-radius:14px; display:flex; align-items:center; justify-content:center; box-shadow:0 4px 14px rgba(99,102,241,0.35); }
.auth-logo-icon svg { width:20px; height:20px; stroke:#fff; stroke-width:2.5; }
.auth-logo-name { font-family:Urbanist,sans-serif; font-size:22px; font-weight:900; letter-spacing:-0.04em; color:#1E293B; }
.auth-logo-badge { font-size:10px; background:#EEF2FF; color:#6366F1; padding:2px 7px; border-radius:99px; font-weight:700; letter-spacing:0.5px; }
.auth-heading { font-family:Urbanist,sans-serif; font-size:24px; font-weight:900; color:#1E293B; letter-spacing:-0.03em; margin-bottom:6px; }
.auth-sub { font-size:13px; color:#94A3B8; margin-bottom:28px; }
.auth-form .form-group { margin-bottom:18px; }
.auth-form .form-input { padding:13px 16px; border-radius:12px; font-size:15px; border:1.5px solid #E2E8F0; background:#FAFAFA; transition:all 0.2s; }
.auth-form .form-input:focus { background:#fff; border-color:#6366F1; box-shadow:0 0 0 4px rgba(99,102,241,0.1); }
.auth-btn { width:100%; padding:14px; border:none; border-radius:12px; background:linear-gradient(135deg,#6366F1,#8B5CF6); color:#fff; font-family:Urbanist,sans-serif; font-size:16px; font-weight:800; letter-spacing:-0.02em; cursor:pointer; margin-top:8px; box-shadow:0 4px 18px rgba(99,102,241,0.35); transition:all 0.2s; }
.auth-btn:hover { box-shadow:0 6px 24px rgba(99,102,241,0.5); transform:translateY(-1px); }
.auth-divider { text-align:center; margin:22px 0 0; font-size:13px; color:#94A3B8; }
.auth-divider a { color:#6366F1; font-weight:700; text-decoration:none; }
.auth-divider a:hover { text-decoration:underline; }
.auth-error { background:#FEF2F2; border:1px solid #FECACA; border-radius:10px; padding:12px 14px; margin-bottom:18px; display:flex; align-items:center; gap:8px; font-size:13px; color:#DC2626; font-weight:500; }
.auth-error svg { width:15px; height:15px; stroke:#DC2626; flex-shrink:0; }
.pwd-wrap { position:relative; }
.pwd-wrap .form-input { padding-right:44px; }
.pwd-toggle { position:absolute; right:13px; top:50%; transform:translateY(-50%); background:none; border:none; cursor:pointer; padding:4px; display:flex; align-items:center; justify-content:center; }
.pwd-toggle svg { width:16px; height:16px; stroke:#94A3B8; transition:stroke 0.15s; }
.pwd-toggle:hover svg { stroke:#6366F1; }
/* USER MENU */
.header-right { display:flex; align-items:center; gap:12px; }
.user-menu { display:flex; align-items:center; gap:10px; padding:5px; border-radius:12px; }
.user-avatar { width:34px; height:34px; border-radius:10px; background:linear-gradient(135deg,#6366F1,#8B5CF6); color:#fff; font-family:Urbanist,sans-serif; font-size:14px; font-weight:900; display:flex; align-items:center; justify-content:center; flex-shrink:0; letter-spacing:-0.02em; }
.user-info { line-height:1.2; }
.user-name { font-size:13px; font-weight:700; color:#1E293B; letter-spacing:-0.01em; }
.user-handle { font-size:11px; color:#94A3B8; font-weight:500; }
.logout-btn { width:32px; height:32px; border-radius:9px; background:#FEF2F2; border:1px solid #FECACA; display:flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0; transition:all 0.15s; text-decoration:none; }
.logout-btn svg { width:14px; height:14px; stroke:#EF4444; stroke-width:2.5; }
.logout-btn:hover { background:#FEE2E2; }
