/* VARIABLES GLOBALES (thème clair)  */
:root {
  --primary: #4a52d8;
  --primary-dark: #2d2f7f;
  --primary-light: #ede9ff;
  --accent: #35c1be;
  --text-strong: #1a1b2f;
  --text-muted: #887d8e;
  --surface: #fffdf9;
  --surface-alt: #f7f4ff;
  --warm-surface: #fdf8f1;
  --border: #dce4f6;
  --shadow: 0 18px 45px rgba(21, 44, 102, 0.12);
  --status-blue: #1f6feb;
  --status-green: #16c79a;
  --status-orange: #ffb347;
  --status-red: #ff6b6b;
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --gap-lg: 24px;
  --gap-md: 16px;
  /* Compatibilité ancien système  */
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1a1b2f;
  --muted: #887d8e;
  --ring: #dce4f6;
  --secondary: #5567ff;
  --secondary-light: #e5e9ff;
  --danger: #ff6b6b;
  --success: #16c79a;
}

/* VARIABLES THÈME SOMBRE  */
.dark,
body.dark {
  --primary: #94b0ff;
  --primary-dark: #728cff;
  --primary-light: #202544;
  --text-strong: #f5f7ff;
  --text-muted: #98a6d6;
  --surface: #15182c;
  --surface-alt: #0f1426;
  --warm-surface: #1a1f3a;
  --border: #2a3150;
  --shadow: 0 18px 45px rgba(5, 8, 20, 0.55);
  --status-blue: #82a7ff;
  --status-green: #3adcb9;
  --status-orange: #ffca7a;
  --status-red: #ff8282;
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --gap-lg: 24px;
  --gap-md: 16px;
  /* Compatibilité ancien système  */
  --bg: #0f1426;
  --card: #15182c;
  --text: #f5f7ff;
  --muted: #98a6d6;
  --ring: #2a3150;
  --secondary: #7d8dff;
  --secondary-light: #2a315d;
  --danger: #ff8282;
  --success: #3adcb9;
}

