/* ═══════════════════════════════════════════════
   MY FINANCE TRACKER — Premium Dark Design
   Inspired by CRED + Groww + Zerodha
═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-base:      #0f1115;
  --bg-sidebar:   #15181e;
  --bg-card:      #1a1d24;
  --bg-card2:     #1a1d24;
  --bg-input:     #111318;
  --border:       rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --border-glow:  rgba(59,130,246,0.4);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted:   #64748b;
  --green:        #10b981;
  --green-dim:    rgba(16,185,129,0.15);
  --green-dark:   #059669;
  --red:          #ef4444;
  --red-dim:      rgba(239,68,68,0.15);
  --blue:         #3b82f6;
  --blue-dim:     rgba(59,130,246,0.15);
  --purple:       #8b5cf6;
  --purple-dim:   rgba(139,92,246,0.15);
  --radius-sm:    6px;
  --radius-md:    12px;
  --radius-lg:    16px;
  --radius-xl:    24px;
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:    0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg:    0 8px 40px rgba(0,0,0,0.5);
  --transition:   all 0.2s ease;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── HIDE ── */
.hide { display: none !important; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: rgba(99,120,220,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99,120,220,0.5); }

/* ── PAGE LAYOUT ── */
.page { padding: 1.25rem 1rem; max-width: 820px; margin: 0 auto; }

/* ── DASHBOARD LAYOUT ── */
.dash-container { display: flex; height: 100vh; overflow: hidden; background: var(--bg-base); }
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.sidebar-header { padding: 1.5rem; }
.sidebar-header .brand-prefix { font-size: 12.5px; font-weight: 600; color: var(--blue); text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 0px; line-height: 1; }
.sidebar-header h2 { font-size: 26px; font-weight: 600; line-height: 1; margin: 0 0 10px 0; color: var(--blue); }
.sidebar-header p { font-size: 10px; font-weight: 600; color: var(--text-secondary); letter-spacing: 0.18em; text-transform: uppercase; margin: 0; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 0 1rem; display: flex; flex-direction: column; gap: 4px; }
.nav-group { margin-bottom: 12px; }
.nav-group-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}
.nav-group-title:hover { color: var(--text-primary); }
.nav-group-items {
  transition: height 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
}
.tab {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  text-align: left;
  position: relative;
}
.tab i { font-size: 18px; }
.tab:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.tab.active {
  background: linear-gradient(90deg, rgba(59,130,246,0.15) 0%, transparent 100%);
  color: var(--blue);
  font-weight: 600;
}
.tab.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--blue);
  border-radius: 0 4px 4px 0;
}

.sidebar-action { padding: 1rem; border-top: 1px solid var(--border); }

