:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --ink: #18211d;
  --muted: #657068;
  --line: #d9ded7;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --amber: #b45309;
  --red: #b42318;
  --green: #146c43;
  --shadow: 0 16px 44px rgba(24, 33, 29, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

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

a {
  color: var(--accent-strong);
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 22px 0 36px;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #15251f;
  color: #eaf7f1;
  flex: 0 0 auto;
}

.brand-title {
  font-weight: 760;
  line-height: 1.1;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.form-panel {
  padding: 18px;
  position: sticky;
  top: 14px;
}

.section-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.12;
  margin-bottom: 8px;
}

h2 {
  font-size: 19px;
  line-height: 1.24;
  margin-bottom: 10px;
}

h3 {
  font-size: 15px;
  line-height: 1.3;
  margin-bottom: 8px;
}

.muted {
  color: var(--muted);
}

.compact-copy {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 18px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.input-row {
  display: flex;
  gap: 8px;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
}

select {
  max-width: 132px;
}

input:focus,
select:focus {
  outline: 2px solid rgba(15, 118, 110, 0.18);
  border-color: var(--accent);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 13px;
  background: var(--accent);
  color: #fff;
  font-weight: 720;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.button:hover,
.button:focus {
  background: var(--accent-strong);
}

.button.secondary {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.button.secondary:hover,
.button.secondary:focus {
  background: #f0f3ef;
}

.button.danger {
  background: var(--red);
}

.button[disabled] {
  opacity: 0.62;
  cursor: wait;
}

.note {
  border-left: 4px solid #d1a01f;
  background: #fff9e8;
  padding: 11px 12px;
  color: #5f4a12;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.status {
  margin-top: 12px;
  min-height: 24px;
  color: var(--muted);
  font-size: 14px;
}

.status.error {
  color: var(--red);
}

.report-panel {
  padding: 18px;
}

.empty-state {
  min-height: 420px;
  display: grid;
  place-items: center;
  padding: 26px;
  color: var(--muted);
  text-align: center;
}

.report-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 124px;
  gap: 14px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.score {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  background: #f8faf7;
}

.score-value {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
}

.score-label {
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
}

.meta-grid,
.sources-grid,
.counts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

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

.cell {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  min-width: 0;
  background: #fbfcfa;
}

.label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.value,
.evidence {
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.section {
  margin-top: 18px;
}

.finding {
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  padding: 13px;
  margin-bottom: 10px;
  background: #fff;
}

.finding.critical {
  border-left-color: var(--red);
}

.finding.high {
  border-left-color: #d97706;
}

.finding.medium {
  border-left-color: #ca8a04;
}

.finding.low {
  border-left-color: #758179;
}

.finding.info {
  border-left-color: var(--accent);
}

.severity {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  color: #fff;
  background: #5d6660;
  font-size: 12px;
  font-weight: 760;
  margin-bottom: 8px;
}

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

.severity.high {
  background: #d97706;
}

.severity.medium {
  background: #a16207;
}

.severity.info {
  background: var(--accent);
}

.evidence-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.evidence-item {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 9px;
  background: #fbfcfa;
  font-size: 13px;
}

.list {
  margin: 0;
  padding-left: 20px;
  line-height: 1.5;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.code-list code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #eef2ef;
  border-radius: 5px;
  padding: 2px 5px;
  overflow-wrap: anywhere;
}

.request-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px auto;
  gap: 8px;
  align-items: end;
}

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

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

th,
td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 10px;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  background: #f4f6f3;
}

.auth-card {
  max-width: 520px;
  margin: 56px auto;
  padding: 22px;
}

.hidden {
  display: none !important;
}

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

  .form-panel {
    position: static;
  }

  .report-head,
  .meta-grid,
  .sources-grid,
  .plan-grid,
  .request-box {
    grid-template-columns: 1fr;
  }

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

  .input-row {
    flex-direction: column;
  }

  select {
    max-width: none;
  }
}

