/* ────────────────────────────────────────────────────────────────
   blacklist-page-v2.css — Blacklist Monitor V2 widgets only.
   INBOX-185 Phase C1 · 2026-05-01

   Chrome (sidebar / page-header / detail-card / domain pill / btn /
   provider-head / body-pad / toolbar) lives in postmaster-page-v2.css
   and is reused verbatim. This file adds only what's unique to the
   Blacklist page:
     • Status hero (big numeral + 3-cell strip)
     • Editorial section labels
     • Coverage dot strip (.bl-cov)
     • Sending Domain featured panel
     • Sending IPs data table (with coverage column)
     • DNSBL coverage 4-cell strip

   Page-prefix `.bl-*` so widgets can't collide with `.pm-*`/`.snd-*`.
   ──────────────────────────────────────────────────────────────── */

/* ──── Color token aliases ──────────────────────────────────────
   The mockup was built with `--success` / `--danger` / `--warn`
   semantic tokens, but the production app palette (defined inline
   in microsoft.html / postmaster.html and reused via postmaster-
   page-v2.css) uses `--green` / `--red` / `--yellow`. Without these
   aliases every reference resolves to nothing and dots / badges /
   gradients render as transparent rgba(0,0,0,0). Aliases keep the
   semantic names readable in this file while binding to whatever
   the host page's palette actually defines. */
:root {
  --success: var(--green);
  --success-text: var(--green);
  --success-soft: var(--green-bg);
  --danger: var(--red);
  --danger-soft: var(--red-bg);
  --warn: var(--yellow);
  --warn-text: var(--yellow);
  --warn-soft: var(--yellow-bg);
}

/* ══════ STATUS HERO ══════ */
.bl-hero {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 1.4fr;
  gap: 0;
  background: linear-gradient(180deg, var(--success-soft) 0%, transparent 90%), var(--surface);
  border: 1px solid var(--success);
  border-radius: 14px;
  overflow: hidden;
}
.bl-hero.state-warn {
  background: linear-gradient(180deg, var(--warn-soft) 0%, transparent 90%), var(--surface);
  border-color: var(--warn);
}
.bl-hero.state-danger {
  background: linear-gradient(180deg, var(--danger-soft) 0%, transparent 90%), var(--surface);
  border-color: var(--danger);
}

.bl-hero-numeral {
  padding: 26px 30px;
  border-right: 1px solid var(--success);
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
}
.bl-hero.state-warn .bl-hero-numeral {
  border-right-color: var(--warn);
}
.bl-hero.state-danger .bl-hero-numeral {
  border-right-color: var(--danger);
}

.bl-hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  color: var(--success-text); text-transform: uppercase;
  margin-bottom: 6px;
}
.bl-hero-eyebrow .check {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--success); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.bl-hero-eyebrow .check svg { width: 10px; height: 10px; }
.bl-hero.state-warn .bl-hero-eyebrow {
  color: var(--warn-text);
}
.bl-hero.state-warn .bl-hero-eyebrow .check {
  background: var(--warn);
}
.bl-hero.state-danger .bl-hero-eyebrow {
  color: var(--danger);
}
.bl-hero.state-danger .bl-hero-eyebrow .check {
  background: var(--danger);
}

.bl-hero-num {
  font-family: 'Geist Mono', monospace;
  font-size: 60px; font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--success-text);
  font-variant-numeric: tabular-nums;
}
.bl-hero.state-warn .bl-hero-num {
  color: var(--warn-text);
}
.bl-hero.state-danger .bl-hero-num {
  color: var(--danger);
}

.bl-hero-num .of {
  color: var(--fg-4);
  font-size: 26px;
  font-weight: 500;
  margin-left: 6px;
}

.bl-hero-num-meta {
  font-size: 13px; color: var(--fg-2);
  margin-top: 6px;
}
.bl-hero-num-meta strong { color: var(--fg); font-weight: 600; }

