:root {
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:#182f3c;
  background:#f5f6f8;
  font-synthesis:none;
  --navy:#102c3c;
  --teal:#087e8b;
  --muted:#5f7480;
  --line:#dfe6e9;
  --paper:#fff;
}

* {
  box-sizing:border-box;
}

body {
  margin:0;
}

button,input,select {
  font:inherit;
}

button,a,input,select {
  outline-offset:4px;
}

button {
  cursor:pointer;
}

button:disabled {
  cursor:wait;
  opacity:.6;
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible {
  outline:3px solid #3bc0d0;
}

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

h1 {
  font-size:clamp(1.8rem,3vw,2.5rem);
  letter-spacing:-.045em;
  margin-bottom:12px;
  line-height:1.15;
}

h2 {
  font-size:1.12rem;
  letter-spacing:-.02em;
}

h3 {
  font-size:1rem;
}

p {
  line-height:1.6;
}

a {
  color:var(--teal);
}

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

small {
  line-height:1.5;
}

.eyebrow {
  font-size:.69rem;
  text-transform:uppercase;
  letter-spacing:.15em;
  font-weight:750;
  color:var(--muted);
  margin-bottom:12px;
}

.loading {
  padding:4rem;
}

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

.sidebar {
  background:var(--navy);
  color:#d8e6ed;
  padding:32px 22px;
  display:flex;
  flex-direction:column;
  gap:28px;
  position:sticky;
  top:0;
  height:100vh;
}

.brand {
  display:flex;
  align-items:center;
  gap:12px;
  color:white;
  font-size:1.25rem;
  font-weight:750;
  letter-spacing:.08em;
}

.mark {
  display:inline-grid;
  place-items:center;
  width:38px;
  height:42px;
  border:1px solid #66bbca;
  border-radius:9px;
  background:#19475a;
  color:#8bdde5;
  letter-spacing:0;
}

.tagline {
  color:#9eb7c5;
  font-size:.8rem;
  margin:12px 0 0;
}

.sidebar label {
  font-size:.72rem;
  font-weight:650;
  color:#9eb7c5;
  display:block;
  margin-bottom:10px;
}

.sidebar select {
  background:#193d4e;
  color:white;
  border:1px solid #3a5967;
  border-radius:7px;
  padding:11px;
  width:100%;
  font-size:.8rem;
}

.navigation {
  display:grid;
  gap:7px;
}

.navigation button {
  border:0;
  background:none;
  color:#b8ced8;
  text-align:left;
  padding:12px 14px;
  border-radius:7px;
  font-size:.86rem;
}

.navigation button[aria-current="page"] {
  background:#235064;
  color:white;
}

.sidebar-bottom {
  margin-top:auto;
  border-top:1px solid #345160;
  padding-top:20px;
  color:#9eb7c5;
  font-size:.76rem;
  line-height:1.7;
}

.logout {
  color:#d8e6ed;
  background:none;
  border:0;
  padding:0;
  margin-top:16px;
}

.main {
  min-width:0;
}

.topbar {
  min-height:78px;
  padding:20px 44px;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  background:white;
  gap:20px;
}

.breadcrumb {
  font-size:.8rem;
  color:var(--muted);
}

.status {
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:.73rem;
  white-space:nowrap;
}

.dot {
  height:7px;
  width:7px;
  border-radius:50%;
  background:#1a9974;
}

.dot.stale {
  background:#d18a29;
}

.content {
  max-width:1450px;
  margin:auto;
  padding:42px 44px 64px;
}

.intro {
  margin-bottom:30px;
  max-width:750px;
}

.intro p {
  color:var(--muted);
  font-size:.94rem;
  margin-bottom:0;
}

.stats {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
  margin-bottom:24px;
}

.stat {
  padding:22px 24px;
  border:1px solid var(--line);
  border-radius:10px;
  background:white;
}

.stat strong {
  display:block;
  font-size:1.9rem;
  letter-spacing:-.05em;
  line-height:1.3;
}

.stat span {
  display:block;
  font-size:.75rem;
  color:var(--muted);
  margin-bottom:10px;
}

.stat small {
  font-size:.7rem;
  display:block;
  margin-top:6px;
}

.grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:22px;
}

.card {
  background:white;
  border:1px solid var(--line);
  border-radius:10px;
  padding:26px;
  margin-bottom:22px;
  min-width:0;
}

.card-header {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:20px;
}

.card-header h2 {
  margin-bottom:6px;
}

