/* 18 · SYSTÈME BDRD (08/10/2026) — design system « Cl_DESIGN_SYSTEM_FINAL_V2_MACOS_KRAKEN » de Lucas.
   Chargé EN DERNIER, à toutes les largeurs : c'est la seule source des couleurs et des familles de composants.
   Principe : surfaces neutres (noir, graphite, blanc cassé) d'abord ; le VIOLET signale ce qui est actif, choisi, principal
   ou en cours (bouton principal, navigation active, focus, sélection, progression, liens importants, logo).
   Jamais : violet partout, bordures violettes, lueurs, dégradés, violet pour une erreur ou une suppression.
   Pour revenir aux couleurs d'avant : retirer la ligne de ce fichier dans index.html. */

/* ------------------------------------------------------------------ Jetons */
:root,:root[data-theme="light"]{
  --violet:#6246EA;--violet-vif:#7657FF;--violet-profond:#5038C8;
  --logo-couleur:#7132F5;

  --background:#FAFAFB;
  --background-secondary:#F3F3F6;
  --background-tertiary:#EDEDF1;
  --surface:#FFFFFF;
  --surface-hover:#F1F1F5;
  --surface-active:#E9E9EF;
  --overlay:rgba(16,16,24,.38);

  --text-primary:#18181B;
  --text-secondary:#55555F;
  --text-tertiary:#83838D;
  --text-muted:#A6A6AF;
  --text-on-accent:#FFFFFF;

  --border-subtle:#E6E6EC;
  --border-default:#D5D5DD;

  --accent:#6246EA;
  --accent-hover:#5038C8;
  --accent-soft:rgba(98,70,234,.10);
  --accent-texte:#5B3FE0;
  --accent-anneau:rgba(98,70,234,.28);

  --succes:#1F9D55;--succes-soft:rgba(31,157,85,.12);
  --alerte:#B7791F;--alerte-soft:rgba(183,121,31,.12);
  --danger:#D03B3B;--danger-soft:rgba(208,59,59,.10);--danger-solid:#D03B3B;

  --cd-control:#EEEEF2;--cd-control-hover:#E4E4EA;--cd-field:#FFFFFF;--cd-raised:#FFFFFF;
  --cd-panel-border:#E6E6EC;--cd-inset:#F3F3F6;--cd-text-list:#3A3A42;--cd-canvas:#FFFFFF;--cd-field-border:#D5D5DD;
  --cd-danger-solid:#D03B3B;

  --r-petit:7px;--r-ctrl:9px;--r-carte:12px;--r-dialogue:16px;
  --shadow-sm:0 1px 2px rgba(16,16,24,.06);
  --shadow-md:0 8px 24px rgba(16,16,24,.10);
  --shadow-lg:0 18px 48px -10px rgba(16,16,24,.22);
}
:root[data-theme="dark"]{
  color-scheme:dark;
  --background:#0F0F12;
  --background-secondary:#0B0B0D;
  --background-tertiary:#1D1D24;
  --surface:#131318;
  --surface-hover:#1D1D24;
  --surface-active:#25252D;
  --overlay:rgba(0,0,0,.62);

  --text-primary:#F5F5F7;
  --text-secondary:#A7A7B0;
  --text-tertiary:#777781;
  --text-muted:#56565F;
  --text-on-accent:#FFFFFF;

  --border-subtle:#22222A;
  --border-default:#34343D;

  --accent:#7657FF;
  --accent-hover:#8468FF;
  --accent-soft:rgba(118,87,255,.16);
  --accent-texte:#A898FF;
  --accent-anneau:rgba(118,87,255,.42);

  --succes:#4CC38A;--succes-soft:rgba(76,195,138,.14);
  --alerte:#E5A33B;--alerte-soft:rgba(229,163,59,.14);
  --danger:#F07A7A;--danger-soft:rgba(208,59,59,.16);--danger-solid:#D03B3B;

  --cd-control:#1D1D24;--cd-control-hover:#26262E;--cd-field:#16161B;--cd-raised:#19191F;
  --cd-panel-border:#27272F;--cd-inset:#09090B;--cd-text-list:#C9C9D1;--cd-canvas:#131318;--cd-field-border:#34343D;
  --cd-danger-solid:#D03B3B;

  --shadow-sm:0 1px 2px rgba(0,0,0,.4);
  --shadow-md:0 8px 24px rgba(0,0,0,.45);
  --shadow-lg:0 18px 48px -10px rgba(0,0,0,.65);
}
body{background:var(--background);color:var(--text-primary);}
::selection{background:var(--accent-soft);color:inherit;}
:root[data-theme="dark"] ::selection{background:rgba(118,87,255,.38);}
input[type="checkbox"],input[type="radio"],input[type="range"],progress{accent-color:var(--accent);}