.bl-hero-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.bl-hero-cell {
  padding: 20px 22px;
  border-right: 1px solid var(--success);
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
}
.bl-hero.state-warn .bl-hero-cell {
  border-right-color: var(--warn);
}
.bl-hero.state-danger .bl-hero-cell {
  border-right-color: var(--danger);
}
.bl-hero-cell:last-child { border-right: none; }

.bl-hero-cell-label {
  font-size: 11px; font-weight: 600;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.bl-hero-cell-value {
  font-size: 15px; font-weight: 600;
  color: var(--fg);
  line-height: 1.3;
  letter-spacing: -0.015em;
}
.bl-hero-cell-value.success { color: var(--success-text); }
.bl-hero-cell-value.warn { color: var(--warn-text); }
.bl-hero-cell-value.danger { color: var(--danger); }

/* ──────────────────────────────────────────────────────────
   State-aware icon swaps. Hero eyebrow + sending-domain icon
   each ship 3 SVGs (.icon-check / .icon-warn / .icon-danger).
   The default is .icon-check; CSS swaps which is visible based
   on the parent state class (.bl-hero.state-warn /.state-danger
   for the eyebrow, .bl-domain-icon.is-listed for the domain).
   This keeps the JS to one classList toggle and avoids inner-
   HTML rewrites which fight the FOUC-killing head script.
   ────────────────────────────────────────────────────────── */

/* Hero eyebrow icon swap */
.bl-hero-eyebrow .icon-warn,
.bl-hero-eyebrow .icon-danger { display: none; }
.bl-hero.state-warn   .bl-hero-eyebrow .icon-check,
.bl-hero.state-warn   .bl-hero-eyebrow .icon-danger { display: none; }
.bl-hero.state-warn   .bl-hero-eyebrow .icon-warn   { display: block; }
.bl-hero.state-danger .bl-hero-eyebrow .icon-check,
.bl-hero.state-danger .bl-hero-eyebrow .icon-warn   { display: none; }
.bl-hero.state-danger .bl-hero-eyebrow .icon-danger { display: block; }

/* Sending-domain icon swap (clean → red ✕ when listed) */
.bl-domain-icon .icon-danger { display: none; }
.bl-domain-icon.is-listed {
  background: var(--danger-soft);
  color: var(--danger);
}
.bl-domain-icon.is-listed .icon-check  { display: none; }
.bl-domain-icon.is-listed .icon-danger { display: block; }

.bl-hero-cell-sub {
  font-size: 11px; color: var(--fg-3);
}

/* ══════ EDITORIAL SECTION LABELS ══════ */
.bl-section-label {
  font-size: 11px; font-weight: 600;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 36px 0 14px;
  display: flex; align-items: baseline; gap: 10px;
  justify-content: space-between;
}
.bl-section-label-left { display: flex; align-items: baseline; gap: 10px; }
.bl-section-label .meta {
  font-size: 12px; font-weight: 500;
  color: var(--fg-3);
  letter-spacing: 0;
  text-transform: none;
}
.bl-section-label .count {
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

/* ══════ COVERAGE STRIP (20 dots, reused on domain panel + table rows) ══════ */
.bl-cov {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  flex-wrap: nowrap;
}
.bl-cov-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  transition: transform 100ms ease;
  cursor: help;
}
.bl-cov-dot:hover { transform: scale(1.6); }
.bl-cov-dot.listed { background: var(--danger); }
.bl-cov-dot.unchecked {
  background: transparent;
  border: 1px dashed var(--border-strong);
}

.bl-cov.lg .bl-cov-dot { width: 10px; height: 10px; }
.bl-cov-labels {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  gap: 3px;
  font-family: 'Geist Mono', monospace;
  font-size: 9px;
  color: var(--fg-4);
  margin-top: 4px;
  letter-spacing: -0.02em;
}
.bl-cov-labels span { text-align: center; line-height: 1.1; }

/* ══════ DOMAIN FEATURED PANEL ══════ */
.bl-domain-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 28px;
  transition: border-color 120ms ease;
}
.bl-domain-panel:hover { border-color: var(--border-strong); }

