:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: rgba(22, 30, 49, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(99, 102, 241, 0.3);
  
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.06) 0%, transparent 40%);
  overflow-x: hidden;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

.accent-color {
  color: var(--accent-cyan);
}

.app-container {
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* TOP NAVBAR */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  padding: 16px 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.brand h1 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand h1 span {
  font-size: 0.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
  padding: 2px 8px;
  border-radius: 6px;
  color: #fff;
  margin-left: 6px;
  vertical-align: middle;
}

.subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 18px;
}

.device-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.device-selector label {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.child-dropdown-select {
  background: #0f172a;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 180px;
}

.child-dropdown-select.large {
  min-width: 240px;
  background: rgba(15, 23, 42, 0.95);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.2);
  padding: 10px 18px;
  font-size: 0.95rem;
}

.child-dropdown-select:hover,
.child-dropdown-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.35);
}

.child-dropdown-select option {
  background: #0b0f19;
  color: #fff;
  padding: 10px;
  font-size: 0.9rem;
}

.btn-primary-sm {
  background: var(--accent-primary);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-primary-sm:hover {
  background: #4f46e5;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.4);
  padding: 8px 16px;
  border-radius: 40px;
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  font-weight: 600;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-rose);
  display: inline-block;
  transition: background 0.3s ease;
}

.status-badge.online .status-dot {
  background: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
}

/* DASHBOARD GRID */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
  min-height: calc(100vh - 140px);
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title h2 {
  font-size: 1.15rem;
  font-weight: 700;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge {
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.btn-icon {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-primary);
}

.btn-icon-labeled {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-icon-labeled:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: var(--accent-primary);
  color: #fff;
  transform: translateY(-1px);
}

.btn-icon-labeled.active {
  background: rgba(6, 182, 212, 0.2);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* MAP STYLING */
.map-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.map-wrapper {
  flex: 1;
  position: relative;
  min-height: 480px;
}

#gpsMap {
  width: 100%;
  height: 100%;
  background: #1a1e29;
}

.map-overlay-info {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1000;
  display: flex;
  gap: 10px;
}

.info-pill {
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* TELEMETRY BAR */
.telemetry-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 18px 24px;
  background: rgba(10, 14, 23, 0.6);
  border-top: 1px solid var(--border-color);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.battery-icon { background: rgba(16, 185, 129, 0.12); color: var(--accent-emerald); }
.network-icon { background: rgba(6, 182, 212, 0.12); color: var(--accent-cyan); }
.coords-icon { background: rgba(139, 92, 246, 0.12); color: var(--accent-secondary); }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.stat-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.clickable-coords {
  color: var(--accent-cyan);
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.clickable-coords:hover {
  color: #fff;
  text-decoration: underline;
  transform: translateY(-1px);
}

.btn-refresh {
  width: 100%;
  height: 42px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-refresh:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-primary);
  color: #fff;
}

/* MEDIA CARD (CAMERA & AUDIO) */
.media-card {
  display: flex;
  flex-direction: column;
}

.live-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: var(--accent-rose);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

.live-pill.active {
  opacity: 1;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-rose);
  animation: pulseAnim 1.5s infinite;
}

@keyframes pulseAnim {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(244, 63, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
}

.video-container {
  position: relative;
  width: 100%;
  background: #06090e;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#remoteVideo,
#liveStreamImg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
  transform-origin: center center;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  z-index: 2;
  border-radius: inherit;
}

.video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px;
  color: var(--text-dim);
}

.placeholder-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.1);
}

