:root {
  color-scheme: light;
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #111827;
  --muted: #64748b;
  --line: #d8dee8;
  --blue: #2563eb;
  --teal: #0f766e;
  --red: #b42318;
  --amber: #b45309;
  --green: #166534;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid #1d4ed8;
  border-radius: 8px;
  background: var(--blue);
  color: #ffffff;
  padding: 0 14px;
  cursor: pointer;
}

button:hover {
  background: #1d4ed8;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 8px 10px;
}

input:focus {
  outline: 3px solid rgba(37, 99, 235, 0.18);
  border-color: var(--blue);
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #111827;
  color: #f8fafc;
  padding: 24px 18px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 1rem;
}

.brand span {
  color: #cbd5e1;
  font-size: 0.84rem;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-list a {
  min-height: 38px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  color: #dbe4ef;
  padding: 0 10px;
  text-decoration: none;
}

.nav-list a:hover,
.nav-list a.active {
  background: #243044;
  color: #ffffff;
}

.main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 2.1rem;
  line-height: 1.1;
}

h2 {
  font-size: 1.1rem;
}

.eyebrow {
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 800;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.status-pill {
  min-width: 128px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 8px 12px;
  text-align: center;
  font-size: 0.86rem;
  font-weight: 800;
}

.status-pill[data-state="ok"] {
  border-color: rgba(22, 101, 52, 0.25);
  background: #ecfdf3;
  color: var(--green);
}

.status-pill[data-state="bad"] {
  border-color: rgba(180, 35, 24, 0.25);
  background: #fef3f2;
  color: var(--red);
}

.settings-band {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(220px, 1fr) auto auto;
  gap: 12px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  padding: 16px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metrics article,
.workspace {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metrics article {
  min-height: 96px;
  padding: 16px;
}

.metrics span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.metrics strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
  line-height: 1;
}

.workspace {
  margin-bottom: 18px;
  overflow: hidden;
}

.workspace.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 0;
}

.section-head {
  min-height: 72px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 16px;
}

.section-head.compact {
  border-right: 1px solid var(--line);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  background: var(--surface-2);
  color: #334155;
  font-size: 0.78rem;
}

td {
  font-size: 0.88rem;
}

.empty {
  color: var(--muted);
  text-align: center;
}

.severity {
  display: inline-flex;
  min-width: 72px;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.76rem;
  font-weight: 800;
}

.severity.low,
.severity.medium {
  background: #eff6ff;
  color: #1d4ed8;
}

.severity.high {
  background: #fff7ed;
  color: var(--amber);
}

.severity.critical {
  background: #fef3f2;
  color: var(--red);
}

.denylist {
  min-height: 260px;
  list-style: none;
  margin: 0;
  border-right: 1px solid var(--line);
  padding: 8px 16px 16px;
}

.denylist li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.denylist code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.denylist button {
  min-height: 32px;
  border-color: #991b1b;
  background: #b42318;
}

.deny-form {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 16px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  border-radius: 8px;
  background: #111827;
  color: #ffffff;
  padding: 12px 14px;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 12px 16px;
  }

  .brand {
    margin-bottom: 0;
  }

  .nav-list {
    display: flex;
    overflow-x: auto;
  }

  .nav-list a {
    white-space: nowrap;
  }

  .settings-band,
  .metrics,
  .workspace.split {
    grid-template-columns: 1fr;
  }

  .section-head.compact,
  .denylist {
    border-right: 0;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 18px 12px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .sidebar {
    align-items: stretch;
    flex-direction: column;
  }

  .metrics strong {
    font-size: 1.65rem;
  }

  h1 {
    font-size: 1.7rem;
  }
}
