/* ============================================================================
   Airspace — Left Sidebar: Drone List & Zone List
   ============================================================================ */

.sp-sidebar {
  width: 336px;
  min-width: 336px;
  background: var(--sp-panel);
  border-right: 1px solid var(--sp-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.25s, min-width 0.25s;
  z-index: 10;
}
.sp-sidebar.collapsed {
  width: 0;
  min-width: 0;
  border-right: none;
}
.sp-sidebar.collapsed > * { display: none; }

.sp-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 212, 255, 0.12);
  flex-shrink: 0;
}

/* Tab strip + collapse button share the top row — kill the side padding
   so each tab spans full width and the collapse button hugs the edge. */
.sp-sidebar-tabhead {
  padding: 0;
  gap: 0;
}

.sp-panel-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--sp-cyan);
  text-transform: uppercase;
}

.sp-sidebar-toggle svg {
  transition: transform 0.25s;
}
.sp-sidebar.collapsed + .sp-map-canvas .sp-sidebar-expand { display: flex; }
.sp-sidebar-tabhead .sp-sidebar-toggle {
  padding: 10px 10px;
  align-self: stretch;
  display: flex;
  align-items: center;
  border-left: 1px solid rgba(0, 212, 255, 0.08);
}

/* --- Tab Strip ----------------------------------------------------------- */
.sp-tabstrip {
  display: flex;
  flex: 1;
  align-items: stretch;
  min-width: 0;
}

.sp-tab {
  flex: 1;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 6px 9px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--sp-text-dim);
  font-family: var(--sp-font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
  min-width: 0;
}
.sp-tab:hover {
  color: var(--sp-text);
  background: rgba(0, 212, 255, 0.04);
}
.sp-tab.is-active {
  color: var(--sp-cyan);
  border-bottom-color: var(--sp-cyan);
}

.sp-tab-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-tab-count {
  font-family: var(--sp-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--sp-text-dim);
  padding: 1px 5px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  min-width: 18px;
  text-align: center;
  letter-spacing: 0;
}
.sp-tab.is-active .sp-tab-count {
  color: var(--sp-cyan);
  background: rgba(0, 212, 255, 0.1);
}

.sp-tab-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff5c79;
  box-shadow: 0 0 6px rgba(255, 92, 121, 0.55);
  animation: pulse 1.4s ease-in-out infinite;
}

/* --- Tab Panels ---------------------------------------------------------- */
.sp-tabpanel {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.sp-tabpanel.is-active {
  display: flex;
}

.sp-sidebar-subheader {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 6px 12px;
  border-bottom: 1px solid rgba(0, 212, 255, 0.06);
  flex-shrink: 0;
}

.sp-sidebar-filter {
  padding: 8px 10px;
  flex-shrink: 0;
}
.sp-sidebar-search {
  font-size: 12px !important;
  padding: 6px 8px !important;
}

.sp-sidebar-section-meta {
  font-size: 10px;
  color: var(--sp-text-dim);
  font-family: var(--sp-mono);
  text-transform: uppercase;
}

/* --- Drone List ----------------------------------------------------------- */
.sp-drone-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

/* --- Alert List ----------------------------------------------------------- */
.sp-alert-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}

.sp-alert-list .sp-empty-list {
  padding: 16px 12px;
}

.sp-alert-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.15s ease;
  border-left: 3px solid transparent;
}

.sp-alert-item:hover {
  background: rgba(0, 212, 255, 0.06);
}

.sp-alert-item.is-critical {
  border-left-color: rgba(255, 92, 121, 0.55);
}

.sp-alert-item.is-warning {
  border-left-color: rgba(255, 177, 74, 0.55);
}

.sp-alert-item.is-info {
  border-left-color: rgba(118, 213, 255, 0.55);
}

.sp-alert-item.is-dismissed {
  background: rgba(255, 255, 255, 0.03);
}

.sp-alert-item-dot {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--sp-cyan);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.25);
}