.video-placeholder h3 {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.video-placeholder p {
  font-size: 0.85rem;
  max-width: 320px;
}

.video-hud {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 10;
}

.hud-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.hud-tag {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.hud-btn {
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.2s ease;
  user-select: none;
}

.hud-btn:hover {
  background: rgba(99, 102, 241, 0.8);
  border-color: var(--accent-primary);
  color: #fff;
  transform: scale(1.04);
}

/* CONTROLS PANEL */
.controls-panel {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(10, 14, 23, 0.4);
  flex: 1;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
  gap: 10px;
}

.btn-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-action:hover:not(:disabled) {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn-action.primary {
  border-color: rgba(6, 182, 212, 0.4);
  background: rgba(6, 182, 212, 0.08);
}
.btn-action.primary:hover:not(:disabled) {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: #041019;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35);
}
.btn-action.danger:hover:not(:disabled) {
  background: var(--accent-rose);
  border-color: var(--accent-rose);
  color: #fff;
}

.btn-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* AUDIO BOX */
.audio-control-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.audio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.audio-label {
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon-toggle {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon-toggle.active {
  background: var(--accent-emerald);
  color: #fff;
}

.audio-visualizer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 28px;
  padding: 0 10px;
  gap: 4px;
}

.audio-bar {
  flex: 1;
  background: var(--accent-cyan);
  border-radius: 2px;
  height: 4px;
  transition: height 0.1s ease;
  opacity: 0.6;
}

.audio-visualizer.active .audio-bar {
  animation: audioWave 1.2s ease-in-out infinite alternate;
}

.audio-visualizer.active .audio-bar:nth-child(2) { animation-delay: 0.1s; }
.audio-visualizer.active .audio-bar:nth-child(3) { animation-delay: 0.25s; }
.audio-visualizer.active .audio-bar:nth-child(4) { animation-delay: 0.15s; }
.audio-visualizer.active .audio-bar:nth-child(5) { animation-delay: 0.35s; }
.audio-visualizer.active .audio-bar:nth-child(6) { animation-delay: 0.05s; }
.audio-visualizer.active .audio-bar:nth-child(7) { animation-delay: 0.3s; }
.audio-visualizer.active .audio-bar:nth-child(8) { animation-delay: 0.18s; }
.audio-visualizer.active .audio-bar:nth-child(9) { animation-delay: 0.4s; }
.audio-visualizer.active .audio-bar:nth-child(10) { animation-delay: 0.1s; }
.audio-visualizer.active .audio-bar:nth-child(11) { animation-delay: 0.22s; }
.audio-visualizer.active .audio-bar:nth-child(12) { animation-delay: 0.3s; }

@keyframes audioWave {
  0% { height: 4px; opacity: 0.3; }
  50% { height: 24px; opacity: 1; background: var(--accent-primary); }
  100% { height: 8px; opacity: 0.5; }
}

.utility-actions {
  display: flex;
  gap: 12px;
}

.btn-subtle {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-subtle.recording {
  background: rgba(244, 63, 94, 0.2);
  border-color: var(--accent-rose);
  color: #fff;
  animation: pulseRecording 1.5s infinite;
}

@keyframes pulseRecording {
  0% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(244, 63, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
}

.btn-subtle:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* RADAR PULSE MARKER FOR MAP */
.radar-pulse-marker {
  position: relative;
  width: 24px;
  height: 24px;
}

.radar-center-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  background: var(--accent-cyan);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent-cyan);
  z-index: 2;
}

.radar-wave {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border: 2px solid var(--accent-cyan);
  border-radius: 50%;
  animation: radarWave 2s infinite ease-out;
  pointer-events: none;
  z-index: 1;
}

@keyframes radarWave {
  0% { width: 14px; height: 14px; opacity: 1; }
  100% { width: 70px; height: 70px; opacity: 0; }
}

/* TOAST NOTIFICATIONS */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.3s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .telemetry-bar {
    grid-template-columns: 1fr 1fr;
  }
}

/* MULTI-CHILD SELECTOR BAR */
.multi-child-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow-x: auto;
}

.multi-child-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.child-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  overflow-x: auto;
}

.child-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  user-select: none;
}

.child-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(99, 102, 241, 0.4);
}

.child-tab.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(6, 182, 212, 0.25));
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
}

.child-tab-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #fff;
}

.child-tab.active .child-tab-avatar {
  background: var(--accent-primary);
}

.child-tab-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

.child-tab-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-rose);
  transition: background 0.3s ease;
}

