:root {
  --ink: #17303a;
  --muted: #5d717b;
  --line: #d5e0e6;
  --paper: #f4f7f8;
  --white: #ffffff;
  --navy: #123044;
  --navy-deep: #0d2433;
  --teal: #0f6e66;
  --teal-dark: #0c5a54;
  --danger: #9c2f2f;
  --sidebar: 248px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  background: var(--paper);
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

a { color: inherit; }

button, input { font: inherit; }

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  background: var(--navy);
  color: #d7e5ed;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  padding: 22px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-kicker,
.nav-group,
.panel-kicker {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand-kicker { color: #8fd0c8; }

.brand-name {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  font-weight: 650;
  color: #fff;
}

.side-nav {
  padding: 16px 12px 24px;
  overflow: auto;
}

.nav-group {
  margin: 14px 8px 6px;
  color: #8aa0ad;
}

.side-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0;
  padding: 9px 10px;
  border-radius: 8px;
  color: #d7e5ed;
  text-decoration: none;
}

.nav-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

.nav-link.is-active {
  background: #1b4c48;
  color: #fff;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 68px;
  padding: 12px 28px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.topbar-title {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
}

.sidebar-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 8px;
  padding: 6px 10px;
}

.account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.account-text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}

.account-name { font-weight: 650; }

.account-id {
  color: var(--muted);
  font-size: 13px;
}

.sign-out,
.btn-quiet,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 7px 14px;
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid transparent;
}

.sign-out,
.btn-quiet {
  color: var(--teal-dark);
  background: #fff;
  border-color: #b7d5d1;
}

.sign-out:hover,
.btn-quiet:hover { background: #f3faf8; }

.btn-primary {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
  cursor: pointer;
}

.btn-primary:hover { background: var(--teal-dark); }

.content { padding: 28px; }

.page-lead,
.panel-lead,
.form-lead {
  margin: 0 0 18px;
  max-width: 68ch;
  color: var(--muted);
}

.screen-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.screen-list a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 124px;
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
}

.screen-list a:hover { border-color: #9fc7c2; }

.screen-label { font-weight: 650; }

.screen-copy { color: var(--muted); }

.panel {
  max-width: 720px;
  padding: 22px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.panel.narrow { max-width: 460px; }

.panel-kicker { color: var(--teal-dark); margin-bottom: 8px; }

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}

.login-body { background: var(--navy-deep); }

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
}

.login-screen:not(:has(.login-intro)) {
  grid-template-columns: 1fr;
}

.login-intro {
  color: #e7f1f4;
  padding: 64px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-intro h1 {
  margin: 10px 0 12px;
  font-size: 42px;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.login-intro p {
  margin: 0;
  max-width: 36ch;
  color: #b7c9d2;
  font-size: 18px;
}

.login-panel {
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.login-form {
  width: min(100%, 400px);
}

.login-form h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  font-weight: 600;
}

.field input {
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #c5d2d8;
  border-radius: 8px;
  background: #fff;
  font-weight: 450;
}

.field input:focus {
  outline: 2px solid rgba(15, 110, 102, 0.35);
  border-color: var(--teal);
}

.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 18px;
  color: var(--ink);
  font-weight: 450;
}

.login-form .btn-primary { width: 100%; }

.validation-summary-valid { display: none; }

.validation-summary {
  margin-bottom: 14px;
  color: var(--danger);
}

.validation-summary ul {
  margin: 0;
  padding-left: 18px;
}

.field-error {
  color: var(--danger);
  font-size: 13px;
  font-weight: 450;
}

.field-error:empty { display: none; }

.request-id { color: var(--muted); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.toolbar label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.toolbar input,
.toolbar select {
  min-height: 38px;
  min-width: 180px;
  padding: 6px 10px;
  border: 1px solid #c5d2d8;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 450;
}

.toolbar input:focus,
.toolbar select:focus {
  outline: 2px solid rgba(15, 110, 102, 0.35);
  border-color: var(--teal);
}

.result-count {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
}

.table-wrap,
.sheet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.table-wrap { overflow: auto; }

.sheet {
  padding: 18px 20px;
  margin-bottom: 14px;
}

table.data {
  width: 100%;
  border-collapse: collapse;
}

table.data th,
table.data td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

table.data th {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
  background: #fbfcfd;
}

table.data tr:last-child td { border-bottom: 0; }

table.data a {
  color: var(--teal-dark);
  font-weight: 650;
  text-decoration: none;
}

table.data a:hover { text-decoration: underline; }

table.data .num,
table.data th.num { text-align: right; }

.muted { color: var(--muted); }

.sub {
  display: block;
  margin-top: 2px;
  font-size: 13px;
}

a.sub {
  color: var(--teal-dark);
  font-weight: 650;
  text-decoration: none;
}

a.sub:hover { text-decoration: underline; }

td.finding { max-width: 36rem; }

.status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #e7eef1;
  color: #35515c;
}

.status-validated,
.status-pass { background: #e5f4f1; color: #0c5a54; }
.status-published { background: #e7eef8; color: #1d4e89; }
.status-quarantined,
.status-fail,
.status-file-reject,
.status-transaction-reject { background: #f8e8e8; color: #9c2f2f; }
.status-pend { background: #f8f1df; color: #7a5b12; }
.status-not-validated { background: #e7eef1; color: #35515c; }

.content > .section-title { margin-top: 22px; }

.facts a,
.result-count a {
  color: var(--teal-dark);
  font-weight: 650;
  text-decoration: none;
}

.facts a:hover,
.result-count a:hover { text-decoration: underline; }

.pager {
  display: flex;
  gap: 16px;
  align-items: center;
}

.sha {
  font-family: Consolas, ui-monospace, monospace;
  font-size: 13px;
  word-break: break-all;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px 18px;
  margin: 0;
}

.facts dt {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.facts dd { margin: 2px 0 0; }

.facts .span-2 { grid-column: 1 / -1; }

.section-title {
  margin: 0 0 12px;
  font-size: 18px;
}

.nest {
  margin: 16px 0 0;
  padding-left: 16px;
  border-left: 2px solid var(--line);
}

.check-yes,
.check-no,
.check-unknown {
  display: inline-block;
  margin-left: 8px;
  font-weight: 650;
}

.check-yes,
.recon-yes { color: var(--teal-dark); }
.recon-yes,
.recon-no { font-weight: 650; }
.recon-no { color: var(--danger); }
.check-no { color: var(--danger); }
.check-unknown { color: var(--muted); font-weight: 450; }

.back-link {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--teal-dark);
  font-weight: 650;
  text-decoration: none;
}

.back-link:hover { text-decoration: underline; }

.quarantine {
  margin: 14px 0 0;
  color: var(--danger);
}

@media (max-width: 860px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-intro { padding: 32px 24px 8px; }
  .login-intro h1 { font-size: 32px; }
  .sidebar-toggle { display: inline-flex; }
  .sidebar {
    position: fixed;
    z-index: 20;
    transform: translateX(-100%);
    transition: transform 160ms ease;
  }
  .app-shell.sidebar-open .sidebar { transform: none; }
  .account-text { display: none; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
}
