/* DomainRadar — Purple Rocket design tokens */
:root {
  --bg: #f7f7fb;
  --surface: #ffffff;
  --surface-2: #f2f1f8;
  --border: #e4e2ef;
  --text: #17142a;
  --muted: #6b6785;
  --brand: #6d28d9;
  --brand-2: #8b5cf6;
  --brand-soft: #efe9fe;
  --ok: #0f8a5f; --ok-soft: #e3f6ee;
  --warn: #a15c00; --warn-soft: #fdf1dc;
  --bad: #c0352b; --bad-soft: #fde6e4;
  --info: #1d5fbf; --info-soft: #e5eefc;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(23, 20, 42, .06), 0 1px 1px rgba(23, 20, 42, .04);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0d18; --surface: #17142a; --surface-2: #1f1b36; --border: #2c2748; --text: #ecebf5; --muted: #9c97b8;
    --brand: #a78bfa; --brand-2: #c4b5fd; --brand-soft: #2a2150;
    --ok: #4ade9f; --ok-soft: #12322a; --warn: #f5b454; --warn-soft: #3a2c12; --bad: #f87171; --bad-soft: #3d1a1a; --info: #7fb0ff; --info-soft: #172743;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f0d18; --surface: #17142a; --surface-2: #1f1b36; --border: #2c2748; --text: #ecebf5; --muted: #9c97b8;
  --brand: #a78bfa; --brand-2: #c4b5fd; --brand-soft: #2a2150;
  --ok: #4ade9f; --ok-soft: #12322a; --warn: #f5b454; --warn-soft: #3a2c12; --bad: #f87171; --bad-soft: #3d1a1a; --info: #7fb0ff; --info-soft: #172743;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
h1 { font-size: 22px; font-weight: 650; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 13px; font-weight: 600; margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* Shell */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 700; font-size: 16px; color: var(--text); }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: grid; place-items: center; color: #fff; font-size: 14px; }
.brand small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); font-weight: 500; margin-bottom: 2px; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand); }
.nav svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.sidebar-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.sidebar-foot form { display: inline; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 28px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.topbar form.quick { display: flex; gap: 8px; flex: 1; max-width: 460px; }
.content { padding: 24px 28px 48px; max-width: 1480px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* Components */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat .label { color: var(--muted); font-size: 12px; font-weight: 500; }
.stat .value { font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 7px 12px; border-radius: 8px; font: 500 13px var(--font); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand); filter: brightness(1.08); }
.btn-danger { color: var(--bad); }
.btn-sm { padding: 4px 9px; font-size: 12px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], select, textarea {
  border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 7px 10px; font: 13px var(--font); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px 12px; align-items: end; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 12px; font-weight: 500; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip:hover { text-decoration: none; border-color: var(--brand); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 16px 0 10px; flex-wrap: wrap; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: 12.5px; }
.kv dd { margin: 0; word-break: break-word; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

/* Badges */
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge-high, .badge-active, .badge-ok, .badge-confirmed-new-registration, .badge-configured, .badge-available, .badge-mx-valid, .badge-format-valid, .badge-registry-published { background: var(--ok-soft); color: var(--ok); }
.badge-medium, .badge-delegated-no-address, .badge-redirects, .badge-previously-registered, .badge-website-published, .badge-unverified { background: var(--info-soft); color: var(--info); }
.badge-low, .badge-newly-observed, .badge-under-construction, .badge-placeholder, .badge-mail-only, .badge-not-configured, .badge-pending { background: var(--warn-soft); color: var(--warn); }
.badge-unknown, .badge-not-scanned, .badge-not-checked { background: var(--surface-2); color: var(--muted); }
.badge-parked, .badge-unreachable, .badge-no-dns, .badge-not-found, .badge-dead, .badge-removed-from-zone, .badge-not-available, .badge-mx-invalid, .badge-blocked-by-robots { background: var(--bad-soft); color: var(--bad); }

/* Bars */
.bars { display: grid; gap: 7px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 56px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar-track { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 99px; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-weight: 500; }
.flash-success { background: var(--ok-soft); color: var(--ok); }
.flash-error { background: var(--bad-soft); color: var(--bad); }
.flash-warning { background: var(--warn-soft); color: var(--warn); }
.notice { background: var(--brand-soft); color: var(--text); border-radius: 8px; padding: 10px 14px; font-size: 13px; }
.pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 12px; }
pre.raw { background: var(--surface-2); padding: 12px; border-radius: 8px; overflow: auto; max-height: 420px; font: 12px/1.45 var(--mono); }
details summary { cursor: pointer; font-weight: 600; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: 0; }
.key-reveal { font-family: var(--mono); background: var(--surface-2); padding: 10px; border-radius: 8px; word-break: break-all; }

/* Login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth .card { width: 100%; max-width: 380px; padding: 28px; }

@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 10px; }
  .nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .nav a { padding: 6px 8px; font-size: 13px; }
  .sidebar-foot { display: none; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
}
