:root {
  /* -------- Fonds ---------- */
  --bg-page: #0b0810;
  --bg-sidebar: rgba(12, 9, 14, 0.6);
  --bg-panel: linear-gradient(
    165deg,
    #16101a,
    #100b14
  ); /* cartes principales */
  --bg-panel-alt: linear-gradient(
    165deg,
    #18111c,
    #110c15
  ); /* cartes secondaires */
  --bg-input: rgba(255, 160, 60, 0.05);
  --bg-row: rgba(255, 160, 60, 0.02); /* ligne d'habitude non faite */
  --bg-row-done: linear-gradient(
    90deg,
    rgba(255, 120, 50, 0.08),
    rgba(255, 120, 50, 0.02)
  );

  /*--------Glows d'ambiance ---------*/
  --glow-violet: radial-gradient(
    1000px 600px at 88% -10%,
    rgba(180, 92, 255, 0.1),
    transparent 60%
  );
  --glow-braise: radial-gradient(
    900px 550px at -5% 0%,
    rgba(255, 92, 57, 0.12),
    transparent 55%
  );

  /*--------------bordure----------------*/
  --border-subtle: rgba(255, 150, 70, 0.1); /* séparateurs */
  --border-panel: rgba(255, 150, 70, 0.13); /* cartes */
  --border-strong: rgba(255, 150, 70, 0.2); /* boutons, inputs */
  --border-active: rgba(255, 160, 60, 0.35); /* nav active, focus */
  --border-cell: rgba(255, 180, 90, 0.12); /* cases vides (points, heatmap) */

  /* -------- Accent Couleur ---------*/
  --accent-ember: #ff5c39; /* rouge-orangé */
  --accent-amber: #ffa028; /* orange principal */
  --accent-gold: #ffcf40; /* jaune doré — titres de niveau, valeurs */
  --accent-pink: #ff3d78; /* magenta — quêtes, urgence */
  --accent-violet: #b45cff; /* violet — combo, esprit */
  --accent-blue: #4fa8ff; /* bleu — santé/eau */
  --accent-green: #7fd98a; /* validation ("✓ terminé") */
  /* -----------degrade --------------*/
  --grad-fire: linear-gradient(
    90deg,
    #ff5c39,
    #ffa028,
    #ffcf40
  ); /* XP, niveau, texte héro */
  --grad-cta: linear-gradient(90deg, #ff5c39, #ffa028); /* boutons, checks */
  --grad-quest: linear-gradient(
    90deg,
    #ff3d78,
    #ffa028
  ); /* barres d'objectifs */
  --grad-done: linear-gradient(90deg, #57d474, #a4e768); /* objectif terminé */
  --grad-avatar: linear-gradient(135deg, #ff3d78, #b45cff);

  /* ---------- Ombres / glows ---------- */
  --shadow-logo: 0 0 22px rgba(255, 130, 50, 0.45);
  --shadow-check: 0 0 12px rgba(255, 130, 50, 0.5);
  --shadow-bar: 0 0 10px rgba(255, 150, 50, 0.7);
  --shadow-dot: 0 0 8px currentColor; /* pastilles projet */

  /* ---------- Typrographie -------------*/

  --font-heading: "Space Grotesk", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --fs-hero: 34px; /* h1 */
  --fs-stat: 38px; /* grands chiffres des cartes stats */
  --fs-h2: 17px; /* titres de panneaux (19px pour le panneau principal) */
  --fs-body: 14px;
  --fs-item: 15px; /* nom d'habitude */
  --fs-meta: 12px;
  --fs-label: 11px; /* labels mono uppercase */
  --fs-micro: 10px;

  --ls-label: 0.16em; /* letter-spacing labels (0.1–0.2em selon taille) */
  --lh-body: 1.6;

  /* ------------Texte ------------------*/
  --text-primary: #f3ebe2; /* blanc chaud */
  --text-secondary: #c8bcc4;
  --text-muted: #a99aa5; /* sous-titres */
  --text-label: #9a8d92; /* labels mono uppercase */
  --text-dim: #8a7d8a; /* méta, légendes */
  --text-faint: #6f6472; /* placeholders */
  --text-ghost: #5f5462; /* footer, icônes inactives */
  --text-on-accent: #1a0d05; /* texte sur fond orange */

  /* ---------- Rayons ---------- */
  --radius-panel: 14px; /* cartes */
  --radius-card: 12px; /* sous-cartes, textarea */
  --radius-item: 11px; /* lignes, chips jour */
  --radius-btn: 10px; /* boutons, inputs */
  --radius-nav: 9px; /* boutons de navigation date */
  --radius-cell: 3px; /* segments de barre (2px barres fines) */
  --radius-pill: 20px; /* badges, humeurs */

  /* ---------- Espacements ---------- */
  --space-page: 30px 38px; /* padding du main */
  --space-panel: 22px; /* padding cartes (16–20px cartes stats) */
  --gap-grid: 16px; /* entre cartes */
  --gap-list: 10px; /* entre lignes d'habitudes */
  --gap-cell: 3px; /* entre segments de barre (2px barres projet) */
  --sidebar-w: 232px;

  /* ---------- Composants ---------- */
  --bar-h: 14px; /* barre de niveau (10px projets, 7–8px lisses) */
  --check-size: 28px; /* rond de validation habitude (18px tâches) */
  --hit-min: 34px; /* taille min. boutons */
}

* {
  box-sizing: border-box;
}

body {
  padding: 0;
  margin: 0;
  min-height: 100vh;
  background: var(--glow-violet), var(--glow-braise), var(--bg-page);
  color: var(--text-primary);

  font-family: var(--font-heading);

  display: flex;
}

.label {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  color: var(--text-label);
}

.sidebar {
  width: var(--sidebar-w);
  align-items: center;
  padding: 22px 16px;
  gap: 6px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.titrelogo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 20px 8px;
}

.logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--grad-cta);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-logo);
  font-size: 16px;
  color: var(--text-on-accent);
}

