/* ============================================================
   Expresso — Preflight UI  (thème clair)
   ============================================================ */

/* --- Reset & Base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --color-bg:       #f0f2f8;
    --color-surface:  #ffffff;
    --color-border:   #dde1ee;
    --color-text:     #1a1d2e;
    --color-muted:    #6b7285;
    --color-accent:   #003b66;
    --color-cta:      #cf2e2e;
    --color-pass:     #16a34a;
    --color-warn:     #d97706;
    --color-fail:     #dc2626;
    --color-info:     #003b66;
    --color-action-bg:    #fef2f2;
    --color-action-border:#f5c6c6;
    --color-action-text:  #cf2e2e;
    --color-process-bg:   #eff6ff;
    --color-process-border:#c3d9f0;
    --color-process-text: #003b66;
    --color-done-bg:      #f9fafb;
    --color-done-border:  #e5e7eb;
    --color-done-text:    #6b7285;
    /* Sections "interne" (non visibles client) : Applivision, Achats associes,
       cout matiere, marge, etc. Indigo doux pour signaler "donnees internes". */
    --color-internal:     #6366f1;
    --color-internal-bg:  #eef2ff;
    --color-internal-border: #c7d2fe;
    --radius:         8px;
    --radius-lg:      12px;
    --shadow:         0 2px 12px rgba(0,0,0,.10);
    --transition:     .2s ease;

    /* Breakpoints responsive — à utiliser dans les @media */
    --bp-mobile:      640px;
    --bp-tablet:      1024px;
    --bp-desktop:     1280px;
}

/* ── Charte Color 36 (verte) ────────────────────────────────────────────────
   Activee via <body class="brand-c36"> quand current_structure_filter()=='C36'
   (cf includes/header.php). Surcharge les variables d'accent. */
body.brand-c36 {
    --color-accent:        #0b5345;  /* vert dominante Color 36 */
    --color-info:          #0b5345;
    --color-process-bg:    #ecfdf5;
    --color-process-border:#a7f3d0;
    --color-process-text:  #0b5345;
}

html { font-size: 15px; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    line-height: 1.5;
}

a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Utilitaires globaux ----------------------------------- */
/* Texte meta (infos secondaires, descriptions courtes, etc.) */
.text-meta {
    font-size: 13px;
    color: var(--color-muted);
    line-height: 1.5;
}

/* Padding standard pour cartes/panneaux */
.card-pad { padding: 24px; }

/* Effet hover standard pour cartes cliquables */
.card-hover {
    transition: box-shadow .15s, border-color .15s, transform .15s;
}
.card-hover:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,.10);
    border-color: #c7d2fe;
}

/* --- Layout ------------------------------------------------ */
.app-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 0 40px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
}

/* ─── Fil d'ariane (breadcrumb global) ──────────────────────────── */
.breadcrumb {
    width: calc(100% - 32px);
    max-width: 1100px;
    margin: 20px auto 0;
    padding: 10px 18px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    font-size: 12.5px;
    box-sizing: border-box;
}
.breadcrumb ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.breadcrumb li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-muted);
}
.breadcrumb li + li::before {
    content: "›";
    color: var(--color-muted);
    opacity: .55;
    font-size: 14px;
}
.breadcrumb a {
    color: var(--color-muted);
    text-decoration: none;
}
.breadcrumb a:hover { color: var(--color-accent); text-decoration: underline; }
.breadcrumb [aria-current="page"] {
    color: var(--color-heading);
    font-weight: 600;
}
/* ─── Bloc d'explication module (.module-intro) ─────────────────────
   Reutilisable sur tous les modules : explique l'objet du module,
   l'interet business, le mode d'emploi en quelques phrases.
   Usage :
   <div class="module-intro">
       <div class="module-intro__icon">🛒</div>
       <div class="module-intro__content">
           <h3 class="module-intro__title">Titre court</h3>
           <p class="module-intro__text">Une ou deux phrases punchy.</p>
       </div>
   </div>
*/
.module-intro {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 4px solid #003b66;
    border-radius: 8px;
}
.module-intro__icon {
    font-size: 30px;
    line-height: 1;
    flex-shrink: 0;
}
.module-intro__content { flex: 1; min-width: 0; }
.module-intro__title {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 800;
    color: #003b66;
    letter-spacing: .01em;
}
.module-intro__text {
    margin: 0;
    font-size: 13px;
    color: #1e3a5f;
    line-height: 1.55;
}
.module-intro__text strong { color: #003b66; }
@media (max-width: 600px) {
    .module-intro { padding: 12px 14px; gap: 12px; }
    .module-intro__icon { font-size: 24px; }
    .module-intro__text { font-size: 12.5px; }
}

/* Variante Color 36 : .module-intro passe en vert quand body.brand-c36 */
body.brand-c36 .module-intro {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-left-color: #0b5345;
}
body.brand-c36 .module-intro__title,
body.brand-c36 .module-intro__text strong { color: #0b5345; }
body.brand-c36 .module-intro__text { color: #134e4a; }

/* ─── Pastille Contact dans le header (a cote du logo Expresso) ───────────
   Affichee pour tout user connecte. Si un commercial est trouve via les
   commandes, son nom apparait en sous-ligne.
*/
.header-contact-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 10px;
    margin-left: 12px;
    background: #eff6ff;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    color: #003b66;
    text-decoration: none;
    font-size: 12px;
    line-height: 1.2;
    transition: background .15s, border-color .15s;
    flex-shrink: 0;
}
.header-contact-pill:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    text-decoration: none;
    color: #003b66;
}
.header-contact-pill__icon { font-size: 16px; line-height: 1; }
.header-contact-pill__label { display: flex; flex-direction: column; }
.header-contact-pill__title { font-weight: 700; font-size: 12px; }
.header-contact-pill__sub {
    font-size: 10.5px;
    color: var(--color-muted);
    font-weight: 500;
    margin-top: 1px;
}
@media (max-width: 768px) {
    .header-contact-pill__sub { display: none; }
    .header-contact-pill { padding: 6px 12px; }
}
/* Variante Color 36 : pastille Contact verte */
body.brand-c36 .header-contact-pill {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #0b5345;
}
body.brand-c36 .header-contact-pill:hover {
    background: #d1fae5;
    border-color: #6ee7b7;
    color: #0b5345;
}
@media (max-width: 480px) {
    .header-contact-pill__title { display: none; }
}

/* ─── Tuiles de navigation .hub-tile (uniformes a l'echelle de l'app) ───────
   Pattern utilise pour les hubs de modules (admin, purchasing, planning,
   orders, shipments, crm, etc.). Tuile blanche, coins arrondis, hover
   discret. Badges optionnels pour statut/comptage. Usage :
     <a href="..." class="hub-tile">
       <div class="hub-tile__icon">🛒</div>
       <div class="hub-tile__title">
         Mes BC
         <span class="hub-tile__badge">3</span>
       </div>
       <div class="hub-tile__desc">Description courte</div>
     </a>
   Variante 'inactive' (a venir, en cours de construction) : --disabled.
*/
.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.hub-grid--wide { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.hub-tile {
    display: block;
    padding: 24px;
    background: var(--color-surface);
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: box-shadow .15s, border-color .15s, transform .15s;
    text-decoration: none;
    color: inherit;
    height: 100%;
}
.hub-tile:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,.10);
    border-color: #c7d2fe;
    text-decoration: none;
    color: inherit;
}
.hub-tile:visited { color: inherit; }
.hub-tile--disabled {
    opacity: .55;
    cursor: not-allowed;
}
.hub-tile--disabled:hover {
    box-shadow: var(--shadow);
    border-color: transparent;
}
/* Tuile "Installer l'app Android" — visuel vert pour se démarquer */
.hub-tile--app {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #86efac;
}
.hub-tile--app .hub-tile__title { color: #15803d; }
.hub-tile--app:hover { border-color: #16a34a; box-shadow: 0 4px 20px rgba(22, 163, 74, .18); }

.hub-tile--empty {
    opacity: .45;
    cursor: default;
    pointer-events: none;
}
/* Variante informationnelle : carte non cliquable, pleine couleur, pas de hover */
.hub-tile--static {
    cursor: default;
}
.hub-tile--static:hover {
    box-shadow: var(--shadow);
    border-color: transparent;
    transform: none;
}

.hub-tile__icon {
    font-size: 28px;
    line-height: 1;
    margin-bottom: 12px;
}

.hub-tile__title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 15px;
    font-weight: 700;
    color: var(--color-heading);
    margin-bottom: 6px;
    line-height: 1.3;
}

.hub-tile__desc {
    font-size: 13px;
    color: var(--color-muted);
    line-height: 1.5;
}

.hub-tile__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
    font-size: 11px;
    color: var(--color-muted);
}
.hub-tile__meta strong { color: var(--color-heading); font-weight: 700; }

/* CA cumulé sur les tuiles (admin + commerciaux uniquement) */
.hub-tile__ca {
    margin-top: 12px;
    padding: 8px 10px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #86efac;
    border-radius: 6px;
    font-size: 12px;
    color: #14532d;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.hub-tile__ca strong { color: #15803d; font-weight: 800; font-size: 13px; }

/* Badges : comptage / statut / metadonnee secondaire */
.hub-tile__badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    background: #dbeafe;
    color: #1e40af;
    line-height: 1.4;
    white-space: nowrap;
}
.hub-tile__badge--warn  { background:#fef3c7; color:#92400e; }
.hub-tile__badge--alert { background:#fee2e2; color:#991b1b; }
.hub-tile__badge--ok    { background:#dcfce7; color:#16a34a; }
.hub-tile__badge--muted { background:#f1f5f9; color:#6b7285; }
.hub-tile__badge--phase { background:#ede9fe; color:#5b21b6; letter-spacing:.04em; font-size:10px; }

@media (max-width: 600px) {
    .hub-tile { padding: 18px; }
    .hub-tile__icon { font-size: 24px; margin-bottom: 8px; }
    .hub-tile__title { font-size: 14px; }
    .hub-tile__desc { font-size: 12.5px; }
}

@media (max-width: 600px) {
    .breadcrumb {
        margin-top: 24px;
        padding: 8px 14px;
        font-size: 11.5px;
    }
}

.app-header__brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}
.app-header__brand-logo {
    height: 36px;
    width: auto;
    display: block;
}
.app-header__divider {
    width: 1px;
    height: 28px;
    background: var(--color-border);
    flex-shrink: 0;
}
.app-header__logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -.02em;
}

.app-header__logo span { color: var(--color-accent); }

.app-header__badge {
    background: rgba(0,59,102,.1);
    color: var(--color-accent);
    border: 1px solid rgba(0,59,102,.25);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 600;
}

.app-main {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px 40px 80px;
}

/* --- Order Card -------------------------------------------- */
.order-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 32px;
    box-shadow: var(--shadow);
}

.order-card__header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.order-card__icon {
    width: 44px; height: 44px;
    background: rgba(0,59,102,.1);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}

.order-card__title { font-size: 18px; font-weight: 700; }
.order-card__meta  { font-size: 13px; color: var(--color-muted); margin-top: 2px; }

.order-card__components {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 4px;
}

.comp-chip {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 13px;
}

.comp-chip__name { font-weight: 600; margin-bottom: 4px; }
.comp-chip__spec { color: var(--color-muted); font-size: 12px; line-height: 1.6; }
.comp-chip__tpe {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .02em;
    vertical-align: middle;
    text-transform: lowercase;
}
.comp-chip__tpe--couverture { background: #dbeafe; color: #1e40af; }
.comp-chip__tpe--interieur  { background: #dcfce7; color: #15803d; }
.comp-chip__tpe--autre      { background: #f1f5f9; color: #475569; }

/* --- Section titre ----------------------------------------- */
.section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--color-muted);
    margin-bottom: 16px;
}

/* --- Drop Zone --------------------------------------------- */
.upload-block { margin-bottom: 32px; }

.upload-block__label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
}

.drop-zone {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    position: relative;
    background: var(--color-surface);
}

.drop-zone:hover,
.drop-zone--over {
    border-color: var(--color-accent);
    background: rgba(0,59,102,.04);
}

.drop-zone--loaded {
    border-style: solid;
    border-color: var(--color-pass);
    background: rgba(22,163,74,.04);
}

.drop-zone__icon { font-size: 36px; margin-bottom: 12px; }
.drop-zone__text { font-size: 15px; font-weight: 500; margin-bottom: 6px; }
.drop-zone__hint { font-size: 13px; color: var(--color-muted); }
.drop-zone__filename {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-pass);
}

.drop-zone input[type=file] {
    position: absolute; inset: 0;
    opacity: 0; cursor: pointer;
    width: 100%; height: 100%;
}

/* --- Results Panel ----------------------------------------- */
.results-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 16px;
    margin-bottom: 32px;
    box-shadow: var(--shadow);
}

