:root {
  color-scheme: light;
  --ink: #14213d;
  --muted: #667085;
  --line: #d9e2ec;
  --paper: #f7f8fa;
  --surface: #ffffff;
  --teal: #006d77;
  --teal-dark: #00525a;
  --amber: #b7791f;
  --coral: #c2412d;
  --green: #2f855a;
  --shadow: 0 8px 24px rgba(20, 33, 61, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--teal);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--teal-dark);
}

button.ghost {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

button.ghost:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

input,
select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 18px;
  align-items: center;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 250, 0.96);
  backdrop-filter: blur(12px);
}

.topbar h1,
.section-head h2,
.login-panel h1 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 24px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-tabs {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.nav-tabs a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.nav-tabs a.active {
  background: #e6f3f4;
  color: var(--teal-dark);
}

.layout {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 64px;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.status-strip div {
  min-width: 0;
  padding: 16px;
  background: var(--surface);
}

.label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-strip strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view {
  display: none;
  margin-top: 28px;
}

.view.active {
  display: block;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-head.compact {
  margin-top: 12px;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.account-card,
.review-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.account-card {
  padding: 18px;
}

.account-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.balance {
  margin: 0;
  font-size: 28px;
  font-weight: 850;
}

.meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr);
  gap: 28px;
  margin-top: 28px;
}

.metric-list {
  display: grid;
  gap: 10px;
}

.metric-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.metric-row:last-child {
  border-bottom: 0;
}

.metric-name {
  overflow: hidden;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-value {
  color: var(--coral);
  font-weight: 850;
}

.filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.money {
  text-align: right;
}

.income {
  color: var(--green);
}

.spend {
  color: var(--coral);
}

.review-stack {
  display: grid;
  gap: 12px;
}

.review-item {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.review-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.review-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
}

.pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: #fff7e6;
  color: var(--amber);
  font-size: 12px;
  font-weight: 850;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

pre {
  margin-top: 16px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #101828;
  color: #f2f4f7;
}

.empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
}

.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(420px, 100%);
}

.login-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-panel form {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.alert {
  margin-top: 14px;
  border-radius: 8px;
  padding: 12px;
  font-weight: 700;
}

.alert.error {
  background: #fff1f0;
  color: var(--coral);
}

@media (max-width: 820px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .nav-tabs {
    overflow-x: auto;
    justify-content: flex-start;
  }

  .status-strip,
  .two-column,
  .filters,
  .review-form {
    grid-template-columns: 1fr;
  }

  .layout {
    width: min(100% - 20px, 1180px);
    margin-top: 16px;
  }
}

