:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #f0eee9;
  --text: #1b1a17;
  --muted: #6b675e;
  --line: #e2dfd7;
  --accent: #e0482f;
  --accent-ink: #ffffff;
  --ok: #1f7a4d;
  --ok-bg: #e3f3ea;
  --warn: #8a5a00;
  --warn-bg: #fbf0d9;
  --bad: #b3261e;
  --bad-bg: #fbe5e3;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141412; --surface: #1d1c1a; --surface-2: #262522; --text: #f2f0eb; --muted: #a29d92;
    --line: #34322e; --accent: #ff6a4d; --accent-ink: #1b0b07;
    --ok: #6fd3a0; --ok-bg: #173226; --warn: #f0c46a; --warn-bg: #352a12; --bad: #ff8a80; --bad-bg: #3a1a18;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1 { font-size: 26px; letter-spacing: -.02em; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.top-inner { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.brand { font-weight: 800; letter-spacing: -.03em; font-size: 18px; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); transform: rotate(45deg); }
.nav { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.nav a { text-decoration: none; padding: 6px 10px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.on { background: var(--text); color: var(--bg); }
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }

main { max-width: 1180px; margin: 0 auto; padding: 24px 16px 64px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }

/* ---------- cards / grid ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: 1.1fr 1fr; }
.stats { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); margin-bottom: 20px; }
.stat .k { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.stat .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .g2 { grid-template-columns: 1fr; } }

/* ---------- forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 5px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], textarea, select {
  width: 100%; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; border-color: transparent; }
.checks { display: flex; gap: 14px; flex-wrap: wrap; }
.checks label { display: flex; align-items: center; gap: 6px; font-weight: 500; margin: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 15px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 7px; }
.btn.ghost { border-color: transparent; background: transparent; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > input, .row > select { flex: 1; min-width: 120px; }
.inline { display: inline; }

/* ---------- flash / pills ---------- */
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-weight: 500; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--bad-bg); color: var(--bad); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.pill.pending { background: var(--warn-bg); color: var(--warn); }
.pill.approved { background: var(--ok-bg); color: var(--ok); }
.pill.rejected { background: var(--bad-bg); color: var(--bad); }
.pill.paid { background: var(--text); color: var(--bg); }
.pill.off { background: var(--bad-bg); color: var(--bad); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: var(--surface-2); position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td input[type=text], td input[type=number], td select { padding: 6px 8px; font-size: 13px; }
.truncate { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }

/* ---------- clipper today ---------- */
.player { width: 100%; max-height: 70vh; border-radius: var(--radius); background: #000; display: block; aspect-ratio: 9/16; object-fit: contain; }
.caption-box { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.platform-row { border-top: 1px solid var(--line); padding: 14px 0; }
.platform-row:first-of-type { border-top: 0; }
.platform-row .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: 700; }
.steps { margin: 0; padding-left: 20px; color: var(--muted); }
.steps li { margin: 3px 0; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }

.login-wrap { min-height: 80vh; display: grid; place-items: center; }
.login-card { width: 100%; max-width: 380px; }
.pager { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 14px; }
.bar { height: 6px; border-radius: 4px; background: var(--surface-2); overflow: hidden; min-width: 80px; }
.bar > span { display: block; height: 100%; background: var(--accent); }
