:root {
  color-scheme: light;
  --ink: #0d1b2a;
  --paper: #f5ebe0;
  --steel: #778da9;
  --amber: #e0a458;
  --line: rgba(13, 27, 42, 0.16);
  --soft: rgba(245, 235, 224, 0.7);
  --danger: #b84a3a;
  --ok: #2f7d65;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(13, 27, 42, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(13, 27, 42, 0.08) 1px, transparent 1px),
    var(--paper);
  background-size: 24px 24px;
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.metrics-spine {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 18px;
  background: var(--ink);
  color: var(--paper);
  border-right: 5px solid var(--amber);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 850;
  line-height: 0.9;
  letter-spacing: 0;
}

.brand img {
  border: 1px solid rgba(245, 235, 224, 0.28);
}

.gauge-block {
  display: grid;
  gap: 8px;
  padding: 18px 0;
  border-top: 1px solid rgba(245, 235, 224, 0.22);
  border-bottom: 1px solid rgba(245, 235, 224, 0.22);
}

.metric-label,
.eyebrow {
  color: var(--steel);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.gauge-block strong {
  color: var(--amber);
  font-size: clamp(54px, 8vw, 82px);
  line-height: 0.85;
  font-weight: 900;
}

.gauge-block small,
.metric-stack small {
  color: rgba(245, 235, 224, 0.72);
  line-height: 1.35;
}

.metric-stack {
  display: grid;
  gap: 10px;
}

.metric-stack div {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(245, 235, 224, 0.14);
}

.metric-stack span {
  color: var(--paper);
  font-size: 26px;
  font-weight: 850;
}

.rail-tabs {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.rail-tab {
  min-height: 42px;
  border: 1px solid rgba(245, 235, 224, 0.2);
  background: transparent;
  color: var(--paper);
  text-align: left;
  padding: 0 12px;
  font-weight: 750;
  transition: background 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.rail-tab:hover,
.rail-tab.active {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--ink);
  transform: translateX(3px);
}

.workspace {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  padding: 22px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--ink);
}

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

h1 {
  max-width: 780px;
  font-size: clamp(30px, 4vw, 58px);
  line-height: 0.95;
  font-weight: 900;
}

h2 {
  font-size: clamp(20px, 2.3vw, 32px);
  line-height: 1;
}

h3 {
  font-size: 16px;
  line-height: 1.15;
}

.search {
  display: grid;
  gap: 6px;
  min-width: 260px;
  color: var(--steel);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.search input,
.quick-create input,
.quick-create select {
  width: 100%;
  min-height: 42px;
  border: 2px solid var(--ink);
  background: rgba(245, 235, 224, 0.84);
  color: var(--ink);
  padding: 0 12px;
  border-radius: 0;
}

.screen {
  display: none;
  min-width: 0;
  padding-top: 18px;
  animation: rise 220ms ease both;
}

.screen.active {
  display: block;
}

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

.section-heading span {
  color: var(--steel);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 14px;
  min-height: 580px;
}

.lane {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  background: rgba(245, 235, 224, 0.74);
  border: 2px solid var(--ink);
}

.lane header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
}

.lane header span {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 900;
}

.case-card {
  display: grid;
  gap: 9px;
  width: 100%;
  min-height: 158px;
  padding: 14px;
  border: 2px solid var(--line);
  background: #fffaf4;
  color: var(--ink);
  text-align: left;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.case-card:hover,
.case-card.selected {
  border-color: var(--amber);
  box-shadow: 6px 6px 0 var(--ink);
  transform: translate(-2px, -2px);
}

.case-zone {
  width: fit-content;
  padding: 4px 7px;
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.case-card strong {
  line-height: 1.18;
}

.case-card small {
  color: #4b5870;
  line-height: 1.3;
}

.progress,
.large-progress {
  position: relative;
  overflow: hidden;
  height: 8px;
  background: rgba(119, 141, 169, 0.24);
}

.progress i,
.large-progress i {
  display: block;
  height: 100%;
  background: var(--amber);
  transition: width 260ms ease;
}

.case-card footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: #4b5870;
}

.case-card footer b {
  color: var(--ink);
}

.details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
}

.case-detail,
.quick-create,
.report-panel {
  border: 2px solid var(--ink);
  background: rgba(255, 250, 244, 0.9);
  padding: 18px;
}

.case-detail {
  min-height: 430px;
}

.case-detail h3 {
  margin-top: 10px;
  font-size: clamp(28px, 4vw, 52px);
  max-width: 780px;
}

dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0;
}

dt {
  color: var(--steel);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

dd {
  margin: 4px 0 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.large-progress {
  height: 56px;
  background: rgba(119, 141, 169, 0.2);
}

.large-progress span,
.large-progress strong {
  position: absolute;
  z-index: 1;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink);
  font-weight: 900;
}

.large-progress span {
  left: 14px;
}

.large-progress strong {
  right: 14px;
  font-size: 28px;
}

.quick-create {
  align-self: start;
}

.quick-create form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.quick-create label {
  display: grid;
  gap: 5px;
  color: var(--steel);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.quick-create button,
.icon-action {
  min-height: 42px;
  border: 2px solid var(--ink);
  background: var(--amber);
  color: var(--ink);
  font-weight: 900;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.quick-create button:hover,
.icon-action:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--ink);
}

.timeline {
  display: grid;
  gap: 9px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 150px;
  gap: 14px;
  align-items: center;
  min-height: 62px;
  border: 2px solid var(--ink);
  background: rgba(255, 250, 244, 0.9);
  color: var(--ink);
  padding: 0 14px;
  text-align: left;
}

.timeline-row time,
.timeline-row b {
  color: var(--steel);
  font-size: 13px;
}

.timeline-row span {
  font-weight: 850;
}

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

.dial {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 24px;
  color: var(--amber);
}

.dial span {
  font-size: clamp(74px, 10vw, 132px);
  line-height: 0.85;
  font-weight: 950;
}

.dial small {
  color: var(--ink);
  font-size: 28px;
  font-weight: 900;
}

ul {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 18px 0 0;
  list-style: none;
}

li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

li span,
li b {
  overflow-wrap: anywhere;
}

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

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

  .metrics-spine {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-right: 0;
    border-bottom: 5px solid var(--amber);
  }

  .rail-tabs {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, 1fr);
    margin-top: 0;
  }

  .board,
  .report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 700px) {
  .workspace,
  .metrics-spine {
    padding: 14px;
  }

  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .search {
    min-width: 0;
  }

  .metrics-spine,
  .board,
  .report-grid,
  dl {
    grid-template-columns: 1fr;
  }

  .rail-tabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .timeline-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 12px;
  }
}