/* RESET & TYPOGRAPHIE  */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', 'SF Pro Display', system-ui, sans-serif;
  background: linear-gradient(180deg, #fefaf4, #f5f2ff);
  color: var(--text-strong);
  font-size: 15px;
  line-height: 1.5;
}
body.dark {
  background: linear-gradient(180deg, #0f1426, #15182c);
  color: var(--text-strong);
}
body.dark h1,
body.dark h2,
body.dark h3,
body.dark h4,
body.dark h5,
body.dark h6 {
  color: var(--text-strong) !important;
}

/* Liens et texte secondaire  */
a { color: inherit; text-decoration: none; }
.muted { color: var(--text-muted); }

/* CONTAINER PRINCIPAL  */
.app {
  max-width: 960px;
  margin: 0 auto;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: transparent;
}

/* HEADER  */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 24px 12px;
}
.brand { display: flex; gap: 12px; align-items: center; }
.logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}
.title { font-size: 20px; margin: 0; letter-spacing: 1px; font-weight: 800; color: var(--primary); }
.icon-btn {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.icon-btn:hover { transform: translateY(-1px); }

/* CONTENEUR PAGES  */
.view-container {
  padding: 16px 24px 32px;
  display: grid;
  gap: var(--gap-lg);
  animation: fadeIn 0.45s ease;
}
.page { display: grid; gap: var(--gap-lg); }

/* CARDS  */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(31,60,136,0.08);
  padding: 22px 24px;
  box-shadow: 0 18px 40px rgba(20,20,43,0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  color: var(--text-strong);
}
body.dark .card {
  background: #15182c !important;
  border-color: rgba(148, 176, 255, 0.2) !important;
  box-shadow: 0 18px 40px rgba(5, 8, 20, 0.4) !important;
  color: var(--text-strong) !important;
}
/* Mode sombre : les éléments de texte utilisent directement les variables CSS */
body.dark .card p,
body.dark .card span,
body.dark .card div {
  color: var(--text-strong) !important;
}
/* Exception : les boutons .btn dans les cartes gardent toujours leur couleur blanche (sauf .ghost) */
body.dark .card .btn:not(.ghost),
body.dark .card button:not(.ghost),
.card .btn:not(.ghost),
.card button:not(.ghost) {
  color: #fff !important;
}
body.dark .card .muted,
body.dark .card .label,
body.dark .card span.muted {
  color: var(--text-muted) !important;
}
body.dark .card strong,
body.dark .card h1, 
body.dark .card h2, 
body.dark .card h3, 
body.dark .card h4, 
body.dark .card h5, 
body.dark .card h6 {
  color: var(--text-strong) !important;
}
.card:hover { transform: translateY(-2px); }
.card h2,
.card h3 { margin-top: 0; color: var(--text-strong); }

.grid-2 { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-2.form-row { grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid-2.form-row { grid-template-columns: repeat(2,minmax(0,1fr)); } }
.col { display: grid; gap: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/*
   BOUTONS PRINCIPAUX & GHOST
*/
.btn {
  background: linear-gradient(120deg, var(--primary), var(--primary-dark));
  color: #fff !important;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 22px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 20px rgba(31, 60, 136, 0.25);
}
.btn:hover { transform: translateY(-1px); }
.btn.ghost {
  background: transparent !important;
  color: var(--text-strong) !important;
  border: 1px solid var(--border);
  box-shadow: none;
}
body.dark .btn.ghost {
  color: var(--text-strong) !important;
  border-color: rgba(148, 176, 255, 0.3);
}
/* Renforcement pour les boutons ghost dans les cartes */
.card .btn.ghost,
.card button.ghost,
.card a.btn.ghost,
.track-card .btn.ghost,
.track-card button.ghost,
.track-card a.btn.ghost,
.plan-head .btn.ghost,
.plan-head button.ghost,
.plan-head a.btn.ghost,
.today-plan .btn.ghost,
.today-plan button.ghost,
.today-plan a.btn.ghost {
  color: var(--text-strong) !important;
}
body.dark .card .btn.ghost,
body.dark .card button.ghost,
body.dark .card a.btn.ghost,
body.dark .track-card .btn.ghost,
body.dark .track-card button.ghost,
body.dark .track-card a.btn.ghost,
body.dark .plan-head .btn.ghost,
body.dark .plan-head button.ghost,
body.dark .plan-head a.btn.ghost,
body.dark .today-plan .btn.ghost,
body.dark .today-plan button.ghost,
body.dark .today-plan a.btn.ghost {
  color: var(--text-strong) !important;
}
.btn.pill { border-radius: 999px; }
.btn.danger {
  background: var(--status-red);
  box-shadow: 0 10px 18px rgba(255, 107, 107, 0.25);
}
.btn:focus-visible,
.icon-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

label { font-size: 13px; color: var(--text-muted); }
input, select, textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 12px 14px;
  font: inherit;
  background: var(--surface-alt);
  color: var(--text-strong);
}
textarea { resize: vertical; min-height: 64px; }

/* BOUTONS SEGMENTÉS  */
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 8px 10px;
}
.segmented input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  flex: 1 1 calc(50% - 10px);
  min-width: 120px;
  padding: 9px 14px;
  border-radius: 14px;
  cursor: pointer;
  text-align: center;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
}
.segmented input[type="radio"]:checked + label {
  background: linear-gradient(120deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-color: transparent;
}
@media (min-width: 700px) {
  .segmented label {
    flex: 1 1 calc(33.33% - 14px);
  }
}

/*
   FLASH MESSAGES (notifications temporaires)
*/
.flash {
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 16px;
  animation: flashShowHide 5.6s ease-in-out forwards;
  overflow: hidden;
}
.flash-success { 
  border-left: 4px solid var(--status-green);
  background: linear-gradient(135deg, rgba(22,199,154,0.1), rgba(22,199,154,0.05));
  border-color: var(--status-green);
  color: var(--text-strong);
}
.flash-info { 
  border-left: 4px solid var(--status-blue);
  background: linear-gradient(135deg, rgba(31,111,235,0.1), rgba(31,111,235,0.05));
  border-color: var(--status-blue);
}
.flash-error { 
  border-left: 4px solid var(--status-red);
  background: linear-gradient(135deg, rgba(255,107,107,0.1), rgba(255,107,107,0.05));
  border-color: var(--status-red);
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes flashShowHide {
  0% {
    opacity: 0;
    transform: translateY(-15px);
    max-height: 0;
    margin-bottom: 0;
  }
  5.4% {
    opacity: 1;
    transform: translateY(0);
    max-height: 150px;
    margin-bottom: 16px;
  }
  94.6% {
    opacity: 1;
    transform: translateY(0);
    max-height: 150px;
    margin-bottom: 16px;
  }
  100% {
    opacity: 0;
    transform: translateY(-15px);
    max-height: 0;
    margin-bottom: 0;
  }
}

/*
   BLOC "INSIGHTS" & TIMELINE (STATS / REWARDS)
   - petites cartes de chiffres clés
   - historique vertical des événements
*/
.insight-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); }
.insight-card {
  padding: 18px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  gap: 6px;
}
.insight-card small { color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; }
.insight-value { font-size: 30px; font-weight: 800; }
.progress-track { width: 100%; height: 10px; border-radius: 999px; background: var(--surface-alt); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%); transition: width 0.35s ease; }

.timeline { display: grid; gap: 12px; }
.timeline-item { display: flex; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.timeline-item:last-child { border-bottom: none; }
.timeline-icon { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; font-size: 22px; background: var(--surface-alt); }
body.dark .timeline-icon {
  background: rgba(148, 176, 255, 0.1);
}
.timeline-info { flex: 1; }
.timeline-info strong { 
  display: block; 
  margin-bottom: 4px; 
  color: var(--text-strong);
  font-weight: 700;
}
.timeline-points { font-weight: 700; color: var(--primary); }

/*
   HERO & CARTES DE FOCUS (HOME)
*/
/* Hero intro : conteneur d'introduction des pages */
.hero-intro {
  color: var(--text-strong);
  background: transparent;
}
body.dark .hero-intro {
  color: var(--text-strong) !important;
  background: transparent !important;
}
.hero-intro h2 { 
  font-size: 28px; 
  font-weight: 800; 
  margin: 4px 0; 
  color: var(--text-strong) !important; 
  background: transparent !important;
}
body.dark .hero-intro h2,
body.dark .page .hero-intro h2,
body.dark .view-container .hero-intro h2,
body.dark .page-home .hero-intro h2,
body.dark .page-stats .hero-intro h2 {
  color: #f5f7ff !important;
  background: transparent !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  opacity: 1 !important;
}
.hero-intro p { 
  margin: 0; 
  color: var(--text-muted); 
}
body.dark .hero-intro p {
  color: var(--text-muted) !important;
}
body.dark .hero-intro .muted {
  color: var(--text-muted) !important;
}
.hero-card {
  background: var(--surface);
  border-radius: 26px;
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: var(--shadow);
}
.section-title { font-size: 18px; font-weight: 700; color: var(--text-strong); }

.focus-stack { display: grid; gap: 16px; }
.focus-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.focus-card strong { display: block; font-size: 17px; }
.focus-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  display: grid;
  place-items: center;
  font-size: 24px;
  color: var(--primary);
}

