/* ═══ v3 — rail large par module + lanceur, calé sur la maquette
   « CRM Maint Up - version PC.html » (31/08/2026).
   Valeurs relevées AU PIXEL sur les atlas de mesures (01/09/2026). ═══ */

/* Encre grise « moyenne » mesurée sur la maquette : rgb(100,104,110).
   Entre --v2-text-2 (#55595f) et --v2-text-3 (#6b6f76) actuels — on la
   porte ici pour rester au pixel, avec une déclinaison sombre lisible. */
:root { --v3-ink-2: #64686e; }
[data-app-theme="dark"] { --v3-ink-2: #9ca1a9; }

.v3-rail {
  position: sticky; top: 0; z-index: 6;
  width: 228px; min-width: 228px; height: 100vh;
  overflow-y: auto; overflow-x: hidden;
  padding: 14px 12px;
  background: var(--rail-bg, #1b1d21);
  display: flex; flex-direction: column; gap: 2px;
}
.v3-rail::-webkit-scrollbar { width: 0; }

.v3-retour {
  display: flex; align-items: center; gap: 9px;
  height: 34px; padding: 0 10px; margin-bottom: 14px;
  border: 0; background: none; border-radius: var(--r-sm, 12px); cursor: pointer;
  font-size: 12.5px; font-weight: 550; color: rgba(255, 255, 255, .5);
  text-align: left;
}
.v3-retour svg { width: 15px; height: 15px; }
.v3-retour:hover { color: #fff; background: rgba(255, 255, 255, .08); }

.v3-mod {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 0 10px; margin-bottom: 14px;
}
.v3-mod-ico {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--r-sm, 12px);
  /* Le rail est sombre dans les deux thèmes : l'ambre .16 mesuré sur la
     maquette, pas le jeton clair (--accent-soft = .26). */
  background: rgba(245, 213, 71, .16); color: var(--accent-bright, #f5d547);
}
.v3-mod-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.v3-mod-txt b { font-size: 15px; font-weight: 640; line-height: 1.2; color: #fff; letter-spacing: -.01em; }
.v3-mod-txt small { font-size: 11px; line-height: 1.35; color: rgba(255, 255, 255, .55); }

.v3-nav { display: flex; flex-direction: column; gap: 2px; }
.v3-lien {
  display: flex; align-items: center; gap: 11px;
  height: 38px; padding: 0 12px;
  border: 0; background: none; border-radius: var(--r-sm, 12px); cursor: pointer;
  color: rgba(255, 255, 255, .62); text-align: left;
}
.v3-lien:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.v3-lien.actif { color: #fff; background: rgba(255, 255, 255, .14); }
.v3-lien-ico { flex: none; display: inline-flex; opacity: .9; }
.v3-lien-txt {
  flex: 1; font-size: 13.5px; font-weight: 550;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.v3-lien.actif .v3-lien-txt { font-weight: 620; }
.v3-lien-nb {
  font-size: 10px; font-weight: 680; padding: 1px 7px; border-radius: 99px;
  background: rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .82);
}
.v3-lien-nb[hidden] { display: none; }

.v3-ressort { flex: 1 1 auto; min-height: 18px; }
.v3-aller {
  border-top: 1px solid rgba(255, 255, 255, .1);
  margin-top: 14px;
  padding: 0 12px 6px;
  font-size: 10px; font-weight: 640; line-height: 1.2; letter-spacing: 1px;
  color: rgba(255, 255, 255, .5);
}
.v3-nav-autres .v3-lien { height: 32px; gap: 10px; color: rgba(255, 255, 255, .55); }
.v3-nav-autres .v3-lien:hover { color: #fff; }
.v3-nav-autres .v3-lien-ico svg { width: 15px; height: 15px; }
.v3-nav-autres .v3-lien-txt { font-size: 12.5px; font-weight: 400; }

.v3-compte {
  display: flex; align-items: center; gap: 10px;
  margin-top: 14px; padding: 9px 10px;
  border: 0; background: rgba(255, 255, 255, .055);
  border-radius: var(--r-md, 18px); cursor: pointer; text-align: left;
}
.v3-compte:hover { background: rgba(255, 255, 255, .09); }
.v3-compte-av {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #6c5ce7; color: #fff; font-size: 11px; font-weight: 640;
}
.v3-compte-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.v3-compte-txt b { font-size: 12.5px; font-weight: 620; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v3-compte-txt small { font-size: 10.5px; color: rgba(255, 255, 255, .42); }

/* ── Le lanceur : rail et en-tête effacés, l'écran porte sa barre ── */
body.v3-sur-lanceur .v3-rail { display: none; }
body.v3-sur-lanceur main .header { display: none; }
body.v3-sur-lanceur main .filters { display: none; }
/* La barre du lanceur court d'un bord à l'autre, comme sur la maquette. */
body.v3-sur-lanceur #kanban-container { padding: 0; }

.v3-lanceur { min-width: 0; padding: 0 0 60px; }
.v3-l-barre {
  /* La maquette cale tout le monde sur la ligne du bas (logo, salut et
     groupe de droite finissent à y≈62), pas sur le centre. */
  display: flex; align-items: flex-end; gap: 16px;
  min-height: 77px; padding: 16px 30px 14px;
  background: var(--panel-2, rgba(255, 255, 255, .42));
}
/* Le sigle de la maquette vit dans une case de 46 px : mêmes retraits. */
.v3-l-logo { width: 34px; height: 43px; margin: 0 6px; object-fit: contain; }
.v3-l-salut { display: flex; flex-direction: column; gap: 3px; margin-right: auto; }
.v3-l-date {
  font-size: 11px; font-weight: 620; line-height: 1.2; letter-spacing: .08em;
  text-transform: uppercase; color: var(--v2-text-3, var(--v2-text-3, #6b6f76));
}
.v3-l-bonjour { font-size: 24px; font-weight: 680; line-height: 1.1; letter-spacing: -.02em; color: var(--v2-text, var(--v2-text, #16171a)); }
/* Recherche, thème et avatar se serrent à 8 px (groupe de droite). */
.v3-l-droite { display: inline-flex; align-items: center; gap: 8px; }
.v3-l-cherche {
  display: inline-flex; align-items: center; gap: 8px;
  height: 33px; padding: 0 13px; width: 216px;
  border: 1px solid var(--stroke, rgba(20, 20, 25, .075)); border-radius: 99px;
  background: var(--panel, rgba(255, 255, 255, .66)); color: var(--v2-text-3, var(--v2-text-3, #6b6f76));
  font-size: 12.5px; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}
.v3-l-cherche kbd {
  margin-left: auto; font-size: 11px; line-height: 13px; font-family: inherit;
  padding: 0 5px; border: 1px solid var(--stroke, rgba(20, 20, 25, .075));
  border-radius: var(--r-xs, 9px); color: var(--v2-text-3, var(--v2-text-3, #6b6f76));
}
/* La bascule de thème garde son display:grid (deux icônes empilées
   qui se fondent, styles.css) — on ne restyle que la coquille. */
.v3-l-theme .theme-btn {
  width: 38px; height: 38px; border-radius: 99px;
  background: var(--panel, rgba(255, 255, 255, .66));
  border: 1px solid var(--stroke, rgba(20, 20, 25, .075));
  color: var(--v3-ink-2, #64686e);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}
.v3-l-theme .theme-btn svg { width: 16px; height: 16px; }
.v3-l-avatar {
  width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: #6c5ce7; color: #fff; font-size: 13px; font-weight: 680;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

/* Seule déclaration des tuiles du lanceur (défaut 10 bis, 02/09/2026).
   Les valeurs sont celles qui gagnaient déjà la cascade : rien ne bouge
   à l'écran en thème clair. En sombre, si : --shadow-sm et
   --accent-soft changent de valeur là où les littéraux, eux, restaient
   au clair. */
/* Le lanceur suit l'écran (Joris, 08/09/2026 : « sur mon 27 pouces ça ne
   s'adapte pas ») : la grille, les tuiles, le pictogramme et le titre
   grandissent avec la fenêtre, entre la maquette (682 px à 1 180) et un
   plafond raisonnable sur un grand écran. */
.v3-tuiles {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(22px, 1.4vw, 32px); max-width: clamp(660px, 40vw, 880px); margin: clamp(40px, 5vh, 80px) auto 0;
}
.v3-tuile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(16px, 1.2vw, 24px);
  aspect-ratio: 1 / 1; height: auto; min-height: 190px; padding: 20px;
  background: var(--panel-solid, #fff); border: 1px solid var(--stroke);
  border-radius: var(--r-lg, 26px); box-shadow: none;
  cursor: pointer; text-align: center;
  /* Montée 140 ms, descente 260 ms ease-in : l'asymétrie fait lire une
     lumière, pas un état qui bascule (spec Claude Design, 08/09/2026). */
  transition: transform .26s ease-in, box-shadow .26s ease-in, border-color .26s ease-in;
}
/* Joris (08/09, 16 h 30) : « le contour des modules n'est plus rétro-éclairé »
   — le liseré ambre de la tuile revient au survol, avec son anneau doux ;
   ses mots priment sur la spec (qui ne gardait que le halo du picto). */
.v3-tuile:hover {
  transform: translateY(-2px);
  border-color: var(--accent-bright, #f5d547);
  box-shadow: 0 0 0 4px var(--accent-soft, rgba(245, 213, 71, .26)), var(--shadow, 0 8px 24px -14px rgba(20, 20, 25, .28));
  transition: transform .14s cubic-bezier(.2, .8, .3, 1), box-shadow .14s cubic-bezier(.2, .8, .3, 1), border-color .14s cubic-bezier(.2, .8, .3, 1);
}
.v3-tuile:active { transform: translateY(0); transition-duration: .09s; }
.v3-tuile:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--v2-accent, #7d640d); }
.v3-tuile-ico .btn-icon,
.v3-pilule .btn-icon { opacity: 1; }
.v3-tuile-ico .btn-icon { width: clamp(26px, 1.6vw, 32px); height: clamp(26px, 1.6vw, 32px); }
/* Le pictogramme « rétro-éclairé » au survol seulement (Joris, 08/09 :
   « quand je mets ma souris dessus, pas tout le temps »). Spec Claude
   Design : au repos rien d'allumé ; au survol la case passe à un ambre
   plus franc (34 % d'--accent-bright) et une lueur serrée apparaît
   autour d'elle (0 0 26px -2px à 62 %) — une source lumineuse a un
   bord ; le liseré de tuile est parti, deux marqueurs pour un geste
   c'est un de trop. Au départ tout revient, aucune trace. */
.v3-tuile-ico {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: clamp(56px, 3.2vw, 70px); height: clamp(56px, 3.2vw, 70px); border-radius: var(--r-md, 18px);
  background: var(--accent-soft, rgba(245, 213, 71, .26));
  color: var(--v2-accent, #7d640d);
  transition: box-shadow .26s ease-in, background .26s ease-in;
}
.v3-tuile:hover .v3-tuile-ico, .v3-tuile:focus-visible .v3-tuile-ico {
  background: color-mix(in srgb, var(--accent-bright, #f5d547) 34%, var(--panel-solid, #fff));
  box-shadow: 0 0 26px -2px color-mix(in srgb, var(--accent-bright, #f5d547) 62%, transparent);
  transition: box-shadow .14s cubic-bezier(.2, .8, .3, 1), background .14s cubic-bezier(.2, .8, .3, 1);
}
.v3-tuile:active .v3-tuile-ico {
  box-shadow: 0 0 26px -2px color-mix(in srgb, var(--accent-bright, #f5d547) 37%, transparent);
  transition-duration: .09s;
}
/* .btn-icon (styles.css) fige les svg à 15 px : le pictogramme de tuile
   fait 28 px sur la maquette, et grandit avec l'écran. */
.v3-tuile-ico svg { width: clamp(26px, 1.6vw, 32px); height: clamp(26px, 1.6vw, 32px); }
.v3-tuile-t { font-size: clamp(16px, 1vw, 19px); font-weight: 640; letter-spacing: -.02em; color: var(--v2-text, var(--v2-text, #16171a)); }
.v3-tuile-s { font-size: 12px; line-height: 1.5; color: var(--v2-text-3, var(--v2-text-3, #6b6f76)); }

.v3-pilules { display: flex; justify-content: center; margin-top: clamp(34px, 3vh, 56px); }
.v3-pilule {
  display: inline-flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 16px;
  border: 1px solid var(--stroke, rgba(20, 20, 25, .075)); border-radius: 99px;
  background: none; color: var(--v3-ink-2, #64686e);
  font-size: 13.5px; font-weight: 620; cursor: pointer;
}
.v3-pilule:hover { color: var(--v2-text, var(--v2-text, #16171a)); border-color: var(--accent-bright); }

/* ── La page-porte Matériel : deux grandes cartes teintées ─────────
   Relevé maquette 18-porte : grille 2 colonnes gap 14, cartes radius 26,
   padding 28/30/30, crème #fdfcf6 (caisses) et lavande #f4f2fb (parc).
   Surfaces fixes comme le rail : mêmes encres dans les deux thèmes. */
.v3-porte { min-width: 0; padding: 30px 0 0; }
.v3-pcartes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.v3-pcarte {
  display: flex; flex-direction: column; align-items: flex-start; gap: 16px;
  padding: 28px 30px 30px;
  border: 1px solid rgba(20, 20, 25, .075); border-radius: var(--r-lg, 26px);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .03), 0 10px 30px -24px rgba(20, 20, 25, .18);
  cursor: pointer; text-align: left;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.v3-pcarte:hover { transform: translateY(-2px); border-color: var(--accent-bright, #f5d547); }
.v3-pcarte--caisses { background: #fdfcf6; }
.v3-pcarte--voitures { background: #f4f2fb; }
.v3-pcarte--caisses .v3-pcarte-ico,
.v3-pcarte--caisses .v3-pcarte-kicker { color: #8d7526; }
.v3-pcarte--voitures .v3-pcarte-ico,
.v3-pcarte--voitures .v3-pcarte-kicker { color: #6f5fb0; }
.v3-pcarte-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--r-sm, 12px); background: #fff;
}
.v3-pcarte-ico svg { width: 22px; height: 22px; }
.v3-pcarte-tete { display: flex; flex-direction: column; gap: 5px; }
.v3-pcarte-kicker {
  font-size: 9.5px; font-weight: 680; letter-spacing: .08em;
  text-transform: uppercase;
}
.v3-pcarte-t {
  font-family: var(--font-display); font-size: 25px; font-weight: 680;
  letter-spacing: -.02em; line-height: 1.12; color: #16171a;
}
.v3-pcarte-stat { display: flex; align-items: baseline; gap: 9px; }
.v3-pcarte-stat b {
  font-family: var(--font-display); font-size: 40px; font-weight: 680;
  line-height: 1; color: #16171a;
}
.v3-pcarte-stat span { font-size: 13px; color: #6b6f76; }
.v3-pcarte-desc { max-width: 344px; font-size: 13px; line-height: 1.54; color: #64686e; }
.v3-pcarte-lien {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 2px;
  font-size: 12.5px; font-weight: 620; color: #16171a;
}

/* ── La barre d'en-tête de page, relevée sur la maquette : fond
   --panel-2 (blanc .42), padding 16/30/14, sur-titre 11/620 collé
   à 3 px du titre 24/680. Prime sur v2-coque.css (chargé avant). ── */
body.v2-coque.v3-rail-large main .header {
  padding: 16px 30px 14px;
  gap: 3px 16px;
  background: var(--panel-2, rgba(255, 255, 255, .42));
}
body.v2-coque.v3-rail-large main .header #page-subtitle { font-weight: 620; line-height: 1.2; }
body.v2-coque.v3-rail-large main .header #page-title { font-size: 24px; line-height: 1.1; }
/* La bascule de thème de l'en-tête, aux mesures de la maquette :
   38 px, ronde, verre .66, encre grise moyenne, icône 16. */
body.v2-coque.v3-rail-large main .header #theme-btn {
  /* Remonté sur les deux lignes de texte (sur-titre + titre) sans
     gonfler la rangée : l'en-tête reste à 73 px comme sur la maquette. */
  margin: -12px 0 0;
  width: 38px; height: 38px; border-radius: 99px;
  background: var(--panel, rgba(255, 255, 255, .66));
  border: 1px solid var(--stroke, rgba(20, 20, 25, .075));
  color: var(--v3-ink-2, #64686e);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}
body.v2-coque.v3-rail-large main .header #theme-btn svg { width: 16px; height: 16px; }

@media (max-width: 1100px) {
  .v3-tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

body.v2-coque.v3-rail-large .app { grid-template-columns: 228px 1fr; }
body.v3-sur-lanceur .app { grid-template-columns: 1fr !important; }


/* ── Le fondu de la page de garde ──────────────────────────────
   Mesuré sur la maquette : deux halos radiaux posés sur la page —
   ambre en haut à gauche, bleuté en haut à droite. Ils ne vivent QUE
   sur le lanceur : la nappe ambrée reste éteinte sur les écrans de
   travail (décision du 11/08/2026, « j'en peux plus de l'ambré »). */
body.v3-sur-lanceur .v2-lueurs {
  display: block;
  background:
    radial-gradient(900px 560px at 12% -8%, rgba(245, 213, 71, .22), rgba(0, 0, 0, 0) 70%),
    radial-gradient(760px 520px at 92% 4%, rgba(120, 150, 190, .16), rgba(0, 0, 0, 0) 72%);
}
[data-app-theme="dark"] body.v3-sur-lanceur .v2-lueurs {
  background:
    radial-gradient(900px 560px at 12% -8%, rgba(245, 213, 71, .10), rgba(0, 0, 0, 0) 70%),
    radial-gradient(760px 520px at 92% 4%, rgba(120, 150, 190, .08), rgba(0, 0, 0, 0) 72%);
}
/* La barre du lanceur passe au-dessus des halos, jamais dessous. */
body.v3-sur-lanceur .v3-lanceur { position: relative; z-index: 1; }
