﻿/* Mode Démo*/

.demo-navbar-badge {
    padding: .55rem .8rem;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .04em;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, .18);
}

.demo-mode-banner {
    position: sticky;
    top: 0;
    z-index: 1025;
    padding: .7rem 1rem;
    color: #3f2b00;
    background: repeating-linear-gradient( -45deg, #ffc107, #ffc107 14px, #ffca2c 14px, #ffca2c 28px );
    border-bottom: 2px solid #a36b00;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .18);
}

body.demo-mode-active {
    box-shadow: inset 0 0 0 4px #ffc107;
}

.demo-mode-banner strong {
    font-weight: 800;
}

    .demo-mode-banner {
        position: static;
    }


/* =====================================================================
   VARIABLES / THEME
===================================================================== */
:root {
    /* Brand */
    --c-orange: #fd7e14;
    --c-red: #dc3545;
    --c-yellow: #ffc107;
    --c-green: #198754;
    --c-blue: #0d6efd;
    --c-purple: #6610f2;
    --c-turquoise: #20c997;
    --c-brown: #BA9E73;
    /* PV system */
    --pv-radius: 14px;
    --pv-radius-sm: 12px;
    --pv-border: rgba(17,24,39,.10);
    --pv-muted: rgba(33,37,41,.60);
    --pv-shadow-sm: 0 1px 2px rgba(16,24,40,.06);
    --pv-shadow-lg: 0 16px 36px rgba(16,24,40,.10);
}

.dashboard-sticky {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: #EBF1FB;
    padding-top: .5rem;
    padding-bottom: .5rem;
}

/* =====================================================================
  THEMES BDC
===================================================================== */

.line-container-bdc {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    transition: transform .20s ease, box-shadow .20s ease;
}

    .line-container-bdc:hover {
        transform: translateY(-2px);

    }

/* VR */
.theme-vr {
    border-left: 5px solid #dc3545 !important;
    background-color: rgba(220,53,69,.13);
}

    .theme-vr:hover {
        box-shadow: 0 .5rem 1rem rgba(220,53,69,.15);
    }

/* PVC */
.theme-pvc {
    border-left: 5px solid #198754 !important;
    background-color: rgba(25,135,84,.13);
}

    .theme-pvc:hover {
        box-shadow: 0 .5rem 1rem rgba(25,135,84,.15);
    }

/* ALU */
.theme-alu {
    border-left: 5px solid #0d6efd !important;
}

    .theme-alu:hover {
        box-shadow: 0 .5rem 1rem rgba(13,110,253,.15);
    }

/* PORTAIL */
.theme-portail {
    border-left: 5px solid #ffc107 !important;
}

    .theme-portail:hover {
        box-shadow: 0 .5rem 1rem rgba(255,193,7,.15);
    }

/* =====================================================================
   LOADER / GLOBAL
===================================================================== */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Conteneur */
.page-loader-box {
    text-align: center;
    background: #fff;
    padding: 40px 50px;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
    animation: loaderFadeIn 0.25s ease-out;
}

/* Logo */
.page-loader-logo {
    height: 64px;
    margin-bottom: 20px;
}

/* Spinner custom (plus classe que Bootstrap) */
.page-loader-spinner {
    width: 42px;
    height: 42px;
    margin: 0 auto 16px;
    border: 3px solid #e3e3e3;
    border-top-color: #0d6efd; /* bleu Normabaie */
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

/* Texte dynamique */
.page-loader-text {
    font-size: 0.95rem;
    color: #333;
}

/* Animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes loaderFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* Logo animé */
.nb-loader-logo {
    width: 100px;
    height: auto;
    animation: nb-spin 1.8s linear infinite;
}

/* Animation rotation */
@keyframes nb-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.nb-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .nb-loader.d-none {
        display: none !important;
    }

.nb-loader-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(6px);
}

.nb-loader-box {
    position: relative;
    z-index: 1;
    background: white;
    padding: 26px 32px;
    border-radius: 22px;
    box-shadow: 0 30px 70px rgba(2, 6, 23, .25);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.nb-loader-text {
    font-size: 1rem;
    font-weight: 700;
    color: #0F172A;
}


#globalLoader {
    position: display: none;
    position: fixed;
}

    #globalLoader.show {
        display: flex;
        align-items: center;
        justify-content: center;
    }

