/* ============================================================
   dashboard.css — SavingPulse investor area
   Depends on: header.css (loaded before this file)
   Provides:   layout, stat cards, charts, tables, SIP/goal
               components. Uses --sp-* tokens from header.css.
   ============================================================ */

/* Local aliases so existing selectors below keep working */
:root {
  --navy:    var(--sp-navy);
  --blue:    var(--sp-blue);
  --blue-lt: var(--sp-blue-lt);
  --gold:    var(--sp-gold);
  --gold-lt: var(--sp-gold-lt);
  --green:   var(--sp-green);
  --green-lt:var(--sp-green-lt);
  --red:     var(--sp-red);
  --red-lt:  var(--sp-red-lt);
  --bg:      var(--sp-bg);
  --surface: var(--sp-surface);
  --border:  var(--sp-border);
  --text:    var(--sp-text);
  --muted:   var(--sp-muted);
  --radius:  var(--sp-radius);
}

/* ── Reset ──────────────────────────────────────────────── */
.dash-body {
  background: var(--bg);
  min-height: 100vh;
  font-family: var(--sp-font);
}
.dash-body .btn-primary { background: var(--blue); border-color: var(--blue); }

/* ════════════════════════════════════════════════════════
   TOPBAR — dashboard-specific overrides
   (Shell, nav links, avatar, search, icon buttons now live
    in header.css under .sp-topbar / .sp-* classes)
════════════════════════════════════════════════════════ */

/* Fixed topbar height matches layout var */
.sp-topbar--fixed {
  height: var(--topbar-h);
  padding: calc(1.5rem * .5);
}

/* Brand aligns with sidebar width */
.sp-topbar--fixed .sp-brand {
  width: var(--sidebar-w);
  flex-shrink: 0;
}

/* Large avatar (profile page) */
.dash-avatar-lg {
  width: 68px; height: 68px;
  border-radius: 50%;
  background: var(--blue);
  border: 1px solid var(--theme-hero-title-color);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════
   SIDEBAR
════════════════════════════════════════════════════════ */
.dash-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: transparent;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1039;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease;
  padding: 1.5rem 0 0 1.75rem;
  padding-top: var(--topbar-h);
}
.dash-sidebar::-webkit-scrollbar { width: 3px; }
.dash-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

/* Nav list */
.dash-nav {
  list-style: none;
  margin: 1rem 0;
  flex: 1;
  background-color: white;
  border-radius: 10px;
}

.dash-nav__link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem .9rem;
  border-radius: 10px;
  /* color: rgba(255,255,255,.6); */
  text-decoration: none;
  /* font-size: .875rem; */
  font-weight: 500;
  transition: background .15s, color .15s;
  white-space: nowrap;
}

.dash-nav__link i {
  font-size: 1.05rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.dash-nav__link:hover {
  background: rgba(255,255,255,.08);
  color: #FCB650;
}

/* ★ Key change: active = white pill on dark sidebar ★ */
.dash-nav__link.active {
  background: #ffffff;
  color: #FCB650;
  /* font-weight: 700; */
}
.dash-nav__link.active i { color: var(--navy); }

/* Badge (e.g. SIP count) */
.dash-nav__badge {
  margin-left: auto;
  background: var(--gold);
  color: var(--navy);
  font-size: .65rem;
  font-weight: 800;
  padding: .1rem .42rem;
  border-radius: 50px;
  flex-shrink: 0;
}

/* Divider */
.dash-nav__divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,.08);
  margin: .5rem .5rem;
}

/* Sidebar bottom profile pill */
.dash-sidebar__footer {
  padding: .875rem .75rem 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
}

.dash-sidebar__profile {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: rgba(255,255,255,.07);
  border-radius: 10px;
  padding: .65rem .875rem;
}

.dash-sidebar__profile-name {
  font-size: .8rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
}

.dash-sidebar__profile-role {
  font-size: .68rem;
  color: rgba(255,255,255,.4);
}

/* Mobile overlay */
.dash-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1038;
}
.dash-overlay.open { display: block; }

/* ════════════════════════════════════════════════════════
   MAIN CONTENT
════════════════════════════════════════════════════════ */
.main-content {
  margin-left: var(--sidebar-w);
  /* margin-top: var(--topbar-total-h); */
  padding: 1.5rem 1.75rem;
  min-height: calc(100vh - var(--topbar-h));
  position: relative;
}
/* No sidebar variant */
.no-sidebar .main-content     { margin-left: 0; }
.no-sidebar .dash-sidebar     { display: none !important; }
.no-sidebar .dash-overlay     { display: none !important; }

