/* ===== DASHBOARD ===== */

/* Keyframe fade-in staggeré pour les cards */
@keyframes dashFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes countUp {
  from { opacity: 0.4; }
  to   { opacity: 1; }
}

/* Layout principal */
#page-dashboard {
  padding-bottom: var(--space-10);
}

.dash-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

@media (min-width: 1024px) {
  .dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: var(--space-5);
  }
}

.dash-col-left,
.dash-col-right {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Card de base */
.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-md);
  opacity: 0;
  animation: dashFadeIn 0.4s ease forwards;
}

.dash-card:nth-child(1) { animation-delay: 0ms; }
.dash-card:nth-child(2) { animation-delay: 60ms; }
.dash-card:nth-child(3) { animation-delay: 120ms; }
.dash-card:nth-child(4) { animation-delay: 180ms; }
.dash-card:nth-child(5) { animation-delay: 240ms; }
.dash-card:nth-child(6) { animation-delay: 300ms; }

.dash-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.dash-section-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dash-section-link {
  font-size: var(--text-xs);
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-weight: 500;
  transition: opacity var(--transition-fast);
}
.dash-section-link:hover { opacity: 0.75; }

/* ===== SECTION 1 — HEADER ===== */
#dash-header-section {
  margin-bottom: var(--space-4);
  animation: dashFadeIn 0.4s ease forwards;
}

.dash-header-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(16,185,129,0.06) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  box-shadow: var(--shadow-md);
}

.dash-greeting {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
  line-height: 1.2;
}

.dash-date {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  text-transform: capitalize;
}

.dash-quote {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-style: italic;
  border-left: 3px solid var(--accent);
  padding-left: var(--space-3);
  margin-bottom: var(--space-4);
  line-height: 1.5;
}

.dash-mood-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.dash-mood-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
}

.dash-mood-btns {
  display: flex;
  gap: var(--space-2);
}

.dash-mood-btn {
  background: none;
  border: 2px solid transparent;
  border-radius: var(--radius-full);
  width: 36px;
  height: 36px;
  font-size: 18px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.dash-mood-btn:hover {
  background: var(--bg-card-hover);
  transform: scale(1.15);
}

.dash-mood-btn.selected {
  border-color: var(--accent);
  background: rgba(16,185,129,0.12);
  transform: scale(1.15);
}

/* ===== SECTION 2 — MOMENTUM ===== */
#dash-momentum-section {
  margin-bottom: var(--space-4);
  animation: dashFadeIn 0.4s ease forwards;
  animation-delay: 40ms;
}

.dash-momentum-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  box-shadow: var(--shadow-md);
}

.dash-momentum-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  gap: var(--space-4);
}

.dash-momentum-score-block {
  display: flex;
  flex-direction: column;
}

.dash-momentum-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-2);
}

.dash-momentum-number {
  font-size: 72px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: color 0.6s ease;
}