.loader-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.8);
}

.loader-card {
    position: relative;
    background: #fff;
    padding: 32px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,.2);
}

inset: 0;
z-index: 9999;
/* =====================================================================
   Pointer pour importer sur bouton
===================================================================== */
.import-banner {
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.import-banner:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0,0,0,.12);
    background-color: rgba(11, 74, 162, 0.06); /* adapte à ta charte */
}

#devisDropZone {
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}

#devisDropZone:hover {
    background-color: rgba(11, 74, 162, 0.04);
    border-color: rgba(11, 74, 162, 0.6);
    box-shadow: 0 6px 18px rgba(11, 74, 162, .12);
    transform: translateY(-1px);
}

/* =====================================================================
   BASE
===================================================================== */
body {
    background: #f7f8fb;
}

.card {
    border-radius: 10px;
}

.badge {
    font-weight: 500;
}


/* =====================================================================
   UTILITAIRES
===================================================================== */
.border-dashed {
    border-style: dashed !important;
}

.pointer-events-none {
    pointer-events: none;
}

.text-orange {
    color: var(--c-orange) !important;
}

.text-red {
    color: var(--c-red) !important;
}

.text-yellow {
    color: var(--c-yellow) !important;
}

.text-green {
    color: var(--c-green) !important;
}

.text-blue {
    color: var(--c-blue) !important;
}

.text-purple {
    color: var(--c-purple) !important;
}

.text-turquoise {
    color: var(--c-turquoise) !important;
}

.text-brown {
    color: var(--c-brown) !important;
}

/* =====================================================================
   DASH / KANBAN
===================================================================== */
.dash-shell {
    background: linear-gradient(180deg, rgba(13,110,253,.05), transparent);
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 18px;
    padding: 1rem;
}

.board-col {
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 14px;
    padding: .75rem;
    min-height: 180px;
    background: linear-gradient(180deg, var(--col-bg), transparent);
}

    .board-col.blue {
        --col-bg: rgba(13,110,253,.05);
    }

    .board-col.green {
        --col-bg: rgba(25,135,84,.06);
    }

    .board-col.orange {
        --col-bg: rgba(253,126,20,.07);
    }

    .board-col.red {
        --col-bg: rgba(220,53,69,.07);
    }

    .board-col.yellow {
        --col-bg: rgba(255,193,7,.10);
    }

    .board-col.purple {
        --col-bg: rgba(102,16,242,.07);
    }

    .board-col.turquoise {
        --col-bg: rgba(32,201,151,.06);
    }
    .board-col.brown {
        --col-bg: rgba(186,158,115,.06);
    }

    .sticky-top {
        position: sticky;
        top: 0;
        z-index: 1020;
    }

    .supplier-name {
        font-size: 0.82rem;
        color: #6c757d;
        font-weight: 500;
    }

/* ==================================================
   KANBAN
================================================== */
/* Conteneur du tab */
.kanban-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 10px;
}

/* Conteneur de scroll */
#tab-en-cours {
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
}

.kanban-board {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    min-width: 100%;
}


.kanban-column {
    flex: 1 1 250px;
    min-width: 240px;
    max-width: 450px;
}

    .kanban-column.collapsed {
        flex: 0 0 60px !important;
        min-width: 60px !important;
        max-width: 60px !important;
    }


.kanban-title {
    font-size: 0.85rem;
}
.order-title {
    font-size: 0.90rem;
}
/* ==================================================
   COLONNE RÉDUITE
================================================== */
.kanban-column.collapsed {
    flex: 0 0 60px !important;
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
}

        .kanban-column.collapsed .board-col-body,
        .kanban-column.collapsed .board-col-fade {
            display: none !important;
        }

        .kanban-column.collapsed .board-col {
            min-height: 350px;
        }

        /* Cache le badge */
        .kanban-column.collapsed .board-col-header > div {
            display: flex !important;
            flex-direction: column !important;
            align-items: center !important;
            gap: 8px;
        }

        /* Badge visible dans les colonnes réduites */
