:root {
  --ink: #1d3557;
  --paper: #fff8f0;
  --surface: #ffffff;
  --line: #d8d1c6;
  --muted: #6f737b;
  --teal: #2a9d8f;
  --coral: #e76f51;
  --amber: #d99b2b;
  --shadow: 0 18px 50px rgba(29, 53, 87, .10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100svh;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(29, 53, 87, .05) 1px, transparent 1px) 0 0 / 46px 46px,
    var(--paper);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100svh;
  padding: 22px;
  color: var(--paper);
  background: var(--ink);
}

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

.brand img {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
}

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

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

.brand small,
.eyebrow,
.tab,
.chip,
.metric span,
.metric small,
th,
.side-meter span,
.side-meter small {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  letter-spacing: 0;
}

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

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

.tab {
  width: 100%;
  padding: 11px 12px;
  color: rgba(255, 248, 240, .76);
  text-align: left;
  background: transparent;
  border: 1px solid rgba(255, 248, 240, .14);
  border-radius: 8px;
  transition: background .18s ease, color .18s ease, border .18s ease;
}

.tab:hover,
.tab.is-active {
  color: var(--paper);
  background: rgba(42, 157, 143, .18);
  border-color: rgba(42, 157, 143, .55);
}

.side-meter {
  margin-top: auto;
  padding: 14px;
  background: rgba(255, 248, 240, .08);
  border: 1px solid rgba(255, 248, 240, .14);
  border-radius: 8px;
}

.side-meter span,
.side-meter strong,
.side-meter small {
  display: block;
}

.side-meter strong {
  margin: 7px 0;
  font-size: 19px;
}

.side-meter small {
  color: var(--teal);
}

.side-meter small.is-warn {
  color: var(--amber);
}

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

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1;
}

h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.chip,
.small-action,
.note-form button {
  min-height: 36px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: transform .16s ease, border .16s ease, background .16s ease;
}

.chip:hover,
.small-action:hover,
.note-form button:hover {
  transform: translateY(-1px);
  border-color: var(--teal);
}

.chip.is-active,
.note-form button,
.small-action {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
}

.view-surface {
  min-width: 0;
}

.loading,
.error-state {
  display: grid;
  place-items: center;
  min-height: 280px;
  color: var(--muted);
  background: rgba(255, 255, 255, .68);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.error-state {
  gap: 8px;
  color: var(--coral);
}

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

.metric {
  min-height: 110px;
  padding: 15px;
  background: var(--surface);
  border-top: 4px solid var(--teal);
  box-shadow: var(--shadow);
}

.metric-risk {
  border-color: var(--coral);
}

.metric-deal {
  border-color: var(--amber);
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin: 8px 0;
  font-size: clamp(28px, 3.5vw, 42px);
  line-height: 1;
}

.resource-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.resource-chip {
  min-width: 160px;
  padding: 11px;
  background: rgba(255, 255, 255, .78);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.resource-chip div {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}

.resource-chip strong,
.resource-chip span,
.resource-chip small {
  display: block;
}

.resource-chip strong {
  font-size: 13px;
  line-height: 1.2;
}

.resource-chip span,
.resource-chip small {
  color: var(--muted);
  font-size: 12px;
}

meter {
  width: 100%;
  height: 8px;
  margin-top: 10px;
}

meter::-webkit-meter-bar {
  background: #ece4d9;
  border: 0;
  border-radius: 999px;
}

meter::-webkit-meter-optimum-value {
  background: var(--teal);
  border-radius: 999px;
}

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

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

.lane-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 10px;
  min-height: 310px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.lane {
  min-width: 190px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.lane header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.lane header span {
  font-weight: 700;
}

.lane header strong {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #fff;
  background: var(--ink);
  border-radius: 50%;
  font-size: 13px;
}

.lane-body {
  display: grid;
  gap: 8px;
  min-height: 252px;
  padding: 10px;
}

.booking-block {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 104px;
  padding: 10px;
  color: var(--ink);
  text-align: left;
  background: var(--surface);
  border: 1px solid transparent;
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(29, 53, 87, .08);
  transition: transform .16s ease, border .16s ease, box-shadow .16s ease;
}

.booking-block:hover,
.booking-block.is-selected {
  transform: translateY(-2px);
  border-color: var(--teal);
  box-shadow: 0 16px 30px rgba(29, 53, 87, .12);
}

.booking-block.risk-medium {
  border-left-color: var(--amber);
}

.booking-block.risk-high {
  border-left-color: var(--coral);
}

.booking-block span,
.booking-block em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.3;
}

.booking-time {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.empty-lane {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.inspector,
.data-panel,
.note-form,
.timeline,
.workflow-step,
.team-row,
.service-list {
  background: rgba(255, 255, 255, .82);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.inspector {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.inspector-section {
  display: grid;
  gap: 10px;
}

.slot-detail {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 7px 10px;
  margin: 0;
  font-size: 13px;
}

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

.slot-detail dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.conflict-list {
  display: grid;
  gap: 8px;
}

.conflict {
  padding: 10px;
  background: #fff;
  border-left: 4px solid var(--amber);
  border-radius: 8px;
}

.severity-high {
  border-left-color: var(--coral);
}

.conflict span,
.conflict small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.data-panel {
  margin-top: 12px;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

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

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

th,
td {
  padding: 11px 14px;
  border-bottom: 1px solid #eee6da;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

td {
  font-size: 14px;
}

.version {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  color: #fff;
  background: var(--ink);
  border-radius: 999px;
}

.history-layout {
  display: grid;
  gap: 12px;
}

.note-form {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.note-form label {
  font-weight: 700;
}

.note-form div {
  display: flex;
  gap: 8px;
}

.note-form input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.timeline {
  display: grid;
  overflow: hidden;
}

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

.timeline-row:last-child {
  border-bottom: 0;
}

.timeline-row time {
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.timeline-row p {
  margin: 4px 0;
}

.timeline-row small {
  color: var(--muted);
}

.workflow-board {
  display: grid;
  gap: 10px;
}

.workflow-step {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 140px;
  gap: 14px;
  align-items: center;
  min-height: 96px;
  padding: 14px;
  transition: transform .16s ease, border .16s ease;
}

.workflow-step:hover {
  transform: translateX(3px);
  border-color: var(--teal);
}

.workflow-step > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  background: var(--ink);
  border-radius: 8px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.workflow-step p {
  margin: 5px 0 0;
  color: var(--muted);
}

.workflow-step > strong {
  color: var(--teal);
  text-align: right;
}

.team-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 12px;
}

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

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

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

.team-row span,
.team-row small,
.service-task span,
.service-task p {
  color: var(--muted);
}

.service-list {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 14px;
}

.service-task {
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.service-task p {
  margin: 5px 0;
}

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

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

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

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

  .tab {
    text-align: center;
  }

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

@media (max-width: 760px) {
  .workspace,
  .sidebar {
    padding: 14px;
  }

  .topbar,
  .panel-header,
  .note-form div {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar {
    justify-content: flex-start;
  }

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

  .timeline-row,
  .workflow-step,
  .team-row {
    grid-template-columns: 1fr;
  }

  .workflow-step > strong {
    text-align: left;
  }

  .metric {
    min-height: 96px;
  }
}

@media (max-width: 460px) {
  .tabs,
  .metric-rail {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 30px;
  }
}

