/* The Websitescraper — dark, calm, professional */
:root {
  --bg:        #0e1320;
  --panel:     #151c2c;
  --panel-2:   #1b2438;
  --line:      #263149;
  --text:      #e6eaf2;
  --muted:     #8d98b0;
  --accent:    #3ecf9e;   /* mint */
  --accent-2:  #2fb386;
  --accent-ink:#06261b;
  --warn:      #f2b84b;
  --bad:       #f06a6a;
  --info:      #6ea8ff;
  --radius:    10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text); font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 22px; margin: 0 0 4px; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 15px; margin: 0 0 12px; font-weight: 600; }
.sub { color: var(--muted); margin: 0 0 14px; max-width: 900px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--panel); border-right: 1px solid var(--line);
  padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 700; font-size: 15px; }
.brand-dot { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), var(--info)); }
.nav-group { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 12px 10px 4px;
  display: flex; justify-content: space-between; width: 100%; background: none; border: 0; cursor: pointer; font-family: inherit; }
.nav-group:hover { color: var(--text); }
.nav-group span { transition: transform .15s; }
.nav-sec.closed .nav-group span { transform: rotate(-90deg); }
.nav-sec.closed .nav-items { display: none; }
.nav a {
  display: flex; align-items: center; justify-content: space-between;
  color: var(--text); padding: 6px 10px; border-radius: 8px; opacity: .85;
}
.nav a:hover { background: var(--panel-2); opacity: 1; }
.nav a.active { background: var(--panel-2); opacity: 1; box-shadow: inset 3px 0 0 var(--accent); }
.soon { font-size: 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 0 6px; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 8px 0; }
.who { font-weight: 600; }
.role { font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }

.main { padding: 22px 26px 50px; max-width: 1500px; width: 100%; min-width: 0; }

