/* Liste Besoins (Case) — bandeau d'en-tête, même langage visuel que Simulations CPS */

#main > .page-header.case-hero-header {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    margin: 4px 0 18px;
    padding: 20px 22px;
    border: 0;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(135deg, #0d2b6b 0%, #123a9e 55%, #1a4fd6 100%);
    box-shadow: 0 10px 30px -12px rgba(15, 42, 74, .4);
}

/* Ondes « diffusion » derrière les boutons (clin d'œil à l'icône porte-voix des besoins) */
#main > .page-header.case-hero-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: repeating-radial-gradient(circle at 96% 50%, rgba(255, 255, 255, .07) 0 1px, transparent 1px 26px);
    -webkit-mask-image: linear-gradient(90deg, transparent 35%, #000 100%);
    mask-image: linear-gradient(90deg, transparent 35%, #000 100%);
}

#main > .page-header.case-hero-header::after {
    content: "";
    position: absolute;
    z-index: -1;
    top: -60%;
    left: 18%;
    width: 420px;
    height: 220%;
    pointer-events: none;
    background: radial-gradient(closest-side, rgba(96, 165, 250, .28), transparent);
}

.case-hero-header .page-header-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px 18px;
}

.case-hero-header .page-header-column-1 {
    flex: 1 1 320px;
    min-width: 0;
    width: auto;
}

.case-hero-header .page-header-column-2 {
    flex: 0 1 auto;
    width: auto;
}

.case-hero-header .page-header-column-1 > .header-title {
    display: none;
}

/* ── Marque : icône + titre + métriques ─────────────────────── */
.case-hero-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.case-hero-icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    font-size: 18px;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15);
    transform: rotate(-8deg);
}

.case-hero-text {
    min-width: 0;
}

.case-hero-eyebrow {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .62);
    line-height: 1.2;
}

.case-hero-title {
    font-family: 'DM Serif Display', Georgia, 'Times New Roman', serif;
    font-weight: 400;
    font-size: 26px;
    line-height: 1.15;
    letter-spacing: -.01em;
    color: #fff;
}

.case-hero-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 0;
    margin-top: 4px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, .74);
}

.case-hero-stat b {
    color: #fff;
    font-weight: 700;
}

.case-hero-stat + .case-hero-stat::before {
    content: "·";
    margin: 0 9px;
    color: rgba(255, 255, 255, .4);
}

.case-hero-stat-rate .fas {
    color: #fcd34d;
    font-size: 11px;
}

.case-hero-sync {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-left: 14px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .18);
}

.case-hero-meta > .case-hero-sync:first-child {
    margin-left: 0;
}

.case-hero-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #86efac;
    box-shadow: 0 0 0 3px rgba(134, 239, 172, .22);
}

.case-hero-sync.is-syncing .case-hero-dot {
    background: #fcd34d;
    box-shadow: 0 0 0 3px rgba(252, 211, 77, .25);
    animation: case-hero-pulse 1s ease-in-out infinite;
}

@keyframes case-hero-pulse {
    50% { opacity: .35; }
}

/* ── Boutons du header Espo ─────────────────────────────────── */
.case-hero-header .header-buttons {
    float: none !important;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.case-hero-header .header-buttons > .btn,
.case-hero-header .header-buttons > .btn-group > .btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    float: none;
    margin: 0 !important;
    padding: 8px 14px;
    border-radius: 9px !important;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .28);
    box-shadow: none;
    transition: background .15s, transform .15s;
}

.case-hero-header .header-buttons > .btn:hover,
.case-hero-header .header-buttons > .btn:focus,
.case-hero-header .header-buttons > .btn-group > .btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, .2);
    border-color: rgba(255, 255, 255, .4);
}

.case-hero-header .header-buttons > .btn > span:empty:not([class]) {
    display: none;
}

.case-hero-header .header-buttons > .btn .fas,
.case-hero-header .header-buttons > .btn .icon {
    color: inherit;
}

.case-hero-header .header-buttons > .btn.btn-xs-wide {
    min-width: 0;
}

/* Ordre : réglages · Paramètres · Créer (principal) · Rafraîchir */
.case-hero-header .header-buttons > [data-name="openScopeAdministration"] { order: 1; padding-left: 11px; padding-right: 11px; }
.case-hero-header .header-buttons > [data-name="caseLiberationSettings"] { order: 2; }
.case-hero-header .header-buttons > [data-name="create"] { order: 3; }
.case-hero-header .header-buttons > [data-name="caseHeroRefresh"] { order: 4; }
.case-hero-header .header-buttons > .btn-group { order: 5; }

.case-hero-header .header-buttons > [data-name="create"] {
    color: #0f2a4a;
    font-weight: 700;
    background: #fff;
    border-color: #fff;
}

.case-hero-header .header-buttons > [data-name="create"]:hover,
.case-hero-header .header-buttons > [data-name="create"]:focus {
    color: #0f2a4a;
    background: #eef3fe;
    border-color: #eef3fe;
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    #main > .page-header.case-hero-header {
        padding: 16px;
    }

    .case-hero-header .page-header-column-2,
    .case-hero-header .header-buttons {
        width: 100%;
        justify-content: flex-start;
    }

    .case-hero-icon {
        display: none;
    }

    .case-hero-sync {
        margin-left: 0;
        margin-top: 4px;
    }
}
