:root {
  --bg: #ffffff;
  --fg: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #0ea5e9;
  --bg-soft: #f8fafc;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  color: var(--fg);
  background: var(--bg);
  margin: 0;
  padding: 24px 32px 48px;
  max-width: 1200px;
}

h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 4px; }

header .meta, footer .meta, .hint {
  color: var(--muted);
  font-size: 12px;
  margin: 4px 0 12px;
}

a { color: var(--accent); }

code {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
  background: var(--bg-soft);
  padding: 1px 4px;
  border-radius: 3px;
}

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 12px 0 16px;
  font-size: 13px;
}

.controls label { display: flex; align-items: center; gap: 6px; }
.controls input, .controls select {
  font: inherit;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
}

.controls button {
  font: inherit;
  padding: 4px 14px;
  background: var(--accent);
  color: white;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.controls button:hover { background: #0284c7; }

.status { color: var(--muted); font-size: 12px; margin-left: auto; }

.banner {
  padding: 12px 16px;
  border-radius: 6px;
  margin: 0 0 16px;
  font-size: 13px;
}

.banner-red {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #7f1d1d;
}

main section { margin-bottom: 28px; }

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}

table thead th {
  text-align: left;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  padding: 6px 8px;
  font-weight: 600;
}

table tbody td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

table tbody tr:hover td { background: #f0f9ff; }

.tag {
  display: inline-block;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
}

.tag-ok { background: #dcfce7; color: #14532d; }
.tag-bad { background: #fee2e2; color: #7f1d1d; }
.tag-pending { background: #fef3c7; color: #78350f; }

/* Funnel */
.funnel-row {
  display: grid;
  grid-template-columns: 180px 1fr 80px;
  gap: 12px;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
}

.funnel-bar {
  height: 22px;
  background: var(--bg-soft);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.funnel-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--green);
  opacity: 0.85;
}

.funnel-fill.pending {
  background: repeating-linear-gradient(
    -45deg, #cbd5e1, #cbd5e1 6px, #e2e8f0 6px, #e2e8f0 12px
  );
}

.funnel-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 12px;
  color: var(--fg);
  z-index: 1;
}

.funnel-pct { text-align: right; color: var(--muted); }

.admin-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  margin: 8px 0 12px;
  font-size: 12px;
  align-items: center;
}
.admin-controls label { display: flex; align-items: center; gap: 4px; }
.admin-controls select { font: inherit; padding: 2px 4px; border: 1px solid var(--line); background: white; border-radius: 3px; }
.admin-controls .status { margin-left: auto; }

#admin-activity .tag-tier-2 { background: #e0f2fe; color: #075985; }
#admin-activity .tag-tier-3 { background: #fef3c7; color: #78350f; }
#admin-activity .tag-tier-4 { background: #fee2e2; color: #7f1d1d; }
#admin-activity .tag-bootstrap { background: #f5f3ff; color: #5b21b6; }

#admin-activity td.reason { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#admin-activity tr:hover td.reason { white-space: normal; overflow: visible; }

.placeholder-note {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  margin: 4px 0;
}