.results-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
}

.results-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.results-score span {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
}

.results-score small { font-size: 11px; color: var(--color-muted); margin-top: 4px; }
.results-score--pass  span { color: var(--color-pass); }
.results-score--warning span { color: var(--color-warn); }
.results-score--fail  span { color: var(--color-fail); }

.results-summary { display: flex; gap: 8px; flex-wrap: wrap; }

.results-section { padding: 20px 24px; border-bottom: 1px solid var(--color-border); }
.results-section:last-child { border-bottom: none; }
.results-section:has(.checklist--sorted) { padding: 20px; }
.results-section:has(.checklist--tabs)   { padding: 0; }

.results-section__title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-muted);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- Check Row -------------------------------------------- */
.checks-list { display: flex; flex-direction: column; gap: 4px; }

.check-row {
    display: flex;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: rgba(0,0,0,.015);
    transition: background var(--transition);
}

.check-row:hover { background: rgba(0,0,0,.03); }

.check-row__status { flex-shrink: 0; padding-top: 1px; }

.check-row__body { flex: 1; min-width: 0; }

.check-row__header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.check-label  { font-weight: 500; font-size: 14px; }
.check-value  { font-size: 13px; font-family: 'Fira Code', monospace; color: var(--color-text); background: rgba(0,0,0,.06); padding: 1px 6px; border-radius: 4px; }
.check-expected { font-size: 12px; color: var(--color-muted); }
.check-message{ font-size: 13px; color: var(--color-muted); margin-top: 3px; }

.check-details {
    list-style: none;
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
}
.check-details li { font-size: 12px; color: var(--color-muted); }

/* Couleurs par statut */
.check-row--fail    { border-left: 3px solid var(--color-fail);    background: rgba(220,38,38,.04); }
.check-row--warning { border-left: 3px solid var(--color-warn);    background: rgba(217,119,6,.04); }
.check-row--pass    { border-left: 3px solid var(--color-pass); }
.check-row--info    { border-left: 3px solid var(--color-info); }

/* --- Badge ------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.badge--pass    { background: rgba(22,163,74,.12);  color: var(--color-pass); }
.badge--warning { background: rgba(217,119,6,.12);  color: var(--color-warn); }
.badge--fail    { background: rgba(220,38,38,.12);  color: var(--color-fail); }
.badge--info    { background: rgba(37,99,235,.12);  color: var(--color-info); }
.badge--pending { background: rgba(0,0,0,.07);       color: var(--color-muted); }

/* --- Tags -------------------------------------------------- */
.tag {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.tag--server { background: rgba(0,59,102,.12); color: var(--color-accent); }
.tag--local  { background: rgba(22,163,74,.12); color: var(--color-pass);   }

/* --- Spinner legacy (conservé pour compatibilité) ---------- */
.results-loading {
    display: flex; flex-direction: column; align-items: center;
    gap: 10px; padding: 32px; color: var(--color-muted); font-size: 14px;
}
.spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
.spinner--small { width: 20px; height: 20px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Analysis Loader — loader animé principal -------------- */
.analysis-loader {
    padding: 36px 24px 28px;
    text-align: center;
    background: var(--color-surface);
}

.analysis-loader__icon {
    font-size: 60px;
    display: block;
    margin: 0 auto 14px;
    line-height: 1;
    animation: loaderBounce 1.8s ease-in-out infinite;
    transition: opacity .15s ease;
    user-select: none;
}

.analysis-loader__icon.loader-icon--swap {
    opacity: 0;
    transform: scale(.7);
    transition: opacity .15s ease, transform .15s ease;
}

@keyframes loaderBounce {
    0%, 100% { transform: translateY(0) rotate(-2deg) scale(1);   }
    30%       { transform: translateY(-10px) rotate(3deg) scale(1.08); }
    60%       { transform: translateY(-4px) rotate(-1deg) scale(1.03);  }
}

.analysis-loader__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 18px;
}

.analysis-loader__bar {
    height: 4px;
    background: var(--color-border);
    border-radius: 2px;
    overflow: hidden;
    max-width: 340px;
    margin: 0 auto 18px;
}

.analysis-loader__bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-accent), #4d87b0, var(--color-accent));
    background-size: 200% 100%;
    border-radius: 2px;
    transition: width .6s cubic-bezier(.4,0,.2,1);
    animation: barShimmer 2s linear infinite;
}

@keyframes barShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.analysis-loader__message {
    font-size: 13px;
    color: var(--color-muted);
    min-height: 38px;
    max-width: 400px;
    margin: 0 auto 10px;
    line-height: 1.6;
    transition: opacity .28s ease, transform .28s ease;
    font-style: italic;
}

.analysis-loader__message.loader-msg--out {
    opacity: 0;
    transform: translateY(6px);
}

.analysis-loader__timer {
    font-family: 'Fira Code', monospace;
    font-size: 15px;
    font-weight: 700;
    color: var(--color-accent);
    letter-spacing: .04em;
}

/* Version compacte pour la section checks avancés */
.analysis-loader--compact {
    padding: 16px 12px;
    text-align: left;
}

.analysis-loader__row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.analysis-loader__icon--sm {
    font-size: 28px;
    display: inline-block;
    flex-shrink: 0;
    animation: loaderBounce 1.8s ease-in-out infinite;
    margin: 0;
}

.analysis-loader__col {
    flex: 1;
    min-width: 0;
}

.analysis-loader__message--sm {
    font-size: 12px;
    min-height: 18px;
    margin: 4px 0 0;
    max-width: none;
}

.analysis-loader__timer--sm {
    font-size: 13px;
    flex-shrink: 0;
    color: var(--color-accent);
    font-family: 'Fira Code', monospace;
    font-weight: 700;
}

/* Badge temps écoulé dans le header résultats */
.elapsed-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(0,59,102,.1);
    color: var(--color-accent);
    font-family: 'Fira Code', monospace;
    white-space: nowrap;
}

/* --- Email Form -------------------------------------------- */
.email-form {
    background: rgba(67,85,238,.05);
    border: 1px solid rgba(67,85,238,.18);
    border-radius: var(--radius-lg);
    margin: 16px 24px 24px;
    padding: 24px;
}

.email-form__title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.email-form__desc  { font-size: 13px; color: var(--color-muted); margin-bottom: 16px; line-height: 1.6; }

.form-row { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }

.form-input {
    flex: 1;
    min-width: 180px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    padding: 9px 14px;
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition);
}

.form-input:focus { border-color: var(--color-accent); }
.form-input::placeholder { color: var(--color-muted); }
.form-textarea { resize: vertical; min-height: 120px; font-family: inherit; }

/* --- Buttons ----------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius);
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity var(--transition), transform var(--transition);
}

.btn:hover  { opacity: .88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
    background: var(--color-accent);
    color: #fff;
}

/* --- Banners ---------------------------------------------- */
.error-banner {
    background: rgba(220,38,38,.08);
    border: 1px solid rgba(220,38,38,.25);
    color: var(--color-fail);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 14px;
}

.success-banner {
    background: rgba(22,163,74,.08);
    border: 1px solid rgba(22,163,74,.25);
    color: var(--color-pass);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 14px;
}

/* --- Notifications ---------------------------------------- */
.notif {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    padding: 12px 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-size: 14px;
    z-index: 9999;
    animation: slideIn .25s ease;
    transition: opacity .4s, transform .4s;
}

.notif--error  { border-color: rgba(220,38,38,.35); color: var(--color-fail); }
.notif--out    { opacity: 0; transform: translateY(10px); }

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

/* --- Check block (3 états) --------------------------------- */
.check-block { margin-bottom: 40px; }

.check-block--free .check-block__upload {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 0 20px;
}

/* --- Upload hero (mode libre) ------------------------------ */
.upload-hero__title {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -.025em;
    color: var(--color-text);
    line-height: 1.2;
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .upload-hero__title {
        white-space: normal;
        font-size: 20px;
    }
}
.upload-hero__sub {
    font-size: 14px;
    font-weight: 400;
    color: var(--color-muted);
    line-height: 1.65;
}
.upload-hero__detail {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-accent);
    letter-spacing: .01em;
    line-height: 1.5;
}

/* --- Feature list (compact, 2 colonnes) -------------------- */
.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.feature-list__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.feature-list__icon {
    font-size: 17px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}
.feature-list__body {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.feature-list__title {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text);
}
.feature-list__desc {
    font-size: 12px;
    color: var(--color-muted);
    line-height: 1.45;
}

@media (max-width: 640px) {
    .upload-hero__title { font-size: 22px; }
}

/* --- Bouton start ------------------------------------------ */
.btn--start {
    display: block;
    /* override accent → CTA red */
    width: 100%;
    margin: 20px 0 0;
    padding: 17px 24px;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: .01em;
    border-radius: 12px;
    background: var(--color-cta);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(207,46,46,.3);
    transition: opacity .2s, transform .2s, box-shadow .2s;
}
.btn--start:disabled {
    opacity: .35;
    cursor: not-allowed;
    box-shadow: none;
    transform: none !important;
}
.btn--start:not(:disabled):hover  { opacity: .9; transform: translateY(-2px); box-shadow: 0 8px 28px rgba(207,46,46,.4); }
.btn--start:not(:disabled):active { transform: translateY(0); }

/* --- Checklist temps-réel ---------------------------------- */
.check-block__progress { padding: 8px 0; }

.checklist {
    max-width: 640px;
    margin: 16px auto 0;
    padding: 0 4px;
}
/* En mode grille, pas de contrainte de largeur */
.checklist--sorted { max-width: none; margin: 0; padding: 0; }

