:root {
  --bg: #f6f1e8;
  --card: #ffffff;
  --ink: #141414;
  --ink-soft: #555;
  --line: #e3dccf;
  --accent: #141414;
  --accent-soft: #ebe5d7;
  --ok: #2e7d4f;
  --warn: #b8860b;
  --err: #b3261e;
  --radius: 10px;
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: inherit; }
button { font-family: inherit; }

header.site {
  background: var(--ink);
  color: #f6f1e8;
  padding: 14px 28px;
  display: flex; align-items: center; gap: 24px;
  border-bottom: 4px solid var(--accent-soft);
}
header.site .brand { font-weight: 800; font-size: 20px; letter-spacing: 1px; }
header.site .brand span { opacity: 0.55; font-weight: 500; }
header.site nav { display: flex; gap: 18px; margin-left: 16px; }
header.site nav a {
  color: #f6f1e8; text-decoration: none; padding: 6px 12px;
  border-radius: 6px; font-size: 14px; opacity: 0.75;
}
header.site nav a.active, header.site nav a:hover { opacity: 1; background: rgba(255,255,255,0.08); }
header.site .spacer { flex: 1; }
header.site .asof { font-size: 13px; opacity: 0.7; }

main { padding: 28px; max-width: 1400px; margin: 0 auto; }

h1 { font-size: 28px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 0 0 12px; }
.sub { color: var(--ink-soft); margin-bottom: 24px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.grid { display: grid; gap: 20px; }
.grid.stats { grid-template-columns: repeat(4, 1fr); }
.grid.two { grid-template-columns: 2fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) {
  .grid.stats, .grid.two, .grid.three { grid-template-columns: 1fr; }
}

.stat .label { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-soft); }
.stat .value { font-size: 30px; font-weight: 800; margin-top: 4px; }
.stat .delta { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { font-weight: 600; color: var(--ink-soft); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
tr:hover td { background: var(--accent-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; background: var(--accent-soft); color: var(--ink); margin-right: 4px; }
.chip.ok { background: #d7eadd; color: var(--ok); }
.chip.warn { background: #f5ebd0; color: var(--warn); }
.chip.err { background: #f3d9d6; color: var(--err); }

.btn {
  background: var(--ink); color: #f6f1e8;
  border: 0; padding: 9px 16px; border-radius: 6px; cursor: pointer; font-size: 14px;
}
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn:disabled { opacity: 0.5; cursor: default; }

select, input[type="text"], input[type="url"], input[type="date"], textarea {
  border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px;
  background: var(--card); font-size: 14px; font-family: inherit;
}

.drop {
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 32px; text-align: center; color: var(--ink-soft);
  background: var(--card); cursor: pointer;
}
.drop.hover { border-color: var(--ink); background: var(--accent-soft); }

.muted { color: var(--ink-soft); font-size: 13px; }
.scroll { max-height: 420px; overflow: auto; }

.bar { height: 6px; background: var(--accent-soft); border-radius: 3px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--ink); }