/* --------------------------------------------------------------- Focus */
:where(button,a,input,select,textarea,[tabindex]):focus-visible{outline:2px solid var(--accent-anneau) !important;outline-offset:1px;}
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),select,textarea):focus,
:where(input:not([type="checkbox"]):not([type="radio"]),select,textarea):focus-visible{border-color:var(--accent) !important;box-shadow:0 0 0 3px var(--accent-soft) !important;outline:none !important;}
#prompt-input:focus{border-color:var(--accent) !important;box-shadow:0 0 0 3px var(--accent-soft) !important;}
@media (max-width:767px){.liens-ligne .liens-url:focus{border-color:var(--accent) !important;box-shadow:0 0 0 3px var(--accent-soft) !important;}}

/* ---------------------------------------------------------------- Boutons
   Principal = violet (un par zone) · secondaire = gris neutre · tertiaire = texte · destructeur = rouge */
button.primary,a.primary,.app button.primary,
:root[data-theme="dark"] button.primary,:root[data-theme="dark"] a.primary,
:root[data-theme="light"] button.primary,:root[data-theme="light"] a.primary{
  background:var(--accent) !important;color:var(--text-on-accent) !important;border:none !important;box-shadow:none !important;
  border-radius:var(--r-ctrl);font-weight:500;}
button.primary:hover:not(:disabled),a.primary:hover,
:root[data-theme="dark"] button.primary:hover:not(:disabled),:root[data-theme="light"] button.primary:hover:not(:disabled){background:var(--accent-hover) !important;}
button.primary:active:not(:disabled){filter:brightness(.94);}
button.primary:disabled,:root[data-theme="dark"] button.primary:disabled,:root[data-theme="light"] button.primary:disabled{
  background:var(--cd-control) !important;color:var(--text-tertiary) !important;opacity:1 !important;cursor:not-allowed;}
