* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1a1a1a;
  background: #fafafa;
  margin: 0;
}

nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: #1f2933;
  color: #fff;
}

nav a {
  color: #fff;
  text-decoration: none;
}

nav a:hover {
  text-decoration: underline;
}

nav form {
  margin: 0;
}

nav button {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
}

nav .spacer {
  flex: 1;
}

.nav-badge {
  display: inline-block;
  min-width: 1.1rem;
  margin-left: 0.15rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none !important;
}

main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1.5rem;
}

h1, h2 {
  font-weight: 600;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  margin-bottom: 1.5rem;
}

th, td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #e5e7eb;
  overflow-wrap: anywhere;
}

th {
  background: #f3f4f6;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: #4b5563;
  white-space: nowrap;
}

tr:hover td {
  background: #f9fafb;
}

.scan-stale-row td {
  background: #fffbeb;
}

.scan-stale-row:hover td {
  background: #fef3c7;
}

.scan-stale-summary {
  color: #92400e;
}

.muted-note {
  color: #6b7280;
  font-size: 0.9rem;
}

a {
  color: #2563eb;
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
}

select, button, input[type="submit"] {
  font: inherit;
  padding: 0.3rem 0.5rem;
}

.assign-form select[multiple] {
  min-width: 220px;
  vertical-align: top;
}

.login-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 70vh;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.06);
  padding: 2.5rem 2rem 2rem;
  text-align: center;
}

.login-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: #eff6ff;
  color: #2563eb;
}

.login-card h1 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
}

.login-subtitle {
  margin: 0 0 1.5rem;
  color: #6b7280;
  font-size: 0.9rem;
}

.login-error {
  margin: 0 0 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 0.85rem;
  text-align: left;
}

.login-form {
  text-align: left;
}

.login-field {
  margin-bottom: 1rem;
}

.login-field label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
}

.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font: inherit;
}

.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.login-form button {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.login-form button:hover {
  background: #1d4ed8;
}

.filters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.filters label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.pagination {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
  background: #e5e7eb;
}

.badge.critical, .badge.high { background: #fee2e2; color: #991b1b; }
.badge.medium { background: #fef3c7; color: #92400e; }
.badge.low { background: #dcfce7; color: #166534; }

.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-tile {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 0.75rem 1.25rem;
  min-width: 140px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.85rem;
  color: #6b7280;
}

.overview-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.5rem;
}

.overview-layout .chart-wrap {
  flex: 0 0 auto;
  margin-bottom: 0;
}

.overview-layout .table-scroll {
  flex: 1 1 480px;
  overflow-x: auto;
}

.chart-wrap {
  overflow-x: auto;
  background: #fff;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  color: #4b5563;
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.chart-legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.chart {
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
}

.chart .chart-row-label,
.chart .chart-value,
.chart .chart-axis-label {
  fill: #1a1a1a;
}

.chart .chart-value {
  font-variant-numeric: tabular-nums;
}

.chart .chart-axis-label {
  fill: #6b7280;
  font-size: 11px;
}

.chart .chart-axis-line {
  stroke: #9ca3af;
  stroke-width: 1;
}

.chart .chart-break-guide {
  stroke: #e5e7eb;
  stroke-width: 1;
}

.chart .chart-break-tick line {
  stroke: #9ca3af;
  stroke-width: 1.5;
}

.chart a .chart-row-label {
  fill: #2563eb;
}

.chart a:hover .chart-row-label {
  text-decoration: underline;
}

.chart .chart-bar:hover {
  opacity: 0.85;
}
