:root {
  --ink: #0b132b;
  --paper: #f6fff8;
  --mint: #5bc0be;
  --sun: #ffd166;
  --coral: #ef476f;
  --grass: #3a7d44;
  --line: rgba(11, 19, 43, 0.13);
  --muted: rgba(11, 19, 43, 0.62);
  --white: #ffffff;
  --shadow: 0 24px 70px rgba(11, 19, 43, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--paper);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.left-rail {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 22px 16px;
  background: var(--ink);
  color: var(--paper);
}

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

.brand strong {
  display: block;
  font-size: 18px;
}

.brand small,
.rail-footer,
.case-meta dt,
.queue-item small,
.section-title p,
.candidate-row small,
.calendar-event small,
.report-row small,
.metric-label,
.eyebrow {
  color: var(--muted);
}

.left-rail .brand small,
.left-rail .rail-footer {
  color: rgba(246, 255, 248, 0.65);
}

.rail-nav {
  display: grid;
  gap: 8px;
}

.nav-button {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(246, 255, 248, 0.76);
  text-align: left;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav-button:hover,
.nav-button.is-active {
  background: rgba(91, 192, 190, 0.16);
  color: var(--paper);
  transform: translateX(2px);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(246, 255, 248, 0.18);
  border-radius: 50%;
  color: var(--sun);
  font-size: 12px;
  font-weight: 800;
}

.rail-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 0 rgba(91, 192, 190, 0.7);
  animation: pulse 1.8s infinite;
}

.work-canvas {
  min-width: 0;
  padding: 28px clamp(18px, 3vw, 42px) 36px;
}

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

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 4.8vw, 58px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: 24px;
}

h3 {
  margin-bottom: 16px;
  font-size: 16px;
}

.search-box {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

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

.search-box input:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(91, 192, 190, 0.18);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 28px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.metric-strip > div {
  padding: 20px;
  background: rgba(255, 255, 255, 0.72);
}

.metric-value {
  display: block;
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 850;
  line-height: 1;
}

.metric-label {
  display: block;
  margin-top: 8px;
  font-size: 13px;
}

.workflow-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.workflow-map::before {
  position: absolute;
  top: 28px;
  left: 8%;
  right: 8%;
  height: 2px;
  background: linear-gradient(90deg, var(--mint), var(--sun), var(--coral), var(--grass));
  content: "";
}

.track {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 104px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px;
  background: transparent;
  color: var(--ink);
  text-align: center;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.track:hover,
.track.is-active {
  transform: translateY(-2px);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.track-pin {
  z-index: 1;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 3px solid var(--paper);
  border-radius: 50%;
  background: var(--ink);
  color: var(--sun);
  font-weight: 850;
  box-shadow: var(--shadow);
}

.track small {
  min-height: 18px;
  color: var(--muted);
}

.screen-panel {
  display: none;
  animation: rise 220ms ease both;
}

.screen-panel.is-visible {
  display: block;
}

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

.section-title p {
  margin-bottom: 0;
  max-width: 620px;
}

.primary-action {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 780;
  transition: transform 180ms ease, background 180ms ease;
}

.primary-action:hover {
  transform: translateY(-1px);
  background: #111d3d;
}

.queue-list,
.candidate-list,
.action-list,
.calendar-lane,
.report-bars {
  display: grid;
  gap: 10px;
}

.queue-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 72px;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 94px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.queue-item:hover,
.queue-item.is-selected {
  transform: translateX(3px);
  border-color: rgba(91, 192, 190, 0.72);
  box-shadow: 0 14px 34px rgba(11, 19, 43, 0.08);
}

.queue-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.queue-main strong,
.drawer-header strong,
.candidate-row strong,
.calendar-event strong {
  overflow-wrap: anywhere;
}

.case-code {
  color: var(--grass);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.badge,
.risk-chip,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
}

.badge {
  background: rgba(255, 209, 102, 0.32);
}

.risk-chip {
  justify-self: end;
  width: 68px;
  color: var(--ink);
}

.critical {
  background: rgba(239, 71, 111, 0.18);
  color: #9c1638;
}

.high {
  background: rgba(255, 209, 102, 0.34);
  color: #7a5200;
}

.medium {
  background: rgba(91, 192, 190, 0.23);
  color: #185d5b;
}

.low {
  background: rgba(58, 125, 68, 0.16);
  color: #24602e;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.detail-block {
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.candidate-row,
.action-row,
.calendar-event,
.report-row {
  display: grid;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--white);
}

.candidate-row {
  grid-template-columns: minmax(0, 1fr) 48px;
}

.candidate-row span:first-child,
.report-row span:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.score {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--ink);
  font-weight: 850;
}

.action-row {
  grid-template-columns: 20px minmax(0, 1fr);
}

.action-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--mint);
}

