:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #e2e6ec;
  --ink: #1a1f29;
  --muted: #687385;
  --accent: #1f6feb;
  --ok-bg: #e6f5ec; --ok-ink: #1a7f43;
  --err-bg: #fdecec; --err-ink: #b3261e;
  --warn-bg: #fff5e6; --warn-ink: #8a5a00;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px; line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--panel); border-bottom: 1px solid var(--line);
  padding: 12px 24px;
}
.topbar .brand { font-weight: 700; letter-spacing: 0.02em; }
.topbar .brand small { color: var(--muted); font-weight: 400; margin-left: 8px; }
.topbar nav a { margin-left: 18px; }
.wrap { max-width: 960px; margin: 0 auto; padding: 24px; }
.wrap.narrow { max-width: 720px; }

.flash { padding: 10px 14px; border-radius: 8px; margin: 0 0 10px; }
.flash.ok { background: var(--ok-bg); color: var(--ok-ink); }
.flash.error { background: var(--err-bg); color: var(--err-ink); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-bottom: 18px; }
.panel h2 { font-size: 15px; margin: 0 0 12px; }
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 22px 0 10px; }
.section-title h2 { font-size: 16px; margin: 0; }
.count { color: var(--muted); font-size: 13px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
tr:last-child td { border-bottom: none; }

.badge { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 999px; background: #eef1f5; color: var(--muted); }
.badge.pedigree { background: #eaf0ff; color: #1f4fb0; }
.badge.hidden_gem { background: #eef7ee; color: #2c7a3d; }
.status { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.status.draft { color: var(--muted); }
.status.approved { color: #8a5a00; }
.status.live { color: #1a7f43; }
.status.retired { color: #9aa1ad; }

form.inline { display: inline; }
.btn {
  display: inline-block; font: inherit; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); color: var(--ink);
  padding: 6px 12px; border-radius: 8px;
}
.btn:hover { background: #f0f2f5; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #1a5fd0; }
.btn.danger { color: var(--err-ink); border-color: #f0c4c1; }
.btn.small { padding: 4px 9px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

label.field { display: block; margin: 0 0 14px; }
label.field > span { display: block; font-weight: 500; margin-bottom: 5px; }
label.field small { color: var(--muted); font-weight: 400; }
input[type=text], select, textarea {
  width: 100%; font: inherit; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
textarea { min-height: 80px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checks { display: flex; gap: 20px; margin: 4px 0 14px; }
.checks label { display: flex; align-items: center; gap: 7px; font-weight: 500; }
.checks input { width: auto; }

.split { display: grid; grid-template-columns: 1fr 380px; gap: 22px; align-items: start; }
.preview-col h2 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 10px; }
.gate { border-left: 3px solid var(--line); padding: 4px 0 4px 14px; margin: 0 0 14px; }
.gate.done { border-left-color: #1a7f43; }
.gate.todo { border-left-color: #b3261e; }
.gate h3 { font-size: 13px; margin: 0 0 4px; }
.gate p { margin: 0 0 8px; color: var(--muted); }
.note { background: #f3f5f8; border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.muted { color: var(--muted); }
.empty { color: var(--muted); font-style: italic; padding: 10px; }
.login-card { max-width: 340px; margin: 80px auto; }