/*
   FILTRES & ÉTATS VIDES (TO-DO)
*/
.tab-filters { display: flex; gap: 10px; flex-wrap: wrap; }
.tab-filters a,
.tab-filters button {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
}
.tab-filters .active {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}

.empty-state {
  display: grid;
  gap: 8px;
  text-align: center;
  padding: 32px 18px;
  color: var(--text-muted);
}

/*
   LISTE DES TÂCHES (TO-DO)
*/
.todo-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.todo-item:last-child { border-bottom: none; }
.todo-item.done { opacity: 0.6; text-decoration: line-through; }
.task-title { font-weight: 600; font-size: 16px; }
.task-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pill {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
}
.pill.prio-high { border-color: var(--status-red); color: var(--status-red); }
.pill.prio-med { border-color: var(--status-orange); color: var(--status-orange); }
.pill.prio-low { border-color: var(--status-green); color: var(--status-green); }
.type-chip {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(31, 60, 136, 0.08);
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}
body.dark .type-chip {
  background: rgba(148, 176, 255, 0.15);
}
.type-chip .icon { font-size: 14px; }

/*
   FORMULAIRE D'AJOUT RAPIDE (TO-DO)
*/
.quick-add-card { background: var(--warm-surface); border-color: rgba(31,60,136,0.08); }
body.dark .quick-add-card {
  background: var(--surface-alt);
  border-color: rgba(148, 176, 255, 0.15);
}
.quick-input { display: grid; gap: 10px; }
.quick-input label { font-weight: 600; font-size: 14px; }
.quick-field {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: stretch;
}
.quick-field textarea {
  flex: 1;
  min-height: 64px;
  resize: none;
  border-radius: var(--radius-md);
  border: 1px solid rgba(31, 60, 136, 0.15);
  background: var(--surface);
  padding: 14px;
  font-size: 15px;
  color: var(--text-strong);
}
.quick-field .btn {
  min-width: 130px;
  align-self: stretch;
}
.quick-tags {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 6px;
}
.tag-option {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.tag-option input { display: none; }
.tag-option input:checked + .pill,
.tag-option input:checked + .type-chip {
  outline: 2px solid var(--status-blue);
  outline-offset: 2px;
}
.custom-type-field {
  margin-top: 12px;
  display: grid;
  gap: 6px;
}
.custom-type-field label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.custom-type-input {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px dashed rgba(31,60,136,0.2);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  background: var(--surface);
}
body.dark .custom-type-input {
  border-color: rgba(148, 176, 255, 0.3);
}
.custom-type-input .icon { font-size: 18px; }
.custom-type-input input {
  border: none;
  background: transparent;
  flex: 1;
  font: inherit;
  color: var(--text-strong);
  outline: none;
}
.tag-hints {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

/*
   OVERVIEW DES RÉCOMPENSES (PAGE REWARDS)
*/
.reward-overview {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 28px;
  box-shadow: var(--shadow);
}
.reward-header {
  display: grid;
  gap: 28px;
}
.reward-main {
  display: grid;
  gap: 12px;
}
.reward-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}
.reward-total {
  margin: 0;
  font-size: 56px;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  letter-spacing: -0.02em;
}
.reward-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  width: fit-content;
  box-shadow: 0 4px 16px rgba(74, 82, 216, 0.25);
}
.level-icon {
  font-size: 18px;
}
.reward-progress-section {
  display: grid;
  gap: 16px;
  padding: 20px;
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.reward-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.progress-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.progress-percent {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}
.reward-progress-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(31, 60, 136, 0.08);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}
body.dark .reward-progress-bar {
  background: rgba(148, 176, 255, 0.15);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}