.checklist-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0 10px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 5px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.checklist-item__icon  { font-size: 14px; font-weight: 700; flex-shrink: 0; width: 18px; text-align: center; }
.checklist-item__label { flex: 1; font-weight: 500; min-width: 0; }
.checklist-item__value {
    font-size: 11px;
    font-family: 'Fira Code', monospace;
    background: rgba(0,0,0,.06);
    padding: 2px 7px;
    border-radius: 4px;
    color: var(--color-muted);
    flex-shrink: 0;
}
.checklist-item__pages {
    font-size: 10px;
    font-weight: 600;
    font-family: 'Fira Code', monospace;
    color: #92400e;
    background: rgba(251,191,36,.15);
    border: 1px solid rgba(251,191,36,.35);
    border-radius: 4px;
    padding: 2px 6px;
    margin-left: 2px;
    white-space: nowrap;
    flex-shrink: 0;
    vertical-align: middle;
}
.checklist-item--pass    .checklist-item__icon { color: var(--color-pass); }
.checklist-item--warning .checklist-item__icon { color: var(--color-warn); }
.checklist-item--fail    .checklist-item__icon { color: var(--color-fail); }
.checklist-item--info    .checklist-item__icon { color: var(--color-info); }
.checklist-item--skip                          { opacity: .65; }
.checklist-item--skip    .checklist-item__icon { color: var(--color-muted); }
.checklist-item--skip    .checklist-item__label { color: var(--color-muted); }

/* Chevron & expand */
.checklist-item__chevron {
    flex-shrink: 0;
    font-size: 16px;
    color: var(--color-muted);
    line-height: 1;
    display: none;
    transition: transform .25s ease;
    margin-left: 2px;
    user-select: none;
}
.checklist-item--clickable { cursor: pointer; }
.checklist-item--clickable:hover { background: rgba(0,0,0,.03); }
.checklist-item--clickable .checklist-item__chevron { display: inline; }
.checklist-item--open .checklist-item__chevron { transform: rotate(90deg); }

/* Hint sur warning/fail fermés : "Cliquez pour cibler le défaut".
   Évite l'auto-ouverture (qui surchargeait l'écran) tout en guidant
   l'utilisateur vers l'action attendue. Retour Nicolas Orlandi (#86).
   N'apparaît QUE sur les items qui contiennent une vignette à montrer
   (classe checklist-item--has-thumb posée par _buildItem). */
.checklist-item--has-thumb.checklist-item--clickable.checklist-item--warning:not(.checklist-item--open) .checklist-item__chevron::before,
.checklist-item--has-thumb.checklist-item--clickable.checklist-item--fail:not(.checklist-item--open)    .checklist-item__chevron::before {
    content: "Cliquez pour cibler le défaut";
    font-size: 11px;
    color: var(--color-warn);
    margin-right: 6px;
    font-weight: 500;
    letter-spacing: .01em;
    opacity: .85;
}

/* Badge CONFORME / NON CONFORME / À VÉRIFIER (onglet CdC) — feedback #85 */
.compliance-badge {
    display: inline-block;
    flex-shrink: 0;
    padding: 2px 9px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-left: 6px;
    line-height: 1.5;
}
.compliance-badge--ok   { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.compliance-badge--ko   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.compliance-badge--info { background: #e0f2fe; color: #075985; border: 1px solid #7dd3fc; }

/* Expandable detail panel */
.checklist-item__detail {
    flex: 0 0 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease, padding .3s ease;
    padding: 0 0 0 28px; /* indent past icon */
}
.checklist-item--open .checklist-item__detail { max-height: 4000px; padding: 8px 0 4px 28px; }

.item-detail__message {
    font-size: 12px;
    color: var(--color-muted);
    line-height: 1.55;
    margin-bottom: 5px;
}
.item-detail__message--empty { font-style: italic; }

.item-detail__row {
    display: flex;
    gap: 8px;
    font-size: 11px;
    margin-bottom: 3px;
    align-items: baseline;
    flex-wrap: wrap;
}
.item-detail__key {
    flex-shrink: 0;
    font-weight: 600;
    color: var(--color-muted);
    min-width: 70px;
}
.item-detail__val {
    font-family: 'Fira Code', monospace;
    color: var(--color-text);
    word-break: break-word;
}

/* Vignettes — pages avec images basse résolution */
.item-detail__thumbs {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--color-border);
}
.item-detail__thumbs-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-muted);
    margin-bottom: 8px;
}
.item-detail__thumb-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.item-detail__thumb {
    margin: 0;
    text-align: center;
}
.item-detail__thumb img {
    display: block;
    max-width: 280px;
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    background: #fff;
}
.item-detail__thumb figcaption {
    font-size: 11px;
    color: var(--color-text);
    font-weight: 600;
    margin-top: 6px;
}
@media (max-width: 768px) {
    .item-detail__thumb img { max-width: 100%; }
}

/* Knowledge blocks — 3 colonnes */
.item-detail__knowledge {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    border-top: 1px solid var(--color-border);
    padding-top: 10px;
}

@media (max-width: 700px) {
    .item-detail__knowledge { grid-template-columns: 1fr; }
}

.item-detail__know-block { display: flex; flex-direction: column; gap: 5px; }

.item-detail__know-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-radius: 4px;
    display: inline-block;
    padding: 1px 7px;
    align-self: flex-start;
}
.item-detail__know-label--explain { background: rgba(37,99,235,.1);  color: var(--color-info); }
.item-detail__know-label--impact  { background: rgba(217,119,6,.1);  color: var(--color-warn); }
.item-detail__know-label--fix     { background: rgba(22,163,74,.1);  color: var(--color-pass); }

.item-detail__know-text {
    font-size: 12px;
    color: var(--color-muted);
    line-height: 1.6;
    margin: 0;
}

/* --- Onglets de checks (live + résultats) ──────────────── */
.checklist--tabs {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 0;
}

.live-score-bar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
}

.live-score-top {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.live-filename {
    font-size: 13px;
    color: var(--color-muted);
    line-height: 1.5;
    margin-bottom: 4px;
}

.live-filename__name {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
    word-break: break-all;
    letter-spacing: -.01em;
}

/* Progress bar style Apple */
.inline-progress { display: flex; flex-direction: column; gap: 5px; }

.inline-progress__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--color-muted);
}

