﻿@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

/******************************************/

.etapes-scroll {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: thin;
    -ms-overflow-style: none;
    padding-bottom: 0.5rem;
}

    .etapes-scroll::-webkit-scrollbar {
        height: 6px;
    }

.etape-block {
    min-width: 220px;
    max-width: 240px;
    flex: 0 0 auto;
    margin-right: 6px;
    text-align: center;
}

.etape-icon {
    width: 48px; /* ↑ taille icône */
    height: 48px;
    font-size: 24px; /* ↑ taille emoji */
    margin-bottom: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 0 3px rgba(0,0,0,0.1);
}

.step-label {
    font-size: 0.75rem;
    line-height: 1.1;
    white-space: pre-line;
    margin-bottom: 4px;
    font-weight: bold; /* ← mettre en gras */
}

.ring-selected {
    box-shadow: 0 0 0 3px rgba(59,130,246,.35); /* bleu doux */
    border: 2px solid #3b82f6;
}


.panel {
    font-size: 0.8rem; /* ↑ texte dans le panneau */
    line-height: 1.3;
}

/*.panel {
    font-size: 0.7rem;
    line-height: 1.2;
    text-align: left;
    padding: 0.5rem;*/ /* Plus compact */
/*}*/

.step-title {
    font-size: 0.75rem;
    white-space: pre-line;
    word-break: break-word;
    margin-bottom: 4px;
}

.bg-done {
    background-color: #2d6cdf;
}

.bg-missing {
    background-color: #999;
}

.bg-late {
    background-color: #d93025;
}

/* ===== Steps responsive (clean, no JS) ===== */

/* ===== Steps responsive (mixte: orientation + largeur) ===== */

/* ===== Steps responsive (clean, no ::after sur cartes) ===== */
.etapes-scroll-responsive {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: thin;
    -ms-overflow-style: none;
    padding-bottom: 0.5rem;
    gap: 1rem;
}

    .etapes-scroll-responsive::-webkit-scrollbar {
        height: 6px;
    }

