:root {
  color-scheme: light;
  --brand: #26334e;
  --accent: #087f87;
  --bg: #f2f5fa;
  --surface: #fff;
  --surface2: #edf2f8;
  --border: #dce3ee;
  --text: #202841;
  --muted: #586880;
  --purple: #7960a5;
  --positive: #087566;
  --negative: #b04050;
  --positive-bg: #e5f5ef;
  --negative-bg: #fbecef;
  --shadow: 0 8px 30px #2028410a;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --brand: #dce7f7;
  --accent: #70d9da;
  --bg: #0e1425;
  --surface: #151e33;
  --surface2: #1d2b44;
  --border: #30405c;
  --text: #e3ecf8;
  --muted: #a5b5cb;
  --purple: #bb9bdc;
  --positive: #7addbd;
  --negative: #ffa6ae;
  --positive-bg: #173a36;
  --negative-bg: #432a38;
  --shadow: 0 8px 30px #0002;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font:
    14px/1.5 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--text);
}
[hidden] {
  display: none !important;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 3px;
}
button {
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  padding: 9px 14px;
  font-weight: 550;
}
button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button.primary {
  background: var(--accent);
  color: var(--surface);
  border-color: var(--accent);
}
html[data-theme="dark"] button.primary {
  color: #102832;
}
a {
  color: var(--accent);
}
header {
  height: 74px;
  border-top: 3px solid var(--purple);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  padding: 0 32px;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--brand);
  text-decoration: none;
  font-size: 19px;
  line-height: 1.15;
}
.brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.brand strong {
  font-weight: 650;
}
.brand small {
  display: block;
  font-size: 9px;
  letter-spacing: 1.8px;
  margin-top: 5px;
  color: var(--muted);
}
.header-actions,
.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-pill {
  font-size: 12px;
  background: var(--surface2);
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 24px;
}
.tier {
  font-size: 11px;
  background: var(--positive-bg);
  color: var(--positive);
  border: 1px solid #86c9b8;
  padding: 4px 10px;
  border-radius: 4px;
}
.tier.lite {
  background: transparent;
  color: var(--purple);
  border-color: var(--purple);
}
.appearance-control {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  background: var(--surface2);
  color: var(--muted);
}
nav {
  padding: 0 32px;
  display: flex;
  gap: 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow: auto;
}
nav button {
  white-space: nowrap;
  padding: 18px 0 15px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  color: var(--muted);
  font-size: 13px;
}
nav button.active {
  border-color: var(--accent);
  color: var(--accent);
}
.count {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 12px;
  background: var(--surface2);
  margin-left: 4px;
}
main {
  max-width: 1500px;
  padding: 34px 32px 20px;
  margin: auto;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.7px;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 7px;
}
h1 {
  font-size: 30px;
  line-height: 1.2;
  font-weight: 620;
  letter-spacing: -0.7px;
  margin: 0 0 8px;
}
h2 {
  font-size: 19px;
  margin: 0 0 7px;
  font-weight: 620;
}
h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 8px;
}
p {
  margin: 0 0 12px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.filters {
  display: flex;
  align-items: end;
  gap: 14px;
  margin: 0 0 24px;
}
.filters label {
  min-width: 130px;
}
.filters input,
.filters select {
  background: var(--surface);
}
.search-label {
  margin-left: auto;
  min-width: 250px !important;
}
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
}
input,
select,
textarea {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 9px 10px;
  width: 100%;
  min-height: 40px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}