.inline-progress__label {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inline-progress__count {
    font-family: 'Fira Code', monospace;
    font-weight: 700;
    font-size: 10px;
    color: var(--color-accent);
    background: rgba(67,85,238,.08);
    padding: 1px 7px;
    border-radius: 10px;
    flex-shrink: 0;
    margin-left: 10px;
}
.btn--skip-adv {
    margin-left: auto;
    padding: 2px 10px;
    font-size: 10px;
    font-weight: 600;
    color: var(--color-muted);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: color .2s, border-color .2s;
}
.btn--skip-adv:hover { color: var(--color-text); border-color: var(--color-muted); }

.inline-progress__track {
    height: 6px;
    background: rgba(0,0,0,.08);
    border-radius: 100px;
    overflow: hidden;
}

.inline-progress__fill {
    position: relative;
    overflow: hidden;
    height: 100%;
    width: 0%;
    border-radius: 100px;
    background: linear-gradient(90deg, var(--color-accent), #4d87b0);
    transition: width .5s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 0 6px rgba(0,59,102,.35);
}

.inline-progress__fill::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
    animation: progress-shimmer 1.4s ease-in-out infinite;
}

@keyframes progress-shimmer {
    0%   { left: -60%; }
    100% { left: 160%; }
}

.inline-progress__fill--warning {
    background: linear-gradient(90deg, var(--color-warn), #f59e0b);
    box-shadow: 0 0 6px rgba(217,119,6,.35);
}

.inline-progress__fill--pass {
    background: linear-gradient(90deg, var(--color-pass), #22c55e);
    box-shadow: 0 0 6px rgba(22,163,74,.35);
}

.tab-bar {
    display: flex;
    gap: 4px;
    padding: 12px 16px 0;
    background: var(--color-bg);
    border-bottom: 2px solid var(--color-border);
    align-items: flex-end;
}

/* ── Toggle Mode simplifié / expert ─────────────────────────────────────
   Aligné à droite dans la tab-bar, masque/affiche les .checklist-item--advanced. */
.mode-toggle {
    margin-left: auto;
    margin-bottom: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: var(--color-surface);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-muted);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}
.mode-toggle:hover { border-color: var(--color-accent); color: var(--color-accent); }
.mode-toggle[aria-pressed="true"] {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}
.mode-toggle__icon { font-size: 13px; }

/* Mode simplifié (par défaut) : les items advanced sont masqués */
.checklist-item--advanced { display: none; }
/* Mode expert : on les ré-affiche, en les marquant visuellement */
.mode-expert .checklist-item--advanced {
    display: flex;
    background: rgba(99,102,241,.04);
    border-left: 2px solid #6366f1;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px 11px;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    margin-bottom: -2px;
    background: rgba(0,0,0,.04);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-muted);
    cursor: pointer;
    transition: color var(--transition), background var(--transition), border-color var(--transition);
    white-space: nowrap;
}

.tab-btn:hover:not(.tab-btn--active) { background: rgba(0,0,0,.07); color: var(--color-text); }

.tab-btn--active {
    background: var(--color-surface);
    border-color: var(--color-border);
    border-bottom-color: var(--color-surface);
}

.tab-btn--active[data-tab="ok"]         { color: var(--color-pass); }
.tab-btn--active[data-tab="info"]       { color: var(--color-info); }
.tab-btn--active[data-tab="warning"]    { color: var(--color-warn); }
.tab-btn--active[data-tab="scope"]      { color: var(--color-muted); }
.tab-btn--active[data-tab="spec"]       { color: #0e7490; }
.tab-btn--active[data-tab="diagnostic"] { color: var(--color-text); }

/* Onglet CdC en alerte rouge pulsante (battement de cœur) quand au moins
   un check du périmètre Q1 (page_count, page_format non homothétique,
   color_mode) est en non-conforme. Retour Nicolas : attire l'œil pour
   forcer le check avant transmission. */
.tab-btn--alert {
    color: #b91c1c !important;
    border-color: #fca5a5 !important;
    background: #fef2f2 !important;
    /* L'animation joue uniquement sur la couleur de fond et un box-shadow
       INSET pour ne pas déborder sur les onglets adjacents. Pas de scale. */
    animation: tabBtnHeartbeat 1.4s ease-in-out infinite;
}
.tab-btn--alert .tab-btn__icon, .tab-btn--alert .tab-btn__count {
    color: #b91c1c !important;
}
.tab-btn--alert .tab-btn__count {
    background: #fee2e2 !important;
}
@keyframes tabBtnHeartbeat {
    0%, 100% {
        background: #fef2f2;
        box-shadow: inset 0 0 0 0 rgba(220, 38, 38, 0);
    }
    14% {
        background: #fee2e2;
        box-shadow: inset 0 0 0 2px rgba(220, 38, 38, 0.45);
    }
    28% { background: #fef2f2; box-shadow: inset 0 0 0 0 rgba(220, 38, 38, 0); }
    42% {
        background: #fecaca;
        box-shadow: inset 0 0 0 2px rgba(220, 38, 38, 0.30);
    }
    56% { background: #fef2f2; box-shadow: inset 0 0 0 0 rgba(220, 38, 38, 0); }
}

.tab-btn__icon--ok         { color: var(--color-pass); }
.tab-btn__icon--info       { color: var(--color-info); }
.tab-btn__icon--warning    { color: var(--color-warn); }
.tab-btn__icon--scope      { color: var(--color-muted); font-size: 16px; }
.tab-btn__icon--spec       { color: #0e7490; font-size: 13px; }
.tab-btn__icon--diagnostic { font-size: 14px; }

.tab-btn__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(0,0,0,.07);
    color: var(--color-muted);
    transition: background var(--transition), color var(--transition);
}

.tab-btn--active[data-tab="ok"]         .tab-btn__count { background: rgba(22,163,74,.15);  color: var(--color-pass); }
.tab-btn--active[data-tab="info"]       .tab-btn__count { background: rgba(37,99,235,.15);  color: var(--color-info); }
.tab-btn--active[data-tab="warning"]    .tab-btn__count { background: rgba(217,119,6,.15);  color: var(--color-warn); }
.tab-btn--active[data-tab="spec"]       .tab-btn__count { background: rgba(14,116,144,.15); color: #0e7490; }
.tab-btn--active[data-tab="diagnostic"] .tab-btn__count { background: rgba(0,0,0,.10);      color: var(--color-text); }

.tab-panel { display: none; }
.tab-panel--active { display: block; }

/* Onglet Diagnostic / Spec : ordre visuel info → warning → pass via flexbox `order`,
   indépendamment de l'ordre d'arrivée des checks (analyse en flux). */
.tab-panel--active[id^="col-body-diagnostic-"],
.tab-panel--active[id^="col-body-spec-"] {
    display: flex;
    flex-direction: column;
}
[id^="col-body-diagnostic-"] .checklist-item--info,
[id^="col-body-spec-"]       .checklist-item--info    { order: 1; }
[id^="col-body-diagnostic-"] .checklist-item--warning,
[id^="col-body-spec-"]       .checklist-item--warning { order: 2; }
[id^="col-body-diagnostic-"] .checklist-item--pass,
[id^="col-body-spec-"]       .checklist-item--pass    { order: 3; }
[id^="col-body-diagnostic-"] .tab-panel__proverb,
[id^="col-body-spec-"]       .tab-panel__proverb      { order: 0; }

/* ── Panneau Hors périmètre ───────────────────────────────── */
.scope-panel {
    padding: 18px 20px 24px;
}
.scope-panel__intro {
    font-size: 13px;
    color: var(--color-muted);
    margin: 0 0 18px;
    line-height: 1.6;
    border-left: 3px solid var(--color-border);
    padding-left: 12px;
}
.scope-panel__cat {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-muted);
    margin: 16px 0 6px;
}
.scope-panel__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.scope-panel__list li {
    font-size: 13px;
    color: var(--color-text);
    padding: 5px 10px 5px 24px;
    position: relative;
    border-radius: 4px;
    background: var(--color-bg-alt, rgba(0,0,0,.02));
}
.scope-panel__list li::before {
    content: '✕';
    position: absolute;
    left: 7px;
    color: var(--color-muted);
    font-size: 10px;
    top: 7px;
}
.scope-panel__footer {
    margin: 20px 0 0;
    font-size: 12px;
    color: var(--color-muted);
    font-style: italic;
}

/* Items inside panels: no margin, flush borders */
.tab-panel .checklist-item { margin-bottom: 0; border-radius: 0; border: none; border-bottom: 1px solid rgba(0,0,0,.05); box-shadow: none; }
.tab-panel .checklist-item:last-child { border-bottom: none; }
.tab-panel__proverb {
    padding: 28px 20px;
    text-align: center;
    font-size: 13px;
    font-style: italic;
    color: var(--color-muted);
    line-height: 1.6;
    opacity: 0;
    animation: proverb-fade 0.6s ease 0.3s forwards;
}
@keyframes proverb-fade {
    to { opacity: 1; }
}


/* --- CTAs résultats ---------------------------------------- */
.results-ctas {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 32px 24px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
}
.results-ctas--secondary {
    padding: 16px 24px;
    border-top: none;
}
.results-ctas--inline {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
}

/* ── Gate prospect inline ──────────────────────────────────── */
.prospect-gate {
    margin: 0;
    padding: 28px 28px 24px;
    background: linear-gradient(135deg, #001a33 0%, #003b66 100%);
    border-radius: 12px;
}
.prospect-gate__form-wrap, .prospect-gate__confirmation { text-align: center; }
.prospect-gate__form-wrap { display: flex; flex-direction: column; gap: 14px; }
.prospect-gate__title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.4;
}
.prospect-gate__desc {
    font-size: 14px;
    color: rgba(255,255,255,.65);
    margin: 0;
    line-height: 1.6;
}
.prospect-gate__email {
    background: rgba(255,255,255,.1) !important;
    border-color: rgba(255,255,255,.2) !important;
    color: #fff !important;
    font-size: 15px;
}
.prospect-gate__email::placeholder { color: rgba(255,255,255,.38); }
.prospect-gate__consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    color: rgba(255,255,255,.6);
    cursor: pointer;
    line-height: 1.5;
}
.prospect-gate__consent input[type=checkbox] {
    flex-shrink: 0;
    margin-top: 2px;
    width: 16px;
    height: 16px;
    accent-color: #003b66;
    cursor: pointer;
}
.prospect-gate__consent a { color: rgba(255,255,255,.85); }
.prospect-gate__btn      { align-self: center; }

/* Écran de confirmation après soumission */
.prospect-gate__confirmation { text-align: center; padding: 16px 0 8px; }
.prospect-gate__conf-icon {
    font-size: 42px;
    line-height: 1;
    margin-bottom: 16px;
    display: inline-block;
    animation: rotate-slow 3s linear infinite;
}
@keyframes rotate-slow {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.prospect-gate__conf-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px;
}
.prospect-gate__conf-msg   { font-size: 14px; color: rgba(255,255,255,.7); margin: 0 0 10px; line-height: 1.6; }
.prospect-gate__conf-email { font-size: 16px; color: #7bafd4; font-weight: 600; margin: 0 0 12px; }
.prospect-gate__conf-sub   { font-size: 12px; color: rgba(255,255,255,.4); margin: 0; }

/* ── Layout 50/50 rapport + BAT ────────────────────────────── */
.gate-row { display: flex; gap: 16px; }
.gate-row__left, .gate-row__right { flex: 1; min-width: 0; }
.fs-gate {
    padding: 28px 28px 24px;
    background: linear-gradient(135deg, #4a1800 0%, #b85c00 100%);
    border-left: none;
    border-radius: 12px;
    display: flex; flex-direction: column; gap: 14px;
    text-align: center;
}
.fs-gate__title {
    font-size: 18px; font-weight: 700; color: #fff; margin: 0; line-height: 1.4;
}
.fs-gate__desc {
    font-size: 14px; color: rgba(255,255,255,.65); line-height: 1.6; margin: 0;
}
.fs-gate__warn {
    font-size: 13px; padding: 10px 14px; border-radius: 6px;
    background: rgba(255,255,255,.15); color: #fff; line-height: 1.5;
}
.fs-gate__warn a { color: #ffd180; font-weight: 600; }
.fs-gate__override {
    display: flex; align-items: flex-start; gap: 8px;
    font-size: 12px; color: rgba(255,255,255,.6); cursor: pointer;
}
.fs-gate__override input { margin-top: 2px; flex-shrink: 0; accent-color: #b85c00; }
.fs-gate__btn {
    align-self: center; padding: 10px 24px; font-size: 14px; font-weight: 700;
    border: none; border-radius: 6px; cursor: pointer;
    background: #fff; color: #b85c00; transition: opacity .15s;
}
.fs-gate__btn:hover { opacity: .85; }
.fs-gate__btn:disabled { opacity: .5; cursor: not-allowed; }
.fs-gate__status { font-size: 13px; color: #fff; }

/* Modal confirmation BAT */
.fs-confirm-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center;
}
.fs-confirm {
    background: #fff; border-radius: 12px; padding: 28px 32px; max-width: 500px; width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.fs-confirm__title { font-size: 16px; font-weight: 700; color: var(--color-heading); margin: 0 0 12px; }
.fs-confirm__msg { font-size: 13px; color: var(--color-text); line-height: 1.6; margin: 0 0 8px; }
.fs-confirm__warn { font-size: 13px; padding: 10px 14px; border-radius: 6px; background: #fff3e0; color: #b85c00; margin: 12px 0; line-height: 1.5; }
.fs-confirm__btns { display: flex; gap: 10px; margin-top: 18px; }
.fs-confirm__btns button {
    padding: 8px 20px; font-size: 13px; font-weight: 600; border-radius: 6px; border: none; cursor: pointer;
}
.fs-confirm__ok { background: #2e7d32; color: #fff; }
.fs-confirm__ok:disabled { background: #cbd5e1; color: #94a3b8; cursor: not-allowed; }
.fs-confirm__cancel { background: var(--color-border); color: var(--color-text); }

/* Bloc des écarts CdC à confirmer (cases à cocher) */
.fs-confirm__mismatch {
    margin: 14px 0 6px;
    padding: 14px 16px;
    background: #fef2f2;
    border: 2px solid #fca5a5;
    border-radius: 8px;
}
.fs-confirm__mismatch-title {
    font-size: 13px;
    font-weight: 700;
    color: #991b1b;
    margin-bottom: 4px;
}
.fs-confirm__mismatch-desc {
    font-size: 12px;
    color: #7f1d1d;
    line-height: 1.5;
    margin-bottom: 12px;
}
.fs-confirm__checkboxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.fs-confirm__check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #fecaca;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.fs-confirm__check:hover { background: #fff5f5; border-color: #f87171; }
.fs-confirm__check input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #dc2626;
}
.fs-confirm__check input[type="checkbox"]:checked + .fs-confirm__check-label { color: #166534; }
.fs-confirm__check:has(input:checked) {
    background: #f0fdf4;
    border-color: #86efac;
}
.fs-confirm__check-label {
    font-size: 13px;
    color: #1a1d2e;
    line-height: 1.4;
}
.fs-confirm__check-label strong { display: block; margin-bottom: 3px; }
.fs-confirm__detail {
    display: block;
    font-size: 11px;
    color: var(--color-muted);
    font-family: 'Fira Code', monospace;
}

@media (max-width: 768px) {
    .gate-row { flex-direction: column; }
    .fs-gate { border-top: none; }
}

/* ── Phases animées (loading → sondage → succès) ────────────── */
.pg-phase {
    display: none;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .45s ease, transform .45s ease;
    text-align: center;
    padding: 8px 0;
}
.pg-phase--active {
    display: block;
    opacity: 1;
    transform: none;
}

/* Icône rotative phase 1 */
.pg-loading-icon {
    font-size: 40px;
    line-height: 1;
    margin-bottom: 16px;
    display: inline-block;
    animation: rotate-slow 2s linear infinite;
}

/* Barre de progression */
.pg-timer-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,.15);
    border-radius: 99px;
    margin: 20px 0 0;
    overflow: hidden;
}
.pg-timer-bar--sm { margin-top: 24px; height: 4px; }
.pg-timer-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4d87b0, #7bafd4);
    border-radius: 99px;
    transition: width .3s linear;
}

/* Cartouche sondage — apparaît à t=3s */
.pg-survey-card {
    margin-top: 20px;
    padding: 16px 18px;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: var(--radius);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .4s ease, transform .4s ease;
    pointer-events: none;
}
.pg-survey-card--visible {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}
.pg-survey__intro {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 14px;
    text-align: center;
}

/* Steps séquentiels */
.pg-survey__step {
    display: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .35s ease, transform .35s ease;
}
.pg-survey__step--active {
    display: block;
    opacity: 1;
    transform: none;
}

.pg-survey__question {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,.6);
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* Options horizontales */
.pg-survey__options {
    display: flex;
    flex-direction: row;
    gap: 8px;
}
/* Grille 2x2 pour Q1 (4 options) */
.pg-survey__options--grid {
    flex-wrap: wrap;
}
.pg-survey__options--grid .pg-survey__opt {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    text-align: left;
}
.pg-survey__opt {
    flex: 1;
    background: rgba(255,255,255,.08);
    border: 1.5px solid rgba(255,255,255,.18);
    border-radius: var(--radius);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    padding: 10px 12px;
    cursor: pointer;
    text-align: center;
    transition: background .2s, border-color .2s, transform .15s;
}
.pg-survey__opt:hover:not(:disabled) {
    background: rgba(255,255,255,.16);
    border-color: rgba(255,255,255,.4);
    transform: translateY(-2px);
}
.pg-survey__opt:disabled { cursor: default; opacity: .7; }

/* Popup "Autre" */
.pg-survey__popup {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
    padding: 14px;
    background: rgba(0,0,0,.25);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: var(--radius);
}
.pg-survey__popup--open { display: flex; }
.pg-survey__popup-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}
.pg-survey__other-input {
    width: 100%;
    padding: 9px 12px;
    background: rgba(255,255,255,.08);
    border: 1.5px solid rgba(255,255,255,.2);
    border-radius: var(--radius);
    color: #fff;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}
.pg-survey__other-input::placeholder { color: rgba(255,255,255,.4); }
.pg-survey__other-input:focus { border-color: rgba(255,255,255,.5); }
.pg-survey__popup-btn {
    align-self: flex-end;
    padding: 8px 20px;
    background: var(--color-cta);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s;
}
.pg-survey__popup-btn:hover { opacity: .88; }

/* Remerciement */
.pg-survey__thanks {
    display: none;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    padding: 8px 0;
}
.pg-survey__thanks--visible { display: block; }

/* ── Boutons CTA dans la barre de score ────────────────────── */
.live-score-top-ctas {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.btn--prospect-header {
    flex-shrink: 0;
    padding: 14px 28px;
    background: var(--color-cta);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .2s, transform .1s;
    box-shadow: 0 4px 14px rgba(207,46,46,.3);
}
@media (max-width: 768px) {
    .btn--prospect-header { white-space: normal; text-align: center; }
}
.btn--prospect-header:hover:not(:disabled) { opacity: .9; transform: translateY(-1px); }
.btn--prospect-header:disabled { opacity: .65; cursor: default; background: #888; }

/* ── Overlay + modal prospect ──────────────────────────────── */
.prospect-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    padding: 16px;
}
.prospect-modal-overlay--visible {
    opacity: 1;
    pointer-events: auto;
}
body.modal-open { overflow: hidden; }

.prospect-modal {
    position: relative;
    background: linear-gradient(135deg, #001a33 0%, #003b66 100%);
    color: #fff;
    border-radius: 16px;
    padding: 40px 44px 36px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
    text-align: center;
    animation: modalIn .25s ease;
}
@keyframes modalIn {
    from { transform: translateY(16px) scale(.97); opacity: 0; }
    to   { transform: none; opacity: 1; }
}
.prospect-modal__close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    color: rgba(255,255,255,.5);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 6px;
    transition: color .15s;
}
.prospect-modal__close:hover { color: #fff; }
.prospect-modal__icon  { font-size: 40px; line-height: 1; margin-bottom: 12px; }
.prospect-modal__title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 12px;
    color: #fff;
}
.prospect-modal__desc {
    font-size: 14px;
    color: rgba(255,255,255,.7);
    margin: 0 0 24px;
    line-height: 1.6;
}
.prospect-modal__form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.prospect-modal__email {
    background: rgba(255,255,255,.1) !important;
    border-color: rgba(255,255,255,.25) !important;
    color: #fff !important;
    font-size: 15px;
}
.prospect-modal__email::placeholder { color: rgba(255,255,255,.4); }
.prospect-modal__consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    font-size: 12px;
    color: rgba(255,255,255,.6);
    cursor: pointer;
    line-height: 1.5;
}
.prospect-modal__consent input[type=checkbox] {
    flex-shrink: 0;
    margin-top: 2px;
    width: 16px;
    height: 16px;
    accent-color: #003b66;
    cursor: pointer;
}
.prospect-modal__consent a { color: rgba(255,255,255,.85); }

.btn--prospect-cta {
    padding: 15px 28px;
    background: var(--color-cta);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(207,46,46,.3);
    transition: opacity .2s, transform .1s;
}
.btn--prospect-cta:hover:not(:disabled) { opacity: .9; transform: translateY(-1px); }
.btn--prospect-cta:disabled { opacity: .55; cursor: not-allowed; }

/* Succès dans le modal */
.prospect-modal__success { text-align: center; padding: 12px 0; }
.prospect-modal__success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(99,214,115,.18);
    color: #63d673;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
}
.prospect-modal__success-msg  { font-size: 17px; font-weight: 600; margin: 0 0 8px; }
.prospect-modal__success-sub  { font-size: 13px; color: rgba(255,255,255,.65); margin: 0; }

.btn--cta-email {
    width: 100%;
    max-width: 440px;
    padding: 18px 28px;
    font-size: 17px;
    font-weight: 800;
    border-radius: 14px;
    background: var(--color-accent);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(67,85,238,.3);
    transition: opacity .2s, transform .2s;
    letter-spacing: .01em;
}
.btn--cta-email:hover { opacity: .9; transform: translateY(-2px); }
.btn--cta-email:active { transform: translateY(0); }

.btn--cta-restart {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 14px 28px;
    cursor: pointer;
    transition: color .2s, border-color .2s;
}
.btn--cta-restart:hover { color: var(--color-accent); border-color: var(--color-accent); }

/* Zone email (repliable) */
.email-wrap {
    padding: 0 24px 24px;
    background: var(--color-bg);
}

/* --- 3-column results layout ------------------------------ */
.checks-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 8px;
}

.checks-col {
    background: var(--color-surface);
    border-radius: 10px;
    border: 1px solid var(--color-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.checks-col--ok      { border-top: 3px solid var(--color-pass); }
.checks-col--warning { border-top: 3px solid var(--color-warn); }
.checks-col--fail    { border-top: 3px solid var(--color-fail); }

.checks-col__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-border);
    font-size: 13px;
    font-weight: 600;
    background: var(--color-bg);
}

.checks-col--ok      .checks-col__header { color: var(--color-pass); }
.checks-col--warning .checks-col__header { color: var(--color-warn); }
.checks-col--fail    .checks-col__header { color: var(--color-fail); }

.checks-col__icon { font-size: 16px; }

.checks-col__title { flex: 1; }

.checks-col__count {
    font-size: 11px;
    font-weight: 700;
    opacity: .65;
    background: rgba(0,0,0,.07);
    border-radius: 10px;
    padding: 2px 7px;
}

.checks-col__body {
    flex: 1;
    padding: 6px 0;
}

.checks-col__empty {
    padding: 16px 14px;
    font-size: 12px;
    color: var(--color-muted);
    text-align: center;
    font-style: italic;
}

/* Compact check row (used inside columns) */
.check-row-slim {
    padding: 7px 14px;
    border-bottom: 1px solid rgba(0,0,0,.05);
    transition: background .15s;
}

.check-row-slim:last-child { border-bottom: none; }

.check-row-slim:hover { background: rgba(0,0,0,.03); }

.check-row-slim__label {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text);
}

.check-row-slim .check-value   { font-size: 11px; }
.check-row-slim .check-message { font-size: 11px; margin-top: 2px; }
.check-row-slim .check-details { margin-top: 4px; }
.check-row-slim .check-details li { font-size: 11px; }


/* --- Progression checks avancés --------------------------- */
.adv-progress {
    margin-top: 14px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 12px 16px;
}

.adv-progress__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.adv-progress__bar-wrap {
    flex: 1;
    height: 5px;
    background: var(--color-border);
    border-radius: 3px;
    overflow: hidden;
}

.adv-progress__bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent), #4d87b0);
    border-radius: 3px;
    transition: width .5s cubic-bezier(.4,0,.2,1);
}

.adv-progress__label {
    font-size: 12px;
    color: var(--color-muted);
    white-space: nowrap;
    font-family: 'Fira Code', monospace;
}

.adv-progress__checks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
}

.adv-progress__item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--color-muted);
    transition: color .2s;
}

