:root {
  --ink: #172126;
  --deep: #2f3e46;
  --paper: #f1faee;
  --line: #d7dfd4;
  --accent: #e9c46a;
  --blue: #457b9d;
  --danger: #b84a42;
  --muted: #687776;
  --surface: #fbfff8;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

button,
input {
  font: inherit;
}

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

.nav {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  background: var(--deep);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.brand {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 900;
  line-height: .9;
}

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

.tabs button,
.icon-button,
.primary {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.tabs button {
  color: var(--paper);
  background: rgba(241, 250, 238, .08);
  text-align: left;
  padding: 0 14px;
}

.tabs button.active {
  background: var(--accent);
  color: #1f2b2f;
  font-weight: 800;
}

.nav-foot {
  margin-top: auto;
  display: grid;
  gap: 4px;
  color: rgba(241, 250, 238, .72);
  font-size: 13px;
}

.nav-foot strong {
  color: var(--accent);
  text-transform: uppercase;
}

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

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 860px;
  margin: 0;
  font-size: clamp(28px, 4vw, 54px);
  line-height: .98;
}

h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
}

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

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

.search input {
  width: min(34vw, 320px);
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--ink);
  text-transform: none;
}

.icon-button {
  width: 52px;
  background: var(--surface);
  color: var(--deep);
  border: 1px solid var(--line);
  font-size: 24px;
}

.primary {
  padding: 0 16px;
  background: var(--deep);
  color: var(--paper);
  font-weight: 850;
}

.primary.large {
  min-height: 62px;
  padding: 0 22px;
  background: var(--accent);
  color: var(--ink);
}

.summary-row {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(5, minmax(128px, 1fr));
  gap: 1px;
  margin: 0 0 20px;
  border: 1px solid var(--deep);
  background: var(--deep);
  box-shadow: 0 10px 20px rgba(47, 62, 70, .08);
}

.metric {
  min-height: 74px;
  padding: 12px 14px;
  background: var(--surface);
  display: grid;
  align-content: center;
  gap: 5px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric strong {
  font-size: clamp(22px, 3vw, 36px);
  line-height: .95;
}

.metric.danger strong {
  color: var(--danger);
  font-size: 18px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: rise .22s ease-out;
}

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

.table-tools,
.panel-head,
.import-layout {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.route-table-wrap {
  overflow-x: auto;
  border-top: 2px solid var(--deep);
  border-bottom: 2px solid var(--deep);
  background: var(--surface);
}

.route-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

.route-table th,
.route-table td {
  padding: 15px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.route-table th {
  position: sticky;
  top: 76px;
  z-index: 3;
  background: #e6efe2;
  color: var(--deep);
  font-size: 12px;
  text-transform: uppercase;
}

.route-table tr {
  cursor: pointer;
}

.route-table tr.selected td {
  background: #fff6d8;
}

.route-table td span,
.benefit small,
.member small,
.movement small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.stage {
  display: inline-flex;
  min-width: 86px;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 850;
  font-size: 13px;
}

.stage.route {
  background: #dbe7cf;
}

.stage.booking {
  background: var(--accent);
}

.stage.group {
  background: #bfd8e7;
}

.stage.review {
  background: #d9d1e8;
}

.pressure {
  width: 140px;
  height: 10px;
  overflow: hidden;
  background: #dce5d8;
  border-radius: 999px;
}

.pressure i,
.load-gauge i {
  display: block;
  height: 100%;
  background: var(--blue);
  border-radius: inherit;
  transition: width .25s ease;
}

.detail-grid,
.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 24px;
  margin-top: 24px;
}

.plain-panel {
  min-width: 0;
}

.benefit-list,
.checklist,
.member-list,
.movement-list,
.feedback-list {
  display: grid;
  gap: 10px;
}

.benefit {
  position: relative;
  min-height: 76px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px;
  cursor: pointer;
}

.benefit em {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  background: var(--accent);
}

.check-row,
.member,
.movement,
.feedback,
.status-line {
  min-height: 62px;
  padding: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.check-row {
  justify-content: flex-start;
  cursor: pointer;
}

.check-row input {
  width: 28px;
  height: 28px;
  accent-color: var(--deep);
  flex: 0 0 auto;
}

.load-gauge {
  margin: 14px 0 18px;
  display: grid;
  gap: 8px;
}

.load-gauge strong {
  font-size: clamp(48px, 8vw, 92px);
  line-height: .9;
}

.load-gauge span,
.muted {
  color: var(--muted);
}

.load-gauge i {
  width: 0;
  height: 14px;
}

.import-layout,
.public-status {
  padding: clamp(18px, 4vw, 42px) 0;
  border-top: 2px solid var(--deep);
  border-bottom: 2px solid var(--deep);
}

.import-layout .muted {
  max-width: 680px;
  line-height: 1.55;
}

.log {
  min-height: 180px;
  margin: 18px 0 0;
  padding: 16px;
  overflow: auto;
  border-radius: 8px;
  background: #172126;
  color: var(--paper);
  white-space: pre-wrap;
}

.public-status h2 {
  font-size: clamp(36px, 7vw, 82px);
  max-width: 820px;
}

.public-status p {
  max-width: 720px;
  font-size: 18px;
  line-height: 1.45;
}

.feedback {
  display: block;
}

.feedback p {
  margin: 8px 0;
}

.feedback span {
  color: var(--blue);
  font-weight: 800;
}

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

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

  .nav {
    position: relative;
    height: auto;
    padding: 14px;
    gap: 14px;
  }

  .brand {
    font-size: 18px;
  }

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

  .tabs button {
    min-height: 46px;
    padding: 0 8px;
    text-align: center;
    font-size: 13px;
  }

  .nav-foot {
    display: none;
  }

  .workspace {
    padding: 16px;
  }

  .topbar,
  .table-tools,
  .import-layout {
    display: grid;
  }

  .top-actions {
    width: 100%;
    align-items: end;
  }

  .search {
    flex: 1;
  }

  .search input {
    width: 100%;
  }

  .summary-row {
    top: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
  }

  .metric {
    min-height: 66px;
  }

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

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

  .route-table th {
    top: 132px;
  }
}

@media (max-width: 520px) {
  .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-row {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 58px;
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .benefit,
  .member,
  .movement,
  .status-line {
    align-items: flex-start;
  }
}
