:root{
  --sidebar-bg:#ffffff;
  --sidebar-bg-2:#f7f8fc;
  --sidebar-border:#e7eaf3;

  --purple:#6c5dd3;
  --purple-dark:#5a4bc4;
  --purple-light:#efeafb;
  --green:#1fbe7a;
  --green-light:#e2f9ee;
  --orange:#ff9f43;
  --orange-light:#fff1e2;
  --blue:#4d8af0;
  --blue-light:#e8f0fe;
  --pink:#f5487f;
  --pink-light:#fde9f0;
  --gray-accent:#b7bacb;
  --bg:#f5f5f9;
  --card:#ffffff;
  --border:#ececf3;
  --text:#1a1a2e;
  --text-dim:#6b6d80;
  --text-faint:#a3a5b8;
  --radius-lg:20px;
  --radius-md:14px;
  --radius-sm:6px;
}
*{
  box-sizing:border-box;
  margin:0;
  padding:0;
}

html, body{
  width:100%;
  min-height:100%;
}
body{
  font-family:'Inter',-apple-system,BlinkMacSystemFont,sans-serif;
  background:var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
}
.logout-item{
  margin-top:8px;
  color:#ef4444;
}

.logout-item:not(.active):hover{
  background:#fff1f2;
  color:#dc2626;
}
img{
  max-width:100%;
  display:block;
}

button,
input,
select{
  font:inherit;
}

.app{
  display:flex;
  width:100%;
  min-height:100vh;
  overflow:hidden;
}

/* ---------------- SIDEBAR ---------------- */
.sidebar{
  width:250px;
  left:-260px;
    transition:left .3s ease;
  flex-shrink:0;
  background:linear-gradient(180deg,var(--sidebar-bg),var(--sidebar-bg-2));
  color:var(--text);
  padding:26px 18px;
  display:flex;
  flex-direction:column;
  position:sticky;
  top:0;
  height:100vh;
  overflow:hidden;
  border-right:1px solid var(--sidebar-border);
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  padding:0 6px 28px;
}

