/* =========================================
   SafeGTM — Admin /#suppressions page (SGM-446)
   All tokens from app.css; zero hardcoded hex values.
   ========================================= */

.sup-page {
  padding: 24px 28px;
}

/* ── Stats row (4 KPI cards) ─────────────────────────────────────────── */
.sup-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.sup-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.sup-stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.sup-stat-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
}
.sup-stat-sub {
  font-size: 11px;
  margin-top: 4px;
  color: var(--text-muted);
}

/* ── Filter bar ──────────────────────────────────────────────────────── */
.sup-filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  align-items: center;
}
.sup-filter-bar input,
.sup-filter-bar select {
  padding: 7px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text);
  font-family: inherit;
  min-height: 32px;
}
.sup-filter-bar input.sup-filter-search { width: 240px; }
.sup-filter-bar select { min-width: 140px; }
.sup-filter-spacer { flex: 1; }
.sup-filter-meta { font-size: 11px; color: var(--text-muted); }

/* ── Data table ──────────────────────────────────────────────────────── */
.sup-table {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 12px;
}
.sup-table-header,
.sup-table-row {
  display: grid;
  grid-template-columns: 240px 130px 100px 130px 110px 130px 90px;
  gap: 12px;
  padding: 10px 14px;
  align-items: center;
}
.sup-table-header {
  background: var(--bg-card-hover);
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.sup-table-row {
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.sup-table-row:hover { background: var(--bg); }
.sup-table-row:last-child { border-bottom: none; }
.sup-email {
  font-family: var(--font-mono, ui-monospace, monospace);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sup-email.is-replaced {
  text-decoration: line-through;
  color: var(--text-muted);
}
.sup-row-meta { font-size: 11px; color: var(--text-muted); }

/* ── Pills ──────────────────────────────────────────────────────────── */
.sup-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.sup-pill--danger { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.sup-pill--warning { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.sup-pill--info { background: var(--info-bg); color: var(--info); border: 1px solid var(--info-border); }
.sup-pill--success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.sup-pill--muted { background: var(--bg-code); color: var(--text-muted); }

/* ── Row actions (icon buttons) ──────────────────────────────────────── */
.sup-row-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}
.sup-row-action {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
}
.sup-row-action:hover {
  background: var(--bg-card-hover);
  color: var(--primary);
  border-color: var(--border);
}
.sup-row-action:disabled { opacity: 0.4; cursor: not-allowed; }
.sup-row-action svg { width: 14px; height: 14px; }

/* ── Modals (manual block + replace contact email) ──────────────────── */
.sup-modal-form .form-row { margin-bottom: 14px; }
.sup-modal-form label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.sup-modal-form input,
.sup-modal-form select,
.sup-modal-form textarea {
  width: 100%;
  padding: 9px 11px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  outline: none;
}
.sup-modal-form textarea { min-height: 60px; resize: vertical; }
.sup-modal-form input:focus,
.sup-modal-form select:focus,
.sup-modal-form textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-bg);
}
.sup-modal-form .is-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-bg);
}
.sup-modal-form .form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.sup-modal-form .form-hint.is-error { color: var(--danger); }

.sup-bad-email-display {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.sup-bad-email-display .lbl {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: inherit;
  margin-bottom: 4px;
}
.sup-bad-email-display .e {
  text-decoration: line-through;
  color: var(--danger);
}
.sup-bad-email-display .r {
  font-family: inherit;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ── Empty state ─────────────────────────────────────────────────────── */
.sup-empty {
  text-align: center;
  padding: 48px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
}
.sup-empty h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 12px 0 6px;
}
.sup-empty p {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 380px;
  margin: 0 auto 16px;
  line-height: 1.55;
}

/* ── Permission banner (when read-only) ─────────────────────────────── */
.sup-permission-banner {
  padding: 12px 16px;
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text);
  margin-bottom: 14px;
}

/* ── SGM-445 PR-F: List/Analysis tab toggle ─────────────────────────── */
.sup-tab-toggle {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 0;
}
.sup-tab-btn {
  padding: 6px 16px;
  background: transparent;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.02em;
}
.sup-tab-btn.active {
  background: var(--primary);
  color: var(--text-inverse);
}

/* ── SGM-445 PR-F: analytics grid + charts ──────────────────────────── */
.sup-analytics-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}
.sup-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow: hidden;
}
.sup-chart-card.col-3  { grid-column: span 3; }
.sup-chart-card.col-4  { grid-column: span 4; }
.sup-chart-card.col-6  { grid-column: span 6; }
.sup-chart-card.col-8  { grid-column: span 8; }
.sup-chart-card.col-12 { grid-column: span 12; }
.sup-chart-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 12px;
}
.sup-chart-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin: -8px 0 12px;
}

