:root {
  --ink: #14213d;
  --paper: #ffffff;
  --line: #d8dde6;
  --muted: #637084;
  --action: #fca311;
  --teal: #2a9d8f;
  --soft: #f4f6f8;
  --danger: #b83b3b;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(300px, 28vw) 1fr;
  background:
    linear-gradient(90deg, rgba(20, 33, 61, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(20, 33, 61, 0.04) 1px, transparent 1px);
  background-size: 36px 36px;
}

.mobile-field {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 26px;
  background: var(--ink);
  color: var(--paper);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 30px;
  line-height: 1;
}

.brand img {
  flex: 0 0 auto;
}

.field-card {
  display: grid;
  gap: 18px;
  min-height: 390px;
  padding: 2px 0;
  align-content: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.mobile-field .eyebrow {
  color: rgba(255, 255, 255, 0.68);
}

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

h1 {
  margin-bottom: 8px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(38px, 5vw, 72px);
  line-height: 0.95;
  font-weight: 500;
}

h2 {
  margin-bottom: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(28px, 3vw, 48px);
  line-height: 1;
  font-weight: 500;
}

h3 {
  margin-bottom: 0;
  font-size: 16px;
}

h4 {
  margin-bottom: 6px;
  font-size: 18px;
  line-height: 1.2;
}

.field-meta {
  display: grid;
  gap: 10px;
  margin: 0;
}

.field-meta div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

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

.mobile-field dt {
  color: rgba(255, 255, 255, 0.58);
}

dd {
  margin: 0;
  font-weight: 800;
  text-align: right;
}

.primary-btn,
.secondary-btn,
.icon-btn,
.mini,
.tab,
.alert-chip,
.pin {
  border: 0;
  border-radius: 6px;
}

.primary-btn {
  min-height: 48px;
  padding: 0 18px;
  background: var(--action);
  color: #16110a;
  font-weight: 900;
}

.secondary-btn {
  min-height: 42px;
  padding: 0 14px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 800;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
}

.tab {
  min-height: 44px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--paper);
  font-weight: 800;
}

.tab.is-active {
  background: var(--paper);
  color: var(--ink);
}

.dispatch-console {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 26px;
}

.console-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.search {
  width: min(360px, 100%);
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.search input:focus {
  border-color: var(--action);
  box-shadow: 0 0 0 3px rgba(252, 163, 17, 0.24);
}

.alert-strip {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.ok-pill,
.alert-chip {
  white-space: nowrap;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
}

.alert-chip strong {
  color: var(--danger);
}

.workspace-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(420px, 1.4fr) minmax(250px, 0.7fr);
  gap: 18px;
  align-items: stretch;
}

.orbit-board,
.work-panel,
.inspector {
  min-width: 0;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.orbit-board {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  background: var(--ink);
}

.orbit-board:before {
  position: absolute;
  inset: 14%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  content: "";
  transform: rotate(-18deg);
}

.orbit-line {
  position: absolute;
  inset: 28% 18%;
  border: 3px solid var(--teal);
  border-left-color: transparent;
  border-radius: 50%;
  transform: rotate(24deg);
}

.pin {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.pin span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--action);
}

.pin-a { top: 18%; left: 18%; }
.pin-b { top: 35%; right: 11%; }
.pin-c { bottom: 26%; left: 15%; }
.pin-d { bottom: 14%; right: 18%; }

.work-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.icon-btn {
  width: 38px;
  height: 38px;
  background: var(--soft);
  color: var(--ink);
  font-size: 20px;
}

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

.metric {
  min-height: 78px;
  display: grid;
  gap: 4px;
  align-content: center;
  padding: 12px;
  border-right: 1px solid var(--line);
}

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

.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric strong {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 30px;
  line-height: 1;
}

.content-list {
  overflow: auto;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.case-row,
.detail-row,
.calendar-row,
.report-row {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.case-row {
  grid-template-columns: minmax(0, 1fr) auto;
  transition: border-color 140ms ease, transform 140ms ease;
}

.case-row:hover,
.case-row.is-active {
  border-color: var(--action);
  transform: translateY(-1px);
}

.case-code,
.detail-row header span,
.calendar-row span,
.report-row span,
.slot span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.stage-rail span {
  min-height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.stage-rail .is-current {
  border-color: var(--action);
  background: var(--action);
  color: #16110a;
}

.row-actions {
  min-width: 150px;
  display: grid;
  gap: 8px;
  align-content: start;
  justify-items: end;
}

.value {
  font-weight: 900;
}

.mini {
  min-height: 32px;
  padding: 0 10px;
  background: var(--soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.mini.danger {
  background: #fff0ec;
  color: var(--danger);
}

.detail-row dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-row header,
.calendar-row,
.report-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
}

.calendar-row time,
.report-row b {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 24px;
}

mark {
  border-radius: 999px;
  padding: 6px 9px;
  background: var(--soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

mark.conflict {
  background: #fff0ec;
  color: var(--danger);
}

mark.in_progress {
  background: #e8f5f2;
  color: var(--teal);
}

.inspector {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

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

.slot {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-left: 4px solid var(--line);
  background: var(--soft);
  border-radius: 6px;
}

.slot.conflict {
  border-left-color: var(--danger);
}

.slot.in_progress {
  border-left-color: var(--teal);
}

.terminal {
  min-height: 116px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border-radius: 6px;
  background: #0d1526;
  color: #e8eefc;
  font-size: 12px;
  white-space: pre-wrap;
}

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

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

  .mobile-field {
    min-height: auto;
  }

  .field-card {
    min-height: auto;
  }

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

  .orbit-board {
    min-height: 340px;
  }
}

@media (max-width: 700px) {
  .mobile-field,
  .dispatch-console {
    padding: 18px;
  }

  .console-head {
    align-items: stretch;
    flex-direction: column;
  }

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

  .case-row,
  .detail-row header,
  .calendar-row,
  .report-row {
    grid-template-columns: 1fr;
  }

  .row-actions {
    justify-items: stretch;
  }

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

  .detail-row dl {
    grid-template-columns: 1fr;
  }
}

