:root {
  --bg: #f5f5f4; --surface: #ffffff; --surface-2: #f0efed; --text: #1c1917; --muted: #6b6560;
  --border: #e2e0dc; --accent: #d9480f; --accent-text: #ffffff; --ok: #2b8a3e; --warn: #b7791f; --bad: #c92a2a;
  --radius: 10px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #141210; --surface: #1f1c19; --surface-2: #2a2622; --text: #f2efec; --muted: #a39d96;
    --border: #3a352f; --accent: #ff6b2c; --accent-text: #141210; --ok: #51cf66; --warn: #f2b84b; --bad: #ff6b6b; color-scheme: dark; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
button, .btn { font: inherit; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-block; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
button.danger { color: var(--bad); }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; width: 100%; padding: 9px 10px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface); color: var(--text); }
textarea { min-height: 120px; resize: vertical; }
label { display: block; font-size: 13px; color: var(--muted); }
label > input, label > select, label > textarea { margin-top: 4px; color: var(--text); }
.form { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.form .full { grid-column: 1 / -1; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.pill.ok { color: var(--ok); } .pill.warn { color: var(--warn); } .pill.bad { color: var(--bad); }
.stat { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 8px; z-index: 50; max-width: calc(100% - 32px); }
.hidden { display: none !important; }
dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); width: min(640px, calc(100% - 32px)); padding: 20px; }
dialog::backdrop { background: rgba(0,0,0,.4); }