.adv-progress__item-icon { font-size: 13px; }

.adv-progress__item--pass    { color: var(--color-pass); }
.adv-progress__item--info    { color: var(--color-info); }
.adv-progress__item--warning { color: var(--color-warn); }
.adv-progress__item--fail    { color: var(--color-fail); }

/* --- Responsive ------------------------------------------- */
@media (max-width: 600px) {
    .tab-btn__label { display: none; }
}
@media (max-width: 1100px) {
    .checks-columns { grid-template-columns: 1fr; }
}

/* ─── Responsive header ───────────────────────────────────────────────────── */
@media (max-width: 860px) {
    /* Les liens de nav sont dupliqués dans le dropdown — on les masque */
    .header-nav-link { display: none; }
    .app-header { padding: 0 16px; gap: 10px; }
}

@media (max-width: 480px) {
    .app-header__badge   { display: none; }
    .app-header__divider { display: none; }
    .header-user__name   { display: none; }
}

@media (max-width: 600px) {
    .app-main { padding: 24px 16px 60px; }
    .results-header { flex-direction: column; align-items: flex-start; }
    .form-row { flex-direction: column; }
    .form-input { min-width: unset; }
}

/* ── Bande de vignettes en bas ───────────────────────────────── */
.page-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 14px 16px 12px;
    border-top: 1px solid var(--color-border);
    background: #f4f5f9;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}
.page-strip:empty {
    display: none;
}
.page-strip__thumb {
    flex-shrink: 0;
    margin: 0;
    text-align: center;
}
.page-strip__thumb img {
    display: block;
    height: 200px;
    width: auto;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    box-shadow: 0 1px 5px rgba(0,0,0,.14);
}
.page-strip__thumb figcaption {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-muted);
    margin-top: 7px;
    letter-spacing: .01em;
}
.page-strip__more {
    flex-shrink: 0;
    align-self: center;
    font-size: 12px;
    color: var(--color-muted);
    padding: 0 8px;
}