.brand-mark{
  width:38px;
  height:38px;
  border-radius:11px;
  background:linear-gradient(135deg,#8b7bf0,var(--purple));
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 6px 16px rgba(108,93,211,.45);
  flex-shrink:0;
}

.brand-mark svg{
  width:20px;
  height:20px;
}
.brand-text .name{
  font-weight:700;
  font-size:15.5px;
  letter-spacing:.2px;
  line-height:1.1;
  color:var(--text);
}

.brand-text .tag{
  font-size:10px;
  letter-spacing:1.5px;
  color:var(--text-faint);
  font-weight:600;
  margin-top:2px;
}

nav.nav{
  display:flex;
  flex-direction:column;
  gap:2px;
  margin-top:6px;
}
.nav-item{
  display:flex;
  align-items:center;
  gap:12px;
  padding:11px 14px;
  border-radius:11px;
  color:var(--text-dim);
  font-size:13.5px;
  font-weight:500;
  text-decoration:none;
  transition:background .15s, color .15s;
}

.nav-item svg{
  width:18px;
  height:18px;
  flex-shrink:0;
  opacity:.8;
}

.nav-item.active{
  background:var(--purple);
  color:#fff;
  box-shadow:0 8px 18px rgba(108,93,211,.18);
}

.nav-item:not(.active):hover{
  background:#f3f5fb;
  color:var(--text);
}
.sidebar-spacer{
  flex:1;
}

.promo-card{
  background:linear-gradient(160deg,#7c6de3,#5d4fd0);
  border-radius:16px;
  padding:16px 16px 18px;
  margin-top:18px;
  position:relative;
  overflow:hidden;
  color:#fff;
}

.promo-card h4{
  font-size:13.5px;
  font-weight:700;
  line-height:1.3;
  margin-bottom:6px;
  color:#fff;
}

.promo-card p{
  font-size:11.5px;
  color:#f0edff;
  line-height:1.5;
  margin-bottom:14px;
}

.promo-btn{
  display:inline-block;
  width:100%;
  text-align:center;
  background:#fff;
  color:var(--purple-dark);
  font-size:12.5px;
  font-weight:400;
  padding:9px 0;
  border-radius:9px;
  border:none;
  cursor:pointer;
}

.promo-icon{
  width:34px;
  height:34px;
  border-radius:10px;
  background:rgba(255,255,255,.18);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
  margin-bottom:12px;
}

.promo-card h4{
  font-size:13.5px;
  font-weight:700;
  line-height:1.3;
  margin-bottom:6px;
}

.promo-card p{
  font-size:11.5px;
  color:#d9d6f2;
  line-height:1.5;
  margin-bottom:14px;
}

.promo-btn{
  display:inline-block;
  width:100%;
  text-align:center;
  background:#fff;
  color:var(--purple-dark);
  font-size:12.5px;
  font-weight:400;
  padding:9px 0;
  border-radius:9px;
  border:none;
  cursor:pointer;
}

.sidebar-foot{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-top:18px;
  padding:0 4px;
  font-size:11px;
  color:var(--text-faint);
}

.toggle-pill{
  width:34px;
  height:18px;
  border-radius:20px;
  background:var(--purple);
  position:relative;
  flex-shrink:0;
}

.toggle-pill::after{
  content:'';
  position:absolute;
  top:2px;
  right:2px;
  width:14px;
  height:14px;
  border-radius:50%;
  background:#fff;
}

/* ---------------- MAIN ---------------- */
main{
  flex:1;
  min-width:0;
  width:100%;
  padding:30px 36px 50px;
  overflow-x:hidden;
}

.topbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  margin-bottom:26px;
  gap:16px;
}

.topbar h1{
  font-size:23px;
  font-weight:700;
  line-height:1.15;
}

.topbar p{
  font-size:13px;
  color:var(--text-dim);
  margin-top:4px;
}

.topbar-right{
  display:flex;
  align-items:center;
  gap:14px;
  flex-shrink:0;
}

.date-pill{
  display:flex;
  align-items:center;
  gap:8px;
  background:var(--card);
  border:1px solid var(--border);
  padding:9px 14px;
  border-radius:10px;
  font-size:12.5px;
  font-weight:500;
  color:var(--text);
  box-shadow:0 2px 6px rgba(20,20,40,.03);
  white-space:nowrap;
}

.bell{
  width:38px;
  height:38px;
  border-radius:10px;
  background:var(--card);
  border:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
  box-shadow:0 2px 6px rgba(20,20,40,.03);
  flex-shrink:0;
}

.bell .dot{
  position:absolute;
  top:-4px;
  right:-4px;
  background:var(--purple);
  color:#fff;
  font-size:9px;
  font-weight:700;
  width:16px;
  height:16px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  border:2px solid var(--bg);
}

/* ---------------- STAT CARDS ---------------- */
.stats-row{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:18px;
  margin-bottom:20px;
}

.stat-card{
  background:var(--card);
  border-radius:var(--radius-sm);
  padding:18px 18px 16px;
  border:1px solid var(--border);
  box-shadow:0 2px 10px rgba(20,20,50,.03);
  min-width:0;
}

.stat-top{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:14px;
}

.stat-icon{
  width:34px;
  height:34px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
}

.stat-icon svg{
  width:16px;
  height:16px;
}

.stat-label{
  font-size:10.5px;
  letter-spacing:.6px;
  color:var(--text-faint);
  font-weight:700;
  text-transform:uppercase;
  line-height:1.2;
}

.stat-value{
  font-size:21px;
  font-weight:800;
  margin-bottom:8px;
  line-height:1.2;
  word-break:break-word;
}

.stat-sub{
  display:flex;
  align-items:center;
  gap:5px;
  font-size:11.5px;
  color:var(--text-faint);
  min-height:16px;
  line-height:1.3;
  flex-wrap:wrap;
}

.stat-sub .up{
  color:var(--green);
  font-weight:700;
}

/* Colorful gradient stat cards (Overview page) */
.stat-card.gradient-blue,
.stat-card.gradient-purple,
.stat-card.gradient-green,
.stat-card.gradient-orange{
  border:none;
  color:#fff;
  box-shadow:0 10px 24px rgba(20,20,50,.14);
}

.stat-card.gradient-blue{ background:linear-gradient(135deg,#5b93f5,#2f5fd6); }
.stat-card.gradient-purple{ background:linear-gradient(135deg,#9b7bf5,#6c5dd3); }
.stat-card.gradient-green{ background:linear-gradient(135deg,#2fd9a0,#149c67); }
.stat-card.gradient-orange{ background:linear-gradient(135deg,#ffc165,#ff8a3d); }

.stat-card.gradient-blue .stat-icon,
.stat-card.gradient-purple .stat-icon,
.stat-card.gradient-green .stat-icon,
.stat-card.gradient-orange .stat-icon{
  background:rgba(255,255,255,.22);
}

.stat-card.gradient-blue .stat-icon svg,
.stat-card.gradient-purple .stat-icon svg,
.stat-card.gradient-green .stat-icon svg,
.stat-card.gradient-orange .stat-icon svg{
  stroke:#fff;
}

.stat-card.gradient-blue .stat-label,
.stat-card.gradient-purple .stat-label,
.stat-card.gradient-green .stat-label,
.stat-card.gradient-orange .stat-label{
  color:rgba(255,255,255,.85);
}

.stat-card.gradient-blue .stat-value,
.stat-card.gradient-purple .stat-value,
.stat-card.gradient-green .stat-value,
.stat-card.gradient-orange .stat-value{
  color:#fff;
}

.stat-card.gradient-blue .stat-sub,
.stat-card.gradient-purple .stat-sub,
.stat-card.gradient-green .stat-sub,
.stat-card.gradient-orange .stat-sub{
  color:rgba(255,255,255,.9);
}

.stat-card.gradient-blue .stat-sub .up,
.stat-card.gradient-purple .stat-sub .up,
.stat-card.gradient-green .stat-sub .up,
.stat-card.gradient-orange .stat-sub .up{
  color:#fff;
}

/* ---------------- PANELS ---------------- */
.mid-row{
  display:grid;
  grid-template-columns:1.05fr 1.4fr;
  gap:18px;
  margin-bottom:20px;
}

.panel,
.card,
.txn-panel{
  background:var(--card);
  border-radius:var(--radius-sm);
  border:1px solid var(--border);
  box-shadow:0 2px 10px rgba(20,20,50,.03);
  min-width:0;
}

.panel{
  padding:20px 22px 22px;
}

.panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:16px;
  gap:10px;
}

.panel-head h3{
  font-size:14.5px;
  font-weight:700;
  line-height:1.2;
}

.filter-chip{
  font-size:11.5px;
  color:var(--text-dim);
  background:var(--bg);
  border:1px solid var(--border);
  padding:5px 10px;
  border-radius:8px;
  font-weight:500;
  white-space:nowrap;
}

.view-all{
  font-size:12px;
  color:var(--purple);
  font-weight:600;
  text-decoration:none;
}

/* ---------------- DONUT ---------------- */
.donut-wrap{
  display:flex;
  align-items:center;
  gap:26px;
  min-width:0;
}

.chart-container{
  position:relative;
  width:200px;
  height:200px;
  flex-shrink:0;
  display:flex;
  align-items:center;
  justify-content:center;
}

.donut-segment{
  transition:transform .25s ease, opacity .25s ease;
  transform-origin:100px 100px;
  cursor:pointer;
}

.donut-segment:hover{
  opacity:.85;
  transform:scale(1.035);
}

.key-stat{
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%,-50%);
  text-align:center;
  pointer-events:none;
  max-width:90px;
}

.key-stat .value{
  font-size:16px;
  font-weight:800;
  color:var(--navy3);
  line-height:1.15;
}

.key-stat .label{
  font-size:10px;
  color:var(--text-faint);
  margin-top:2px;
}

.legend{
  display:flex;
  flex-direction:column;
  gap:12px;
  flex:1;
  min-width:0;
}

.legend-row{
  display:flex;
  align-items:center;
  gap:9px;
  font-size:12.5px;
  min-width:0;
  cursor:pointer;
  transition:opacity .25s ease;
}

.legend-row.dimmed{
  opacity:.35;
}

.legend-swatch{
  width:8px;
  height:8px;
  border-radius:2px;
  flex-shrink:0;
}

.legend-icon{
  width:22px;
  height:22px;
  border-radius:6px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:11px;
  flex-shrink:0;
}

.legend-name{
  flex:1;
  font-weight:500;
  color:var(--text);
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.legend-amt{
  text-align:right;
  flex-shrink:0;
}

.legend-amt .n{
  font-weight:700;
  font-size:12.5px;
}

.legend-amt .p{
  font-size:10.5px;
  color:var(--text-faint);
}

.top-cat{
  display:flex;
  align-items:center;
  gap:8px;
  background:var(--purple-light);
  border-radius:10px;
  padding:9px 12px;
  margin-top:18px;
  font-size:12px;
  min-width:0;
  overflow:hidden;
}

.top-cat b{
  color:var(--purple-dark);
}

/* ---------------- PORTFOLIO TREND ---------------- */
.trend-chart-wrap{
  position:relative;
  width:100%;
  min-width:0;
}

.trend-axis{
  display:flex;
  justify-content:space-between;
  font-size:10.5px;
  color:var(--text-faint);
  margin-top:6px;
  padding:0 2px;
  gap:8px;
}

.trend-foot{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid var(--border);
}

.trend-foot-label{
  font-size:10.5px;
  color:var(--text-faint);
  text-transform:uppercase;
  letter-spacing:.5px;
  font-weight:700;
}

.trend-foot-val{
  font-size:14px;
  font-weight:700;
  margin-top:4px;
  line-height:1.3;
}

.trend-foot-val .up{
  color:var(--green);
  font-size:12px;
  font-weight:700;
  margin-left:4px;
}

.up-icon.up{
  color:var(--green);
}

/* ---------------- SECTION PAGES ---------------- */
#overview-content,
#section-view,
#section-content{
  width:100%;
  min-width:0;
  max-width:100%;
}

#overview-content[hidden],
#section-view[hidden]{
  display:none !important;
}

.section-page-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  margin-bottom:22px;
  gap:16px;
}

.section-page-header h1,
#section-title{
  font-size:23px;
  font-weight:700;
  line-height:1.15;
}

.section-page-header p,
#section-subtitle{
  margin-top:5px;
  font-size:13px;
  color:var(--text-dim);
}

.empty-state{
  padding:32px;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  text-align:center;
  color:var(--text-dim);
}

.cards-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:16px;
}

.card-card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:16px;
  padding:18px;
  box-shadow:0 10px 30px rgba(0,0,0,.04);
}

.profile-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.section-key-value{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:14px 16px;
  background:#f8f8ff;
  border-radius:12px;
  min-width:0;
}

.section-key-value span{
  color:#6b6d80;
  text-transform:capitalize;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.section-key-value strong{
  text-align:right;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

#section-content{
  overflow-x:auto;
  overflow-y:hidden;
  padding-bottom:2px;
}

/* ---------------- GENERIC TABLES ---------------- */
table{
  border-collapse:collapse;
}

.table{
  width:max-content;
  min-width:100%;
  background:#fff;
  border-radius:14px;
  overflow:hidden;
}

.table-wrap{
  width:100%;
  max-width:100%;
  overflow-x:auto;
  overflow-y:hidden;
  border-radius:14px;
  background:#fff;
}

.table thead th,
.tbl thead th{
  text-align:left;
  font-size:10.5px;
  letter-spacing:.6px;
  color:var(--text-faint);
  text-transform:uppercase;
  font-weight:700;
  padding:14px 16px;
  border-bottom:1px solid var(--border);
  background:#fafafe;
  white-space:nowrap;
}

.table tbody td,
.tbl tbody td{
  padding:13px 16px;
  border-bottom:1px solid var(--border);
  font-size:13px;
  vertical-align:middle;
  white-space:nowrap;
}

.table tbody tr:last-child td,
.tbl tbody tr:last-child td{
  border-bottom:none;
}

.table tbody tr:hover,
.tbl tbody tr:hover{
  background:#f7f9fd;
  transition:.25s;
}

.table-wrap::-webkit-scrollbar,
.tbl-wrap::-webkit-scrollbar,
#section-content::-webkit-scrollbar{
  height:8px;
}

.table-wrap::-webkit-scrollbar-thumb,
.tbl-wrap::-webkit-scrollbar-thumb,
#section-content::-webkit-scrollbar-thumb{
  background:#c8c9d6;
  border-radius:999px;
}