.sp-alert-item.is-critical .sp-alert-item-dot {
  background: #ff5c79;
  box-shadow: 0 0 12px rgba(255, 92, 121, 0.3);
}

.sp-alert-item.is-warning .sp-alert-item-dot {
  background: #ffb14a;
  box-shadow: 0 0 12px rgba(255, 177, 74, 0.25);
}

.sp-alert-item-copy {
  flex: 1;
  min-width: 0;
}

.sp-alert-item-topline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sp-alert-item-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--sp-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-alert-item-state {
  flex-shrink: 0;
  min-height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 9px;
  line-height: 18px;
  letter-spacing: 0.08em;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(225, 236, 247, 0.72);
  background: rgba(255, 255, 255, 0.08);
}

.sp-alert-item-state.is-dismissed {
  color: #d7f3ff;
  background: rgba(118, 213, 255, 0.14);
}

.sp-alert-item-desc {
  margin-top: 3px;
  font-size: 11px;
  color: var(--sp-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-alert-item-meta {
  margin-top: 5px;
  font-size: 10px;
  color: var(--sp-text-dim);
  font-family: var(--sp-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-drone-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.15s;
  border-left: 3px solid transparent;
}
.sp-drone-item:hover {
  background: rgba(0, 212, 255, 0.06);
}
.sp-drone-item.active {
  background: rgba(0, 212, 255, 0.1);
  border-left-color: var(--sp-cyan);
}
.sp-drone-item.stale {
  opacity: 0.5;
}

.sp-drone-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.3);
  flex-shrink: 0;
}
.sp-drone-icon.aircraft,
.sp-drone-icon.heavy_jet,
.sp-drone-icon.medium_jet,
.sp-drone-icon.light_aircraft { background: rgba(255, 170, 0, 0.1); border-color: rgba(255, 170, 0, 0.3); }
.sp-drone-icon.helicopter { background: rgba(0, 255, 136, 0.1); border-color: rgba(0, 255, 136, 0.3); }
.sp-drone-icon.vehicle { background: rgba(122, 166, 255, 0.1); border-color: rgba(122, 166, 255, 0.3); }
.sp-drone-icon.operator { background: rgba(179, 136, 255, 0.1); border-color: rgba(179, 136, 255, 0.3); }
.sp-drone-icon.unknown { background: rgba(132, 148, 167, 0.1); border-color: rgba(132, 148, 167, 0.3); }
.sp-drone-icon.friendly { background: rgba(255, 215, 0, 0.1); border-color: rgba(255, 215, 0, 0.3); }

.sp-drone-item.friendly {
  border-left-color: rgba(255, 215, 0, 0.5);
}
.sp-drone-item.friendly .sp-drone-name {
  color: #ffd700;
}

.sp-drone-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.sp-drone-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--sp-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-drone-meta {
  font-size: 13px;
  color: var(--sp-text-dim);
  font-family: var(--sp-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-drone-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sp-drone-status.live { background: var(--sp-green); box-shadow: 0 0 6px rgba(0, 255, 136, 0.4); }
.sp-drone-status.stale { background: var(--sp-amber); }
.sp-drone-status.lost { background: var(--sp-red); }

/* --- Zone List ------------------------------------------------------------ */
.sp-zone-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.sp-zone-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 12px;
}
.sp-zone-item:hover { background: rgba(0, 212, 255, 0.06); }
.sp-zone-item.active { background: rgba(0, 212, 255, 0.1); }

.sp-zone-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}
.sp-zone-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--sp-text);
}
.sp-zone-type {
  font-size: 10px;
  color: var(--sp-text-dim);
  font-family: var(--sp-mono);
  text-transform: uppercase;
}

/* --- Empty State ---------------------------------------------------------- */
.sp-empty-list {
  text-align: center;
  color: var(--sp-text-dim);
  font-size: 12px;
  padding: 20px 12px;
}