.reward-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  transition: width 0.5s ease-out;
  box-shadow: 0 2px 8px rgba(74, 82, 216, 0.3);
  position: relative;
}
.reward-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}
.reward-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 4px;
}
.reward-stat-item {
  display: grid;
  gap: 6px;
}
.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-strong);
  line-height: 1;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-banner {
  display: grid;
  gap: 20px;
  background: linear-gradient(135deg, #fdf3ff, #fdf8f1);
  border: 1px solid rgba(31,60,136,0.12);
  padding: 24px;
}
body.dark .progress-banner {
  background: linear-gradient(135deg, #1a1f3a, #1f2544);
  border-color: rgba(148, 176, 255, 0.15);
}
.progress-info { display: grid; gap: 12px; }
.progress-info h3 { margin: 0; font-size: 32px; font-weight: 800; color: var(--text-strong); }
.progress-track-daily {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(31,60,136,0.08);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}
body.dark .progress-track-daily {
  background: rgba(148, 176, 255, 0.15);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}
.progress-fill-daily {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  transition: width 0.5s ease-out;
  box-shadow: 0 2px 8px rgba(45,87,255,0.3);
  position: relative;
}
.progress-fill-daily::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}
.mini-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.tag-badge {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong);
}
.eyebrow {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--status-blue);
}
.progress-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) calc(var(--progress) * 1%), rgba(31,60,136,0.1) 0);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 28px;
  color: var(--primary-dark);
  border: 8px solid rgba(255,255,255,0.4);
}
.mini-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-weight: 600;
}
.chart-card .chart {
  background: var(--surface);
  border: 1px solid var(--border);
}
.journey-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.journey-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  box-shadow: 0 12px 30px rgba(20,28,56,0.07);
}
.journey-card .label {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.journey-card strong { font-size: 22px; display: block; }
.journey-value {
  font-size: 28px;
  font-weight: 900;
  display: block;
  color: var(--text-strong);
  line-height: 1.2;
  margin: 4px 0;
}
.journey-card span { color: var(--text-muted); font-size: 13px; }
.journey-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(31,60,136,0.08);
  display: grid;
  place-items: center;
  font-size: 22px;
}
body.dark .journey-icon {
  background: rgba(148, 176, 255, 0.15);
}
.rewards-panel {
  display: grid;
  gap: 18px;
}
.rewards-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.rewards-header h3 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-strong);
  margin: 4px 0;
}
.favorites-head h3 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-strong);
  margin: 4px 0;
}
.reward-ring {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 20px;
}
.reward-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.reward-list li {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  font-weight: 600;
}
.reward-icon {
  font-size: 20px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(31,60,136,0.08);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
body.dark .reward-icon {
  background: rgba(148, 176, 255, 0.15);
}
.reward-text {
  flex: 1;
  font-size: 15px;
  color: var(--text-strong);
  font-weight: 600;
}
.reward-badge {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.reward-badge.positive {
  background: linear-gradient(135deg, var(--status-green), #16c79a);
  color: #fff;
  box-shadow: 0 2px 8px rgba(22,199,154,0.25);
}
.favorites-panel .eyebrow { color: var(--text-muted); }
.progress-track.mini { height: 8px; background: rgba(20,31,56,0.12); }

/*
   POMODORO (ANCIEN TIMER CIRCULAIRE + PRESETS)
*/
.pomodoro-timer { display: grid; gap: 16px; justify-items: center; }
.pomodoro-timer .ring { width: 220px; height: 220px; position: relative; }
.pomodoro-timer .label { 
  position: absolute; 
  inset: 0; 
  display: grid; 
  place-items: center; 
  font-size: 36px; 
  font-weight: 800; 
  color: var(--text-strong);
}
.pomodoro-timer .progress-ring .progress { 
  transition: stroke-dashoffset 0.3s ease-out; 
  filter: drop-shadow(0 2px 4px rgba(45,87,255,0.2));
}
.preset-row { display: grid; grid-template-columns: repeat(auto-fit,minmax(90px,1fr)); gap: 12px; }
.preset-btn {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px;
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
}
.preset-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}
.toolbar { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.toolbar form { margin: 0; }

.ambiance-audio { width: 100%; margin-top: 12px; border-radius: 16px; }
.track-card.active { border-color: var(--primary); }
.track-card .badge { padding: 4px 10px; border-radius: 999px; background: var(--primary-light); color: var(--primary); font-size: 12px; }


.chart { min-height: 220px; border: 1px solid var(--border); border-radius: 24px; padding: 16px; display: grid; place-items: center; }

/*
   TABBAR (ANCIEN DESIGN DE NAVIGATION BAS)
*/
/*
   TABBAR (V2) : NAVIGATION PRINCIPALE MOBILE
*/
.tabbar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(255,255,255,0.9);
  border-top: 1px solid rgba(31,60,136,0.08);
  backdrop-filter: blur(18px);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -18px 35px rgba(20,20,43,0.12);
}
body.dark .tabbar {
  background: rgba(21, 24, 44, 0.95);
  border-top-color: rgba(148, 176, 255, 0.15);
  box-shadow: 0 -18px 35px rgba(5, 8, 20, 0.4);
}
.tabbar a {
  padding: 12px 6px 10px;
  text-align: center;
  color: var(--text-muted);
  font-weight: 600;
  display: grid;
  gap: 4px;
  justify-items: center;
  font-size: 12px;
}
.tabbar a .nav-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  font-size: 18px;
  background: rgba(31,60,136,0.06);
  transition: background 0.2s ease, color 0.2s ease;
}
.tabbar a.active {
  color: var(--primary);
}
.tabbar a.active .nav-icon {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 8px 18px rgba(31,60,136,0.3);
}

/*
   AUTH (ANCIEN STYLE DE LA CARTE LOGIN)
*/
.login-container { min-height: 100dvh; display: grid; place-items: center; background: var(--surface-alt); padding: 20px; }
.login-card {
  max-width: 420px;
  width: 100%;
  background: var(--surface);
  border-radius: 32px;
  padding: 40px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
  border: 1px solid var(--border);
  text-align: center;
}
.login-title { margin: 0; font-size: 30px; font-weight: 800; }
.login-subtitle { margin: 0 0 8px 0; color: var(--text-muted); }
.login-card .login-form { display: grid; gap: 16px; justify-items: center; }
.login-card .login-form > * { width: 100%; }

.task-create textarea { font-size: 16px; line-height: 1.5; }
.task-create fieldset { border: none; padding: 0; margin: 0; }
.task-create legend { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.form-row { align-items: start; }
.tips ul { padding-left: 18px; margin: 0; }

#pomo { scroll-margin-top: 80px; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Règles .app-header, .brand, .icon-btn, .view-container, .page, .grid-2, .col, .row déjà définies en haut - suppression de la duplication */

/* Règles .btn déjà définies en haut du fichier - suppression de la duplication */

.chip-btn {
  width: 42px; height: 42px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--primary-light);
  color: var(--primary);
  cursor: pointer;
}
body.dark .chip-btn {
  background: rgba(148, 176, 255, 0.15);
}

label { font-size: 13px; color: var(--text-muted); }
input, select, textarea {
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 12px 14px;
  font: inherit;
  background: var(--surface);
  color: var(--text-strong);
}
body.dark input, .dark select, .dark textarea {
  background: var(--surface-alt);
  border-color: rgba(148, 176, 255, 0.2);
  color: var(--text-strong);
}
textarea { resize: vertical; }

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--secondary-light);
  border-radius: 16px;
  padding: 10px;
}
.segmented input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  flex: 1 1 calc(50% - 10px);
  min-width: 120px;
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  color: var(--primary);
  border: 1px solid transparent;
  background: transparent;
}
.segmented input[type="radio"]:checked + label {
  background: var(--primary);
  color: #fff;
}
@media (min-width: 700px) {
  .segmented label {
    flex: 1 1 calc(33.33% - 14px);
  }
}