.table-wrap::-webkit-scrollbar-track,
.tbl-wrap::-webkit-scrollbar-track,
#section-content::-webkit-scrollbar-track{
  background:transparent;
}

/* ---------------- CURRENT HOLDINGS / DASHBOARD TABLE ---------------- */
.txn-panel{
  padding:20px 22px 8px;
  margin-bottom:20px;
}

.card{
  width:100%;
  overflow:hidden;
}

.tbl-wrap{
  width:100%;
  max-width:100%;
  overflow-x:auto;
  overflow-y:hidden;
  display:block;
  border-radius:14px;
}

.tbl{
  width:max-content;
  min-width:100%;
  border-collapse:collapse;
  table-layout:auto;
}

.tbl th,
.tbl td{
  white-space:nowrap;
}

.tbl tbody tr:hover{
  background:#f7f9fd;
  transition:.25s;
}

/* ---------------- TABLE TOOLBAR / SIP-STP ---------------- */
.table-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:18px;
  gap:20px;
  flex-wrap:wrap;
}

.table-header h3{
  margin:0;
  font-size:20px;
  font-weight:700;
}

.table-header p{
  margin-top:4px;
  color:#888;
  font-size:13px;
}

.table-tools{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.search-input{
  padding:10px 14px;
  border:1px solid #ddd;
  border-radius:10px;
  min-width:260px;
  background:#fff;
  color:var(--text);
  outline:none;
}

.search-input:focus{
  border-color:rgba(108,93,211,.5);
  box-shadow:0 0 0 3px rgba(108,93,211,.08);
}

.select,
.form-input{
  background:#fff;
  color:var(--text);
  border:1px solid #ddd;
  border-radius:10px;
  outline:none;
}

.select{
  padding:10px 14px;
  min-width:160px;
}

.form-input{
  padding:10px 14px;
  min-width:220px;
}

.status-badge{
  display:inline-block;
  padding:4px 10px;
  border-radius:999px;
  background:#E8F7EE;
  color:#15803D;
  font-size:12px;
  font-weight:600;
  white-space:nowrap;
}

.status-badge.paused{
  background:#fff3e5;
  color:#b45309;
}

.status-badge.stopped{
  background:#fdecec;
  color:#b91c1c;
}

.status-badge.active{
  background:#e8f7ee;
  color:#15803D;
}

/* ---------------- SIP/STP TABLE HELPERS ---------------- */
.sip-section-card,
.section-table-card{
  width:100%;
  min-width:0;
  padding:20px;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow:0 2px 10px rgba(20,20,50,.03);
}

.sip-table{
  min-width:1700px;
  width:max-content;
  border-collapse:collapse;
}

.sip-table th,
.sip-table td{
  white-space:nowrap;
  padding:14px 18px;
}

.sip-table thead th{
  background:#fafafe;
}

.sip-table tbody tr:hover{
  background:#f7f9fd;
}

.fund-name{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
}

.fund-name strong{
  font-weight:700;
}

.fund-name span{
  color:var(--text-faint);
  font-size:11px;
}

/* ---------------- TEXT / SMALL UI ---------------- */
.cat-pill{
  display:inline-block;
  padding:4px 10px;
  border-radius:20px;
  font-size:10.5px;
  font-weight:700;
  white-space:nowrap;
}

.pay-method{
  display:flex;
  align-items:center;
  gap:8px;
  color:var(--text-dim);
}

.pay-icon{
  width:22px;
  height:15px;
  border-radius:3px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:8px;
  color:#fff;
  font-weight:700;
}

td.amount{
  text-align:right;
  font-weight:700;
  color:#e5335a;
}

.section-subtitle{
  color:var(--text-dim);
}

/* ---------------- BUDGET CARDS ---------------- */
.section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:14px;
  gap:12px;
}

