:root {
  --ink: #172133;
  --navy: #1d3557;
  --paper: #fff8f0;
  --paper-strong: #fffdfa;
  --teal: #2a9d8f;
  --coral: #e76f51;
  --line: rgba(29, 53, 87, 0.16);
  --muted: #667085;
  --shadow: 0 18px 48px rgba(29, 53, 87, 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 {
  margin: 0;
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

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

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

.brand img {
  flex: 0 0 auto;
  border-radius: 12px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 20px;
  line-height: 1.1;
}

.brand small,
.mono,
.metric-label,
.eyebrow {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand small {
  color: rgba(255, 248, 240, 0.68);
  margin-top: 4px;
}

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

.nav-tab {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 248, 240, 0.76);
  text-align: left;
  padding: 10px 12px;
}

.nav-tab:hover,
.nav-tab.is-active {
  background: rgba(255, 248, 240, 0.1);
  color: var(--paper);
}

.sidebar-note {
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 248, 240, 0.18);
}

.sidebar-note strong {
  display: block;
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.45;
}

.sidebar-note p {
  margin: 0;
  color: rgba(255, 248, 240, 0.68);
  font-size: 13px;
  line-height: 1.5;
}

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

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

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

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

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 0.98;
  letter-spacing: 0;
  max-width: 820px;
}

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

.sync-state {
  flex: 0 0 auto;
  max-width: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--navy);
  background: var(--paper-strong);
  font-size: 13px;
  box-shadow: var(--shadow);
}

.sync-state.is-error {
  color: #9b2f1f;
  border-color: rgba(231, 111, 81, 0.45);
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  border: 1px solid var(--line);
  background: var(--paper-strong);
  margin-bottom: 18px;
}

.metrics-strip > div {
  padding: 16px;
  border-right: 1px solid var(--line);
}

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

.metric-label {
  display: block;
  color: var(--muted);
  margin-bottom: 10px;
}

.metrics-strip strong {
  display: block;
  color: var(--navy);
  font-size: 31px;
  line-height: 1;
}

.screen {
  display: none;
}

.screen.is-active {
  display: block;
  animation: screenIn 180ms ease-out;
}

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

.toolbar {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 16px;
}

.search-field,
.select-field {
  display: grid;
  gap: 6px;
}

.search-field {
  flex: 1 1 360px;
}

.select-field {
  flex: 0 0 210px;
}

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

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  color: var(--ink);
  padding: 9px 12px;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 2px solid rgba(42, 157, 143, 0.42);
  outline-offset: 2px;
}

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

.lane {
  position: relative;
  min-height: 160px;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  overflow: hidden;
}

.lane::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--teal);
}

.lane:nth-child(2)::before {
  background: #7b61ff;
}

.lane:nth-child(3)::before {
  background: var(--coral);
}

.lane:nth-child(4)::before {
  background: #457b9d;
}

.lane-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.lane-head strong,
.lane-head small {
  display: block;
}

.lane-head small {
  color: var(--muted);
  margin-top: 4px;
  font-size: 12px;
}

.lane-head b {
  color: var(--navy);
  font-size: 28px;
  line-height: 1;
}

.lane-meter {
  height: 7px;
  background: rgba(29, 53, 87, 0.08);
  border-radius: 99px;
  overflow: hidden;
}

.lane-meter span {
  display: block;
  height: 100%;
  background: var(--teal);
  border-radius: inherit;
  transition: width 220ms ease-out;
}

.conflict-overlay {
  margin: 12px 0 0;
  border: 1px solid rgba(231, 111, 81, 0.45);
  background: rgba(231, 111, 81, 0.12);
  color: #9b2f1f;
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 700;
}

.lane-items {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.resource-chip,
.empty-chip,
.status-pill,
.conflict-mark {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  line-height: 1.2;
  white-space: normal;
}

.resource-chip {
  background: rgba(42, 157, 143, 0.12);
  color: #126b61;
}

.empty-chip {
  color: var(--muted);
  background: rgba(29, 53, 87, 0.06);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--paper-strong);
}

table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

td strong,
td small {
  display: block;
}

td small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

tbody tr {
  transition: background 160ms ease;
}

tbody tr:hover {
  background: rgba(42, 157, 143, 0.06);
}

.resource-number {
  color: var(--navy);
  font-weight: 800;
}

.status-pill {
  background: rgba(29, 53, 87, 0.08);
  color: var(--navy);
  font-weight: 700;
}

.status-reminder {
  background: rgba(123, 97, 255, 0.12);
  color: #4731a6;
}

.status-assembly {
  background: rgba(231, 111, 81, 0.14);
  color: #9b2f1f;
}

.status-delivery,
.status-planned {
  background: rgba(42, 157, 143, 0.12);
  color: #126b61;
}

.status-blocked {
  background: rgba(231, 111, 81, 0.18);
  color: #8f271c;
}

.status-completed {
  background: rgba(29, 53, 87, 0.1);
  color: var(--muted);
}

.conflict-mark {
  margin-top: 6px;
  background: rgba(231, 111, 81, 0.14);
  color: #9b2f1f;
}

.row-action {
  min-width: 128px;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: var(--navy);
  color: var(--paper);
  padding: 7px 10px;
  font-weight: 700;
}

.row-action:hover {
  background: #13243c;
}

.row-action:disabled {
  cursor: default;
  opacity: 0.42;
}

.section-head {
  max-width: 760px;
  margin-bottom: 18px;
}

.section-head p {
  color: var(--muted);
  line-height: 1.5;
}

.timeline,
.settings-grid,
.team-grid {
  display: grid;
  gap: 10px;
}

.timeline-row,
.setting-item,
.team-member {
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 170px;
  gap: 14px;
  align-items: start;
}

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

.timeline-row p,
.setting-item p,
.team-member p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.settings-grid,
.team-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.setting-item strong {
  display: block;
  margin-top: 8px;
  color: var(--navy);
  font-size: 24px;
}

.team-member {
  display: grid;
  gap: 10px;
}

.team-member strong,
.team-member span,
.team-member small {
  display: block;
}

.team-member span,
.team-member small {
  color: var(--muted);
}

.load-bar {
  height: 8px;
  background: rgba(29, 53, 87, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.load-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--coral));
  border-radius: inherit;
}

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

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

  .sidebar {
    position: static;
    padding: 16px;
    gap: 16px;
  }

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

  .nav-tab {
    text-align: center;
  }

  .sidebar-note {
    display: none;
  }

  .workspace {
    padding: 18px 16px 28px;
  }

  .lane-board,
  .settings-grid,
  .team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar,
  .toolbar {
    display: grid;
  }

  .sync-state,
  .select-field,
  .search-field {
    width: 100%;
    max-width: none;
    flex-basis: auto;
  }

  .metrics-strip,
  .lane-board,
  .settings-grid,
  .team-grid,
  .timeline-row {
    grid-template-columns: 1fr;
  }

  .metrics-strip > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metrics-strip > div:last-child {
    border-bottom: 0;
  }

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

  h1 {
    font-size: 32px;
  }
}

