/* FansVilla — Gatehouse (creator-verification console).
   Monochrome, content-first. No neon, no gradients.
   Gold is reserved for VIP/monetization and is intentionally absent here. */

:root {
  --bg: #000000;
  --panel: #0b0b0c;
  --panel-2: #131315;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #ffffff;
  --text-2: #a1a1a6;
  --text-3: #6b6b70;
  --solid: #ffffff;            /* filled surfaces: primary button, approve badge, bars */
  --on-solid: #000000;        /* text on --solid */
  --solid-hover: #e6e6e6;
  --hover: rgba(255, 255, 255, 0.06);
  --topbar: rgba(0, 0, 0, 0.86);
  --scrim: rgba(0, 0, 0, 0.7);
  --danger: #f87171;
  --radius: 14px;
  --radius-sm: 9px;
}

/* Light / white mode — same monochrome system, inverted. No neon, no gradients. */
:root[data-theme="light"] {
  --bg: #ffffff;
  --panel: #f7f7f8;
  --panel-2: #ececee;
  --line: rgba(0, 0, 0, 0.10);
  --line-strong: rgba(0, 0, 0, 0.20);
  --text: #0a0a0a;
  --text-2: #55555b;
  --text-3: #8a8a90;
  --solid: #0a0a0a;
  --on-solid: #ffffff;
  --solid-hover: #2b2b2b;
  --hover: rgba(0, 0, 0, 0.06);
  --topbar: rgba(255, 255, 255, 0.86);
  --scrim: rgba(0, 0, 0, 0.45);
  --danger: #d92d20;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ── Top bar ─────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--topbar);
  backdrop-filter: blur(14px);
  z-index: 5;
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-mark { font-weight: 700; letter-spacing: -0.02em; font-size: 17px; }
.brand-divider { color: var(--text-3); }
.brand-sub { color: var(--text-2); font-size: 13px; }
.topbar-actions { display: flex; gap: 8px; }

.btn {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--solid); color: var(--on-solid); border-color: var(--solid); }
.btn-primary:hover { background: var(--solid-hover); }
.btn-ghost { border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: var(--hover); }
.btn-danger { border-color: rgba(248, 113, 113, 0.4); color: var(--danger); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.1); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.icon-btn {
  background: transparent; border: none; color: var(--text-2);
  font-size: 24px; line-height: 1; cursor: pointer; padding: 2px 8px; border-radius: 8px;
}
.icon-btn:hover { color: var(--text); background: var(--hover); }

/* ── Stats ───────────────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}
.stat { background: var(--bg); padding: 16px 22px; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.stat-label { color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px; }

/* ── Toolbar ─────────────────────────────────────────────── */
.toolbar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 22px; border-bottom: 1px solid var(--line);
}
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab {
  background: transparent; border: 1px solid transparent; color: var(--text-2);
  padding: 7px 14px; border-radius: 999px; font-size: 13px; cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--panel-2); color: var(--text); border-color: var(--line-strong); }
.search {
  margin-left: auto; width: 240px; max-width: 40vw;
  background: var(--panel-2); border: 1px solid var(--line);
  color: var(--text); padding: 9px 14px; border-radius: 999px; font-size: 13px; outline: none;
}
.search:focus { border-color: var(--line-strong); }
.search::placeholder { color: var(--text-3); }

/* ── Layout ──────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  gap: 0;
  height: calc(100vh - 197px);
}
.queue { overflow-y: auto; border-right: 1px solid var(--line); }
.detail { overflow-y: auto; padding: 28px 32px 80px; }
.empty { color: var(--text-3); padding: 40px 0; text-align: center; }

/* ── Queue rows ──────────────────────────────────────────── */
.row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.row:hover { background: var(--panel); }
.row.is-selected { background: var(--panel-2); }
.row-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  object-fit: cover; background: var(--panel-2); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); font-weight: 600; font-size: 15px;
}
.row-main { min-width: 0; }
.row-handle { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { color: var(--text-3); font-size: 12px; margin-top: 3px; }
.row-right { text-align: right; }
.scorering { font-weight: 700; font-size: 16px; }
.row-tier {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em;
  font-weight: 600; color: var(--text-3); margin-bottom: 3px;
}
.badge {
  display: inline-block; margin-top: 5px; padding: 2px 8px; border-radius: 999px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
  border: 1px solid var(--line-strong); color: var(--text-2);
}
.badge.approve, .badge.approved { background: var(--solid); color: var(--on-solid); border-color: var(--solid); }
.badge.reject, .badge.rejected, .badge.revoked { color: var(--danger); border-color: rgba(248,113,113,0.4); }
.badge.review, .badge.pending { color: var(--text-2); }

/* ── Detail ──────────────────────────────────────────────── */
.detail-head { display: flex; gap: 18px; align-items: flex-start; }
.detail-avatar {
  width: 76px; height: 76px; border-radius: 50%; object-fit: cover;
  background: var(--panel-2); border: 1px solid var(--line); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 26px; color: var(--text-2); font-weight: 600;
}
.detail-title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.detail-head-main { min-width: 0; }
.detail-auto { color: var(--text-3); font-size: 12px; }
.detail-sub { color: var(--text-2); margin-top: 4px; }
.detail-sub a { color: var(--text); }
.detail-decision { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

.score-box {
  margin-left: auto; text-align: center; padding: 12px 18px;
  border: 1px solid var(--line-strong); border-radius: var(--radius); min-width: 108px;
}
.score-box .n { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.score-box .l { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); margin-top: 6px; }

.section { margin-top: 30px; }
.section h3 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-3); margin: 0 0 12px; font-weight: 600;
}