/* Badge compteur commun */

.board-col-header .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    border-radius: 50% !important;
    font-size: .85rem;
    font-weight: 800;
    color: #000 !important;
    border: 2px solid rgba(0,0,0,.15);
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
}



.kanban-title {
    flex: 1;
    text-align: left !important;
    margin-left: 5px;
}


        /* Header simplifié */
        .kanban-column.collapsed .board-col-header {
            padding: .5rem;
        }

            .kanban-column.collapsed .board-col-header > div {
                display: flex !important;
                flex-direction: column !important;
                align-items: center !important;
                justify-content: flex-start !important;
                gap: 8px;
            }

        .kanban-column.collapsed .kanban-title {
            writing-mode: vertical-rl;
            transform: rotate(180deg);
            white-space: nowrap;
            overflow: visible;
            max-width: none !important;
            width: auto !important;
        }

        /* Titre vertical */
        .kanban-column.collapsed .kanban-title {
            writing-mode: vertical-rl;
            transform: rotate(180deg);
            white-space: nowrap;
            overflow: visible;
            text-align: center;
            max-width: none;
        }

        /* Rotation du chevron */
        .kanban-column.collapsed .js-toggle-column i {
            transform: rotate(180deg);
        }

/* Scroll propre */
.kanban-board::-webkit-scrollbar {
    height: 8px;
}

.kanban-board::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,.2);
    border-radius: 20px;
}

