:root {
  color-scheme: light;
  --bg: #f7f7fb;
  --paper: #fff;
  --ink: #1d1930;
  --muted: #68637a;
  --line: #eae8f0;
  --purple: #6540da;
  --soft: #eee8ff;
  --green: #157655;
  --red: #ab4152;
  font: 16px/1.5 "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button, select { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
:focus-visible { outline: 3px solid #977af2; outline-offset: 3px; }
.skip { position: fixed; top: -5rem; left: 1rem; z-index: 20; padding: .6rem 1rem; background: var(--paper); }
.skip:focus { top: .5rem; }
h1, h2, h3, .brand, .money { font-family: Manrope, system-ui, sans-serif; font-weight: 800; margin: 0; }
h1 { font-size: clamp(1.8rem, 3vw, 2.45rem); letter-spacing: -.055em; line-height: 1.14; }
h2 { font-size: 1.1rem; letter-spacing: -.023em; }
p { margin: 0; }
small, .muted { color: var(--muted); }
small { font-size: .82rem; }
.icon { width: 1.2rem; height: 1.2rem; flex: none; vertical-align: middle; }
.shell { min-height: 100dvh; padding-left: 236px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 236px; background: var(--paper); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 23px 15px 15px; z-index: 5; overflow: auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.28rem; letter-spacing: -.06em; padding: 0 8px; width: fit-content; }
.brand-mark { border-radius: 10px; background: var(--purple); color: white; padding: 8px; display: inline-flex; }
.brand-mark .icon { width: 21px; height: 21px; }
nav { margin-top: 29px; }
.nav-label { display: block; padding: 0 11px; margin: 13px 0 5px; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .09em; font-weight: 800; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 8px 11px; min-height: 39px; border-radius: 8px; font-size: .88rem; font-weight: 600; color: #565166; }
.nav-link:hover { background: var(--bg); }
.nav-link[aria-current="page"] { color: #5530c2; background: var(--soft); font-weight: 800; }
.side-bottom { margin-top: auto; padding-top: 15px; }
.profile { margin-top: 9px; border-top: 1px solid var(--line); padding: 12px 4px 0; }
.profile a { display: flex; align-items: center; gap: 10px; font-size: .875rem; font-weight: 700; }
.profile a > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { background: #eae1ff; color: #5630bc; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-weight: 800; flex: none; }
.topbar { height: 67px; padding: 0 clamp(16px, 3vw, 42px); background: var(--paper); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.crumb { display: flex; align-items: center; gap: 9px; font-size: .88rem; font-weight: 700; }
.crumb .icon { width: 15px; color: #7d748d; }
.top-actions, .actions, .legend, .inline { display: flex; align-items: center; gap: 10px; }
.content { max-width: 1540px; margin: 0 auto; padding: 30px clamp(16px, 3vw, 42px) 42px; }
.headline { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.headline p { margin-top: 7px; color: var(--muted); }
.btn, .icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 13px; min-height: 39px; border: 1px solid var(--line); background: var(--paper); border-radius: 8px; font-size: .875rem; font-weight: 700; white-space: nowrap; }
.btn:hover, .icon-btn:hover { background: var(--bg); }
.icon-btn { width: 39px; padding: 0; }
.primary { color: white; background: var(--purple); border-color: var(--purple); }
.primary:hover { background: #5530c2; border-color: #5530c2; }
.mobile-menu, .scrim { display: none; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 17px; }
.panel, .stat-card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; min-width: 0; box-shadow: 0 2px 6px #24164305; }
.stat-card { overflow: hidden; }
.stat-content { padding: 15px 16px 13px; }
.stat-card dt { color: var(--muted); font-size: .87rem; font-weight: 700; }
.stat-card dd { margin: 3px 0 0; }
.stat-card dl { margin: 10px 0 0; }
.stat-meta { border-top: 1px solid var(--line); padding: 8px 16px; font-size: .78rem; min-height: 37px; color: var(--muted); background: #fbfaff; }
.stat-feature { background: radial-gradient(ellipse at 108% -24%, #a180ff 0, transparent 62%), linear-gradient(125deg,#5934cd,#7449ec); border-color: transparent; color: white; }
.stat-feature dt, .stat-feature .stat-meta { color: #f1eaff; }
.stat-feature .stat-meta { border-color: #ffffff33; background: #ffffff0f; }
.stat-feature .tile { background: #ffffff29; color: white; }
.tile { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; flex: none; color: #6440d9; background: var(--soft); }
.tile.green { background: #e5f6ee; color: #157655; }
.tile.rose { background: #fcebf0; color: #ad4359; }
.tile.blue { background: #e8f1ff; color: #3265b1; }
.tile.gold { background: #fff2db; color: #9c5e0b; }
.tile .icon { width: 18px; height: 18px; }
.money { font-size: clamp(1.06rem, 1.75vw, 1.62rem); letter-spacing: -.045em; overflow-wrap: anywhere; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(245px, 1fr); gap: 17px; align-items: start; }
.stack { display: grid; gap: 17px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 13px; gap: 10px; }
.panel-head small { display: block; margin-top: 2px; }
.panel-body { padding: 0 18px 16px; }
.legend { font-size: .78rem; color: var(--muted); flex-wrap: wrap; }
.legend span { display: flex; align-items: center; gap: 5px; }
.swatch { width: 9px; height: 9px; border-radius: 3px; background: #724be5; }
.swatch.light { background: #d7c8ff; }
.chart { display: grid; grid-template-columns: auto minmax(0, 1fr); margin-top: 12px; gap: 8px; }
.chart-labels { height: 155px; display: flex; flex-direction: column; justify-content: space-between; text-align: right; font-size: .72rem; color: var(--muted); }
.chart-area { min-width: 0; }
.bar-grid { height: 155px; display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); background: repeating-linear-gradient(to top, var(--line) 0 1px, transparent 1px 25%); }
.bar-group { display: flex; align-items: end; justify-content: center; gap: 5px; }
.bar { width: min(25%, 19px); border-radius: 5px 5px 0 0; background: #724be5; }
.bar.light { background: #d7c8ff; }
.chart-months { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); text-align: center; margin-top: 7px; color: var(--muted); font-size: .76rem; }
.list { margin: 0; padding: 0; list-style: none; }
.list-row { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding: 10px 0; }
.list-row:first-child { border-top: 0; }
.list-row > .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.list-row strong { display: block; font-size: .88rem; }
.list-row .amount { text-align: right; }
.link { font-size: .85rem; font-weight: 800; color: var(--purple); }
.link:hover { text-decoration: underline; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .86rem; }
thead { background: #faf9fd; color: var(--muted); }
th { font-weight: 700; }
td, th { padding: 10px 14px; white-space: nowrap; }
td { border-top: 1px solid var(--line); }
td:first-child, th:first-child { padding-left: 18px; }
td:last-child, th:last-child { padding-right: 18px; }
.amount { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.income { color: var(--green); }
.expense { color: var(--red); }
.pill { display: inline-block; font-size: .78rem; font-weight: 700; background: #f0ecfa; color: #564471; border-radius: 30px; padding: 3px 8px; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 16px 18px; }
.filters label { flex: 1 1 140px; }
.fields { display: grid; gap: 13px; }
label { display: grid; gap: 5px; font-size: .875rem; font-weight: 700; }
input, select { border: 1px solid #dbd7e5; border-radius: 8px; background: var(--paper); color: var(--ink); padding: 8px 10px; width: 100%; min-width: 0; min-height: 40px; }
select { appearance: none; padding-right: 31px; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2368637a' stroke-width='1.5'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") right 8px center/16px no-repeat; }
input[type=month] { width: auto; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,235px),1fr)); gap: 15px; }
.detail-card { padding: 17px; }
.detail-card .tile { margin-bottom: 10px; }
.detail-card .money { margin: 9px 0; }
.detail-card .actions { margin-top: 12px; flex-wrap: wrap; }
progress { width: 100%; height: 9px; border: 0; background: var(--soft); border-radius: 10px; appearance: none; }
progress::-webkit-progress-bar { background: var(--soft); border-radius: 10px; }
progress::-webkit-progress-value { background: var(--purple); border-radius: 10px; }
progress::-moz-progress-bar { background: var(--purple); border-radius: 10px; }
.empty { padding: 20px 18px; color: var(--muted); }
dialog { width: min(480px, calc(100% - 24px)); max-height: calc(100dvh - 24px); border: 1px solid var(--line); border-radius: 16px; padding: 22px; background: var(--paper); color: var(--ink); box-shadow: 0 18px 60px #21164540; }
dialog::backdrop { background: #20163175; }
.dialog-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.dialog-actions { display: flex; justify-content: end; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.error { color: var(--red); font-size: .875rem; }
#toast { position: fixed; z-index: 9; right: 18px; bottom: 18px; background: #241a3e; color: white; border-radius: 10px; box-shadow: 0 4px 20px #21164540; padding: 10px 15px; }
#toast:empty { display: none; }
.auth { display: grid; min-height: 100dvh; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-art { color: white; background: radial-gradient(circle at 75% 62%, #865cf4 0, transparent 50%), #4624a3; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(25px, 6vw, 90px); }
.auth-art h1 { font-size: clamp(2.4rem, 5vw, 5rem); max-width: 10ch; }
.auth-art p { margin-top: 14px; color: #f3edff; max-width: 34ch; }
.auth-demo { margin-top: 25px; padding: 20px; max-width: 330px; border: 1px solid #ffffff50; border-radius: 14px; background: #ffffff18; }
.auth-demo small { color: #f3edff; }
.auth-demo .money { font-size: 2rem; }
.auth-main { display: grid; place-items: center; padding: 30px 20px; }
.auth-inner { width: min(100%, 390px); }
.auth-inner form { margin: 20px 0 14px; }
.auth-inner p { margin-top: 9px; }
.auth-inner .btn { width: 100%; }
@media (max-width: 1090px) {
  .shell { padding-left: 196px; }
  .sidebar { width: 196px; }
  .stat-content, .stat-meta { padding-left: 11px; padding-right: 11px; }
  .dashboard-grid { grid-template-columns: minmax(0,1.5fr) minmax(211px,1fr); }
}
@media (max-width: 850px) {
  .shell { padding: 0; }
  .sidebar { display: none; width: 236px; }
  .menu-open .sidebar, .menu-open .scrim { display: flex; }
  .scrim { position: fixed; inset: 0; z-index: 4; border: 0; background: #21164565; }
  .mobile-menu { display: inline-flex; }
}
@media (max-width: 620px) {
  .content { padding-top: 21px; }
  .headline { align-items: start; flex-direction: column; margin-bottom: 16px; }
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .stat-content { padding-top: 11px; }
  .stat-card dt { font-size: .79rem; }
  .money { font-size: 1.2rem; }
  .dashboard-grid, .auth { grid-template-columns: minmax(0,1fr); }
  .auth-art { gap: 16px; }
  .auth-art h1 { font-size: 2rem; max-width: none; }
  .auth-demo { display: none; }
  .auth-main { place-items: start center; }
  .crumb .muted, .crumb .icon { display: none; }
}
/* Local styles for the adapted TailUI IconStat and FormModal components. */
.month-control { white-space: nowrap; }
.actions { flex-wrap: wrap; }
.detail-card h2, .panel-body { overflow-wrap: anywhere; }
[hidden] { display: none !important; }