button.ghost,a.ghost{border-radius:var(--r-ctrl);}
button.danger,.btn-danger,button.primary.danger,button.destructif{background:var(--danger-solid) !important;color:#fff !important;}
a:not([class]),.lien,.st-lien{color:var(--accent-texte);}

/* ------------------------------------------------- Navigation et sélection
   Un seul traitement actif partout : fond neutre surélevé + icône violette (barre latérale, réglages, menus) ;
   contrôles segmentés et filtres : segment actif neutre, son compteur en violet. */
.st-nav button.active,.st-layout .st-nav button.active{background:var(--surface-active) !important;color:var(--text-primary) !important;}
.st-nav button.active svg{color:var(--accent-texte) !important;stroke:currentColor;}
nav.tabs button.active,nav.tabs button.active svg{color:var(--accent-texte) !important;}
.segmented button.active,
:root[data-theme="dark"] .segmented button.active{background:var(--surface-active) !important;color:var(--text-primary) !important;box-shadow:none !important;}
@media (max-width:767px){.vt-filtre.active,
:root[data-theme="dark"] .vt-filtre.active{background:var(--surface-active) !important;color:var(--text-primary) !important;box-shadow:none !important;}}
:root[data-theme="light"] .segmented button.active{background:var(--surface) !important;box-shadow:var(--shadow-sm) !important;}
@media (max-width:767px){:root[data-theme="light"] .vt-filtre.active{background:var(--surface) !important;box-shadow:var(--shadow-sm) !important;}}
.segmented button.active .cpt,#fiches-filtre .active .cpt{color:var(--accent-texte) !important;opacity:1 !important;}
@media (max-width:767px){.vt-filtre.active .cpt{color:var(--accent-texte) !important;opacity:1 !important;}}
.menu-contexte.pc .mc-item:hover .mc-ic{color:var(--accent-texte);}
@media (max-width:767px){.sel-item.actif .mc-ic,.sel-item[aria-selected="true"]{color:var(--accent-texte);}}

/* interrupteurs : allumé = violet */
.switch input:checked + .track,:root[data-theme="light"] .switch input:checked + .track,:root[data-theme="dark"] .switch input:checked + .track{background:var(--accent) !important;}
.conso-interrupteur[aria-checked="true"],.conso-interrupteur.on{background:var(--accent) !important;}

/* contrôles de choix (radio en ligne) : segment choisi neutre, comme les segmentés */
:root[data-theme="dark"] .st-row-ctl .vt-radio-row label:has(input:checked){background:var(--surface-active);}

/* ---------------------------------------------------------- Progression
   Ce qui est EN COURS est violet (barres, anneaux, point animé) ; succès vert, alerte ambre, échec rouge. */
.vt-lien-spinner,.spinner,.loader{border-top-color:var(--accent) !important;}
progress::-webkit-progress-value{background:var(--accent);}
.cl-etat--cours::before{background:var(--accent) !important;}
.cl-etat--cours{color:var(--text-primary);}
.cl-etat--fait::before{background:var(--succes) !important;}
.cl-etat--echec,.cl-etat--echec::before{color:var(--danger);}
.cl-etat--echec::before{background:var(--danger) !important;}

/* ---------------------------------------------------------------- Logo
   Le logo garde le violet exact de la marque. */
.auth-logo,.bdrd-charge,.ac-boite{color:var(--logo-couleur) !important;}
.auth-logo path,#auth-screen .auth-logo path{fill:var(--logo-couleur) !important;stroke:var(--logo-couleur) !important;}
.bdrd-etoile,#flash-status.bdrd-en-cours::before,#gen-photos-status.bdrd-en-cours::before{background-color:var(--accent) !important;}

/* ================================================================ FICHES
   Une carte = un PRODUIT, pas un formulaire : photo, titre, une ligne d'infos (compte · prix), et seulement pour une fiche
   à publier, une ligne d'action compacte (prix modifiable + Publier). État discret sur la photo ; sélection = contour violet. */
@media (min-width:768px){
  
  
  
  .vt-fiche-photos{border-radius:var(--r-carte);overflow:hidden;background:var(--cd-raised);outline:1px solid var(--border-subtle);outline-offset:-1px;}
  
  
  
  

  /* état sur la photo : petite étiquette sombre, point de couleur sémantique, aucune couleur de fond */
  .vt-fiche-haut .pill-status{display:inline-flex !important;align-items:center;gap:6px;padding:3px 8px !important;border-radius:6px !important;font-size:11px !important;font-weight:500 !important;
    background:rgba(12,12,16,.62) !important;color:#F5F5F7 !important;border:none !important;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);}
  
  
  .vt-fiche-haut .pill-status.actif::before{animation:sys-pulse 1.4s ease-in-out infinite;}
  .vt-fiche-haut .pill-status.echec{color:#F5F5F7 !important;}
  .vt-fiche-haut .pill-status.echec::before{background:#F07A7A;}
  
  .vt-fiche-haut .pill-status::after{display:none !important;}
  .vt-fiche-nb{font-size:11px !important;padding:2px 7px !important;border-radius:6px !important;background:rgba(12,12,16,.55) !important;color:#E5E5EA !important;border:none !important;}

  /* sélection : la coche n'apparaît qu'au survol ou quand une sélection est en cours */
  .vt-fiche-coche{opacity:0;transition:opacity .12s;}
  .vt-fiche-coche.on,.vt-fiche-coche:focus-visible{opacity:1;}
  .vt-fiche-coche.on{background:var(--accent) !important;border-color:var(--accent) !important;}

  .vt-fiche-corps{padding:10px 2px 0 !important;gap:4px !important;}
  .vt-fiche-titre{font-size:13px !important;font-weight:500 !important;line-height:1.38 !important;min-height:0 !important;-webkit-line-clamp:2;}
  .vt-fiche-sous{font-size:12px !important;color:var(--text-tertiary);gap:6px !important;}
  .vt-fiche-prix{font-size:13px !important;font-weight:600;color:var(--text-primary);}
  .vt-fiche-erreur{color:var(--danger) !important;font-size:12px !important;}
  .vt-fiche-date{font-size:12px !important;color:var(--text-tertiary) !important;}

  /* fiche à publier : compte = texte avec flèche (pas une boîte), puis prix + Publier sur UNE ligne */
  .vt-fiche-compte-choix{margin-top:0 !important;gap:2px !important;}
  
  
  .vt-fiche-achat{font-size:11.5px;color:var(--text-tertiary);}
  
  
  
  
  
  
  
}
@keyframes sys-pulse{0%,100%{opacity:1}50%{opacity:.35}}
@media (prefers-reduced-motion:reduce){.vt-fiche-haut .pill-status.actif::before{animation:none;}}

/* ============================================================ LISTES
   File des liens, Production, En attente : une seule surface, lignes alignées, l'état est un point + un mot ;
   l'action de reprise reste discrète (texte) et le menu ⋯ n'apparaît qu'au survol. */
.cl-ligne{border-radius:var(--r-ctrl);}
.cl-ligne:hover{background:var(--surface-hover);}
.cl-btn{background:transparent !important;color:var(--text-secondary) !important;}
.cl-btn:hover{background:var(--cd-control) !important;color:var(--text-primary) !important;}
.cl-ligne .cl-btn--icone{opacity:0;transition:opacity .12s;}
.cl-ligne:hover .cl-btn--icone,.cl-ligne:focus-within .cl-btn--icone{opacity:1;}
.cl-section-tete span{color:var(--text-tertiary);}

/* ============================================================ SURFACES
   Menus, fenêtres, info-bulles, notifications : même surface surélevée, bord fin, ombre retenue. */
.menu-contexte,.popover{border-radius:var(--r-carte) !important;}
@media (max-width:767px){.sel-menu,.pal{border-radius:var(--r-carte) !important;}}
.detail-sheet,.modal,.dialog,.vt-drawer{border-radius:var(--r-dialogue);}
@media (max-width:767px){#brouillons-list .vt-fiche-haut .pill-status.actif::after{display:none !important;}}

/* ============================================================ CONNEXION
   Même famille que le reste : Se connecter = principal violet, Google = secondaire neutre (pas un second bouton blanc). */
#auth-screen .auth-google{background:var(--cd-control) !important;color:var(--text-primary) !important;border:1px solid var(--border-subtle) !important;box-shadow:none !important;border-radius:var(--r-ctrl) !important;}
#auth-screen .auth-google:hover{background:var(--cd-control-hover) !important;}
#auth-screen .auth-box a{color:var(--accent-texte);}

/* ============================================================ GÉNÉRATIONS
   Garder les libellés d'état lisibles, sans mouvement, balayage ni pulsation pendant le travail. */
.bdrd-etoile,
#flash-status.bdrd-en-cours::before,#gen-photos-status.bdrd-en-cours::before,
#flash-status.bdrd-en-cours,#gen-photos-status.bdrd-en-cours,.vt-chargement,
.prod-ligne:has(.bdrd-etoile),.prod-ligne:has(.bdrd-etoile) .prod-img,
.vt-photo-refaire.en-cours,.vt-photo-modifier.en-cours,.photo-ia-vue.en-cours,.vt-attente-point,
.vt-fiche-haut .pill-status.actif::after{
  animation:none !important;
}
#flash-status.bdrd-en-cours,#gen-photos-status.bdrd-en-cours,.vt-chargement{
  color:var(--text-secondary,#9a9a92) !important;-webkit-text-fill-color:currentColor !important;background:none !important;
}
.prod-ligne:has(.bdrd-etoile){background-image:none !important;}
.vt-photo-refaire.en-cours,.vt-photo-modifier.en-cours,.photo-ia-vue.en-cours{opacity:1 !important;}
