:root {
  --onyx: #22333b;
  --paper: #f2f4f3;
  --paper-strong: #fbfcfb;
  --signal: #e63946;
  --aqua: #a8dadc;
  --ink-soft: rgba(34, 51, 59, 0.68);
  --line: rgba(34, 51, 59, 0.14);
  --shadow: 0 22px 58px rgba(34, 51, 59, 0.12);
  font-family: "Inter Tight", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--onyx);
  background:
    linear-gradient(90deg, rgba(34, 51, 59, 0.05) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(180deg, #fbfcfb 0%, var(--paper) 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--ink-soft);
}

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

.rail {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 18px;
  background: rgba(34, 51, 59, 0.96);
  color: var(--paper);
}

.rail .mono {
  color: rgba(242, 244, 243, 0.52);
}

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

.brand strong {
  display: block;
  font-size: 1.16rem;
  line-height: 1.05;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: rgba(242, 244, 243, 0.66);
}

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

.tab,
.primary-button,
.icon-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
}

.tab {
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  color: rgba(242, 244, 243, 0.78);
  background: transparent;
}

.tab:hover,
.tab.is-active {
  color: var(--paper);
  background: rgba(242, 244, 243, 0.08);
  border-color: rgba(242, 244, 243, 0.14);
}

.tab.is-active {
  box-shadow: inset 3px 0 0 var(--aqua);
}

.quick-create {
  display: grid;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid rgba(242, 244, 243, 0.14);
}

label {
  display: grid;
  gap: 7px;
  font-size: 0.84rem;
  color: rgba(242, 244, 243, 0.78);
}

input,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(242, 244, 243, 0.16);
  border-radius: 8px;
  color: var(--paper);
  background: rgba(242, 244, 243, 0.08);
  outline: none;
}

input {
  min-height: 40px;
  padding: 0 11px;
}

textarea {
  resize: vertical;
  padding: 10px 11px;
  line-height: 1.45;
}

input:focus,
textarea:focus {
  border-color: var(--aqua);
}

.primary-button {
  padding: 0 15px;
  color: var(--onyx);
  background: var(--aqua);
}

.rail-status {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(242, 244, 243, 0.14);
  border-radius: 8px;
  background: rgba(242, 244, 243, 0.08);
}

.rail-status strong {
  display: block;
  margin-top: 5px;
}

.workspace {
  min-width: 0;
  padding: 26px clamp(16px, 3vw, 38px) 38px;
}

.topbar,
.board-head,
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--ink-soft);
}

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

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.8rem, 3.1vw, 3.25rem);
  line-height: 0.98;
}

h2 {
  font-size: clamp(1.05rem, 1.55vw, 1.32rem);
}

h3 {
  font-size: 1rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.search-box {
  min-width: min(320px, 62vw);
  color: var(--onyx);
}

.search-box input {
  color: var(--onyx);
  background: rgba(251, 252, 251, 0.84);
  border-color: var(--line);
}

.icon-button {
  width: 44px;
  color: var(--onyx);
  border-color: var(--line);
  background: var(--paper-strong);
}

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

.metric {
  min-width: 0;
  padding: 16px;
  background: rgba(251, 252, 251, 0.94);
}

.metric strong {
  display: block;
  margin: 9px 0 4px;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1;
}

.metric small {
  color: var(--ink-soft);
}

.metric-accent {
  box-shadow: inset 0 -4px 0 var(--aqua);
}

.metric-alert {
  box-shadow: inset 0 -4px 0 var(--signal);
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
  animation: view-in 180ms ease-out;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.board-head,
.table-zone,
.inspector,
.workflow-step,
.member,
.timeline-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 252, 251, 0.88);
}

.board-head {
  padding: 18px;
  margin-bottom: 1px;
}

.board-head p {
  max-width: 58rem;
  margin: 7px 0 0;
  color: var(--ink-soft);
}

.lane-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 1px;
  overflow-x: auto;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.lane {
  min-width: 190px;
  padding: 14px;
  background: rgba(251, 252, 251, 0.94);
  animation: lane-in 240ms ease-out both;
  animation-delay: calc(var(--lane-index) * 40ms);
}

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