.calendar-event {
  grid-template-columns: 128px minmax(0, 1fr) 120px;
  color: var(--ink);
  text-align: left;
}

.report-row {
  grid-template-columns: minmax(120px, 180px) minmax(120px, 1fr) 54px;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(11, 19, 43, 0.1);
}

.bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--sun), var(--coral));
}

.inspection-drawer {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  padding: 26px 22px;
  background: var(--white);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.inspection-drawer h2 {
  margin-bottom: 12px;
  font-size: 30px;
  line-height: 1.08;
}

.inspection-drawer p {
  color: var(--muted);
  line-height: 1.55;
}

.risk-dial {
  position: relative;
  display: grid;
  place-items: center;
  width: 190px;
  height: 190px;
  margin: 28px auto;
}

.risk-dial svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}

.dial-bg,
.dial-value {
  fill: none;
  stroke-width: 12;
}

.dial-bg {
  stroke: rgba(11, 19, 43, 0.09);
}

.dial-value {
  stroke: var(--coral);
  stroke-linecap: round;
  stroke-dasharray: 301.59;
  stroke-dashoffset: 301.59;
  transition: stroke-dashoffset 420ms ease;
}

.risk-dial div {
  display: grid;
  justify-items: center;
}

.risk-dial span {
  font-size: 46px;
  font-weight: 850;
}

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

.case-meta {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.case-meta div {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  background: var(--white);
}

.case-meta dt,
.case-meta dd {
  margin: 0;
}

.case-meta dd {
  overflow-wrap: anywhere;
  font-weight: 760;
}

.empty-state {
  min-height: 110px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 11px rgba(91, 192, 190, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(91, 192, 190, 0);
  }
}

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

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .left-rail {
    align-items: center;
  }

  .brand {
    grid-template-columns: 42px;
  }

  .brand span,
  .nav-button span:last-child,
  .rail-footer span:last-child {
    display: none;
  }

  .nav-button {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;
  }

  .inspection-drawer {
    grid-column: 1 / -1;
    position: relative;
    height: auto;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .left-rail {
    position: relative;
    height: auto;
    flex-direction: row;
    justify-content: space-between;
    padding: 12px;
  }

  .rail-nav {
    display: flex;
    gap: 6px;
  }

  .nav-button {
    width: 38px;
    min-height: 38px;
  }

  .work-canvas {
    padding: 22px 14px 28px;
  }

  .topbar,
  .metric-strip,
  .workflow-map,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 34px;
  }

  .workflow-map::before {
    top: 0;
    bottom: 0;
    left: 28px;
    right: auto;
    width: 2px;
    height: auto;
    background: linear-gradient(180deg, var(--mint), var(--sun), var(--coral), var(--grass));
  }

  .track {
    grid-template-columns: 56px minmax(0, 1fr);
    justify-items: start;
    min-height: 72px;
    text-align: left;
  }

  .track small {
    grid-column: 2;
  }

  .section-title,
  .queue-item,
  .calendar-event,
  .report-row {
    grid-template-columns: 1fr;
  }

  .section-title {
    align-items: stretch;
  }

  .risk-chip {
    justify-self: start;
  }
}