.metric,
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  box-shadow: var(--shadow);
}
.metric {
  padding: 20px 22px;
  min-height: 135px;
}
.metric-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}
.metric-value {
  font-size: 29px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.6px;
}
.metric-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}
.metric.highlight {
  border-top: 3px solid var(--accent);
  padding-top: 18px;
}
.positive {
  color: var(--positive);
}
.negative {
  color: var(--negative);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(290px, 1fr);
  gap: 22px;
  margin-bottom: 22px;
}
.panel-head {
  padding: 20px 22px 14px;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 15px;
}
.panel-body {
  padding: 0 22px 22px;
}
.breakdown {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.breakdown:last-child {
  border: 0;
}
.breakdown strong {
  margin-left: auto;
  font-size: 17px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}
.bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 100px;
  align-items: center;
  gap: 14px;
  margin: 18px 0;
}
.bar-track {
  height: 9px;
  border-radius: 4px;
  background: var(--surface2);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
}
.bar-fill.expense {
  background: var(--purple);
}
.bar-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.notice {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  background: var(--surface2);
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
}
.table-scroll {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}
th {
  background: var(--surface2);
  font-size: 10px;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  font-weight: 650;
  color: var(--muted);
  padding: 12px 20px;
  white-space: nowrap;
}
td {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tr:last-child td {
  border-bottom: 0;
}
.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cell-title {
  font-weight: 600;
}
.cell-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.status {
  font-size: 11px;
  border-radius: 3px;
  padding: 3px 8px;
  background: var(--surface2);
  white-space: nowrap;
}
.status.paid {
  background: var(--positive-bg);
  color: var(--positive);
}
.status.overdue {
  background: var(--negative-bg);
  color: var(--negative);
}
.row-actions {
  display: flex;
  gap: 6px;
}
.row-actions button {
  padding: 5px 9px;
  font-size: 12px;
  white-space: nowrap;
}
.empty {
  text-align: center;
  padding: 55px 24px;
  color: var(--muted);
}
.empty h3 {
  color: var(--text);
  font-size: 18px;
}
.receipt-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
}
.receipt-card {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 18px;
}
.receipt-card .receipt-info {
  flex: 1;
}
.file-icon {
  font-size: 11px;
  border: 1px solid var(--border);
  padding: 10px 7px;
  border-radius: 4px;
  color: var(--accent);
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
dialog {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 7px;
  width: 680px;
  max-width: calc(100% - 32px);
  padding: 26px;
  max-height: 90vh;
  box-shadow: 0 24px 90px #0004;
}
dialog::backdrop {
  background: #0a15266b;
  backdrop-filter: blur(2px);
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 20px;
}
.close {
  font-size: 23px;
  border: 0;
  padding: 0 6px;
  line-height: 1;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}
.full {
  grid-column: 1/-1;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.form-error {
  color: var(--negative);
  font-size: 13px;
}
.plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 22px;
}
.plan-grid section {
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: 4px;
}
.plan-grid h3 {
  margin-top: 14px;
}
.auth-card {
  max-width: 600px;
  margin: 10vh auto;
  padding: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
}
.auth-card h1 {
  font-size: 40px;
  margin: 16px 0 20px;
}
.auth-card p {
  line-height: 1.7;
}
.auth-card button.primary {
  margin: 15px 0;
}
.sample-banner {
  padding: 8px 24px;
  text-align: center;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  color: var(--purple);
  font-size: 11px;
  letter-spacing: 0.4px;
}
#message {
  padding: 12px 24px;
  background: var(--positive-bg);
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
#message.error {
  background: var(--negative-bg);
  color: var(--negative);
}
.history {
  padding-left: 20px;
}
.history li {
  margin-bottom: 10px;
}
.split {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
}
@media (max-width: 1050px) {
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .page-heading {
    align-items: start;
  }
  .page-heading .actions {
    flex-wrap: wrap;
    justify-content: end;
  }
  .filters {
    flex-wrap: wrap;
  }
  .search-label {
    margin-left: 0;
    flex: 1;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .user-pill {
    display: none;
  }
}
@media (max-width: 650px) {
  header {
    padding: 0 16px;
  }
  .brand {
    font-size: 16px;
  }
  .brand img {
    width: 30px;
    height: 30px;
  }
  .header-actions {
    gap: 7px;
  }
  nav {
    padding: 0 16px;
    gap: 22px;
  }
  main {
    padding: 24px 16px;
  }
  .page-heading {
    display: block;
  }
  .page-heading .actions {
    justify-content: start;
    margin-top: 18px;
  }
  .metrics {
    gap: 10px;
  }
  .metric {
    padding: 16px;
    min-height: 125px;
  }
  .metric.highlight {
    padding-top: 14px;
  }
  .metric-value {
    font-size: 24px;
  }
  .filters label {
    flex: 1;
  }
  .form-grid,
  .plan-grid {
    grid-template-columns: 1fr;
  }
  .receipt-card,
  .receipt-intro {
    flex-wrap: wrap;
  }
  .receipt-card .row-actions {
    flex-wrap: wrap;
  }
  .receipt-info {
    min-width: 180px;
  }
  .auth-card {
    margin: 35px 16px;
    padding: 28px;
  }
  .auth-card h1 {
    font-size: 34px;
  }
  footer {
    display: block;
  }
  .bar-row {
    grid-template-columns: 90px 1fr 90px;
  }
  .tier {
    font-size: 10px;
  }
  .full {
    grid-column: auto;
  }
}
