:root {
  --ink: #102a43;
  --paper: #f5f7fa;
  --signal: #d64545;
  --mint: #56a3a6;
  --line: rgba(16, 42, 67, 0.16);
  --soft: #e8edf2;
  --shadow: 0 24px 70px rgba(16, 42, 67, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Arial Narrow", "Roboto Condensed", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

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

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

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

.brand img {
  flex: 0 0 auto;
}

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

.nav-tab {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(245, 247, 250, 0.18);
  border-radius: 8px;
  background: transparent;
  color: rgba(245, 247, 250, 0.76);
  cursor: pointer;
  text-align: left;
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  padding: 0 14px;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-tab:hover,
.nav-tab.active {
  background: var(--paper);
  color: var(--ink);
  transform: translateX(2px);
}

.shift-box {
  margin-top: auto;
  display: grid;
  gap: 6px;
  padding-top: 18px;
  border-top: 1px solid rgba(245, 247, 250, 0.18);
  line-height: 1.5;
}

.shift-box span,
.eyebrow,
.metric span,
.detail-list dt,
.drawer-tab,
.team-member span,
.timeline-item time {
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  opacity: 0.72;
}

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

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

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

h1 {
  font-size: clamp(32px, 5vw, 58px);
  line-height: 0.95;
}

h2 {
  font-size: 26px;
  line-height: 1.1;
}

h3 {
  font-size: 20px;
}

.eyebrow {
  color: var(--mint);
  margin-bottom: 8px;
}

.search {
  display: grid;
  gap: 7px;
  min-width: min(360px, 100%);
}

.search label,
.status-form label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.search input,
.status-form select,
.status-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  background: var(--line);
}

.metric {
  min-height: 96px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 16px;
  background: #ffffff;
}

.metric strong {
  font-size: 34px;
  line-height: 1;
}

.metric.accent strong {
  color: var(--mint);
}

.metric.alert strong {
  color: var(--signal);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 20px;
  align-items: start;
}

.route-wall,
.detail-sheet,
.timeline,
.drawer-grid,
.team-grid {
  animation: rise 260ms ease both;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-top: 4px solid var(--ink);
}

.section-heading.compact {
  max-width: 980px;
}

.db-badge,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 12px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  font-weight: 800;
}

.route-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.route-item {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  min-height: 124px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  padding: 14px;
  text-align: left;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.route-item::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 7px;
  background: var(--mint);
}

.route-item.status-incident::after,
.route-item.status-control::after {
  background: var(--signal);
}

.route-item:hover,
.route-item.active {
  transform: translateY(-2px);
  border-color: rgba(16, 42, 67, 0.38);
  box-shadow: var(--shadow);
}

.route-order {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 900;
}

.route-main,
.route-meta {
  display: grid;
  gap: 7px;
  min-width: 0;
  line-height: 1.35;
}

.route-main strong,
.route-main span,
.route-meta span,
.route-meta b {
  overflow-wrap: anywhere;
}

.route-meta {
  grid-column: 2;
  color: rgba(16, 42, 67, 0.74);
}

.route-meta b {
  color: var(--ink);
}

.detail-sheet {
  position: sticky;
  top: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.drawer-label {
  background: repeating-linear-gradient(90deg, #ffffff 0, #ffffff 16px, var(--soft) 16px, var(--soft) 17px);
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 900;
}

#detailContent {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.detail-head {
  display: grid;
  gap: 9px;
}

.detail-head p {
  line-height: 1.5;
}

.detail-list {
  display: grid;
  gap: 1px;
  margin: 0;
  background: var(--line);
}

.detail-list div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 0;
  background: #ffffff;
}

.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

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

.status-form button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  font-weight: 900;
}

.timeline,
.drawer-grid,
.team-grid {
  display: grid;
  gap: 12px;
  max-width: 980px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 18px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.timeline-item div {
  display: grid;
  gap: 6px;
  line-height: 1.55;
}

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

.drawer-grid,
.team-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.drawer,
.team-member {
  position: relative;
  min-height: 170px;
  display: grid;
  align-content: start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
  overflow: hidden;
}

.drawer::before,
.team-member::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 8px;
  background: var(--mint);
}

.drawer.muted::before,
.health-critical::before {
  background: var(--signal);
}

.drawer p,
.team-member p {
  line-height: 1.55;
}

.drawer > span,
.team-member b {
  margin-top: auto;
  color: rgba(16, 42, 67, 0.72);
}

.error {
  border: 1px solid rgba(214, 69, 69, 0.4);
  border-radius: 8px;
  background: #fff1f1;
  color: #8a2020;
  padding: 16px;
}

.empty {
  color: rgba(16, 42, 67, 0.64);
}

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

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

  .rail {
    position: sticky;
    top: 0;
    z-index: 5;
    gap: 14px;
    padding: 14px;
  }

  .brand {
    font-size: 21px;
  }

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

  .nav-tab {
    min-height: 38px;
    padding: 0 8px;
    text-align: center;
    font-size: 11px;
  }

  .shift-box {
    display: none;
  }

  .workspace {
    padding: 18px 14px;
  }

  .topbar {
    display: grid;
    align-items: start;
  }

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

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

  .detail-sheet {
    position: static;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 36px;
  }

  .metrics,
  .route-list,
  .drawer-grid,
  .team-grid {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 78px;
  }

  .route-item {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .detail-list div,
  .timeline-item {
    grid-template-columns: 1fr;
  }
}

