/**
 * Dashboard KPIs, Metrics Grid & Vigilancia Activa Styles
 * Fully Responsive for Mobile 2x2 Grid & Desktop 4-Column Layout
 */
.main-wrapper {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: var(--bg-app);
}

.tab-content {
  display: none;
  padding: 24px;
}

.tab-content.active {
  display: block;
}

.tab-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Desktop KPI Grid: 4 Columns */
.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

/* Clickable KPI Dashboard Cards */
.card-panel[onclick] {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.card-panel[onclick]:hover {
  transform: translateY(-2.5px);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .card-panel[onclick]:hover {
  border-color: #081020;
  box-shadow: 0 8px 20px rgba(8, 16, 32, 0.12);
}

.card-panel[onclick] .svg-icon {
  transition: transform 0.2s ease, color 0.2s ease;
}

.card-panel[onclick]:hover .svg-icon {
  transform: scale(1.15);
  color: var(--accent-gold);
}

/* Pulse indicator for El Vigía */
.vigia-pulse-container {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.vigia-pulse-dot {
  width: 7px;
  height: 7px;
  background-color: var(--status-emerald);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: vigia-pulse-anim 2s infinite;
}

@keyframes vigia-pulse-anim {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Executive Productivity Stat Grid */
.dash-productivity-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.dash-metric-stat-box {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 16px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.dash-metric-stat-box:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.dash-metric-stat-val {
  font-size: 26px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
  margin-bottom: 3px;
  line-height: 1.1;
}

.dash-metric-stat-label {
  font-size: 11.5px;
  color: var(--text-primary);
  font-weight: 700;
  margin-bottom: 2px;
}

/* Tablet & Mobile 2x2 Grid Layouts */
@media (max-width: 992px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .dash-productivity-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 640px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .dashboard-kpi-grid .card-panel {
    padding: 12px 10px !important;
  }

  .dashboard-kpi-grid .form-label {
    font-size: 11px !important;
  }

  .dashboard-kpi-grid div[id^="dash"] {
    font-size: 19px !important;
  }

  .dash-productivity-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .dash-metric-stat-box {
    padding: 12px 8px !important;
  }

  .dash-metric-stat-val {
    font-size: 20px !important;
  }

  .dash-metric-stat-label {
    font-size: 10.5px !important;
  }
}

@media (max-width: 360px) {
  .dashboard-kpi-grid {
    grid-template-columns: 1fr;
  }
  .dash-productivity-grid {
    grid-template-columns: 1fr;
  }
}

/* Refresh Button Animation & Metric Highlighting */
.spin-anim {
  animation: dash-spin 0.75s cubic-bezier(0.4, 0, 0.2, 1) infinite !important;
}

@keyframes dash-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.metrics-loading {
  opacity: 0.45;
  transition: opacity 0.2s ease;
}

.metric-updated-pulse {
  animation: metric-pulse-anim 0.8s ease-out;
}

@keyframes metric-pulse-anim {
  0% {
    transform: scale(1.08);
    color: var(--accent-gold);
  }
  100% {
    transform: scale(1);
  }
}

