#ns-invoice{
    --nsi-bg: #f5f7fb;
    --nsi-card: #ffffff;
    --nsi-text: #0f172a;
    --nsi-muted: #64748b;
    --nsi-border: rgba(15, 23, 42, .08);

    --nsi-navy-1: #122d5a;
    --nsi-navy-2: #0f2a54;

    --nsi-gold-1: #d1a62e;
    --nsi-gold-2: #e0be57;

    --nsi-success: #16a34a;
    --nsi-danger: #ef4444;

    background: var(--nsi-bg);
    color: var(--nsi-text);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

/* Conteneur principal */
#ns-invoice .nsi-wrap{
    max-width: 980px;
    margin: 0 auto;
    padding: clamp(18px, 3vw, 28px);
}

/* Carte globale (avec header bleu) */
#ns-invoice .nsi-shell{
    background: var(--nsi-card);
    border: 1px solid var(--nsi-border);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(2, 8, 23, .08);
}

/* Header */
#ns-invoice .nsi-hero{
    position: relative;
    padding: clamp(20px, 4vw, 36px);
    background: radial-gradient(1200px 420px at 20% 10%, rgba(255,255,255,.14) 0%, rgba(255,255,255,0) 55%),
    linear-gradient(145deg, var(--nsi-navy-1), var(--nsi-navy-2));
    color: #fff;
}

#ns-invoice .nsi-hero h1{
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
    font-size: clamp(26px, 3.2vw, 40px);
}

#ns-invoice .nsi-hero p{
    margin: 6px 0 0 0;
    color: rgba(255,255,255,.82);
    font-weight: 500;
}

/* Pastille date */
#ns-invoice .nsi-date-pill{
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(209,166,46,.98), rgba(224,190,87,.98));
    color: #11203a;
    font-weight: 800;
    box-shadow: 0 10px 25px rgba(209,166,46,.22);
    border: 1px solid rgba(255,255,255,.25);
}

/* Badge paiement */
#ns-invoice .nsi-status{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.25);
    background: rgba(255,255,255,.12);
    color: #fff;
    font-weight: 700;
    backdrop-filter: blur(6px);
}

/* Contenu */
#ns-invoice .nsi-body{
    padding: clamp(18px, 3vw, 28px);
}

/* Titres section */
#ns-invoice .nsi-section-title{
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: #18325f;
    margin: 2px 0 12px;
    font-size: 1.1rem;
}

#ns-invoice .nsi-divider{
    height: 1px;
    background: linear-gradient(90deg, rgba(15,23,42,.10), rgba(15,23,42,0));
    margin: 10px 0 18px;
}

/* Cards internes */
#ns-invoice .nsi-card{
    background: #fff;
    border: 1px solid var(--nsi-border);
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(2, 8, 23, .05);
}

#ns-invoice .nsi-card .nsi-card-h{
    padding: 14px 16px;
    border-bottom: 1px solid var(--nsi-border);
    background: #fbfcff;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
    font-weight: 800;
    color: #19335f;
}

#ns-invoice .nsi-card .nsi-card-b{
    padding: 16px;
}

/* Bloc "Informations client" (accent à gauche) */
#ns-invoice .nsi-accent{
    position: relative;
    overflow: hidden;
}
#ns-invoice .nsi-accent::before{
    content:"";
    position:absolute;
    left:0;
    top:0;
    bottom:0;
    width: 6px;
    background: linear-gradient(180deg, var(--nsi-gold-1), var(--nsi-gold-2));
}
#ns-invoice .nsi-accent .nsi-card-b{
    padding-left: 22px;
}

/* Liste clés/valeurs */
#ns-invoice .nsi-kv{
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 10px 14px;
    margin: 0;
}

#ns-invoice .nsi-kv dt{
    margin: 0;
    color: #1c3563;
    font-weight: 800;
}
#ns-invoice .nsi-kv dd{
    margin: 0;
    color: var(--nsi-text);
    font-weight: 600;
}
#ns-invoice .nsi-kv .muted{
    color: var(--nsi-muted);
    font-weight: 600;
}

/* Badges */
#ns-invoice .nsi-badge{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 800;
    border: 1px solid var(--nsi-border);
    background: #fff;
    color: #0b1b36;
}

#ns-invoice .nsi-badge-code{
    background: #0b224a;
    color: #fff;
    border-color: rgba(255,255,255,.12);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    letter-spacing: .04em;
}

#ns-invoice .nsi-badge-danger{
    background: rgba(239,68,68,.08);
    border-color: rgba(239,68,68,.28);
    color: #b91c1c;
}

#ns-invoice .nsi-badge-success{
    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 8px 12px;
    border-radius: 999px;

    font-weight: 800;
    font-size: .875rem;

    background: rgba(22,163,74,.10);
    border: 1px solid rgba(22,163,74,.35);
    color: #15803d;

    box-shadow: 0 4px 12px rgba(22,163,74,.12);
}

/* Récap paiement */
#ns-invoice .nsi-pay{
    background: #f6f8fc;
    border-color: rgba(15,23,42,.08);
}

#ns-invoice .nsi-pay .row-item{
    padding: 12px 0;
    border-bottom: 1px dashed rgba(15,23,42,.16);
}
#ns-invoice .nsi-pay .row-item:last-child{
    border-bottom: 0;
}

#ns-invoice .nsi-total{
    margin-top: 12px;
    padding-top: 14px;
    border-top: 2px solid rgba(15,23,42,.18);
    font-weight: 900;
    font-size: 1.15rem;
    color: #0b224a;
}

