:root {
  --ink: #17202a;
  --paper: #f7f3e8;
  --mint: #2f8f83;
  --amber: #f2b544;
  --line: rgba(23, 32, 42, 0.14);
  --muted: rgba(23, 32, 42, 0.64);
  --white: #fffdf7;
  --danger: #b7483b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

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

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

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

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

.tab,
.rail-note,
.metric,
.wide-panel,
.import-panel,
.public-panel,
.inspector,
.lanes,
.registry {
  border: 1px solid var(--line);
}

.tab {
  min-height: 42px;
  text-align: left;
  color: rgba(247, 243, 232, 0.74);
  background: transparent;
  border-color: rgba(247, 243, 232, 0.12);
  border-radius: 8px;
  padding: 0 12px;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.tab:hover,
.tab.is-active {
  color: var(--paper);
  background: rgba(47, 143, 131, 0.28);
  transform: translateX(2px);
}

.rail-note {
  margin-top: auto;
  border-color: rgba(247, 243, 232, 0.16);
  border-radius: 8px;
  padding: 14px;
}

.rail-note span,
.eyebrow,
.metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0;
}

.rail-note span {
  color: rgba(247, 243, 232, 0.52);
}

.rail-note strong {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.35;
}

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

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

.topbar h1,
.section-head h2,
.wide-panel h2,
.import-panel h2,
.public-panel h2,
.passport h2 {
  margin: 4px 0 0;
  font-size: clamp(24px, 3vw, 40px);
  line-height: 1.02;
  letter-spacing: 0;
}

.section-head h2,
.wide-panel h2,
.import-panel h2,
.public-panel h2,
.passport h2 {
  font-size: 20px;
}

.top-actions {
  display: flex;
  align-items: end;
  gap: 10px;
}

.search {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  padding: 0 12px;
  min-width: 160px;
}

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

.metric {
  min-height: 86px;
  border-radius: 8px;
  background: var(--white);
  padding: 16px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.view {
  display: none;
}

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

#view-inspection.is-visible {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  align-items: start;
}

.planner {
  display: grid;
  gap: 14px;
}

.lanes,
.registry,
.inspector,
.wide-panel,
.import-panel,
.public-panel {
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.72);
  padding: 16px;
}

.sync {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.lane-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.lane {
  min-width: 0;
  border-left: 4px solid var(--mint);
  padding-left: 10px;
}

.lane h3 {
  margin: 0 0 10px;
  font-size: 13px;
}

.slot {
  width: 100%;
  min-height: 82px;
  display: grid;
  gap: 4px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  padding: 10px;
  margin-bottom: 8px;
  transition: transform 160ms ease, border-color 160ms ease;
}

.slot:hover,
.asset-card:hover {
  transform: translateY(-2px);
  border-color: rgba(47, 143, 131, 0.52);
}

.slot span,
.slot em,
.asset-card span,
.asset-card small,
.event span,
.public-row span,
.public-row em {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  font-style: normal;
}

.slot.blocked {
  border-color: rgba(183, 72, 59, 0.45);
}

.asset-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.asset-card {
  min-height: 156px;
  display: grid;
  align-content: start;
  gap: 9px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  padding: 13px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.asset-card.is-selected {
  border-color: var(--mint);
  box-shadow: inset 0 0 0 1px var(--mint);
}

.badge {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(47, 143, 131, 0.12);
  color: var(--mint);
  font-size: 11px;
  font-weight: 800;
}

.badge.blocked {
  background: rgba(183, 72, 59, 0.12);
  color: var(--danger);
}

.badge.service_scheduled,
.badge.watch {
  background: rgba(242, 181, 68, 0.2);
  color: #8a5f00;
}

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

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--amber));
  transition: width 260ms ease;
}

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

.passport dl {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px 12px;
  margin: 16px 0;
}

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

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

.progress-ring {
  --value: 0;
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  margin: 10px 0 16px;
  background: conic-gradient(var(--mint) calc(var(--value) * 1%), rgba(23, 32, 42, 0.1) 0);
}

.progress-ring span {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--white);
  font-weight: 900;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: grid;
  gap: 8px;
}

.checklist li {
  min-height: 42px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.checklist li.done span {
  color: var(--muted);
  text-decoration: line-through;
}

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

.actions button,
.primary,
.icon-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font-weight: 800;
}

.primary {
  border-color: var(--mint);
  background: var(--mint);
  color: white;
}

.icon-button {
  width: 42px;
  font-size: 18px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 14px;
}

.progress-chart,
.activity-feed,
.public-status {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.chart-row,
.public-row,
.event {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 2fr) 52px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.event {
  grid-template-columns: 118px 1fr;
}

.event p {
  grid-column: 2;
  margin: -4px 0 0;
  color: var(--muted);
}

.import-panel,
.public-panel {
  max-width: 820px;
}

.import-panel p {
  max-width: 620px;
  color: var(--muted);
  line-height: 1.55;
}

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  padding: 14px;
}

.public-row {
  grid-template-columns: minmax(140px, 1fr) 120px minmax(140px, 1fr) 132px;
}

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

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

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

  .rail {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    flex: 1 1 520px;
  }

  .rail-note {
    display: none;
  }

  #view-inspection.is-visible,
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .inspector {
    position: static;
  }
}

@media (max-width: 760px) {
  .workspace,
  .rail {
    padding: 14px;
  }

  .topbar,
  .top-actions,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions,
  .tabs {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  input,
  select {
    width: 100%;
  }

  .metrics,
  .lane-board,
  .asset-grid {
    grid-template-columns: 1fr;
  }

  .actions,
  .chart-row,
  .public-row,
  .event {
    grid-template-columns: 1fr;
  }

  .event p {
    grid-column: auto;
  }
}