.sidebar-profile {
  padding: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.avatar-img { width: 36px; height: 36px; border-radius: 50%; background: var(--blue-dim); color: var(--blue); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.profile-info { flex: 1; }
.p-name { font-size: 13px; font-weight: 600; color: var(--text-primary); text-transform: uppercase; }
.p-tier { font-size: 11px; color: var(--text-secondary); }

.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ── TOPBAR ── */
.topbar {
  background: var(--bg-base);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}
#page-title { font-size: 20px; font-weight: 600; color: var(--text-primary); margin: 0; }
.topbar-r { display: flex; align-items: center; gap: 16px; }

.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  width: 240px;
}
.search-box i { color: var(--text-secondary); }
.search-box input { border: none; background: transparent; color: var(--text-primary); font-size: 13px; outline: none; width: 100%; }

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover { color: var(--text-primary); }

.main-content { flex: 1; overflow-y: auto; padding-bottom: 2rem; position: relative; }
.page { padding: 1.5rem 2rem; max-width: 1400px; margin: 0 auto; }

#mobile-menu-btn { display: none; }

/* ── MONTH SELECTOR ── */
.month-sel { display: flex; align-items: center; gap: 8px; }
.month-sel select, .month-sel input[type=number] {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 12px;
  font-family: inherit;
  transition: var(--transition);
}
.month-sel select:focus, .month-sel input[type=number]:focus {
  outline: none;
  border-color: var(--border-glow);
}
.month-sel input[type=number] { width: 76px; }

/* ── BUTTONS ── */
.btn {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card2);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:hover { background: rgba(255,255,255,0.05); border-color: var(--border-hover); }

.btn-google {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-google:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--border-hover);
  box-shadow: none;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
  color: #8b90a8;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}
.auth-divider span { padding: 0 10px; }

.btn-blue-glow {
  background: var(--blue);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 15px rgba(59,130,246,0.3);
}
.btn-blue-glow:hover {
  background: #60a5fa;
  box-shadow: 0 4px 20px rgba(59,130,246,0.5);
  transform: translateY(-1px);
}

.btn-green {
  background: var(--green);
  border-color: transparent;
  color: #fff;
}
.btn-green:hover { background: #34d399; transform: translateY(-1px); }

.btn-blue {
  background: var(--blue);
  border-color: transparent;
  color: #fff;
}
.btn-blue:hover { background: #60a5fa; transform: translateY(-1px); }

.btn-red {
  background: var(--red);
  border-color: transparent;
  color: #fff;
}
.btn-red:hover { background: #f87171; transform: translateY(-1px); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.w-100 { width: 100%; }

/* ── SECTIONS / CARDS ── */
.section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: var(--transition);
}
.section:hover { border-color: var(--border-hover); }

.sec-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-primary);
}

/* ── FORM FIELDS ── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.field input, .field select, .field textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  background: var(--bg-input);
  color: var(--text-primary);
  width: 100%;
  font-family: inherit;
  transition: var(--transition);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
  background: rgba(255,255,255,0.02);
}
.field input::placeholder { color: var(--text-muted); }
select option { background: var(--bg-card); color: var(--text-primary); }

/* ── GRIDS ── */
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px,1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px,1fr)); gap: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 10px; }

/* ── METRIC CARDS ── */
.metric {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.metric::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(99,120,220,0.5), transparent);
}
.metric:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.metric .lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.metric .val { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.metric .sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── BADGES / TAGS ── */
.tag { padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.tg  { color: var(--green);  background: var(--green-dim);  border: 1px solid rgba(0,212,160,0.2); }
.tr  { color: var(--red);    background: var(--red-dim);    border: 1px solid rgba(255,107,107,0.2); }
.badge { padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.b-dep { color: var(--green); background: var(--green-dim); border: 1px solid rgba(0,212,160,0.2); }
.b-wit { color: var(--red);   background: var(--red-dim);   border: 1px solid rgba(255,107,107,0.2); }

/* ── MESSAGES ── */
.msg { font-size: 12px; margin-top: .5rem; min-height: 18px; padding: 2px 0; }
.msg-ok   { color: var(--green); }
.msg-err  { color: var(--red); }
.msg-info { color: var(--text-secondary); }

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--border); margin: .85rem 0; }

/* ── PROGRESS BAR ── */
.bar-wrap {
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.bar {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--green-dark), var(--green));
  transition: width .6s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 10px rgba(0,212,160,0.4);
}

/* ── INVESTMENT ROWS ── */
.inv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1.1rem;
  border: 1px solid var(--border);
  background: var(--bg-card2);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: var(--transition);
}
.inv-row:hover { border-color: var(--border-hover); transform: translateX(3px); }
.ir-name { font-size: 13px; font-weight: 600; }
.ir-desc { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.ir-amt  { font-size: 16px; font-weight: 700; }
.ir-pct  { font-size: 11px; color: var(--text-secondary); text-align: right; margin-top: 2px; }

/* ── PROGRESS BAR (investment) ── */
.prog-wrap { height: 5px; background: var(--bg-input); border-radius: 3px; margin-top: 5px; overflow: hidden; }
.prog { height: 100%; border-radius: 3px; transition: width .6s cubic-bezier(.4,0,.2,1); }

/* ── TABLES ── */
.tbl-wrap {
  overflow-x: auto;
  margin-top: .75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
table.data-tbl { width: 100%; border-collapse: collapse; min-width: 540px; }
table.data-tbl th {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: .75rem .85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card2);
  white-space: nowrap;
}
table.data-tbl td {
  padding: .6rem .85rem;
  border-bottom: 1px solid rgba(99,120,220,0.08);
  font-size: 12px;
  vertical-align: middle;
}
table.data-tbl tr:last-child td { border-bottom: none; }
table.data-tbl tr:hover td { background: rgba(99,120,220,0.05); }
table.data-tbl select,
table.data-tbl input[type=text],
table.data-tbl input[type=number],
table.data-tbl input[type=date] {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--text-primary);
  width: 100%;
  font-family: inherit;
}
.unmatched td:first-child { border-left: 2px solid var(--red); }

