#zoneWrapper {
  position: relative;
  height: 70vh;
  max-height: 70vh;
  width: 100%;
  overflow: hidden;
}

#zoneImage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

#zoneCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.top-view-stage {
  --top-view-grid-size: 5%;
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 2px solid #6c757d;
  border-radius: 0.5rem;
  background-color: #f8f9fa;
  background-image:
    linear-gradient(rgba(108, 117, 125, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108, 117, 125, 0.08) 1px, transparent 1px);
  background-size: var(--top-view-grid-size) var(--top-view-grid-size);
  user-select: none;
  touch-action: none;
}

.top-view-stage.grid-disabled {
  background-image: none;
}

.top-view-empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 2rem;
  color: #6c757d;
  text-align: center;
  pointer-events: none;
}

.top-view-image-box {
  position: absolute;
  z-index: 2;
  transform-origin: center;
  cursor: grab;
  touch-action: none;
}

.top-view-image-box.is-dragging {
  cursor: grabbing;
}

.top-view-image-box > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.top-view-resize-handle,
.top-view-rotate-handle {
  position: absolute;
  z-index: 4;
  width: 1.15rem;
  height: 1.15rem;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #0d6efd;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
  touch-action: none;
}

.top-view-resize-handle.top-left { left: 0; top: 0; transform: translate(-50%, -50%); cursor: nwse-resize; }
.top-view-resize-handle.top-right { right: 0; top: 0; transform: translate(50%, -50%); cursor: nesw-resize; }
.top-view-resize-handle.bottom-left { left: 0; bottom: 0; transform: translate(-50%, 50%); cursor: nesw-resize; }
.top-view-resize-handle.bottom-right { right: 0; bottom: 0; transform: translate(50%, 50%); cursor: nwse-resize; }

.top-view-rotate-handle {
  left: 50%;
  top: -2rem;
  width: 1.65rem;
  height: 1.65rem;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  line-height: 1;
  cursor: grab;
}

.top-view-rotate-handle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 2px;
  height: 1rem;
  background: #0d6efd;
}

.top-view-button-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.top-view-compartment-button {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 12%;
  height: 8%;
  padding: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.admin-header,
.admin-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

.admin-vehicle-picker,
.admin-panel,
.admin-action-card,
.admin-controls-card {
  border: 1px solid var(--at-border, #dee2e6);
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 0.75rem 2rem rgba(32, 37, 43, 0.06);
}

.admin-vehicle-picker {
  padding: 1.5rem;
  border-left: 0.35rem solid var(--at-primary, #cd5449);
}

.admin-workspace-nav {
  padding: 0.4rem;
  border: 1px solid var(--at-border, #dee2e6);
  border-radius: 0.9rem;
  background: #fff;
}

.admin-workspace-nav .nav {
  gap: 0.35rem;
}

.admin-workspace-nav .nav-link {
  flex: 0 0 auto;
  border-radius: 0.65rem;
  color: var(--at-ink, #20252b);
  font-weight: 650;
  white-space: nowrap;
}

.admin-workspace-nav .nav-link.active {
  background: var(--at-primary, #cd5449);
  color: #fff;
}

.admin-panel {
  padding: clamp(1rem, 3vw, 2rem);
}

.admin-panel-heading {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--at-border, #dee2e6);
}

.admin-controls-card,
.admin-action-card {
  padding: 1.25rem;
}

.admin-action-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.admin-danger-zone {
  padding: 1rem;
  border: 1px solid rgba(220, 53, 69, 0.35);
  border-radius: 0.75rem;
  background: rgba(220, 53, 69, 0.06);
}

@media (max-width: 575.98px) {
  .admin-header,
  .admin-panel-heading {
    display: block;
  }
}

.top-view-compartment-button.is-dragging {
  cursor: grabbing;
  z-index: 6;
}

@media (max-width: 576px) {
  .top-view-compartment-button {
    padding: 0.1rem;
    font-size: 0.8rem;
  }
}
