:root {
  --ink: #15201d;
  --muted: #60736d;
  --paper: #fffdf8;
  --soft: #f2f6f3;
  --line: #d8e1dc;
  --green: #0f766e;
  --blue: #2563eb;
  --amber: #b45309;
  --red: #b42318;
  --shadow: 0 18px 44px rgba(32, 44, 39, 0.12);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: #eaf0ec;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select, textarea { font: inherit; }
.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}
.shell > *, .panel, .hero, .source-grid, .fact-grid, .form-grid, .grid { min-width: 0; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  color: #f8fbf8;
  background: #15201d;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #d7f8eb;
  color: #0f3b34;
  font-weight: 900;
}
.brand p, .eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.2;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0;
}
.brand p { color: #9db1aa; }
.brand h1 { margin: 0; font-size: 1.08rem; line-height: 1.2; }
.steps { display: grid; gap: 8px; }
.steps a {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  color: #d8e4de;
  text-decoration: none;
  font-weight: 750;
}
.steps a:first-child {
  border-color: #8ddfca;
  background: rgba(141, 223, 202, 0.13);
  color: #fff;
}
.sidebar-note {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
}
.sidebar-note p { margin: 6px 0 0; color: #c5d3cd; line-height: 1.45; }
main { display: grid; gap: 20px; padding: 24px; }
.hero {
  min-height: 260px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 24px;
  align-items: end;
  padding: 36px;
  color: #fff;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(14, 48, 42, 0.94), rgba(14, 48, 42, 0.76)),
    url("https://images.unsplash.com/photo-1450101499163-c8848c66ca85?auto=format&fit=crop&w=1800&q=80") center / cover;
}
.hero .eyebrow { color: #98f1d6; }
.hero h2 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: 0;
  overflow-wrap: break-word;
}
.lede { max-width: 690px; margin: 18px 0 0; color: #dcebe5; font-size: 1.07rem; line-height: 1.55; }
.drive-link {
  justify-self: end;
  width: 100%;
  max-width: 260px;
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 8px;
  color: #12312c;
  background: #d7f8eb;
  text-decoration: none;
  font-weight: 850;
}
.drive-link span { color: #38625a; font-size: 0.82rem; font-weight: 650; }
.logout-link {
  justify-self: end;
  align-self: start;
  color: #d7f8eb;
  font-weight: 850;
  text-decoration: none;
}
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr); }
.panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.wide { grid-column: 1 / -1; }
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}
h3, h4, p { margin-top: 0; }
h3 { margin-bottom: 0; font-size: 1.28rem; line-height: 1.25; }
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 99px;
  border: 1px solid #b7e2cd;
  color: #0d6a45;
  background: #e5f7ef;
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}
.pill.blue { border-color: #c8dafb; color: #1d4ed8; background: #edf3ff; }
.source-grid, .fact-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.fact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile, .card {
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}
.tile b, .card b { display: block; margin-bottom: 8px; }
.tile p, .card p, li { color: var(--muted); line-height: 1.45; font-size: 0.92rem; }
.tile a { color: var(--green); font-weight: 850; }
.stack { display: grid; gap: 12px; }
.card.evidence { border-left: 5px solid var(--blue); }
.card.warn { border-left: 5px solid var(--amber); }
.card.warn.high { border-left-color: var(--red); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
label { display: grid; gap: 6px; color: #3f4f4a; font-size: 0.82rem; font-weight: 850; }
input, select, textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cdd8d1;
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fff;
}
textarea { min-height: 76px; resize: vertical; }
.allocation-title { display: flex; justify-content: space-between; align-items: center; margin: 22px 0 10px; }
.allocation-title h4 { margin: 0; }
button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--green);
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-weight: 850;
  cursor: pointer;
}
.allocation-rows { display: grid; gap: 10px; }
.allocation-row {
  display: grid;
  grid-template-columns: 1fr 1fr 0.8fr 0.8fr 38px;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}
.allocation-row label:last-child { grid-column: 1 / -1; }
.remove-row { padding: 0; border-color: #d0d8d3; background: #fff; color: var(--red); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
pre {
  min-height: 520px;
  margin: 0;
  white-space: pre-wrap;
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #263832;
  background: #fbfaf5;
  font: 0.9rem/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}
@media (max-width: 1020px) {
  .shell, .grid.two, .hero { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .sidebar-note { margin-top: 0; }
  .drive-link { justify-self: start; }
  .source-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  main, .sidebar { padding: 16px; }
  .hero { min-height: 360px; padding: 24px; }
  .hero h2 { font-size: 2.25rem; }
  .source-grid, .fact-grid, .form-grid { grid-template-columns: 1fr; }
  .panel { padding: 16px; }
  .panel-head { flex-direction: column; align-items: stretch; }
  .allocation-row { grid-template-columns: 1fr; }
  .pill, .drive-link, .steps a { white-space: normal; min-width: 0; }
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(90deg, rgba(14, 48, 42, 0.92), rgba(14, 48, 42, 0.78)),
    url("https://images.unsplash.com/photo-1450101499163-c8848c66ca85?auto=format&fit=crop&w=1800&q=80") center / cover;
}
.login-shell {
  width: min(100%, 460px);
  padding: 0;
}
.login-panel {
  padding: 28px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.login-brand {
  margin-bottom: 28px;
  color: var(--ink);
}
.login-brand p { color: var(--muted); }
.login-panel h2 {
  margin: 0 0 12px;
  font-size: 2rem;
  line-height: 1.05;
  letter-spacing: 0;
}
.login-copy {
  color: var(--muted);
  line-height: 1.45;
}
.login-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}
.login-error {
  display: none;
  margin: 16px 0 0;
  color: var(--red);
  font-weight: 850;
}
.has-login-error .login-error { display: block; }