.bl-domain-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.bl-domain-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.bl-domain-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--success-soft);
  color: var(--success-text);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.bl-domain-icon svg { width: 18px; height: 18px; }

.bl-domain-name {
  font-family: 'Geist Mono', monospace;
  font-size: 18px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.015em;
}
.bl-domain-sub {
  font-size: 12px; color: var(--fg-3);
  margin-top: 1px;
}

.bl-status-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.bl-status-badge.clean {
  background: var(--success-soft);
  color: var(--success-text);
}
.bl-status-badge.listed {
  background: var(--danger-soft);
  color: var(--danger);
}
.bl-status-badge .ind {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor;
}

.bl-domain-cov-row {
  display: flex; align-items: center; gap: 16px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
}
.bl-cov-eyebrow {
  font-size: 11px; font-weight: 600;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

/* ══════ DATA TABLE ══════ */
.bl-table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.bl-table { width: 100%; border-collapse: collapse; }
.bl-table thead th {
  text-align: left;
  font-size: 11px; font-weight: 600;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 14px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.bl-table thead th:first-child { padding-left: 22px; }
.bl-table thead th:last-child { padding-right: 22px; text-align: right; }
.bl-table tbody td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--fg-2);
  vertical-align: middle;
}
.bl-table tbody tr:last-child td { border-bottom: none; }
.bl-table tbody tr { transition: background 100ms ease; }
.bl-table tbody tr:hover { background: var(--surface-2); }
.bl-table td:first-child { padding-left: 22px; }
.bl-table td:last-child { padding-right: 22px; text-align: right; color: var(--fg-3); font-variant-numeric: tabular-nums; }

.bl-table .ip-cell {
  font-family: 'Geist Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  white-space: nowrap;
}
.bl-table .pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.bl-table .pill.success { background: var(--success-soft); color: var(--success-text); }
.bl-table .pill.success .ind { background: var(--success); }
.bl-table .pill.danger { background: var(--danger-soft); color: var(--danger); }
.bl-table .pill.danger .ind { background: var(--danger); }
.bl-table .pill .ind { width: 6px; height: 6px; border-radius: 50%; }

.bl-table tr.is-listed { background: linear-gradient(180deg, var(--danger-soft) 0%, transparent 80%), var(--surface); }
.bl-table tr.is-listed:hover { background: linear-gradient(180deg, var(--danger-soft) 0%, transparent 80%), var(--surface-2); }

.bl-table .listing-chip {
  display: inline-flex; align-items: center;
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: var(--danger);
  background: rgba(185, 28, 28, 0.08);
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: 6px;
}

/* ══════ DOMAIN DETAIL CONTAINER ══════ */
.bl-domain-detail-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
  overflow: hidden;
  margin-bottom: 20px;
}

.bl-listing-details {
  width: 100%;
  border-collapse: collapse;
}
.bl-listing-details tr {
  background: var(--surface-2);
  transition: background 100ms ease;
}
.bl-listing-details tr:hover {
  background: var(--surface-3);
}
.bl-listing-details td {
  padding: 6px 12px;
  font-size: 12px;
  color: var(--fg-2);
}

