:root {
  --ink: #0b132b;
  --paper: #f6fff8;
  --mint: #5bc0be;
  --sun: #ffd166;
  --white: #ffffff;
  --line: rgba(11, 19, 43, 0.12);
  --text: #1c2745;
  --muted: #68738c;
  --danger: #e85d75;
  --shadow: 0 18px 60px rgba(11, 19, 43, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(91, 192, 190, 0.09), transparent 34%),
    var(--paper);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.rail {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 22px 18px;
  color: var(--white);
  background: var(--ink);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0;
}

.brand img {
  width: 42px;
  height: 42px;
}

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

.nav__item {
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  text-align: left;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav__item:hover,
.nav__item.is-active {
  color: var(--ink);
  background: var(--sun);
  transform: translateX(3px);
}

.rail__status {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  line-height: 1.45;
}

.rail__status strong {
  color: var(--white);
  font-size: 15px;
}

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

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 13px;
}

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

h1 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: clamp(30px, 4vw, 56px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 24px;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 16px;
  letter-spacing: 0;
}

.search {
  display: grid;
  gap: 7px;
  min-width: 280px;
  color: var(--muted);
  font-size: 13px;
}

.search input,
.action-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--text);
  background: var(--white);
  outline: none;
}

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

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

.metric {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 8px 26px rgba(11, 19, 43, 0.05);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 12px;
  color: var(--ink);
  font-size: 42px;
  line-height: 1;
  letter-spacing: 0;
}

.metric--amber {
  border-color: rgba(255, 209, 102, 0.85);
}

.metric--mint {
  border-color: rgba(91, 192, 190, 0.75);
}

.view {
  display: none;
}

.view.is-active {
  display: block;
  animation: rise 240ms ease both;
}

.track-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.track-head p {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
}

.ghost {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 16px;
  color: var(--ink);
  background: var(--white);
}

.tracks {
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.track {
  min-height: 520px;
  border-left: 4px solid var(--mint);
  padding: 0 0 0 14px;
  animation: slideIn 300ms ease both;
  animation-delay: var(--delay);
}

.track__header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  margin-bottom: 12px;
}

.track__badge {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--ink);
  background: var(--sun);
  font-weight: 800;
}

.track__header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.track__lane {
  display: grid;
  gap: 10px;
}

.session-card {
  width: 100%;
  min-height: 168px;
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.86);
  text-align: left;
  box-shadow: 0 10px 24px rgba(11, 19, 43, 0.06);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.session-card:hover,
.session-card.is-selected {
  border-color: var(--mint);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.session-card strong {
  color: var(--ink);
  font-size: 18px;
}

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

.risk,
.badge,
.status {
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--ink);
  background: rgba(91, 192, 190, 0.18);
  font-size: 12px;
  font-weight: 700;
}

.risk--critical,
.risk--high {
  background: rgba(232, 93, 117, 0.18);
  color: #8d1730;
}

.risk--medium {
  background: rgba(255, 209, 102, 0.36);
}

.score {
  color: var(--ink);
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.drawer {
  min-width: 0;
  padding: 24px;
  border-left: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(91, 192, 190, 0.18), transparent 28%),
    #ffffff;
}

.empty-state,
.detail-panel {
  position: sticky;
  top: 24px;
}

.empty-state {
  display: grid;
  gap: 12px;
  padding-top: 18vh;
}

.pulse-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 0 rgba(91, 192, 190, 0.5);
  animation: pulse 1500ms infinite;
}

.detail-hero {
  display: grid;
  gap: 9px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.detail-hero h2 {
  font-size: 30px;
  line-height: 1;
}

.detail-hero p {
  color: var(--muted);
}

.detail-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0;
}

.detail-list div,
.report-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: rgba(246, 255, 248, 0.82);
}

dt {
  color: var(--muted);
  font-size: 12px;
}

dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-weight: 700;
}

.drawer-section {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.drawer-section p {
  color: var(--muted);
  line-height: 1.5;
}

.recommendation {
  color: var(--ink) !important;
  font-weight: 700;
}

.mini-row,
.bar-row,
.timeline__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid rgba(11, 19, 43, 0.08);
}

.mini-row span,
.bar-row span {
  min-width: 0;
}

.mini-row strong,
.bar-row strong {
  flex: 0 0 auto;
  color: var(--ink);
}

.action-form {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.action-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.action-form button {
  border: 0;
  border-radius: 8px;
  padding: 13px 16px;
  color: var(--ink);
  background: var(--sun);
  font-weight: 800;
}

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

.timeline__item {
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.82);
}

.timeline__item time {
  flex: 0 0 120px;
  color: var(--ink);
  font-weight: 800;
}

.timeline__item div {
  min-width: 0;
  flex: 1;
}

.timeline__item p {
  margin-bottom: 0;
  color: var(--muted);
}

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

.report-block--wide {
  grid-column: 1 / -1;
}

.insight {
  padding: 13px 0;
  border-top: 1px solid rgba(11, 19, 43, 0.08);
}

.insight p {
  margin-bottom: 8px;
  color: var(--text);
}

.insight span {
  color: var(--mint);
  font-weight: 800;
}

.notice {
  grid-column: 1 / -1;
  border: 1px solid rgba(232, 93, 117, 0.28);
  border-radius: 8px;
  padding: 16px;
  color: #8d1730;
  background: rgba(232, 93, 117, 0.08);
}

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

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(14px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  to {
    box-shadow: 0 0 0 18px rgba(91, 192, 190, 0);
  }
}

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

  .rail {
    padding: 18px 12px;
  }

  .brand span,
  .nav__item span,
  .rail__status {
    display: none;
  }

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

  .empty-state,
  .detail-panel {
    position: static;
    padding-top: 0;
  }
}

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

  .rail {
    position: sticky;
    top: 0;
    z-index: 4;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .brand span,
  .nav__item span {
    display: inline;
  }

  .nav {
    display: flex;
    overflow-x: auto;
  }

  .nav__item {
    white-space: nowrap;
  }

  .workspace {
    padding: 20px 14px;
  }

  .topbar,
  .track-head,
  .timeline__item {
    display: grid;
    align-items: start;
  }

  .search {
    min-width: 0;
    width: 100%;
  }

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

  .metric {
    min-height: 98px;
    padding: 14px;
  }

  .metric strong {
    font-size: 32px;
  }

  .tracks {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .track {
    min-height: 0;
  }

  .drawer {
    padding: 18px 14px;
  }

  .detail-list,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .report-block--wide {
    grid-column: auto;
  }

  .timeline__item time {
    flex-basis: auto;
  }
}