/* Vignettes avec anomalies */
.page-strip__thumb--fail img {
    border-color: var(--color-fail, #dc2626);
    border-width: 2px;
    box-shadow: 0 0 0 1px var(--color-fail, #dc2626), 0 2px 6px rgba(220,38,38,.25);
}
.page-strip__thumb--warning img {
    border-color: var(--color-warn, #d97706);
    border-width: 2px;
    box-shadow: 0 0 0 1px var(--color-warn, #d97706), 0 2px 6px rgba(217,119,6,.2);
}
.page-strip__thumb--fail figcaption::before {
    content: '● ';
    color: var(--color-fail, #dc2626);
}
.page-strip__thumb--warning figcaption::before {
    content: '● ';
    color: var(--color-warn, #d97706);
}

/* Liste des anomalies sous chaque vignette concernée */
.page-strip__issues {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    text-align: left;
    width: max-content;
    max-width: 200px;
}
.page-strip__issues li {
    font-size: 11px;
    font-weight: 500;
    line-height: 1.5;
    white-space: normal;
    word-break: break-word;
    padding: 2px 4px 2px 18px;
    position: relative;
    border-radius: 4px;
    margin-bottom: 2px;
}
.page-strip__issues li::before {
    content: '!';
    font-size: 9px;
    font-weight: 800;
    position: absolute;
    left: 5px;
    top: 3px;
}
.page-strip__issues--fail li {
    color: var(--color-fail, #dc2626);
    background: rgba(220,38,38,.07);
}
.page-strip__issues--warning li {
    color: #92400e;
    background: rgba(217,119,6,.08);
}

/* ─── Header — zone utilisateur ──────────────────────────────────────────── */

.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    flex-shrink: 0;
}
.header-user--push { margin-left: auto; }

.header-nav-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-muted);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.header-nav-link:hover,
.header-nav-link--active {
    background: var(--color-bg);
    color: var(--color-text);
}

/* Trigger (avatar + nom) */
.header-user__trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius);
    transition: background var(--transition);
    user-select: none;
}
.header-user__trigger:hover { background: var(--color-bg); }

.header-user__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-accent);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.header-user__avatar img { width: 100%; height: 100%; object-fit: cover; }

.header-user__name {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.header-user__caret { font-size: 10px; color: var(--color-muted); }

/* Dropdown */
.header-user__dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    min-width: 200px;
    overflow: hidden;
    z-index: 200;
}
.header-user--open .header-user__dropdown { display: block; }

.header-user__email {
    padding: 10px 14px 8px;
    font-size: 11px;
    color: var(--color-muted);
    border-bottom: 1px solid var(--color-border);
    word-break: break-all;
}
.header-user__item {
    display: block;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--color-text);
    text-decoration: none;
    transition: background var(--transition);
}
.header-user__item:hover { background: var(--color-bg); text-decoration: none; }
.header-user__item--danger { color: var(--color-fail); }

/* Boutons header (non connecté) */
.btn--login {
    font-size: 13px;
    padding: 6px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    background: transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition), border-color var(--transition);
}
.btn--login:hover { background: var(--color-bg); border-color: var(--color-accent); text-decoration: none; }

.btn--register {
    font-size: 13px;
    padding: 6px 14px;
    border-radius: var(--radius);
    background: var(--color-accent);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    transition: opacity var(--transition);
}
.btn--register:hover { opacity: .88; text-decoration: none; }

/* ─── Pages auth (login / register) ─────────────────────────────────────── */

.auth-page {
    background: linear-gradient(135deg, #001a33 0%, var(--color-accent) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.auth-wrap {
    width: 100%;
    max-width: 440px;
}

.auth-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    box-shadow: 0 16px 48px rgba(0,0,0,.25);
    box-sizing: border-box;
}
@media (max-width: 480px) {
    .auth-card { padding: 28px 20px; }
}
@media (max-width: 768px) {
    .auth-features { grid-template-columns: 1fr !important; }
}

.auth-card__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    justify-content: center;
}

.auth-card__title {
    font-size: 22px;
    font-weight: 800;
    color: var(--color-text);
    text-align: center;
    margin-bottom: 6px;
}
.auth-card__sub {
    font-size: 13px;
    color: var(--color-muted);
    text-align: center;
    margin-bottom: 24px;
}

.auth-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 18px;
}

.auth-form { display: flex; flex-direction: column; gap: 14px; }

.form-group { display: flex; flex-direction: column; gap: 5px; }

.form-label { font-size: 13px; font-weight: 500; color: var(--color-text); }
.form-required { color: var(--color-cta); }
.form-hint { font-size: 11px; color: var(--color-muted); }

.auth-form__separator {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    border-top: 1px solid var(--color-border);
    padding-top: 14px;
    margin-top: 4px;
}

.btn--auth-cta {
    width: 100%;
    padding: 12px;
    background: var(--color-cta);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 6px;
    transition: opacity var(--transition);
}
.btn--auth-cta:hover { opacity: .88; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--color-muted);
    font-size: 12px;
}
.auth-divider::before,
.auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--color-border); }

.btn--google {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    cursor: pointer;
    transition: background var(--transition), box-shadow var(--transition);
}
.btn--google:not(:disabled):hover { background: #f8faff; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.btn--google:disabled { opacity: .5; cursor: not-allowed; }

.auth-card__subtitle {
    font-size: 13px;
    color: var(--color-muted);
    margin: -8px 0 20px;
    line-height: 1.5;
}

.auth-card__footer {
    text-align: center;
    font-size: 13px;
    color: var(--color-muted);
    margin-top: 20px;
}
.auth-card__footer a { color: var(--color-accent); font-weight: 500; }

.auth-card__consent {
    font-size: 11px;
    color: var(--color-muted);
    text-align: center;
    line-height: 1.5;
    margin-top: 4px;
}

.auth-consent-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    color: var(--color-muted);
    line-height: 1.5;
    cursor: pointer;
    margin-bottom: 16px;
}
.auth-consent-check input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    accent-color: var(--color-accent);
    cursor: pointer;
}
.auth-consent-check a {
    color: var(--color-accent);
    text-decoration: underline;
}

/* ── Modale d'authentification inline ──────────────────────────────────────── */

.auth-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.52);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.auth-modal-overlay--visible {
    display: flex;
}

.auth-modal {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 40px rgba(0,0,0,.22);
    padding: 32px 28px 24px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.auth-modal__close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--color-muted);
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background var(--transition);
}
.auth-modal__close:hover { background: var(--color-bg); color: var(--color-text); }

