.dispatch-desktop {
  min-height: 100vh;
}

.dispatch-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(20, 32, 24, 0.95);
}

.dispatch-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dispatch-layout {
  display: grid;
  grid-template-columns: 280px 1fr 220px;
  gap: 0.75rem;
  padding: 0.75rem;
  max-width: 1600px;
  margin: 0 auto;
}

.dispatch-sidebar,
.dispatch-sidebar-right {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dispatch-map-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

.map-card {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dispatch-map {
  width: 100%;
  height: min(62vh, 520px);
  min-height: 360px;
  border-radius: 10px;
  border: 1px solid #3a5a3a;
  background: #1a2830;
}

.dispatch-grid {
  max-width: 960px;
  display: grid;
  gap: 0.75rem;
}

.dispatch-grid .wide {
  grid-column: 1 / -1;
}

.log-pre {
  background: #0a120e;
  border: 1px solid #3a5a3a;
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 11px;
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
}

.log-pre.small {
  max-height: 100px;
}

/* AUTOPILOT pill switch */
.autopilot-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  user-select: none;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #4a7a4a;
  background: rgba(30, 50, 36, 0.9);
}

.autopilot-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #9fefb0;
}

.autopilot-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.autopilot-pill {
  width: 2.4rem;
  height: 1.25rem;
  border-radius: 999px;
  background: #3a4a3a;
  position: relative;
  transition: background 0.15s ease;
  border: 1px solid #5a7a5a;
}

.autopilot-pill::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 2px;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #c8d8c8;
  transition: transform 0.15s ease, background 0.15s ease;
}

.autopilot-switch input:checked + .autopilot-pill {
  background: #2f8f5b;
  border-color: #7dffb0;
}

.autopilot-switch input:checked + .autopilot-pill::after {
  transform: translateX(1.05rem);
  background: #e8fff0;
}

.autopilot-queue {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 280px;
  overflow: auto;
  font-size: 0.78rem;
}

.autopilot-queue li {
  padding: 0.45rem 0.35rem;
  border-bottom: 1px solid #2a4032;
  color: #c8d8c8;
}

.autopilot-queue li strong {
  color: #9fefb0;
  display: block;
}

#cmd-input {
  width: 100%;
  padding: 0.5rem;
  background: #142018;
  color: #e6f0e6;
  border: 1px solid #3a5a3a;
  border-radius: 8px;
  box-sizing: border-box;
}

.log-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.compact-list {
  font-size: 12px;
  max-height: 120px;
  overflow-y: auto;
}

.devices.compact {
  max-height: 160px;
  overflow-y: auto;
  font-size: 12px;
}

@media (max-width: 1100px) {
  .dispatch-layout {
    grid-template-columns: 1fr;
  }
  .dispatch-sidebar-right {
    order: 3;
  }
}
