:root {
  --bg-dark: #0b0f19;
  --bg-card: #131b2e;
  --bg-card-hover: #1c2742;
  --border-color: #233152;
  --primary: #3b82f6;
  --primary-glow: rgba(59, 130, 246, 0.4);
  --critical: #ef4444;
  --critical-glow: rgba(239, 68, 68, 0.5);
  --warning: #f59e0b;
  --success: #10b981;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --command-header-height: 116px;
}

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

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.header {
  background: linear-gradient(100deg, #0b1220 0%, #0f172a 58%, #101b31 100%);
  border-bottom: 1px solid var(--border-color);
  padding: 9px 16px 10px;
  padding-top: max(10px, var(--safe-top));
  padding-left: max(16px, var(--safe-left));
  padding-right: max(16px, var(--safe-right));
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 9px;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.25);
}

@media (min-width: 1100px) {
  .header {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) auto minmax(300px, 1fr);
    align-items: center;
    padding: 10px 24px;
    gap: 20px;
  }
}

.header-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
  min-width: 0;
}

@media (min-width: 1100px) {
  .header-main-row {
    display: contents;
  }
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-shrink: 1;
}

@media (min-width: 1100px) {
  .logo-group { grid-column: 1; }
}

.logo-badge {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: 1px;
  box-shadow: 0 0 12px var(--primary-glow);
  flex-shrink: 0;
}

.logo-text {
  min-width: 0;
  overflow: hidden;
}

.logo-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.title-short {
  display: none;
}

.logo-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 768px) {
  .title-full {
    display: none;
  }
  .title-short {
    display: inline;
    font-size: 0.95rem;
    font-weight: 700;
  }
  .logo-subtitle {
    display: none;
  }
}

/* Header Telemetry Stats Strip */
.header-stats-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  display: flex;
}

.header-stats-wrapper::-webkit-scrollbar {
  display: none;
}

@media (min-width: 1100px) {
  .header-stats-wrapper {
    grid-column: 2;
    justify-content: center;
    overflow: visible;
    width: auto;
  }
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
}

@media (min-width: 1100px) {
  .header-stats {
    width: auto;
    gap: 12px;
  }
}

/* Keep the complete operational summary visible on tablets and phones. */
@media (max-width: 1024px) {
  .header-main-row {
    flex: 0 0 auto;
  }
  .header-controls {
    gap: 5px;
  }
  .header-controls .btn-icon-text {
    width: 36px;
    height: 36px;
    padding: 0;
  }
  .header-controls .btn-icon-text .btn-text {
    display: none;
  }
  .header-controls .btn-icon-text .btn-icon {
    margin: 0;
    font-size: 1rem;
  }
  .clock-display {
    padding: 5px 7px;
    font-size: 0.75rem;
  }
  .header-stats-wrapper {
    flex: 0 0 100%;
    order: 2;
    overflow: visible;
    display: block;
    clear: both;
  }
  .header-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
    gap: 6px;
    visibility: visible;
  }
  .stat-chip {
    min-width: 0;
    padding-inline: 5px;
    overflow: hidden;
  }
  .stat-label,
  .stat-value {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.stat-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 5px 10px;
  border-radius: 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 72px;
}

.stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.stat-value {
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.stat-value.online { color: var(--success); }
.stat-value.alert { color: var(--critical); }
.stat-value.latency { color: #60a5fa; }

/* Header Controls & Actions */
.header-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

@media (min-width: 1100px) {
  .header-controls {
    grid-column: 3;
    justify-self: end;
  }
}

.clock-display {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  border: 1px solid var(--border-color);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

@media (max-width: 480px) {
  .clock-display {
    font-size: 0.72rem;
    padding: 3px 6px;
  }
}

.btn {
  background: #1e293b;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  touch-action: manipulation;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn:hover {
  background: #334155;
  border-color: #475569;
}

.btn-primary {
  background: #2563eb;
  border-color: #3b82f6;
  color: #fff;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-danger {
  background: #b91c1c;
  border-color: #ef4444;
  color: #fff;
}

.btn-danger:hover {
  background: #991b1b;
}

@media (max-width: 600px) {
  :root { --command-header-height: 122px; }

  .header {
    padding: 8px 10px;
    gap: 7px;
  }
  .header-main-row { gap: 6px; }
  .logo-group { gap: 7px; }
  .logo-badge {
    font-size: 0.84rem;
    padding: 4px 6px;
    letter-spacing: 0.6px;
  }
  .btn-icon-text {
    width: 32px;
    height: 32px;
    padding: 0;
  }
  .btn-icon-text .btn-text {
    display: none;
  }
  .btn-icon-text .btn-icon {
    font-size: 1rem;
    margin: 0;
  }
  .header-controls { gap: 4px; }
  .header-stats-wrapper {
    display: block !important;
    overflow: visible;
    visibility: visible;
    opacity: 1;
    flex: 0 0 auto;
    min-height: 43px;
  }
  .header-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
    gap: 4px;
    min-height: 43px;
  }
  .stat-chip {
    min-width: 0;
    padding: 4px 2px;
    border-radius: 6px;
    overflow: hidden;
  }
  .stat-label {
    max-width: 100%;
    font-size: clamp(0.48rem, 1.7vw, 0.58rem);
    letter-spacing: 0;
    line-height: 1.05;
    min-height: 1.95em;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .stat-value {
    max-width: 100%;
    font-size: clamp(0.68rem, 2.7vw, 0.8rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 380px) {
  .clock-display { display: none; }
  .header-controls { gap: 3px; }
  .btn-icon-text { width: 30px; height: 30px; }
  .stat-chip { padding-inline: 1px; }
  .stat-label { font-size: 0.46rem; }
}

/* ==========================================================================
   Mobile Segmented Navigation Bar
   ========================================================================== */
.mobile-nav-bar {
  display: none;
  background: rgba(11, 18, 32, 0.96);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 12px 10px;
  position: sticky;
  top: var(--command-header-height);
  z-index: 45;
  width: 100%;
  max-width: 100%;
  gap: 8px;
}

@media (max-width: 1024px) {
  .mobile-nav-bar {
    display: flex;
  }
}

.mobile-nav-tab {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 6px;
  background: rgba(30, 41, 59, 0.76);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  touch-action: manipulation;
}

.mobile-nav-tab.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border-color: #3b82f6;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.mobile-nav-tab:not(.active):hover {
  color: var(--text-main);
  background: #26364f;
}

.mob-tab-badge {
  background: rgba(255, 255, 255, 0.15);
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 10px;
  font-family: var(--font-mono);
}

.mob-tab-badge.alert {
  background: var(--critical);
  color: #fff;
}

@media (max-width: 480px) {
  .mobile-nav-bar {
    padding: 7px 8px 9px;
    gap: 5px;
  }
  .mobile-nav-tab { gap: 4px; padding: 8px 3px; font-size: 0.72rem; }
  .mob-tab-icon { font-size: 0.86rem; }
  .mob-tab-badge { padding: 1px 4px; font-size: 0.63rem; }
}

/* Mobile Alert Notification Toast */
.mobile-alert-toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: #991b1b;
  color: #fff;
  border: 1px solid #ef4444;
  padding: 10px 18px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.6);
  z-index: 95;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  max-width: 90vw;
  animation: pulse-toast 1.5s infinite;
}

@keyframes pulse-toast {
  0% { box-shadow: 0 0 8px rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.8); }
  100% { box-shadow: 0 0 8px rgba(239, 68, 68, 0.4); }
}

.pulse-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* ==========================================================================
   Main Command Center Layout
   ========================================================================== */
.main-container {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px;
  padding: 16px 20px;
  flex: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

@media (max-width: 1024px) {
  .main-container {
    display: block;
    padding: 10px 12px;
    padding-bottom: max(16px, var(--safe-bottom));
  }
}

/* Camera Section */
.camera-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-subtitle-tag {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.divider-dot {
  color: var(--border-color);
}

/* Camera Grid */
.camera-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
  width: 100%;
}

@media (max-width: 640px) {
  .camera-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.camera-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
  width: 100%;
  max-width: 100%;
}

.camera-card.alert-active {
  border-color: var(--critical);
  box-shadow: 0 0 15px var(--critical-glow);
  animation: pulse-border 1.5s infinite;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 5px var(--critical-glow); }
  50% { box-shadow: 0 0 18px var(--critical-glow); }
  100% { box-shadow: 0 0 5px var(--critical-glow); }
}

.camera-card-header {
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.cam-badge {
  background: #1e293b;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 0.78rem;
  color: #93c5fd;
  flex-shrink: 0;
}

.cam-name {
  font-size: 0.82rem;
  font-weight: 600;
  margin-left: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cam-status {
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #6b7280;
  flex-shrink: 0;
}

.status-dot.online {
  background-color: var(--success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.camera-feed-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.camera-feed-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-feed-placeholder {
  color: #4b5563;
  font-size: 0.85rem;
  text-align: center;
  padding: 16px;
}

.feed-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.feed-telemetry {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  padding: 3px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #38bdf8;
}

.camera-card-footer {
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  gap: 8px;
  flex-wrap: wrap;
}

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

/* ==========================================================================
   Alerts & Incidents Side Panel
   ========================================================================== */
.alerts-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: calc(100vh - 100px);
  position: sticky;
  top: 80px;
  width: 100%;
  min-width: 0;
}

@media (max-width: 1024px) {
  .alerts-section {
    position: static;
    height: calc(100dvh - 165px);
    min-height: 440px;
  }
}

.alerts-header {
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border-color);
}

.alerts-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 8px;
}

.alerts-tab-group {
  display: flex;
  gap: 6px;
  min-width: 0;
}

.alerts-action-group {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.tab-btn {
  background: #1e293b;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab-btn:hover {
  color: #fff;
  background: #334155;
}

.tab-btn.active {
  background: #2563eb;
  color: #fff;
  border-color: #3b82f6;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

.alerts-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alert-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--critical);
  border-radius: 6px;
  padding: 9px 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.alert-card:hover, .alert-card:active {
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.alert-card.severity-SUSPICIOUS {
  border-left-color: var(--warning);
}

.alert-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.alert-type {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
}

.alert-time {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.alert-meta {
  font-size: 0.74rem;
  color: #cbd5e1;
  display: flex;
  gap: 10px;
}

/* Activity Card */
.activity-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-left: 4px solid #38bdf8;
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.15s;
}

.activity-card:hover, .activity-card:active {
  background: var(--bg-card-hover);
}

.activity-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.activity-action {
  font-size: 0.78rem;
  font-weight: 700;
  color: #e2e8f0;
}

.activity-time {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.activity-meta {
  font-size: 0.72rem;
  color: #94a3b8;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.direction-badge {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-weight: 600;
}

/* Fullscreen Button */
.fullscreen-btn {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  color: #93c5fd;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.fullscreen-btn:hover {
  background: #2563eb;
  color: #fff;
  border-color: #3b82f6;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

/* ==========================================================================
   Modals (Evidence Dossier, Zone Editor, Fullscreen Camera)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 12px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@media (max-width: 640px) {
  .modal-content {
    padding: 14px;
    border-radius: 12px;
    max-height: 94dvh;
  }
}

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

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

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

.evidence-view-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 768px) {
  .evidence-view-container {
    grid-template-columns: 1fr;
  }
}

.evidence-box {
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.evidence-title {
  background: #0f172a;
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.evidence-media {
  width: 100%;
  height: 200px;
  object-fit: contain;
  background: #000;
}

@media (max-width: 640px) {
  .evidence-media {
    height: 170px;
  }
}

.evidence-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

@media (max-width: 500px) {
  .evidence-details-grid {
    grid-template-columns: 1fr;
  }
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-key {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.detail-val {
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

/* Fullscreen Dedicated Modal */
#camera-fullscreen-modal {
  padding: 0;
  background: #000;
}

.fs-modal-viewport {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #000;
}

.fs-hud-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: max(12px, var(--safe-top)) max(16px, var(--safe-right)) 12px max(16px, var(--safe-left));
  background: linear-gradient(180deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 70%, transparent 100%);
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.fs-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.fs-cam-title {
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fs-live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.fs-status-label {
  color: var(--success);
  font-size: 0.8rem;
  font-weight: 600;
}

.btn-close-fs {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #fff;
  padding: 6px 12px;
  font-size: 0.85rem;
}

.fs-video-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.fs-video-img {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.fs-hud-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px max(16px, var(--safe-right)) max(16px, var(--safe-bottom)) max(16px, var(--safe-left));
  background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 70%, transparent 100%);
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.fs-action-buttons {
  display: flex;
  gap: 8px;
}