/* =====================================================================
   PV LINE CARD — CORE
===================================================================== */
.pv-line-card {
    position: relative;
    overflow: hidden;
    /* Accent par défaut */
    --pv-accent: #6b7280;
    --pv-accent-2: rgba(107,114,128,.18);
    --pv-accent-3: rgba(107,114,128,.10);
    background: linear-gradient(180deg, #fff, #fbfbfc);
    border: 1px solid var(--pv-border);
    border-radius: var(--pv-radius);
    box-shadow: var(--pv-shadow-sm);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

    .pv-line-card:hover {
        transform: translateY(-1px);
        box-shadow: var(--pv-shadow-lg);
    }

    /* Accent bar */
    .pv-line-card::before {
        content: "";
        position: absolute;
        inset: 0 auto 0 0;
        width: 6px;
        background: linear-gradient(180deg, var(--pv-accent), transparent);
    }

    /* Inner stroke */
    .pv-line-card::after {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: inherit;
        pointer-events: none;
        box-shadow: inset 0 0 0 1px var(--pv-accent-3);
    }

/* =====================================================================
   THUMB / IMAGE
===================================================================== */
.pv-thumb {
    width: 80px;
    height: 80px;
    border-radius: var(--pv-radius-sm);
    background: linear-gradient(180deg, #fff, #f3f4f6);
    border: 1px solid var(--pv-border);
    box-shadow: 0 6px 14px rgba(16,24,40,.06);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pv-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pv-img-clickable {
    cursor: zoom-in;
    transition: transform .12s ease, box-shadow .12s ease;
}

    .pv-img-clickable:hover {
        transform: scale(1.03);
        box-shadow: 0 .75rem 1.25rem rgba(0,0,0,.15);
    }

/* =====================================================================
   CHECKBOX
===================================================================== */
.pv-line-check {
    width: 1.15rem;
    height: 1.15rem;
    cursor: pointer;
    accent-color: var(--pv-accent);
}

/* =====================================================================
   SUMMARY
===================================================================== */
.pv-summary {
    border-radius: var(--pv-radius-sm);
    border: 1px solid var(--pv-accent-3);
    border-left: 5px solid var(--pv-accent);
    background: linear-gradient(180deg, #fff, #f8fafc);
    padding: .65rem .75rem;
}

.pv-summary-title {
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--pv-accent);
    display: flex;
    align-items: center;
    gap: .4rem;
}

    .pv-summary-title::before {
        content: "";
        width: 10px;
        height: 10px;
        border-radius: 999px;
        background: var(--pv-accent);
        box-shadow: 0 0 0 3px var(--pv-accent-3);
    }

.pv-srow {
    display: flex;
    justify-content: space-between;
    font-size: .9rem;
    color: rgba(17,24,39,.82);
}

.pv-sval {
    font-weight: 800;
}

.pv-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(17,24,39,.12), transparent);
    margin: .35rem 0;
}

.pv-total {
    font-size: 1.02rem;
    font-weight: 900;
}

/* =====================================================================
   THEMES MATIERES
===================================================================== */
.pv-line-card.mat-pvc {
    --pv-accent: #87bd40;
    --pv-accent-2: rgba(22,163,74,.18);
    --pv-accent-3: rgba(22,163,74,.10);
}

.pv-line-card.mat-alu {
    --pv-accent: #40baec;
    --pv-accent-2: rgba(37,99,235,.18);
    --pv-accent-3: rgba(37,99,235,.10);
}

.pv-line-card.mat-volet {
    --pv-accent: #e51f21;
    --pv-accent-2: rgba(220,38,38,.18);
    --pv-accent-3: rgba(220,38,38,.10);
}

/* =========================================================
   RESTORE PREMIUM LOOK (VISUAL LAYER)
   ========================================================= */

/* ===== PV LINE CARD ===== */
.pv-line-card {
    box-shadow: 0 1px 2px rgba(16,24,40,.06), 0 10px 24px rgba(16,24,40,.06);
}

    .pv-line-card:hover {
        box-shadow: 0 2px 4px rgba(16,24,40,.08), 0 16px 36px rgba(16,24,40,.12);
    }

    /* Accent interne subtil */
    .pv-line-card::after {
        box-shadow: inset 0 0 0 1px var(--pv-accent-3);
    }

/* ===== SUMMARY ===== */
.pv-summary {
    background: linear-gradient( 180deg, rgba(255,255,255,.98) 0%, rgba(248,250,252,.95) 100% );
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.75), 0 4px 10px rgba(16,24,40,.06);
}

/* Titre summary + pastille */
.pv-summary-title {
    letter-spacing: .4px;
}

    .pv-summary-title::before {
        box-shadow: 0 0 0 3px var(--pv-accent-3);
    }

/* ===== THUMB ===== */
.pv-thumb {
    background: linear-gradient(180deg, #ffffff 0%, #f3f4f6 100%);
    box-shadow: 0 6px 14px rgba(16,24,40,.06);
}

/* ===== IMAGE HOVER ===== */
.pv-img-clickable:hover {
    transform: scale(1.04);
    box-shadow: 0 .75rem 1.25rem rgba(0,0,0,.18);
}

/* ===== BOARD COL ===== */
.board-col {
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.5);
}

/* ===== KPI CHIP ===== */
.kpi-chip {
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.75), 0 .25rem .75rem rgba(0,0,0,.05);
}

/* ===== GALLERY ===== */
.gallery-tile {
    transition: transform .15s ease, box-shadow .15s ease;
}

    .gallery-tile:hover {
        transform: translateY(-1px);
        box-shadow: 0 10px 20px rgba(0,0,0,.15);
    }

/* ===== FLASH LINE ===== */
.js-flash-line {
    animation: lineFlash 0.9s ease-out;
}

/* ===== ZOOM POP ===== */
.img-zoom-pop img {
    transition: transform .2s ease, box-shadow .2s ease;
}

.img-zoom-pop:hover img {
    box-shadow: 0 .75rem 1.5rem rgba(0,0,0,.25);
}

/* ===== TABS ===== */
.nav-tabs-premium .nav-link.active {
    box-shadow: 0 2px 6px rgba(0,0,0,.08), 0 0 0 1px rgba(13,110,253,.15);
}

/* =====================================================================
   UI EXTENSIONS – RESTORE VISUELS MANQUANTS
===================================================================== */