/* Responsive ajustements */
@media (max-width: 575.98px){
    #ns-invoice .nsi-kv{
        grid-template-columns: 1fr;
    }
    #ns-invoice .nsi-hero-actions{
        flex-direction: column;
        align-items: stretch !important;
    }
    #ns-invoice .nsi-hero-actions > *{
        justify-content: center;
    }
}
:root{
    --wc-bg: #F2C879;          /* jaune sable */
    --wc-ink: #0F2E43;         /* bleu nuit */
    --wc-ink-2: #173F5A;
    --wc-white: #ffffff;
    --wc-radius: 18px;
}

.wc-popup{
    position: fixed;
    left: 20px;
    bottom: 20px;
    right: auto;
    width: 360px;
    max-width: calc(100vw - 40px);
    border-radius: var(--wc-radius);
    background: transparent;
    z-index: 1056; /* au-dessus des contenus */
    transform: translateY(16px);
    opacity: 0;
    pointer-events: none;
    transition: .28s ease;
}

.wc-popup.is-open{
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.wc-popup__inner{
    border-radius: var(--wc-radius);
    overflow: hidden;
}

.wc-popup__header{
    background: rgba(255,255,255,0.22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--wc-ink);
    padding: 10px 12px;
    border: 1px solid rgba(15,46,67,0.10);
    border-bottom: 0;
}

.wc-popup__brand{
    color: var(--wc-ink-2);
    letter-spacing: .2px;
}

.wc-dot{
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #2EC97C;
    box-shadow: 0 0 0 4px rgba(46,201,124,.18);
    display: inline-block;
}

.wc-icon-btn{
    border-radius: 10px;
    padding: 6px 8px;
    line-height: 1;
    border: 1px solid rgba(15,46,67,0.12);
    color: var(--wc-ink);
    background: rgba(255,255,255,0.55);
}

.wc-icon-btn:hover{
    background: rgba(255,255,255,0.85);
}

.wc-popup__body{
    position: relative;
    background: var(--wc-bg);
    color: var(--wc-ink);
    padding: 18px 16px 70px 16px; /* espace pour l'illu */
    border: 1px solid rgba(15,46,67,0.10);
    border-top: 0;
}

.wc-title{
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--wc-ink);
}

.wc-text{
    margin: 0;
    color: rgba(15,46,67,0.85);
    line-height: 1.35;
}

.wc-cta{
    background: var(--wc-ink);
    color: var(--wc-white);
    border-radius: 999px;
    font-weight: 700;
    border: 0;
    box-shadow: 0 10px 22px rgba(15,46,67,.18);
}

.wc-cta:hover{
    background: #0b2435;
    color: var(--wc-white);
}

.wc-link{
    color: rgba(15,46,67,0.9);
    text-decoration: none;
    border-bottom: 1px dashed rgba(15,46,67,0.45);
}

.wc-link:hover{
    color: var(--wc-ink);
    border-bottom-color: rgba(15,46,67,0.8);
}

/* Illustration simple (remplace par un <img> si tu veux) */
.wc-illu{
    position: absolute;
    right: 16px;
    bottom: 10px;
    width: 180px;
    height: 160px;
    pointer-events: none;
}

.wc-illu-img{
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.wc-illu__blob{
    position: absolute;
    inset: 10px 0 0 0;
    border-radius: 20px;
    background: rgba(255,255,255,0.28);
    border: 1px solid rgba(15,46,67,0.12);
    transform: rotate(-2deg);
}

.wc-illu__tag{
    position: absolute;
    right: 8px;
    top: 0;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.65);
    border: 1px solid rgba(15,46,67,0.14);
    font-weight: 900;
    font-size: .75rem;
    letter-spacing: .5px;
}

/* Minimized state */
.wc-popup.is-minimized .wc-popup__header,
.wc-popup.is-minimized .wc-popup__body{
    display: none;
}

.wc-popup__minbar{
    display: none;
    width: 100%;
    border: 1px solid rgba(15,46,67,0.14);
    background: rgba(255,255,255,0.92);
    color: var(--wc-ink);
    border-radius: var(--wc-radius);
    padding: 12px 12px;
    gap: 10px;
    align-items: center;
}

.wc-popup.is-minimized .wc-popup__minbar{
    display: flex;
}


@media (max-width: 991.98px){

    /* On “dock” la popup et on la réduit */
    .wc-popup{
        left: 12px;
        right: auto;
        bottom: calc(12px + var(--brevo-safe, 84px));
        width: min(360px, calc(100vw - 24px));
    }

    .wc-popup:not(.is-open-on-mobile){
        pointer-events: auto;
    }

    .wc-popup:not(.is-open-on-mobile) .wc-popup__header,
    .wc-popup:not(.is-open-on-mobile) .wc-popup__body{
        display: none;
    }
    .wc-popup:not(.is-open-on-mobile) .wc-popup__minbar{
        display: flex;
    }

    /* Minbar plus compacte */
    .wc-popup__minbar{
        padding: 10px 12px;
        border-radius: 999px;
    }
}

/* Petit effet "pop" */
@media (prefers-reduced-motion: no-preference) {
    .wc-popup.is-open{
        animation: wc-pop .35s ease both;
    }
    @keyframes wc-pop {
        from { transform: translateY(18px) scale(.98); opacity: 0; }
        to   { transform: translateY(0) scale(1); opacity: 1; }
    }
}
.wc-popup__header{
    background: rgba(255,255,255,.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