.section-head h3{
  font-size:15px;
  font-weight:700;
}

.budget-row{
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:16px;
  margin-bottom:20px;
}

.budget-card{
  background:var(--card);
  border-radius:var(--radius-sm);
  padding:16px;
  border:1px solid var(--border);
  box-shadow:0 2px 10px rgba(20,20,50,.03);
  min-width:0;
}

.budget-card-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:14px;
  gap:10px;
}

.cat-icon{
  width:34px;
  height:34px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:15px;
  flex-shrink:0;
}

.budget-card .cname{
  font-size:13px;
  font-weight:700;
  margin-bottom:2px;
  line-height:1.2;
}

.budget-card .camt{
  font-size:11px;
  color:var(--text-faint);
  margin-bottom:10px;
  word-break:break-word;
}

.bcard-bar-track,
.budget-bar-track{
  height:6px;
  background:var(--border);
  border-radius:6px;
  overflow:hidden;
  margin-bottom:6px;
}

.bcard-bar-fill,
.budget-bar-fill{
  height:100%;
  border-radius:6px;
}

.bcard-pct,
.budget-of{
  font-size:10.5px;
  color:var(--text-faint);
  text-align:right;
  font-weight:600;
}

/* ---------------- CTA ---------------- */
.cta{
  background:linear-gradient(120deg,var(--purple) 0%,#7b6ce0 55%,#4d6bea 100%);
  border-radius:6px;
  padding:34px 40px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  color:#fff;
  position:relative;
  overflow:hidden;
  gap:20px;
}

.cta-left{
  display:flex;
  align-items:flex-start;
  gap:18px;
  max-width:520px;
  min-width:0;
}

.cta-icon{
  width:46px;
  height:46px;
  border-radius:13px;
  background:rgba(255,255,255,.2);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:20px;
  flex-shrink:0;
}

.cta h2{
  font-size:19px;
  font-weight:700;
  margin-bottom:8px;
}

.cta p{
  font-size:13px;
  color:#e3e0fb;
  line-height:1.5;
  margin-bottom:18px;
}

.cta-btn{
  background:#fff;
  color:var(--purple-dark);
  border:none;
  padding:12px 22px;
  border-radius:11px;
  font-size:13px;
  font-weight:400;
  cursor:pointer;
}

.cta-art{
  width:120px;
  height:120px;
  border-radius:50%;
  background:rgba(255,255,255,.15);
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  overflow:hidden;
}

.cta-art img{
  width:78px;
  height:78px;
  border-radius:50%;
  object-fit:cover;
}

/* ---------------- HAMBURGER / MENU TOGGLE ---------------- */
.menu-toggle{
  display:none;
  width:42px;
  height:42px;
  border:none;
  border-radius:10px;
  background:#6c5dd3;
  color:#fff;
  font-size:22px;
  cursor:pointer;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  transition:all .2s ease;
}
.menu-toggle:hover{
  background:#5a4bc4;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sidebar-overlay.open,
.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

.sidebar-close {
  display: none;
  background: transparent;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: var(--text-dim);
  cursor: pointer;
  margin-left: auto;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all .2s ease;
}
.sidebar-close:hover {
  background: #f1f5f9;
  color: var(--text);
}

/* ---------------- RESPONSIVE ----------------
   Ordered largest -> smallest so smaller breakpoints
   correctly override larger ones (no duplicate/conflicting
   breakpoints for the same selector). */

@media (max-width:1180px){
  .stats-row{
    grid-template-columns:repeat(2,1fr);
  }

  .mid-row{
    grid-template-columns:1fr;
  }

  .budget-row{
    grid-template-columns:repeat(3,1fr);
  }

  .cta{
    flex-direction:column;
    align-items:flex-start;
  }
}

@media (max-width:1024px){
  .sidebar{
    width:220px;
  }

  main{
    padding:20px;
  }

  .stats-row{
    grid-template-columns:repeat(2,1fr);
  }

  .mid-row{
    grid-template-columns:1fr;
  }

  .budget-row{
    grid-template-columns:repeat(2,1fr);
  }
}

@media (max-width:991px){
  /* Sidebar becomes an off-canvas drawer */
  .sidebar-close{
    display:block;
  }

  .sidebar{
    position:fixed;
    top:0;
    left:-280px;
    width:260px;
    height:100vh;
    z-index:1000;
    transition:left .3s ease;
    box-shadow:0 0 30px rgba(0,0,0,.15);
  }

  .sidebar.open,
  .sidebar.mobile-open{
    left:0;
  }

  .menu-toggle{
    display:inline-flex !important;
    align-items:center;
    justify-content:center;
  }

  main{
    width:100%;
    margin:0;
    padding:16px;
  }

  .topbar{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:12px;
  }

  .topbar-right{
    width:100%;
    justify-content:space-between;
    flex-wrap:wrap;
  }

  .stats-row{
    grid-template-columns:2fr 2fr;
  }

  .mid-row{
    grid-template-columns:1fr;
  }

  .budget-row{
    grid-template-columns:1fr;
  }

  .donut-wrap{
    flex-direction:column;
    align-items:center;
  }

  .cta{
    flex-direction:column;
    align-items:flex-start;
    gap:20px;
    padding:26px 22px;
  }

  .profile-grid{
    grid-template-columns:1fr;
  }

  .table-header{
    flex-direction:column;
    align-items:flex-start;
  }

  .search-input{
    width:100%;
    min-width:100%;
  }

  .select,
  .form-input{
    min-width:100%;
  }

  .tbl-wrap{
    overflow-x:auto;
  }
}

@media (max-width:520px){
  .budget-row{
    grid-template-columns:1fr;
  }

  .section-page-header{
    flex-direction:column;
    align-items:flex-start;
  }

  .trend-foot{
    flex-direction:column;
    align-items:flex-start;
  }
}