.lane-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-weight: 700;
}

.lane-track {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 220px;
  align-content: start;
}

.sla-line {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  border-radius: 999px;
  background: var(--aqua);
  transition: width 220ms ease;
}

.room-chip {
  width: 100%;
  min-height: 96px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  color: var(--onyx);
  background: #fff;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.room-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 51, 59, 0.26);
  box-shadow: 0 12px 28px rgba(34, 51, 59, 0.12);
}

.room-chip span,
.room-chip strong,
.room-chip small {
  display: block;
}

.room-chip strong {
  margin: 8px 0 2px;
  font-size: 1.45rem;
}

.room-chip small {
  color: var(--ink-soft);
}

.room-chip.conflict {
  box-shadow: inset 4px 0 0 var(--signal);
}

.room-chip.watch {
  box-shadow: inset 4px 0 0 #c89b3c;
}

.room-chip.clear {
  box-shadow: inset 4px 0 0 var(--aqua);
}

.empty-lane {
  color: var(--ink-soft);
}

.queue-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.7fr);
  gap: 18px;
  align-items: start;
}

.table-zone,
.inspector {
  padding: 16px;
}

.section-head {
  margin-bottom: 14px;
}

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

.table-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.86fr 0.7fr 66px;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 11px 12px;
  border: 0;
  text-align: left;
  color: var(--onyx);
  background: rgba(251, 252, 251, 0.96);
}

.table-head {
  min-height: 38px;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: rgba(242, 244, 243, 0.96);
}

button.table-row:hover,
button.table-row.is-selected {
  background: #fff;
}

button.table-row.is-selected {
  box-shadow: inset 3px 0 0 var(--signal);
}

.table-row strong,
.table-row small {
  display: block;
}

.table-row small {
  margin-top: 3px;
  color: var(--ink-soft);
}

.sla-text {
  font-weight: 800;
}

.sla-text.conflict {
  color: var(--signal);
}

.sla-text.watch {
  color: #8a641b;
}

.sla-text.clear {
  color: #237073;
}

.inspector {
  position: sticky;
  top: 24px;
}

.inspector h2 {
  margin-top: 8px;
  font-size: 1.7rem;
}

.inspector p {
  margin: 10px 0 16px;
  color: var(--ink-soft);
  line-height: 1.48;
}

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

dt {
  color: var(--ink-soft);
}

dd {
  margin: 0;
  font-weight: 700;
}

.vendor-rank {
  display: grid;
  gap: 8px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.vendor-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  color: var(--ink-soft);
}

.vendor-line.is-current {
  color: var(--onyx);
  font-weight: 800;
}

.timeline,
.workflow-grid,
.team-grid {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  padding: 16px;
}

.timeline-item time {
  color: var(--ink-soft);
}

.timeline-item h3 {
  margin: 4px 0 6px;
}

.timeline-item p {
  margin: 0 0 6px;
  color: var(--onyx);
}

.timeline-item small {
  color: var(--ink-soft);
}

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

.workflow-step,
.member {
  padding: 16px;
}

.workflow-step p,
.member p {
  min-height: 44px;
  margin: 8px 0 18px;
  color: var(--ink-soft);
  line-height: 1.45;
}

.bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(34, 51, 59, 0.1);
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--aqua), var(--signal));
  transition: width 220ms ease;
}

.workflow-step footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

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

.member {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.member .bar {
  grid-column: 1 / -1;
}

.member > strong {
  font-size: 1.45rem;
}

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

  .rail {
    position: static;
    height: auto;
  }

  .quick-create {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
  }

  .quick-create .mono,
  .quick-create button {
    grid-column: 1 / -1;
  }

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

  .inspector {
    position: static;
  }

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

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

  .topbar,
  .board-head,
  .section-head {
    display: grid;
  }

  .toolbar {
    justify-content: stretch;
  }

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

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

  .table-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .table-head {
    display: none;
  }

  .timeline-item,
  .workflow-grid,
  .team-grid,
  .quick-create {
    grid-template-columns: 1fr;
  }

  dl {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