.child-tab-status.online {
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.child-tab-battery {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
}

.btn-download-apk {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid var(--accent-emerald);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-download-apk:hover {
  background: var(--accent-emerald);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.btn-add-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-add-tab:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-primary);
  color: #fff;
}

.empty-tabs-hint {
  font-size: 0.85rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
}

.empty-tabs-hint b {
  color: var(--accent-cyan);
}

/* =========================================================
   MOBILE RESPONSIVE STYLES (Smartphones & Tablets)
   ========================================================= */
@media (max-width: 768px) {
  .app-container {
    padding: 10px 12px;
    gap: 12px;
  }

  /* TOP NAVIGATION ON MOBILE */
  .top-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
  }

  .brand {
    justify-content: space-between;
    width: 100%;
  }

  .brand h1 {
    font-size: 1.15rem;
  }

  .brand-icon {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  .subtitle {
    font-size: 0.72rem;
  }

  .nav-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
  }

  .btn-download-apk {
    justify-content: center;
    padding: 10px;
    font-size: 0.85rem;
    width: 100%;
  }

  .device-selector {
    display: none; /* Hidden on mobile because multi-child bar below already has large dropdown */
  }

  .status-badge {
    justify-content: center;
    width: 100%;
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  /* MULTI-CHILD BAR ON MOBILE */
  .multi-child-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
  }

  .multi-child-label {
    font-size: 0.82rem;
  }

  .dropdown-wrapper {
    width: 100%;
  }

  .child-dropdown-select.large {
    width: 100%;
    min-width: 100%;
    font-size: 0.9rem;
    padding: 10px 14px;
  }

  .child-tabs {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .child-tab {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  /* DASHBOARD GRID ON MOBILE */
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    min-height: auto;
  }

  .card {
    border-radius: var(--radius-md);
  }

  .card-header {
    padding: 14px 16px;
  }

  .card-title h2 {
    font-size: 1rem;
  }

  /* MAP ON MOBILE */
  .map-wrapper {
    height: 340px;
  }

  .map-overlay-info {
    top: 8px;
    left: 8px;
    right: 8px;
    flex-direction: column;
    gap: 4px;
    pointer-events: none;
  }

  .info-pill {
    padding: 4px 8px;
    font-size: 0.7rem;
    align-self: flex-start;
  }

  /* TELEMETRY STATS ON MOBILE */
  .telemetry-bar {
    grid-template-columns: 1fr 1fr;
    padding: 12px;
    gap: 8px;
  }

  .stat-item {
    padding: 8px 10px;
  }

  .stat-icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .stat-label {
    font-size: 0.68rem;
  }

  .stat-val {
    font-size: 0.85rem;
  }

  .btn-refresh {
    font-size: 0.75rem;
    padding: 8px;
  }

  /* VIDEO STREAM ON MOBILE */
  .video-container {
    aspect-ratio: 4 / 3;
    max-height: 280px;
  }

  .video-placeholder h3 {
    font-size: 0.95rem;
  }

  .video-placeholder p {
    font-size: 0.75rem;
    padding: 0 10px;
  }

  .placeholder-icon {
    font-size: 2.2rem;
  }

  /* CONTROLS PANEL ON MOBILE */
  .controls-panel {
    padding: 14px 16px;
    gap: 12px;
  }

  .btn-group {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .btn-action {
    padding: 12px 14px;
    font-size: 0.88rem;
  }

  .audio-control-box {
    padding: 10px 14px;
  }

  .utility-actions {
    flex-direction: row;
    gap: 8px;
  }

  .btn-subtle {
    padding: 10px;
    font-size: 0.8rem;
  }

  .toast-container {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .toast {
    font-size: 0.78rem;
    padding: 10px 14px;
  }
}

/* ========================================================
   SECURITY AUTH OVERLAY (Auto-clears on Chrome Close)
   ======================================================== */
.auth-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 14, 23, 0.95);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-card {
  background: rgba(22, 30, 49, 0.95);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(99, 102, 241, 0.25);
  animation: authCardIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authCardIn {
  from { opacity: 0; transform: scale(0.9) translateY(24px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-icon {
  width: 68px;
  height: 68px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
  font-size: 30px;
  color: #fff;
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
}

.auth-card h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.auth-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

.auth-input-group {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 16px;
  margin-bottom: 14px;
  transition: all 0.2s ease;
}

.auth-input-group:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 18px rgba(6, 182, 212, 0.3);
}

.auth-input-group i.fa-key {
  color: var(--accent-cyan);
  font-size: 1rem;
  margin-right: 12px;
}

.auth-input-group input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 1.15rem;
  padding: 14px 0;
  letter-spacing: 3px;
  font-family: 'JetBrains Mono', monospace;
}

.auth-input-group input::placeholder {
  letter-spacing: normal;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.88rem;
  color: var(--text-dim);
}

.btn-eye {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 8px;
  font-size: 1rem;
  transition: color 0.2s;
}

.btn-eye:hover {
  color: #fff;
}

.auth-error-msg {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  animation: shakeError 0.3s ease;
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.btn-auth-submit {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.btn-auth-submit:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(6, 182, 212, 0.45);
}

.auth-note {
  margin-top: 20px;
  font-size: 0.78rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

