/* ========================================
   Dashboard Stats — Ora
   ======================================== */

/* Streak card */
.dashboard-streak {
  text-align: center;
  padding: 20px;
  background: var(--color-card);
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.streak-number {
  font-size: 3rem;
  font-weight: 700;
  color: var(--liturgical-color, #4a7c59);
  line-height: 1;
}

.streak-label {
  font-size: 0.95rem;
  color: var(--color-text-secondary, #666);
  margin-top: 4px;
}

.streak-record {
  font-size: 0.8rem;
  color: var(--color-text-secondary, #999);
  margin-top: 8px;
}

/* Weekly bar chart */
.dashboard-week {
  background: var(--color-card);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.dashboard-week h3 {
  margin: 0 0 12px 0;
  font-size: 0.85rem;
  color: var(--color-text-secondary, #666);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.week-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 100px;
  gap: 6px;
}

.week-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.week-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.week-bar {
  width: 100%;
  max-width: 32px;
  border-radius: 4px 4px 0 0;
  background: var(--liturgical-color, #4a7c59);
  transition: height 0.3s ease;
  min-height: 2px;
  position: relative;
}

.week-bar.empty {
  background: var(--color-border, #e0e0e0);
  min-height: 2px;
  max-height: 2px;
}

.week-bar-value {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: var(--color-text-secondary, #888);
  font-weight: 600;
}

.week-bar-label {
  font-size: 0.7rem;
  color: var(--color-text-secondary, #888);
  margin-top: 6px;
  font-weight: 500;
}

.week-bar-col.is-today .week-bar-label {
  color: var(--liturgical-color, #4a7c59);
  font-weight: 700;
}

/* Heatmap */
.dashboard-heatmap {
  background: var(--color-card);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.dashboard-heatmap h3 {
  margin: 0 0 12px 0;
  font-size: 0.85rem;
  color: var(--color-text-secondary, #666);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  grid-template-rows: repeat(7, 1fr);
  gap: 2px;
}

.heatmap-cell {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--heatmap-empty, #ebedf0);
  min-width: 8px;
  min-height: 8px;
}

.heatmap-cell.level-1 {
  background: #9be9a8;
}
.heatmap-cell.level-2 {
  background: #40c463;
}
.heatmap-cell.level-3 {
  background: #30a14e;
}
.heatmap-cell.level-4 {
  background: #216e39;
}

/* Dark theme heatmap */
.dark .heatmap-cell {
  background: #2d333b;
}
.dark .heatmap-cell.level-1 {
  background: #0e4429;
}
.dark .heatmap-cell.level-2 {
  background: #006d32;
}
.dark .heatmap-cell.level-3 {
  background: #26a641;
}
.dark .heatmap-cell.level-4 {
  background: #39d353;
}

.heatmap-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 8px;
  font-size: 0.7rem;
  color: var(--color-text-secondary, #888);
}

.heatmap-legend-cell {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

/* By norm list */
.dashboard-norms {
  background: var(--color-card);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.dashboard-norms h3 {
  margin: 0 0 12px 0;
  font-size: 0.85rem;
  color: var(--color-text-secondary, #666);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.norm-stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border, #f0f0f0);
}

.norm-stat-row:last-child {
  border-bottom: none;
}

.norm-stat-icon {
  font-size: 1.2rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.norm-stat-info {
  flex: 1;
  min-width: 0;
}

.norm-stat-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text, #333);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.norm-stat-bar {
  height: 6px;
  background: var(--color-border, #e8e8e8);
  border-radius: 3px;
  margin-top: 4px;
  overflow: hidden;
}

.norm-stat-fill {
  height: 100%;
  background: var(--liturgical-color, #4a7c59);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.norm-stat-count {
  font-size: 0.75rem;
  color: var(--color-text-secondary, #888);
  flex-shrink: 0;
  text-align: right;
  min-width: 40px;
}

/* Totals footer */
.dashboard-totals {
  display: flex;
  justify-content: space-around;
  padding: 16px;
  background: var(--color-card);
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.total-item {
  text-align: center;
}

.total-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--liturgical-color, #4a7c59);
}

.total-label {
  font-size: 0.7rem;
  color: var(--color-text-secondary, #888);
  margin-top: 2px;
}

/* Loading state */
.dashboard-loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-secondary, #888);
}

.dashboard-loading .spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--color-border, #e0e0e0);
  border-top-color: var(--liturgical-color, #4a7c59);
  border-radius: 50%;
  animation: dash-spin 0.8s linear infinite;
}

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

/* Month labels row for heatmap */
.heatmap-months {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}

.heatmap-month-label {
  font-size: 0.6rem;
  color: var(--color-text-secondary, #aaa);
  text-align: center;
}

/* Day labels for heatmap */
.heatmap-container {
  display: flex;
  gap: 4px;
}

.heatmap-day-labels {
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  gap: 2px;
  font-size: 0.55rem;
  color: var(--color-text-secondary, #aaa);
  padding-right: 2px;
}

.heatmap-day-labels span {
  display: flex;
  align-items: center;
  min-height: 8px;
}

.heatmap-grid-wrap {
  flex: 1;
  min-width: 0;
}