/* Horizontal bar list (used for by_reason + by_domain + replacement source) */
.sup-hbar-list { display: flex; flex-direction: column; gap: 8px; }
.sup-hbar-row {
  display: grid;
  grid-template-columns: 120px 1fr 60px;
  gap: 10px;
  align-items: center;
  font-size: 11px;
}
.sup-hbar-label {
  color: var(--text);
  font-family: var(--font-mono, ui-monospace, monospace);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sup-hbar-track {
  background: var(--bg);
  height: 14px;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.sup-hbar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
}
.sup-hbar-fill.danger  { background: var(--danger); }
.sup-hbar-fill.warning { background: var(--warning); }
.sup-hbar-fill.accent  { background: var(--accent); }
.sup-hbar-fill.muted   { background: var(--text-dim); }
.sup-hbar-value {
  font-weight: 700;
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Stacked horizontal bar (sender stress) */
.sup-hbar-track.stacked { display: flex; }
.sup-hbar-track.stacked .seg { height: 100%; }
.sup-hbar-track.stacked .seg.bounce { background: var(--danger); }
.sup-hbar-track.stacked .seg.spam   { background: var(--warning); }
.sup-hbar-track.stacked .seg.unsub  { background: var(--primary); }

/* Legend row (under stacked bar + timeseries) */
.sup-legend-row {
  display: flex;
  gap: 16px;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 8px;
}
.sup-legend-row .dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; margin-right: 4px; vertical-align: middle;
}

/* Donut (reason breakdown) */
.sup-donut-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
}
.sup-donut {
  width: 120px; height: 120px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}
.sup-donut::after {
  content: "";
  position: absolute;
  inset: 28px;
  background: var(--bg-card);
  border-radius: 50%;
}
.sup-donut-legend { flex: 1; }
.sup-donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
}
.sup-donut-legend-item:last-child { border-bottom: none; }
.sup-donut-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.sup-donut-legend-label { flex: 1; }
.sup-donut-legend-value {
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Progress bar (replacement rate) */
.sup-progress-numbers {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 4px 0 8px;
}
.sup-progress-current {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--success);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.sup-progress-total { font-size: 14px; color: var(--text-muted); }
.sup-progress-track {
  background: var(--bg);
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 6px;
}
.sup-progress-fill {
  background: var(--success);
  height: 100%;
}

/* Timeseries (30-day daily bars: added vs replaced) */
.sup-timeseries {
  height: 140px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  padding: 8px 0 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.sup-ts-col {
  flex: 1;
  display: flex;
  flex-direction: column-reverse;
  gap: 1px;
  min-width: 4px;
}
.sup-ts-col .added {
  background: var(--danger);
  border-radius: 2px 2px 0 0;
}
.sup-ts-col .replaced {
  background: var(--success);
  border-radius: 2px 2px 0 0;
  opacity: 0.85;
}
.sup-ts-xaxis {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── SGM-451: Date preset chip buttons in the filter bar ──────────────── */
.sup-date-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  font-family: inherit;
}
.sup-date-btn:hover {
  background: var(--bg-hover, color-mix(in srgb, var(--primary) 8%, var(--bg-card)));
  color: var(--text);
}
.sup-date-btn.active {
  background: color-mix(in srgb, var(--primary) 14%, var(--bg-card));
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
  font-weight: 600;
}

/* ── SGM-451: Row hover affordance — row click opens detail modal ─────── */
.sup-table-row[data-sup-action="row-open-detail"]:hover {
  background: color-mix(in srgb, var(--primary) 4%, var(--bg-card));
}
.sup-table-row[data-sup-action="row-open-detail"] {
  transition: background 0.1s;
}

/* ── SGM-451: Row detail modal ────────────────────────────────────────── */
.sup-detail-modal {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 4px;
}
.sup-detail-section {
  background: var(--bg-input, var(--bg-card));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}
.sup-detail-section-title {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.sup-detail-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  padding: 4px 0;
  font-size: 13px;
  align-items: start;
}
.sup-detail-row + .sup-detail-row {
  border-top: 1px dashed var(--border);
  padding-top: 6px;
  margin-top: 2px;
}
.sup-detail-row .lbl {
  color: var(--text-muted);
  font-size: 12px;
  padding-top: 2px;
}
.sup-detail-row .val {
  color: var(--text);
  word-break: break-word;
}
.sup-detail-row .val code {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 12px;
  background: color-mix(in srgb, var(--text) 5%, transparent);
  padding: 2px 6px;
  border-radius: 4px;
}
.sup-detail-note {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}