/* ---------- Order card ---------- */
.order-card {
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 14px;
    box-shadow: 0 .35rem 1rem rgba(0,0,0,.05);
    transition: transform .08s ease, box-shadow .08s ease;
    position: relative;
    overflow: hidden;
}

    .order-card::before {
        content: "";
        position: absolute;
        inset: 0 auto 0 0;
        width: 5px;
        background: var(--accent, var(--c-blue));
        opacity: .9;
    }

    .order-card:hover {
        transform: translateY(-1px);
        box-shadow: 0 .55rem 1.25rem rgba(0,0,0,.10);
    }

/* ---------- Line containers ---------- */
.line-container {
    padding: .75rem 1rem;
    border-radius: .5rem;
    transition: background-color .2s ease, border-color .2s ease;
}

.line-saved {
    background-color: #e9f7ef;
    border-left: 4px solid #198754;
}

.line-pending {
    background-color: #fff4e5;
    border-left: 4px solid #fd7e14;
}

/* ---------- PV feedback ---------- */
.pv-line:hover {
    border-color: var(--c-blue);
    box-shadow: 0 0.5rem 1rem rgba(13,110,253,.15);
}

.js-flash-line {
    animation: lineFlash .9s ease-out;
}

.bdc-loader-content {
    text-align: center;
}

/* ---------- Sticky actions ---------- */

.bdc-actions-sticky {
    position: sticky;
    bottom: 0;
    z-index: 1020;
}

/* Eau claire sur mobile */
@media (max-width: 768px) {
    .bdc-actions-sticky {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ---------- Filters ---------- */
.filter-shell {
    border: 1px solid rgba(0,0,0,.06);
    background: #fff;
    border-radius: 14px;
    padding: .75rem;
    box-shadow: 0 .25rem .75rem rgba(0,0,0,.04);
}

    .filter-shell .form-label {
        font-weight: 800;
        font-size: .8rem;
        color: rgba(0,0,0,.65);
        margin-bottom: .25rem;
    }

/* ---------- KPI ---------- */
.kpi-chip .count {
    font-size: 1.1rem;
    font-weight: 900;
}

/* ---------- Zoom stage ---------- */
.pv-zoom-stage {
    width: 100%;
    height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    cursor: grab;
}

    .pv-zoom-stage:active {
        cursor: grabbing;
    }

.pv-zoom-img {
    max-width: none;
    max-height: none;
    transform-origin: center center;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

/* ---------- Img zoom pop ---------- */
.img-zoom-pop {
    display: inline-block;
    position: relative;
}

    .img-zoom-pop img {
        transition: transform .2s ease, box-shadow .2s ease;
        cursor: zoom-in;
    }

    .img-zoom-pop:hover img {
        transform: scale(2.2);
        z-index: 20;
        position: relative;
        box-shadow: 0 .75rem 1.5rem rgba(0,0,0,.25);
    }

/* ---------- Nav pills ---------- */
.nav-pills .nav-link {
    border-radius: 999px;
    font-weight: 800;
    padding: .45rem .85rem;
}

/* ---------- Sticky tabs separator ---------- */
.tabs-sticky-wrapper::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 1px;
    background: rgba(0,0,0,.08);
}

/* =======================
   GRILLE GALERIE
======================= */
/* Galerie */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: .75rem;
}

.gallery-tile {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: .75rem;
    cursor: pointer;
    background: #f1f3f5;
}

.gallery-tile img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Overlay */
.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.7), transparent 60%);
    display: flex;
    align-items: flex-end;
    padding: .5rem;
    opacity: 0;
    transition: opacity .2s ease;
}

.gallery-tile:hover .gallery-overlay {
    opacity: 1;
}

.gallery-title {
    color: #fff;
    font-size: .85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* =======================
   SPEC DEVIS IMPORT
======================= */
/* =========================================================
   PREVIEW DEVIS MODAL — CSS manquant / correctifs JS
   Cible: HTML généré par openDevisPreviewModal()
========================================================= */

/* 0) Fix entité HTML si jamais elle traîne encore */
.tab-content > .tab-pane {
    animation: fadeSlide .25s ease;
}

/* 1) Utilitaire non Bootstrap mais utilisé dans ton HTML JS */
.min-w-0 {
    min-width: 0 !important;
}

/* 2) Scope global modal (évite d'impacter le reste du site) */
#modalPreviewDevis .modal-body {
    background: linear-gradient(180deg, rgba(13,110,253,.04), rgba(255,255,255,0) 65%);
}

