:root {
  --bg-950: #141414;
  --bg-900: #1a1a1a;
  --bg-800: #222222;
  --bg-700: #2c2c2c;
  --ink: hsl(0 0% 88%);
  --muted: hsl(0 0% 64%);
  --accent: #f05010;
  --accent-soft: hsl(17 88% 50% / 0.15);
  --green: #3fca6b;
  --red: #e5484d;
  --amber: hsl(39 90% 58%);
  --border: hsl(0 0% 100% / 0.08);
  --radius: 14px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg-950);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ---------- PIN GATE ---------- */
.gate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 80% -10%, hsl(17 88% 40% / 0.18), transparent 60%),
    var(--bg-950);
  z-index: 50;
}
.gate-card {
  width: 100%;
  max-width: 400px;
  text-align: center;
  background: var(--bg-900);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 32px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.gate-logo { font-size: 30px; font-weight: 800; letter-spacing: -1px; }
.gate-logo-dot { color: var(--accent); }
.gate-title { margin: 14px 0 6px; font-size: 24px; }
.gate-sub { color: var(--muted); margin: 0 0 24px; font-size: 14px; }
#gateForm { display: flex; flex-direction: column; gap: 12px; }
.gate-input {
  background: var(--bg-800);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  font-size: 26px;
  letter-spacing: 10px;
  outline: none;
}
.gate-input:focus { border-color: var(--accent); }
.gate-btn {
  background: linear-gradient(120deg, #f05010, #d05010);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.gate-btn:hover { filter: brightness(1.06); }
.gate-error { color: var(--red); font-size: 13px; margin: 12px 0 0; }
.gate-hint { color: var(--muted); font-size: 12px; margin: 20px 0 0; }

/* ---------- DASHBOARD ---------- */
.dash { max-width: 1200px; margin: 0 auto; padding: 20px 20px 60px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 20px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo { font-size: 26px; font-weight: 800; letter-spacing: -1px; }
.logo-dot { color: var(--accent); }
.brand-name { font-weight: 700; font-size: 18px; }
.brand-tag { color: var(--muted); font-size: 12px; }
.lock-btn {
  background: var(--bg-800);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
}
.lock-btn:hover { background: var(--bg-700); }

.card {
  background: var(--bg-900);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi { position: relative; overflow: hidden; }
.kpi .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.kpi .value { font-size: 30px; font-weight: 800; margin: 6px 0 4px; }
.kpi .note { font-size: 12px; color: var(--muted); min-height: 30px; }
.kpi .note.good { color: var(--green); }
.kpi .note.hot { color: var(--accent); }
.kpi .accent-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--accent), transparent); }

/* Filters */
.filter-row { display: flex; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.filter-row:last-child { margin-bottom: 0; }
.filter-group { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 140px; }
.filter-group label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.filter-group select {
  background: var(--bg-800);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 10px;
  font-size: 14px;
  outline: none;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  background: var(--bg-800);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
}
.chip.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.grid-3 > .filter-group { min-width: 120px; }
.switch-label { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); cursor: pointer; }
.switch-label input { display: none; }
.slider {
  width: 38px; height: 20px; background: var(--bg-700);
  border-radius: 999px; position: relative; transition: background 0.2s;
}
.slider::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  background: #fff; border-radius: 50%; transition: transform 0.2s;
}
.switch-label input:checked + .slider { background: var(--accent); }
.switch-label input:checked + .slider::after { transform: translateX(18px); }

/* Table */
.table-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.table-head h2 { margin: 0; font-size: 17px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.buyer-name { font-weight: 600; }
.buyer-sub { color: var(--muted); font-size: 12px; }
.score { font-weight: 700; }
.score.high { color: var(--green); }
.score.mid { color: var(--amber); }
.pill {
  display: inline-block; font-size: 11px; padding: 3px 9px; border-radius: 999px;
  background: var(--bg-700); color: var(--muted); border: 1px solid var(--border);
}
.pill.scrape { color: var(--ink); }
.pill.meta_paid { color: var(--accent); border-color: var(--accent); }
.pill.landing { color: var(--green); border-color: var(--green); }
.link { color: var(--accent); text-decoration: none; font-size: 13px; }
.link:hover { text-decoration: underline; }
.empty-state { text-align: center; padding: 40px 20px; }
.empty-title { font-size: 18px; font-weight: 700; margin: 0 0 6px; }
.empty-sub { color: var(--muted); margin: 0; }

.foot { display: flex; justify-content: center; gap: 8px; color: var(--muted); font-size: 12px; padding: 20px 0 0; }

@media (max-width: 760px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
