:root {
  --bg: #f3f6f9;
  --card-bg: #ffffff;
  --text: #2c3e50;
  --muted: #6c757d;
  --border: #d7dde4;
  --status-bg: #ffffff;
}

body[data-theme='dark'] {
  --bg: #111827;
  --card-bg: #1f2937;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: #374151;
  --status-bg: #111827;
}

body {
  background: var(--bg);
  color: var(--text);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.card {
  border-radius: 0;
  background: var(--card-bg);
  color: var(--text);
}

.status-panel {
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 12px;
  background: var(--status-bg);
}

.scan-id {
  font-size: 0.85rem;
}

.table td,
.table th {
  vertical-align: middle;
}

.btn,
.form-control,
.form-select,
.progress,
.card,
.navbar {
  border-radius: 0 !important;
}

body[data-theme='dark'] .table {
  --bs-table-bg: var(--card-bg);
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--border);
  --bs-table-hover-bg: #273549;
  --bs-table-hover-color: #f3f4f6;
}

body[data-theme='dark'] .text-muted {
  color: var(--muted) !important;
}

body[data-theme='dark'] .form-control,
body[data-theme='dark'] .form-select {
  background-color: #111827;
  color: var(--text);
  border-color: var(--border);
}

body[data-theme='dark'] .form-control::placeholder {
  color: #9ca3af;
}

body[data-theme='dark'] .btn-outline-dark {
  color: #e5e7eb;
  border-color: #9ca3af;
}

.scan-score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.5rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.score-good {
  background: #d1fae5;
  border-color: #6ee7b7;
  color: #065f46;
}

.score-fair {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

.score-risk {
  background: #fed7aa;
  border-color: #fb923c;
  color: #9a3412;
}

.score-critical {
  background: #fecaca;
  border-color: #f87171;
  color: #991b1b;
}

.scan-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 1.5rem;
}

.scan-score-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100%;
  border: 1px solid var(--border);
  background: var(--status-bg);
  padding: 1.5rem;
}

.scan-score-value {
  font-size: 3.5rem;
  line-height: 1;
  font-weight: 800;
}

.finding-card {
  border: 1px solid var(--border);
  background: var(--card-bg);
  padding: 1rem;
}

.finding-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.finding-evidence {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--status-bg);
  border: 1px solid var(--border);
  padding: 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.summary-tile {
  border: 1px solid var(--border);
  background: var(--status-bg);
  padding: 1rem;
}

.icon-only-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
}

.icon-only-btn i {
  margin: 0 !important;
}

@media (max-width: 991px) {
  .scan-hero {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }
}