:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --rail: #edf2f6;
  --panel: #ffffff;
  --ink: #16202a;
  --muted: #5d6876;
  --line: #d7dee7;
  --blue: #225ee8;
  --green: #177245;
  --amber: #9b5f00;
  --red: #b42318;
  --teal: #0f766e;
  --slate: #334155;
  --shadow: 0 10px 28px rgba(19, 31, 45, 0.08);
}

* {
  box-sizing: border-box;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

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

h1 {
  font-size: 25px;
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

h3 {
  font-size: 14px;
  letter-spacing: 0;
}

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

.shell > *,
.panel,
.content,
.control-rail {
  min-width: 0;
}

.control-rail {
  border-right: 1px solid var(--line);
  background: var(--rail);
  padding: 24px;
}

.content {
  padding: 24px;
}

.stack {
  display: grid;
  gap: 16px;
}

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

.panel,
.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.panel {
  padding: 16px;
  box-shadow: var(--shadow);
}

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

.metric {
  min-height: 92px;
  padding: 14px;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 25px;
  line-height: 1.1;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.status-pill {
  border: 1px solid #b9d7d1;
  border-radius: 999px;
  background: #e9f7f4;
  color: var(--teal);
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 800;
}

.field,
.field-grid {
  display: grid;
  gap: 8px;
}

.field-grid {
  grid-template-columns: 1fr;
}

label {
  color: var(--slate);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  padding: 9px 13px;
  font-weight: 800;
}

button.primary {
  background: var(--blue);
  color: #fff;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

#vendorTableWrap,
#incidentTableWrap {
  max-width: 100%;
  overflow-x: auto;
}

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

th {
  color: var(--slate);
  font-size: 12px;
  text-transform: uppercase;
}

.tag {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 800;
}

.tag.pass {
  background: #e8f7ee;
  color: var(--green);
}

.tag.warn {
  background: #fff3d6;
  color: var(--amber);
}

.tag.fail {
  background: #fdecec;
  color: var(--red);
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.packet {
  min-height: 260px;
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #1f2937;
  margin: 0;
  padding: 14px;
  white-space: pre-wrap;
}

.status-list {
  display: grid;
  gap: 10px;
}

.status-item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 7px;
  background: var(--muted);
}

.pass .dot {
  background: var(--green);
}

.warn .dot {
  background: var(--amber);
}

.fail .dot {
  background: var(--red);
}

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

  .control-rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

@media (max-width: 560px) {
  .control-rail,
  .content {
    padding: 16px;
  }

  .metric-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