.dash-momentum-number.score-red    { color: #EF4444; }
.dash-momentum-number.score-orange { color: #F59E0B; }
.dash-momentum-number.score-green  { color: #10B981; }

.dash-momentum-sub {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.dash-streak-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
}

.dash-streak-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
}

.dash-streak-count {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.dash-flame {
  font-size: 28px;
  display: inline-block;
}

.dash-flame-active {
  animation: flameWobble 1.5s ease-in-out infinite;
}

.dash-momentum-bar-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.dash-momentum-bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.dash-momentum-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1s ease, background-color 0.6s ease;
  background: var(--accent);
}

.dash-momentum-bar-fill.score-red    { background: #EF4444; }
.dash-momentum-bar-fill.score-orange { background: #F59E0B; }
.dash-momentum-bar-fill.score-green  { background: #10B981; }

/* Slider énergie */
.dash-energy-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.dash-energy-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.dash-energy-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: var(--radius-full);
  background: linear-gradient(to right, #EF4444, #F59E0B, #10B981);
  outline: none;
  cursor: pointer;
}

.dash-energy-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-card);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.dash-energy-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.dash-energy-value {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--accent);
  min-width: 24px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ===== SECTION 3 — HABITUDES ===== */
.dash-habits-progress {
  margin-bottom: var(--space-4);
}

.dash-habits-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-2);
}

.dash-habits-count {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.dash-habits-pct {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.dash-progress-track {
  height: 6px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.dash-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

.dash-habits-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.dash-habit-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.dash-habit-item:hover {
  background: var(--bg-card-hover);
}

.dash-habit-check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.dash-habit-check.checked {
  background: var(--accent);
  border-color: var(--accent);
}

.dash-habit-check.checking {
  animation: pulseGreen 0.4s ease;
}

.dash-habit-check svg {
  width: 14px;
  height: 14px;
  stroke: white;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.dash-habit-check.checked svg {
  opacity: 1;
}

.dash-habit-name {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.dash-habit-name.done {
  color: var(--text-muted);
  text-decoration: line-through;
}

.dash-habit-streak {
  font-size: var(--text-xs);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 2px;
}

/* ===== SECTION 4 — OBJECTIFS ===== */
.dash-goals-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.dash-goal-item {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
}

.dash-goal-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.dash-goal-name {
  flex: 1;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.dash-goal-badge {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.dash-goal-badge.urgent {
  background: rgba(239,68,68,0.15);
  color: #EF4444;
}

.dash-goal-badge.warning {
  background: rgba(245,158,11,0.15);
  color: #F59E0B;
}

.dash-goal-progress-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.dash-goal-track {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.dash-goal-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

.dash-goal-pct {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 32px;
  text-align: right;
}

/* ===== SECTION 5 — TÂCHES ===== */
.dash-tasks-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.dash-task-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.dash-task-item:hover {
  background: var(--bg-card-hover);
}

.dash-task-check {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dash-task-check:hover {
  border-color: var(--accent);
}

.dash-task-info {
  flex: 1;
  min-width: 0;
}

.dash-task-title {
  font-size: var(--text-sm);
  color: var(--text-primary);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-task-title.overdue {
  color: #EF4444;
}

.dash-task-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 1px;
}

.dash-priority-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}
.dash-priority-dot.high   { background: #EF4444; }
.dash-priority-dot.medium { background: #F59E0B; }
.dash-priority-dot.low    { background: #94A3B8; }

/* Input rapide tâche */
.dash-quick-add {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.dash-quick-input {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  transition: border-color var(--transition-fast);
}

.dash-quick-input::placeholder { color: var(--text-muted); }
.dash-quick-input:focus {
  outline: none;
  border-color: var(--accent);
}

.dash-quick-btn {
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition-fast);
}

.dash-quick-btn:hover { opacity: 0.85; }

/* ===== SECTION 6 — SPORT ===== */
.dash-sport-stats {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.dash-sport-stat {
  flex: 1;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  text-align: center;
}

.dash-sport-stat-value {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.dash-sport-stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.dash-last-session {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  line-height: 1.5;
}

.dash-last-session strong {
  color: var(--text-primary);
}

/* ===== SECTION 7 — FINANCES ===== */
.dash-finances-balance {
  text-align: center;
  margin-bottom: var(--space-5);
}

.dash-finances-amount {
  font-size: var(--text-3xl);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.dash-finances-amount.positive { color: #10B981; }
.dash-finances-amount.negative { color: #EF4444; }
.dash-finances-amount.zero    { color: var(--text-muted); }

.dash-finances-period {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.dash-finances-delta {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-top: var(--space-2);
}

.dash-finances-delta.better {
  background: rgba(16,185,129,0.15);
  color: #10B981;
}

.dash-finances-delta.worse {
  background: rgba(239,68,68,0.15);
  color: #EF4444;
}

.dash-cat-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.dash-cat-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.dash-cat-emoji {
  font-size: 16px;
  width: 22px;
  text-align: center;
}

.dash-cat-name {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.dash-cat-amount {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* ===== SECTION 8 — INTENTIONS ===== */
.dash-intentions-period {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-3);
}

.dash-intentions-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.dash-intention-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  resize: none;
  transition: border-color var(--transition-fast);
  box-sizing: border-box;
}

.dash-intention-input::placeholder { color: var(--text-muted); }
.dash-intention-input:focus {
  outline: none;
  border-color: var(--accent);
}

.dash-intentions-save-indicator {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: right;
  min-height: 16px;
  margin-top: var(--space-1);
  transition: color var(--transition-fast);
}

.dash-intentions-save-indicator.saved {
  color: var(--accent);
}

/* ===== ÉTAT VIDE ===== */
.dash-empty {
  text-align: center;
  padding: var(--space-6) var(--space-4);
  color: var(--text-muted);
}

.dash-empty-icon {
  font-size: 32px;
  margin-bottom: var(--space-2);
}

.dash-empty p {
  font-size: var(--text-sm);
  margin-bottom: var(--space-3);
}

/* ===== SKELETON LOADER ===== */
.dash-skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-card-hover) 25%,
    var(--bg-secondary) 50%,
    var(--bg-card-hover) 75%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s infinite;
  border-radius: var(--radius-md);
}

@keyframes skeletonShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.dash-skeleton-line {
  height: 14px;
  margin-bottom: var(--space-2);
}

.dash-skeleton-line.short  { width: 40%; }
.dash-skeleton-line.medium { width: 65%; }
.dash-skeleton-line.long   { width: 90%; }

/* ===== VUE HEBDOMADAIRE ===== */
#dash-weekly-section {
  margin-bottom: var(--space-4);
  animation: dashFadeIn 0.4s ease forwards;
  animation-delay: 80ms;
}

.dash-week-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dash-week-header,
.dash-week-row {
  display: flex;
  align-items: center;
  min-width: 300px;
}

.dash-week-row {
  border-top: 1px solid var(--border);
  padding: 3px 0;
}

.dash-week-header { padding-bottom: var(--space-2); }

.dash-week-label {
  width: 108px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  padding-right: var(--space-2);
}

.dwhl {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 76px;
  font-size: var(--text-xs);
}

.dash-week-cells {
  display: flex;
  flex: 1;
  gap: 3px;
  justify-content: space-between;
}

.dash-week-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding-bottom: var(--space-2);
}

.dash-week-day.is-today .dwl,
.dash-week-day.is-today .dwn {
  color: var(--accent);
  font-weight: 700;
}

.dwl { font-size: 10px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.dwn { font-size: 10px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

.dwc {
  flex: 1;
  aspect-ratio: 1;
  border-radius: 50%;
  max-width: 28px;
  min-width: 20px;
  margin: auto;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.dwc.empty {
  border: 2px solid var(--border);
  cursor: pointer;
}

.dwc.empty:hover {
  border-color: var(--hc, var(--accent));
  background: rgba(16,185,129,0.1);
  transform: scale(1.1);
}

.dwc.done {
  background: var(--hc, var(--accent));
  border: 2px solid var(--hc, var(--accent));
  cursor: pointer;
}

.dwc.done::after {
  content: '✓';
  font-size: 9px;
  color: white;
  font-weight: 800;
  line-height: 1;
}

.dwc.done:hover { opacity: 0.8; transform: scale(1.05); }
.dwc.na { opacity: 0; pointer-events: none; }
.dwc.future { border: 2px dashed var(--border); opacity: 0.3; }

/* ===== 3 MINI SCORES ===== */
#dash-scores-section {
  animation: dashFadeIn 0.4s ease forwards;
}

.dash-scores-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.dash-score-panel {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-3);
  text-align: center;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  animation: dashFadeIn 0.4s ease forwards;
  transition: border-color 0.4s ease, background 0.4s ease;
}

.dash-score-panel.score-green  {
  border-color: rgba(16,185,129,0.5);
  background: linear-gradient(135deg, var(--bg-card) 60%, rgba(16,185,129,0.07));
}
.dash-score-panel.score-orange {
  border-color: rgba(245,158,11,0.5);
  background: linear-gradient(135deg, var(--bg-card) 60%, rgba(245,158,11,0.07));
}
.dash-score-panel.score-red    {
  border-color: rgba(239,68,68,0.5);
  background: linear-gradient(135deg, var(--bg-card) 60%, rgba(239,68,68,0.07));
}

.dash-score-panel-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.dash-score-num {
  font-size: var(--text-3xl);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  margin-bottom: var(--space-2);
  transition: color 0.4s ease;
}
.dash-score-panel.score-green  .dash-score-num { color: #10B981; }
.dash-score-panel.score-orange .dash-score-num { color: #F59E0B; }
.dash-score-panel.score-red    .dash-score-num { color: #EF4444; }

.dash-score-bar-track {
  height: 4px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-2);
}
.dash-score-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.9s ease, background-color 0.4s ease;
}
.dash-score-bar-fill.score-green  { background: #10B981; }
.dash-score-bar-fill.score-orange { background: #F59E0B; }
.dash-score-bar-fill.score-red    { background: #EF4444; }

.dash-score-hint {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* ===== TOP GRID (planning + habitudes) ===== */
.dash-top-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

@media (min-width: 768px) {
  .dash-top-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: var(--space-5);
  }
}

#dash-weekly-section {
  /* Supprime le vieux margin-bottom standalone (géré par dash-top-grid) */
  margin-bottom: 0;
}

/* ===== PLANNING DU JOUR ===== */
.dash-planning-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.dash-planning-identity { min-width: 0; }

.dash-plan-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  margin: var(--space-4) 0 var(--space-3) 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: var(--space-3);
}

.dash-plan-save-indicator {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 400;
  transition: color var(--transition-fast);
}
.dash-plan-save-indicator.saved { color: var(--accent); }

.dash-plan-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  min-height: 36px;
}

.dash-plan-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-2);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}
.dash-plan-item:hover { border-color: var(--border); }
.dash-plan-item.done  { opacity: 0.6; }

.dash-plan-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: none;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.dash-plan-check:hover          { border-color: var(--accent); background: var(--accent-subtle); }
.dash-plan-check.checked        { background: var(--accent); border-color: var(--accent); }
.dash-plan-check svg            { stroke: transparent; transition: stroke var(--transition-fast); }
.dash-plan-check.checked svg    { stroke: white; }

.dash-plan-text {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--text-primary);
  word-break: break-word;
  transition: all var(--transition-fast);
}
.dash-plan-text.striked {
  text-decoration: line-through;
  color: var(--text-muted);
}

.dash-plan-delete {
  width: 20px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all var(--transition-fast);
}
.dash-plan-item:hover .dash-plan-delete { opacity: 1; }
.dash-plan-delete:hover { background: var(--error-subtle); color: var(--error); }

.dash-plan-empty {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-align: center;
  padding: var(--space-3) 0;
  font-style: italic;
}

.dash-plan-add-row {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.dash-plan-input {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  transition: border-color var(--transition-fast);
}
.dash-plan-input::placeholder { color: var(--text-muted); }
.dash-plan-input:focus { outline: none; border-color: var(--accent); }

.dash-plan-add-btn {
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition-fast);
}
.dash-plan-add-btn:hover { opacity: 0.85; }

/* Mobile : scores en 3 col mais compacts */
@media (max-width: 480px) {
  .dash-score-num { font-size: var(--text-2xl); }
  .dash-scores-row { gap: var(--space-2); }
  .dash-score-panel { padding: var(--space-3) var(--space-2); }
}

/* ===== HABITUDES — liste avec coche du jour + dots semaine ===== */

.dw-table-header {
  display: flex;
  align-items: center;
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-1);
  border-bottom: 1px solid var(--border);
}

.dw-table-left {
  /* Largeur identique à : check (22) + gap(8) + icon(18) + gap(8) + name (flex) */
  flex: 1;
  min-width: 0;
}

.dw-dot-headers {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.dw-dot-header {
  width: 22px;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.dw-dot-header.today { color: var(--accent); }

.dw-list {
  display: flex;
  flex-direction: column;
}

.dw-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-fast);
}

.dw-row:last-child { border-bottom: none; }
.dw-row.not-today  { opacity: 0.4; }

/* Checkbox du jour */
.dw-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: none;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.dw-check:not(:disabled):hover {
  border-color: var(--hc, var(--accent));
  background: rgba(16,185,129,0.08);
  transform: scale(1.1);
}

.dw-check.checked {
  background: var(--hc, var(--accent));
  border-color: var(--hc, var(--accent));
}

.dw-check.inactive { cursor: default; }

.dw-check svg { opacity: 0; transition: opacity var(--transition-fast); }
.dw-check.checked svg { opacity: 1; }

/* Icône + nom */
.dw-icon {
  font-size: 14px;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
  line-height: 1;
}

.dw-name {
  flex: 1;
  font-size: var(--text-xs);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all var(--transition-fast);
  min-width: 0;
}

.dw-name.done {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Dots semaine */
.dw-dots {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.dw-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-sizing: border-box;
  transition: all var(--transition-fast);
}

.dw-dot.done {
  background: var(--hc, var(--accent));
}

.dw-dot.empty {
  border: 2px solid var(--border);
}

.dw-dot.empty.is-today {
  border-color: var(--hc, var(--accent));
  border-width: 2px;
  box-shadow: 0 0 0 2px rgba(16,185,129,0.15);
}

.dw-dot.future {
  border: 2px dashed var(--border);
  opacity: 0.25;
}

/* ===== GRILLE HEBDOMADAIRE HABITUDES × JOURS ===== */

.dwg-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

/* ---- En-tête ---- */

.dwg-habit-header {
  min-width: 120px;
  padding: 0 var(--space-2) var(--space-2) var(--space-1);
  border-bottom: 2px solid var(--border);
  text-align: left;
}

.dwg-day-header {
  width: 42px;
  min-width: 42px;
  padding: 0 0 var(--space-2) 0;
  text-align: center;
  border-bottom: 2px solid var(--border);
  vertical-align: bottom;
}

.dwg-day-header.today .dwg-dlabel,
.dwg-day-header.today .dwg-dnum { color: var(--accent); font-weight: 800; }
.dwg-day-header.future           { opacity: 0.35; }

.dwg-dlabel {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.dwg-dnum {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

/* ---- Lignes ---- */

.dwg-row { height: 44px; }
.dwg-row:not(:last-child) td { border-bottom: 1px solid var(--border); }

.dwg-row:hover .dwg-habit-cell { background: var(--bg-secondary); }

.dwg-habit-cell {
  min-width: 120px;
  padding: 0 var(--space-2) 0 var(--space-1);
  vertical-align: middle;
  transition: background var(--transition-fast);
}

.dwg-habit-inner {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dwg-icon {
  font-size: 14px;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
  line-height: 1;
}

.dwg-name {
  flex: 1;
  font-size: var(--text-xs);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  min-width: 0;
}

/* ---- Cellules des jours ---- */

.dwg-cell {
  width: 42px;
  min-width: 42px;
  padding: 0 4px;
  text-align: center;
  vertical-align: middle;
}

.dwg-cell.is-today { background: rgba(16,185,129,0.05); }
.dwg-cell.na       { background: transparent; }

.dwg-cell.future .dwg-btn {
  opacity: 0.18;
  cursor: default;
}

/* ---- Bouton coche ---- */

.dwg-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  margin: 0 auto;
}

.dwg-btn:not(:disabled):not(.checked):hover {
  border-color: #10B981;
  background: rgba(16,185,129,0.1);
  transform: scale(1.12);
}

.dwg-btn.checked {
  background: #10B981;
  border-color: #10B981;
}

.dwg-btn:disabled { cursor: default; }

.dwg-cell.is-today .dwg-btn:not(.checked) {
  border-color: #10B981;
  border-style: dashed;
}

/* Animation cochage */
@keyframes dwgCheck {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.dwg-btn.checking { animation: dwgCheck 0.3s ease; }

@media (max-width: 480px) {
  .dwg-habit-header,
  .dwg-habit-cell  { min-width: 90px; }
  .dwg-name        { font-size: 10px; }
  .dwg-day-header,
  .dwg-cell        { width: 34px; min-width: 34px; }
  .dwg-btn         { width: 24px; height: 24px; }
}

.dw-dot.na {
  visibility: hidden;
}

/* Mobile : dots un peu plus petits */
@media (max-width: 480px) {
  .dw-dot, .dw-dot-header { width: 18px; }
  .dw-dot { height: 18px; }
  .dw-dots { gap: 2px; }
  .dw-dot-headers { gap: 2px; }
}