/* 3) IMPORTANT : ton JS met 'pv-line-card' SUR .card-body aussi.
      -> On neutralise pv-line-card quand c'est un card-body pour éviter double style. */
#modalPreviewDevis .card-body.pv-line-card {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: .85rem .95rem !important; /* ton look "UI Pro" */
    overflow: visible !important;
    position: relative;
}

    #modalPreviewDevis .card-body.pv-line-card::before,
    #modalPreviewDevis .card-body.pv-line-card::after {
        content: none !important; /* empêche les doubles barres/inner-strokes */
    }

/* 4) La vraie card (le DIV .card) : style premium restauré */
#modalPreviewDevis .card.pv-line-card {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid rgba(17,24,39,.08);
    background: linear-gradient(180deg, #ffffff 0%, #fbfbfc 100%);
    box-shadow: 0 1px 2px rgba(16,24,40,.06), 0 10px 24px rgba(16,24,40,.06);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

    /* Accent matière à gauche */
    #modalPreviewDevis .card.pv-line-card::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 6px;
        background: linear-gradient(180deg, var(--pv-accent, #6b7280) 0%, rgba(255,255,255,0) 160%);
        opacity: .95;
    }

    /* Liseré interne */
    #modalPreviewDevis .card.pv-line-card::after {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 14px;
        pointer-events: none;
        box-shadow: inset 0 0 0 1px var(--pv-accent-3, rgba(107,114,128,.10));
    }

    #modalPreviewDevis .card.pv-line-card:hover {
        transform: translateY(-1px);
        border-color: rgba(17,24,39,.12);
        box-shadow: 0 2px 4px rgba(16,24,40,.08), 0 18px 42px rgba(16,24,40,.14);
    }

/* 5) Checkbox look */
#modalPreviewDevis .pv-line-check {
    transform: scale(1.15);
    cursor: pointer;
    width: 1.15rem;
    height: 1.15rem;
    margin-top: .1rem;
    border-radius: .30rem;
}

/* 6) Thumb + image (ton JS met img-thumbnail + pv-img) */
#modalPreviewDevis .pv-thumb {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    border: 1px solid rgba(17,24,39,.10);
    background: linear-gradient(180deg,#fff 0%,#f3f4f6 100%);
    box-shadow: 0 6px 14px rgba(16,24,40,.06);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

    /* On force l'image à remplir la thumb (sinon ton .pv-img 96x96 casse le ratio) */
    #modalPreviewDevis .pv-thumb .pv-img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        background: transparent !important;
        border: 0 !important;
        padding: 0 !important;
        border-radius: 12px !important;
    }

/* Petit effet zoom */
#modalPreviewDevis .pv-img-clickable {
    cursor: zoom-in;
    transition: transform .12s ease, box-shadow .12s ease;
}

    #modalPreviewDevis .pv-img-clickable:hover {
        transform: scale(1.04);
        box-shadow: 0 .75rem 1.25rem rgba(0,0,0,.18);
    }

/* 7) Titre + sous-titre */
#modalPreviewDevis .pv-title {
    font-weight: 800;
    letter-spacing: .2px;
    line-height: 1.15;
    font-size: 1.02rem;
}

#modalPreviewDevis .pv-sub {
    color: rgba(33,37,41,.65);
    font-size: .875rem;
}

/* 8) Chips (matière / type menuiserie) */
#modalPreviewDevis .pv-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .28rem .55rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: .75rem;
    border: 1px solid rgba(17,24,39,.10);
    background: rgba(255,255,255,.92);
    color: rgba(33,37,41,.86);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.65);
}

    #modalPreviewDevis .pv-chip i {
        font-size: .95em;
        opacity: .85;
    }

/* 9) Summary montants (bloc à droite) */
#modalPreviewDevis .pv-summary {
    background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(248,250,252,.95) 100%);
    border: 1px solid var(--pv-accent-3, rgba(107,114,128,.10));
    border-left: 5px solid var(--pv-accent, #6b7280);
    border-radius: 14px;
    padding: .75rem .85rem;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.75), 0 4px 10px rgba(16,24,40,.06);
}