/* ---------- cards + forms ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.grid { display: grid; gap: 14px 18px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
input, select, textarea {
  width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 70px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; }
.check input { width: auto; }
.help { font-size: 12px; color: var(--muted); margin-top: 6px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); padding: 8px 14px; border-radius: 8px;
  font: inherit; font-weight: 550; cursor: pointer;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- chips (niches, keywords, tags) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px;
  background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; cursor: pointer; user-select: none;
}
.chip.on { border-color: var(--accent); color: var(--accent); }
.chip.off { opacity: .45; text-decoration: line-through; }
.chip .x { color: var(--muted); font-size: 12px; }
.chip .x:hover { color: var(--bad); }

/* ---------- table ---------- */
.table-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { padding: 6px 9px; border-bottom: 1px solid var(--line); text-align: left; white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
td.num, th.num, td.muted { white-space: nowrap; overflow-wrap: normal; }
th { background: var(--panel-2); color: var(--muted); font-weight: 550; font-size: 12px; position: sticky; top: 0; }
tr:hover td { background: rgba(255,255,255,.02); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11px; border: 1px solid var(--line); }
.pill.ok   { color: var(--accent); border-color: rgba(62,207,158,.4); }
.pill.warn { color: var(--warn); border-color: rgba(242,184,75,.4); }
.pill.bad  { color: var(--bad);  border-color: rgba(240,106,106,.4); }

/* ---------- progress + notices ---------- */
.progress { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.progress > div { height: 100%; background: var(--accent); width: 0; transition: width .3s; }
.notice { padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); margin-bottom: 14px; }
.notice.warn { border-color: rgba(242,184,75,.45); }
.notice.bad  { border-color: rgba(240,106,106,.45); }
.notice.ok   { border-color: rgba(62,207,158,.45); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.stat b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 12px; }

/* ---------- sign in ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth .card { width: 100%; max-width: 380px; padding: 28px; }
.auth .brand { justify-content: center; padding-bottom: 6px; }
.stack > * + * { margin-top: 12px; }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; }
  .nav-group, .side-foot { display: none; }
  .nav-sec.closed .nav-items { display: contents; }
  .main { padding: 20px 16px 48px; }
}

/* ---------- aligned form fields: every box lines up ---------- */
.fields { display: grid; gap: 14px 16px; align-items: end; }
.fields-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fields-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; min-width: 0; }
.field label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field input, .field select { height: 38px; }
.span-2 { grid-column: span 2; }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; }
.kw-box { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
select { height: 38px; }
optgroup { background: var(--panel); color: var(--muted); }
option { color: var(--text); }

details.more { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
details.more summary { cursor: pointer; color: var(--accent); font-weight: 550; list-style: none; user-select: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "▸"; display: inline-block; width: 16px; transition: transform .15s; }
details.more[open] summary::before { transform: rotate(90deg); }
details.more[open] summary { margin-bottom: 14px; }

@media (max-width: 900px) { .fields-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .fields-3, .fields-4 { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } }
.kw-box:empty { display: none; }
/* same alignment for the older grids (Company database filters, etc.) */
.grid { align-items: end; }
.grid > div { display: flex; flex-direction: column; min-width: 0; }
.grid label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid input, .grid select { height: 38px; }

/* ---------- tiny tag pills ---------- */
.tagpill { display: inline-block; font-size: 10.5px; line-height: 16px; padding: 0 6px; margin: 1px 3px 1px 0;
  border-radius: 99px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tagpill.ok { color: var(--accent); border-color: rgba(62,207,158,.45); }
.tagpill.admin { color: var(--info); border-color: rgba(110,168,255,.45); }
.tagpill.more { color: var(--muted); border-style: dashed; }

/* ---------- labeler ---------- */
.lab-top { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.lab-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; }
.lab-player { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.lab-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lab-videos { max-height: 520px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.lab-video { display: flex; gap: 8px; align-items: center; padding: 4px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
.lab-video:hover { background: var(--panel-2); }
.lab-video.on { border-color: var(--accent); }
.lab-video img { width: 96px; height: 54px; object-fit: cover; border-radius: 6px; flex: none; }
.lab-video span { font-size: 12px; line-height: 1.3; }
.lab-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.lab-buttons .btn { min-width: 90px; justify-content: center; }
.lab-buttons .btn kbd { font: 10px var(--font); color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.btn.picked { border-color: var(--accent); color: var(--accent); }
.btn.haram { color: var(--bad); border-color: rgba(240,106,106,.45); }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tabs .btn.on { border-color: var(--accent); color: var(--accent); }
@media (max-width: 900px) { .lab-grid { grid-template-columns: 1fr; } }

/* compact labeler header */
.lab-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: -2px 0 10px; }
.lab-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 12.5px; color: var(--muted); flex: 1; min-width: 0; }
.lab-facts b { color: var(--text); font-weight: 600; }
.lab-tools { display: flex; gap: 6px; margin-left: auto; }
.btn.small-btn { padding: 4px 10px; font-size: 12px; }

/* Team page: one person's permission switches, grouped */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px 24px; }

/* Creator window */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 50; display: flex; justify-content: center; align-items: flex-start; padding: 40px 16px; overflow-y: auto; }
.modal { width: min(980px, 100%); margin: 0; }
.modal h3 { margin: 18px 0 8px; font-size: 14px; }

/* Notes on creators */
.notes { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.note { background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid #e6b450; border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.note a { margin-left: 6px; }
.notebadge { font-size: 11px; margin-left: 6px; cursor: help; }

/* Verification badges: verified bounces get their own colour (reports are the yellow "⚠ bounce?") */
.check { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 99px; border: 1px solid var(--line); white-space: nowrap; }
.check.valid { color: #3ecf9e; border-color: #3ecf9e66; }
.check.invalid { color: #fff; background: #b4235a; border-color: #b4235a; }
.check.catch_all, .check.risky, .check.unknown { color: #9aa4b2; }
textarea.keys { min-height: 34px; height: 34px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 12px; -webkit-text-security: disc; }
textarea.keys:focus { -webkit-text-security: none; height: auto; min-height: 60px; }
details.adv { margin-top: 4px; }
details.adv > summary { cursor: pointer; color: var(--accent); font-size: 13px; width: fit-content; }
