:root {
  --ink: #162238;
  --navy: #1d3557;
  --paper: #fff8f0;
  --mint: #2a9d8f;
  --coral: #e76f51;
  --line: rgba(29, 53, 87, 0.16);
  --muted: #6d7682;
  --surface: #ffffff;
  --shadow: 0 18px 45px rgba(22, 34, 56, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(42, 157, 143, 0.08), transparent 32%),
    linear-gradient(180deg, #fffaf3 0%, #f6efe7 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.side-rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  padding: 24px;
  color: var(--paper);
  background: var(--navy);
}

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

.brand strong {
  display: block;
  font-size: 20px;
}

.brand small,
.rail-note span,
.eyebrow,
.data-table th,
.setting-row small {
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand small {
  color: rgba(255, 248, 240, 0.72);
  font-size: 11px;
}

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

.tab-button {
  min-height: 42px;
  border: 1px solid rgba(255, 248, 240, 0.14);
  border-radius: 8px;
  color: rgba(255, 248, 240, 0.82);
  background: transparent;
  text-align: left;
  padding: 0 14px;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

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

.rail-note {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 248, 240, 0.16);
}

.rail-note span {
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 248, 240, 0.6);
  font-size: 11px;
}

.rail-note strong {
  display: block;
  max-width: 18ch;
  font-size: 18px;
  line-height: 1.25;
}

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

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--mint);
  font-size: 12px;
  font-weight: 700;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(32px, 5vw, 58px);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 6px;
  font-size: 20px;
  line-height: 1.15;
}

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

.search-box {
  display: grid;
  gap: 4px;
  min-width: min(260px, 100%);
}

.search-box span {
  color: var(--muted);
  font-size: 12px;
}

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

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

.metric-strip > div {
  min-width: 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.86);
}

.metric-strip span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.metric-strip strong {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: 30px;
  line-height: 1;
}

.metric-strip small {
  color: var(--muted);
  font-size: 14px;
}

.resource-meter i {
  display: block;
  width: 100%;
  height: 7px;
  margin-top: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mint) var(--value, 0%), rgba(29, 53, 87, 0.12) var(--value, 0%));
}

.view-panel {
  display: none;
  animation: rise 260ms ease both;
}

.view-panel.is-active {
  display: block;
}

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

.lanes-panel,
.inspector,
.table-panel,
.team-member,
.setting-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
}

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

.section-head.compact {
  align-items: center;
  padding: 14px 16px;
}

.section-head p {
  max-width: 68ch;
  margin: 0;
  color: var(--muted);
}

.primary-button,
.ghost-button,
.action-stack button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--navy);
  background: var(--paper);
}

.primary-button {
  color: #fff;
  background: var(--mint);
  border-color: var(--mint);
}

.lane-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 1px;
  overflow-x: auto;
  background: var(--line);
}

.lane-column {
  min-height: 440px;
  background: rgba(255, 255, 255, 0.62);
}

.lane-title {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 248, 240, 0.94);
}

.lane-title span {
  display: inline-grid;
  place-items: center;
  min-width: 25px;
  height: 25px;
  border-radius: 999px;
  color: #fff;
  background: var(--navy);
  font-size: 12px;
}

.lane-items {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.lane-item {
  position: relative;
  display: grid;
  gap: 8px;
  width: 100%;
  min-height: 142px;
  border: 1px solid rgba(29, 53, 87, 0.13);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.lane-item:hover,
.lane-item.is-selected {
  border-color: var(--mint);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(29, 53, 87, 0.12);
}

.lane-item.has-conflict {
  border-color: rgba(231, 111, 81, 0.72);
}

.lane-item.has-conflict:after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 8px;
  background: repeating-linear-gradient(135deg, rgba(231, 111, 81, 0.11), rgba(231, 111, 81, 0.11) 8px, transparent 8px, transparent 16px);
  content: "";
}

.lane-item-top,
.chips {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lane-item-top i,
.muted,
.conflict-line,
.data-table small,
.team-member small,
.team-member em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.lane-item strong {
  line-height: 1.2;
}

.chips em {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  color: var(--navy);
  background: rgba(42, 157, 143, 0.14);
  font-size: 12px;
  font-style: normal;
}

.conflict-line {
  color: var(--coral);
  font-weight: 700;
}

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

.inspector h2 {
  margin-bottom: 10px;
}

.inspector p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.5;
}

.inspector dl {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.inspector dl div {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.inspector dt {
  color: var(--muted);
}

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

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

.action-stack button:first-child {
  grid-column: 1 / -1;
  color: #fff;
  background: var(--navy);
}

.table-panel {
  margin-top: 18px;
}

.data-table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 11px;
}

.data-table td small {
  display: block;
  margin-top: 3px;
}

.data-table tr {
  transition: background 140ms ease;
}

.data-table tr:hover,
.data-table tr.is-selected-row {
  background: rgba(42, 157, 143, 0.09);
}

.status-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  background: rgba(29, 53, 87, 0.1);
  white-space: nowrap;
}

.status-blocked {
  color: #a33d25;
  background: rgba(231, 111, 81, 0.16);
}

.status-ready,
.status-out_for_delivery {
  color: #12665d;
  background: rgba(42, 157, 143, 0.16);
}

.timeline {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 18px 0 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 170px 220px minmax(0, 1fr) 190px;
  gap: 14px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
}

.timeline p {
  margin: 0;
  color: var(--muted);
}

.timeline span,
.timeline time {
  color: var(--muted);
  font-size: 13px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-top: 18px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
}

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

.setting-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.setting-row input[type="number"] {
  width: 110px;
}

.setting-row input[type="checkbox"] {
  width: 46px;
  height: 24px;
  accent-color: var(--mint);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-top: 18px;
}

.team-member {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 16px;
  align-items: center;
  padding: 18px;
}

.load-ring {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border-radius: 999px;
  background: conic-gradient(var(--mint) var(--load), rgba(29, 53, 87, 0.12) 0);
}

.load-ring b {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: #fff;
}

.team-member h3 {
  margin-bottom: 3px;
}

.team-member p {
  margin-bottom: 4px;
  color: var(--navy);
  font-weight: 700;
}

.team-member em {
  display: block;
  margin-top: 8px;
  color: var(--coral);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  max-width: min(360px, calc(100vw - 36px));
  border-radius: 8px;
  padding: 12px 14px;
  color: #fff;
  background: var(--navy);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

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

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

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

  .rail-note {
    display: none;
  }

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

  .inspector {
    position: static;
  }
}

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

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

  .topbar-actions,
  .search-box,
  .topbar-actions select {
    width: 100%;
  }

  .metric-strip,
  .settings-grid,
  .team-grid {
    grid-template-columns: 1fr;
  }

  .lane-board {
    grid-template-columns: repeat(4, 240px);
  }

  .timeline li {
    grid-template-columns: 1fr;
  }

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