.titre {
  color: var(--accent-gold);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.12em;
}

.navigation {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  color: var(--text-label);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.1em;
}
.nav-item:hover {
  color: var(--accent-gold);
}
.nav-item.actif {
  border-color: var(--border-active);
  background: rgba(255, 160, 60, 0.1);
  color: #ffe9c9;
}

main {
  flex: 1;
  padding: 30px 38px 40px 38px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: auto;
  max-height: 100vh;
}

.bandeau {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}

.date-lisible {
  letter-spacing: 0.2em;
  font-size: 11px;
}

h1 {
  margin: 6px 0 0 0;
  font-size: 34px;
  font-weight: 700;
}
.degrade {
  background: var(--grad-fire);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.btn-nav {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-nav);
  background: var(--bg-input);
  color: var(--accent-amber);
  cursor: pointer;
  font-size: 12px;
}

.btn-aujourdhui {
  height: 34px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-nav);
  background: var(--grad-cta);
  color: var(--text-on-accent);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  font-weight: 600;
  text-transform: uppercase;
}

.panneau {
  background: var(--bg-panel);
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-panel);
  padding: var(--space-panel);
}

.top-habitudes-resume {
  display: flex;
  justify-content: space-between;
  flex-direction: row;
  align-items: baseline;
  margin-bottom: 14px;
}
h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
}

.resume {
  font-size: 13px;
}

.grille {
  display: flex;
  flex-direction: column;
  gap: var(--gap-grid);
}

.carte {
  border: 1px solid var(--border-cell);
  border-radius: var(--radius-item);
  background: var(--bg-row);
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
}

.check {
  width: var(--check-size);
  height: var(--check-size);
  flex-shrink: 0;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  color: var(--text-on-accent);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  background-color: var(--bg-panel);
  display: grid;
  place-items: center;
  background: transparent;
}
.checkfait {
  border-color: transparent;
  background: var(--grad-cta);
  box-shadow: var(--shadow-check);
}
.pastille {
  width: 35px;
  height: 35px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-dot);
}

.nom {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 600px;
}
.nomfait {
  text-decoration: line-through;
  color: var(--text-dim);
}

.points {
  display: flex;
  gap: 4px;
}

.cellule {
  width: 20px;
  height: 20px;
  border: 1px solid var(--border-cell);
  border-radius: 6px;
  background-color: var(--bg-row);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--text-dim);
}

.cellulefait {
  width: 20px;
  height: 20px;
  border: 1px solid var(--border-cell);
  border-radius: 6px;
  background-color: var(--bg-row);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--text-dim);
  background: var(--grad-cta);
}

.serie {
  color: var(--accent-amber);
  font-size: 12px;
  min-width: 44px;
  text-align: right;
  white-space: nowrap;
}

.suppr {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-ghost);
  cursor: pointer;
  font-size: 16px;
  border-radius: 6px;
}

.form-ajout {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.form-ajout input[type="text"] {
  height: 38px;
  min-width: 160px;
  flex: 1;
  background-color: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-btn);
  padding: 0 14px;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 14px;
}

.form-ajout input[type="color"] {
  height: 38px;
  width: 38px;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-btn);
  padding: 3px;
  background-color: var(--bg-input);
}

.form-ajout button[type="submit"] {
  height: 38px;
  background: var(--grad-cta);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-btn);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-on-accent);
  letter-spacing: 0.02em;
  font-family: var(--font-mono);
  text-transform: uppercase;
  padding: 0 18px;
}
.form-ajout input[type="color"]::-webkit-color-swatch {
  border-style: none;
}

.panneau:hover {
  box-shadow: 0 18px 40px -28px rgba(255, 130, 50, 0.45);
}
.carte:hover {
  box-shadow: 0 18px 40px -28px rgba(255, 150, 50, 0.7);
}