.auth-modal__intro {
    font-size: 13px;
    color: var(--color-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

.auth-modal-tabs {
    display: flex;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 20px;
}
.auth-modal-tab {
    flex: 1;
    padding: 9px 12px;
    font-size: 14px;
    font-weight: 500;
    background: none;
    border: none;
    color: var(--color-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color var(--transition), border-color var(--transition);
}
.auth-modal-tab--active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

.auth-modal-form--hidden { display: none !important; }

/* ── Page Mon compte ────────────────────────────────────────────────────────── */

.account-page .app-main { padding: 32px 16px; }

.account-wrap {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow: hidden;
}

.account-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 28px 28px 24px;
}

/* ── Sections "interne" (non visibles client) ──────────────────────────────
   A appliquer sur tout bloc qui n'est pas affiche aux comptes user_type=client
   (Applivision, Achats associes, marges, cout matiere, etc.). Visuel : bord
   gauche indigo + leger fond teinte + badge automatique en haut a droite. */
.section-internal {
    background: var(--color-internal-bg);
    border-left: 4px solid var(--color-internal);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 16px;
    position: relative;
}
.section-internal::before {
    content: "🔒 interne";
    position: absolute;
    top: 8px; right: 12px;
    font-size: 10px;
    font-weight: 700;
    color: var(--color-internal);
    background: var(--color-surface);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid var(--color-internal-border);
    letter-spacing: .03em;
}
.section-internal h3,
.section-internal summary {
    margin-top: 0;
}
/* ── Sections prépresse ───────────────────────────────────── */
.prepresse-section { margin-bottom: 40px; }
.prepresse-section__title {
    font-size: 17px; font-weight: 800; color: var(--color-text); margin-bottom: 16px;
    display: flex; align-items: center; gap: 10px;
}
.prepresse-section__count {
    font-size: 12px; font-weight: 700; background: var(--color-accent); color: #fff;
    padding: 2px 10px; border-radius: 12px;
}

/* ── Status cards (cliquables) ────────────────────────────── */
.status-cards { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.status-card {
    display: flex; align-items: center; gap: 16px; padding: 20px 24px;
    border-radius: 10px; cursor: pointer; transition: box-shadow .15s, border-color .15s;
    text-decoration: none; color: inherit;
}
.status-card__icon { font-size: 32px; flex-shrink: 0; }
.status-card__label { font-size: 15px; font-weight: 700; }
.status-card__count { font-size: 13px; opacity: .7; margin-left: 4px; }
.status-card--empty { opacity: .4; cursor: default; }

.status-detail { display: none; margin-bottom: 24px; }
.status-detail--active { display: block; }
.status-detail__back {
    font-size: 13px; color: var(--color-muted); cursor: pointer;
    background: none; border: none; padding: 0; margin-bottom: 12px;
}
.status-detail__back:hover { color: var(--color-text); }

/* ── Grille cartes commandes (masonry) ────────────────────── */
.order-cards { columns: 3 240px; column-gap: 12px; }
.order-cards .order-card {
    break-inside: avoid; border: 1px solid var(--color-border); border-radius: 10px;
    padding: 18px 20px; background: var(--color-surface); margin-bottom: 12px;
    transition: box-shadow .15s, border-color .15s;
}
.order-cards .order-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.order-card__id { font-size: 15px; font-weight: 800; color: var(--color-text); margin-bottom: 4px; }
.order-card__ref { font-size: 13px; color: var(--color-muted); margin-bottom: 4px; line-height: 1.4; }
.order-card__tag {
    font-size: 11px; padding: 3px 10px; border-radius: 12px;
    background: #f3f4f6; color: var(--color-text); font-weight: 500;
}
.order-card__action {
    font-size: 12px; font-weight: 600; color: var(--color-accent); text-decoration: none;
}
.order-card__action:hover { text-decoration: underline; }

/* ── Home grid 3×2 ────────────────────────────────────────── */
.home-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.home-grid__link,
.home-grid__link:hover,
.home-grid__link:focus {
    text-decoration: none;
    color: inherit;
}
.home-card--active {
    cursor: pointer;
    transition: box-shadow .15s, border-color .15s;
}
/* Hover uniquement sur les appareils avec un vrai pointeur (pas tactile).
   Sur mobile, :hover forcait un "premier tap = hover / second tap = click". */
@media (hover: hover) {
    .home-grid__link:hover .home-card--active {
        box-shadow: 0 6px 24px rgba(0,59,102,.12);
        border-color: var(--color-accent) !important;
    }
}
@media (max-width: 1024px) {
    .home-grid { grid-template-columns: repeat(2, 1fr); }
}
.home-card {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
    padding: 20px !important;
}
.home-card__icon {
    font-size: 28px !important;
}
@media (max-width: 768px) {
    .home-grid { grid-template-columns: 1fr; }
}
.search-btn-icon { display: none; }
@media (max-width: 640px) {
    .search-btn-text { display: none; }
    .search-btn-icon { display: inline; }
}
/* ── Sections mois (commandes, livraisons, POD) ─────────────────────────────── */
.month-group { margin-bottom: 12px; }
.month-group > summary {
    cursor: pointer; font-size: 13px; font-weight: 700;
    padding: 8px 12px; background: #f9fafb; border-radius: 6px;
    list-style: none; display: flex; align-items: center; gap: 8px;
}
.month-group > summary::-webkit-details-marker { display: none; }
.month-group > summary .month-group__count { font-weight: 400; opacity: .7; }

/* ── Cards (commandes, livraisons, POD) ──────────────────────────────────────── */
.card-columns { columns: 3 260px; column-gap: 12px; }
.card-item {
    break-inside: avoid; border: 1px solid var(--color-border); border-radius: 10px;
    padding: 18px 20px; background: var(--color-surface); margin-bottom: 12px;
    transition: box-shadow .15s, border-color .15s;
}
.card-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); border-color: var(--color-process-border); }

/* Carte de commande en transmission partielle (apparaît dans les 2 sections
   "Fichiers à transmettre" + "En cours prépresse" avec une signalisation
   visuelle distincte). */
.card-item--partial {
    border-color: #f59e0b;
    border-width: 2px;
}
.card-item--partial:hover { border-color: #d97706; }
.card-item__partial-banner {
    margin: -18px -20px 12px;
    padding: 6px 14px;
    background: linear-gradient(90deg, #fef3c7, #fffbeb);
    color: #92400e;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #fde68a;
}
.card-item__cmd,
.card-item__id { font-size: 15px; font-weight: 800; color: var(--color-heading); margin-bottom: 2px; }
.card-item__ref { font-size: 13px; color: var(--color-muted); margin-bottom: 4px; line-height: 1.4; }
.card-item__client { font-size: 12px; color: var(--color-muted); margin-bottom: 10px; }
.card-item__meta { display: flex; flex-wrap: wrap; gap: 6px; }
.card-item__tag {
    font-size: 11px; padding: 3px 10px; border-radius: 12px;
    background: #f3f4f6; color: var(--color-text); font-weight: 500;
}
.card-item__action {
    display: inline-block; margin-top: 12px; font-size: 12px; font-weight: 600;
    color: var(--color-primary, #1a73e8);
}
.card-item__bl {
    margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--color-border);
}
.card-item__bl-tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 12px; background: #e0e7ff; color: #4338ca;
    font-weight: 600; font-size: 11px; margin-right: 6px; margin-bottom: 4px;
}

/* ── Profil incomplet ────────────────────────────────────────────────────────── */
.profile-incomplete-bar {
    background: #fffbeb;
    border-bottom: 1px solid #f59e0b;
    padding: 8px 24px;
    font-size: 13px;
    color: #92400e;
    text-align: center;
}
.profile-incomplete-bar a {
    color: #92400e;
    font-weight: 600;
    text-decoration: underline;
    margin-left: 4px;
}
.profile-incomplete-banner {
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 13px;
    color: #92400e;
    margin-bottom: 16px;
}

.account-card__title {
    font-size: 17px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 20px;
}
.account-card__subtitle {
    font-size: 14px;
    color: var(--color-muted);
    margin: -12px 0 20px;
    line-height: 1.5;
}

.auth-success {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 16px;
}

.account-empty {
    color: var(--color-muted);
    font-size: 14px;
    text-align: center;
    padding: 24px 0;
}

.account-table-wrap {
    overflow-x: auto;
}

.account-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.account-table th {
    text-align: left;
    color: var(--color-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 0 12px 10px 0;
    border-bottom: 1px solid var(--color-border);
}
.account-table td {
    padding: 10px 12px 10px 0;
    border-bottom: 1px solid var(--color-bg);
    vertical-align: middle;
}
.account-table tr:last-child td { border-bottom: none; }

.account-table__filename {
    font-weight: 500;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-table__date { color: var(--color-muted); white-space: nowrap; }

.account-table__actions { white-space: nowrap; }

.account-link {
    display: inline-block;
    margin-right: 8px;
    font-size: 12px;
    color: var(--color-accent);
    text-decoration: none;
    padding: 2px 8px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    transition: background var(--transition);
}
.account-link:hover { background: var(--color-bg); }
.account-link--danger {
    background: none;
    border: none;
    cursor: pointer;
    color: #dc2626;
    padding: 0;
    margin: 0;
    font-family: inherit;
}
.account-link--danger:hover { background: #fee2e2; color: #991b1b; }

.account-score {
    font-weight: 700;
    font-size: 13px;
}
.account-score--pass    { color: var(--color-pass); }
.account-score--warning { color: var(--color-warn); }
.account-score--fail    { color: var(--color-fail); }

.account-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}
.account-badge--pass    { background: #dcfce7; color: #15803d; }
.account-badge--warning { background: #fef3c7; color: #92400e; }
.account-badge--fail    { background: #fee2e2; color: #991b1b; }

.header-user__item--active {
    font-weight: 600;
    color: var(--color-accent);
}

/* --- Réassurance technique secondaire (hero) --------------- */
.upload-hero__tech-reassurance {
    font-size: 11px;
    color: var(--color-muted);
    line-height: 1.55;
    padding: 8px 12px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

/* --- Hero 2 colonnes --------------------------------------- */
.hero-grid {
    display: grid;
    grid-template-columns: 55% 45%;
    gap: 36px;
    align-items: start;
}
.hero-grid__left {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.hero-grid__right {
    display: flex;
    flex-direction: column;
}

/* Drop zone compacte dans le hero */
.hero-grid__right .drop-zone {
    padding: 26px 20px;
}

/* --- Micro-réassurance sous le CTA ------------------------- */
.hero-micro-reassurance {
    font-size: 12px;
    color: var(--color-muted);
    text-align: center;
    margin-top: 8px;
    margin-bottom: 2px;
}

/* --- Mockup aperçu rapport --------------------------------- */
.report-mockup {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-top: 12px;
    font-size: 13px;
}

.report-mockup__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    font-size: 11px;
    font-weight: 600;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.report-mockup__status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-pass);
    flex-shrink: 0;
}

.report-mockup__body {
    padding: 0;
}

.report-mockup__score {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--color-border);
}

.report-mockup__score-value {
    font-size: 30px;
    font-weight: 800;
    color: var(--color-warn);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.03em;
}

.report-mockup__score-label {
    font-size: 14px;
    color: var(--color-muted);
    font-weight: 500;
}

.report-mockup__score-tag {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(217,119,6,.1);
    color: var(--color-warn);
}

.report-mockup__rows {
    list-style: none;
    padding: 10px 16px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    border-bottom: 1px solid var(--color-border);
}

.report-mockup__row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
}

.report-mockup__row-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.report-mockup__row--fail { color: var(--color-fail); }
.report-mockup__row--fail .report-mockup__row-dot { background: var(--color-fail); }
.report-mockup__row--warn { color: var(--color-warn); }
.report-mockup__row--warn .report-mockup__row-dot { background: var(--color-warn); }
.report-mockup__row--pass { color: var(--color-pass); }
.report-mockup__row--pass .report-mockup__row-dot { background: var(--color-pass); }

.report-mockup__footer {
    padding: 8px 16px 10px;
    font-size: 11px;
    color: var(--color-muted);
}

.report-mockup__footer code {
    font-family: 'Fira Code', monospace;
    background: rgba(0,0,0,.05);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 10px;
}

/* --- Responsive hero grid ---------------------------------- */
@media (max-width: 860px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .hero-grid__right .drop-zone {
        padding: 30px 20px;
    }
}

@media (max-width: 640px) {
    .report-mockup { display: none; }
}

/* --- Sections homepage (mode libre) ------------------------ */
.homepage-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 36px 48px;
    margin: 0 auto 20px;
    max-width: 1100px;
    box-shadow: var(--shadow);
}

.homepage-section--highlight {
    background: rgba(0,59,102,.04);
    border-color: rgba(0,59,102,.18);
}

.homepage-section__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -.02em;
    margin-bottom: 20px;
}

.homepage-section__text p {
    font-size: 15px;
    color: var(--color-muted);
    line-height: 1.7;
    margin-bottom: 10px;
}
.homepage-section__text p:last-child { margin-bottom: 0; }

.homepage-section__empty {
    font-size: 14px;
    color: var(--color-muted);
}

/* ── Dernières analyses (homepage connecté) ───────────────── */
.last-analyses {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.last-analysis-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 13px;
}
.last-analysis__filename {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    color: var(--color-text);
}
.last-analysis__date {
    color: var(--color-muted);
    white-space: nowrap;
    font-size: 12px;
}
.last-analysis__actions { white-space: nowrap; }
.last-analyses__more {
    margin-top: 12px;
    font-size: 13px;
}
.last-analyses__more a {
    color: var(--color-accent);
    font-weight: 500;
    text-decoration: none;
}
.last-analyses__more a:hover { text-decoration: underline; }

.homepage-section__text-single {
    font-size: 15px;
    color: var(--color-muted);
    line-height: 1.7;
}

/* --- Grilles homepage -------------------------------------- */
.homepage-grid {
    display: grid;
    gap: 16px;
}
.homepage-grid--3 { grid-template-columns: repeat(3, 1fr); }
.homepage-grid--4 { grid-template-columns: repeat(4, 1fr); }

/* --- Carte homepage ---------------------------------------- */
.homepage-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px 22px;
}

.homepage-card--steps {
    text-align: center;
    padding: 24px 20px;
}

.homepage-card__step {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-accent);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

.homepage-card__title {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 8px;
}

.homepage-card__desc {
    font-size: 13px;
    color: var(--color-muted);
    line-height: 1.5;
    margin: 0;
}

/* --- CTA final --------------------------------------------- */
.homepage-cta-final {
    background: var(--color-accent);
    border-radius: var(--radius-lg);
    padding: 48px;
    text-align: center;
    margin: 0 auto 20px;
    max-width: 1100px;
}

.homepage-cta-final__title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
    letter-spacing: -.02em;
}

.homepage-cta-final__desc {
    font-size: 15px;
    color: rgba(255,255,255,.8);
    margin-bottom: 28px;
    line-height: 1.6;
}

.btn--cta-final {
    display: inline-block;
    width: auto;
    padding: 16px 40px;
    font-size: 16px;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(207,46,46,.4);
}

/* --- Sous-texte modale auth -------------------------------- */
.auth-modal__intro-sub {
    font-size: 12px;
    color: var(--color-muted);
    text-align: center;
    margin-top: -8px;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* --- Responsive homepage sections -------------------------- */
@media (max-width: 900px) {
    .homepage-grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .homepage-section { padding: 28px 24px; }
    .homepage-grid--3,
    .homepage-grid--4 { grid-template-columns: 1fr; }
    .homepage-cta-final { padding: 32px 24px; }
    .btn--cta-final { display: block; width: 100%; }
}

/* ============================================================
   ADMIN
   ============================================================ */

.admin-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 64px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Stat cards */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

@media (max-width: 1000px) { .admin-stats-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px)  { .admin-stats-grid { grid-template-columns: repeat(2, 1fr); } }

.admin-stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    text-align: center;
    box-shadow: var(--shadow);
}

.admin-stat-card__value {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-accent);
    letter-spacing: -.02em;
    line-height: 1;
    margin-bottom: 6px;
}

