:root {
  --ink: #102a43;
  --paper: #f5f7fa;
  --red: #d64545;
  --teal: #56a3a6;
  --line: #d8e0e8;
  --muted: #66788a;
  --drawer: #e8d7b9;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: "Arial Narrow", "Roboto Condensed", Arial, sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

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

.rail {
  background: var(--ink);
  color: var(--paper);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.brand {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 12px;
  color: var(--paper);
  text-decoration: none;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

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

.tab {
  border: 0;
  color: #dbe7f1;
  background: transparent;
  text-align: left;
  padding: 11px 10px;
  border-left: 3px solid transparent;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 13px;
}

.tab:hover,
.tab.is-active {
  background: rgba(255, 255, 255, 0.08);
  border-left-color: var(--teal);
  color: var(--white);
}

.drawer-stack {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.drawer {
  min-height: 58px;
  background: linear-gradient(180deg, #f0dfbf, var(--drawer));
  color: var(--ink);
  border: 1px solid rgba(16, 42, 67, 0.28);
  box-shadow: inset 0 -8px 0 rgba(16, 42, 67, 0.08);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.drawer span {
  font-size: 12px;
  color: #6b5540;
}

.drawer strong {
  font-size: 14px;
}

.workspace {
  min-width: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  align-items: end;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 56px);
  line-height: 0.98;
  letter-spacing: 0;
}

.search {
  display: grid;
  gap: 6px;
}

.search label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.search input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

.search input:focus {
  border-color: var(--teal);
}

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

.metrics div {
  min-width: 0;
  padding: 13px 16px;
  border-right: 1px solid var(--line);
}

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

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.metrics strong {
  display: block;
  margin-top: 4px;
  font-size: 26px;
}

.board {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 18px;
  min-height: 0;
}

.timeline {
  position: sticky;
  top: 24px;
  align-self: start;
  display: grid;
  gap: 10px;
}

.stage {
  min-height: 74px;
  border-left: 4px solid var(--line);
  padding: 7px 0 7px 12px;
  display: grid;
  align-content: center;
  gap: 4px;
}

.stage span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  background: var(--line);
  color: var(--ink);
  font-weight: 800;
}

.stage strong {
  font-size: 14px;
}

.stage.is-current {
  border-left-color: var(--red);
}

.stage.is-current span {
  background: var(--red);
  color: var(--white);
}

.content {
  min-width: 0;
}

.portfolio-wall {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}

.project-tile {
  min-height: 176px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  padding: 16px;
  text-align: left;
  cursor: pointer;
  display: grid;
  align-content: space-between;
  gap: 12px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.project-tile:hover,
.project-tile.is-selected {
  transform: translateY(-2px);
  border-color: var(--ink);
  box-shadow: 0 16px 30px rgba(16, 42, 67, 0.12);
}

.project-tile.status-hot {
  border-top: 5px solid var(--red);
}

.project-tile.status-risk {
  border-top: 5px solid #e1a33d;
}

.project-tile.status-steady {
  border-top: 5px solid var(--teal);
}

.tile-top,
.tile-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.tile-top b,
.tile-meta,
.tile-bottom span {
  color: var(--muted);
  font-size: 13px;
}

.tile-top em {
  color: var(--red);
  font-style: normal;
  font-size: 12px;
  text-transform: uppercase;
}

.tile-title {
  font-size: 24px;
  line-height: 1.08;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.tile-meta {
  line-height: 1.35;
}

.tile-bottom b {
  font-size: 24px;
}

.detail-sheet {
  background: #fffaf1;
  border-left: 1px solid #dfd1b9;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sheet-kicker {
  color: #7e684a;
  text-transform: uppercase;
  font-size: 12px;
}

#quickAction {
  border: 0;
  background: var(--ink);
  color: var(--white);
  min-height: 38px;
  padding: 0 12px;
  cursor: pointer;
}

#quickAction:hover {
  background: var(--red);
}

.assembly-sheet h2 {
  margin: 0 0 18px;
  font-size: 28px;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

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

dl div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid #e5d8c2;
  padding-bottom: 8px;
}

dt {
  color: #7e684a;
  font-size: 12px;
  text-transform: uppercase;
}

dd {
  margin: 0;
  line-height: 1.4;
}

.quality,
.load {
  height: 10px;
  background: #d9e2ea;
  overflow: hidden;
}

.quality {
  margin: 22px 0;
}

.quality span,
.load span {
  display: block;
  height: 100%;
  background: var(--teal);
}

.next-action {
  margin: 0;
  padding: 14px;
  background: rgba(214, 69, 69, 0.1);
  line-height: 1.5;
}

.empty {
  min-height: 200px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.log-list,
.team-list {
  display: grid;
  gap: 10px;
}

.log-row,
.team-row,
.workflow-step {
  background: var(--white);
  border: 1px solid var(--line);
}

.log-row {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 16px;
  padding: 14px;
}

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

.log-row strong,
.log-row p,
.log-row span {
  display: block;
  margin: 0 0 5px;
  line-height: 1.4;
}

.log-row p,
.log-row span {
  color: var(--muted);
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.workflow-step {
  min-height: 190px;
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.workflow-step span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--white);
  font-weight: 800;
}

.workflow-step h3 {
  margin: 0;
  font-size: 22px;
}

.workflow-step p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.team-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 220px) 52px minmax(120px, 1fr);
  align-items: center;
  gap: 14px;
  padding: 14px;
}

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

.team-row span,
.team-row em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.4;
}

.muted {
  color: var(--muted);
  line-height: 1.55;
}

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

  .detail-sheet {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid #dfd1b9;
  }

  .workflow-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

@media (max-width: 760px) {
  .shell {
    display: block;
  }

  .rail {
    padding: 14px;
    gap: 14px;
  }

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

  .tab {
    text-align: center;
    padding: 10px 6px;
    border-left: 0;
    border-bottom: 3px solid transparent;
    font-size: 11px;
  }

  .tab.is-active,
  .tab:hover {
    border-bottom-color: var(--teal);
  }

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

  .drawer {
    min-height: 50px;
    display: grid;
    gap: 2px;
  }

  .workspace,
  .detail-sheet {
    padding: 16px;
  }

  .topline,
  .board {
    grid-template-columns: 1fr;
  }

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

  .metrics div:nth-child(2n) {
    border-right: 0;
  }

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

  .stage {
    min-height: 80px;
    border-left: 0;
    border-top: 4px solid var(--line);
    padding: 10px 4px 0;
  }

  .portfolio-wall,
  .workflow-grid {
    grid-template-columns: 1fr;
  }

  .log-row,
  .team-row {
    grid-template-columns: 1fr;
  }

  dl div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
