:root {
  --ink: #17202a;
  --muted: #667085;
  --line: #e4e7ec;
  --paper: #ffffff;
  --wash: #f7f7f5;
  --brand: #7c221c;
  --brand-dark: #5d1713;
  --success: #19724b;
  --shadow: 0 10px 30px rgba(16,24,40,.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin:0; background:var(--wash); color:var(--ink); }
a { color:inherit; }
button, input, textarea, select { font:inherit; }
button { cursor:pointer; }
.shell { max-width:1180px; margin:0 auto; padding:32px 24px 56px; }
.topbar { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:28px; }
.brand-wrap { display:flex; align-items:center; gap:14px; }
.mark { width:46px; height:46px; border-radius:10px; background:var(--brand); color:#fff; display:grid; place-items:center; font-weight:800; letter-spacing:-1px; }
.eyebrow { margin:0 0 2px; text-transform:uppercase; letter-spacing:.12em; font-size:12px; color:var(--brand); font-weight:800; }
h1 { margin:0; font-size:28px; line-height:1.12; letter-spacing:-.025em; }
.subtle { color:var(--muted); font-size:14px; }
.actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.btn { border:1px solid var(--line); background:#fff; color:var(--ink); border-radius:8px; padding:10px 14px; font-weight:700; text-decoration:none; display:inline-flex; align-items:center; gap:8px; }
.btn:hover { border-color:#c9ced6; }
.btn-primary { background:var(--brand); border-color:var(--brand); color:#fff; }
.btn-primary:hover { background:var(--brand-dark); border-color:var(--brand-dark); }
.btn-danger { color:#9b1c1c; }
.controlbar { background:#fff; border:1px solid var(--line); border-radius:12px; padding:14px 16px; display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:20px; box-shadow:var(--shadow); }
.controls-left { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
select { border:1px solid var(--line); background:#fff; border-radius:8px; padding:9px 36px 9px 11px; color:var(--ink); }
.segment { display:inline-flex; padding:3px; border:1px solid var(--line); border-radius:9px; background:#fafafa; }
.segment button { border:0; background:transparent; padding:7px 11px; border-radius:6px; font-size:13px; font-weight:800; color:var(--muted); }
.segment button.active { background:#fff; color:var(--ink); box-shadow:0 1px 3px rgba(16,24,40,.12); }
.hero-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin-bottom:20px; }
.hero-card { background:var(--ink); color:#fff; padding:22px; border-radius:12px; min-height:128px; }
.hero-card .label { color:#cfd5dd; font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; }
.hero-card .number { font-size:40px; font-weight:850; letter-spacing:-.04em; margin-top:8px; }
.hero-card .delta { margin-top:4px; color:#dfe4ea; font-size:13px; }
.section-head { display:flex; justify-content:space-between; align-items:end; margin:28px 0 11px; }
.section-head h2 { margin:0; font-size:17px; letter-spacing:-.01em; }
.section-head p { margin:0; color:var(--muted); font-size:13px; }
.metric-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
.metric-card { background:#fff; border:1px solid var(--line); border-radius:12px; padding:20px; box-shadow:0 1px 2px rgba(16,24,40,.03); }
.metric-card .label { color:var(--muted); font-weight:700; font-size:13px; }
.metric-card .number { margin-top:9px; font-size:31px; letter-spacing:-.035em; font-weight:850; }
.metric-card .foot { margin-top:7px; color:var(--muted); font-size:12px; }
.rate { color:var(--brand); }
.note { margin-top:20px; padding:18px 20px; border-left:4px solid var(--brand); background:#fff; border-radius:0 10px 10px 0; color:#3b4450; }
.note strong { display:block; margin-bottom:4px; color:var(--ink); }
.empty { background:#fff; border:1px dashed #cfd4dc; border-radius:12px; padding:48px 24px; text-align:center; color:var(--muted); }

.login-page { min-height:100vh; display:grid; place-items:center; padding:24px; background:#efece9; }
.login-card { width:min(430px,100%); background:#fff; border:1px solid var(--line); border-radius:16px; padding:34px; box-shadow:var(--shadow); }
.login-card .mark { margin-bottom:22px; }
.login-card h1 { font-size:26px; }
.login-card p { color:var(--muted); line-height:1.5; }
.field { margin-top:17px; }
.field label { display:block; font-size:13px; font-weight:800; margin-bottom:7px; }
.field input, .field textarea { width:100%; border:1px solid #cfd4dc; border-radius:8px; padding:11px 12px; background:#fff; }
.field input:focus, .field textarea:focus { outline:2px solid rgba(124,34,28,.14); border-color:var(--brand); }
.field textarea { min-height:92px; resize:vertical; }
.login-card .btn { width:100%; justify-content:center; margin-top:18px; }
.error { color:#a61b1b; font-size:13px; margin-top:10px; min-height:18px; }

.admin-grid { display:grid; grid-template-columns:1.35fr .65fr; gap:20px; }
.panel { background:#fff; border:1px solid var(--line); border-radius:12px; padding:22px; box-shadow:0 1px 2px rgba(16,24,40,.03); }
.panel h2 { margin:0 0 5px; font-size:18px; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.full { grid-column:1/-1; }
.admin-list { margin-top:14px; }
.admin-row { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:12px 0; border-top:1px solid var(--line); }
.admin-row:first-child { border-top:0; }
.admin-row strong { display:block; font-size:14px; }
.admin-row span { color:var(--muted); font-size:12px; }
.linkbtn { border:0; background:none; padding:4px; color:var(--brand); font-weight:800; font-size:12px; }

.report-page { background:#e9e9e6; padding:28px; }
.report-sheet { width:8.5in; min-height:11in; margin:0 auto; background:#fff; padding:.62in .68in .58in; box-shadow:0 12px 35px rgba(0,0,0,.12); position:relative; }
.report-brand { display:flex; justify-content:space-between; gap:20px; border-bottom:4px solid var(--brand); padding-bottom:18px; }
.report-brand h1 { font-size:27px; }
.report-brand .date { text-align:right; color:var(--muted); font-size:12px; }
.report-intro { margin:22px 0 18px; }
.report-intro h2 { margin:0 0 7px; font-size:20px; }
.report-intro p { margin:0; color:#4b5563; line-height:1.45; }
.report-totals { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin:18px 0 22px; }
.report-total { background:#f2f0ed; padding:16px; border-radius:8px; }
.report-total .n { font-size:28px; font-weight:850; letter-spacing:-.04em; }
.report-total .l { margin-top:3px; font-size:10px; font-weight:850; color:#59616c; text-transform:uppercase; letter-spacing:.07em; }
.report-section { margin-top:18px; }
.report-section h3 { font-size:13px; text-transform:uppercase; letter-spacing:.08em; color:var(--brand); margin:0 0 8px; }
.report-table { width:100%; border-collapse:collapse; }
.report-table td { padding:8px 5px; border-bottom:1px solid #e5e7eb; font-size:13px; }
.report-table td:last-child { text-align:right; font-weight:800; }
.report-donor-note { margin-top:20px; background:#f7f7f5; border-left:3px solid var(--brand); padding:13px 15px; font-size:12px; line-height:1.5; color:#46505c; }
.report-footer { position:absolute; left:.68in; right:.68in; bottom:.42in; display:flex; justify-content:space-between; border-top:1px solid #d8dbe0; padding-top:9px; color:#777f88; font-size:9px; }
.print-controls { width:8.5in; margin:0 auto 12px; display:flex; justify-content:flex-end; gap:8px; }

@media (max-width: 800px) {
  .shell { padding:22px 15px 40px; }
  .topbar, .controlbar { align-items:flex-start; flex-direction:column; }
  .hero-grid, .metric-grid, .admin-grid, .form-grid { grid-template-columns:1fr; }
  .full { grid-column:auto; }
  .actions { width:100%; }
  .hero-card .number { font-size:36px; }
  .report-page { padding:0; }
  .print-controls { width:100%; padding:10px; }
  .report-sheet { width:100%; min-height:0; padding:28px 22px 70px; box-shadow:none; }
  .report-footer { left:22px; right:22px; }
}
@media print {
  @page { size: letter; margin:0; }
  body { background:#fff !important; }
  .print-controls { display:none !important; }
  .report-page { padding:0; background:#fff; }
  .report-sheet { width:8.5in; height:11in; min-height:11in; margin:0; box-shadow:none; }
}
