:root {
  --ink: #0a0619;
  --accent: #ff0844;
  --paper: #ffffff;
  --line: #e7e5ee;
  --muted: #6b6780;
  --ok: #0d8a5f;
  --warn: #b06a00;
  --wash: #f7f6fa;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: Poppins, system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

a { color: var(--accent); }

.brand-mark {
  font-family: Poppins, sans-serif;
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  color: var(--paper);
}
.brand-mark span { color: var(--accent); }

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--ink);
}
.login-card {
  background: var(--paper);
  border-radius: 14px;
  padding: 40px;
  width: min(420px, 100%);
  box-shadow: 0 24px 60px rgba(10, 6, 25, 0.35);
}
.login-card .brand-mark { color: var(--ink); margin-bottom: 24px; }
.login-card h1 { font-size: 1.5rem; margin-bottom: 6px; }
.login-card label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin: 20px 0 6px;
}
.login-card input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
}
.login-card input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}
button {
  margin-top: 20px;
  width: 100%;
  padding: 12px 16px;
  background: var(--accent);
  color: var(--paper);
  border: 0;
  border-radius: 8px;
  font-family: Poppins, sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }
.form-error {
  margin: 16px 0 0;
  padding: 10px 12px;
  background: #fff0f3;
  border-left: 3px solid var(--accent);
  font-size: 0.9rem;
}

.topbar { background: var(--ink); color: var(--paper); }
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.topbar-title h1 { font-size: 1.15rem; color: var(--paper); }
.topbar-title p { margin: 2px 0 0; font-size: 0.85rem; color: #a49fb8; }
.topbar form { margin-left: auto; }
button.ghost {
  margin: 0;
  width: auto;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--paper);
  padding: 8px 16px;
  font-size: 0.85rem;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px; }

.range-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 0.85rem;
}
.range-switch a {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}
.range-switch a.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.generated { margin-left: auto; color: var(--muted); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat, .money {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-alert { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.money-highlight { background: var(--ink); border-color: var(--ink); }
.money-highlight .stat-label, .money-highlight .stat-sub { color: #a49fb8; }
.money-highlight .stat-value { color: var(--paper); }
.stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--muted);
}
.stat-value {
  font-family: Poppins, sans-serif;
  font-weight: 700;
  font-size: 1.9rem;
  line-height: 1.1;
}
.stat-sub { font-size: 0.85rem; color: var(--muted); }

.money-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 20px;
}
.panel h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
}
.panel h3 { font-size: 0.9rem; margin-bottom: 10px; }

.table-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th {
  text-align: left;
  font-family: Poppins, sans-serif;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82rem; }

.health { list-style: none; margin: 0; padding: 0; }
.health li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.health li:last-child { border-bottom: 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.health .ok .dot { background: var(--ok); }
.health .bad .dot { background: var(--accent); }
.health .warn .dot { background: var(--warn); }
.health-label { font-weight: 600; min-width: 200px; }
.health-detail { color: var(--muted); }

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.pill-ok { background: #e6f5ef; color: var(--ok); }
.pill-bad { background: #fff0f3; color: var(--accent); }
.pill-warn { background: #fff6e6; color: var(--warn); }

.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.plain { list-style: none; padding: 0; }
.error-note {
  padding: 10px 14px;
  background: #fff0f3;
  border-left: 3px solid var(--accent);
  font-size: 0.88rem;
  margin: 0 0 16px;
}

.foot {
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 24px 40px;
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 640px) {
  .topbar-inner { flex-wrap: wrap; }
  .health li { flex-wrap: wrap; }
  .health-label { min-width: 0; }
}
