/* ════════════════════════════════════════════════════════════
   RoadTripper — feuille de style principale
   ────────────────────────────────────────────────────────────
   Toutes les couleurs passent par des variables (« tokens »),
   définies deux fois : une pour le thème clair, une pour le sombre.
   Le thème est choisi par l'attribut data-bs-theme="light|dark"
   posé sur <html> par static/js/theme-init.js.

   Règle à respecter : ne jamais écrire une couleur en dur dans une
   règle ci-dessous. Utiliser une variable, sinon le mode sombre casse.
   ════════════════════════════════════════════════════════════ */


/* ── 0. Polices (hébergées en local, licence SIL OFL) ─────────── */
/* Aucune requête vers Google Fonts : l'adresse IP des visiteurs
   n'est transmise à aucun tiers.
   Polices « variables » : un seul fichier contient toutes les graisses.
   font-display: swap affiche le texte immédiatement avec une police
   système, puis bascule dès que la police est chargée. */
@font-face {
  font-family:  'Inter';
  font-style:   normal;
  font-weight:  100 900;
  font-display: swap;
  src: url("../fonts/inter-variable.260c81a4759b.woff2") format('woff2');
}

@font-face {
  font-family:  'Manrope';
  font-style:   normal;
  font-weight:  200 800;
  font-display: swap;
  src: url("../fonts/manrope-variable.938c6e8019b6.woff2") format('woff2');
}


