:root {
  --bg: #f7f6f4;
  --card: #ffffff;
  --ink: #242933;
  --muted: #6d7486;
  --border: #e7e3df;
  --blue: #3f7187;
  --blue-chart: #4f8ba6;
  --tan: #bf9a7f;
  --green: #6ba081;
  --purple: #9877aa;
  --shadow: 0 2px 8px rgba(31, 29, 26, 0.12);
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--sans);
}
.topbar {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background: rgba(247, 246, 244, 0.95);
  border-bottom: 1px solid #eee9e5;
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand {
  color: var(--blue);
  font: 700 24px var(--serif);
  text-decoration: none;
}
nav { display: flex; gap: 34px; }
nav a {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  font-size: 16px;
}
nav a.active { color: var(--ink); }
main { padding-bottom: 64px; }
.view { max-width: 1500px; margin: 0 auto; padding: 0 40px; }
.hero { max-width: 900px; margin: 12px auto 36px; text-align: center; }
h1, h2 { font-family: var(--serif); color: var(--ink); margin: 0; line-height: 1.05; }
.hero h1 { font-size: 30px; max-width: 820px; margin: 0 auto 18px; }
.hero p, .page-heading p, .card p { color: var(--muted); line-height: 1.55; font-size: 20px; }
.hero p { font-size: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.form-card {
  max-width: 760px;
  margin: 0 auto;
  padding: 34px;
}
.form-card h2, .chart-card h2, .recent-card h2 { font-size: 32px; margin-bottom: 10px; }
.form-card p { font-size: 18px; margin: 0 0 28px; }
.grid { display: grid; gap: 28px 32px; }
.two { grid-template-columns: 1fr 1fr; }
label { display: block; font-weight: 700; font-size: 17px; margin-bottom: 12px; }
input, select {
  width: 100%;
  height: 48px;
  border: 1px solid #dcd7d2;
  border-radius: 8px;
  background: white;
  padding: 0 16px;
  font: 500 16px var(--sans);
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.08);
}
.form-card > label { margin-top: 28px; }
.turnstile-widget { margin-top: 28px; min-height: 65px; }
button {
  width: 100%; height: 50px; margin-top: 30px;
  border: 0; border-radius: 8px;
  background: var(--blue); color: white;
  font-weight: 700; font-size: 17px; cursor: pointer;
}
button:hover { filter: brightness(.95); }
.form-message { margin-bottom: 18px; padding: 14px 16px; border-radius: 10px; font-weight: 600; }
.form-message.success { background: #eef8f1; color: #276943; }
.form-message.error { background: #fff0f0; color: #9d2a2a; }
.page-heading { margin: 24px 0 36px; }
.page-heading h1 { font-size: 30px; }
.page-heading p { max-width: 860px; font-size: 16px; }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 34px; margin-bottom: 64px; }
.stat-card { padding: 34px; }
.stat-card span { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; font-size: 16px; }
.stat-card strong { display: block; margin-top: 22px; color: var(--blue); font: 500 44px var(--serif); }
.stat-card em { font: 600 18px var(--sans); color: var(--muted); text-transform: none; letter-spacing: 0; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; margin-bottom: 64px; }
.chart-card, .recent-card { padding: 36px; min-height: 430px; }
.chart-card p, .recent-card p { margin: 0 0 34px; font-size: 18px; }
.donut-wrap { display: flex; justify-content: center; }
.donut-wrap canvas { width: 280px; height: 280px; max-width: 100%; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 14px; margin-top: 18px; color: var(--muted); font-size: 16px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 16px; height: 16px; border-radius: 50%; display: inline-block; }
.breakdown-details { display: grid; gap: 10px; margin-top: 24px; border-top: 1px solid var(--border); padding-top: 18px; }
.breakdown-details p { margin: 0; font-size: 15px; }
.breakdown-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; color: var(--muted); font-size: 15px; }
.breakdown-row strong { color: var(--ink); font-weight: 700; }
.recent-list { display: grid; }
.entry { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 18px 0; border-bottom: 1px solid #eee9e5; }
.entry strong { font-size: 19px; }
.entry span { color: var(--muted); }
.entry p { grid-column: 1 / -1; margin: 0; font-size: 15px; }
.bottom-charts .chart-card { min-height: 520px; }
.wide-chart { grid-column: 1 / -1; }
canvas { display: block; width: 100%; max-width: 100%; }
@media (max-width: 900px) {
  .topbar { padding: 0 18px; }
  nav { gap: 16px; }
  .view { padding: 0 18px; }
  .two, .stats-grid, .dashboard-grid { grid-template-columns: 1fr; }
  .hero p, .page-heading p { font-size: 18px; }
  .form-card { padding: 24px; }
}
