/* Analytics Dashboard Styles */

.analytics-dashboard {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Back Button - matches Filter Builder */
.analytics-dashboard .btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #64748b;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 1.5rem;
}

.analytics-dashboard .btn-back:hover {
  background: #f8fafc;
  color: #1e293b;
  border-color: #cbd5e1;
}

.analytics-dashboard .btn-back i {
  width: 16px;
  height: 16px;
}

/* Header */
.analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  gap: 1rem;
}

.header-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.header-title h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-title h1 i {
  width: 24px;
  height: 24px;
  color: #64748b;
}

.header-subtitle {
  color: #64748b;
  font-size: 0.9rem;
  margin: 0;
}

.analytics-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Summary Cards Grid */
.analytics-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.summary-card {
  background: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  gap: 1rem;
  align-items: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.summary-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.summary-icon i,
.summary-icon svg {
  width: 28px;
  height: 28px;
  color: white;
}

.summary-content {
  flex: 1;
}

.summary-value {
  font-size: 2rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.summary-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 0.25rem;
}

.summary-sublabel {
  font-size: 0.75rem;
  color: #9ca3af;
}

/* Charts Row */
.analytics-charts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.analytics-chart-card {
  background: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.analytics-chart-card.full-width {
  grid-column: 1 / -1;
}

.analytics-chart-card h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1rem;
}

.analytics-chart-card h3 svg {
  width: 1.25rem;
  height: 1.25rem;
  color: #6b7280;
}

.analytics-chart-card canvas {
  max-height: 300px;
}

/* Tables */
.analytics-tables {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
}

.analytics-table-section {
  background: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.analytics-table-section h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1rem;
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
}

.analytics-table thead {
  background: #f9fafb;
  border-bottom: 2px solid #e5e7eb;
}

.analytics-table th {
  padding: 0.75rem;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.analytics-table td {
  padding: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.875rem;
  color: #1f2937;
}

.analytics-table tbody tr:hover {
  background: #f9fafb;
}

/* Responsive Design */
@media (max-width: 768px) {
  .analytics-dashboard {
    padding: 1rem;
  }

  .analytics-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .analytics-summary-grid {
    grid-template-columns: 1fr;
  }

  .analytics-charts-row {
    grid-template-columns: 1fr;
  }

  .analytics-tables {
    grid-template-columns: 1fr;
  }
}
