:root {
  --ink: #151816;
  --muted: #66706a;
  --line: #d8ddd6;
  --paper: #f7f8f3;
  --panel: #ffffff;
  --teal: #0e7c73;
  --blue: #295d8f;
  --red: #a33b2f;
  --amber: #a66a12;
  --yellow: #8b7a19;
  --green: #3d7047;
  --charcoal: #222723;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Avenir Next", "Segoe UI", Verdana, sans-serif;
  letter-spacing: 0;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--teal); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 243, 0.96);
  backdrop-filter: blur(10px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: white;
  font-weight: 800;
}
.brand strong { display: block; font-size: 15px; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
}
.nav a {
  padding: 8px 10px;
  border: 1px solid transparent;
  font-size: 13px;
  white-space: nowrap;
}
.nav a.active {
  border-color: var(--line);
  background: var(--panel);
}
.userbar { display: flex; align-items: center; gap: 10px; }
button, .button {
  border: 1px solid var(--charcoal);
  background: var(--charcoal);
  color: #fff;
  padding: 9px 12px;
  font: inherit;
  cursor: pointer;
}
button:hover, .button:hover { background: var(--teal); border-color: var(--teal); color: #fff; }

.page { padding: 24px; max-width: 1500px; margin: 0 auto; }
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 18px;
}
.eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
h1, h2 { margin: 0; line-height: 1.1; }
h1 { font-size: 34px; }
h2 { font-size: 18px; }
h3 { margin: 0 0 10px; font-size: 15px; }
.security-note { max-width: 520px; margin: 0; color: var(--muted); font-size: 14px; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.metric, .panel, .summary-grid > div {
  border: 1px solid var(--line);
  background: var(--panel);
}
.metric { padding: 16px; min-height: 118px; }
.metric span, .summary-grid span { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.metric strong { display: block; margin-top: 10px; font-size: 34px; }
.metric small { color: var(--muted); }
.metric.red { border-top: 4px solid var(--red); }
.metric.amber { border-top: 4px solid var(--amber); }
.metric.blue { border-top: 4px solid var(--blue); }

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.triad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.panel { padding: 16px; margin-bottom: 16px; overflow-x: auto; }
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.panel-head a, .panel-head small { color: var(--muted); font-size: 13px; }

table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}
th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
}
td small { display: block; color: var(--muted); margin-top: 3px; }

.pill {
  display: inline-block;
  min-width: 88px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}
.pill.red { color: var(--red); border-color: #d9aaa3; background: #fff1ef; }
.pill.amber { color: var(--amber); border-color: #dfbd84; background: #fff6e8; }
.pill.yellow { color: var(--yellow); border-color: #d7cf82; background: #fffbe6; }
.pill.green { color: var(--green); border-color: #b5d0ba; background: #eef8f0; }
.pill.done { color: var(--muted); background: #f0f1ee; }
.pill.unknown { color: var(--muted); }

.radar-panel { overflow-x: visible; }
.radar-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.radar-card {
  display: grid;
  gap: 6px;
  min-height: 160px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fbfcf8;
}
.radar-card.red { border-left: 5px solid var(--red); }
.radar-card.amber { border-left: 5px solid var(--amber); }
.radar-card.yellow { border-left: 5px solid var(--yellow); }
.radar-card.green { border-left: 5px solid var(--green); }
.radar-card strong { font-size: 15px; }
.radar-card b { font-size: 13px; }
.radar-card small, .radar-card em, .radar-tag {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}
.radar-card em { line-height: 1.35; }

.progress-list { display: grid; gap: 10px; }
.progress-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 10px;
  border: 1px solid var(--line);
  overflow: hidden;
}
.progress-row i, .bar i {
  display: block;
  height: 4px;
  background: var(--teal);
}
.progress-row i { grid-column: 1 / -1; }
.progress-row small { color: var(--muted); }
.bar { width: 160px; height: 6px; background: #e5e8e0; margin-bottom: 4px; }

.audit-mini { margin: 0; padding: 0; list-style: none; }
.audit-mini li {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.audit-mini span, .audit-mini small { color: var(--muted); }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.summary-grid > div { padding: 14px; }
.summary-grid strong { display: block; margin-top: 5px; overflow-wrap: anywhere; }
.client-score {
  min-width: 150px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.client-score span { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.client-score strong { display: block; font-size: 28px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.facts div { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.facts dt { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.facts dd { margin: 3px 0 0; overflow-wrap: anywhere; }

.search, .channel-form {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}
.service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.stack-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.stack-form button { align-self: end; }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  padding: 9px 10px;
  font: inherit;
}
label { display: grid; gap: 5px; min-width: 180px; color: var(--muted); font-size: 12px; }
.check { display: flex; align-items: center; min-width: auto; color: var(--ink); }
.check input { width: auto; }
.compact-form { overflow-x: visible; }
.inline-form {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-width: 230px;
}
.inline-form select { min-height: 36px; padding: 7px 8px; }
.inline-form button { min-height: 36px; padding: 7px 10px; }
.policy-facts { grid-template-columns: 1fr; }
.plain-list { margin: 10px 0 0; padding-left: 18px; line-height: 1.7; }

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #e8ebe2;
}
.login-shell { width: min(440px, calc(100vw - 32px)); }
.login-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 24px;
}
.login-brand { margin-bottom: 24px; }
.login-form { display: grid; gap: 14px; }
.login-form label { min-width: 0; color: var(--ink); font-size: 13px; }
.login-form button { width: 100%; }
.error { color: var(--red); margin: 0; }
.muted { color: var(--muted); font-size: 13px; }

@media (max-width: 980px) {
  .topbar { grid-template-columns: 1fr; }
  .userbar { justify-content: space-between; }
  .metric-grid, .split, .triad, .summary-grid, .radar-list, .service-grid, .stack-form { grid-template-columns: 1fr; }
  .page-head { display: grid; align-items: start; }
  h1 { font-size: 28px; }
}