.tabbar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--border);
  background: var(--surface);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -14px 35px rgba(10, 18, 49, 0.08);
}
.tab-btn {
  padding: 14px 4px;
  display: grid;
  justify-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.tab-btn .nav-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  background: rgba(31,60,136,0.08);
  font-size: 18px;
}
body.dark .tab-btn .nav-icon {
  background: rgba(148, 176, 255, 0.15);
}
.tab-btn.active { color: var(--primary); }
.tab-btn.active .nav-icon {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 8px 18px rgba(31,60,136,0.3);
}

/*
   HOME (V2) : HERO + BLOC "FOCUS DU JOUR"
*/
.welcome-hero h1 {
  margin: 0 0 6px;
  font-size: 24px;
}
.welcome-hero p { margin: 0; color: var(--text-muted); }

.quote-card { display: grid; gap: 14px; }
.quote-card .quote-actions { display: flex; gap: 10px; align-items: center; }

.hero-stack { display: grid; }
.status-strip {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--warm-surface);
  border: 1px solid rgba(31, 60, 136, 0.08);
  font-weight: 600;
  color: var(--text-strong);
}
body.dark .status-strip {
  background: var(--surface-alt) !important;
  border-color: rgba(148, 176, 255, 0.15) !important;
  color: var(--text-strong) !important;
}
.focus-launch {
  background: var(--surface);
  display: grid;
  gap: var(--gap-md);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
}
body.dark .focus-launch {
  background: linear-gradient(135deg, #151a32, #1b2040) !important;
  border-color: rgba(148, 176, 255, 0.3) !important;
  color: var(--text-strong) !important;
}
body.dark .focus-launch .muted,
body.dark .focus-launch .label {
  color: var(--text-muted) !important;
}
body.dark .focus-launch .focus-eyebrow {
  color: var(--status-blue) !important;
}
.focus-header h3 { margin: 4px 0 0 0; font-size: 26px; }
.focus-eyebrow {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--status-blue);
}
.focus-task {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  display: grid;
  gap: 6px;
}
body.dark .focus-task {
  background: rgba(10, 16, 40, 0.9);
  border-color: rgba(148, 176, 255, 0.25);
}
.focus-task.empty { background: transparent; border-style: dashed; }
.focus-task .label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.focus-task .task-name {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-strong);
}
.focus-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.focus-progress {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  color: var(--text-strong);
}
body.dark .focus-progress {
  color: var(--text-strong);
}
.mode-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.mode-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--surface);
  transition: transform 0.2s ease;
}
body.dark .mode-card:not(.primary) {
  background: rgba(10, 16, 40, 0.9);
  border-color: rgba(148, 176, 255, 0.25);
  color: var(--text-strong);
}
body.dark .mode-card:not(.primary) .mode-copy strong,
body.dark .mode-card:not(.primary) .mode-cta {
  color: var(--text-strong);
}
body.dark .mode-card:not(.primary) .mode-copy span {
  color: var(--text-muted);
}
.mode-card:hover { transform: translateY(-2px); }
.mode-card.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 24px 35px rgba(31, 60, 136, 0.25);
}
.mode-card.primary .mode-cta { background: rgba(255,255,255,0.2); color: #fff; }
.mode-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(31, 60, 136, 0.08);
  display: grid;
  place-items: center;
  font-size: 22px;
}
body.dark .mode-icon {
  background: rgba(148, 176, 255, 0.15);
}
.mode-card.primary .mode-icon { background: rgba(255,255,255,0.15); }
.mode-copy strong { display: block; font-size: 16px; }
.mode-copy span { font-size: 13px; color: var(--text-muted); }
body.dark .mode-copy span { color: var(--text-muted); }
.mode-card.primary .mode-copy span { color: rgba(255,255,255,0.8); }
.mode-cta {
  font-weight: 700;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  border: none;
  background: rgba(31, 60, 136, 0.08);
  color: var(--primary);
}
body.dark .mode-cta {
  background: rgba(148, 176, 255, 0.15);
}
.mode-cta.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-strong);
}
body.dark .mode-cta.ghost {
  border-color: rgba(148, 176, 255, 0.3);
  color: var(--text-strong);
}
.insight-line {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.insight-line > div {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
}
body.dark .insight-line > div {
  background: rgba(10, 16, 40, 0.9);
  border-color: rgba(148, 176, 255, 0.25);
}
body.dark .insight-line .label {
  color: var(--text-muted);
}
body.dark .insight-line strong {
  color: var(--text-strong);
}
.insight-line .label {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.insight-line strong { 
  font-size: 20px; 
  color: var(--text-strong);
  font-weight: 800;
}
.spotlight-card {
  border-radius: 34px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0,1fr);
}
.spotlight-visual {
  position: relative;
  min-height: 160px;
  background: linear-gradient(135deg, #1f3c88, #5d73f2);
}
.spotlight-img {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(255,255,255,0.15), rgba(19,27,56,0.25));
  opacity: 0.5;
}
.spotlight-badge {
  position: absolute;
  bottom: 16px;
  left: 16px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-weight: 600;
  backdrop-filter: blur(6px);
}
.spotlight-body {
  padding: 24px 26px 26px;
  display: grid;
  gap: 16px;
}
.spotlight-body h3 { 
  margin: 4px 0; 
  font-size: 28px; 
  color: var(--text-strong);
  font-weight: 800;
}
.spotlight-progress {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  color: var(--text-strong);
}
.progress-track.mini { height: 8px; background: rgba(20,31,56,0.08); }
body.dark .progress-track.mini {
  background: rgba(148, 176, 255, 0.15);
}
.mode-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.mode-chip {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 10px 14px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-weight: 600;
  background: var(--surface-alt);
}
body.dark .mode-chip {
  border-color: rgba(148, 176, 255, 0.2);
}
.mode-chip span:first-child { font-size: 18px; }
.mode-chip.ghost {
  background: transparent;
}
.metric-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.metric-card {
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 18px;
  box-shadow: 0 12px 30px rgba(20,28,56,0.08);
  display: grid;
  gap: 6px;
}
.metric-label {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.metric-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-strong);
}
.metric-caption {
  font-size: 13px;
  color: var(--text-muted);
}