#modalPreviewDevis .pv-summary-title {
    font-weight: 900;
    font-size: .85rem;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--pv-accent, #6b7280);
    display: flex;
    align-items: center;
    gap: .45rem;
}

    #modalPreviewDevis .pv-summary-title::before {
        content: "";
        width: 10px;
        height: 10px;
        border-radius: 999px;
        background: var(--pv-accent, #6b7280);
        box-shadow: 0 0 0 3px var(--pv-accent-3, rgba(107,114,128,.10));
    }

#modalPreviewDevis .pv-summary-qty {
    display: flex;
    align-items: baseline;
    gap: .35rem;
    padding: .18rem .5rem;
    border-radius: 999px;
    border: 1px solid rgba(17,24,39,.10);
    background: rgba(255,255,255,.7);
    font-size: .85rem;
}

#modalPreviewDevis .pv-summary-qty-val {
    font-weight: 900;
    font-size: 1rem;
    color: rgba(17,24,39,.92);
}

#modalPreviewDevis .pv-summary-lines {
    margin-top: .55rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

#modalPreviewDevis .pv-srow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .90rem;
    color: rgba(17,24,39,.78);
}

#modalPreviewDevis .pv-sval {
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    color: rgba(17,24,39,.92);
}

#modalPreviewDevis .pv-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(17,24,39,.12), transparent);
    margin: .25rem 0;
}

#modalPreviewDevis .pv-srow.pv-total span:first-child {
    font-weight: 900;
    color: rgba(17,24,39,.88);
}

#modalPreviewDevis .pv-srow.pv-total .pv-sval {
    font-size: 1.02rem;
}

/* 10) Sections (Dormant / Vitrage / Volet roulant) rendues par renderSection() */
#modalPreviewDevis .pv-section {
    margin-top: .65rem;
    border: 1px solid rgba(17,24,39,.10);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

#modalPreviewDevis .pv-section-h {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .55rem .75rem;
    background: linear-gradient(180deg, rgba(248,249,250,.95), rgba(255,255,255,.92));
    border-bottom: 1px solid rgba(17,24,39,.08);
}

#modalPreviewDevis .pv-section-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 900;
    font-size: .88rem;
    color: rgba(33,37,41,.85);
}

#modalPreviewDevis .pv-section-body {
    padding: .65rem .75rem;
}

/* Empty state */
#modalPreviewDevis .pv-empty {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem .75rem;
    border-radius: 10px;
    background: rgba(108,117,125,.06);
    border: 1px dashed rgba(108,117,125,.25);
    color: rgba(33,37,41,.65);
    font-weight: 650;
}

    #modalPreviewDevis .pv-empty i {
        color: rgba(108,117,125,.75);
    }

/* 11) Spec grid (renderSpecGrid) */
#modalPreviewDevis .pv-specgrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .35rem .75rem;
    margin: 0;
}

@media (min-width: 992px) {
    #modalPreviewDevis .pv-specgrid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

#modalPreviewDevis .pv-spec dt {
    margin: 0;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: rgba(33,37,41,.55);
    font-weight: 800;
    white-space: nowrap;
}

#modalPreviewDevis .pv-spec dd {
    margin: 0;
    font-size: .86rem;
    color: rgba(33,37,41,.88);
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 12) Groups (renderGroup) */
#modalPreviewDevis .pv-group {
    margin: 0 0 .65rem 0;
}

    #modalPreviewDevis .pv-group:last-child {
        margin-bottom: 0;
    }

#modalPreviewDevis .pv-group-title {
    font-size: .75rem;
    font-weight: 900;
    color: rgba(33,37,41,.72);
    margin-bottom: .35rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

#modalPreviewDevis .pv-group-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .35rem .75rem;
}

