* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f6f7fb; --panel: #ffffff; --ink: #1a2233; --muted: #68738c;
  --line: #e5e8f0; --accent: #2f6fed; --accent-ink: #ffffff;
  --good: #147d4e; --warn: #b26a00; --alert: #c0392b;
  --good-bg: #e7f6ee; --warn-bg: #fdf3e3; --alert-bg: #fdeae7; --info-bg: #eaf1fe;
}
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; }
.hidden { display: none !important; }

header { display: flex; justify-content: space-between; align-items: center;
  padding: 14px 28px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10; }
.brand { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.brand span { color: var(--accent); }
.brand-hindi { display: block; font-size: 11px; font-weight: 600; color: var(--muted);
  letter-spacing: 0; margin-top: -2px; }
.header-actions { display: flex; gap: 10px; }

main { max-width: 1180px; margin: 0 auto; padding: 24px 20px 80px; }

.btn { border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.secondary:hover { background: #eef1f8; }
.btn.danger { background: var(--alert); border-color: var(--alert); color: #fff; }
.btn.big { padding: 12px 26px; font-size: 16px; }

.empty-hero {
  text-align: center; border-radius: 22px; margin-top: 40px; color: #fff;
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #16255c 0%, #1d3a8f 35%, #2f6fed 70%, #12b3a8 100%);
  box-shadow: 0 20px 50px rgba(29, 58, 143, 0.35);
}
.empty-hero::before {
  content: ""; position: absolute; inset: 0; opacity: 0.22;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='420' height='300' viewBox='0 0 420 300'><g fill='white' font-family='Georgia,serif'><text x='18' y='60' font-size='44'>₹</text><text x='95' y='140' font-size='30'>$</text><text x='40' y='225' font-size='34'>€</text><text x='160' y='70' font-size='26'>£</text><text x='215' y='190' font-size='40'>¥</text><text x='300' y='90' font-size='30'>₿</text><text x='355' y='210' font-size='34'>₹</text><text x='265' y='275' font-size='26'>$</text><text x='130' y='280' font-size='22'>€</text><text x='375' y='55' font-size='22'>&#8377;</text><text x='300' y='160' font-size='28'>&#9992;</text><text x='90' y='95' font-size='24'>&#8962;</text><text x='190' y='250' font-size='26'>&#128176;</text><text x='350' y='135' font-size='24'>&#128188;</text><text x='25' y='150' font-size='24'>&#128663;</text><text x='240' y='45' font-size='24'>&#127796;</text></g></svg>");
  background-size: 420px 300px;
}
.empty-inner { position: relative; padding: 64px 44px 56px; }
.empty-hindi { font-size: 17px; letter-spacing: 0; opacity: 0.9; margin-bottom: 10px; font-weight: 700; }
.empty-hero h1 { font-size: 38px; margin-bottom: 16px; letter-spacing: -0.5px; }
.empty-hero p { opacity: 0.92; max-width: 620px; margin: 0 auto 22px; line-height: 1.6; font-size: 15.5px; }
.feature-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.feature-row span { background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px; padding: 6px 14px; font-size: 13.5px; backdrop-filter: blur(4px); }
.btn.white { background: #fff; border-color: #fff; color: #1d3a8f; }
.btn.white:hover { filter: brightness(0.94); }
.fine-light { font-size: 12.5px; opacity: 0.75; margin-top: 16px; max-width: 640px;
  margin-left: auto; margin-right: auto; line-height: 1.5; }

/* ---------- login & user ---------- */
.login-box { max-width: 340px; margin: 0 auto 6px; display: flex; flex-direction: column; gap: 10px; }
.login-box input { padding: 11px 14px; border-radius: 10px; border: none; font-size: 15px; }
.login-or { opacity: 0.7; font-size: 13px; }
.btn.ghost { background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.35);
  color: #fff; padding: 10px 16px; }
.link-btn { background: none; border: none; color: #fff; opacity: 0.85; font-size: 13.5px;
  cursor: pointer; text-decoration: underline; padding: 2px; }
.link-btn:hover { opacity: 1; }
.btn.ghost:hover { background: rgba(255,255,255,0.24); }
.status.light { color: #fff; opacity: 0.9; }
.status.light.err { color: #ffd4cc; }
.user-chip { font-size: 13px; font-weight: 700; background: #eef1f8; border-radius: 18px;
  padding: 7px 13px; cursor: pointer; white-space: nowrap; }
.user-chip:hover { background: #e2e7f2; }
.modal.wide { width: 620px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.demo-banner { background: #fdf3e3; color: #7a4a00; border-bottom: 1px solid #f0dcb4;
  padding: 10px 28px; font-size: 13.5px; line-height: 1.5; }
.fine { font-size: 12.5px; color: var(--muted); margin-top: 14px; }

/* ---------- category cubes ---------- */
.section-h { font-size: 16.5px; margin: 22px 0 12px; }
.cube-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px; margin-bottom: 8px; }
.cube {
  border-radius: 14px; padding: 14px 14px 12px; cursor: pointer; position: relative;
  border: 1px solid var(--line); background: var(--panel);
  transition: transform 0.12s, box-shadow 0.12s;
}
.cube:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(26,34,51,0.10); }
.cube .c-icon { font-size: 21px; }
.cube .c-name { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-top: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cube .c-amt { font-size: 17px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }
.cube .c-pct { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.cube .c-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  border-radius: 14px 0 0 14px; }

/* ---------- home: hero + review cards ---------- */
.hero {
  border-radius: 18px; margin-bottom: 26px; color: #fff; position: relative;
  overflow: hidden; background: linear-gradient(120deg, #1d3a8f 0%, #2f6fed 55%, #12b3a8 100%);
}
.hero::before {
  content: ""; position: absolute; inset: 0; opacity: 0.28;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='420' height='300' viewBox='0 0 420 300'><g fill='white' font-family='Georgia,serif'><text x='18' y='60' font-size='44'>₹</text><text x='95' y='140' font-size='30'>$</text><text x='40' y='225' font-size='34'>€</text><text x='160' y='70' font-size='26'>£</text><text x='215' y='190' font-size='40'>¥</text><text x='300' y='90' font-size='30'>₿</text><text x='355' y='210' font-size='34'>₹</text><text x='265' y='275' font-size='26'>$</text><text x='130' y='280' font-size='22'>€</text><text x='375' y='55' font-size='22'>&#8377;</text><text x='300' y='160' font-size='28'>&#9992;</text><text x='90' y='95' font-size='24'>&#8962;</text><text x='190' y='250' font-size='26'>&#128176;</text><text x='350' y='135' font-size='24'>&#128188;</text><text x='25' y='150' font-size='24'>&#128663;</text><text x='240' y='45' font-size='24'>&#127796;</text></g></svg>");
  background-size: 420px 300px;
}
.hero-inner { position: relative; padding: 46px 40px 42px; }
.hero h1 { font-size: 34px; letter-spacing: -0.5px; margin-bottom: 8px; }
.hero p { opacity: 0.92; font-size: 16px; }
.name-edit {
  position: absolute; top: 16px; right: 18px; background: rgba(255,255,255,0.18);
  border: none; color: #fff; border-radius: 16px; padding: 5px 12px;
  font-size: 12.5px; cursor: pointer;
}
.name-edit:hover { background: rgba(255,255,255,0.3); }

.home-h2 { font-size: 18px; margin: 26px 0 12px; }
.home-h2 .fine { font-weight: 500; }
.month-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.mcard {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px; cursor: pointer; transition: transform 0.12s, box-shadow 0.12s;
}
.mcard:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(26,34,51,0.10); border-color: var(--accent); }
.mcard .m-title { font-weight: 800; font-size: 17px; display: flex; justify-content: space-between; align-items: center; }
.mcard .m-badge { font-size: 12px; font-weight: 700; border-radius: 14px; padding: 3px 10px; }
.m-badge.good { background: var(--good-bg); color: var(--good); }
.m-badge.bad { background: var(--alert-bg); color: var(--alert); }
.m-badge.na { background: #eef1f8; color: var(--muted); }
.mcard .m-rows { margin-top: 12px; display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; }
.mcard .m-rows div { display: flex; justify-content: space-between; }
.mcard .m-rows .lab { color: var(--muted); }
.mcard .m-foot { margin-top: 10px; color: var(--accent); font-size: 12.5px; font-weight: 700; }

.range-bar { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.period-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.period-controls label { font-weight: 700; color: var(--ink); }
.period-controls select, .period-controls input[type=date] {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 13.5px; background: var(--panel); color: var(--ink); }
#range-label { margin-left: auto; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px; margin-bottom: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.card .label { color: var(--muted); font-size: 12.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.4px; }
.card .value { font-size: 26px; font-weight: 800; margin-top: 6px; }
.card .sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.card.income .value { color: var(--good); }
.card.expense .value { color: var(--alert); }
.card.invest .value { color: var(--accent); }

.insights { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.insight { border-radius: 10px; padding: 12px 16px; font-size: 14px; line-height: 1.45; }
.insight b { display: block; }
.insight.good { background: var(--good-bg); color: var(--good); }
.insight.warn { background: var(--warn-bg); color: var(--warn); }
.insight.alert { background: var(--alert-bg); color: var(--alert); }
.insight.info { background: var(--info-bg); color: var(--accent); }
.insight .detail { color: var(--ink); opacity: 0.75; font-size: 13px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 20px; margin-bottom: 16px; }
.panel h2 { font-size: 16px; margin-bottom: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.panel-head h2 { margin: 0; }
.chart-wrap { position: relative; height: 280px; }
.pill { background: var(--info-bg); color: var(--accent); border-radius: 20px;
  font-size: 12px; padding: 3px 10px; font-weight: 700; margin-left: 6px; }

.row-item { display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.row-item:last-child { border-bottom: none; }
.row-item .meta { color: var(--muted); font-size: 12px; }
.row-item .amt { font-weight: 700; white-space: nowrap; margin-left: 12px; }

.filters { display: flex; gap: 8px; }
.filters input, .filters select { padding: 7px 10px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 13.5px; background: var(--panel); color: var(--ink); }
.filters input { width: 220px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.4px; padding: 8px 10px; border-bottom: 2px solid var(--line); }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.merchant { font-weight: 600; }
.narr { color: var(--muted); font-size: 12px; max-width: 420px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.credit { color: var(--good); font-weight: 700; }
.debit { color: var(--ink); font-weight: 600; }
.tag { font-size: 11.5px; padding: 2px 8px; border-radius: 12px; background: #eef1f8;
  color: var(--muted); font-weight: 600; }
td select.cat-select { padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 12.5px; background: var(--panel); color: var(--ink); max-width: 150px; }
.icon-btn { border: none; background: none; cursor: pointer; font-size: 15px; opacity: 0.55; }
.icon-btn:hover { opacity: 1; }
.table-foot { text-align: center; padding-top: 12px; }

.modal-back { position: fixed; inset: 0; background: rgba(15, 22, 40, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: var(--panel); border-radius: 14px; padding: 26px; width: 480px;
  max-width: 92vw; max-height: 90vh; overflow-y: auto; }
.modal h2 { margin-bottom: 6px; }
.modal input[type=file] { margin: 14px 0 6px; display: block; width: 100%; }
.modal input, .modal select { width: 100%; padding: 9px 10px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 14px; margin-top: 6px; background: var(--panel); color: var(--ink); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; align-items: center; }
.modal-actions .spacer { flex: 1; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.form-grid label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.form-grid .span2 { grid-column: span 2; }
.checkline { display: flex; align-items: center; gap: 8px; font-weight: 500 !important; }
.checkline input { width: auto !important; margin: 0 !important; }
.status { margin-top: 12px; font-size: 13.5px; min-height: 18px; }
.status.err { color: var(--alert); }
.status.ok { color: var(--good); }
