:root {
  color-scheme: light;
  --ink: #182a3a;
  --muted: #4d6072;
  --line: #d8e2e9;
  --surface: #fff;
  --canvas: #f3f6f8;
  --nav: #152b3b;
  --accent: #0b625d;
  --focus: #187a80;
  font-family: "Aptos", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; font-size: 1rem; line-height: 1.5; }
button, input, select { font: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 3.5vw, 2.65rem); line-height: 1.15; letter-spacing: -.035em; }
h2 { font-size: 1.2rem; font-weight: 680; }

.layout { min-height: 100vh; display: grid; grid-template-columns: 14rem minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; padding: 2rem 1.1rem 1.2rem; background: var(--nav); color: #f5f9fc; }
.identity { margin: 0 .85rem 2.5rem; font-size: 1.18rem; font-weight: 740; text-decoration: none; }
.sidebar :focus-visible { outline-color: #84d5cb; }
nav { display: grid; gap: .3rem; }
nav a { display: block; padding: .7rem .85rem; text-decoration: none; border-radius: .45rem; color: #d6e3ec; }
nav a:hover, nav a[aria-current] { background: #264455; color: #fff; }
nav a[aria-current] { box-shadow: inset 3px 0 #78ceb8; font-weight: 650; }
.account { margin-top: auto; min-width: 0; border-top: 1px solid #3a5263; padding: 1rem .85rem 0; display: grid; gap: .4rem; }
.account-name { font-size: .9rem; color: #d6e3ec; overflow-wrap: anywhere; }
.account button { border: 0; color: #fff; background: transparent; padding: .2rem 0; cursor: pointer; justify-self: start; text-decoration: underline; text-underline-offset: .22em; }

.main { min-width: 0; padding: clamp(1.2rem, 4.5vw, 4.5rem); }
.page-heading { margin-bottom: 1.7rem; }
.page-heading p, .empty-state p { margin-top: .55rem; color: var(--muted); }
.panel { border: 1px solid var(--line); border-radius: .7rem; background: var(--surface); }
.run-panel, .empty-state { max-width: 48rem; padding: clamp(1.1rem, 3.2vw, 2rem); }
.run-panel h2 { margin-bottom: 1.3rem; }
.field { display: grid; gap: .36rem; min-width: 0; margin-bottom: 1.2rem; }
.field-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1rem; }
label { font-size: .94rem; font-weight: 640; }
input:not([type="hidden"]), select { width: 100%; min-height: 2.85rem; padding: .62rem .75rem; border: 1px solid #9cadbb; border-radius: .4rem; background-color: var(--surface); color: var(--ink); }
select {
  appearance: none;
  padding-right: 2rem;
  background-image: linear-gradient(45deg, transparent 50%, #426173 50%), linear-gradient(135deg, #426173 50%, transparent 50%);
  background-position: calc(100% - 1.05rem) 50%, calc(100% - .8rem) 50%;
  background-size: .25rem .25rem;
  background-repeat: no-repeat;
}
.panel-footer { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.1rem; border-top: 1px solid var(--line); padding-top: 1.15rem; margin-top: .2rem; }
.panel-footer p { color: var(--muted); font-size: .9rem; }
.primary { border: 0; border-radius: .45rem; color: white; background: var(--accent); padding: .65rem 1.15rem; min-height: 2.8rem; font-weight: 680; cursor: pointer; }
.primary:hover:not(:disabled) { background: #074e49; }
.primary:disabled { background: #dce5e9; color: #506471; cursor: not-allowed; }
.notice { border-left: 3px solid #ab792c; background: #fff5df; padding: .7rem .9rem; margin-bottom: 1.1rem; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: .85rem 1rem; text-align: left; }
th { white-space: nowrap; background: #f7fafb; border-bottom: 1px solid var(--line); font-size: .9rem; }
td.empty-cell { color: var(--muted); text-align: center; padding: 2.5rem 1rem; }

.login { display: grid; place-items: center; min-height: 100vh; padding: 1.25rem; }
.login-panel { width: min(100%, 27rem); padding: clamp(1.35rem, 4vw, 2.1rem); }
.login-panel .product-name { color: var(--accent); font-weight: 680; margin-bottom: .6rem; }
.login-panel h1 { margin-bottom: 1.5rem; font-size: 1.9rem; }
.login-panel .primary { width: 100%; }
.errorlist { color: #a32330; padding-left: 1.2rem; font-size: .95rem; }

@media (max-width: 700px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { padding: .85rem; }
  .identity { margin: .25rem .5rem .8rem; }
  nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  nav a { padding: .55rem .5rem; font-size: .9rem; }
  .account { margin-top: .7rem; padding: .5rem .5rem 0; display: flex; align-items: center; justify-content: space-between; }
}
@media (max-width: 460px) { .field-row { grid-template-columns: 1fr; gap: 0; } }

.nowrap { white-space: nowrap; }
.identifier { font: .82rem ui-monospace, Menlo, monospace; overflow-wrap: anywhere; }
table tbody tr + tr { border-top: 1px solid var(--line); }
table tbody a, .pagination a { color: var(--accent); text-underline-offset: .19em; }
.pagination { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; }
.status { display: inline-block; border-radius: .35rem; padding: .25rem .55rem; font-size: .86rem; font-weight: 730; background: #e8eef2; color: #354b60; }
.status[data-status="READY"], .status[data-status="PRESENT"] { background: #def1e8; color: #185843; }
.status[data-status="NEEDS_REVIEW"], .status[data-status="MISSING"], .status[data-status="OUTDATED"] { background: #fff0d3; color: #755113; }
.report-summary, .finding, .timeline, .reconciliation { max-width: 60rem; padding: clamp(1rem, 3vw, 1.55rem); }
.summary-status, .finding-heading { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.summary-status p { color: var(--muted); }
.run-metadata { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: 1rem; margin: 1rem 0 .1rem; }
.run-metadata dt, .secondary { color: var(--muted); font-size: .9rem; }
.run-metadata dd { margin: .2rem 0 0; font-weight: 650; }
.report-findings, .timeline { max-width: 60rem; margin-top: 1.5rem; }
.report-findings { display: grid; gap: .7rem; }
.finding h3, .reconciliation h3 { margin: 0; font-size: 1.05rem; }
.finding > p, .report-summary .notice { margin-top: .62rem; }
.finding details { margin-top: .8rem; }
details summary { cursor: pointer; color: var(--accent); }
.evidence-list { list-style: none; margin: .65rem 0 0; padding: 0; }
.evidence-list li { border-top: 1px solid var(--line); padding: .65rem 0; }
.measurement { margin-top: .3rem; font-weight: 660; }
blockquote { margin: .4rem 0; padding-left: .65rem; border-left: 2px solid var(--line); }
.timeline ol { list-style: none; margin: .7rem 0 0; padding: 0; }
.timeline li { border-top: 1px solid var(--line); padding: .62rem 0; }
.timeline summary span { margin-left: .65rem; }
.timeline details p { margin: .35rem 0 0 1.1rem; overflow-wrap: anywhere; }
