:root {
  --ink: #102a43;
  --paper: #f5f7fa;
  --signal: #d64545;
  --teal: #56a3a6;
  --line: rgba(16, 42, 67, 0.16);
  --muted: #64748b;
  --white: #ffffff;
  --shadow: 0 18px 45px rgba(16, 42, 67, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
  background:
    linear-gradient(90deg, rgba(16, 42, 67, 0.06) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(180deg, #f5f7fa 0%, #eef4f4 100%);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

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

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

.brand img {
  width: 46px;
  height: 46px;
}

.brand strong {
  display: block;
  font-size: 23px;
  line-height: 1;
}

.brand small,
.rail-note,
.drawer-index {
  color: rgba(245, 247, 250, 0.74);
}

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

.tab {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(245, 247, 250, 0.14);
  border-radius: 6px;
  padding: 10px 12px;
  background: transparent;
  color: var(--paper);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

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

.drawer-index {
  display: grid;
  gap: 7px;
  margin-top: auto;
}

.drawer-index span {
  display: block;
  border-top: 1px solid rgba(245, 247, 250, 0.24);
  padding: 10px 0 4px;
  font-size: 12px;
  letter-spacing: 0;
}

.rail-note {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(245, 247, 250, 0.2);
  padding-top: 16px;
}

.workspace {
  min-width: 0;
  padding: 26px clamp(16px, 3vw, 42px) 42px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  margin-bottom: 20px;
}

.eyebrow,
.mono {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--teal);
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(34px, 5vw, 68px);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1.02;
}

h3 {
  margin-bottom: 10px;
  font-size: 23px;
  line-height: 1.05;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

.search-box {
  display: grid;
  grid-template-columns: auto minmax(150px, 220px);
  gap: 8px;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.72);
}

.search-box .mono {
  margin: 0;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.icon-button,
.primary-button,
.dialog-actions button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  background: var(--white);
  color: var(--ink);
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.icon-button {
  width: 42px;
  padding: 0;
  font-size: 22px;
}

.primary-button {
  border-color: var(--signal);
  background: var(--signal);
  color: var(--white);
}

.icon-button:hover,
.primary-button:hover,
.dialog-actions button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

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

.metric {
  min-width: 0;
  padding: 18px;
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: 0;
}

.metric strong {
  display: block;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1;
}

.metric small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.35;
}

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

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

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

.view.is-visible {
  display: block;
}

.blueprint-wall {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--shadow);
}

.lane {
  position: relative;
  display: grid;
  min-height: 188px;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(86, 163, 166, 0.13), transparent 52%),
    var(--white);
  color: var(--ink);
  text-align: left;
  align-content: space-between;
  overflow: hidden;
}

.lane:last-child {
  border-right: 0;
}

.lane:hover {
  background:
    linear-gradient(180deg, rgba(214, 69, 69, 0.1), transparent 62%),
    var(--white);
}

.lane .pin {
  width: 32px;
  height: 32px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}

.lane strong {
  margin-top: 28px;
  font-size: clamp(25px, 3vw, 40px);
  line-height: 0.94;
}

.lane small,
.lane em {
  color: var(--muted);
  font-style: normal;
}

.score {
  display: block;
  width: 100%;
  height: 7px;
  margin: 14px 0 8px;
  overflow: hidden;
  background: rgba(16, 42, 67, 0.1);
}

.score i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--signal));
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 18px;
  align-items: start;
}

.inventory,
.detail-sheet,
.timeline,
.workflow-grid,
.team-grid {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
}

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

.section-head .mono {
  margin: 0;
  color: var(--signal);
}

.request-table {
  display: grid;
}

.initiative-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 70px 92px;
  gap: 14px;
  align-items: center;
  min-height: 72px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 13px 18px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.initiative-row:hover,
.initiative-row.is-active {
  background: rgba(86, 163, 166, 0.12);
}

.row-stage,
.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  text-align: center;
  font-size: 12px;
  line-height: 1;
}

.row-main {
  min-width: 0;
}

.row-main strong,
.row-main small {
  display: block;
  overflow-wrap: anywhere;
}

.row-main small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.25;
}

.row-quality {
  font-size: 23px;
  font-weight: 700;
}

.status-approved {
  color: #1f7a4d;
}

.status-pending {
  color: #9a5a00;
}

.status-blocked {
  color: var(--signal);
}

.detail-sheet {
  position: sticky;
  top: 22px;
  padding: 20px;
}

.detail-sheet p {
  color: var(--muted);
  line-height: 1.7;
}

.detail-sheet dl {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
}

.detail-sheet dl div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

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

dd {
  min-width: 0;
  margin: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.timeline {
  display: grid;
}

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

.timeline-item time {
  color: var(--signal);
  font-weight: 700;
}

.timeline-item p {
  margin: 6px 0;
  color: var(--muted);
  line-height: 1.55;
}

.timeline-item span {
  color: var(--teal);
  font-size: 12px;
  text-transform: uppercase;
}

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

.workflow-step,
.member {
  min-height: 210px;
  padding: 18px;
  border-right: 1px solid var(--line);
}

.workflow-step:last-child,
.member:last-child {
  border-right: 0;
}

.workflow-step p,
.member p {
  color: var(--muted);
  line-height: 1.65;
}

.step-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
}

.member strong,
.member span {
  display: block;
}

.member span,
.member em {
  color: var(--muted);
  font-style: normal;
}

dialog {
  width: min(520px, calc(100vw - 24px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(16, 42, 67, 0.44);
}

.dialog-form {
  display: grid;
  gap: 18px;
  padding: 22px;
  background: var(--paper);
}

.dialog-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.dialog-form textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  color: var(--ink);
}

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

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

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

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

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

  .drawer-index {
    display: none;
  }

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

  .detail-sheet {
    position: static;
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 18px 12px 28px;
  }

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

  .quick-actions {
    justify-content: stretch;
  }

  .search-box {
    grid-template-columns: 1fr;
    width: 100%;
    padding: 8px 10px;
  }

  .metrics,
  .blueprint-wall,
  .workflow-grid,
  .team-grid {
    grid-template-columns: 1fr;
  }

  .metric,
  .lane,
  .workflow-step,
  .member {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .lane {
    min-height: 136px;
  }

  .initiative-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .row-stage,
  .status-pill {
    width: max-content;
    max-width: 100%;
  }

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

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