/* File: /public_html/mte/assets/css/stats_cohort.css
   Purpose: Dark mode cohort stats dashboard optimized for TV display
*/

/* ========== BASE & DARK MODE ========== */
body {
  background: #0f172a !important;
  color: #f1f5f9 !important;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important;
}
#stats-root {
  background: #0f172a !important;
  min-height: 100vh;
  padding: 2rem;
}
#stats-root .stats-root {
  max-width: 1600px;
  margin: 0 auto;
}

/* ========== HEADER ========== */
#stats-root .stats-title {
  margin-bottom: 2rem;
  padding: 1rem 1.5rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}
#stats-root .stats-title h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #f1f5f9;
}
#stats-root #rangeText {
  color: #94a3b8;
  font-size: 1rem;
  font-weight: 500;
}

/* ========== MONTHLY GRIDS ========== */
#stats-root .months-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
}
#stats-root .months-grid.bottom {
  margin-top: 1.5rem;
}

/* ========== MONTH CARDS ========== */
#stats-root .month-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.75rem;
  padding: 1rem 0.75rem 0.625rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}
#stats-root .month-card .text-sm {
  color: #cbd5e1;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  text-align: center;
}
#stats-root .canvas-wrap {
  position: relative;
  height: 140px;
}
#stats-root .qty-label {
  position: absolute;
  left: -6px; top: 8px; width: 14px;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 700;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  user-select: none;
}
#stats-root .row.center {
  margin-top: 0.75rem;
  color: #f1f5f9;
  font-weight: 600;
  font-size: 0.875rem;
}

/* ========== DUAL CHART SUMMARY CARD ========== */
#stats-root .summary-card {
  margin-top: 2rem;
  padding: 1.5rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.dual-chart-container {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 2rem;
}

/* ========== DONUT / PIE CHART CONTAINERS ========== */
.chart-wrapper,
.donut-wrapper {
  flex: 1;
  min-width: 320px;
  max-width: 800px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.donut-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #F1F5F9;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  margin-bottom: 1rem;
}

#stats-root .donut-inner,
#stats-root .pie-inner {
  width: 100%;
  max-width: 800px;
  height: 400px;
}

#stats-root .donut-subtext {
  font-size: 0.875rem;
  color: #cbd5e1;
  font-weight: 500;
  margin-top: 0.5rem;
  text-align: center;
}

/* ========== PIE CHART LEGEND ========== */
.progress-legend {
  width: 110%;
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding: 0 1rem;
  padding-bottom: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.legend-horizontal-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  max-width: 800px;
  margin: 0 auto;
  padding: 0;
}

.legend-item-horiz {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.675rem;
  font-weight: 500;
  color: #F1F5F9;
  white-space: nowrap;
  padding: 0 0.25rem;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-label {
  white-space: nowrap;
}

.legend-list,
.legend-item,
.legend-count {
  display: none !important;
}

#totals-legend {
  padding-bottom: 50px;
}



/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .chart-wrapper {
    min-width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  #stats-root {
    padding: 1rem;
  }
  #stats-root .stats-title h1 {
    font-size: 1.5rem;
  }
  #stats-root .months-grid {
    gap: 1rem;
  }
}
