/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --bg:      #0f1117;
  --card:    #1a1d27;
  --input:   #13161f;
  --row:     #1f2235;
  --border:  #2a2f45;
  --muted:   #8890aa;
  --log-bg:  #0b0e18;
  --radius:  10px;
  --accent:  #4c8ef7;
}
[data-bs-theme="light"] {
  --bg:     #f0f2f8;
  --card:   #ffffff;
  --input:  #f5f6fa;
  --row:    #f8f9fc;
  --border: #dee2ef;
  --muted:  #6c757d;
  --log-bg: #1a1d27;
}

/* ── Base ──────────────────────────────────────────────────────────────────── */
body { background: var(--bg); font-size: .875rem; }
.bg-card  { background: var(--card)  !important; border-radius: var(--radius) !important; }
.bg-input { background: var(--input) !important; }
.card     { box-shadow: 0 2px 16px rgba(0,0,0,.2); }

/* ── Navbar ────────────────────────────────────────────────────────────────── */
.navbar { background: var(--card); position: sticky; top: 0; z-index: 200; }

/* ── Tab bar ───────────────────────────────────────────────────────────────── */
.tab-bar { background: var(--card); }
.tab-bar .nav-link {
  color: var(--muted);
  border: none;
  border-bottom: 2px solid transparent;
  padding: .6rem 1.1rem;
  font-size: .83rem;
  font-weight: 500;
  border-radius: 0;
  transition: color .15s, border-color .15s;
}
.tab-bar .nav-link:hover  { color: #fff; border-bottom-color: var(--border); }
.tab-bar .nav-link.active { color: var(--accent); border-bottom-color: var(--accent); background: transparent; }

/* ── Stat cards ────────────────────────────────────────────────────────────── */
.stat-card  { border-radius: var(--radius) !important; }
.stat-num   { font-size: 2rem; font-weight: 700; line-height: 1; }
.stat-lbl   { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 4px; }

/* ── Table ─────────────────────────────────────────────────────────────────── */
.table-head th { background: var(--row); color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; border-color: var(--border); }
.table td, .table th { border-color: var(--border); vertical-align: middle; }
.table-hover tbody tr:hover td { background: var(--row) !important; }
.table { --bs-table-bg: transparent; color: inherit; }

/* ── Status badges ─────────────────────────────────────────────────────────── */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .7rem; font-weight: 600; text-transform: uppercase;
  padding: 3px 9px; border-radius: 20px; letter-spacing: .04em;
}
.status-ok      { background: #1a3d2b; color: #4ade80; }
.status-error   { background: #3d1010; color: #f87171; }
.status-none    { background: #3d2e0a; color: #fbbf24; }
.status-pending { background: #1e3a5f; color: #60a5fa; animation: blink 1.2s infinite; }
.status-loading { background: var(--row); color: var(--muted); }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ── URL cell ──────────────────────────────────────────────────────────────── */
.site-url-cell { font-size: .82rem; word-break: break-all; max-width: 380px; }
.site-perm     { font-size: .65rem; color: var(--muted); }

/* ── Action buttons ────────────────────────────────────────────────────────── */
.btn-action { padding: 3px 8px; font-size: .72rem; }

/* ── Pagination ────────────────────────────────────────────────────────────── */
#pagination-bar { display: flex !important; }
.page-btn       { min-width: 30px; font-size: .75rem; padding: 2px 7px; }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Log console ───────────────────────────────────────────────────────────── */
.log-console {
  background: var(--log-bg); min-height: 500px; max-height: 70vh;
  overflow-y: auto; padding: 14px 16px; font-size: .76rem; line-height: 1.75;
  border-radius: 0 0 var(--radius) var(--radius);
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.log-line  { display: flex; gap: 10px; align-items: flex-start; }
.log-time  { color: #555e7a; flex-shrink: 0; font-size: .68rem; padding-top: 2px; }
.log-badge {
  flex-shrink: 0; font-size: .6rem; padding: 1px 6px; border-radius: 4px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.log-badge.INFO    { background:#1e3a5f; color:#6db3f2; }
.log-badge.SUCCESS { background:#1a3d2b; color:#4ade80; }
.log-badge.WARN    { background:#3d2e0a; color:#fbbf24; }
.log-badge.ERROR   { background:#3d1010; color:#f87171; }
.log-badge.DEBUG   { background:#1e2a3d; color:#7dd3fc; }
.log-text          { color:#c8d0e8; word-break:break-all; }
.log-text.SUCCESS  { color:#4ade80; }
.log-text.ERROR    { color:#f87171; }
.log-text.WARN     { color:#fbbf24; }

/* ── SSE / health indicators ───────────────────────────────────────────────── */
#sse-dot.live       { background:#28a745 !important; }
#sse-dot.offline    { background:#dc3545 !important; }
#health-badge.ok    { background:#28a745 !important; }
#health-badge.fail  { background:#dc3545 !important; }

/* ── Inspector result ──────────────────────────────────────────────────────── */
.result-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); gap: 12px; }
.result-row:last-child { border-bottom: none; }
.result-key { font-size: .75rem; color: var(--muted); flex-shrink: 0; min-width: 160px; }
.result-val { font-size: .82rem; word-break: break-all; text-align: right; }

.verdict-PASS    { color: #4ade80; font-weight: 700; }
.verdict-FAIL    { color: #f87171; font-weight: 700; }
.verdict-NEUTRAL { color: #fbbf24; font-weight: 700; }

/* ── Performance boxes ─────────────────────────────────────────────────────── */
.perf-box  { background: var(--row); border-radius: 8px; padding: 10px; }
.perf-num  { font-size: 1.5rem; font-weight: 700; }
.perf-lbl  { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }

/* ── Modal ─────────────────────────────────────────────────────────────────── */
.modal-content { background: var(--card) !important; }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .site-url-cell { max-width: 200px; }
  .log-console   { min-height: 300px; }
}
