.realtime-theme .dashboard-layout {
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  right: 0;
  bottom: 0;

  background: #dbdbda;
  overflow: hidden;
}

.realtime-theme .dashboard-body {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.realtime-theme .dashboard-page .dashboard-content {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  min-height: 0;
  overflow: hidden;
}

.realtime-theme .dashboard-timeline {
  grid-column: 1 / -1;
  grid-row: 1;
  flex-shrink: 0;
}

.realtime-theme .dashboard-left-section {
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.realtime-theme .floor-plan-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;

  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 8px;
}

.realtime-theme .floor-plan-card > * {
  flex: 1;
  min-height: 0;
}

.realtime-theme .dashboard-stats-chart {
  flex: 0 0 140px;
  min-height: 140px;
}

.realtime-theme .dashboard-right-section {
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

.realtime-theme .dashboard-stats-cards {
  flex: 0 0 auto;
}

.realtime-theme .dashboard-camera-status {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.realtime-theme .stats-cards-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.realtime-theme .stat-card {
  background: linear-gradient(135deg, #FFFFFF 0%, #F9FAFB 100%);
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  padding: 16px;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.realtime-theme .horizontal-stats-chart {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.realtime-theme .chart-body {
  flex: 1;
  min-height: 0;
}


/* ================================
   Floor plan focus mode container
   ================================ */

.realtime-theme .dashboard-floorplan-focus {
  grid-column: 1 / -1;
  grid-row: 2;

  position: relative;

  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;

  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 8px;
}

.realtime-theme .dashboard-floorplan-focus > * {
  flex: 1;
  min-height: 0;
}


.realtime-theme .stat-card {
  position: relative;

  background: #ffffff;
  border-radius: 12px;
  padding: 12px 14px;
  min-height: 80px;

  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;

  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.04);

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.realtime-theme .stat-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.08),
    0 3px 6px rgba(0, 0, 0, 0.05);
}

/* --------------------------------
   Label & Value
   -------------------------------- */

.realtime-theme .stat-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.realtime-theme .stat-value {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}

/* --------------------------------
   Accent bar (top)
   -------------------------------- */

.realtime-theme .stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 12px 12px 0 0;
}

/* --------------------------------
   CURRENT
   -------------------------------- */

.realtime-theme .stat-card-current::before {
  background: linear-gradient(90deg, #dc2626, #f87171);
}

.realtime-theme .stat-card-current .stat-value {
  color: #dc2626;
}

/* --------------------------------
   PEAK
   -------------------------------- */

.realtime-theme .stat-card-peak::before {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.realtime-theme .stat-card-peak .stat-value {
  color: #10b981;
}

/* --------------------------------
   AVERAGE
   -------------------------------- */

.realtime-theme .stat-card-average::before {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.realtime-theme .stat-card-average .stat-value {
  color: #3b82f6;
}

/* --------------------------------
   MINIMUM
   -------------------------------- */

.realtime-theme .stat-card-minimum::before {
  background: linear-gradient(90deg, #6b7280, #9ca3af);
}

.realtime-theme .stat-card-minimum .stat-value {
  color: #6b7280;
}



@media (max-height: 800px) {
  .realtime-theme .dashboard-camera-status {
    overflow-y: auto;
  }
}

@media (max-width: 1024px) {
  .realtime-theme .dashboard-page .dashboard-content {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    overflow-y: auto;
  }

  .realtime-theme .dashboard-right-section {
    overflow: visible;
  }

  .realtime-theme .dashboard-camera-status {
    max-height: 300px;
  }
}

@media (max-width: 768px) {
  .realtime-theme .stats-cards-container {
    grid-template-columns: 1fr;
  }

  .realtime-theme .dashboard-stats-chart {
    min-height: 160px;
  }
}