.card-header p {
  font-size:.8rem;
  color:var(--muted);
  margin:0;
}

.badge {
  display:inline-block;
  border-radius:5px;
  background:#e8f5f5;
  color:#086773;
  font-size:.65rem;
  letter-spacing:.03em;
  padding:5px 8px;
  font-weight:700;
  white-space:nowrap;
}

.badge.gray {
  background:#eef1f3;
  color:#657581;
}

.badge.amber {
  background:#fff3df;
  color:#976013;
}

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

.flow-step {
  border-left:2px solid #c7e7eb;
  padding:4px 14px;
}

.flow-step .step {
  font-size:.68rem;
  color:var(--teal);
  font-weight:750;
  display:block;
  margin-bottom:12px;
}

.flow-step h3 {
  font-size:.88rem;
  margin-bottom:8px;
}

.flow-step p {
  font-size:.75rem;
  color:var(--muted);
  margin-bottom:0;
}

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

table {
  width:100%;
  border-collapse:collapse;
  text-align:left;
  font-size:.79rem;
}

th {
  font-size:.65rem;
  text-transform:uppercase;
  letter-spacing:.07em;
  color:var(--muted);
  font-weight:650;
  padding:12px 10px;
  border-bottom:1px solid var(--line);
  white-space:nowrap;
}

td {
  padding:15px 10px;
  border-bottom:1px solid #edf1f3;
  vertical-align:top;
  line-height:1.5;
}

tr:last-child td {
  border-bottom:0;
}

.text-button {
  border:0;
  background:transparent;
  color:var(--teal);
  padding:0;
  text-align:left;
  font-size:inherit;
  font-weight:600;
  overflow-wrap:anywhere;
}

.text-button:hover {
  text-decoration:underline;
}

.id {
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
  font-size:.72rem;
  max-width:260px;
  overflow-wrap:anywhere;
}

.reasons {
  font-size:.72rem;
  max-width:340px;
  color:var(--muted);
  padding-left:16px;
  margin:0;
}

.reasons li+li {
  margin-top:5px;
}

.notice {
  border-left:3px solid #6db7c1;
  background:#ecf6f7;
  padding:16px 19px;
  font-size:.8rem;
  line-height:1.65;
  border-radius:0 7px 7px 0;
  margin-bottom:24px;
}

.notice.warn {
  background:#fff7e9;
  border-color:#d59b40;
}

.empty {
  padding:35px 20px;
  text-align:center;
  color:var(--muted);
  font-size:.86rem;
  line-height:1.7;
}

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

.search {
  padding:11px 13px;
  border:1px solid #cbd9df;
  border-radius:7px;
  min-width:230px;
  background:#fff;
  font-size:.82rem;
}

.button {
  background:var(--navy);
  border:1px solid var(--navy);
  color:#fff;
  padding:11px 17px;
  border-radius:7px;
  font-size:.8rem;
  font-weight:600;
}

.button.secondary {
  background:white;
  color:var(--navy);
  border-color:#cbd9df;
}

.pagination {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:15px;
  margin-top:18px;
  font-size:.77rem;
  color:var(--muted);
}

.pagination .buttons {
  display:flex;
  gap:8px;
}

.facts {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:20px;
  margin:0;
}

.facts dt {
  color:var(--muted);
  font-size:.72rem;
  margin-bottom:5px;
}

.facts dd {
  font-size:.84rem;
  margin:0;
  overflow-wrap:anywhere;
}

.heatmap {
  display:grid;
  grid-template-columns:38px repeat(24,minmax(9px,1fr));
  gap:4px;
  min-width:430px;
}

.heat {
  min-height:15px;
  background:#eef2f4;
  border-radius:2px;
}

.heat.high {
  background:#128997;
}

.heat.low {
  background:#9bd6db;
}

.heat-label {
  font-size:.58rem;
  color:var(--muted);
  display:flex;
  align-items:center;
}

.key {
  font-size:.69rem;
  color:var(--muted);
  margin-top:12px;
}

.back {
  margin-bottom:24px;
}

.login-shell {
  min-height:100vh;
  display:grid;
  grid-template-columns:1.1fr 1fr;
}

.login-story {
  background:var(--navy);
  color:#fff;
  padding:clamp(35px,7vw,110px);
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:60px;
}

.login-story h1 {
  font-size:clamp(2.8rem,5vw,4.7rem);
  max-width:580px;
  letter-spacing:-.05em;
}

.login-story p {
  color:#b4ced9;
  max-width:420px;
}

.login-form-wrap {
  display:grid;
  place-items:center;
  padding:30px;
}