/* ── ANNUAL CARDS ── */
.months-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(152px,1fr));
  gap: 10px;
  margin-top: .85rem;
}
.mcard {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: .9rem 1rem;
  cursor: pointer;
  transition: var(--transition);
}
.mcard:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(77,159,255,0.1);
}
.mcard .mname { font-size: 13px; font-weight: 700; margin-bottom: 7px; color: var(--text-primary); }
.mcard .mrow { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-secondary); margin-top: 4px; }
.mcard .mrow span:last-child { color: var(--text-primary); font-weight: 500; }

/* ── HIGHLIGHT CARDS ── */
.hl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(115px,1fr)); gap: 8px; margin-bottom: 1.1rem; }
.hlcard {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: .9rem .75rem;
  text-align: center;
  transition: var(--transition);
}
.hlcard:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.hlcard .hl { font-size: 10px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.hlcard .hv { font-size: 16px; font-weight: 700; }
.hlcard .hs { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* ── UPLOAD ZONE ── */
.upload-zone {
  border: 2px dashed rgba(99,120,220,0.3);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-card2);
}
.upload-zone:hover {
  border-color: var(--blue);
  background: var(--blue-dim);
  box-shadow: 0 0 30px rgba(77,159,255,0.1);
}
.upload-zone .u-ico { font-size: 36px; margin-bottom: .75rem; }
.upload-zone p { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }
.upload-zone b { color: var(--text-primary); }

/* ── EMPTY STATE ── */
.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.8;
}
.empty-icon { font-size: 36px; margin-bottom: .85rem; opacity: .7; }
.empty a { color: var(--blue); text-decoration: none; }
.empty a:hover { text-decoration: underline; }

/* ── LEGEND ── */
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 12px; color: var(--text-secondary); }
.legend span { display: flex; align-items: center; gap: 6px; }
.leg-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ── RULES TABLE ── */
.rules-tbl { width: 100%; border-collapse: collapse; margin-top: .5rem; }
.rules-tbl th {
  font-size: 10px; font-weight: 700; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: .06em;
  padding: .6rem .5rem; text-align: left;
  border-bottom: 1px solid var(--border);
}
.rules-tbl td { padding: .4rem .4rem; border-bottom: 1px solid rgba(99,120,220,0.07); vertical-align: middle; }
.rules-tbl input[type=text] {
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px;
  padding: 5px 9px; font-size: 12px; color: var(--text-primary); width: 100%; font-family: inherit;
}
.rules-tbl select {
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px;
  padding: 5px 9px; font-size: 12px; color: var(--text-primary); width: 100%; font-family: inherit;
}

/* ── INFO BOX ── */
.info-box {
  background: rgba(77,159,255,0.06);
  border: 1px solid rgba(77,159,255,0.2);
  border-radius: var(--radius-sm);
  padding: .9rem 1rem;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}
.info-box b { color: var(--green); }

/* ══════════════════════════════════════════════
   HOME / LOGIN PAGE
══════════════════════════════════════════════ */
#pg-home {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(77,159,255,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(167,139,250,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 60% 80%, rgba(0,212,160,0.04) 0%, transparent 60%),
    var(--bg-base);
}
#pg-home .page { width: 100%; max-width: 520px; }

.hero { text-align: center; padding: 2rem 1rem 1.75rem; }
.hero-icon {
  font-size: 48px;
  margin-bottom: 1rem;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.hero h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: .5rem;
  background: linear-gradient(135deg, #e8edf8, #a0b4d8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 1.25rem; }
.hcard {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hcard::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(77,159,255,0.05), rgba(167,139,250,0.05));
  opacity: 0;
  transition: var(--transition);
}
.hcard:hover::before { opacity: 1; }
.hcard:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(77,159,255,0.15);
}
.hcard .ico { font-size: 28px; margin-bottom: .75rem; }
.hcard .ht { font-size: 14px; font-weight: 700; margin-bottom: .35rem; }
.hcard .hd { font-size: 12px; color: var(--text-secondary); }

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-lg);
}
.panel h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.row-inp { display: flex; gap: 8px; }
.row-inp input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 14px;
  color: var(--text-primary);
  font-family: inherit;
  transition: var(--transition);
}
.row-inp input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(77,159,255,0.1); }