.quick-stats {
  display: grid;
  gap: 18px;
}
.quick-head {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}
.quick-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit,minmax(180px,1fr));
}
.quick-item {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 14px;
  background: var(--surface-alt);
  display: grid;
  gap: 4px;
}
.quick-item .label {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.quick-item strong {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-strong);
}
/*
   HOME (V2) : SECTION "À TRAITER AUJOURD'HUI"
*/
.today-plan { display: grid; gap: 18px; }
.plan-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
/* Assurer la visibilité des boutons ghost dans plan-head */
.plan-head .btn.ghost,
.plan-head a.btn.ghost {
  color: var(--text-strong) !important;
}
body.dark .plan-head .btn.ghost,
body.dark .plan-head a.btn.ghost {
  color: var(--text-strong) !important;
}
.plan-list { display: grid; gap: 12px; }
.plan-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface-alt);
}
body.dark .today-plan {
  background: var(--surface);
}
body.dark .plan-item {
  background: rgba(10, 16, 40, 0.95);
  border-color: rgba(148, 176, 255, 0.25);
}
/* Forcer les textes dans plan-item à être visibles  */
body.dark .plan-item .plan-title,
body.dark .plan-item strong {
  color: var(--text-strong) !important;
}
.plan-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-strong);
}
.plan-item .pill { margin-right: 6px; }
.plan-link {
  align-self: center;
  font-weight: 600;
  color: var(--primary);
}
.pill.soft {
  border-color: transparent;
  background: rgba(31, 60, 136, 0.08);
  color: var(--primary);
}

/*
   HOME (V2) : CARTE "INSPIRE-TOI" (CITATION)
*/
.inspiration-card { display: grid; gap: 18px; }
.inspiration-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.inspiration-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: rgba(30, 51, 114, 0.08);
  display: grid;
  place-items: center;
  font-size: 20px;
  color: var(--primary);
}
body.dark .inspiration-icon {
  background: rgba(148, 176, 255, 0.15);
}
.inspiration-title {
  margin: 0 0 4px 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
}
.inspiration-quote {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-strong);
}
.inspiration-author {
  color: var(--text-muted);
  font-size: 14px;
}
.inspiration-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.btn.slim { padding: 10px 20px; }
.inspiration-icons {
  display: flex;
  gap: 10px;
}
.icon-chip {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  display: grid;
  place-items: center;
  font-size: 18px;
  color: var(--text-strong);
  cursor: pointer;
}
body.dark .icon-chip.active {
  background: rgba(148, 176, 255, 0.2);
  border-color: var(--primary);
}
.icon-chip.active {
  background: rgba(31, 60, 136, 0.12);
}

.focus-grid { display: grid; gap: 14px; }
.focus-card {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
}
body.dark .focus-card {
  background: var(--surface-alt);
  border-color: rgba(148, 176, 255, 0.2);
}
.focus-card .icon {
  width: 48px; height: 48px;
  border-radius: 16px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 24px;
  display: grid; place-items: center;
}
body.dark .focus-card .icon {
  background: rgba(148, 176, 255, 0.15);
}

.insight-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.insight-card {
  border-radius: 20px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface), var(--surface-alt));
  padding: 16px;
  display: grid;
  gap: 6px;
}
body.dark .insight-card {
  background: linear-gradient(180deg, var(--surface), var(--surface-alt));
  border-color: rgba(148, 176, 255, 0.2);
}
.insight-card small { text-transform: uppercase; font-size: 11px; color: var(--text-muted); }
.insight-value { font-size: 24px; font-weight: 800; color: var(--text-strong); }
.progress-track {
  width: 100%; height: 8px;
  border-radius: 999px;
  background: rgba(31, 60, 136, 0.08);
}
body.dark .progress-track {
  background: rgba(148, 176, 255, 0.15);
}
.progress-fill { height: 100%; border-radius: inherit; background: var(--primary); }