.admin-stat-card__label {
    font-size: 12px;
    color: var(--color-muted);
    font-weight: 500;
}

/* Stats columns (day/week/month) */
.admin-stats-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 4px;
}

@media (max-width: 800px) { .admin-stats-cols { grid-template-columns: 1fr; } }

.admin-section-subtitle {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-muted);
    margin-bottom: 10px;
}

/* Mini bar table */
.admin-mini-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-mini-table tr + tr td { padding-top: 5px; }

.admin-mini-table__label {
    font-size: 12px;
    color: var(--color-muted);
    white-space: nowrap;
    padding-right: 10px;
    font-family: 'Fira Code', monospace;
    min-width: 90px;
}

.admin-mini-table__bar { width: 100%; padding-right: 8px; }

.admin-mini-table__count {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text);
    white-space: nowrap;
    text-align: right;
    min-width: 28px;
}

/* Bar component */
.admin-bar {
    height: 8px;
    background: rgba(0,0,0,.07);
    border-radius: 100px;
    overflow: hidden;
}

.admin-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent), #4d87b0);
    border-radius: 100px;
    transition: width .4s ease;
    min-width: 3px;
}

/* User admin badges */
.admin-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    border: none;
    cursor: default;
}

button.admin-badge {
    cursor: pointer;
    transition: opacity .15s;
}

button.admin-badge:hover { opacity: .8; }

.admin-badge--admin { background: rgba(0,59,102,.12); color: var(--color-accent); }
.admin-badge--user  { background: rgba(0,0,0,.06);    color: var(--color-muted); }
.admin-badge--self  { background: rgba(22,163,74,.1); color: var(--color-pass); }

/* Users table specific */
.admin-users-table { min-width: 900px; }

/* Surveys */
.admin-surveys-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 20px;
}

@media (max-width: 700px) { .admin-surveys-cols { grid-template-columns: 1fr; } }

.admin-survey-row {
    display: grid;
    grid-template-columns: 220px 1fr 36px;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

@media (max-width: 900px) {
    .admin-survey-row { grid-template-columns: 1fr 80px 32px; }
    .admin-survey-row__label { font-size: 11px; }
}

.admin-survey-row__label {
    font-size: 13px;
    color: var(--color-text);
    font-weight: 500;
}

.admin-survey-row__count {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-accent);
    text-align: right;
}

.admin-survey-others__list {
    margin: 4px 0 0 16px;
    font-size: 13px;
    color: var(--color-muted);
    line-height: 1.8;
}

.admin-survey-detail {
    border-top: 1px solid var(--color-border);
    padding-top: 16px;
    margin-top: 4px;
}

.admin-survey-detail summary {
    font-size: 13px;
    color: var(--color-muted);
    cursor: pointer;
    font-weight: 500;
    user-select: none;
}

.admin-survey-detail summary:hover { color: var(--color-text); }

/* Disk usage */
.admin-disk-table { max-width: 600px; }
/* Vérification email */
.verify-email-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-lg);
    padding: 14px 20px;
    flex-wrap: wrap;
}

.verify-email-banner__text {
    flex: 1;
    font-size: 13px;
    color: #1e40af;
    line-height: 1.5;
    min-width: 200px;
}

.verify-email-banner__btn {
    background: #1d4ed8;
    color: #fff;
    white-space: nowrap;
}

.verify-email-banner__btn:hover:not(:disabled) { opacity: .88; }

.verify-gate { text-align: center; }

.verify-gate__icon {
    font-size: 36px;
    margin-bottom: 12px;
    display: block;
}

.auth-card--verify { text-align: center; }

.verify-pending__icon {
    font-size: 48px;
    margin-bottom: 8px;
    display: block;
}

.admin-disk-table .admin-mini-table__label { min-width: 260px; font-family: inherit; font-size: 13px; }
.admin-disk-total td { padding-top: 10px; border-top: 1px solid var(--color-border); }

/* Uploads toolbar */
.admin-uploads-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.admin-uploads-selall {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--color-muted);
    cursor: pointer;
    user-select: none;
}

.btn--sm {
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: opacity .15s;
}

.btn--sm:disabled { opacity: .4; cursor: not-allowed; }

.btn--danger {
    background: var(--color-fail);
    color: #fff;
}

/* ── Orders tree ─────────────────────────────────────────────────────────────*/
.otree { display: flex; flex-direction: column; gap: 6px; }

.otree__email {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.otree__email-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-accent);
    background: var(--color-bg);
    list-style: none;
    user-select: none;
}
.otree__email-summary::-webkit-details-marker { display: none; }
.otree__email-summary::before {
    content: '›';
    font-size: 16px;
    transition: transform .2s;
    display: inline-block;
    width: 14px;
    color: var(--color-muted);
}
.otree__email[open] > .otree__email-summary::before { transform: rotate(90deg); }
.otree__email-summary:hover { background: var(--color-border); }

.otree__email-addr { flex: 1; }

.otree__count {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-muted);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: 2px 10px;
}

.otree__cmd-list {
    padding: 8px 12px 12px 28px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
}
.otree__cmd-list--flat {
    padding: 0;
    border-top: none;
    background: transparent;
}

.otree__cmd {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.otree__cmd-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    cursor: pointer;
    font-size: 13px;
    list-style: none;
    user-select: none;
    background: var(--color-bg);
}
.otree__cmd-summary::-webkit-details-marker { display: none; }
.otree__cmd-summary::before {
    content: '›';
    font-size: 14px;
    transition: transform .2s;
    display: inline-block;
    width: 12px;
    color: var(--color-muted);
}
.otree__cmd[open] > .otree__cmd-summary::before { transform: rotate(90deg); }
.otree__cmd-summary:hover { background: var(--color-border); }

.otree__cmd-info {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.otree__cmd-num {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    margin-right: 6px;
}

.otree__cmd-ref {
    font-size: 13px;
    font-weight: 400;
    color: var(--color-muted);
}

.otree__cmd-product {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
}

.otree__cmd-meta {
    font-size: 12px;
    color: var(--color-muted);
}

.otree__detail {
    padding: 12px 16px;
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.otree__order-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    font-size: 13px;
    color: var(--color-text);
}

.otree__comp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}
.otree__comp-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--color-muted);
    padding: 6px 10px;
    border-bottom: 1px solid var(--color-border);
}
.otree__comp-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}
.otree__comp-table tr:last-child td { border-bottom: none; }
.otree__comp-table tr:hover td { background: var(--color-bg); }

/* Color badges */
.otree-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.otree-badge--cmyk  { background: #dbeafe; color: #1d4ed8; }
.otree-badge--gray  { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }
.otree-badge--spot  { background: #fef3c7; color: #b45309; }
.otree-badge--none  { color: var(--color-muted); }

@media (max-width: 640px) {
    .otree__cmd-list { padding: 10px; }

    /* Masquer l'en-tête du tableau */
    .otree__comp-table thead { display: none; }

    /* Chaque ligne devient une card */
    .otree__comp-table,
    .otree__comp-table tbody,
    .otree__comp-table tr { display: block; width: 100%; }

    .otree__comp-table tr {
        border: 1px solid var(--color-border);
        border-radius: var(--radius);
        margin-bottom: 10px;
        padding: 10px 12px;
        background: var(--color-surface);
    }
    .otree__comp-table tr:last-child { margin-bottom: 0; }

    /* Chaque cellule sur sa propre ligne avec label à gauche */
    .otree__comp-table td {
        display: flex;
        align-items: baseline;
        gap: 8px;
        padding: 4px 0;
        border-bottom: none;
        font-size: 13px;
    }
    /* Masquer les cellules vides (label vide + contenu vide) */
    .otree__comp-table td:empty { display: none; }

    .otree__comp-table td[data-label]::before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: .04em;
        color: var(--color-muted);
        min-width: 80px;
        flex-shrink: 0;
    }
    /* Cellule bouton "Tester" : centrée sous la card */
    .otree__comp-table td[data-label=""] {
        justify-content: flex-end;
        margin-top: 6px;
        padding-top: 8px;
        border-top: 1px solid var(--color-border);
    }
    .otree__comp-table td[data-label=""]::before { display: none; }
}

.btn--danger:hover:not(:disabled) { opacity: .85; }

/* ── Info link [i] ──────────────────────────────────────────────────────── */
/* Icone ronde 'i' a coter d'un n° dossier ou nom client. Cliquable pour
   ouvrir la page detail correspondante. Utilisee partout via le helper
   PHP info_icon_order() / info_icon_client() dans includes/info_icon.php. */
.q-info-link {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px;
    margin-left: 6px;
    border: 1px solid var(--color-border, #d1d5db);
    border-radius: 50%;
    color: var(--color-accent, #003b66);
    background: #fff;
    text-decoration: none;
    font-family: serif;
    font-style: italic;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.q-info-link:hover {
    background: var(--color-accent, #003b66);
    color: #fff;
    text-decoration: none;
}

/* ── Badge structure (O5 / C36) ─────────────────────────────────────────── */
/* Affichage rond a cote d'un dossier/facture/livraison pour identifier la
   structure. Utilise via le helper PHP info_struct(\$structure). */
.q-struct-badge {
    display: inline-block;
    padding: 2px 7px;
    margin-left: 6px;
    border-radius: 10px;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    line-height: 1.4;
    vertical-align: middle;
    user-select: none;
}
.q-struct-badge--O5  { background: #003b66; }
.q-struct-badge--C36 { background: #0b5345; }

/* ── Toggle filtre structure (header) ───────────────────────────────────── */
/* 3 boutons O5 / C36 / Tous dans le header, persiste en session. Visible
   uniquement aux users ayant acces a >1 structure. */
.q-struct-toggle {
    display: inline-flex;
    border: 1px solid var(--color-border, #d1d5db);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}
.q-struct-toggle__btn {
    padding: 6px 12px;
    background: #fff;
    color: var(--color-muted, #6b7285);
    text-decoration: none;
    border-right: 1px solid var(--color-border, #d1d5db);
    transition: background .15s, color .15s;
}
.q-struct-toggle__btn:last-child { border-right: 0; }
.q-struct-toggle__btn:hover {
    background: #f3f4f6;
    color: var(--color-fg, #1a1d2e);
    text-decoration: none;
}
.q-struct-toggle__btn--active {
    background: var(--color-accent, #003b66);
    color: #fff;
}
.q-struct-toggle__btn--active.q-struct-toggle__btn--c36 {
    background: #0b5345;
}
.q-struct-toggle__btn--active:hover {
    background: var(--color-accent, #003b66);
    color: #fff;
}
.q-struct-toggle__btn--active.q-struct-toggle__btn--c36:hover {
    background: #0b5345;
}