.login-form {
  width:100%;
  max-width:360px;
}

.login-form label {
  display:block;
  font-size:.8rem;
  font-weight:600;
  margin-bottom:10px;
}

.login-form input {
  width:100%;
  padding:14px;
  border:1px solid #cbd9df;
  border-radius:7px;
  margin-bottom:16px;
}

.login-form .button {
  width:100%;
  padding:14px;
}

.form-error {
  color:#a73535;
  font-size:.8rem;
  min-height:24px;
}

.schema {
  display:grid;
  gap:13px;
}

.schema-row {
  display:flex;
  justify-content:space-between;
  gap:20px;
  border-bottom:1px solid var(--line);
  padding-bottom:12px;
  font-size:.79rem;
}

.schema-row:last-child {
  border-bottom:0;
}

.schema-row span {
  color:var(--muted);
  text-align:right;
}

.footer-note {
  font-size:.72rem;
  color:var(--muted);
  line-height:1.7;
  margin-top:28px;
}

.error {
  color:#9c3434;
  background:#fff1f0;
  border:1px solid #efcfcb;
  padding:20px;
  border-radius:8px;
}

.mobile-label {
  display:none;
}

@media(max-width:1100px) {
  .shell {
    grid-template-columns:205px minmax(0,1fr);
  }
  .sidebar {
    padding:25px 16px;
  }
  .content {
    padding:30px 25px;
  }
  .topbar {
    padding:20px 25px;
  }
  .stats {
    grid-template-columns:repeat(2,1fr);
  }
  .grid {
    grid-template-columns:1fr;
  }
  .flow {
    grid-template-columns:repeat(2,1fr);
    gap:22px;
  }
  .login-story {
    padding:50px;
  }
}

@media(max-width:700px) {
  .shell {
    display:block;
  }
  .sidebar {
    height:auto;
    position:static;
    padding:18px 20px;
    gap:18px;
  }
  .sidebar .tagline,.sidebar-bottom {
    display:none;
  }
  .brand {
    font-size:1.05rem;
  }
  .mark {
    height:33px;
    width:31px;
  }
  .sidebar label {
    margin-bottom:6px;
  }
  .navigation {
    grid-template-columns:repeat(4,1fr);
    gap:3px;
  }
  .navigation button {
    padding:10px 5px;
    text-align:center;
    font-size:.69rem;
  }
  .topbar {
    padding:15px 20px;
    min-height:58px;
  }
  .content {
    padding:28px 18px;
  }
  .stats {
    gap:10px;
  }
  .stat {
    padding:18px;
  }
  .stat strong {
    font-size:1.6rem;
  }
  .card {
    padding:20px 16px;
  }
  .flow {
    grid-template-columns:1fr 1fr;
  }
  .login-shell {
    grid-template-columns:1fr;
  }
  .login-story {
    padding:30px;
    gap:35px;
  }
  .login-story h1 {
    font-size:2.8rem;
  }
  .login-story .footer-note {
    display:none;
  }
  .login-form-wrap {
    padding:35px 25px;
  }
  .breadcrumb {
    font-size:.72rem;
  }
  .status {
    font-size:.65rem;
  }
  .facts {
    grid-template-columns:1fr 1fr;
  }
  .search {
    min-width:0;
    width:100%;
  }
}

/* Keep imported source attributes readable without widening the dashboard. */
pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 28rem; overflow: auto; font-size: .8rem; }
summary { cursor: pointer; padding: .75rem; }
.toolbar input[type="checkbox"] { width: auto; }

.toggle { display: inline-flex; align-items: center; gap: .5rem; margin: .75rem 0; font-size: .85rem; }
.toggle input { width: auto; }
.compact { max-width: 24rem; margin: .4rem 0 0; font-size: .78rem; }
.prompt-editor { display: block; width: 100%; padding: 1rem; margin: .6rem 0 1rem; border: 1px solid var(--line); border-radius: .5rem; font: inherit; line-height: 1.6; }
.decision-check { border-top: 1px solid var(--line); margin: .5rem 0; }
.monthly-activity { display: grid; gap: .6rem; margin-top: 1.5rem; }
.activity-row { display: grid; grid-template-columns: 5rem minmax(2rem, 1fr) 4rem; align-items: center; gap: 1rem; font-size: .8rem; }
.activity-track { background: #edf4f5; border-radius: .25rem; overflow: hidden; height: 1rem; }
.activity-fill { display: block; height: 100%; background: var(--teal); }
