/* ── Top nav links ────────────────────────────────────────────── */
.header-nav {
  display: flex;
  gap: 4px;
}
.nav-link {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  border-radius: 6px;
  transition: all .15s;
  border: 1px solid transparent;
}
.nav-link:hover { color: white; background: rgba(255,255,255,.12); }
.nav-link.active { color: white; background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.3); }
.nav-logout-btn {
  background: none; border: 1px solid rgba(255,255,255,.25); cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 500;
}
.nav-admin-link { opacity: .55; font-size: 12px; }

/* ── Page container ───────────────────────────────────────────── */
.page-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}
.page-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.page-title   { font-size: 22px; font-weight: 700; color: var(--text); }
.page-subtitle { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.page-title-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ── Scan time control ────────────────────────────────────────── */
.scan-time-control {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
}
.scan-time-label { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.scan-time-input {
  font-size: 13px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  width: 80px;
}

/* ── Add site card ────────────────────────────────────────────── */
.add-site-card { margin-bottom: 16px; }
.add-site-inner { display: flex; align-items: center; gap: 10px; }
.add-site-icon { width: 20px; height: 20px; color: var(--primary); flex-shrink: 0; }
.add-site-input { flex: 1; }
.add-error {
  font-size: 12px;
  color: var(--critical);
  margin-top: 8px;
  padding: 6px 10px;
  background: var(--critical-bg);
  border-radius: 6px;
}

/* ── Scan banner ──────────────────────────────────────────────── */
.scan-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  font-size: 13px;
  color: #1d4ed8;
  margin-bottom: 16px;
}
.spinner-sm {
  width: 18px; height: 18px; flex-shrink: 0;
  border: 2px solid #bfdbfe;
  border-top-color: #1d4ed8;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ── Website list ─────────────────────────────────────────────── */
.website-list { display: flex; flex-direction: column; gap: 12px; }
.loading-placeholder {
  display: flex; align-items: center; gap: 12px;
  padding: 40px;
  color: var(--text-3);
  font-size: 14px;
}

/* ── Website card ─────────────────────────────────────────────── */
.website-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow .15s;
}
.website-card:hover { box-shadow: var(--shadow-md); }
.website-card-inner {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
}
.ws-status-col { display: flex; align-items: center; }
.ws-dot {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
}
.ws-dot.ok     { background: var(--pass); }
.ws-dot.warn   { background: var(--serious); }
.ws-dot.fail   { background: var(--critical); }
.ws-dot.unscan { background: var(--text-3); }

.ws-info { min-width: 0; }
.ws-url {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-meta {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

.ws-counts { display: flex; gap: 6px; flex-wrap: wrap; }
.ws-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Last scan summary bar ────────────────────────────────────── */
.ws-scan-bar {
  padding: 8px 20px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  color: var(--text-2);
}
.ws-scan-bar .scan-in-progress {
  display: flex; align-items: center; gap: 6px;
  color: var(--primary);
}

/* ── Empty state (websites) ───────────────────────────────────── */
.empty-websites {
  text-align: center;
  padding: 60px 40px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}
.empty-websites h3 { font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-websites p  { font-size: 13px; max-width: 400px; margin: 0 auto; }

/* ── Violation detail page ────────────────────────────────────── */
.vd-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
  margin-bottom: 20px;
  padding: 5px 0;
}
.vd-back:hover { text-decoration: underline; }
.vd-back svg { width: 16px; height: 16px; }

.vd-header { margin-bottom: 20px; }
.vd-impact-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.vd-impact-badge.critical { background: var(--critical-bg); color: var(--critical); }
.vd-impact-badge.serious  { background: var(--serious-bg);  color: var(--serious); }
.vd-impact-badge.moderate { background: var(--moderate-bg); color: var(--moderate); }
.vd-impact-badge.minor    { background: var(--minor-bg);    color: var(--minor); }

.vd-title { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.vd-url-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  flex-wrap: wrap;
}
.vd-url-link { color: var(--primary); text-decoration: none; font-weight: 500; }
.vd-url-link:hover { text-decoration: underline; }
.vd-dot { color: var(--text-3); }

/* ── Detail sections ──────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.detail-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.detail-section.full-width { grid-column: 1 / -1; }
.ds-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.ds-header svg { width: 15px; height: 15px; color: var(--primary); }
.ds-body { padding: 16px; }

.wcag-criterion-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.wcag-id-pill {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-light);
  padding: 8px 14px;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
}
.wcag-detail-text .wcag-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.wcag-detail-text .wcag-desc { font-size: 13px; color: var(--text-2); line-height: 1.6; margin-bottom: 8px; }
.wcag-meta-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.wcag-level-pill {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px;
}
.wcag-level-pill.A   { background: #e0f2fe; color: #0369a1; }
.wcag-level-pill.AA  { background: #f3e8ff; color: #7e22ce; }
.wcag-level-pill.AAA { background: #fdf4ff; color: #6b21a8; }
.wcag-principle-pill { font-size: 11px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); padding: 2px 8px; border-radius: 4px; }
.new22-pill { font-size: 10px; font-weight: 700; background: #fef3c7; color: #92400e; padding: 2px 7px; border-radius: 3px; border: 1px solid #fcd34d; }
.wcag-learn-link { font-size: 12px; color: var(--primary); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; }
.wcag-learn-link:hover { text-decoration: underline; }

/* ── Screenshot section ───────────────────────────────────────── */
.screenshot-wrap {
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #f0f0f0;
  margin-bottom: 10px;
  position: relative;
}
.screenshot-wrap img { display: block; width: 100%; height: auto; }
.screenshot-caption { font-size: 11px; color: var(--text-3); }
.no-screenshot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 140px;
  gap: 8px;
  color: var(--text-3);
  font-size: 12px;
  background: var(--surface-2);
  border-radius: 6px;
  margin-bottom: 10px;
}
.no-screenshot svg { width: 32px; height: 32px; }

/* ── Code block ───────────────────────────────────────────────── */
.code-block {
  background: #1e293b;
  color: #e2e8f0;
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 12px;
  line-height: 1.6;
  padding: 12px 14px;
  border-radius: 7px;
  overflow-x: auto;
  white-space: pre;
  margin-bottom: 8px;
}
.code-block.html-snippet { background: #0f172a; }

/* ── Element node list ────────────────────────────────────────── */
.node-list { display: flex; flex-direction: column; gap: 10px; }
.node-item { border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.node-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-2);
}
.node-selector { font-family: monospace; font-size: 11px; color: var(--primary); }
.node-summary { font-size: 11px; color: var(--text-2); padding: 8px 10px; line-height: 1.5; }

/* ── Recommendation ───────────────────────────────────────────── */
.rec-summary { font-size: 13px; color: var(--text-2); line-height: 1.6; margin-bottom: 14px; }
.rec-steps { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.rec-steps li { font-size: 13px; color: var(--text); line-height: 1.5; }
.rec-code-label { font-size: 11px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.rec-resources { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.rec-resource-link {
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
}
.rec-resource-link:hover { background: #dbeafe; }

/* ── Prev / next violation ────────────────────────────────────── */
.vd-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.vd-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
  padding: 7px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  transition: background .12s;
}
.vd-nav-btn:hover { background: #dbeafe; }
.vd-nav-btn svg { width: 16px; height: 16px; }

@media (max-width: 768px) {
  .website-card-inner { grid-template-columns: auto 1fr; }
  .ws-actions { grid-column: 1/-1; }
  .detail-grid { grid-template-columns: 1fr; }
}
