:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-hover: #263548;
  --border: rgba(148, 163, 184, 0.12);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.25);
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.15);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.12);
  --cyan: #22d3ee;
  --radius: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(34, 211, 238, 0.06), transparent);
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.dashboard {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

@media (min-width: 640px) {
  .dashboard {
    padding: 2rem 1.5rem 3rem;
  }
}

.dash-header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1.5rem 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.dash-header__logo {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.dash-header__title {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #f8fafc 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.dash-header__subtitle {
  margin: 0.5rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.dash-header__meta {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 640px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .cards {
    grid-template-columns: repeat(4, 1fr);
  }
}

.metric-card {
  position: relative;
  padding: 1.25rem 1.25rem 1.35rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(99, 102, 241, 0.25);
}

.metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
  opacity: 0.9;
}

.metric-card--total::before {
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
}

.metric-card--covered::before {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

.metric-card--missing::before {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.metric-card--coverage::before {
  background: linear-gradient(90deg, #22d3ee, #6366f1);
}

.metric-card__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  margin-bottom: 0.75rem;
  color: var(--accent);
  background: rgba(99, 102, 241, 0.12);
}

.metric-card--covered .metric-card__icon {
  color: var(--green);
  background: var(--green-dim);
}

.metric-card--missing .metric-card__icon {
  color: var(--red);
  background: var(--red-dim);
}

.metric-card--coverage .metric-card__icon {
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.12);
}

.metric-card__value {
  display: block;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.metric-card__label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.metric-card__hint {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.section-title {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.insights {
  margin-bottom: 2rem;
}

.insights__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.insights__item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  color: #e2e8f0;
}

.insights__item::before {
  content: "→";
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

.insights__item--warn::before {
  color: #fbbf24;
}

.insights__item--danger::before {
  color: var(--red);
}

.charts {
  margin-bottom: 2rem;
}

.charts__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 900px) {
  .charts__grid {
    grid-template-columns: repeat(3, 1fr);
    align-items: stretch;
  }
}

.chart-panel {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.chart-panel__title {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.chart-panel__canvas {
  position: relative;
  flex: 1;
  min-height: 220px;
}

.chart-panel--progress {
  justify-content: center;
}

.progress-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex: 1;
  min-height: 200px;
  padding: 0.5rem 0;
}

.progress-block__track {
  width: 100%;
  max-width: 280px;
  height: 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  overflow: hidden;
}

.progress-block__fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #22d3ee);
  box-shadow: 0 0 20px var(--accent-glow);
  transition: width 0.8s cubic-bezier(0.33, 1, 0.68, 1);
}

.progress-block__label {
  font-size: 1.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.table-section__head {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .table-section__head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .table-section__head .section-title {
    margin: 0;
  }
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn {
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.filter-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.filter-btn.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.45);
  color: #c7d2fe;
}

.table-wrap {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  max-height: min(480px, 55vh);
  overflow-y: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.data-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #162032;
}

.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr.row-covered {
  background: rgba(34, 197, 94, 0.06);
}

.data-table tbody tr.row-covered:hover {
  background: rgba(34, 197, 94, 0.1);
}

.data-table tbody tr.row-missing {
  background: rgba(239, 68, 68, 0.06);
}

.data-table tbody tr.row-missing:hover {
  background: rgba(239, 68, 68, 0.1);
}

.data-table tbody tr.row-placeholder td {
  padding: 1.25rem 1rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
  background: rgba(15, 23, 42, 0.5);
}

.data-table .cell-method {
  font-weight: 600;
  font-size: 0.72rem;
  width: 4.5rem;
}

.data-table .cell-path {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  color: #cbd5e1;
  word-break: break-all;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge--covered {
  background: var(--green-dim);
  color: #86efac;
}

.badge--missing {
  background: var(--red-dim);
  color: #fca5a5;
}

.table-footnote {
  margin: 0.75rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dash-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dash-footer span {
  color: #a5b4fc;
  font-weight: 600;
}
