/*
 * ============================================================================
 * STATISTICS PAGE
 * ============================================================================
 *
 * Styles for organization statistics and insights dashboard
 */

/* Page Intro */
.statistics-page .page-intro {
  text-align: center;
  color: var(--text-light);
  margin: calc(-1 * var(--space-md)) 0 var(--space-xl) 0;
  font-size: var(--text-lg);
}

/* Stats Grid - Metric Cards with enhanced spacing */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-lg); /* Increased from md to lg for better breathing room */
  margin-bottom: var(--space-2xl);
}

.stat-card {
  background: var(--accent-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg); /* Increased vertical padding */
  text-align: center;
  transition: transform var(--transition-standard), box-shadow var(--transition-standard);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px oklch(var(--lch-border) / 0.15);
}

.stat-value {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-xs);
  line-height: 1;
}

.stat-trend {
  font-size: var(--text-xs);
  font-weight: 500;
  margin-top: var(--space-xs);
  margin-bottom: var(--space-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
}

.stat-trend--up {
  color: var(--accent);
}

.stat-trend--down {
  color: var(--text-light);
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* Stats Row - Two column layout */
.stats-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

@media (min-width: 768px) {
  .stats-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* Stats Sections */
.stats-section {
  margin-bottom: var(--space-2xl);
}

.stats-section--half {
  margin-bottom: 0;
}

.stats-section-title {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 var(--space-md) 0;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Stats Highlight - Redesigned for better visual hierarchy */
.stats-highlight {
  background: var(--accent-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
}

.stats-highlight-value {
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: var(--space-sm);
}

.stats-highlight-label {
  font-size: var(--text-base);
  color: var(--text-light);
}

.stats-highlight p {
  margin: 0;
  font-size: var(--text-base);
  color: var(--text-light);
}

.stats-highlight strong {
  color: var(--accent);
  font-weight: 600;
}

/* Stats List */
.stats-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.stats-list-item {
  background: var(--accent-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-decoration: none;
  color: inherit;
  transition: background var(--transition-standard), border-color var(--transition-standard);
}

.stats-list-item:hover {
  background: color-mix(in oklch, var(--accent) 10%, var(--accent-bg));
  border-color: var(--accent);
}

.stats-list-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stats-list-name {
  font-weight: 600;
  color: var(--text);
  font-size: var(--text-base);
}

.stats-list-detail {
  font-size: var(--text-sm);
  color: var(--text-light);
}

/* Stats Locked (Pro feature for Lite users) */
.stats-locked {
  background: var(--accent-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
}

.stats-locked p {
  margin: 0 0 var(--space-lg) 0;
  color: var(--text-light);
  font-size: var(--text-base);
}

/* Empty States */
.stats-empty {
  color: var(--text-lighter);
  font-size: var(--text-sm);
  font-style: italic;
  padding: var(--space-lg);
  text-align: center;
}

.stats-empty-state {
  background: var(--accent-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  margin-top: var(--space-xl);
}

.stats-empty-state p {
  margin: 0;
  color: var(--text-light);
  font-size: var(--text-base);
}

.stats-empty-state a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.stats-empty-state a:hover {
  text-decoration: underline;
}

/* Insight Cards */
.insight-card {
  background: var(--accent-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.insight-card--warning {
  background: oklch(var(--lch-accent) / 0.05);
  border-color: var(--accent);
}

.insight-icon {
  width: 24px;
  height: 24px;
  color: var(--accent);
  flex-shrink: 0;
}

.insight-content {
  flex: 1;
}

.insight-title {
  font-weight: 600;
  color: var(--text);
  font-size: var(--text-base);
  margin-bottom: 2px;
}

.insight-detail {
  font-size: var(--text-sm);
  color: var(--text-light);
}

/* Work Rate Distribution */
.work-rate-distribution {
  background: var(--accent-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.distribution-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.distribution-bar-container {
  height: 32px;
  background: var(--bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

.distribution-bar {
  height: 100%;
  border-radius: var(--radius-md);
  transition: width var(--transition-standard);
  min-width: 2px;
}

.distribution-bar--high {
  background: var(--accent);
}

.distribution-bar--medium {
  background: color-mix(in oklch, var(--accent) 60%, var(--text-light));
}

.distribution-bar--low {
  background: var(--text-lighter);
}

.distribution-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.distribution-label {
  font-weight: 600;
  color: var(--text);
  font-size: var(--text-sm);
}

.distribution-value {
  font-size: var(--text-sm);
  color: var(--text-light);
}
