/* ========================================
   Week — Grid, Trend Chart, Day Cards
   ======================================== */

/* ---- Week Grid Container ---- */
.week-grid-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -16px;
  padding: 0 16px 12px;
}

.week-grid {
  display: table;
  width: 100%;
  min-width: 340px;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.week-grid thead th {
  background: var(--gold-light);
  padding: 10px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--gold-darker);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-align: center;
  position: sticky;
  top: 0;
}

.week-grid thead th:first-child {
  text-align: left;
  padding-left: 14px;
  min-width: 80px;
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--gold-light);
}

.week-grid thead th.today {
  background: var(--gold);
  color: white;
}

.week-grid tbody td {
  padding: 10px 8px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  border-top: 1px solid var(--cream-dark);
}

.week-grid tbody td:first-child {
  text-align: left;
  padding-left: 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  position: sticky;
  left: 0;
  background: white;
  z-index: 1;
}

.week-grid tbody td.today {
  background: #FFF9F0;
}

.week-grid .count-green { color: var(--green); }
.week-grid .count-red { color: var(--red); }
.week-grid .count-orange { color: var(--orange); }
.week-grid .count-blue { color: var(--blue); }
.week-grid .count-purple { color: var(--purple); }
.week-grid .count-teal { color: var(--teal); }

.week-grid .count-zero {
  color: var(--text-muted);
  font-weight: 400;
}

/* ---- Potty Trend Chart ---- */
.potty-trend {
  margin-top: 16px;
}

.trend-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.trend-bars {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  height: 120px;
  padding: 0 8px;
}

.trend-bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.trend-bar {
  width: 100%;
  max-width: 40px;
  min-height: 4px;
  border-radius: 6px 6px 0 0;
  transition: height 0.4s ease;
  position: relative;
}

.trend-bar.good {
  background: linear-gradient(180deg, var(--green) 0%, #81C784 100%);
}

.trend-bar.warn {
  background: linear-gradient(180deg, var(--orange) 0%, #FFD54F 100%);
}

.trend-bar.empty {
  background: var(--cream-dark);
  min-height: 4px;
}

.trend-bar-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 600;
}

.trend-bar-value {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
}

/* ---- Per-Day Cards (moved from stats) ---- */
.stats-day-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.stats-day-row {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: transform 0.15s;
}

.stats-day-row:active {
  transform: scale(0.97);
}

.stats-day-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.stats-day-date {
  font-weight: 700;
  font-size: 1rem;
}

.stats-day-datestr {
  color: var(--text-muted);
  font-size: 0.8rem;
  flex: 1;
}

.stats-day-pct {
  font-weight: 700;
  font-size: 1.1rem;
}

.stats-day-bar {
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.stats-day-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.stats-day-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.day-chip {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 12px;
  background: var(--bg-secondary);
  color: var(--text-muted);
  white-space: nowrap;
}

.day-chip.chip-good {
  background: #e8f5e9;
  color: #2e7d32;
}

.day-chip.chip-miss {
  background: #fce4ec;
  color: #c62828;
}

/* ---- Week Per-Day Section Title ---- */
.week-section-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 20px 0 12px;
  color: var(--text-primary);
}
