/* ── 14. Detail Panel ─────────────────────────────────────── */
#detail-panel {
  width: var(--detail-w);
  height: auto;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transform: translateX(100%);
  transition: transform var(--t-spring);
  z-index: 1000;
  position: fixed;
  right: 0;
  top: var(--topbar-h);
  bottom: 0;
  box-shadow: var(--shadow-lg);
}

#detail-panel.open {
  transform: translateX(0);
}

.detail-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: flex-start;
  gap: 11px;
  background: var(--bg-elevated);
}

.detail-close-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  color: var(--text-tertiary);
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
  transition: all var(--t-fast);
}

.detail-close-btn:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.detail-vehicle-emoji {
  font-size: 26px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border-radius: var(--r-md);
  border: 1px solid var(--border-medium);
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

.detail-vehicle-info {
  flex: 1;
  overflow: hidden;
}

.detail-vehicle-plate {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.detail-vehicle-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.detail-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.detail-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color var(--t-fast), border-color var(--t-fast);
}

.detail-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.detail-tab:hover:not(.active) {
  color: var(--text-secondary);
}

.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.detail-section {
  margin-bottom: 20px;
}

.detail-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}

/* Telemetry */
.telemetry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.telem-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  padding: 10px 12px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.telem-card:hover {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-dim);
}

.telem-label {
  font-size: 10px;
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.telem-value {
  font-family: 'DM Mono', monospace;
  font-size: 22px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.25;
  margin-top: 3px;
}

.telem-unit {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 400;
}

/* SOC bar */
.soc-bar-wrap {
  margin-top: 5px;
}

.soc-bar-track {
  background: var(--border-light);
  border-radius: var(--r-full);
  height: 4px;
  overflow: hidden;
}

.soc-bar-fill {
  height: 100%;
  border-radius: var(--r-full);
  transition: width 0.6s var(--t-spring);
}

.soc-high {
  background: var(--brand);
}

.soc-mid {
  background: var(--warning);
}

.soc-low {
  background: var(--danger);
}

/* Compliance */
.compliance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}

.compliance-row:last-child {
  border-bottom: none;
}

.compliance-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.compliance-date {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 500;
}

.enforce-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── 15. Tabs ─────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-elevated);
  border-radius: var(--r-md);
  padding: 3px;
  border: 1px solid var(--border-light);
  margin-bottom: 16px;
}

.tab-btn {
  flex: 1;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 600;
  background: none;
  color: var(--text-tertiary);
  transition: all var(--t-fast);
  border: 1px solid transparent;
}

.tab-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
  border-color: var(--border-light);
}

.tab-btn:hover:not(.active) {
  color: var(--text-secondary);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: pageIn 0.2s ease;
}