.todo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.filter-tabs { display: flex; gap: 8px; }
.filter-tabs a {
  padding: 8px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  font-weight: 600;
  color: var(--text-strong);
  background: var(--surface);
}
body.dark .filter-tabs a {
  background: var(--surface-alt);
  border-color: rgba(148, 176, 255, 0.2);
}
.filter-tabs a.active {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}

.todo-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
}
body.dark .todo-item {
  border-bottom-color: rgba(148, 176, 255, 0.15);
}
.todo-item:last-child { border-bottom: none; }
.todo-item.done { opacity: 0.55; }
.pill {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-strong);
}
body.dark .pill {
  border-color: rgba(148, 176, 255, 0.2);
}

.empty-state {
  padding: 28px;
  text-align: center;
  color: var(--text-muted);
  border-radius: 22px;
  border: 1px dashed var(--border);
  background: var(--surface-alt);
}
body.dark .empty-state {
  border-color: rgba(148, 176, 255, 0.15);
}

/*
   POMODORO (V2) : PANEL TIMER + MÉTADONNÉES
*/
.pomo-panel { display: grid; gap: 20px; }
.pomo-focus { display: grid; gap: 18px; justify-items: center; }
.pomo-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mode-label {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(45,87,255,0.1);
  color: var(--primary-dark);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.05em;
}
.cycle-chip {
  font-weight: 600;
  color: var(--text-muted);
}
.timer-display {
  display: grid;
  gap: 24px;
  justify-items: center;
  width: 100%;
}
.timer-label {
  font-size: 64px;
  font-weight: 900;
  color: var(--text-strong);
  letter-spacing: -0.03em;
  line-height: 1;
}
.progress-bar-container {
  width: 100%;
  max-width: 320px;
}
.progress-bar-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e3ebff;
  overflow: hidden;
  position: relative;
}
body.dark .progress-bar-track {
  background: rgba(148, 176, 255, 0.15);
}
.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2d57ff, #4a52d8);
  transition: width 0.5s ease-out;
  box-shadow: 0 2px 8px rgba(45,87,255,0.3);
  position: relative;
}
.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.pomo-meta {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px,1fr));
  gap: 12px;
  text-align: left;
}
.pomo-meta p {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.pomo-meta strong { 
  font-size: 18px; 
  color: var(--text-strong);
  font-weight: 800;
}
.pomo-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.pomo-actions form { margin: 0; }
.pomo-presets { display: grid; gap: 14px; }
.preset-head { display: flex; justify-content: space-between; align-items: center; }
.preset-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.preset-chip {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 12px 14px;
  text-align: left;
  background: var(--surface);
  display: grid;
  gap: 4px;
  cursor: pointer;
}
.preset-chip strong { 
  font-size: 15px; 
  color: var(--text-strong);
  font-weight: 700;
}
.preset-chip span { font-size: 12px; color: var(--text-muted); }
.preset-chip.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 12px 25px rgba(31,60,136,0.25);
}
.preset-chip.active span { color: rgba(255,255,255,0.8); }

/*
   AMBIANCE (V2) : CARTES DE SONS + BADGE "EN COURS"
*/
.track-card.active { border-color: var(--primary); box-shadow: 0 14px 30px rgba(23,34,80,0.12); }
.track-card .badge {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--secondary-light);
  font-size: 12px;
}

/*
   RESPIRATION (V2) : PATTERNS, CERCLE & ÉTAPES
*/
/* Respiration Module  */
.breath-patterns { display: grid; gap: 16px; }
.pattern-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}
.pattern-head h3 { margin: 0; font-size: 22px; font-weight: 800; color: var(--text-strong); }
.pattern-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.pattern-chip {
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  padding: 16px;
  background: var(--surface);
  display: flex;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}
.pattern-chip:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(31,60,136,0.08);
}
.pattern-chip.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 12px 25px rgba(31,60,136,0.25);
}
.pattern-icon {
  font-size: 32px;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: rgba(31,60,136,0.08);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
body.dark .pattern-icon {
  background: rgba(148, 176, 255, 0.15);
}
.pattern-chip.active .pattern-icon {
  background: rgba(255,255,255,0.2);
}
.pattern-info {
  display: grid;
  gap: 4px;
  flex: 1;
}
.pattern-info strong {
  font-size: 16px;
  font-weight: 700;
  display: block;
  color: var(--text-strong);
}
.pattern-info span {
  font-size: 13px;
  color: var(--text-muted);
}
.pattern-chip.active .pattern-info span {
  color: rgba(255,255,255,0.8);
}

.breath-hero {
  display: grid;
  gap: 28px;
  justify-items: center;
  padding: 32px;
}
.breath-circle {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 6px solid var(--border);
  background: var(--surface-alt);
  animation: breath-cycle var(--cycle-duration, 16s) infinite ease-in-out;
  animation-play-state: paused;
  transition: all 0.4s ease;
  box-shadow: 0 4px 16px rgba(45,87,255,0.1);
  transform: scale(0.85);
}
.breath-circle.is-running {
  animation-play-state: running;
  background: linear-gradient(135deg, rgba(45,87,255,0.15), rgba(74,82,216,0.08));
  box-shadow: 0 8px 32px rgba(45,87,255,0.2);
  border-color: var(--primary);
}
.breath-circle:not(.is-running) {
  animation-play-state: paused;
  border-color: var(--border);
  background: var(--surface-alt);
  opacity: 1;
}
@keyframes breath-cycle {
  0% { 
    transform: scale(0.85); 
    border-color: var(--primary); 
  }
  25% { 
    transform: scale(1.15); 
    border-color: var(--primary); 
  }
  50% { 
    transform: scale(1.15); 
    border-color: var(--accent); 
  }
  75% { 
    transform: scale(0.85); 
    border-color: var(--primary-light); 
  }
  100% { 
    transform: scale(0.85); 
    border-color: var(--primary); 
  }
}

.breath-instruction {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 24px 0;
}
.breath-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 400px;
}
.breath-step {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  background: var(--surface-alt);
  text-align: center;
}
.step-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.step-duration {
  display: block;
  font-size: 24px;
  font-weight: 800;
  color: var(--text-strong);
}