/* ── 1. Tokens : thème clair (par défaut) ─────────────────────── */
:root,
[data-bs-theme="light"] {
  /* Couleurs de marque — identiques dans les deux thèmes,
     elles servent de fonds sombres (barre de navigation, bandeaux) */
  --rt-dark:         #0F1923;
  --rt-road:         #1E3A5F;
  --rt-forest-1:     #0B3D2E;
  --rt-forest-2:     #1A6B4A;
  --rt-speed:        #E8A020;
  --rt-speed-dark:   #D4900F;
  --rt-trail:        #2ECC71;
  --rt-danger:       #E74C3C;
  --rt-danger-dark:  #C0392B;

  /* Surfaces et textes — changent avec le thème */
  --rt-bg:            #F4F5F7;   /* fond de page */
  --rt-surface:       #FFFFFF;   /* cartes, panneaux */
  --rt-surface-2:     #F7F8FA;   /* zones secondaires (pied de carte, chat) */
  --rt-border:        rgba(15, 25, 35, .08);
  --rt-border-strong: rgba(15, 25, 35, .15);
  --rt-text:          #0F1923;
  --rt-text-muted:    #4A5868;
  --rt-accent:        #1E3A5F;   /* icônes, liens, éléments actifs */
  --rt-accent-hover:  #0F1923;
  --rt-accent-soft:   rgba(30, 58, 95, .08);
  --rt-focus-ring:    rgba(30, 58, 95, .15);

  --rt-shadow:        0 1px 3px rgba(15, 25, 35, .08),
                      0 4px 12px rgba(15, 25, 35, .06);
  --rt-shadow-hover:  0 4px 8px rgba(15, 25, 35, .10),
                      0 12px 24px rgba(15, 25, 35, .08);

  /* Composants particuliers */
  --rt-pending-bg:     #FFFBF0;
  --rt-pending-border: rgba(232, 160, 32, .30);
  --rt-weather-bg:     linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
  --rt-draft-bg:       #BDC3C7;

  /* Badges de difficulté : fond / texte */
  --rt-diff-1-bg: #E8F5E9;  --rt-diff-1-fg: #2E7D32;
  --rt-diff-2-bg: #E3F2FD;  --rt-diff-2-fg: #1565C0;
  --rt-diff-3-bg: #FFF8E1;  --rt-diff-3-fg: #8A5300;
  --rt-diff-4-bg: #FFF3E0;  --rt-diff-4-fg: #B03E00;
  --rt-diff-5-bg: #FFEBEE;  --rt-diff-5-fg: #C62828;

  --rt-radius: 12px;

  /* Typographie : Manrope pour les titres, Inter pour le texte */
  --rt-font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --rt-font-display: 'Manrope', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Bootstrap aligné sur la palette (sinon : bleu vif #0d6efd par défaut) */
  --bs-body-font-family:      var(--rt-font-body);
  --bs-primary:               #1E3A5F;
  --bs-primary-rgb:           30, 58, 95;
  --bs-link-color:            #1E3A5F;
  --bs-link-color-rgb:        30, 58, 95;
  --bs-link-hover-color:      #0F1923;
  --bs-link-hover-color-rgb:  15, 25, 35;
  --bs-border-radius:         .5rem;
  --bs-border-radius-lg:      .75rem;
  --bs-focus-ring-color:      rgba(30, 58, 95, .25);
}


/* ── 2. Tokens : thème sombre ─────────────────────────────────── */
[data-bs-theme="dark"] {
  --rt-bg:            #0E141B;
  --rt-surface:       #161E27;
  --rt-surface-2:     #1C2631;
  --rt-border:        rgba(255, 255, 255, .08);
  --rt-border-strong: rgba(255, 255, 255, .16);
  --rt-text:          #E6EAEF;
  --rt-text-muted:    #9AA7B4;
  --rt-accent:        #8DB4E2;   /* bleu éclairci : lisible sur fond sombre */
  --rt-accent-hover:  #B5CFEE;
  --rt-accent-soft:   rgba(141, 180, 226, .12);
  --rt-focus-ring:    rgba(141, 180, 226, .25);

  /* En sombre, les ombres se voient peu : on renforce l'opacité */
  --rt-shadow:        0 1px 3px rgba(0, 0, 0, .40),
                      0 4px 12px rgba(0, 0, 0, .30);
  --rt-shadow-hover:  0 4px 8px rgba(0, 0, 0, .45),
                      0 12px 24px rgba(0, 0, 0, .35);

  --rt-pending-bg:     rgba(232, 160, 32, .08);
  --rt-pending-border: rgba(232, 160, 32, .35);
  --rt-weather-bg:     linear-gradient(135deg, #1B2A3A 0%, #22364C 100%);
  --rt-draft-bg:       #5D6D7E;

  /* Fonds translucides : la couleur reste reconnaissable sans éblouir */
  --rt-diff-1-bg: rgba(76, 175, 80, .18);   --rt-diff-1-fg: #81C784;
  --rt-diff-2-bg: rgba(33, 150, 243, .20);  --rt-diff-2-fg: #90CAF9;
  --rt-diff-3-bg: rgba(255, 193, 7, .18);   --rt-diff-3-fg: #FFD54F;
  --rt-diff-4-bg: rgba(255, 152, 0, .20);   --rt-diff-4-fg: #FFB74D;
  --rt-diff-5-bg: rgba(244, 67, 54, .22);   --rt-diff-5-fg: #EF9A9A;

  /* Composants Bootstrap (cartes, menus, champs) alignés sur nos surfaces */
  --bs-body-bg:      #161E27;
  --bs-secondary-bg: #1C2631;
  --bs-tertiary-bg:  #1C2631;

  /* Liens éclaircis pour rester lisibles sur fond sombre */
  --bs-link-color:            #8DB4E2;
  --bs-link-color-rgb:        141, 180, 226;
  --bs-link-hover-color:      #B5CFEE;
  --bs-link-hover-color-rgb:  181, 207, 238;
  --bs-focus-ring-color:      rgba(141, 180, 226, .30);
}


/* ── 3. Structure de page ─────────────────────────────────────── */
html, body {
  height: 100%;
}

body {
  display:          flex;
  flex-direction:   column;
  min-height:       100vh;
  background-color: var(--rt-bg);
  color:            var(--rt-text);
}

main {
  flex: 1 0 auto;
}


/* ── 4. Typographie ───────────────────────────────────────────── */
body {
  font-family:             var(--rt-font-body);
  -webkit-font-smoothing:  antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.section-title,
.rt-panel__title,
.rt-form-section__title,
.rt-card__title,
.rt-hero__title,
.rt-profile-card__name,
.rt-brand {
  font-family:    var(--rt-font-display);
  letter-spacing: -.015em;   /* resserre légèrement les grands titres */
}

/* Chiffres à chasse fixe : les compteurs ne « dansent » pas */
.rt-card__spots,
.rt-card__details,
.badge {
  font-variant-numeric: tabular-nums;
}


/* ── 5. Barre de navigation ───────────────────────────────────── */
/* Fond sombre translucide + flou : le contenu qui défile dessous
   reste deviné, comme à travers un verre dépoli */
.navbar {
  background:              rgba(15, 25, 35, .94) !important;   /* assez opaque pour rester sombre sur fond clair */
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter:         saturate(160%) blur(14px);
  border-bottom:           1px solid rgba(255, 255, 255, .06);
  padding-top:             .65rem;
  padding-bottom:          .65rem;
}

/* Navigateurs sans prise en charge du flou : fond opaque */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .navbar { background: var(--rt-dark) !important; }
}

/* Logo : pictogramme + nom en deux tons */
.rt-brand {
  display:     flex;
  align-items: center;
  gap:         .55rem;
  font-weight: 800;
  font-size:   1.2rem;
  color:       #fff !important;
}

.rt-brand__mark {
  width:           32px;
  height:          32px;
  border-radius:   9px;
  display:         grid;
  place-items:     center;
  background:      linear-gradient(135deg, var(--rt-speed) 0%, var(--rt-speed-dark) 100%);
  color:           var(--rt-dark);
  font-size:       1rem;
  box-shadow:      0 2px 8px rgba(232, 160, 32, .35);
}

.rt-brand__accent { color: var(--rt-speed); }

.navbar .nav-link {
  color:         rgba(255, 255, 255, .72);
  font-weight:   500;
  font-size:     .92rem;
  border-radius: 8px;
  padding:       .45rem .75rem !important;
  transition:    color .15s ease, background-color .15s ease;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus-visible {
  color:      #fff;
  background: rgba(255, 255, 255, .06);
}

/* Page en cours */
.navbar .nav-link.active {
  color:      #fff;
  background: rgba(255, 255, 255, .10);
}

/* Lien « Nouvelle sortie » : l'action principale, en ambre */
.navbar .nav-link.rt-nav-cta {
  color: var(--rt-speed);
}
.navbar .nav-link.rt-nav-cta:hover {
  color:      #F5B53D;
  background: rgba(232, 160, 32, .10);
}

/* Le bouton du sélecteur de thème hérite du style des liens */
.navbar .nav-link.rt-theme-toggle {
  border:     none;
  background: none;
}
.navbar .nav-link.rt-theme-toggle:hover {
  background: rgba(255, 255, 255, .06);
}

.rt-nav-avatar {
  width:         26px;
  height:        26px;
  border-radius: 50%;
  object-fit:    cover;
  margin-right:  .35rem;
  border:        1px solid rgba(255, 255, 255, .2);
}

/* Menus déroulants */
.dropdown-menu {
  border:        1px solid var(--rt-border);
  border-radius: 12px;
  box-shadow:    var(--rt-shadow-hover);
  padding:       .4rem;
  font-size:     .9rem;
}

.dropdown-item {
  border-radius: 8px;
  padding:       .45rem .75rem;
}

.dropdown-item i {
  width:        1.25rem;
  display:      inline-block;
  color:        var(--rt-text-muted);
}

.dropdown-item.active,
.dropdown-item:active {
  background: var(--rt-road);
  color:      #fff;
}
.dropdown-item.active i,
.dropdown-item:active i { color: #fff; }


/* ── 6. Pied de page ──────────────────────────────────────────── */
footer {
  flex-shrink: 0;
  background:  var(--rt-dark);
  color:       #8A96A3;
  padding:     32px 0;
  border-top:  1px solid rgba(255, 255, 255, .06);
  font-size:   .88rem;
}

footer .rt-brand { justify-content: center; font-size: 1rem; }

footer a {
  color:           #8A96A3;
  text-decoration: none;
}

footer a:hover { color: #fff; }


/* ── 7. Composants Bootstrap harmonisés ───────────────────────── */
/* Bootstrap fige les couleurs de ses boutons à la compilation :
   on les redéfinit via ses variables locales (--bs-btn-*). */
.btn {
  font-weight:   600;
  border-radius: 8px;
}

.btn-primary {
  --bs-btn-bg:                    var(--rt-road);
  --bs-btn-border-color:          var(--rt-road);
  --bs-btn-hover-bg:              #17304F;
  --bs-btn-hover-border-color:    #17304F;
  --bs-btn-active-bg:             var(--rt-dark);
  --bs-btn-active-border-color:   var(--rt-dark);
  --bs-btn-disabled-bg:           var(--rt-road);
  --bs-btn-disabled-border-color: var(--rt-road);
  --bs-btn-focus-shadow-rgb:      30, 58, 95;
}

.btn-outline-primary {
  --bs-btn-color:               var(--rt-accent);
  --bs-btn-border-color:        var(--rt-accent);
  --bs-btn-hover-color:         #fff;
  --bs-btn-hover-bg:            var(--rt-road);
  --bs-btn-hover-border-color:  var(--rt-road);
  --bs-btn-active-color:        #fff;
  --bs-btn-active-bg:           var(--rt-road);
  --bs-btn-active-border-color: var(--rt-road);
  --bs-btn-focus-shadow-rgb:    30, 58, 95;
}

.btn-warning {
  --bs-btn-color:              var(--rt-dark);
  --bs-btn-bg:                 var(--rt-speed);
  --bs-btn-border-color:       var(--rt-speed);
  --bs-btn-hover-color:        var(--rt-dark);
  --bs-btn-hover-bg:           var(--rt-speed-dark);
  --bs-btn-hover-border-color: var(--rt-speed-dark);
  --bs-btn-active-bg:          var(--rt-speed-dark);
}

/* En sombre : bleu un peu plus clair, sinon le bouton se fond dans le fond */
[data-bs-theme="dark"] .btn-primary {
  --bs-btn-bg:                  #2B5283;
  --bs-btn-border-color:        #2B5283;
  --bs-btn-hover-bg:            #33609A;
  --bs-btn-hover-border-color:  #33609A;
}

/* text-primary sur fond sombre : on utilise l'accent éclairci */
[data-bs-theme="dark"] .text-primary {
  color: var(--rt-accent) !important;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--rt-accent);
  box-shadow:   0 0 0 .2rem var(--rt-focus-ring);
}

.form-check-input:checked {
  background-color: var(--rt-road);
  border-color:     var(--rt-road);
}

.form-check-input:focus {
  border-color: var(--rt-accent);
  box-shadow:   0 0 0 .2rem var(--rt-focus-ring);
}

.alert {
  border-radius: 10px;
}


/* ── 8. Éléments génériques ───────────────────────────────────── */
.section-title {
  font-weight:  700;
  border-left:  4px solid var(--rt-accent);
  padding-left: 12px;
}

/* Cartes Bootstrap (pages de connexion, inscription, confirmation…) */
.card {
  border:        1px solid var(--rt-border);
  border-radius: var(--rt-radius);
  box-shadow:    var(--rt-shadow);
}

.btn-sos {
  background:  var(--rt-danger);
  color:       #fff;
  font-weight: 700;
}


/* ── 9. Carte de sortie ───────────────────────────────────────── */
.rt-card {
  background:     var(--rt-surface);
  border-radius:  var(--rt-radius);
  box-shadow:     var(--rt-shadow);
  border:         1px solid var(--rt-border);
  overflow:       hidden;
  display:        flex;
  flex-direction: column;
  height:         100%;
  transition:     transform .15s ease, box-shadow .15s ease;
}

.rt-card:hover {
  transform:  translateY(-2px);
  box-shadow: var(--rt-shadow-hover);
}

/* En-tête en dégradé : fond de marque, identique dans les deux thèmes */
.rt-card__header {
  padding:         14px 16px;
  display:         flex;
  justify-content: space-between;
  align-items:     flex-start;
}

.rt-card__header--meca {
  background: linear-gradient(135deg, var(--rt-dark) 0%, var(--rt-road) 100%);
}

.rt-card__header--musc {
  background: linear-gradient(135deg, var(--rt-forest-1) 0%, var(--rt-forest-2) 100%);
}

.rt-card__meta {
  display:   flex;
  gap:       6px;
  flex-wrap: wrap;
}

/* Pastilles posées sur les en-têtes sombres : blanc translucide */
.rt-pill {
  display:         inline-flex;
  align-items:     center;
  gap:             4px;
  padding:         3px 10px;
  border-radius:   20px;
  font-size:       .75rem;
  font-weight:     600;
  background:      rgba(255, 255, 255, .15);
  color:           #fff;
  backdrop-filter: blur(4px);
}

.rt-pill--light {
  background: rgba(255, 255, 255, .25);
}

/* Statut de la sortie */
.rt-card__status {
  font-size:      .7rem;
  font-weight:    700;
  padding:        3px 8px;
  border-radius:  20px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.rt-status--published { background: var(--rt-trail);   color: #fff; }
.rt-status--cancelled { background: var(--rt-danger);  color: #fff; }
.rt-status--completed { background: #5D6D7E;           color: #fff; }
.rt-status--ongoing   { background: var(--rt-speed);   color: var(--rt-dark); }
.rt-status--draft     { background: var(--rt-draft-bg); color: var(--rt-text); }

/* Corps */
.rt-card__body {
  padding:   16px;
  flex-grow: 1;
}

.rt-card__title-row {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  gap:             8px;
  margin-bottom:   10px;
  flex-wrap:       nowrap;   /* empêche le retour à la ligne */
}

.rt-card__title {
  font-size:     1rem;
  font-weight:   800;
  margin:        0;
  line-height:   1.3;
  flex-grow:     1;
  min-width:     0;          /* nécessaire pour l'ellipsis dans un flex item */
  white-space:   nowrap;
  overflow:      hidden;
  text-overflow: ellipsis;
}

.rt-card__title a {
  color:           var(--rt-text);
  text-decoration: none;
}

.rt-card__title a:hover {
  color: var(--rt-accent);
}

.rt-card__details {
  list-style:     none;
  padding:        0;
  margin:         0;
  display:        flex;
  flex-direction: column;
  gap:            6px;
}

.rt-card__details li {
  display:     flex;
  align-items: center;
  gap:         6px;
  font-size:   .82rem;
  color:       var(--rt-text-muted);
}

.rt-card__details i {
  color:       var(--rt-accent);
  font-size:   .9rem;
  flex-shrink: 0;
}

/* Pied de carte */
.rt-card__footer {
  padding:         10px 16px;
  border-top:      1px solid var(--rt-border);
  display:         flex;
  justify-content: space-between;
  align-items:     center;
  background:      var(--rt-surface-2);
}

.rt-card__spots {
  font-size:   .8rem;
  font-weight: 600;
  color:       var(--rt-text-muted);
  display:     flex;
  align-items: center;
  gap:         5px;
}

.rt-card__thumb {
  width:         36px;
  height:        36px;
  border-radius: 6px;
  object-fit:    cover;
  border:        2px solid var(--rt-border);
}

/* Badges de difficulté */
.rt-difficulty {
  font-size:     .65rem;
  font-weight:   700;
  padding:       2px 7px;
  border-radius: 20px;
  white-space:   nowrap;
  flex-shrink:   0;          /* le badge ne rétrécit jamais */
}

.rt-difficulty--1 { background: var(--rt-diff-1-bg); color: var(--rt-diff-1-fg); }
.rt-difficulty--2 { background: var(--rt-diff-2-bg); color: var(--rt-diff-2-fg); }
.rt-difficulty--3 { background: var(--rt-diff-3-bg); color: var(--rt-diff-3-fg); }
.rt-difficulty--4 { background: var(--rt-diff-4-bg); color: var(--rt-diff-4-fg); }
.rt-difficulty--5 { background: var(--rt-diff-5-bg); color: var(--rt-diff-5-fg); }


/* ── 10. Barre de filtres et recherche ─────────────────────────── */
.rt-filters {
  display:       flex;
  flex-wrap:     wrap;
  align-items:   flex-end;
  gap:           20px;
  padding:       16px 20px;
  background:    var(--rt-surface);
  border-radius: var(--rt-radius);
  border:        1px solid var(--rt-border);
}

.rt-filter-group {
  display:        flex;
  flex-direction: column;
  gap:            6px;
}

.rt-filter-group--selects {
  flex-direction: row;
  flex-wrap:      wrap;
  gap:            8px;
}

.rt-filter-label {
  font-size:   .72rem;
  font-weight: 600;
  color:       var(--rt-text-muted);
}

/* Boutons radio en forme de pastilles */
.rt-pills-toggle {
  display:       flex;
  background:    var(--rt-surface-2);
  border-radius: 8px;
  padding:       3px;
  gap:           2px;
}

.rt-pill-radio {
  position: relative;
  cursor:   pointer;
}

.rt-pill-radio input {
  position:       absolute;
  opacity:        0;
  pointer-events: none;
}

.rt-pill-radio span {
  display:       block;
  padding:       6px 14px;
  border-radius: 6px;
  font-size:     .82rem;
  font-weight:   600;
  color:         var(--rt-text-muted);
  transition:    background .15s, color .15s;
  white-space:   nowrap;
}

.rt-pill-radio input:checked + span {
  background: var(--rt-road);
  color:      #fff;
}

.rt-pill-radio:hover input:not(:checked) + span {
  background: var(--rt-accent-soft);
}

/* Navigation au clavier : l'anneau de focus doit rester visible */
.rt-pill-radio input:focus-visible + span {
  box-shadow: 0 0 0 3px var(--rt-focus-ring);
}

.rt-select {
  padding:       7px 12px;
  border-radius: 8px;
  border:        1px solid var(--rt-border-strong);
  background:    var(--rt-surface);
  font-size:     .82rem;
  color:         var(--rt-text);
  min-width:     140px;
}

.rt-select:focus {
  outline:      none;
  border-color: var(--rt-accent);
  box-shadow:   0 0 0 3px var(--rt-focus-ring);
}

.rt-filter-reset {
  font-size:       .82rem;
  color:           var(--rt-text-muted);
  text-decoration: none;
  display:         flex;
  align-items:     center;
  gap:             4px;
  padding:         7px 4px;
}

.rt-filter-reset:hover {
  color: var(--rt-danger);
}

.rt-search-box {
  display:       flex;
  align-items:   center;
  gap:           8px;
  padding:       7px 12px;
  border-radius: 8px;
  border:        1px solid var(--rt-border-strong);
  background:    var(--rt-surface);
}

.rt-search-box:focus-within {
  border-color: var(--rt-accent);
  box-shadow:   0 0 0 3px var(--rt-focus-ring);
}

.rt-search-box i {
  color: var(--rt-text-muted);
}

.rt-search-input {
  border:     none;
  outline:    none;
  flex:       1;
  font-size:  .85rem;
  color:      var(--rt-text);
  background: transparent;
}

.rt-filter-submit {
  padding:       8px 18px;
  border-radius: 8px;
  border:        none;
  background:    var(--rt-road);
  color:         #fff;
  font-weight:   600;
  font-size:     .82rem;
  align-self:    flex-end;
  cursor:        pointer;
  transition:    background .15s;
}

.rt-filter-submit:hover {
  background: var(--rt-dark);
}

@media (max-width: 768px) {
  .rt-filters {
    flex-direction: column;
    align-items:    stretch;
  }
  .rt-filter-group--selects {
    flex-direction: column;
  }
  .rt-select { width: 100%; }
}


/* ── 11. Page d'une sortie ─────────────────────────────────────── */
.rt-hero {
  position:            relative;
  border-radius:       var(--rt-radius);
  overflow:            hidden;
  min-height:          220px;
  display:             flex;
  align-items:         flex-end;
  background-size:     cover;
  background-position: center;
  margin-bottom:       24px;
}

.rt-hero--meca { background-image: linear-gradient(135deg, var(--rt-dark) 0%, var(--rt-road) 100%); }
.rt-hero--musc { background-image: linear-gradient(135deg, var(--rt-forest-1) 0%, var(--rt-forest-2) 100%); }

.rt-hero__overlay {
  width:      100%;
  padding:    24px;
  background: linear-gradient(to top, rgba(15, 25, 35, .8) 0%, rgba(15, 25, 35, 0) 100%);
}

.rt-hero__badges  { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.rt-hero__title {
  color:       #fff;
  font-size:   1.8rem;
  font-weight: 800;
  margin:      0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}
.rt-hero__actions { position: absolute; top: 16px; right: 16px; display: flex; gap: 8px; }

.rt-panel {
  background:    var(--rt-surface);
  border-radius: var(--rt-radius);
  border:        1px solid var(--rt-border);
  box-shadow:    var(--rt-shadow);
  padding:       24px;
  margin-bottom: 24px;
}

.rt-panel__title {
  font-size:     1.05rem;
  font-weight:   800;
  margin-bottom: 16px;
  display:       flex;
  align-items:   center;
  gap:           8px;
}

.rt-info-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap:                   16px;
  margin-bottom:         20px;
}
.rt-info-item        { display: flex; align-items: flex-start; gap: 10px; }
.rt-info-item i      { font-size: 1.2rem; color: var(--rt-accent); margin-top: 2px; }
.rt-info-item__label { font-weight: 600; font-size: .85rem; color: var(--rt-text); }
.rt-info-item__value { font-size: .8rem; color: var(--rt-text-muted); }

/* Bouton SOS : volontairement identique dans les deux thèmes */
.rt-sos-btn {
  width:          100%;
  padding:        16px;
  border:         none;
  border-radius:  var(--rt-radius);
  background:     linear-gradient(135deg, var(--rt-danger) 0%, var(--rt-danger-dark) 100%);
  color:          #fff;
  font-weight:    800;
  font-size:      1.05rem;
  letter-spacing: .5px;
  cursor:         pointer;
  box-shadow:     0 4px 12px rgba(231, 76, 60, .3);
  transition:     transform .1s;
}
.rt-sos-btn:hover:not(:disabled) { transform: translateY(-1px); }
.rt-sos-btn:disabled { opacity: .6; cursor: not-allowed; }

.rt-participant-chip {
  display:       inline-flex;
  align-items:   center;
  gap:           6px;
  padding:       6px 12px;
  border-radius: 20px;
  background:    var(--rt-surface-2);
  border:        1px solid var(--rt-border);
  font-size:     .82rem;
  font-weight:   600;
  color:         var(--rt-text);
}

.rt-organizer-tag {
  font-size:     .62rem;
  font-weight:   700;
  background:    var(--rt-speed);
  color:         var(--rt-dark);
  padding:       1px 6px;
  border-radius: 10px;
}

.rt-pending-item {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding:         12px;
  border:          1px solid var(--rt-pending-border);
  background:      var(--rt-pending-bg);
  border-radius:   10px;
  margin-bottom:   10px;
  gap:             12px;
  flex-wrap:       wrap;
}

.rt-chat-messages {
  height:        300px;
  overflow-y:    auto;
  background:    var(--rt-surface-2);
  border-radius: 10px;
  padding:       14px;
  margin-bottom: 12px;
}

.rt-weather {
  background:    var(--rt-weather-bg);
  border-radius: 10px;
  padding:       16px;
  text-align:    center;
}


/* ── 12. Formulaires ───────────────────────────────────────────── */
.rt-form-section {
  background:    var(--rt-surface);
  border-radius: var(--rt-radius);
  border:        1px solid var(--rt-border);
  box-shadow:    var(--rt-shadow);
  padding:       24px;
  margin-bottom: 20px;
}

.rt-form-section__title {
  font-size:     1rem;
  font-weight:   800;
  margin-bottom: 18px;
  display:       flex;
  align-items:   center;
  gap:           8px;
  color:         var(--rt-text);
}
.rt-form-section__title i { color: var(--rt-accent); }

.rt-field { margin-bottom: 16px; }
.rt-field:last-child { margin-bottom: 0; }
.rt-field label {
  display:       block;
  font-weight:   600;
  font-size:     .85rem;
  color:         var(--rt-text);
  margin-bottom: 6px;
}
.rt-field .text-muted { font-weight: 400; }

/* Uniformise les champs générés par Django (sans classes) */
.rt-form-section input[type="text"],
.rt-form-section input[type="number"],
.rt-form-section input[type="datetime-local"],
.rt-form-section input[type="file"],
.rt-form-section select,
.rt-form-section textarea {
  width:         100%;
  padding:       9px 12px;
  border-radius: 8px;
  border:        1px solid var(--rt-border-strong);
  font-size:     .88rem;
  color:         var(--rt-text);
  background:    var(--rt-surface);
  transition:    border-color .15s;
}

.rt-form-section input:focus,
.rt-form-section select:focus,
.rt-form-section textarea:focus {
  outline:      none;
  border-color: var(--rt-accent);
  box-shadow:   0 0 0 3px var(--rt-focus-ring);
}

.rt-form-actions {
  display:    flex;
  gap:        10px;
  margin-top: 8px;
}

.rt-btn-submit {
  padding:       11px 28px;
  border:        none;
  border-radius: 8px;
  background:    linear-gradient(135deg, var(--rt-speed) 0%, var(--rt-speed-dark) 100%);
  color:         var(--rt-dark);
  font-weight:   800;
  font-size:     .92rem;
  cursor:        pointer;
  transition:    transform .1s;
}
.rt-btn-submit:hover { transform: translateY(-1px); }


/* ── 13. Tableau de bord ──────────────────────────────────────── */
.rt-profile-card {
  background:    var(--rt-surface);
  border-radius: var(--rt-radius);
  border:        1px solid var(--rt-border);
  box-shadow:    var(--rt-shadow);
  overflow:      hidden;
  margin-bottom: 20px;
}

.rt-profile-card__banner {
  height:     72px;
  background: linear-gradient(135deg, var(--rt-dark) 0%, var(--rt-road) 100%);
}

.rt-profile-card__body { padding: 0 20px 20px; text-align: center; }

.rt-avatar {
  width:         88px;
  height:        88px;
  border-radius: 50%;
  object-fit:    cover;
  border:        4px solid var(--rt-surface);   /* se fond dans la carte */
  margin-top:    -44px;
  position:      relative;
  box-shadow:    0 2px 8px rgba(15, 25, 35, .15);
}

.rt-avatar--initial {
  display:         flex;
  align-items:     center;
  justify-content: center;
  background:      var(--rt-speed);
  color:           var(--rt-dark);
  font-size:       2rem;
  font-weight:     800;
  margin:          -44px auto 0;
}

.rt-profile-card__name { font-size: 1.1rem; font-weight: 800; margin: 12px 0 2px; }
.rt-profile-card__mail { font-size: .82rem; color: var(--rt-text-muted); }

.rt-progress {
  height:        8px;
  border-radius: 4px;
  background:    var(--rt-surface-2);
  overflow:      hidden;
}
.rt-progress__bar { height: 100%; border-radius: 4px; transition: width .4s ease; }

.rt-contact-row {
  display:         flex;
  justify-content: space-between;
  align-items:     center;
  padding:         10px 0;
}
.rt-contact-row + .rt-contact-row { border-top: 1px solid var(--rt-border); }


/* ── 14. Cartes Leaflet en mode sombre ────────────────────────── */
/* Les tuiles OpenStreetMap sont claires par nature. On les inverse,
   puis on fait tourner la teinte de 180° pour retrouver des couleurs
   naturelles (eau bleue, végétation verte) sur fond sombre.
   Seul le calque des tuiles est filtré : les marqueurs gardent
   leurs vraies couleurs. */
[data-bs-theme="dark"] .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(.95) contrast(.9);
}

[data-bs-theme="dark"] .leaflet-container {
  background: #1A2028;   /* fond visible pendant le chargement des tuiles */
}

[data-bs-theme="dark"] .leaflet-popup-content-wrapper,
[data-bs-theme="dark"] .leaflet-popup-tip {
  background: var(--rt-surface);
  color:      var(--rt-text);
}

[data-bs-theme="dark"] .leaflet-control-attribution {
  background: rgba(22, 30, 39, .8);
  color:      var(--rt-text-muted);
}

[data-bs-theme="dark"] .leaflet-control-attribution a {
  color: var(--rt-accent);
}

[data-bs-theme="dark"] .leaflet-bar a {
  background-color: var(--rt-surface);
  color:            var(--rt-text);
  border-color:     var(--rt-border-strong);
}


/* ── 15. Page d'accueil ───────────────────────────────────────── */
.rt-home-hero {
  position:   relative;
  overflow:   hidden;
  color:      #fff;
  padding:    104px 0 96px;
  /* Deux halos discrets (ambre en haut à gauche, bleu à droite)
     sur un dégradé nuit : profondeur sans image */
  background:
    radial-gradient(ellipse 60% 55% at 15% 0%,  rgba(232, 160, 32, .16) 0%, transparent 60%),
    radial-gradient(ellipse 55% 60% at 90% 35%, rgba(30, 58, 95, .70) 0%, transparent 60%),
    linear-gradient(180deg, var(--rt-dark) 0%, #13202E 100%);
}

/* Trame de points très légère, estompée vers le bas */
.rt-home-hero::before {
  content:          '';
  position:         absolute;
  inset:            0;
  background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px);
  background-size:  22px 22px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
  mask-image:         linear-gradient(to bottom, #000 0%, transparent 85%);
  pointer-events:   none;
}

.rt-home-hero > .container { position: relative; }   /* au-dessus de la trame */

.rt-eyebrow {
  display:        inline-flex;
  align-items:    center;
  gap:            .45rem;
  padding:        .35rem .9rem;
  border-radius:  999px;
  border:         1px solid rgba(255, 255, 255, .14);
  background:     rgba(255, 255, 255, .05);
  color:          rgba(255, 255, 255, .78);
  font-size:      .8rem;
  font-weight:    600;
  letter-spacing: .02em;
  margin-bottom:  1.5rem;
}

.rt-home-title {
  font-size:      clamp(2.3rem, 5.5vw, 3.8rem);   /* s'adapte à la largeur d'écran */
  font-weight:    800;
  line-height:    1.07;
  letter-spacing: -.03em;
  margin-bottom:  1.25rem;
}

.rt-home-title em {
  font-style: normal;
  color:      var(--rt-speed);
}

.rt-home-lead {
  max-width:     36rem;
  margin:        0 auto 2.25rem;
  font-size:     1.12rem;
  line-height:   1.6;
  color:         rgba(255, 255, 255, .74);
}

.rt-home-actions {
  display:         flex;
  flex-wrap:       wrap;
  justify-content: center;
  gap:             .75rem;
}

.rt-home-actions .btn {
  padding:       .8rem 1.5rem;
  border-radius: 10px;
}

.rt-home-section { padding: 80px 0; }

.rt-section-head {
  max-width:     40rem;
  margin:        0 auto 3rem;
  text-align:    center;
}

.rt-section-head h2 {
  font-size:     clamp(1.6rem, 3vw, 2.1rem);
  font-weight:   800;
  margin-bottom: .75rem;
}

.rt-section-head p {
  color:         var(--rt-text-muted);
  font-size:     1.02rem;
  margin:        0;
}

/* Cartes de fonctionnalités */
.rt-feature {
  height:        100%;
  padding:       28px;
  background:    var(--rt-surface);
  border:        1px solid var(--rt-border);
  border-radius: var(--rt-radius);
  box-shadow:    var(--rt-shadow);
}

.rt-feature__icon {
  width:         48px;
  height:        48px;
  border-radius: 12px;
  display:       grid;
  place-items:   center;
  font-size:     1.35rem;
  background:    var(--rt-accent-soft);
  color:         var(--rt-accent);
  margin-bottom: 1.1rem;
}

.rt-feature__icon--safety {
  background: rgba(231, 76, 60, .12);
  color:      var(--rt-danger);
}

.rt-feature h3 {
  font-size:     1.12rem;
  font-weight:   800;
  margin-bottom: .5rem;
}

.rt-feature p {
  color:       var(--rt-text-muted);
  font-size:   .93rem;
  line-height: 1.6;
  margin:      0;
}

/* Les deux univers : mécanique / musculaire */
.rt-universe {
  height:        100%;
  padding:       32px;
  border-radius: var(--rt-radius);
  color:         #fff;
  position:      relative;
  overflow:      hidden;
}

.rt-universe--meca { background: linear-gradient(135deg, var(--rt-dark) 0%, var(--rt-road) 100%); }
.rt-universe--musc { background: linear-gradient(135deg, var(--rt-forest-1) 0%, var(--rt-forest-2) 100%); }

.rt-universe h3 {
  font-size:     1.35rem;
  font-weight:   800;
  margin-bottom: .5rem;
}

.rt-universe p {
  color:         rgba(255, 255, 255, .75);
  margin-bottom: 1.25rem;
}

.rt-universe__tags {
  display:   flex;
  flex-wrap: wrap;
  gap:       .5rem;
}

/* Grand pictogramme en filigrane, coin bas droit */
.rt-universe__watermark {
  position:       absolute;
  right:          -12px;
  bottom:         -22px;
  font-size:      7.5rem;
  line-height:    1;
  color:          rgba(255, 255, 255, .06);
  pointer-events: none;
}

/* Bandeau d'appel final */
.rt-home-cta {
  padding:       48px 32px;
  border-radius: 16px;
  text-align:    center;
  background:    var(--rt-surface);
  border:        1px solid var(--rt-border);
  box-shadow:    var(--rt-shadow);
}

.rt-home-cta h2 {
  font-size:     clamp(1.4rem, 2.6vw, 1.8rem);
  font-weight:   800;
  margin-bottom: .6rem;
}

.rt-home-cta p {
  color:         var(--rt-text-muted);
  margin-bottom: 1.5rem;
}


/* ── 16. Animations (discrètes) ───────────────────────────────── */
/* Toutes sont neutralisées pour les personnes qui ont activé
   « Réduire les animations » dans leur système (voir fin de section). */

/* Transition entre les pages (API View Transitions).
   Le navigateur fond l'ancienne page dans la nouvelle, sans JavaScript.
   Navigateurs non compatibles : navigation normale, rien ne casse. */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: .18s;
}

/* La barre de navigation reste fixe pendant la transition */
.navbar {
  view-transition-name: rt-navbar;
}

/* Apparition des cartes en cascade.
   « backwards » applique l'état de départ pendant le délai, puis
   rend la main : l'effet de survol (translateY) reste fonctionnel. */
@keyframes rt-rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.rt-card,
.rt-feature,
.rt-universe {
  animation: rt-rise .35s cubic-bezier(.2, .7, .3, 1) backwards;
}

.row > :nth-child(2) > .rt-card, .row > :nth-child(2) > .rt-feature, .row > :nth-child(2) > .rt-universe { animation-delay: .05s; }
.row > :nth-child(3) > .rt-card, .row > :nth-child(3) > .rt-feature { animation-delay: .10s; }
.row > :nth-child(4) > .rt-card { animation-delay: .15s; }
.row > :nth-child(5) > .rt-card { animation-delay: .20s; }
.row > :nth-child(6) > .rt-card { animation-delay: .25s; }
.row > :nth-child(7) > .rt-card { animation-delay: .30s; }
.row > :nth-child(n+8) > .rt-card { animation-delay: .35s; }   /* plafond : pas d'attente au-delà */

.rt-feature {
  transition: transform .2s ease, box-shadow .2s ease;
}
.rt-feature:hover {
  transform:  translateY(-2px);
  box-shadow: var(--rt-shadow-hover);
}

/* Retour tactile au clic */
.btn:active:not(:disabled),
.rt-btn-submit:active,
.rt-filter-submit:active {
  transform: scale(.98);
}

/* Marqueurs GPS « en direct » : une onde se propage autour du point */
.rt-live-dot {
  position:      relative;
  width:         100%;
  height:        100%;
  border-radius: 50%;
  background:    var(--dot);
  border:        3px solid #fff;
  box-shadow:    0 2px 8px rgba(0, 0, 0, .4);
}

.rt-live-dot--me {
  border-width: 4px;
}

.rt-live-dot::after {
  content:       '';
  position:      absolute;
  inset:         -3px;
  border-radius: 50%;
  border:        2px solid var(--dot);
  animation:     rt-pulse 2.2s ease-out infinite;
}

@keyframes rt-pulse {
  from { transform: scale(1);   opacity: .7; }
  to   { transform: scale(2.6); opacity: 0;  }
}

/* Notifications flottantes (messages Django) */
.rt-toasts {
  position:  fixed;
  top:       80px;               /* sous la barre de navigation */
  right:     16px;
  z-index:   1090;
  width:     min(380px, calc(100vw - 32px));
  display:   flex;
  flex-direction: column;
  gap:       10px;
}

.rt-toast {
  background:    var(--rt-surface);
  color:         var(--rt-text);
  border:        1px solid var(--rt-border);
  border-left:   4px solid var(--rt-accent);
  border-radius: 10px;
  box-shadow:    var(--rt-shadow-hover);
  font-size:     .9rem;
}

.rt-toast .toast-body {
  display:     flex;
  align-items: flex-start;
  gap:         .6rem;
  padding:     .8rem .9rem;
}

.rt-toast .toast-body > i { font-size: 1.1rem; line-height: 1.3; }
.rt-toast .btn-close     { margin-left: auto; flex-shrink: 0; }

.rt-toast--success { border-left-color: #2E9E5B; }
.rt-toast--success .toast-body > i { color: #2E9E5B; }
.rt-toast--danger  { border-left-color: var(--rt-danger); }
.rt-toast--danger  .toast-body > i { color: var(--rt-danger); }
.rt-toast--warning { border-left-color: var(--rt-speed); }
.rt-toast--warning .toast-body > i { color: var(--rt-speed); }
.rt-toast--info .toast-body > i    { color: var(--rt-accent); }

/* Bootstrap fait apparaître les toasts en fondu ; on ajoute un léger glissement */
.rt-toast.showing,
.rt-toast.show {
  animation: rt-slide-in .25s cubic-bezier(.2, .7, .3, 1);
}

@keyframes rt-slide-in {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: none; }
}

/* Fondu des couleurs pendant un changement de thème uniquement.
   La classe est posée par theme.js pendant 300 ms : en temps normal,
   aucune transition de couleur ne ralentit l'affichage. */
.rt-theme-switching,
.rt-theme-switching *,
.rt-theme-switching *::before,
.rt-theme-switching *::after {
  transition: background-color .25s ease, color .25s ease,
              border-color .25s ease, fill .25s ease !important;
}

/* Accessibilité : certaines personnes ont des vertiges ou des nausées
   avec les mouvements à l'écran. On respecte leur réglage système. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration:        .01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay:           0s !important;
    transition-duration:       .01ms !important;
    scroll-behavior:           auto !important;
  }

  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   17. PROFIL : activités, langues
   ═══════════════════════════════════════════════════════════════ */

/* La règle générique .rt-form-section select efface la flèche
   des selects Bootstrap (raccourci background). On la remet. */
.rt-form-section select.form-select {
  background-image:    var(--bs-form-select-bg-img), var(--bs-form-select-bg-icon, none);
  background-repeat:   no-repeat;
  background-position: right .75rem center;
  background-size:     16px 12px;
  padding-right:       2.25rem;
}

.rt-activity-grid {
  display:        flex;
  flex-direction: column;
  gap:            8px;
}

.rt-activity-row {
  display:               grid;
  grid-template-columns: 1fr 180px 110px;
  align-items:           center;
  gap:                   10px;
  padding:               8px 12px;
  border:                1px solid var(--rt-border);
  border-radius:         10px;
  background:            var(--rt-surface-2);
}

.rt-activity-row__label { font-weight: 600; font-size: .9rem; }
.rt-activity-row__error { grid-column: 1 / -1; }
.rt-activity-row--error { border-color: var(--bs-danger); }

/* Mobile : libellé sur sa ligne, niveau et année côte à côte */
@media (max-width: 575.98px) {
  .rt-activity-row { grid-template-columns: 1fr 100px; }
  .rt-activity-row__label { grid-column: 1 / -1; }
}


/* ── Garage ── */
.rt-vehicle-row {
  color:           inherit;
  text-decoration: none;
  border-radius:   8px;
  transition:      background .15s;
}
.rt-vehicle-row:hover { background: var(--rt-surface-2); color: inherit; }

.rt-vehicle-thumb {
  width:         40px;
  height:        40px;
  border-radius: 8px;
  object-fit:    cover;
  flex-shrink:   0;
}
.rt-vehicle-thumb--empty {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  background:      var(--rt-surface-2);
  font-size:       1.2rem;
}
.rt-vehicle-thumb--lg { width: 96px; height: 72px; }


/* ── Fiche membre ── */
.rt-member-stats {
  display:               grid;
  grid-template-columns: repeat(3, 1fr);
  gap:                   8px;
  margin-top:            20px;
  padding-top:           16px;
  border-top:            1px solid var(--rt-border);
}
.rt-member-stats__value {
  font-family: var(--rt-font-display);
  font-size:   1.35rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.rt-member-stats__label { font-size: .75rem; color: var(--rt-text-muted); }

/* Niveau : 4 pastilles, allumées selon le niveau (Débutant = 1 … Expert = 4) */
.rt-level { display: inline-flex; gap: 3px; }
.rt-level__dot {
  width:         8px;
  height:        8px;
  border-radius: 50%;
  background:    var(--rt-border-strong);
}
.rt-level__dot.is-on { background: var(--rt-accent); }

.rt-garage-card {
  border:        1px solid var(--rt-border);
  border-radius: 10px;
  overflow:      hidden;
  background:    var(--rt-surface);
  height:        100%;
}
.rt-garage-card__img {
  width:        100%;
  aspect-ratio: 4 / 3;
  object-fit:   cover;
  display:      block;
}
.rt-garage-card__img--empty {
  display:         flex;
  align-items:     center;
  justify-content: center;
  font-size:       2.2rem;
  background:      var(--rt-surface-2);
}
.rt-garage-card__body { padding: 8px 10px; }


/* ═══════════════════════════════════════════════════════════════
   18. PILOTAGE (tableau de bord staff)
   ═══════════════════════════════════════════════════════════════ */

/* Couleurs des variations : texte lisible (contraste ≥ 4,5:1) dans les
   deux thèmes. La flèche et le signe portent le sens, la couleur renforce. */
:root {
  --rt-delta-good: #006C10;
  --rt-delta-bad:  #C0392B;
}
[data-bs-theme="dark"] {
  --rt-delta-good: #53C556;
  --rt-delta-bad:  #FF8F87;
}

.rt-pilotage__head {
  display:         flex;
  flex-wrap:       wrap;
  justify-content: space-between;
  align-items:     flex-end;
  gap:             16px;
  margin-bottom:   28px;
}
.rt-pilotage__kicker {
  font-size:      .72rem;
  font-weight:    700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color:          var(--rt-text-muted);
}

.rt-pilotage__section { margin-bottom: 40px; }
.rt-pilotage__title {
  font-family:   var(--rt-font-display);
  font-size:     1.1rem;
  font-weight:   800;
  display:       flex;
  align-items:   center;
  gap:           8px;
  margin-bottom: 14px;
}
.rt-pilotage__title i { color: var(--rt-accent); }

/* Sélecteur de période (contrôle segmenté) */
.rt-segmented {
  display:       inline-flex;
  padding:       3px;
  gap:           2px;
  border-radius: 10px;
  background:    var(--rt-surface-2);
  border:        1px solid var(--rt-border);
}
.rt-segmented__item {
  padding:         6px 12px;
  border-radius:   7px;
  font-size:       .82rem;
  font-weight:     600;
  color:           var(--rt-text-muted);
  text-decoration: none;
  white-space:     nowrap;
  transition:      background .15s, color .15s;
}
.rt-segmented__item:hover { color: var(--rt-text); background: var(--rt-surface); }
.rt-segmented__item.is-active {
  background: var(--rt-surface);
  color:      var(--rt-text);
  box-shadow: var(--rt-shadow);
}
.rt-segmented__item:focus-visible { outline: 3px solid var(--rt-focus-ring); outline-offset: 1px; }

/* Chiffres clés */
.rt-tile {
  height:        100%;
  padding:       16px 18px;
  border-radius: var(--rt-radius);
  background:    var(--rt-surface);
  border:        1px solid var(--rt-border);
  box-shadow:    var(--rt-shadow);
}
.rt-tile__label { font-size: .8rem; color: var(--rt-text-muted); margin-bottom: 4px; }
.rt-tile__value {
  font-family:   var(--rt-font-display);
  font-size:     1.75rem;
  font-weight:   800;
  line-height:   1.1;
  color:         var(--rt-text);
}
.rt-tile__hint { font-size: .74rem; color: var(--rt-text-muted); margin-top: 6px; }

.rt-delta { font-size: .78rem; font-weight: 700; margin-top: 6px; }
.rt-delta span { font-weight: 400; color: var(--rt-text-muted); }
.rt-delta--good { color: var(--rt-delta-good); }
.rt-delta--bad  { color: var(--rt-delta-bad); }
.rt-delta--flat { color: var(--rt-text-muted); }

/* Cartes de graphique */
.rt-chart {
  height:        100%;
  margin:        0;
  padding:       16px 18px;
  border-radius: var(--rt-radius);
  background:    var(--rt-surface);
  border:        1px solid var(--rt-border);
  box-shadow:    var(--rt-shadow);
}
.rt-chart__title {
  font-weight:   700;
  font-size:     .92rem;
  margin-bottom: 10px;
  color:         var(--rt-text);
}
.rt-chart__sub { font-weight: 400; font-size: .78rem; color: var(--rt-text-muted); margin-left: 6px; }
.rt-chart__canvas { position: relative; height: 260px; }

.rt-chart__data { margin-top: 8px; font-size: .8rem; }
.rt-chart__data summary {
  cursor:     pointer;
  color:      var(--rt-text-muted);
  width:      fit-content;
}
.rt-chart__data summary:hover { color: var(--rt-text); }
.rt-chart__data[open] { max-height: 320px; overflow-y: auto; }

/* Tableaux : sobres, chiffres alignés */
.rt-table { --bs-table-bg: transparent; font-size: .84rem; }
.rt-table th {
  font-size:      .72rem;
  font-weight:    700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color:          var(--rt-text-muted);
  border-bottom-color: var(--rt-border-strong);
}
.rt-table td { border-bottom-color: var(--rt-border); }
.rt-table td.text-end { font-variant-numeric: tabular-nums; }


/* ═══════════════════════════════════════════════════════════════
   19. NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════ */

.rt-bell { position: relative; }
.rt-bell__badge {
  position:      absolute;
  top:           2px;
  right:         0;
  min-width:     18px;
  height:        18px;
  padding:       0 5px;
  border-radius: 9px;
  font-size:     .68rem;
  font-weight:   700;
  line-height:   18px;
  text-align:    center;
  color:         #fff;
  background:    var(--bs-danger);
}

/* Une notification = un bouton pleine largeur (formulaire POST) */
.rt-notif {
  display:     flex;
  gap:         12px;
  width:       100%;
  padding:     14px 18px;
  border:      0;
  border-bottom: 1px solid var(--rt-border);
  background:  transparent;
  color:       inherit;
  text-align:  left;
  transition:  background .15s;
}
.rt-notif:hover { background: var(--rt-surface-2); }
.rt-notif--unread { background: color-mix(in srgb, var(--rt-accent) 8%, transparent); }
.rt-notif--unread .rt-notif__title { font-weight: 700; }
.rt-notif__icon { font-size: 1.2rem; color: var(--rt-accent); flex-shrink: 0; margin-top: 2px; }
.rt-notif__text { display: flex; flex-direction: column; gap: 2px; }
.rt-notif__title { font-size: .92rem; }
.rt-notif__body  { font-size: .84rem; color: var(--rt-text-muted); }
.rt-notif__time  { font-size: .74rem; color: var(--rt-text-muted); }