/* ══════ TOOLBAR (search / filter / sort) ══════ */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.search-input {
  flex: 1; min-width: 240px;
  height: 36px;
  padding: 0 14px 0 38px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>") no-repeat 12px center;
  font-size: 13px; color: var(--fg);
  font-family: inherit;
  transition: border-color 100ms ease;
}
.search-input:hover { border-color: var(--fg); }
.search-input:focus { outline: none; border-color: var(--fg); }
.filter-select, .sort-select {
  appearance: none; -webkit-appearance: none;
  height: 36px;
  padding: 0 32px 0 14px;
  background: var(--surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") no-repeat right 11px center;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 13px; color: var(--fg); font-weight: 500;
  cursor: pointer; font-family: inherit;
  flex-shrink: 0;
}
.filter-select:hover, .sort-select:hover { border-color: var(--fg); }

/* ══════ DNSBL COVERAGE STRIP (4-cell) ══════ */
.bl-dnsbl-strip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
}
.bl-dnsbl-cell {
  padding: 22px 24px;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.bl-dnsbl-cell:last-child { border-right: none; }

.bl-dnsbl-count {
  font-family: 'Geist Mono', monospace;
  font-size: 30px;
  font-weight: 600;
  color: var(--fg);
  line-height: 1;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}
.bl-dnsbl-count .of {
  color: var(--fg-4);
  font-size: 16px;
  font-weight: 500;
  margin-left: 4px;
}
.bl-dnsbl-cat {
  font-size: 13px; font-weight: 600;
  color: var(--fg);
  margin-top: 4px;
}
.bl-dnsbl-list {
  font-size: 12px;
  color: var(--fg-3);
  line-height: 1.55;
  font-family: 'Geist Mono', monospace;
  margin-top: 2px;
}

/* ══════ MOBILE ══════ */
@media (max-width: 1024px) {
  .bl-hero { grid-template-columns: 1fr; }
  .bl-hero-numeral { border-right: none; border-bottom: 1px solid var(--success); }
  .bl-hero.state-warn .bl-hero-numeral { border-bottom-color: var(--warn); }
  .bl-hero.state-danger .bl-hero-numeral { border-bottom-color: var(--danger); }
  .bl-dnsbl-strip { grid-template-columns: 1fr 1fr; }
  .bl-dnsbl-cell { border-right: none; border-bottom: 1px solid var(--border); }
  .bl-dnsbl-cell:nth-child(odd) { border-right: 1px solid var(--border); }
  .bl-dnsbl-cell:nth-last-child(-n+2) { border-bottom: none; }
}
@media (max-width: 880px) {
  .bl-hero-strip { grid-template-columns: 1fr; }
  .bl-hero-cell { border-right: none; border-bottom: 1px solid var(--success); }
  .bl-hero.state-warn .bl-hero-cell { border-bottom-color: var(--warn); }
  .bl-hero.state-danger .bl-hero-cell { border-bottom-color: var(--danger); }
  .bl-hero-cell:last-child { border-bottom: none; }
  .bl-dnsbl-strip { grid-template-columns: 1fr; }
  .bl-dnsbl-cell { border-right: none !important; border-bottom: 1px solid var(--border); }
  .bl-dnsbl-cell:last-child { border-bottom: none; }
  .bl-hero-num { font-size: 44px; }
  .bl-dnsbl-count { font-size: 24px; }
  .bl-table thead th, .bl-table td { padding: 12px 14px; }
  .bl-table .cov-cell { display: none; }
  .bl-domain-cov-row { flex-direction: column; align-items: flex-start; gap: 10px; }
}

html[data-theme="dark"] {
  /* Dark mode overrides for hero gradient + border colors */
  .bl-hero {
    background: linear-gradient(180deg, rgba(38, 217, 120, 0.12) 0%, transparent 90%), var(--surface);
    border-color: rgba(38, 217, 120, 0.3);
  }
  .bl-hero.state-warn {
    background: linear-gradient(180deg, rgba(245, 166, 35, 0.12) 0%, transparent 90%), var(--surface);
    border-color: rgba(245, 166, 35, 0.3);
  }
  .bl-hero.state-danger {
    background: linear-gradient(180deg, rgba(248, 113, 113, 0.12) 0%, transparent 90%), var(--surface);
    border-color: rgba(248, 113, 113, 0.3);
  }
  .bl-hero-numeral,
  .bl-hero.state-warn .bl-hero-numeral,
  .bl-hero.state-danger .bl-hero-numeral {
    border-right-color: inherit;
  }
  .bl-hero-cell,
  .bl-hero.state-warn .bl-hero-cell,
  .bl-hero.state-danger .bl-hero-cell {
    border-right-color: inherit;
  }
}
