:root {
  --ink: #172033;
  --navy: #1d3557;
  --paper: #fff8f0;
  --paper-2: #f4eee5;
  --line: #d7d0c4;
  --teal: #2a9d8f;
  --orange: #e76f51;
  --muted: #667085;
  --white: #ffffff;
  --shadow: 0 18px 50px rgba(29, 53, 87, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body {
  min-height: 100%;
  margin: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 22px 18px;
  color: var(--paper);
  background: var(--navy);
}

.brand {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
  line-height: 1.1;
}

.brand small,
.eyebrow,
.searchbox label,
.metric span,
.case__stage,
.case__meta,
.case__numbers,
.side-status,
.progress-dot,
.history-table th,
.person span,
.person small {
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

.brand small {
  color: rgba(255, 248, 240, 0.68);
  font-size: 11px;
  margin-top: 3px;
}

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

.nav__item {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 12px;
  color: rgba(255, 248, 240, 0.78);
  background: transparent;
  text-align: left;
}

.nav__item:hover,
.nav__item.is-active {
  color: var(--paper);
  border-color: rgba(255, 248, 240, 0.24);
  background: rgba(255, 248, 240, 0.08);
}

.side-status {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  color: rgba(255, 248, 240, 0.76);
  background: rgba(0, 0, 0, 0.16);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 6px rgba(42, 157, 143, 0.18);
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 340px);
  gap: 20px;
  align-items: end;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--teal);
  font-size: 12px;
  line-height: 1.45;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  color: var(--navy);
  font-size: 28px;
  line-height: 1.14;
}

.searchbox {
  display: grid;
  gap: 6px;
}

.searchbox label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.searchbox input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--white);
  outline: none;
}

.searchbox input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.14);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.metric {
  min-height: 86px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: var(--navy);
  font-size: 30px;
  line-height: 1;
}

.metric.accent strong {
  color: var(--teal);
}

.screen {
  display: none;
}

.screen.is-visible {
  display: block;
  animation: rise 180ms ease-out;
}

.lanes {
  display: grid;
  grid-template-columns: repeat(5, minmax(238px, 1fr));
  gap: 10px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 8px;
}

.lane {
  min-width: 238px;
  border-left: 1px solid var(--line);
}

.lane__head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 10px;
  background: var(--paper);
}

.lane__head h2 {
  margin: 0;
  color: var(--navy);
  font-size: 14px;
}

.lane__head span {
  min-width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--paper);
  background: var(--navy);
  font-size: 12px;
}

.lane__body {
  display: grid;
  gap: 10px;
  padding: 0 10px 8px;
}

.case {
  position: relative;
  min-height: 306px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.case:hover {
  transform: translateY(-2px);
  border-color: rgba(42, 157, 143, 0.44);
  box-shadow: 0 20px 58px rgba(29, 53, 87, 0.18);
}

.case--risk {
  border-color: rgba(231, 111, 81, 0.55);
}

.case--blocked {
  border-color: var(--orange);
}

.case__top,
.case__meta,
.case__numbers,
.case__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.case__top,
.case__numbers,
.case__actions {
  justify-content: space-between;
}

.case__stage {
  color: var(--teal);
  font-size: 11px;
  text-transform: uppercase;
}

.risk {
  border-radius: 999px;
  padding: 4px 7px;
  color: var(--navy);
  background: var(--paper-2);
  font-size: 11px;
}

.risk--risk,
.risk--blocked {
  color: var(--paper);
  background: var(--orange);
}

.case h3 {
  min-height: 44px;
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.25;
}

.case__meta {
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 11px;
}

.case__meta span {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 7px;
  background: var(--paper);
}

.resource-line {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #e5ded4;
}

.resource-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.case--risk .resource-line span,
.case--blocked .resource-line span {
  background: var(--orange);
}

.case__numbers {
  color: var(--muted);
  font-size: 11px;
}

.case__numbers strong {
  color: var(--navy);
}

.evidence-list {
  display: grid;
  gap: 6px;
  min-height: 86px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.evidence {
  display: grid;
  gap: 3px;
  border-left: 3px solid var(--line);
  padding-left: 8px;
}

.evidence span {
  font-size: 12px;
  line-height: 1.28;
}

.evidence small,
.muted {
  color: var(--muted);
  font-size: 11px;
}

.evidence--approved,
.evidence--uploaded {
  border-left-color: var(--teal);
}

.evidence--required {
  border-left-color: var(--orange);
}

.case__progress {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 25px;
}

.progress-dot {
  border-radius: 999px;
  padding: 4px 6px;
  color: var(--navy);
  background: rgba(42, 157, 143, 0.12);
  font-size: 10px;
}

.case__actions {
  margin-top: auto;
}

.action-btn,
.ghost-btn,
.icon-btn {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  color: var(--paper);
  background: var(--navy);
}

.action-btn {
  flex: 1;
  padding: 0 10px;
}

.icon-btn {
  width: 36px;
  font-size: 20px;
  line-height: 1;
  background: var(--teal);
}

.action-btn:disabled,
.icon-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.ghost-btn {
  min-width: 120px;
  padding: 0 12px;
  color: var(--navy);
  border: 1px solid var(--line);
  background: var(--white);
}

.conflict-overlay {
  position: absolute;
  right: -38px;
  top: 18px;
  width: 150px;
  transform: rotate(28deg);
  padding: 5px 0;
  color: var(--paper);
  background: var(--orange);
  text-align: center;
  font-size: 10px;
  font-weight: 700;
}

.empty-lane,
.error-state {
  min-height: 140px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
}

.error-state {
  grid-column: 1 / -1;
  color: var(--ink);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.section-head h2 {
  margin: 0;
  color: var(--navy);
  font-size: 19px;
}

.history-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
  background: var(--white);
}

.history-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.history-table th,
.history-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.history-table th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  background: var(--paper-2);
}

.history-table td {
  font-size: 13px;
}

.history-table td span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

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

.workflow-step {
  min-height: 222px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--white);
}

.workflow-index {
  color: var(--teal);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.workflow-step h3 {
  margin: 10px 0;
  color: var(--navy);
}

.workflow-step ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
}

.rules {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(42, 157, 143, 0.1);
}

.rules h3 {
  margin: 0 0 8px;
  color: var(--navy);
}

.rules p {
  margin: 6px 0;
}

.team-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.person {
  min-height: 108px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--white);
}

.person h3,
.person p {
  margin: 0;
}

.person p {
  margin-top: 4px;
  color: var(--muted);
}

.person span {
  border-radius: 999px;
  padding: 5px 7px;
  color: var(--paper);
  background: var(--navy);
  font-size: 10px;
}

.person small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.person--online {
  border-color: rgba(42, 157, 143, 0.48);
}

.person--busy {
  border-color: rgba(231, 111, 81, 0.48);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .side {
    position: relative;
    height: auto;
  }

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

  .nav__item {
    text-align: center;
  }

  .side-status {
    margin-top: 0;
  }

  .metrics,
  .workflow-grid,
  .team-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .workspace {
    padding: 16px;
  }

  .topbar,
  .metrics,
  .workflow-grid,
  .team-list {
    grid-template-columns: 1fr;
  }

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

  h1 {
    font-size: 23px;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .ghost-btn {
    width: 100%;
  }
}

