:root {
  --ink: #24233a;
  --muted: #87869b;
  --soft-muted: #aaa9ba;
  --line: #ececf4;
  --surface: #ffffff;
  --canvas: #f8f8fc;
  --indigo: #5b5bd6;
  --indigo-dark: #4646b7;
  --lavender: #eeedff;
  --mint: #dff8ee;
  --mint-strong: #2ba57b;
  --peach: #fff0e5;
  --peach-strong: #e7854b;
  --rose: #ffe9ed;
  --rose-strong: #d75d72;
  --sky: #e8f3ff;
  --sky-strong: #4c96df;
  --yellow: #fff7d9;
  --shadow: 0 15px 38px rgba(41, 40, 79, 0.06);
  --radius: 18px;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 240px; flex: 0 0 240px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 31px 18px 22px; }
.brand, .mobile-brand { text-decoration: none; color: var(--ink); font-family: Manrope, sans-serif; font-size: 19px; font-weight: 800; letter-spacing: -0.04em; display: inline-flex; align-items: center; gap: 11px; }
.brand { padding: 0 14px 39px; }
.brand-mark { display: inline-flex; align-items: flex-end; height: 23px; gap: 3px; }
.brand-mark span { display: block; width: 5px; border-radius: 5px; background: var(--indigo); transform: skew(-12deg); }
.brand-mark span:nth-child(1) { height: 11px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 18px; opacity: .78; }
.brand-mark span:nth-child(3) { height: 23px; }
.workspace-label, .eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .14em; color: #a4a3b5; }
.workspace-label { padding: 0 14px 13px; }
.nav-list { display: grid; gap: 5px; }
.nav-item, .sidebar-action { width: 100%; border: 0; background: transparent; color: #88879c; display: flex; align-items: center; gap: 12px; border-radius: 11px; padding: 12px 14px; text-align: left; font-size: 13px; font-weight: 600; transition: .2s ease; }
.nav-item:hover, .sidebar-action:hover { color: var(--indigo); background: #f7f7fd; }
.nav-item.active { background: var(--lavender); color: var(--indigo-dark); }
.nav-icon { font-size: 19px; width: 19px; text-align: center; font-weight: 400; }
.sidebar-footer { margin-top: auto; }
.privacy-note { display: flex; gap: 9px; align-items: flex-start; background: #fafaff; border: 1px solid #f0f0f9; border-radius: 13px; padding: 12px 11px; margin: 0 4px 16px; }
.privacy-note strong, .privacy-note small { display: block; }
.privacy-note strong { color: #59586f; font-size: 10px; margin-bottom: 3px; }
.privacy-note small { color: var(--soft-muted); font-size: 9px; line-height: 1.35; }
.lock-icon { color: var(--indigo); font-size: 19px; line-height: 1; }
.sidebar-action { font-size: 12px; padding: 9px 14px; }
.sidebar-action span { width: 18px; font-size: 18px; color: var(--indigo); text-align: center; }
.main-content { flex: 1; min-width: 0; }
.topbar { height: 74px; background: rgba(248,248,252,.85); border-bottom: 1px solid rgba(236,236,244,.7); display: flex; justify-content: flex-end; align-items: center; padding: 0 42px; }
.mobile-brand { display: none; font-size: 17px; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.icon-button, .avatar { border: 1px solid var(--line); background: white; color: #828197; width: 35px; height: 35px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; transition: .2s; }
.icon-button:hover { color: var(--indigo); border-color: #d8d7fb; }
.avatar { background: var(--ink); color: white; border: 0; border-radius: 50%; font-size: 10px; font-weight: 700; margin-left: 5px; }
.content-wrap { max-width: 1400px; padding: 47px 52px 80px; margin: 0 auto; }
.view { display: none; animation: fadeUp .35s ease both; }
.view.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 30px; }
.page-heading h1 { font-family: Manrope, sans-serif; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.06em; line-height: 1.1; margin: 8px 0 8px; }
.page-heading h1 span { color: var(--indigo); }
.eyebrow { margin: 0; }
.subheading { color: var(--muted); font-size: 13px; margin: 0; }
.month-control { display: flex; align-items: center; gap: 4px; padding: 5px; background: white; border: 1px solid var(--line); border-radius: 12px; height: 42px; }
.month-control input { border: 0; color: #53526b; font-weight: 700; font-size: 12px; background: white; outline: 0; min-width: 114px; }
.month-arrow { border: 0; background: transparent; color: #9a99aa; width: 24px; height: 27px; border-radius: 7px; font-size: 21px; line-height: 1; }
.month-arrow:hover { background: var(--lavender); color: var(--indigo); }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 21px; }
.summary-card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.summary-card { min-height: 145px; padding: 20px 21px 17px; }
.card-label-row { display: flex; justify-content: space-between; align-items: center; }
.card-label { color: #858498; font-size: 11px; font-weight: 600; }
.card-symbol { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 8px; font-size: 14px; }
.balance-symbol { color: var(--indigo); background: var(--lavender); }
.income-symbol { color: var(--mint-strong); background: var(--mint); }
.expense-symbol { color: var(--peach-strong); background: var(--peach); }
.budget-symbol { color: var(--sky-strong); background: var(--sky); }
.summary-value { display: block; margin-top: 16px; font-family: Manrope, sans-serif; font-size: 25px; letter-spacing: -.055em; white-space: nowrap; }
.summary-helper { color: var(--soft-muted); font-size: 10px; margin: 7px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-progress { height: 5px; background: #f0f0f8; border-radius: 10px; margin-top: 17px; overflow: hidden; }
.mini-progress span { display: block; height: 100%; width: 0%; background: var(--indigo); border-radius: inherit; transition: width .45s ease; }
.budget-summary-card .summary-value { margin-top: 11px; }
.dashboard-grid, .lower-grid { display: grid; grid-template-columns: minmax(0, 1.16fr) minmax(0, .84fr); gap: 14px; margin-bottom: 14px; }
.lower-grid { grid-template-columns: minmax(0, .84fr) minmax(0, 1.16fr); margin-bottom: 0; }
.panel { padding: 24px 25px; }
.panel-heading, .table-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; }
.panel-heading h2, .table-heading h2 { font-family: Manrope, sans-serif; font-size: 17px; letter-spacing: -.045em; margin: 7px 0 0; }
.text-button { border: 0; background: transparent; color: var(--indigo); font-size: 11px; font-weight: 700; padding: 2px 0; white-space: nowrap; }
.text-button span { padding-left: 4px; font-size: 15px; }
.category-bars { margin-top: 28px; display: grid; gap: 17px; min-height: 184px; }
.category-row { display: grid; gap: 7px; }
.category-meta { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; }
.category-meta strong { font-size: 11px; font-weight: 700; }
.category-meta span { color: var(--muted); font-size: 10px; }
.bar-track { height: 8px; background: #f1f1f7; border-radius: 10px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--indigo); transition: width .5s ease; }
.bar-fill.over { background: var(--rose-strong); }
.empty-state { display: grid; place-items: center; min-height: 160px; text-align: center; color: var(--soft-muted); font-size: 12px; line-height: 1.6; }
.empty-state strong { display: block; color: #5f5e76; font-size: 13px; margin-bottom: 3px; }
.chart-legend { display: flex; gap: 13px; color: var(--muted); font-size: 10px; padding-top: 6px; }
.legend-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; }
.income-dot { background: var(--mint-strong); }
.expense-dot { background: var(--peach-strong); }
.trend-chart { height: 222px; margin: 20px -4px -2px; }
.trend-svg { width: 100%; height: 100%; overflow: visible; }
.chart-gridline { stroke: #f1f1f6; stroke-width: 1; }
.chart-label { fill: #aaa9b8; font: 10px "DM Sans", sans-serif; }
.chart-bar-income { fill: #c3efdf; }
.chart-bar-expense { fill: #ffd6b9; }
.chart-highlight { fill: #efefff; }
.sparkle { color: #9a98e9; font-size: 21px; }
.insights-list { margin-top: 22px; display: grid; gap: 11px; }
.insight-item { display: flex; gap: 11px; align-items: flex-start; padding: 12px 12px; background: #fafaff; border-radius: 12px; }
.insight-icon { flex: 0 0 25px; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; background: var(--lavender); color: var(--indigo); font-size: 13px; }
.insight-item.warning .insight-icon { background: var(--rose); color: var(--rose-strong); }
.insight-item.positive .insight-icon { background: var(--mint); color: var(--mint-strong); }
.insight-item p { margin: 0; color: #65647a; font-size: 11px; line-height: 1.5; }
.insight-item p strong { color: var(--ink); }
.recent-list { margin-top: 18px; }
.recent-item { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid #f3f3f8; }
.recent-item:last-child { border-bottom: 0; }
.transaction-icon { width: 31px; height: 31px; border-radius: 10px; display: grid; place-items: center; color: var(--indigo); background: var(--lavender); font-size: 14px; }
.transaction-icon.income { color: var(--mint-strong); background: var(--mint); }
.transaction-main { min-width: 0; flex: 1; }
.transaction-main strong { display: block; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.transaction-main small { display: block; margin-top: 3px; color: var(--soft-muted); font-size: 10px; }
.transaction-amount { font-size: 11px; font-weight: 700; }
.transaction-amount.expense { color: var(--ink); }
.transaction-amount.income { color: var(--mint-strong); }
.compact-heading { align-items: center; }
.primary-button, .secondary-button { border: 0; border-radius: 10px; font-size: 12px; font-weight: 700; padding: 11px 16px; transition: .2s ease; }
.primary-button { background: var(--indigo); color: white; box-shadow: 0 6px 13px rgba(91,91,214,.16); }
.primary-button:hover { background: var(--indigo-dark); transform: translateY(-1px); }
.secondary-button { border: 1px solid var(--line); color: #67667d; background: white; }
.secondary-button:hover { border-color: #d5d4f6; color: var(--indigo); background: #fcfcff; }
.toolbar { display: flex; align-items: center; gap: 10px; padding: 12px; margin-bottom: 14px; box-shadow: none; }
.search-field { display: flex; align-items: center; gap: 8px; flex: 1; padding: 0 10px; color: var(--soft-muted); }
.search-field input { border: 0; outline: 0; width: 100%; color: var(--ink); font-size: 12px; background: transparent; }
.select-control { border: 1px solid var(--line); border-radius: 9px; background: white; color: #6f6e82; font-size: 11px; padding: 9px 27px 9px 10px; outline: none; }
.table-panel { padding: 24px 0 0; overflow: hidden; }
.table-heading { padding: 0 25px 18px; align-items: center; }
.count-pill { background: #f5f5fb; color: #9897a9; border-radius: 20px; padding: 6px 9px; font-size: 10px; white-space: nowrap; }
.transaction-table-wrap { overflow-x: auto; }
.transaction-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.transaction-table th { color: #a3a2b1; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; text-align: left; padding: 11px 25px; border-top: 1px solid #f1f1f6; border-bottom: 1px solid #f1f1f6; white-space: nowrap; }
.transaction-table td { color: #68677b; padding: 14px 25px; border-bottom: 1px solid #f4f4f8; white-space: nowrap; }
.transaction-table td:first-child { color: var(--ink); font-weight: 600; }
.transaction-table .align-right { text-align: right; }
.table-category { display: inline-flex; background: #f3f3fa; padding: 4px 8px; border-radius: 6px; font-size: 10px; color: #77768a; }
.table-type { font-size: 10px; font-weight: 700; }
.table-type.expense { color: var(--peach-strong); }
.table-type.income { color: var(--mint-strong); }
.delete-button { border: 0; background: transparent; color: #c5c4d0; font-size: 17px; line-height: 1; }
.delete-button:hover { color: var(--rose-strong); }
.mobile-transaction-list { display: none; }
.budget-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(270px, .7fr); gap: 14px; }
.budget-list-panel { padding-bottom: 19px; }
.budget-list { display: grid; gap: 9px; margin: 22px 0 15px; }
.budget-row { display: grid; grid-template-columns: 1fr 105px 82px; gap: 15px; align-items: center; padding: 13px 0; border-bottom: 1px solid #f2f2f7; }
.budget-category { display: flex; align-items: center; gap: 10px; min-width: 0; }
.budget-dot { width: 9px; height: 9px; border-radius: 4px; background: var(--indigo); }
.budget-category strong { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.budget-category small { display: block; color: var(--soft-muted); font-size: 10px; margin-top: 3px; }
.budget-input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px; color: var(--ink); font-size: 11px; text-align: right; outline: none; }
.budget-input:focus { border-color: #b4b3ef; box-shadow: 0 0 0 3px #f0efff; }
.budget-status { text-align: right; color: var(--muted); font-size: 10px; }
.budget-status.over { color: var(--rose-strong); font-weight: 700; }
.budget-status.good { color: var(--mint-strong); }
.full-width { width: 100%; }
.budget-guide-panel { background: #f0efff; border-color: #e5e4ff; box-shadow: none; padding: 27px; }
.budget-guide-illustration { width: 54px; height: 54px; border-radius: 17px; background: white; color: var(--indigo); display: grid; place-items: center; font-size: 29px; margin-bottom: 27px; box-shadow: 0 8px 18px rgba(91,91,214,.09); }
.budget-guide-panel h2 { font-family: Manrope, sans-serif; font-size: 21px; letter-spacing: -.05em; line-height: 1.2; margin: 9px 0 10px; }
.budget-guide-panel > p:not(.eyebrow) { color: #767596; font-size: 12px; line-height: 1.6; margin: 0 0 28px; }
.guide-stat { display: flex; justify-content: space-between; border-top: 1px solid #dddcfb; padding: 13px 0 0; margin-top: 12px; color: #8584a2; font-size: 11px; }
.guide-stat strong { color: var(--indigo-dark); font-family: Manrope, sans-serif; font-size: 14px; }
.mobile-nav, .floating-add { display: none; }
.modal-backdrop { position: fixed; z-index: 10; inset: 0; background: rgba(31,30,54,.34); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(100%, 460px); background: white; border-radius: 20px; padding: 26px; box-shadow: 0 25px 65px rgba(27,26,63,.2); animation: modalIn .22s ease both; }
.small-modal { width: min(100%, 390px); }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.modal h2 { font-family: Manrope, sans-serif; font-size: 21px; letter-spacing: -.05em; margin: 7px 0 0; }
.close-button { border: 0; background: #f6f6fb; color: #9291a2; width: 29px; height: 29px; border-radius: 9px; font-size: 20px; line-height: 1; }
.type-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 19px; background: #f7f7fb; padding: 4px; border-radius: 10px; }
.type-toggle label { position: relative; }
.type-toggle input { position: absolute; opacity: 0; }
.type-toggle span { display: block; text-align: center; color: #9998aa; font-size: 12px; font-weight: 700; border-radius: 8px; padding: 10px; }
.type-toggle input:checked + span { color: var(--indigo); background: white; box-shadow: 0 2px 7px rgba(45,44,83,.07); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.field { display: grid; gap: 7px; color: #77768b; font-size: 11px; font-weight: 600; }
.field input, .field select { width: 100%; border: 1px solid var(--line); border-radius: 9px; outline: 0; padding: 11px 12px; color: var(--ink); font-size: 12px; background: white; }
.field input:focus, .field select:focus { border-color: #b4b3ef; box-shadow: 0 0 0 3px #f0efff; }
.full-field { grid-column: 1 / -1; }
.amount-input { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; padding-left: 12px; color: #9a99a9; }
.amount-input:focus-within { border-color: #b4b3ef; box-shadow: 0 0 0 3px #f0efff; }
.amount-input input { border: 0; box-shadow: none; padding-left: 6px; }
.amount-input input:focus { box-shadow: none; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 25px; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 26px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: #2e2d48; color: white; border-radius: 10px; padding: 11px 16px; font-size: 11px; box-shadow: 0 10px 25px rgba(31,30,54,.18); transition: .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1050px) {
  .sidebar { width: 210px; flex-basis: 210px; }
  .content-wrap { padding-left: 32px; padding-right: 32px; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  body { padding-bottom: 70px; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .topbar { height: 62px; padding: 0 18px; justify-content: space-between; }
  .mobile-brand { display: inline-flex; }
  .topbar-actions { gap: 6px; }
  .icon-button { width: 32px; height: 32px; font-size: 15px; }
  .avatar { width: 31px; height: 31px; }
  .content-wrap { padding: 30px 16px 20px; }
  .page-heading { display: block; margin-bottom: 22px; }
  .page-heading .month-control { margin-top: 18px; width: fit-content; }
  .page-heading h1 { font-size: 28px; }
  .subheading { font-size: 12px; }
  .summary-grid { grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 10px; }
  .summary-card { min-height: 129px; padding: 16px 14px 13px; border-radius: 14px; }
  .summary-value { font-size: 21px; margin-top: 15px; }
  .summary-helper { font-size: 9px; }
  .dashboard-grid, .lower-grid, .budget-layout { grid-template-columns: 1fr; gap: 10px; margin-bottom: 10px; }
  .lower-grid { display: flex; flex-direction: column; }
  .panel { padding: 19px 16px; border-radius: 15px; }
  .panel-heading h2, .table-heading h2 { font-size: 15px; }
  .text-button { font-size: 10px; }
  .category-bars { margin-top: 22px; gap: 14px; }
  .trend-panel { min-height: 315px; }
  .trend-chart { height: 220px; margin-top: 20px; }
  .chart-legend { font-size: 9px; gap: 8px; }
  .insights-panel { order: 1; }
  .recent-panel { order: 2; }
  .compact-heading { display: flex; align-items: flex-end; }
  .compact-heading .primary-button { padding: 10px 11px; font-size: 10px; }
  .compact-heading .month-control { margin-top: 0; }
  .toolbar { flex-wrap: wrap; padding: 9px; gap: 7px; }
  .search-field { flex-basis: 100%; padding: 4px 7px; }
  .select-control { flex: 1; min-width: 0; }
  .transaction-table-wrap { display: none; }
  .mobile-transaction-list { display: block; }
  .mobile-transaction-list .recent-item { padding: 13px 0; }
  .budget-row { grid-template-columns: minmax(0, 1fr) 92px; gap: 9px; }
  .budget-status { grid-column: 1 / -1; text-align: left; margin-left: 19px; margin-top: -4px; }
  .budget-guide-panel { padding: 22px; }
  .budget-guide-illustration { margin-bottom: 20px; }
  .mobile-nav { display: flex; position: fixed; z-index: 5; bottom: 0; left: 0; right: 0; height: 68px; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); justify-content: space-around; padding: 5px 12px; }
  .mobile-nav-item { border: 0; background: transparent; color: #a1a0b0; display: grid; place-items: center; gap: 1px; min-width: 70px; border-radius: 10px; }
  .mobile-nav-item span { font-size: 19px; line-height: 20px; }
  .mobile-nav-item small { font-size: 9px; font-weight: 700; }
  .mobile-nav-item.active { color: var(--indigo); background: #f4f3ff; }
  .floating-add { display: grid; place-items: center; position: fixed; right: 18px; bottom: 83px; z-index: 4; width: 46px; height: 46px; border: 0; border-radius: 15px; background: var(--indigo); color: white; font-size: 25px; box-shadow: 0 9px 20px rgba(91,91,214,.25); }
  .floating-add:active { transform: scale(.95); }
}
@media (max-width: 390px) {
  .page-heading h1 { font-size: 25px; }
  .summary-value { font-size: 19px; }
  .compact-heading { gap: 10px; }
  .compact-heading .primary-button { padding-left: 8px; padding-right: 8px; }
}