.breath-cta {
  padding: 20px;
}
.btn-full {
  width: 100%;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/*
   REWARDS (V2) : CARTE POINTS + TIMELINE
*/
.points-card {
  background: linear-gradient(135deg, #1b2450, #2f3f9e);
  color: #fff;
  border: none;
  box-shadow: 0 30px 60px rgba(22,33,84,0.3);
}
.points-card .hero-title { color: #fff; }
.timeline { margin-top: 12px; }
.timeline-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-icon {
  width: 44px; height: 44px;
  border-radius: 16px;
  background: rgba(255,255,255,0.15);
  display: grid; place-items: center;
  font-size: 20px;
}
.timeline-info { flex: 1; }
.timeline-points { 
  font-weight: 700; 
  color: var(--primary);
}

/*
   STATS (V2) : GRAPHIQUE "7 DERNIERS JOURS"
*/
.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}
.chart-head h3 { font-size: 24px; font-weight: 800; color: var(--text-strong); }
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}
.legend-dot.filled { background: var(--primary); }
.legend-dot.empty { background: rgba(76, 110, 245, 0.25); }
.chart {
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
  min-height: 220px;
  background: var(--surface-alt);
}
body.dark .chart {
  border-color: rgba(148, 176, 255, 0.2);
}
.chart.chart-empty { display: grid; place-items: center; text-align: center; }
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 200px;
}
.chart-bar {
  flex: 1;
  display: grid;
  gap: 8px;
  justify-items: center;
}
.chart-value {
  font-size: 13px;
  font-weight: 700;
  min-height: 18px;
  color: var(--text-strong);
}
.chart-bar.is-empty .chart-value { 
  color: var(--text-muted);
  font-weight: 600;
}
.chart-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
}
.chart-bar .bar {
  width: 60%;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  transition: height 0.4s ease-out;
  box-shadow: 0 2px 8px rgba(45,87,255,0.2);
  position: relative;
}
.chart-bar .bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 30%;
  background: linear-gradient(180deg, rgba(255,255,255,0.3), transparent);
  border-radius: 999px 999px 0 0;
}
.chart-bar .bar.zero {
  height: 8px !important;
  background: rgba(31,60,136,0.15);
  box-shadow: none;
}
body.dark .chart-bar .bar.zero {
  background: rgba(148, 176, 255, 0.2);
}
.chart-bar .bar.zero::after {
  display: none;
}

/*
   STATS (V2) : LISTE DES CITATIONS FAVORITES
*/
.favorite-quote {
  padding: 12px 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.favorite-text { 
  flex: 1 1 220px; 
  color: var(--text-strong);
}
.favorite-text p {
  color: var(--text-strong);
  font-weight: 600;
}
.favorite-text span {
  color: var(--text-muted);
}
.favorite-remove { margin: 0; }
.favorite-quote .btn { white-space: nowrap; }
.favorite-quote + .favorite-quote { margin-top: 10px; }

/*
   AUTH (V2) : PAGE DE CONNEXION / INSCRIPTION
*/
.login-container { min-height: 100dvh; display: grid; place-items: center; background: var(--surface); padding: 20px; }
body.dark .login-container { background: var(--surface); }
.login-card { max-width: 420px; width: 100%; background: var(--surface); border-radius: 32px; padding: 32px; box-shadow: 0 20px 60px rgba(15,23,42,0.2); display: grid; gap: 16px; }
body.dark .login-card { background: var(--surface); box-shadow: 0 20px 60px rgba(5,8,20,0.4); }
.login-title { margin: 0; font-size: 28px; font-weight: 800; text-align: center; color: var(--text-strong); }
.login-subtitle { margin: 0 0 8px 0; color: var(--text-muted); text-align: center; }
.login-card .login-form { display: grid; gap: 16px; }

.task-create textarea { font-size: 16px; }
.task-create fieldset { border: none; padding: 0; margin: 0; }
.task-create legend { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.form-row { align-items: start; }
.tips ul { margin: 0; padding-left: 18px; }

/* Décalage de scroll pour ancrer la section Pomodoro sous le header  */
#pomo { scroll-margin-top: 80px; }

/* Iframe qui contient le widget Pomodoro (rafraîchi indépendamment)  */
.pomo-frame {
  width: 100%;
  min-height: 720px;
  border: none;
  background: transparent;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px);} to { opacity: 1; transform: translateY(0);} }