.main-content-inner {
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  margin-top: var(--topbar-h);
}
/* Page welcome */
.dash-welcome h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 .2rem;
}
.dash-welcome p {
  font-size: .875rem;
  color: var(--muted);
  margin: 0;
}

/* Section title */
.dash-section-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 1rem;
}
.dash-section-title small {
  font-size: .75rem;
  font-weight: 400;
  color: var(--muted);
  margin-left: .4rem;
}

/* ── Stat cards ──────────────────────────────────────── */
.stat-card {
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  border: none;
  position: relative;
  overflow: hidden;
}

.stat-card-navy  { background: #EEF2FF; }
.stat-card-green { background: var(--green-lt); }
.stat-card-red   { background: var(--red-lt); }
.stat-card-blue  { background: var(--blue-lt); }

.stat-card__label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .4rem;
}

.stat-card__value {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: .35rem;
}

.stat-card__sub {
  font-size: .78rem;
  color: var(--muted);
}

.stat-card__icon {
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: .15;
  font-size: 3rem;
  line-height: 1;
}

.badge-up {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .75rem;
  font-weight: 700;
  color: var(--green);
  background: rgba(18,183,106,.12);
  border-radius: 50px;
  padding: .15rem .5rem;
}

.badge-down {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .75rem;
  font-weight: 700;
  color: var(--red);
  background: rgba(240,68,56,.12);
  border-radius: 50px;
  padding: .15rem .5rem;
}

/* ── White cards ─────────────────────────────────────── */
.dash-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
}

/* Full-height within a row column */
.row > [class*="col"] > .dash-card { height: 100%; }

/* ── Transaction list (icon style, not table) ────────── */
.tx-list { display: flex; flex-direction: column; }

.tx-item {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--border);
}
.tx-item:last-child { border-bottom: none; }

.tx-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.tx-body { flex: 1; min-width: 0; }

.tx-name {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-meta {
  font-size: .75rem;
  color: var(--muted);
  margin-top: 1px;
}

.tx-right { text-align: right; flex-shrink: 0; }
.tx-amount { font-size: .9rem; font-weight: 700; color: var(--text); }
.tx-date   { font-size: .72rem; color: var(--muted); margin-top: 1px; }

/* ── Quick action icons ──────────────────────────────── */
.dash-quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: .875rem .5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: .75rem;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s;
  cursor: pointer;
  text-align: center;
}

.dash-quick-btn i {
  font-size: 1.3rem;
  color: var(--blue);
}

.dash-quick-btn:hover {
  border-color: var(--blue);
  background: var(--blue-lt);
  color: var(--blue);
  transform: translateY(-2px);
}
.dash-quick-btn:hover i { color: var(--blue); }

/* ── SIP cards ───────────────────────────────────────── */
.sip-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .875rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  transition: box-shadow .2s;
}
.sip-card:hover { box-shadow: 0 4px 16px rgba(23,112,200,.08); }