@media (min-width: 992px) {
    #modalPreviewDevis .pv-group-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

#modalPreviewDevis .pv-kv {
    display: flex;
    gap: .45rem;
    min-width: 0;
}

    #modalPreviewDevis .pv-kv .k {
        font-size: .72rem;
        font-weight: 900;
        color: rgba(33,37,41,.55);
        text-transform: uppercase;
        letter-spacing: .04em;
        white-space: nowrap;
    }

    #modalPreviewDevis .pv-kv .v {
        font-size: .86rem;
        font-weight: 650;
        color: rgba(33,37,41,.88);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

/* 13) Volet/Vitrage/VRI block si buildVriContent() renvoie .pv-vri */
#modalPreviewDevis .pv-vri {
    margin-top: .45rem;
    border-radius: 12px;
    padding: .45rem .55rem;
    background: linear-gradient(90deg, var(--pv-accent-3, rgba(107,114,128,.10)), rgba(255,255,255,0) 60%);
    border-left: 4px solid var(--pv-accent, #6b7280);
}

#modalPreviewDevis .pv-vri-header {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-weight: 900;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--pv-accent, #6b7280);
    margin-bottom: .2rem;
}

#modalPreviewDevis .pv-vri-content {
    font-size: .85rem;
    color: rgba(17,24,39,.85);
    padding-left: 1.35rem;
}

/* 14) Sécurité : si ton code injecte des badges en haut à droite */
#modalPreviewDevis .pv-line-card .position-absolute.top-0.end-0 {
    display: flex;
    gap: .45rem;
    align-items: center;
    padding: .1rem;
    z-index: 2;
}

/* 15) Mobile : summary full width plus agréable */
@media (max-width: 767.98px) {
    #modalPreviewDevis .pv-summary {
        margin-top: .35rem;
    }
}

/* HEADER GLOBAL */
.nb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-radius: 16px;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(2,6,23,.08);
    border: 1px solid rgba(15, 23, 42, .08);
    gap: 20px; /* ✅ Ajoute de l’air entre gauche et droite */
}

/* LEFT */
.nb-welcome {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0F172A;
}

.nb-user {
    font-weight: 900;
    color: #0B4AA2;
}

.nb-sub {
    font-size: .85rem;
    color: #64748B;
    margin-top: 2px;
}

/* CLIENT PILL */
.nb-client-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(11,74,162,.06), rgba(245,165,36,.05));
    border: 1px solid rgba(15, 23, 42, .08);
    transition: .2s ease;
}

    .nb-client-pill:hover {
        transform: translateY(-1px);
        box-shadow: 0 8px 20px rgba(2,6,23,.10);
    }

/* ICON */
.nb-client-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(11,74,162,.1);
    font-size: 15px;
}

/* CONTENT */
.nb-client-label {
    font-size: .72rem;
    color: #64748B;
    font-weight: 700;
    text-transform: uppercase;
}

.nb-client-name {
    font-size: .95rem;
    font-weight: 800;
    color: #0F172A;
    white-space: nowrap;
}

/* ACTION */
.nb-client-action {
    margin-left: 10px;
    border: 0;
    background: transparent;
    font-weight: 900;
    font-size: .85rem;
    color: #0B4AA2;
    padding: 6px 10px;
    border-radius: 10px;
    transition: .2s;
}

    .nb-client-action:hover {
        background: rgba(11,74,162,.08);
    }

.form-select.is-valid {
    border-color: #198754; /* vert bootstrap */
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
    background-color: #f6fffa;
}

.form-select.is-empty {
    border-color: #dc3545; /* optionnel rouge si vide */
}

.vr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 10px;
}

.vr-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    .vr-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    }

.vr-card-header {
    font-weight: 600;
    font-size: 13px;
    color: #6b7280;
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.vr-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px dashed #eee;
}

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

.vr-label {
    font-size: 12px;
    color: #9ca3af;
}

.vr-value {
    font-size: 13px;
    font-weight: 500;
    color: #111827;
}


#clientInfosAccordion .card {
    border-radius: 14px;
}

#clientInfosAccordion button {
    transition: all .2s ease;
}

    #clientInfosAccordion button:hover {
        background: #f8fafc;
    }

#clientInfosAccordion .collapse.show {
    animation: fadeIn .25s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}