.grid-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.field { background: var(--panel); padding: 12px 14px; }
.field .k { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.field .v { margin-top: 5px; font-size: 14px; word-break: break-word; }
.field .v.trunc { max-height: 38px; overflow: hidden; }

.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 46px; gap: 12px; align-items: center; font-size: 12px; }
.bar-row .name { color: var(--text-2); text-transform: capitalize; }
.bar-track { height: 8px; background: var(--panel-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.bar-fill { height: 100%; background: var(--solid); border-radius: 999px; }
.bar-fill.neg { background: var(--danger); }
.bar-row .val { text-align: right; color: var(--text-2); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 5px 11px; border-radius: 999px; font-size: 12px;
  border: 1px solid var(--line-strong); color: var(--text-2); background: var(--panel);
}
.chip.fail { color: var(--danger); border-color: rgba(248,113,113,0.4); }
.chip.warn { color: var(--text); }
.chip.tier { color: var(--text); border-color: var(--line-strong); background: var(--panel-2); font-weight: 600; }

.list { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 13px; line-height: 1.8; }
.list li::marker { color: var(--text-3); }

details.raw { margin-top: 12px; }
details.raw summary { cursor: pointer; color: var(--text-2); font-size: 13px; }
details.raw pre {
  margin-top: 12px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px; overflow: auto; max-height: 340px;
  font-size: 12px; color: var(--text-2); line-height: 1.6;
}

.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.note-input {
  width: 100%; margin-top: 14px; background: var(--panel-2); border: 1px solid var(--line);
  color: var(--text); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; outline: none;
  resize: vertical; min-height: 44px;
}
.note-input:focus { border-color: var(--line-strong); }

.timeline { border-left: 1px solid var(--line); margin-left: 6px; padding-left: 18px; }
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item::before {
  content: ""; position: absolute; left: -23px; top: 5px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--bg); border: 1px solid var(--line-strong);
}
.timeline-item .t { font-size: 13px; }
.timeline-item .d { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: var(--scrim);
  display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 20;
}
/* Author `display: flex` beats the UA `[hidden] { display: none }` rule, so the
 * backdrop stayed visible even when `hidden = true`. Restore the hidden behavior. */
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 18px;
  width: min(680px, 100%); max-height: 88vh; display: flex; flex-direction: column; padding: 22px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h2 { font-size: 17px; margin: 0; }
.modal-hint { color: var(--text-3); font-size: 12.5px; line-height: 1.6; margin: 8px 0 14px; }
.modal-hint code { color: var(--text-2); }
#pasteInput {
  flex: 1; min-height: 240px; background: var(--panel-2); border: 1px solid var(--line);
  color: var(--text); border-radius: var(--radius-sm); padding: 14px; font-family: ui-monospace, monospace;
  font-size: 12px; line-height: 1.55; outline: none; resize: vertical;
}
#pasteInput:focus { border-color: var(--line-strong); }
.paste-error { color: var(--danger); font-size: 13px; margin-top: 10px; }
.modal-foot { display: flex; gap: 10px; align-items: center; margin-top: 16px; }
.spacer { flex: 1; }

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; height: auto; }
  .queue { border-right: none; border-bottom: 1px solid var(--line); max-height: 40vh; }
  .detail { padding: 22px 18px 60px; }
  .search { width: 160px; }
}

/* ── Login gate ──────────────────────────────────────────── */
.gate {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
}
/* Author `display: flex` beats the UA `[hidden] { display: none }` rule, so the
 * gate stayed on screen after a successful login — the console loaded behind it
 * and the UI looked stuck on "Verifying…". Restore the hidden behavior. */
.gate[hidden] { display: none; }
.gate-card {
  width: min(400px, 100%); background: var(--panel);
  border: 1px solid var(--line-strong); border-radius: 18px; padding: 28px;
}
.gate-title { font-size: 20px; margin: 18px 0 6px; letter-spacing: -0.01em; }
.gate-hint { color: var(--text-3); font-size: 13px; line-height: 1.6; margin: 0 0 18px; }
.gate-label {
  display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-3); margin: 14px 0 6px;
}
.gate-row { display: flex; gap: 8px; }
.gate-input {
  flex: 1; min-width: 0; background: var(--panel-2); border: 1px solid var(--line);
  color: var(--text); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; outline: none;
}
.gate-input:focus { border-color: var(--line-strong); }
.gate-msg {
  margin-top: 16px; font-size: 13px; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); color: var(--text-2);
}
.gate-msg.is-error { color: var(--danger); border-color: rgba(248, 113, 113, 0.4); }
.gate-theme { margin-top: 20px; }

/* ── Action key ──────────────────────────────────────────── */
.key-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.key-row label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); }
.key-input {
  flex: 1; min-width: 0; max-width: 320px; background: var(--panel-2); border: 1px solid var(--line);
  color: var(--text); padding: 8px 12px; border-radius: var(--radius-sm); font-size: 13px; outline: none;
}
.key-input:focus { border-color: var(--line-strong); }

/* ── Avatars (photo-first, monogram fallback) ────────────── */
.avatar-img { object-fit: cover; display: block; }
img.row-avatar { width: 42px; height: 42px; border-radius: 50%; }
img.detail-avatar { width: 76px; height: 76px; border-radius: 50%; }

/* ── Toast ───────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--solid); color: var(--on-solid); padding: 10px 18px;
  border-radius: 999px; font-size: 13px; font-weight: 600; z-index: 30;
}
.toast.is-error { background: var(--danger); color: #ffffff; }
