:root {
  --background: #0b1412;
  --surface: #101c19;
  --surface-raised: #14231f;
  --surface-soft: #182a25;
  --border: #29433a;
  --border-soft: rgba(99, 214, 161, 0.14);
  --emerald: #2faf7a;
  --emerald-light: #63d6a1;
  --cream: #f4efe6;
  --gold: #c8a96b;
  --text-soft: #c5d0c8;
  --text-muted: #9eafa5;
  --danger: #d7b681;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { background: var(--background); scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 76% -12%, rgba(47, 175, 122, 0.16), transparent 34rem),
    var(--background);
  color: var(--cream);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--emerald-light);
  outline-offset: 3px;
}
.app-shell { min-height: 100vh; }
.noise {
  position: fixed; inset: 0; z-index: 20; pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex: 0 0 248px; display: flex; flex-direction: column;
  padding: 28px 18px; border-right: 1px solid var(--border);
  background: rgba(11, 20, 18, .94);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px; color: var(--cream); }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid rgba(99, 214, 161, .7); border-radius: 50%;
  color: var(--gold); font: italic 1.25rem var(--serif);
}
.brand-name { font-size: 1.1rem; letter-spacing: .02em; }
.nav-group { margin-top: 66px; }
.nav-label, .eyebrow {
  margin: 0; color: var(--text-muted); font-size: .66rem; font-weight: 700;
  letter-spacing: .17em; text-transform: uppercase;
}
.nav-label { padding: 0 12px; margin-bottom: 12px; }
.nav-button {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 12px; margin-bottom: 3px; border: 0; border-radius: 10px;
  color: var(--text-muted); background: transparent; text-align: left;
  transition: transform .2s, background .2s, color .2s;
}
.nav-button:hover { color: var(--cream); background: rgba(99, 214, 161, .1); transform: translateX(2px); }
.nav-button.active { color: var(--emerald-light); background: rgba(47, 175, 122, .17); }
.nav-icon { width: 18px; color: currentColor; font-size: .92rem; text-align: center; }
.sidebar-foot { margin-top: auto; padding: 15px 10px 0; border-top: 1px solid var(--border); }
.sidebar-foot p { margin: 11px 0 14px; color: var(--text-muted); font-size: .71rem; line-height: 1.55; }
.demo-note {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px;
  border: 1px solid rgba(200, 169, 107, .38); border-radius: 999px;
  color: var(--gold); background: rgba(200, 169, 107, .11);
  font-size: .62rem; font-weight: 700;
}
.main { min-width: 0; flex: 1; }
.mobile-head { display: none; }
.content { max-width: 1480px; margin: auto; padding: 41px clamp(24px, 4vw, 66px) 72px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 43px; }
.topbar h1, .view-title, .note-title {
  margin: 7px 0 0; color: var(--cream); font: italic 400 clamp(2.5rem, 4vw, 4.25rem)/.95 var(--serif);
  letter-spacing: .045em; word-spacing: .14em;
}
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.date-stamp { color: var(--text-muted); font-size: .72rem; }
.primary-button, .ghost-button {
  min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 15px; border-radius: 9px; font-size: .77rem; font-weight: 700;
  transition: transform .2s, background .2s, border-color .2s, color .2s;
}
.primary-button { border: 1px solid var(--gold); color: var(--background); background: var(--gold); }
.primary-button:hover { transform: translateY(-2px); background: #d6b97c; }
.ghost-button { border: 1px solid var(--border); color: var(--cream); background: transparent; }
.ghost-button:hover { border-color: var(--emerald); color: var(--emerald-light); background: rgba(47, 175, 122, .1); }
.summary-grid { display: grid; grid-template-columns: 1.55fr repeat(3, 1fr); gap: 13px; margin-bottom: 20px; }
.panel {
  border: 1px solid var(--border); border-radius: 18px;
  background: linear-gradient(145deg, rgba(20, 35, 31, .97), rgba(16, 28, 25, .97));
  box-shadow: 0 18px 45px rgba(0, 0, 0, .08);
}
.metric-card { min-height: 157px; padding: 24px 23px; position: relative; overflow: hidden; }
.metric-card.featured { border-color: rgba(47, 175, 122, .62); background: linear-gradient(145deg, #19392d, #101c19); }
.metric-card.featured::after {
  content: ""; position: absolute; width: 145px; height: 145px; right: -34px; top: -52px;
  border: 1px solid rgba(200, 169, 107, .3); border-radius: 50%;
  box-shadow: 0 0 0 14px rgba(200, 169, 107, .06), 0 0 0 28px rgba(47, 175, 122, .05);
}
.metric-label { color: var(--text-soft); font-size: .73rem; }
.metric-value { margin-top: 14px; color: var(--cream); font: 500 clamp(1.65rem, 2.7vw, 2.35rem) var(--mono); letter-spacing: -.06em; }
.metric-card.featured .metric-value { color: var(--emerald-light); }
.metric-change { display: inline-flex; align-items: center; gap: 4px; margin-top: 12px; color: var(--emerald-light); font-size: .67rem; font-weight: 700; }
.metric-change.gold { color: var(--gold); }
.dashboard-grid { display: grid; grid-template-columns: 1.35fr .9fr; gap: 20px; align-items: start; }
.panel-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 22px 23px 0; }
.panel-title { margin: 5px 0 0; color: var(--cream); font-size: 1.08rem; font-weight: 500; letter-spacing: .02em; }
.panel-link { padding: 5px 0; border: 0; color: var(--gold); background: transparent; font-size: .72rem; font-weight: 700; }
.panel-link:hover { color: var(--emerald-light); }
.chart-panel { min-height: 316px; }
.legend { display: flex; gap: 17px; margin-top: 12px; color: var(--text-soft); font-size: .65rem; }
.legend span { display: flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--emerald-light); }
.dot.gold { background: var(--gold); }
.chart-wrap { height: 202px; position: relative; margin: 12px 23px 20px; }
.chart-grid { position: absolute; inset: 12px 0 26px; display: flex; flex-direction: column; justify-content: space-between; }
.chart-grid i { width: 100%; height: 1px; background: rgba(99, 214, 161, .13); }
.chart-svg { position: absolute; inset: 10px 0 25px; width: 100%; height: calc(100% - 35px); overflow: visible; }
.chart-months { position: absolute; inset: auto 0 0; display: flex; justify-content: space-between; color: var(--text-muted); font: .59rem var(--mono); }
.side-stack { display: grid; gap: 20px; }
.progress-panel { padding-bottom: 24px; }
.progress-row { padding: 22px 23px 0; }
.progress-meta, .progress-sub { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.progress-name { color: var(--cream); font-size: .84rem; }
.progress-number { color: var(--gold); font: .67rem var(--mono); white-space: nowrap; }
.progress-track { height: 6px; margin-top: 11px; overflow: hidden; border-radius: 10px; background: rgba(99, 214, 161, .14); }
.progress-fill { width: var(--progress); height: 100%; border-radius: inherit; background: var(--emerald); animation: fill 1s cubic-bezier(.2,.8,.2,1) both; }
.progress-fill.gold { background: var(--gold); }
.progress-sub { margin-top: 7px; color: var(--text-muted); font-size: .65rem; }
.category-panel { padding-bottom: 20px; }
.category-list { padding: 13px 23px 0; }
.category-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.category-item + .category-item { border-top: 1px solid rgba(99, 214, 161, .12); }
.category-icon { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; color: var(--emerald-light); background: rgba(47, 175, 122, .14); font-size: .8rem; }
.category-info { min-width: 0; flex: 1; }
.category-name, .category-share { display: block; }
.category-name { color: var(--cream); font-size: .76rem; }
.category-share { margin-top: 3px; color: var(--text-soft); font-size: .61rem; }
.category-amount { font: .68rem var(--mono); }
.transactions-panel { margin-top: 20px; overflow: hidden; }
.transaction-table { width: 100%; border-collapse: collapse; }
.transaction-table th { padding: 17px 23px 11px; color: var(--text-soft); font-size: .61rem; font-weight: 700; letter-spacing: .12em; text-align: left; text-transform: uppercase; }
.transaction-table td { padding: 15px 23px; border-top: 1px solid rgba(99, 214, 161, .12); color: var(--cream); font-size: .76rem; }
.transaction-table tbody tr { transition: background .2s; }
.transaction-table tbody tr:hover { background: rgba(47, 175, 122, .08); }
.transaction-name { display: flex; align-items: center; gap: 11px; font-weight: 600; }
.transaction-avatar { display: grid; place-items: center; width: 31px; height: 31px; border: 1px solid rgba(99, 214, 161, .44); border-radius: 50%; color: var(--emerald-light); font-size: .68rem; }
.transaction-date { color: var(--text-soft); font-size: .7rem; }
.amount-income { color: var(--emerald-light); font: .7rem var(--mono); }
.amount-expense { color: var(--gold); font: .7rem var(--mono); }
.type-pill { display: inline-flex; padding: 4px 7px; border-radius: 5px; color: var(--text-soft); background: rgba(99, 214, 161, .12); font-size: .6rem; }
.table-actions { display: flex; justify-content: flex-end; gap: 5px; opacity: 0; transition: opacity .2s; }
.transaction-table tr:hover .table-actions, .table-actions:focus-within { opacity: 1; }
.small-action { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 6px; color: var(--text-soft); background: transparent; }
.small-action:hover { color: var(--emerald-light); background: rgba(47, 175, 122, .15); }
.view-heading { margin-bottom: 27px; }
.view-title { font-size: clamp(2.1rem, 4vw, 3.5rem); }
.view-copy { margin: 10px 0 0; color: var(--text-soft); font-size: .8rem; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 15px; margin-bottom: 15px; }
.search-box { display: flex; align-items: center; gap: 8px; min-width: 230px; flex: 1; color: var(--text-soft); }
.search-box input, .field input, .field select, .select-control {
  border: 1px solid var(--border); border-radius: 8px; color: var(--cream); background: rgba(11, 20, 18, .68); padding: 10px 11px;
}
.search-box input { width: 100%; border: 0; outline: 0; padding: 9px 3px; }
.select-control { font-size: .75rem; }
.select-control option, .field select option { color: var(--cream); background: var(--surface); }
.empty-state { padding: 55px 20px; color: var(--text-soft); text-align: center; }
.empty-state h3 { margin: 15px 0 7px; color: var(--cream); font-size: 1.15rem; font-weight: 500; }
.empty-state p { font-size: .78rem; }
.budget-grid, .goal-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 20px; }
.goal-grid { grid-template-columns: repeat(3, 1fr); }
.goal-card { min-height: 188px; padding: 22px; }
.goal-card h3 { margin: 13px 0 5px; color: var(--cream); font-size: 1rem; font-weight: 500; }
.goal-card p { min-height: 34px; margin: 0 0 19px; color: var(--text-soft); font-size: .72rem; line-height: 1.5; }
.budget-list { padding: 16px 23px 23px; }
.budget-row { padding: 14px 0; }
.budget-row + .budget-row { border-top: 1px solid rgba(99, 214, 161, .12); }
.note-card { min-height: 260px; padding: 23px; }
.note-title { margin: 16px 0 10px; font-size: 2rem; line-height: 1; }
.note-copy { color: var(--text-soft); font-size: .78rem; line-height: 1.65; }
.mobile-nav { display: none; }
.modal-backdrop { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 18px; background: rgba(5, 13, 11, .84); backdrop-filter: blur(8px); }
.modal { width: min(100%, 520px); max-height: calc(100vh - 36px); overflow: auto; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); animation: rise .25s ease both; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 23px 24px 15px; }
.modal-head h2 { margin: 5px 0 0; color: var(--cream); font: italic 400 1.65rem var(--serif); letter-spacing: .04em; }
.close-button { width: 35px; height: 35px; border: 1px solid var(--border); border-radius: 50%; color: var(--text-soft); background: transparent; }
.close-button:hover { color: var(--emerald-light); border-color: var(--emerald); }
.modal-form { padding: 4px 24px 24px; }
.field { display: grid; gap: 7px; margin-top: 14px; }
.field label { color: var(--text-soft); font-size: .7rem; font-weight: 700; letter-spacing: .04em; }
.field input, .field select { width: 100%; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.type-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border-radius: 10px; background: var(--background); }
.type-switch button { border: 0; border-radius: 7px; color: var(--text-soft); background: transparent; padding: 9px; font-size: .75rem; font-weight: 700; }
.type-switch button.active { color: var(--background); background: var(--emerald-light); }
.modal-error { margin: 13px 0 0; color: var(--gold); font-size: .7rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 23px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; padding: 13px 16px; border: 1px solid rgba(47, 175, 122, .58); border-radius: 10px; color: var(--cream); background: var(--surface-raised); box-shadow: var(--shadow); font-size: .76rem; animation: rise .3s ease both; }
.motion { animation: rise .65s cubic-bezier(.2,.8,.2,1) both; }
.delay-1 { animation-delay: .08s; } .delay-2 { animation-delay: .16s; } .delay-3 { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fill { from { width: 0; } to { width: var(--progress); } }
@media (max-width: 1050px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-card.featured { grid-column: span 2; }
  .dashboard-grid, .budget-grid { grid-template-columns: 1fr; }
  .goal-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .layout { display: block; }
  .sidebar { display: none; }
  .mobile-head { display: flex; align-items: center; justify-content: space-between; height: 65px; padding: 0 18px; border-bottom: 1px solid var(--border); background: rgba(11, 20, 18, .95); }
  .mobile-head .brand { padding: 0; }
  .menu-button { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 50%; color: var(--cream); background: transparent; }
  .content { padding: 27px 16px 90px; }
  .topbar { display: block; margin-bottom: 31px; }
  .topbar h1 { font-size: 2.8rem; }
  .topbar-actions { margin-top: 23px; justify-content: space-between; }
  .topbar-actions .date-stamp { margin-right: auto; }
  .summary-grid { gap: 9px; margin-bottom: 15px; }
  .metric-card { min-height: 135px; padding: 18px 16px; }
  .metric-card.featured { grid-column: span 2; }
  .metric-value { margin-top: 12px; font-size: 1.48rem; }
  .dashboard-grid, .budget-grid { gap: 15px; }
  .chart-panel { min-height: 285px; }
  .panel-header { padding: 18px 17px 0; }
  .chart-wrap { margin-right: 17px; margin-left: 17px; }
  .category-list, .progress-row { padding-right: 17px; padding-left: 17px; }
  .transactions-panel { margin-top: 15px; }
  .transaction-table th, .transaction-table td { padding-right: 14px; padding-left: 14px; }
  .transaction-table th:nth-child(3), .transaction-table td:nth-child(3) { display: none; }
  .table-actions { opacity: 1; }
  .view-title { font-size: 2.5rem; }
  .toolbar { align-items: stretch; }
  .search-box { flex-basis: 100%; }
  .select-control { flex: 1; }
  .goal-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .mobile-nav { position: fixed; inset: auto 10px 10px; z-index: 15; display: flex; justify-content: space-around; padding: 8px 4px; border: 1px solid var(--border); border-radius: 16px; background: rgba(16, 28, 25, .97); backdrop-filter: blur(12px); }
  .mobile-nav .nav-button { display: grid; width: auto; justify-items: center; gap: 3px; padding: 7px 12px; margin: 0; font-size: .58rem; }
}