:root {
  --ink: #17202a;
  --paper: #f7f3e8;
  --mint: #2f8f83;
  --amber: #f2b544;
  --clay: #b9533f;
  --line: rgba(23, 32, 42, 0.16);
  --muted: rgba(23, 32, 42, 0.68);
  --panel: #fffaf0;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

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

.brand {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 19px;
  font-weight: 800;
}

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

.tab,
.lane-filter button,
.actions button,
.import-copy button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 7px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

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

.tab:hover,
.tab.is-active {
  color: var(--paper);
  background: rgba(247, 243, 232, 0.1);
  border-color: rgba(247, 243, 232, 0.2);
}

.workflow {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.workflow span {
  padding: 10px 0 10px 16px;
  border-left: 3px solid var(--amber);
  color: rgba(247, 243, 232, 0.82);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
}

.workspace {
  min-width: 0;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 540px);
  gap: 18px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1,
h2,
h3 {
  line-height: 1.04;
  letter-spacing: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 54px);
}

h2 {
  margin-bottom: 14px;
  font-size: 22px;
}

.search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 8px;
}

.search input,
.search select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffdf7;
  color: var(--ink);
  padding: 11px 12px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid var(--line);
}

.metric-strip > div {
  min-width: 0;
  padding: 14px 16px;
  border-right: 1px solid var(--line);
}

.metric-strip > div:last-child {
  border-right: 0;
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.metric-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 29px;
}

.screen {
  display: none;
}

.screen.is-visible {
  display: block;
  animation: rise 220ms ease both;
}

.planner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.board,
.inspector,
.chart-panel,
.import-copy,
.public-screen > div,
.status-matrix,
pre {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.72);
}

.board {
  min-width: 0;
  overflow: hidden;
}

.board-head {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.board-head h2 {
  margin: 0;
}

.lane-filter {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.lane-filter button {
  white-space: nowrap;
  color: var(--ink);
  background: transparent;
  border-color: var(--line);
  padding: 7px 10px;
}

.lane-filter button.is-active {
  color: #ffffff;
  background: var(--mint);
  border-color: var(--mint);
}

.calendar-grid {
  display: grid;
}

.route-row {
  width: 100%;
  min-height: 82px;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 118px 92px 94px;
  gap: 12px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 12px 16px;
  text-align: left;
}

.route-row:hover,
.route-row.is-selected {
  background: #fffdf7;
}

.route-row.is-selected {
  box-shadow: inset 4px 0 0 var(--amber);
}

.time {
  color: var(--mint);
  font-weight: 900;
}

.route-main {
  min-width: 0;
}

.route-main strong,
.route-main small {
  display: block;
  overflow-wrap: anywhere;
}

.route-main small {
  margin-top: 5px;
  color: var(--muted);
}

.lane {
  color: var(--muted);
  font-size: 13px;
}

.mini-progress,
.progress-bar,
.ticket-progress,
.bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 32, 42, 0.12);
}

.mini-progress i,
.progress-bar span,
.ticket-progress i,
.bar i {
  display: block;
  height: 100%;
  background: var(--mint);
}

.status-badge {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--ink);
  background: rgba(242, 181, 68, 0.25);
  font-size: 12px;
  font-weight: 850;
}

.status-approved,
.status-done,
.status-accepted {
  color: #ffffff;
  background: var(--mint);
}

.status-review,
.status-pending {
  background: var(--amber);
}

.status-draft,
.status-queued {
  background: rgba(185, 83, 63, 0.16);
}

.inspector {
  position: sticky;
  top: 18px;
  padding: 18px;
}

.inspector-top h2 {
  margin: 12px 0 8px;
}

.inspector-top p,
.import-copy p,
.public-screen p {
  color: var(--muted);
  line-height: 1.45;
}

.progress-bar {
  margin: 16px 0;
  height: 12px;
}

.proof-list {
  display: grid;
  gap: 10px;
}

.proof {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.proof span {
  color: var(--mint);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.proof strong {
  display: block;
  margin-top: 4px;
}

.proof p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.42;
}

.actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 16px;
}

.actions button,
.import-copy button {
  color: #ffffff;
  background: var(--ink);
  padding: 10px 12px;
}

.actions button:hover,
.import-copy button:hover {
  transform: translateY(-1px);
  background: #26313d;
}

.toast {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--mint);
  font-weight: 750;
}

.analytics-screen,
.import-screen,
.public-screen {
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
}

.analytics-screen.is-visible,
.import-screen.is-visible,
.public-screen.is-visible {
  display: grid;
}

.chart-panel,
.import-copy,
.public-screen > div,
.status-matrix,
pre {
  padding: 18px;
}

.driver-bars {
  display: grid;
  gap: 14px;
}

.driver-bar {
  display: grid;
  grid-template-columns: minmax(0, 190px) minmax(120px, 1fr) 42px;
  gap: 12px;
  align-items: center;
}

.driver-bar span {
  min-width: 0;
}

.driver-bar strong,
.driver-bar small {
  display: block;
  overflow-wrap: anywhere;
}

.driver-bar small {
  color: var(--muted);
}

.driver-bar em {
  font-style: normal;
  font-weight: 850;
}

.status-matrix {
  display: grid;
  gap: 10px;
}

.status-matrix div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.status-matrix strong {
  font-size: 28px;
}

pre {
  min-height: 180px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #fff8e8;
  background: var(--ink);
}

.public-ticket {
  background: #fffdf7;
}

.ticket-label {
  color: var(--clay);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.ticket-progress {
  margin-top: 16px;
}

.empty {
  padding: 18px;
  color: var(--muted);
}

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

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

  .rail {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 14px;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }

  .tabs {
    display: flex;
  }

  .tab {
    white-space: nowrap;
  }

  .workflow {
    display: none;
  }

  .planner,
  .analytics-screen,
  .import-screen,
  .public-screen,
  .topbar {
    grid-template-columns: 1fr;
  }

  .inspector {
    position: static;
  }
}

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

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

  .metric-strip > div:nth-child(2n) {
    border-right: 0;
  }

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

  .board-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .route-row {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 8px;
  }

  .lane,
  .mini-progress,
  .route-row .status-badge {
    grid-column: 2;
  }

  .driver-bar {
    grid-template-columns: 1fr;
  }
}