.profiles-label { font-size: 11px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .6rem; }

.pitem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  cursor: pointer;
  transition: var(--transition);
}
.pitem:hover { border-color: var(--border-hover); transform: translateX(4px); background: rgba(77,159,255,0.05); }
.pitem-l { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(77,159,255,0.3), rgba(167,139,250,0.3));
  border: 1px solid rgba(77,159,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  flex-shrink: 0;
}
.pitem-name { font-size: 14px; font-weight: 600; }
.pitem-id   { font-size: 11px; color: var(--text-secondary); margin-top: 1px; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .home-grid { grid-template-columns: 1fr; }
  .topbar { padding: .6rem .85rem; }
  #mobile-menu-btn { display: block; }
  .dash-layout { flex-direction: column; }
  .sidebar { width: 100%; display: none; padding: .5rem 0; border-right: none; border-bottom: 1px solid var(--border); }
  .sidebar.show { display: flex; }
  .page { padding: .85rem .75rem; }
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr 1fr; }
  .month-sel select { max-width: 110px; }
  .panel { padding: 1.25rem; }
  .hero h1 { font-size: 22px; }
}

/* --- LANDING & AUTH PAGE REDESIGN --- */
.landing-container { min-height: 100vh; background: #05080f; color: #fff; display: flex; flex-direction: column; font-family: 'Inter', sans-serif; }
.landing-header { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem 3rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
.landing-logo { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; color: #fff; cursor: pointer; }
.landing-logo i { color: #3b82f6; font-size: 22px; }
.landing-nav { display: flex; gap: 2rem; }
.landing-nav a { color: #94a3b8; text-decoration: none; font-size: 14px; font-weight: 500; transition: color 0.2s; }
.landing-nav a:hover { color: #fff; }
.landing-actions { display: flex; gap: 1rem; align-items: center; }
.btn-ghost { background: transparent; color: #fff; border: none; font-weight: 600; cursor: pointer; padding: 10px 18px; font-size: 13px; transition: color 0.2s; }
.btn-ghost:hover { color: #3b82f6; }

#landing-main { flex: 1; display: flex; flex-direction: column; padding: 4rem 2rem; max-width: 1200px; margin: 0 auto; width: 100%; }

.landing-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; margin-bottom: 6rem; }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(16,185,129,0.1); color: #10b981; padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; border: 1px solid rgba(16,185,129,0.2); margin-bottom: 1.5rem; }
.hero-title { font-size: 56px; font-weight: 800; line-height: 1.1; margin-bottom: 1.5rem; letter-spacing: -0.02em; }
.hero-subtitle { font-size: 18px; color: #94a3b8; line-height: 1.6; margin-bottom: 2.5rem; max-width: 480px; }
.hero-cta { display: flex; gap: 1rem; }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: 8px; }

.mock-card { background: #121826; border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 2rem; box-shadow: 0 20px 40px rgba(0,0,0,0.4); }
.mock-header { margin-bottom: 2rem; }
.mock-label { font-size: 12px; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; margin-bottom: 4px; }
.mock-value { font-size: 36px; font-weight: 700; margin-bottom: 4px; }
.mock-trend { font-size: 13px; color: #10b981; display: flex; align-items: center; gap: 4px; font-weight: 500; }
.mock-chart { display: flex; align-items: flex-end; gap: 12px; height: 120px; margin-bottom: 2rem; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 12px; }
.mbar { flex: 1; background: #3b82f6; border-radius: 4px 4px 0 0; opacity: 0.8; transition: opacity 0.2s; }
.mbar:hover { opacity: 1; }
.mock-assets { display: flex; flex-direction: column; gap: 12px; }
.mock-asset { display: flex; justify-content: space-between; align-items: center; padding: 12px; background: rgba(255,255,255,0.03); border-radius: 8px; border: 1px solid rgba(255,255,255,0.05); }
.ma-left { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.ma-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.bg-blue { background: rgba(59,130,246,0.2); color: #3b82f6; }
.bg-orange { background: rgba(249,115,22,0.2); color: #f97316; }

.landing-features-header { text-align: center; max-width: 600px; margin: 0 auto 3rem; }
.landing-features-header h2 { font-size: 32px; margin-bottom: 1rem; }
.landing-features-header p { color: #94a3b8; font-size: 16px; }
.landing-features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; margin-bottom: 6rem; }
.feature-card { background: #121826; border: 1px solid rgba(255,255,255,0.05); padding: 2rem; border-radius: 12px; }
.fc-icon { width: 48px; height: 48px; border-radius: 12px; background: rgba(255,255,255,0.05); display: flex; align-items: center; justify-content: center; font-size: 24px; color: #3b82f6; margin-bottom: 1.5rem; }
.feature-card h3 { font-size: 20px; margin-bottom: 1rem; }
.feature-card p { color: #94a3b8; line-height: 1.6; margin-bottom: 1.5rem; }
.fc-list { display: flex; flex-direction: column; gap: 8px; color: #e2e8f0; font-size: 14px; font-weight: 500; }
.fc-list i { color: #3b82f6; }

.landing-cta-bottom { text-align: center; background: linear-gradient(180deg, #1d4ed8 0%, #1e3a8a 100%); padding: 4rem 2rem; border-radius: 16px; margin-bottom: 4rem; }
.landing-cta-bottom h2 { font-size: 36px; margin-bottom: 1rem; }
.landing-cta-bottom p { color: #bfdbfe; font-size: 18px; margin-bottom: 2rem; max-width: 500px; margin-inline: auto; }

.landing-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,0.1); color: #94a3b8; font-size: 13px; }
.lf-links { display: flex; gap: 2rem; }
.lf-links a { color: #94a3b8; text-decoration: none; }
.lf-links a:hover { color: #fff; }

/* AUTH OVERLAY (Dark Theme like Option 1) */
#auth-overlay { position: fixed; inset: 0; background: radial-gradient(circle at 50% 30%, #111a2f 0%, #05080f 80%); z-index: 100; overflow-y: auto; display: flex; flex-direction: column; }
.auth-nav { padding: 1.5rem 3rem; display: flex; justify-content: space-between; align-items: center; }
.auth-trust { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #94a3b8; }
.auth-container { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; }
.auth-panel { background: #151a22; border: 1px solid #2a2f3a; border-radius: 16px; width: 100%; max-width: 650px; padding: 3.5rem; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5); }
.auth-panel h3 { font-size: 28px; font-weight: 700; margin-bottom: 0.5rem; text-align: center; }
.auth-sub { text-align: center; color: #94a3b8; font-size: 15px; margin-bottom: 2rem; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-form .field label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #94a3b8; margin-bottom: 6px; display: block; }
.auth-form .field input { background: #0a0f18; border: 1px solid #2a2f3a; color: #fff; border-radius: 6px; padding: 12px 14px; font-size: 15px; width: 100%; outline: none; transition: border-color 0.2s; box-sizing: border-box; }
.auth-form .field input:focus { border-color: #3b82f6; }
.auth-form .field input:-webkit-autofill,
.auth-form .field input:-webkit-autofill:hover, 
.auth-form .field input:-webkit-autofill:focus, 
.auth-form .field input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px #0a0f18 inset !important;
  -webkit-text-fill-color: #fff !important;
  transition: background-color 5000s ease-in-out 0s;
}
.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.auth-agree { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: #94a3b8; margin-top: 0.5rem; margin-bottom: 0.5rem; }
.btn-block { width: 100%; padding: 14px; font-size: 15px; }
.auth-divider { display: flex; align-items: center; margin: 1.5rem 0; color: #64748b; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; border-bottom: 1px solid #2a2f3a; }
.auth-divider span { padding: 0 16px; }
.auth-footer-text { text-align: center; font-size: 14px; color: #94a3b8; margin-top: 1rem; }
.auth-footer-text a { color: #fff; text-decoration: none; font-weight: 600; }
.auth-link { color: #3b82f6 !important; text-decoration: none; font-weight: 500; font-size: 12px; }
.auth-back-link { display: flex; align-items: center; justify-content: center; gap: 8px; color: #94a3b8; text-decoration: none; margin-top: 1.5rem; font-size: 14px; transition: color 0.2s; }
.auth-back-link:hover { color: #fff; }
.auth-icon-top { width: 48px; height: 48px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #fff; margin: 0 auto 1.5rem; }

.auth-footer { display: flex; justify-content: center; gap: 2rem; margin-top: 2rem; color: #64748b; font-size: 11px; font-weight: 600; letter-spacing: 0.05em; margin-bottom: 2rem; }
.auth-sec-badge { display: flex; align-items: center; gap: 6px; }
.auth-copyright { border-top: 1px solid #2a2f3a; padding: 2rem 3rem; display: flex; justify-content: space-between; font-size: 12px; color: #64748b; }
.ac-right a { color: #64748b; text-decoration: none; margin-left: 1.5rem; transition: color 0.2s; }
.ac-right a:hover { color: #94a3b8; }

/* SPLIT TXN MODAL */
#modal-split .modal-content { max-width: 600px; }
.split-info { display: flex; justify-content: space-between; margin-bottom: 1rem; background: var(--bg-card); padding: 10px; border-radius: 8px; border: 1px solid var(--border); }
.split-row { display: flex; gap: 10px; margin-bottom: 10px; align-items: center; }
.split-row input, .split-row select { padding: 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); }
.split-row .split-amt { width: 100px; }
.split-row .split-cat { flex: 1; }
.split-row-del { color: var(--text-error); cursor: pointer; padding: 5px; font-weight: bold; }


/* ACTION MENU */
.action-menu-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 13px; color: var(--text-primary); cursor: pointer; border-radius: 6px; transition: var(--transition); }
.action-menu-item:hover { background: var(--bg-card2); }
.action-menu-item.danger { color: var(--text-error); }
.action-menu-item.danger:hover { background: rgba(239, 68, 68, 0.1); }


.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(10, 25, 47, 0.85); z-index: 1000; justify-content: center; align-items: center; }
.modal:not(.hide) { display: flex !important; }
.modal-content { background: var(--bg-card); padding: 2rem; border-radius: 12px; border: 1px solid var(--border); width: 90%; max-width: 600px; position: relative; box-shadow: 0 10px 30px -10px rgba(2,12,27,0.7); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.modal-header h3 { color: var(--text-primary); margin: 0; }
.close-btn { background: transparent; border: none; color: var(--text-secondary); font-size: 1.5rem; cursor: pointer; }
.close-btn:hover { color: var(--text-primary); }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); align-items:center; }
.split-row input, .split-row select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-input); color: var(--text-primary); }
.action-menu { display: none; position: absolute; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.5); z-index: 9999; min-width: 160px; padding: 6px 0; overflow: hidden; }

.pending-cb, #selectAllPending, #selectAllDash {
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--bg-card2);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  display: inline-block;
  vertical-align: middle;
}
.pending-cb:checked, #selectAllPending:checked, #selectAllDash:checked {
  background: var(--blue);
  border-color: var(--blue);
}
.pending-cb:checked::after, #selectAllPending:checked::after, #selectAllDash:checked::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* USER GUIDE STYLES */
.guide-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-main);
  color: var(--text-primary);
  overflow: hidden;
}

.guide-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - 60px); /* Adjust based on topbar height */
}

.guide-sidebar {
  width: 250px;
  background-color: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 24px;
  overflow-y: auto;
  flex-shrink: 0;
}

.guide-nav-item {
  padding: 10px 16px;
  margin-bottom: 8px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.2s ease;
}

.guide-nav-item:hover {
  background-color: var(--bg-card2);
  color: var(--text-primary);
}

.guide-nav-item.active {
  background-color: rgba(100, 255, 218, 0.1);
  color: var(--accent);
}

.guide-content {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
  scroll-behavior: smooth;
  max-width: 900px;
  margin: 0 auto;
}

.guide-section {
  margin-bottom: 60px;
}

.guide-section h2 {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.guide-section h3 {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-primary);
  margin-top: 32px;
  margin-bottom: 16px;
}

.guide-section h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 24px;
  margin-bottom: 8px;
}

.guide-section p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
  font-size: 15px;
}

.guide-section ul, .guide-section ol {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
  padding-left: 24px;
}

.guide-section li {
  margin-bottom: 8px;
}

.feature-card, .info-card, .faq-item, .troubleshoot-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.feature-card h3 {
  margin-top: 0;
  color: var(--accent);
}

.tip-box {
  background-color: rgba(100, 255, 218, 0.05);
  border-left: 4px solid var(--accent);
  padding: 16px;
  border-radius: 4px 8px 8px 4px;
  margin-top: 16px;
  color: var(--text-primary) !important;
}

.tip-box i {
  color: var(--accent);
  margin-right: 8px;
}

.info-card strong, .faq-item strong {
  display: block;
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

@media (max-width: 768px) {
  .guide-layout {
    flex-direction: column;
  }
  .guide-sidebar {
    width: 100%;
    height: auto;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px;
  }
  .guide-content {
    padding: 24px;
  }
}

/* USER GUIDE - REDESIGN STYLES */
.guide-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
}
.guide-nav-item i {
  font-size: 18px;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.step-card {
  display: flex;
  gap: 20px;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.step-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.step-icon {
  width: 48px;
  height: 48px;
  background-color: rgba(100, 255, 218, 0.1);
  color: var(--accent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-number {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  background-color: var(--bg-card2);
  padding: 4px 8px;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 8px;
}

.step-content h3 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 20px;
  color: var(--text-primary);
}

.styled-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.styled-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--text-secondary);
  font-size: 14px;
}
.styled-list li i {
  color: var(--accent);
  font-size: 16px;
  margin-top: 2px;
}

.feat-icon {
  width: 40px;
  height: 40px;
  background-color: var(--bg-card2);
  color: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-accordion {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.faq-accordion summary {
  padding: 20px 24px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.faq-accordion summary::-webkit-details-marker {
  display: none;
}

.faq-accordion summary i:not(.acc-arrow) {
  color: var(--accent);
  font-size: 20px;
}

.acc-arrow {
  margin-left: auto;
  color: var(--text-secondary);
  transition: transform 0.3s ease;
}

.faq-accordion[open] .acc-arrow {
  transform: rotate(180deg);
}

.faq-accordion[open] {
  border-color: var(--accent);
}

.acc-content {
  padding: 0 24px 24px 60px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
}

.troubleshoot-card {
  display: flex;
  gap: 16px;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.ts-icon {
  width: 40px;
  height: 40px;
  background-color: rgba(255, 100, 100, 0.1);
  color: #ff6b6b;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.ts-content h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 18px;
  color: var(--text-primary);
}

.ts-content p {
  margin-bottom: 0;
  font-size: 14px;
}

/* USER GUIDE - UI REFINEMENTS */
.guide-sidebar {
  width: 230px !important;
}
.guide-content {
  max-width: 1200px !important;
}
.guide-nav-item {
  transition: all 0.2s ease !important;
}
.guide-nav-item:hover {
  transform: translateX(4px);
  background-color: var(--bg-card2);
}
.guide-nav-item.active {
  transform: translateX(0); /* active state doesn't need the shift */
}
.feature-card, .info-card, .troubleshoot-card, .step-card {
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
}
.feature-card:hover, .info-card:hover, .troubleshoot-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}
/* FIX NESTED INFO CARD OVERFLOW */
.info-card {
  height: auto !important;
  display: block !important;
}
.info-card:hover {
  transform: none !important;
  box-shadow: none !important;
}
.step-card .info-card, .feature-card .info-card {
  margin-bottom: 0 !important;
}

/* Add Subcategory Modal Input Styling */
.input-field {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 14px;
  color: var(--text-primary);
  font-family: inherit;
  transition: var(--transition);
  box-sizing: border-box;
}
.input-field:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(77,159,255,0.1);
}
.input-field:disabled {
  background: var(--bg-base);
  opacity: 0.6;
  cursor: not-allowed;
}
.input-field::placeholder {
  color: var(--text-muted);
}