.sip-card__icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--blue-lt);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.sip-card__body { flex: 1; min-width: 0; }
.sip-card__name { font-size: .875rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sip-card__meta { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.sip-card__amount { font-size: .95rem; font-weight: 700; color: var(--text); text-align: right; }
.sip-card__date   { font-size: .7rem; color: var(--muted); text-align: right; }

/* ── Goal cards ──────────────────────────────────────── */
.goal-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.goal-progress-bar {
  background: var(--border);
  border-radius: 50px;
  height: 6px;
  overflow: hidden;
  margin: .6rem 0 .3rem;
}
.goal-progress-bar__fill {
  height: 100%;
  border-radius: 50px;
  background: var(--blue);
  transition: width .6s ease;
}

/* ── Table (portfolio, transactions) ─────────────────── */
.dash-table { width: 100%; border-collapse: collapse; font-size: .875rem; }

.dash-table thead th {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  padding: .55rem .75rem;
  background: var(--bg);
  white-space: nowrap;
}

.dash-table tbody td {
  padding: .8rem .75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.dash-table tbody tr:last-child td { border-bottom: none; }
.dash-table tbody tr:hover td { background: var(--bg); }

.fund-name { font-weight: 600; color: var(--navy); display: block; font-size: .875rem; }
.fund-meta { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.fund-dot  { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }

/* ── Status pills ────────────────────────────────────── */
.pill {
  display: inline-block;
  padding: .18rem .55rem;
  border-radius: 50px;
  font-size: .68rem;
  font-weight: 700;
}
.pill-active  { background: #ECFDF5; color: #059669; }
.pill-paused  { background: #FFFBEB; color: #D97706; }
.pill-stopped { background: #FFF1F2; color: var(--red); }

/* ── Form controls ───────────────────────────────────── */
.dash-body .form-control,
.dash-body .form-select {
  border-color: var(--border);
  border-radius: 8px;
  font-size: .875rem;
  color: var(--text);
}
.dash-body .form-control:focus,
.dash-body .form-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(23,112,200,.12);
}
.dash-body .form-label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: .3rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── Tab pills ───────────────────────────────────────── */
.dash-tabs {
  display: flex;
  gap: .3rem;
  background: var(--bg);
  border-radius: 10px;
  padding: .3rem;
  width: fit-content;
  flex-wrap: wrap;
}
.dash-tab {
  padding: .38rem .9rem;
  border-radius: 7px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: none;
  transition: all .15s;
  text-decoration: none;
}
.dash-tab:hover { color: var(--navy); background: rgba(0,0,0,.04); }
.dash-tab.active { 
  background: var(--theme-hero-title-color);
  color: var(--theme-header-active-bg);
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}

/* ── Alert banners ───────────────────────────────────── */
.dash-alert {
  border-radius: 10px;
  padding: .7rem 1rem;
  font-size: .84rem;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  margin-bottom: 1rem;
}
.dash-alert i { font-size: .95rem; margin-top: 1px; flex-shrink: 0; }
.dash-alert-info    { background: var(--blue-lt);  color: #1e40af; }
.dash-alert-warning { background: #FFFBEB;          color: #92400e; }
.dash-alert-success { background: var(--green-lt);  color: #065f46; }
.dash-alert-danger  { background: var(--red-lt);    color: #9f1239; }

/* ── KYC badges ──────────────────────────────────────── */
.kyc-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .72rem;
  font-weight: 700;
  padding: .22rem .6rem;
  border-radius: 50px;
}
.kyc-verified { background: var(--green-lt); color: #059669; }
.kyc-pending  { background: #FFFBEB;         color: #D97706; }
.kyc-rejected { background: var(--red-lt);   color: var(--red); }
.kyc-linked   { background: var(--blue-lt);  color: var(--blue); }

/* ── Profile hero card ───────────────────────────────── */
.profile-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  flex-wrap: wrap;
}

.profile-hero__left {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  flex: 1;
  min-width: 0;
}

.profile-hero__avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: -.02em;
}

.profile-hero__name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
  margin-bottom: .2rem;
}

.profile-hero__meta {
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: .5rem;
}

.profile-hero__sep {
  margin: 0 .4rem;
  opacity: .4;
}

.profile-hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.profile-hero__right {
  text-align: right;
  flex-shrink: 0;
}

.profile-hero__pan-label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .15rem;
}

.profile-hero__pan {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: .1em;
  font-family: monospace;
}

.profile-hero__since {
  font-size: .75rem;
  color: var(--muted);
  margin-top: .3rem;
}

@media (max-width: 575.98px) {
  .profile-hero         { flex-direction: column; }
  .profile-hero__right  { text-align: left; }
}

/* ── Fund cards (invest page) ────────────────────────── */
.fund-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color .2s, box-shadow .2s;
  cursor: pointer;
}
.fund-card:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 20px rgba(23,112,200,.1);
  color: inherit;
}
.fund-card__name  { font-weight: 700; font-size: .9rem; color: var(--navy); margin-bottom: 2px; }
.fund-card__meta  { font-size: .72rem; color: var(--muted); }
.fund-card__ret-val   { font-weight: 800; font-size: 1.05rem; color: var(--green); }
.fund-card__ret-label { font-size: .68rem; color: var(--muted); }

/* ── Page header (inner pages) ───────────────────────── */
.dash-page-header { margin-bottom: 1.5rem; }
.dash-page-header h1 { font-size: 1.3rem; font-weight: 700; color: var(--text); margin: 0 0 .2rem; }
.dash-page-header p  { font-size: .875rem; color: var(--muted); margin: 0; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 991.98px) {
  /* topbar: header.css hides .sp-topnav and shows .sp-topbar__toggle */
  .sp-topbar--fixed .sp-brand { width: auto; padding: 0 1rem; }

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

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

@media (max-width: 575.98px) {
  .main-content { padding: 1rem; }
  .stat-card__value { font-size: 1.3rem; }
}