.etape-block-responsive {
    min-width: 160px;
    max-width: 180px;
    flex: 0 0 auto;
    text-align: center;
    padding: 0.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Arrow-step : pas de texte “dur”, uniquement via CSS */
.arrow-step {
    font-size: 0 !important;
    line-height: 0;
}

    .arrow-step::before {
        content: "→"; /* mode paysage par défaut */
        font-size: 1.5rem;
        line-height: 1;
    }

/* Empilé : flèche vers le bas */
@media (orientation: portrait) {
    .etapes-scroll-responsive {
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .etape-block-responsive {
        width: 100%;
        max-width: none;
        min-width: 100%;
    }

    .arrow-step::before {
        content: "↓";
    }
}

/* Popup fix en portrait */
@media (orientation: portrait) {
    .etapes-scroll-responsive .report-popup {
        position: static !important;
        width: auto !important;
        max-width: 100% !important;
        left: auto !important;
        top: auto !important;
    }
}


/* Portrait: flèche ↓ centrée */
@media (orientation: portrait) {
    .arrow-step {
        display: block; /* n'est plus un petit inline */
        width: 100%; /* occupe toute la ligne du conteneur flex */
        text-align: center; /* centre le contenu dans la ligne */
        margin: .5rem 0;
        font-size: 0 !important; /* masque le texte dur éventuel */
        line-height: 0;
    }

        .arrow-step::before {
            content: "↓";
            font-size: 1.5rem;
            line-height: 1;
        }
}


/* — Option A : wrap auto au lieu du scroll (décommente si tu préfères)
.etapes-scroll-responsive { flex-wrap: wrap; overflow-x: hidden; overflow-y: auto; }
.etapes-scroll-responsive > .step-clickable,
.etapes-scroll-responsive > .etape-block-responsive { flex: 1 1 18rem; }
*/

/* — Option B : container queries (plus robuste que orientation) —
.etapes-scroll-responsive { container-type: inline-size; }
@container (inline-size < 700px) {
  .etapes-scroll-responsive { flex-direction: column; overflow-y: auto; overflow-x: clip; }
  .etapes-scroll-responsive > .step-clickable,
  .etapes-scroll-responsive > .etape-block-responsive { width: 100%; flex: 0 0 auto; }
}
*/


/*.panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
    min-height: 100px;*/ /* ajuste selon besoin */
/*}*/


.panel {
    font-size: 1rem;
    line-height: 1.5;
}

.timeline-header-cell {
    white-space: nowrap;
    position: relative;
    padding-right: 1.5rem;
}

.timeline-title {
    font-weight: 600;
    display: inline-block;
}

.timeline-arrow {
    margin-left: 0.5rem;
    color: #6c757d;
    font-size: 1.1rem;
}

th.timeline-separator {
    position: relative;
    text-align: center;
    vertical-align: middle;
    padding: 0.5rem 1rem;
    font-weight: 600;
}

    /* Ajoute une flèche → entre les colonnes sauf la dernière */
    th.timeline-separator:not(:last-child)::after {
        content: "→";
        position: absolute;
        top: 50%;
        right: -10px;
        transform: translateY(-50%);
        font-size: 1.2rem;
        font-weight: 900;
        color: #333; /* Flèche foncée */
        pointer-events: none;
    }

.arrow-step {
    color: #444;
    margin-top: 10px; /* ajuste la hauteur de la flèche */
}


.selected-step {
    position: relative;
    box-shadow: 0 0 8px 4px rgba(0, 123, 255, 0.5); /* halo bleu */
    transform: scale(1.20);
    transition: box-shadow 0.2s, transform 0.2s;
    z-index: 2;
}


.etape-icon {
    transition: all 0.2s ease-in-out;
}

.selected-panel {
    background-color: #e6f7ff; /* fond bleu très doux */
    border-left: 5px solid #3399ff;
    padding-left: 1rem;
}

.selected-panel {
    background-color: #e6f7ff !important;
    border-left: 5px solid #3399ff;
}



.etape-icon-wrapper {
    position: relative;
    display: inline-block;
}

.triangle-indicator {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #3399ff;
}

.triangle-indicator-up {
    position: absolute;
    top: 100%;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #cfe2ff; /* ou autre couleur */
    transform: translateX(-50%);
    z-index: 1000;
    transition: left 0.2s ease;
}


.etape-icon {
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.status-green {
    color: #198754; /* vert */
}

.status-red {
    color: #dc3545; /* rouge */
}

.status-orange {
    color: #fd7e14; /* orange */
}

.status-gray {
    color: #6c757d; /* gris par défaut */
}


.bg-green {
    background-color: #198754; /* vert Bootstrap classique */
    color: white;
}

.bg-red {
    background-color: #dc3545; /* rouge Bootstrap */
    color: white;
}

.bg-orange {
    background-color: #fd7e14; /* orange vif */
    color: white;
}

.bg-gray {
    background-color: #6c757d; /* gris classique */
    color: white;
}

.etape-icon {
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: transform 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auto-resize-textarea {
    overflow: hidden;
    resize: none;
    min-height: 2.2rem;
    line-height: 1.4;
    height: auto;
}

    /* Astuce CSS : déclenche l'auto-ajustement si texte dépasse */
    .auto-resize-textarea:focus {
        height: auto;
    }


.validation-button {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .validation-button:hover {
        transform: translateY(-3px) scale(1.1);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

.bg-white-dot {
    background-color: #e5e7eb; /* Gris un peu plus foncé (Tailwind gray-200) */
    border: 2px solid #6b7280; /* Gris plus marqué (Tailwind gray-500) */
    color: #111;
}

.step-clickable {
    transition: background-color 0.2s ease-in-out, box-shadow 0.2s;
    border-radius: 0.5rem;
}

.step-clickable:hover {
    background-color: rgba(0, 123, 255, 0.05); /* Bleu léger */
    box-shadow: 0 0 6px rgba(0, 123, 255, 0.2);
}

.selected-step-column {
    background-color: rgba(13, 110, 253, 0.15); /* Bleu Bootstrap */
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.4); /* halo plus marqué */
    transform: scale(1.02);
    z-index: 1;
    transition: background-color 0.2s ease-in-out, box-shadow 0.2s, transform 0.2s;
}

.dimmed-step {
    opacity: 0.85;
    filter: grayscale(5%) brightness(1.05) contrast(1.2);
    color: #6c757d; /* gris moyen de Bootstrap */
    transition: opacity 0.2s ease-in-out, filter 0.2s ease-in-out, color 0.2s ease-in-out;
}


.step-draft {
    background-color: #e8e0ff; /* Violet pastel */
    border-left: 4px dashed #6c63ff;
    padding: 0.5rem;
    border-radius: 8px;
    position: relative;
}

.step-draft-label {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #6c63ff;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
}


.editable-title:hover .edit-hint {
    opacity: 1;
}

.step-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.dot-and-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
}

.cell-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 2px;
    line-height: 1.1;
}

.meta-agent {
    font-size: 0.8rem;
    font-weight: 600;
    color: #212529; /* texte sombre */
}

.meta-intervention {
    font-size: 0.75rem;
    color: #6c757d; /* gris bootstrap */
}

/* ===== Desktop compact (≥ 561px) ===== */
@media (min-width: 561px) {
    .step-row {
        align-items: center; /* centrage vertical */
        flex-wrap: nowrap; /* une seule ligne */
        gap: 8px; /* espace réduit */
    }

    .title-wrap {
        flex: 0 1 28rem; /* largeur raisonnable du titre */
        min-width: 12rem; /* évite le wrap intempestif */
    }

    /* Le titre ne doit pas étirer la hauteur */
    .step-label {
        margin: 0;
        line-height: 1.15;
        display: -webkit-box; /* clamp à 2 lignes */
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
    }

    /* Mode édition compact */
    .title-wrap .form-control-sm {
        padding-top: .15rem;
        padding-bottom: .15rem;
        line-height: 1.1;
    }

    .title-wrap .mt-2 {
        margin-top: .25rem !important;
    }

    .title-wrap small {
        margin-top: .15rem !important;
        font-size: .7rem;
    }

    /* Le panneau reste sur une ligne et n'étire pas ses enfants */
    .panel-wrap > * {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        gap: 6px;
        width: 100%;
        min-height: 0;
    }

        .panel-wrap > * > * {
            flex: 0 0 auto; /* taille au contenu (boutons/inputs) */
            min-width: 0;
        }
}

.protocol-sections-sticky {
    position: sticky;
    top: 0; /* ajuste si tu as une navbar fixe */
    z-index: 1050;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border-radius: 0 0 12px 12px; /* arrondi uniquement en bas */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* inertie iOS */
    padding: 6px 0;
}

/* Mobile : plus compact */
@media (max-width: 575.98px) {
    .protocol-sections-sticky {
        padding: 4px 0;
        box-shadow: 0 3px 10px rgba(0,0,0,0.10);
        border-radius: 0 0 16px 16px; /* arrondi un peu plus marqué en mobile */
    }
}

/* Base : bouton flottant (large) */
.vp-float {
    position: fixed;
    z-index: 1050;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 9999px;
    border: none;
    font-size: 34px;
    font-weight: 700;
    line-height: 1;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease, opacity .15s ease;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    color: #fff;
    user-select: none;
    touch-action: manipulation;
    /* centrage vertical par défaut pour left / right */
    top: 50%;
    transform: translateY(-50%);
}

/* Position aux bords */
.vp-left {
    left: max(16px, env(safe-area-inset-left));
}

.vp-right {
    right: max(16px, env(safe-area-inset-right));
}

/* Cancel en bas à gauche (avec marge, pas collé) */
.vp-bottom-left {
    left: max(16px, env(safe-area-inset-left));
    bottom: max(100px, env(safe-area-inset-bottom)); /* ajuste 100px si besoin */
    top: auto;
    right: auto;
    transform: none; /* pas de translate vertical ici */
}

/* === ÉTATS GÉNÉRIQUES === */

/* Actif (BLEU Bootstrap) */
.vp-on {
    background: #0d6efd;
    color: #fff;
}

    .vp-on:hover {
        background: #0b5ed7;
        box-shadow: 0 12px 30px rgba(0,0,0,.30);
    }
/* garder la bonne translation au hover selon la position */
.vp-left.vp-on:hover, .vp-right.vp-on:hover {
    transform: translateY(-50%) scale(1.08);
}

.vp-bottom-left.vp-on:hover {
    transform: scale(1.08);
}

/* Succès (VERT Bootstrap) */
.vp-success {
    background: #198754;
    color: #fff;
}

.vp-left.vp-success:hover, .vp-right.vp-success:hover {
    transform: translateY(-50%) scale(1.08);
    background: #157347;
}

.vp-bottom-left.vp-success:hover {
    transform: scale(1.08);
    background: #157347;
}

/* Désactivé (GRIS CLAIR neutre) */
.vp-off,
.vp-float:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
    opacity: 1;
}

.vp-left.vp-off:hover, .vp-right.vp-off:hover {
    transform: translateY(-50%);
}

.vp-bottom-left.vp-off:hover {
    transform: none;
}

/* === COULEUR SPÉCIALE POUR CANCEL (rouge adouci, toujours actif) === */
/* Cancel : carré arrondi, plus petit, rouge doux */
.vp-cancel {
    width: 56px;
    height: 56px;
    border-radius: 12px; /* coins arrondis, pas un cercle */
    font-size: 26px;
    background: #e06666;
    color: #fff;
}

.vp-bottom-left.vp-cancel:hover {
    background: #cc4d4d;
    transform: scale(1.08);
    box-shadow: 0 12px 30px rgba(0,0,0,.30);
}

.vp-cancel:focus-visible {
    outline: 3px solid #f5c2c7;
    outline-offset: 3px;
}

/* Sur mobile : un peu plus grand */
@media (max-width: 575.98px) {
    .vp-cancel {
        width: 64px;
        height: 64px;
        font-size: 30px;
    }
}

/* ==== Safe bottom spacing for Cancel (footer + expander + marge) ==== */
:root {
    --footer-h: 56px; /* fallback si non défini dans le MainLayout */
    --expander-trigger-h: 64px; /* hauteur du bouton "Toutes les étapes" */
    --cancel-gap: 24px; /* marge confortable au-dessus de la barre */
}

/* Quand la barre .expander-fixed est présente, on remonte Cancel */
body:has(.expander-fixed) .vp-bottom-left,
body:has(.expander-fixed) .vp-cancel {
    bottom: calc(var(--footer-h, 56px) + var(--expander-trigger-h, 64px) + var(--cancel-gap));
    z-index: 1060; /* au-dessus de la barre (1050) et du footer (1040) */
}

/* Safe-area mobile (iPhone, etc.) */
@media (max-width: 575.98px) {
    body:has(.expander-fixed) .vp-bottom-left,
    body:has(.expander-fixed) .vp-cancel {
        bottom: calc(var(--footer-h, 56px) + var(--expander-trigger-h, 64px) + var(--cancel-gap) + env(safe-area-inset-bottom));
    }
}


/* Toujours au-dessus du panneau (1045) et de la barre (1050) */
.vp-float, .vp-bottom-left, .vp-cancel {
    z-index: 2001 !important;
}

/* Quand la barre d'expander est présente, on remonte Cancel au-dessus du footer + barre */
:root {
    --footer-h: 56px; /* fallback si non défini dans MainLayout */
    --expander-trigger-h: 64px; /* hauteur du bouton "Toutes les étapes" */
    --cancel-gap: 24px; /* marge d'air */
}

/* version auto si :has est supporté */
body:has(.expander-fixed) .vp-bottom-left,
body:has(.expander-fixed) .vp-cancel {
    bottom: calc(var(--footer-h, 56px) + var(--expander-trigger-h, 64px) + var(--cancel-gap));
}

/* fallback sans :has -> mets .with-expander sur <body> ou un wrapper */
.with-expander .vp-bottom-left,
.with-expander .vp-cancel {
    bottom: calc(var(--footer-h, 56px) + var(--expander-trigger-h, 64px) + var(--cancel-gap));
}

/* Safe-area mobile */
@media (max-width: 575.98px) {
    body:has(.expander-fixed) .vp-bottom-left,
    body:has(.expander-fixed) .vp-cancel,
    .with-expander .vp-bottom-left,
    .with-expander .vp-cancel {
        bottom: calc(var(--footer-h, 56px) + var(--expander-trigger-h, 64px) + var(--cancel-gap) + env(safe-area-inset-bottom));
    }
}

/* Barre CR devient un bloc compact centré */
.expander-report-fixed {
    position: fixed;
    bottom: calc(var(--footer-h, 56px) + var(--expander-trigger-h));
    left: 50%;
    transform: translateX(-50%);
    z-index: 1048;
    /* aspect bouton */
    background: #fff;
    border: 2px solid var(--acc, #3b82f6);
    border-radius: 12px;
    box-shadow: 0 -4px 12px rgba(0,0,0,.12);
    /* largeur réduite */
    width: auto;
    max-width: 90vw;
    padding: .5rem 1rem;
}

    /* couleur de fond bleue claire si tu veux garder l’accent */
    .expander-report-fixed.accent-blue {
        background: var(--acc-softer, #eff6ff);
    }


/* Le conteneur qui entoure le texte + StepButton sert d'ancre */
.report-anchor {
    position: relative;
}

/* Popup centré AU-DESSUS du bouton */
.report-popup--above {
    position: absolute;
    bottom: calc(100% + 10px); /* ↑ au-dessus de l’ancre */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1049;
    width: min(600px, 95vw);
    min-width: 300px;
    min-height: 180px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0,0,0,.18);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    resize: both;
    overflow: auto;
}

    /* Petite flèche qui pointe vers le bouton (optionnel) */
    .report-popup--above::after {
        content: "";
        position: absolute;
        bottom: -6px; /* colle sous le popup */
        left: 50%;
        transform: translateX(-50%) rotate(45deg);
        width: 12px;
        height: 12px;
        background: #fff;
        border-left: 1px solid #e9ecef;
        border-bottom: 1px solid #e9ecef;
    }

/* Hauteur "réservée" pour le bloc CR/Photo */
:root {
    --cr-block-h: 72px; /* ajuste (64–88px selon ton contenu) */
    --cr-gap: 8px; /* petit espace visuel */
}

/* Le bloc CR/Photo a au moins cette hauteur (utile si le contenu wrap) */
.expander-report-fixed {
    min-height: var(--cr-block-h);
}

/* IMPORTANT : le panneau se place au-dessus de la barre + CR/Photo */
.expander-panel {
    bottom: calc(var(--footer-h, 56px) + var(--expander-trigger-h) + var(--cr-block-h) + var(--cr-gap));
    padding-bottom: 16px; /* petit confort au fond du panel */
    z-index: 1045;
}

/* Ordre des couches (pour mémoire) */
.expander-report-fixed {
    z-index: 1048;
}

.report-popup--above {
    z-index: 1049;
}

.expander-fixed {
    z-index: 1050;
}


@media (max-width: 575.98px) {
    .expander-report-fixed {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* =========================
   Toolbar compacte (1 ligne)
   ========================= */
.toolbar-compact {
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

    .toolbar-compact .btn {
        padding: .25rem .45rem;
        line-height: 1;
    }

        .toolbar-compact .btn.btn-sm {
            font-size: .9rem;
        }

/* Option: rend la barre globale plus compacte */
.expander-report-fixed.compact .container {
    padding-top: .25rem;
    padding-bottom: .25rem;
}

.expander-report-fixed.compact .gap-3,
.expander-report-fixed.compact .gap-4 {
    gap: .5rem !important;
}

.expander-report-fixed.compact small,
.expander-report-fixed.compact .small {
    font-size: .75rem;
}

/* =========================
   Boutons icône + libellé
   ========================= */
.btn-labeled {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

    .btn-labeled .icon,
    .btn-labeled .label {
        line-height: 1;
    }

/* =========================
   Pilules (même style partout)
   ========================= */
:root {
    --chip-border: #d0d7de; /* gris clair */
    --chip-bg: #f8fafc; /* fond très clair */
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
    border: 2px solid var(--chip-border);
    background: var(--chip-bg);
    border-radius: 9999px;
    padding: .35rem .6rem;
}

.chip-title {
    font-size: .8rem;
    color: #6c757d;
    line-height: 1;
    white-space: nowrap;
}

/* Lien "Annuler" (si utilisé) */
.chip-cancel {
    font-size: .78rem;
    color: #6c757d;
    text-decoration: none;
}

    .chip-cancel:hover {
        text-decoration: underline;
    }

/* Empêche le bouton Compte-rendu de se comprimer */
.report-anchor .btn {
    white-space: nowrap;
}


/* Variante “empilée” : titre, actions, puis Annuler centré en bas */
.chip--stacked {
    flex-direction: column;
    align-items: center; /* centre horizontalement tous les enfants */
}

    .chip--stacked .chip-title {
        text-align: center;
    }

    .chip--stacked .actions {
        display: flex;
        align-items: center;
        gap: .35rem;
    }

.chip-cancel {
    margin-top: .25rem; /* espace au-dessus */
    font-size: .78rem;
    color: #6c757d;
    text-decoration: none;
    align-self: center; /* sécurité : reste centré même si styles changent */
}

    .chip-cancel:hover {
        text-decoration: underline;
    }

/* Variante empilée : titre / actions / bouton bas centré */
.chip--stacked {
    flex-direction: column;
    align-items: center; /* centre le contenu horizontalement */
}

    .chip--stacked .actions {
        display: flex;
        align-items: center;
        gap: .35rem;
    }

.chip-footer {
    display: flex;
    justify-content: center; /* bouton centré en bas */
    width: 100%;
    margin-top: .25rem;
}

/* Bouton bas (look discret) */
.chip-cancel {
    font-size: .78rem;
    color: #6c757d;
    text-decoration: none;
    padding: 0;
}

    .chip-cancel:hover {
        text-decoration: underline;
    }


/* A — défaut : une seule ligne défilable */
.toolbar-compact {
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
}

    .toolbar-compact .btn {
        padding: .25rem .45rem;
        line-height: 1;
    }

        .toolbar-compact .btn.btn-sm {
            font-size: .9rem;
        }

/* B — mobile (<= 576px) : wrap en 2–3 lignes */
@media (max-width: 576px) {
    .toolbar-compact.toolbar-wrap-sm {
        flex-wrap: wrap; /* autorise le retour à la ligne */
        overflow-x: visible; /* plus de scroll horizontal */
        white-space: normal; /* permet les retours à la ligne */
        gap: .5rem;
    }

        /* Chaque bloc devient un “rang” plein largeur */
        .toolbar-compact.toolbar-wrap-sm .chip {
            flex: 1 1 100%;
            min-width: 0;
        }

            /* Actions au centre, possibilité de passer sur 2 lignes si besoin */
            .toolbar-compact.toolbar-wrap-sm .chip .actions {
                display: flex;
                justify-content: center;
                align-items: center;
                gap: .35rem;
                flex-wrap: wrap;
            }

        /* Titre et bouton bas centrés */
        .toolbar-compact.toolbar-wrap-sm .chip-title {
            text-align: center;
        }

        .toolbar-compact.toolbar-wrap-sm .chip-footer {
            width: 100%;
            display: flex;
            justify-content: center;
            margin-top: .25rem;
        }

        /* Légère augmentation des zones cliquables en mobile */
        .toolbar-compact.toolbar-wrap-sm .btn {
            padding: .35rem .55rem;
        }
}


.alert-fade {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

    .alert-fade.show {
        opacity: 1;
    }

