/* Passion Élite — thème futuriste (sombre / clair) — couche visuelle uniquement */
html[data-pe]{--bg:#0E0E1A;--panel:rgba(29,29,48,.66);--panel2:rgba(44,44,66,.58);--solid:#191a2c;--field:rgba(255,255,255,.05);--border:rgba(255,255,255,.085);--ink:#F2F2F7;--text:#D6D6E2;--muted:#A9A9BC;--muted2:#77778f;--red:#DD1521;--redl:#FF4D5A;--wine:#941D34;
  --font:"Nunito Sans",-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;--x:"Genos","Rajdhani","Arial Narrow",sans-serif;--shadow:0 10px 40px rgba(0,0,0,.35);--glassbg:rgba(18,18,32,.66);--sidebg:rgba(12,12,22,.78)}
html[data-pe="light"]{--bg:#F3F4F9;--panel:rgba(255,255,255,.80);--panel2:rgba(255,255,255,.92);--solid:#ffffff;--field:rgba(255,255,255,.95);--border:rgba(22,22,48,.11);--ink:#16162B;--text:#2f3044;--muted:#5B5B72;--muted2:#8A8AA2;--red:#D0121B;--redl:#E3242F;--shadow:0 10px 36px rgba(30,30,70,.09);--glassbg:rgba(255,255,255,.74);--sidebg:rgba(255,255,255,.82)}
html[data-pe] body{background:var(--bg)!important;color:var(--text)!important;font-family:var(--font)!important}
html[data-pe] body, html[data-pe] p, html[data-pe] span:not([class*="ri-"]):not([class*="fa"]):not([class*="la-"]), html[data-pe] a, html[data-pe] td, html[data-pe] th, html[data-pe] li, html[data-pe] label, html[data-pe] input, html[data-pe] select, html[data-pe] textarea, html[data-pe] button, html[data-pe] .btn{font-family:var(--font)!important}
html[data-pe] h1,html[data-pe] h2,html[data-pe] h3,html[data-pe] h4,html[data-pe] .card-title,html[data-pe] .header-title h4{font-family:var(--x)!important;font-weight:600!important;letter-spacing:.5px}
html[data-pe] h1{font-size:clamp(24px,3vw,34px)}html[data-pe] h2{font-size:clamp(21px,2.4vw,28px)}
#pe-bg{position:fixed;inset:0;z-index:0;pointer-events:none;display:block}
#pe-halo{position:fixed;inset:0;z-index:0;pointer-events:none;background:radial-gradient(900px 600px at 85% -10%,rgba(221,21,33,.20),transparent 60%),radial-gradient(700px 500px at -5% 105%,rgba(148,29,52,.22),transparent 60%)}
html[data-pe="light"] #pe-halo{background:radial-gradient(900px 600px at 85% -10%,rgba(221,21,33,.10),transparent 60%),radial-gradient(700px 500px at -5% 105%,rgba(148,29,52,.08),transparent 60%)}
html[data-pe] .min-h-screen,html[data-pe] body>div,html[data-pe] main{position:relative;z-index:1;background:transparent!important}
html[data-pe] nav.bg-white,html[data-pe] .content-page,html[data-pe] .wrapper{background:transparent!important}
html[data-pe] .iq-sidebar{background:var(--sidebg)!important;backdrop-filter:blur(18px) saturate(140%);-webkit-backdrop-filter:blur(18px) saturate(140%);border-right:1px solid var(--border)!important;box-shadow:none!important}
html[data-pe] .iq-top-navbar,html[data-pe] .d-block.d-lg-none>div:first-child{background:var(--glassbg)!important;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);border-bottom:1px solid var(--border)!important;box-shadow:none!important}
html[data-pe] .iq-sidebar-menu .side-menu li a,html[data-pe] .iq-sidebar-menu li a{color:var(--muted)!important;border-radius:12px!important;transition:background .2s,color .2s,box-shadow .2s}
html[data-pe] .iq-sidebar-menu li a:hover{background:var(--panel2)!important;color:var(--ink)!important}
html[data-pe] .iq-sidebar-menu li.active>a{background:linear-gradient(90deg,rgba(221,21,33,.22),rgba(221,21,33,.05))!important;color:var(--ink)!important;box-shadow:inset 3px 0 0 var(--red),0 6px 22px rgba(221,21,33,.14)}
html[data-pe] .iq-sidebar-menu li.active>a i,html[data-pe] .iq-sidebar-menu li.active>a svg{color:var(--redl)!important}
html[data-pe] .iq-sidebar-menu li ul,html[data-pe] .iq-submenu{background:transparent!important}
html[data-pe] .card:not(#pe-z){background:var(--cardbg)!important;border:1px solid var(--border)!important;border-radius:18px!important;box-shadow:var(--shadow)!important}
html[data-pe] .card-header,html[data-pe] .card-footer{background:transparent!important;border-color:var(--border)!important}
html[data-pe] .btn-primary,html[data-pe] .btn-danger{background:linear-gradient(135deg,var(--redl),var(--red) 55%,var(--wine))!important;border-color:transparent!important;color:#fff!important;box-shadow:0 8px 22px rgba(221,21,33,.28)}
html[data-pe] .btn-light,html[data-pe] .btn-secondary,html[data-pe] .btn-outline-primary,html[data-pe] .btn-outline-secondary,html[data-pe] .te-filter-btn{background:var(--panel2)!important;border:1px solid var(--border)!important;color:var(--text)!important;border-radius:12px!important;}
html[data-pe] .te-filter-btn.te-active,html[data-pe] .btn-outline-primary.active,html[data-pe] .btn-light.active{background:linear-gradient(135deg,rgba(221,21,33,.24),rgba(221,21,33,.06))!important;border-color:rgba(221,21,33,.5)!important;color:var(--ink)!important}
html[data-pe] .btn:hover{box-shadow:0 0 0 3px rgba(221,21,33,.12)}
html[data-pe] .form-control,html[data-pe] .custom-select,html[data-pe] input[type=text],html[data-pe] input[type=email],html[data-pe] input[type=number],html[data-pe] input[type=date],html[data-pe] input[type=search],html[data-pe] input[type=password],html[data-pe] select,html[data-pe] textarea{background-color:var(--field)!important;border:1px solid var(--border)!important;color:var(--ink)!important;border-radius:11px!important}
html[data-pe] .form-control:focus,html[data-pe] input:focus,html[data-pe] select:focus,html[data-pe] textarea:focus{border-color:rgba(221,21,33,.6)!important;box-shadow:0 0 0 4px rgba(221,21,33,.14)!important;outline:none}
html[data-pe] .form-control::placeholder,html[data-pe] input::placeholder{color:var(--muted2)!important}
html[data-pe] .table{color:var(--text)!important}html[data-pe] .table th,html[data-pe] .table td{border-color:var(--border)!important}
html[data-pe] .table thead th{font-family:var(--x)!important;letter-spacing:1px;color:var(--muted)!important;background:transparent!important}
html[data-pe] .table-striped tbody tr:nth-of-type(odd){background:rgba(127,127,160,.06)!important}
html[data-pe] .table-hover tbody tr:hover,html[data-pe] .table tbody tr:hover{background:rgba(221,21,33,.05)!important}
html[data-pe] .dropdown-menu,html[data-pe] .modal-content,html[data-pe] .popover,html[data-pe] .swal2-popup,html[data-pe] .flatpickr-calendar,html[data-pe] .select2-dropdown{background:var(--solid)!important;border:1px solid var(--border)!important;color:var(--text)!important;border-radius:16px!important;box-shadow:0 24px 70px rgba(0,0,0,.35)!important}
html[data-pe] .dropdown-item{color:var(--text)!important}html[data-pe] .dropdown-item:hover{background:rgba(221,21,33,.08)!important}
html[data-pe] .modal-header,html[data-pe] .modal-footer{border-color:var(--border)!important}
html[data-pe] hr{border-color:var(--border)!important}
html[data-pe] .apexcharts-text,html[data-pe] .apexcharts-legend-text,html[data-pe] .apexcharts-title-text{fill:var(--muted)!important;color:var(--muted)!important}
html[data-pe] .apexcharts-gridline,html[data-pe] .apexcharts-xaxis-tick{stroke:var(--border)!important}
html[data-pe] .apexcharts-tooltip{background:var(--solid)!important;color:var(--text)!important;border-color:var(--border)!important}
html[data-pe] *::-webkit-scrollbar{width:9px;height:9px}html[data-pe] *::-webkit-scrollbar-thumb{background:rgba(127,127,160,.28);border-radius:9px}html[data-pe] *::-webkit-scrollbar-thumb:hover{background:rgba(221,21,33,.45)}
html[data-pe] .change-mode{display:none!important}
.pe-toggle{width:40px;height:40px;border-radius:12px;border:1px solid var(--border);background:var(--panel2);color:var(--ink);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;font-size:17px;transition:.2s;flex:none;margin:0 8px;padding:0;line-height:1}
.pe-toggle:hover{border-color:rgba(221,21,33,.5);box-shadow:0 0 0 3px rgba(221,21,33,.12)}
@media (max-width:991px){.pe-toggle{width:36px;height:36px;font-size:15px;margin:0 4px}}

/* ---- Page de connexion (layout guest) ---- */
html[data-pe] .auth-page{background:transparent!important;background-image:none!important}
html[data-pe] .auth-page::before,html[data-pe] .auth-page::after{display:none!important}
html[data-pe] .grid-overlay,html[data-pe] #raysCanvas{display:none!important}
html[data-pe] .login-card{background:var(--panel)!important;border:1px solid var(--border)!important;border-radius:24px!important;max-width:420px;width:100%;padding:36px 32px 26px!important;backdrop-filter:blur(22px) saturate(140%);-webkit-backdrop-filter:blur(22px) saturate(140%);box-shadow:0 30px 90px rgba(0,0,0,.45)!important;overflow:hidden}
html[data-pe="light"] .login-card{box-shadow:0 30px 80px rgba(30,30,70,.14)!important}
html[data-pe] .login-card::before{content:"";position:absolute;left:24px;right:24px;top:0;height:2px;background:linear-gradient(90deg,transparent,var(--red),transparent);border-radius:2px}
html[data-pe] .logo-wrapper{background:transparent!important;border:0!important;box-shadow:none!important;width:auto!important;height:auto!important}
html[data-pe] .logo-wrapper img{width:96px!important;height:auto!important;filter:drop-shadow(0 8px 26px rgba(221,21,33,.35))}
html[data-pe] .brand-label{font-family:var(--x)!important;letter-spacing:4px!important;font-size:14px!important;color:var(--redl)!important}
html[data-pe] .login-card h4{font-family:var(--x)!important;font-size:30px!important;color:var(--ink)!important;letter-spacing:1px}
html[data-pe] .login-card .text-white{color:var(--ink)!important}
html[data-pe] .text-muted-soft{color:var(--muted)!important}
html[data-pe] .input-dark{background:var(--field)!important;border:1px solid var(--border)!important;border-radius:13px!important;box-shadow:none!important;transition:.2s;display:flex;align-items:center}
html[data-pe] .input-dark:focus-within{border-color:rgba(221,21,33,.6)!important;box-shadow:0 0 0 4px rgba(221,21,33,.14)!important}
html[data-pe] .input-dark input{background:transparent!important;border:0!important;box-shadow:none!important;color:var(--ink)!important;outline:none!important}
html[data-pe] .input-dark .input-icon{color:var(--redl)!important}
html[data-pe] .login-card form button[type=submit],html[data-pe] .login-card .btn{background:linear-gradient(135deg,var(--redl),var(--red) 55%,var(--wine))!important;border:0!important;color:#fff!important;border-radius:13px!important;font-weight:800!important;letter-spacing:.5px;box-shadow:0 12px 30px rgba(221,21,33,.35)!important}
html[data-pe] .login-card label,html[data-pe] .login-card .form-check-label{color:var(--muted)!important}
html[data-pe] .auth-page footer,html[data-pe] .auth-page .copyright,html[data-pe] body footer{color:var(--muted2)!important}

/* ================= v2 : couleurs apaisées, polices partout, grilles responsives ================= */
html[data-pe]{--tile:rgba(255,255,255,.035);--cardbg:rgba(24,24,40,.88)}
html[data-pe="light"]{--tile:rgba(255,255,255,.92);--cardbg:rgba(255,255,255,.90)}
html[data-pe] body :where(*:not(i,svg,svg *,.fa,.fas,.far,.fab,.fal,.fad,[class*="fa-"],[class*="ri-"],[class*="la-"],.la,.las,.lab,.lar,.material-icons,[class*="icon-"])){font-family:var(--font)!important}
html[data-pe] h1,html[data-pe] h2,html[data-pe] h3,html[data-pe] h4,html[data-pe] .card-title,html[data-pe] .header-title h4,html[data-pe] .table thead th{font-family:var(--x)!important}
html[data-pe] [data-pe-tile]{background:var(--tile)!important;background-image:none!important;border:1px solid var(--border)!important;box-shadow:inset 3px 0 0 var(--pe-acc),0 6px 18px rgba(0,0,0,.06)!important;border-radius:14px!important}
html[data-pe="dark"] [data-pe-surf]{background:var(--tile)!important;background-image:none!important}
html[data-pe] [data-pe-surf]{border-color:var(--border)!important}
html[data-pe="dark"] [data-pe-bg]{background:var(--pe-b)!important;background-image:none!important;color:var(--pe-bt)!important}
html[data-pe] [data-pe-bd]{border-color:var(--border)!important}
html[data-pe] [data-pe-tt="big"]{color:var(--ink)!important}
html[data-pe] [data-pe-tt="sm"]{color:var(--muted)!important}
html[data-pe="dark"] [data-pe-col]{color:var(--pe-c)!important}
html[data-pe] [data-pe-stack]{display:flex!important;flex-direction:column!important}
html[data-pe] [data-pe-stack]>[data-pe-tile],html[data-pe] [data-pe-stack]>[data-pe-surf]{flex:1 1 auto}
@media (max-width:1199px){html[data-pe] [data-pe-grid="5"],html[data-pe] [data-pe-grid="6"]{grid-template-columns:repeat(3,minmax(0,1fr))!important}}
@media (max-width:991px){html[data-pe] [data-pe-grid="4"],html[data-pe] [data-pe-grid="5"],html[data-pe] [data-pe-grid="6"]{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media (max-width:767px){html[data-pe] [data-pe-grid="3"]{grid-template-columns:minmax(0,1fr)!important}}
@media (max-width:575px){html[data-pe] [data-pe-grid]{grid-template-columns:minmax(0,1fr)!important}}
@media (max-width:767px){
  html[data-pe] [data-pe-wrap]{flex-wrap:wrap!important;row-gap:8px}
  html[data-pe] .dataTables_wrapper,html[data-pe] .table-responsive{overflow-x:auto;-webkit-overflow-scrolling:touch}
  html[data-pe] .content-page{padding-left:10px!important;padding-right:10px!important}
  html[data-pe] .card:not(#pe-z){border-radius:16px!important}
  html[data-pe] .card-body{padding:16px!important}
}
html[data-pe-auth] .pe-toggle{display:none!important}

/* variables par élément (valeurs posées en ligne par pe-theme.js) */
html[data-pe="light"] [data-pe-bg]{--pe-bv:var(--pe-bo);--pe-btv:var(--pe-bto);--pe-bi:var(--pe-bio,none)}
html[data-pe="dark"] [data-pe-bg]{--pe-bv:var(--pe-b);--pe-btv:var(--pe-bt);--pe-bi:none}
html[data-pe="light"] [data-pe-surf]{--pe-sv:var(--pe-so);--pe-si:var(--pe-sio,none)}
html[data-pe="dark"] [data-pe-surf]{--pe-sv:var(--tile);--pe-si:none}
html[data-pe="light"] [data-pe-col]{--pe-cv:var(--pe-co)}
html[data-pe="dark"] [data-pe-col]{--pe-cv:var(--pe-c)}

/* ---- v2.1 : DataTables, ApexCharts, menus ---- */
html[data-pe] .apexcharts-legend-text,html[data-pe] .apexcharts-text,html[data-pe] .apexcharts-datalabel,html[data-pe] .apexcharts-tooltip *{font-family:var(--font)!important}
html[data-pe] .apexcharts-menu,html[data-pe] .apexcharts-xaxistooltip,html[data-pe] .apexcharts-yaxistooltip{background:var(--solid)!important;color:var(--text)!important;border-color:var(--border)!important}
html[data-pe] .apexcharts-menu-item:hover{background:rgba(221,21,33,.1)!important}
html[data-pe] .apexcharts-xaxistooltip-bottom:before,html[data-pe] .apexcharts-xaxistooltip-bottom:after{border-bottom-color:var(--solid)!important}
html[data-pe] .dataTables_wrapper label{background:transparent!important;color:var(--muted)!important}
html[data-pe] .dataTables_wrapper select,html[data-pe] .dataTables_length select{background-color:var(--field)!important;color:var(--ink)!important;border:1px solid var(--border)!important;border-radius:9px!important}
html[data-pe] .dataTables_info{color:var(--muted)!important}
html[data-pe] .dataTables_paginate .paginate_button,html[data-pe] .page-link{background:var(--panel2)!important;border:1px solid var(--border)!important;color:var(--text)!important;border-radius:9px!important;margin:0 2px}
html[data-pe] .dataTables_paginate .paginate_button.current,html[data-pe] .page-item.active .page-link{background:linear-gradient(135deg,rgba(221,21,33,.3),rgba(221,21,33,.1))!important;border-color:rgba(221,21,33,.55)!important;color:var(--ink)!important}
html[data-pe] .dataTables_paginate .paginate_button.disabled{opacity:.45}
html[data-pe] .nav-tabs{border-color:var(--border)!important}html[data-pe] .nav-tabs .nav-link{color:var(--muted)!important;background:transparent!important;border-color:transparent!important}
html[data-pe] .nav-tabs .nav-link.active,html[data-pe] .nav-pills .nav-link.active{color:var(--ink)!important;background:linear-gradient(135deg,rgba(221,21,33,.22),rgba(221,21,33,.06))!important;border-color:rgba(221,21,33,.45)!important}
html[data-pe] .badge{font-family:var(--font)!important;font-weight:700}
html[data-pe] .alert{border-radius:12px!important}
html[data-pe] .select2-container--default .select2-selection--single,html[data-pe] .select2-container--default .select2-selection--multiple{background:var(--field)!important;border:1px solid var(--border)!important;border-radius:11px!important;color:var(--ink)!important}
html[data-pe] .select2-container--default .select2-selection__rendered{color:var(--ink)!important}
html[data-pe] .select2-results__option--highlighted{background:rgba(221,21,33,.18)!important;color:var(--ink)!important}
html[data-pe] footer,html[data-pe] .iq-footer{background:transparent!important;color:var(--muted2)!important;border-top:1px solid var(--border)!important}

html[data-pe] .apexcharts-canvas text,html[data-pe] .apexcharts-canvas tspan{font-family:var(--font)!important}
html[data-pe] .apexcharts-xaxis-label,html[data-pe] .apexcharts-yaxis-label,html[data-pe] .apexcharts-xaxis-label tspan{fill:var(--muted)!important}

/* ---- boutons d'onglets / filtres (toutes familles *-tab-btn, *-filter-btn) ---- */
html[data-pe] button[class*="tab-btn"]:not(#pe-z),html[data-pe] button[class*="filter-btn"]:not(#pe-z){background:var(--panel2)!important;background-image:none!important;border:1px solid var(--border)!important;color:var(--text)!important;border-radius:10px!important;box-shadow:none!important;font-family:var(--font)!important}
html[data-pe] button[class*="tab-btn"]:not(#pe-z):hover,html[data-pe] button[class*="filter-btn"]:not(#pe-z):hover{border-color:rgba(221,21,33,.4)!important;color:var(--ink)!important}
html[data-pe] button[class*="tab-btn"]:not(#pe-z)[class*="active"],html[data-pe] button[class*="filter-btn"]:not(#pe-z)[class*="active"]{background:linear-gradient(135deg,rgba(221,21,33,.26),rgba(221,21,33,.07))!important;border-color:rgba(221,21,33,.55)!important;color:var(--ink)!important}

@media (max-width:767px){html[data-pe] .card-body{overflow-x:auto;-webkit-overflow-scrolling:touch}html[data-pe] .card-body>table,html[data-pe] .card-body table.table{min-width:100%}}

html[data-pe] .dataTables_filter label{background:var(--field)!important;border:1px solid var(--border)!important;border-radius:12px!important;padding:2px 10px!important;display:inline-flex!important;align-items:center;gap:6px}
html[data-pe] .dataTables_filter label:focus-within{border-color:rgba(221,21,33,.6)!important;box-shadow:0 0 0 4px rgba(221,21,33,.14)!important}
html[data-pe] .dataTables_filter input{background:transparent!important;border:0!important;box-shadow:none!important;outline:none!important;padding:6px 4px!important}
html[data-pe] .dataTables_filter label i,html[data-pe] .dataTables_filter label svg{color:var(--redl)!important}

/* Menus flottants (profil, notifications, dropdowns) : fond opaque lisible */
html[data-pe] :is(.dropdown-menu,.iq-sub-dropdown,[id$="-dropdown"],[id*="dropdown"],[style*="position:absolute"],[style*="position: absolute"],[style*="position:fixed"],[style*="position: fixed"]) [data-pe-surf],
html[data-pe] :is([id*="dropdown"],[style*="position:absolute"],[style*="position: absolute"],[style*="position:fixed"],[style*="position: fixed"])>[data-pe-surf]{--pe-sv:var(--solid)!important;--pe-si:none!important}
html[data-pe] :is(.dropdown-menu,.iq-sub-dropdown),html[data-pe] .iq-sub-dropdown .card:not(#pe-z),html[data-pe] [id*="dropdown"]>div:first-child{background:var(--solid)!important;background-image:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;box-shadow:0 22px 60px rgba(0,0,0,.55),0 0 0 1px var(--border)!important}
html[data-pe="light"] :is(.dropdown-menu,.iq-sub-dropdown),html[data-pe="light"] [id*="dropdown"]>div:first-child{box-shadow:0 22px 50px rgba(20,20,40,.18),0 0 0 1px var(--border)!important}

/* Menu profil (mobile + desktop) */
html[data-pe] [id*="profile-dropdown"] a[href]:not(#pe-z),html[data-pe] [id*="dropdown"] a[href$="/profile"]:not(#pe-z){background:var(--panel2)!important;border:1px solid var(--border)!important;color:var(--text)!important;transition:border-color .2s,background .2s}
html[data-pe] [id*="profile-dropdown"] a[href]:not(#pe-z):hover{border-color:rgba(221,21,33,.5)!important;background:rgba(221,21,33,.08)!important}
html[data-pe] [id*="dropdown"] a[href*="logout"]:not(#pe-z),html[data-pe] [id*="profile-dropdown"] a[href*="logout"]:not(#pe-z){background:linear-gradient(135deg,rgba(221,21,33,.22),rgba(221,21,33,.06))!important;border:1px solid rgba(221,21,33,.5)!important}
html[data-pe] [id*="profile-dropdown"] a[href] *:not(#pe-z){color:var(--ink)!important}
html[data-pe] [id*="profile-dropdown"] p:not(#pe-z){color:var(--ink)!important}
html[data-pe] [id*="profile-dropdown"] p+p:not(#pe-z){color:var(--muted)!important}
html[data-pe] [id*="profile-dropdown"] span[style*="border-radius:20px"]:not(#pe-z),html[data-pe] [id*="profile-dropdown"] span[style*="border-radius: 20px"]:not(#pe-z){background:var(--panel2)!important;border:1px solid var(--border)!important;color:var(--text)!important}
html[data-pe] [id*="profile-dropdown"] [style*="border-top"]:not(#pe-z){border-top-color:var(--border)!important}
html[data-pe] [id*="profile-dropdown"] [style*="linear-gradient"][style*="border-radius:50%"]:not(#pe-z){background:linear-gradient(135deg,#DD1521,#7a0c16)!important;border-color:var(--solid)!important;box-shadow:0 0 0 1px rgba(221,21,33,.4),0 8px 24px rgba(221,21,33,.35)!important}
html[data-pe] [id*="profile-dropdown"] [style*="linear-gradient"][style*="border-radius:50%"] span:not(#pe-z){color:#fff!important}
/* Menu profil desktop (.iq-user-dropdown) */
html[data-pe] .iq-user-dropdown>div:first-child:not(#pe-z),html[data-pe] .iq-user-dropdown [data-pe-surf]{--pe-sv:var(--solid)!important;background:var(--solid)!important;backdrop-filter:none!important;box-shadow:0 22px 60px rgba(0,0,0,.55),0 0 0 1px var(--border)!important;border-color:var(--border)!important}
html[data-pe="light"] .iq-user-dropdown>div:first-child:not(#pe-z){box-shadow:0 22px 50px rgba(20,20,40,.18),0 0 0 1px var(--border)!important}
html[data-pe] :is([id*="profile-dropdown"],.iq-user-dropdown) a[href]:not([style*="position: absolute"]):not([style*="position:absolute"]):not(#pe-z){background:var(--panel2)!important;background-image:none!important;border:1px solid var(--border)!important;color:var(--text)!important;opacity:1!important}
html[data-pe] :is([id*="profile-dropdown"],.iq-user-dropdown) a[href]:not([style*="position: absolute"]):not([style*="position:absolute"]):not(#pe-z):hover{border-color:rgba(221,21,33,.5)!important;background:rgba(221,21,33,.08)!important}
html[data-pe] :is([id*="profile-dropdown"],.iq-user-dropdown) a[href*="logout"]:not(#pe-z),html[data-pe] :is([id*="profile-dropdown"],.iq-user-dropdown) form button:not(#pe-z){background:linear-gradient(135deg,rgba(221,21,33,.22),rgba(221,21,33,.06))!important;border:1px solid rgba(221,21,33,.5)!important;color:var(--ink)!important}
html[data-pe] :is([id*="profile-dropdown"],.iq-user-dropdown) a[href]:not([style*="position: absolute"]):not([style*="position:absolute"]) *:not(i):not(svg):not(svg *):not(#pe-z),html[data-pe] :is([id*="profile-dropdown"],.iq-user-dropdown) form button *:not(#pe-z){color:var(--ink)!important;opacity:1!important}
html[data-pe] :is([id*="profile-dropdown"],.iq-user-dropdown) a[href] :is(i,svg):not(#pe-z){color:var(--redl)!important}
html[data-pe] :is([id*="profile-dropdown"],.iq-user-dropdown) [style*="border-left"]:not(#pe-z){border-left-color:var(--red)!important}
html[data-pe] :is([id*="profile-dropdown"],.iq-user-dropdown) a[style*="position: absolute"]:not(#pe-z),html[data-pe] :is([id*="profile-dropdown"],.iq-user-dropdown) a[style*="position:absolute"]:not(#pe-z){background:var(--red)!important;border-color:var(--solid)!important}
html[data-pe] :is([id*="profile-dropdown"],.iq-user-dropdown) :is(p,h4,h5,h6):not(#pe-z){color:var(--ink)!important}
html[data-pe] :is([id*="profile-dropdown"],.iq-user-dropdown) span[style*="border-radius"]:not([style*="50%"]):not(#pe-z){background:var(--panel2)!important;border:1px solid var(--border)!important;color:var(--text)!important}
html[data-pe] :is([id*="profile-dropdown"],.iq-user-dropdown) [style*="linear-gradient"][style*="50%"]:not(#pe-z),html[data-pe] .iq-user-dropdown [style*="border-radius:50%"][style*="width:60px"]:not(#pe-z),html[data-pe] .iq-user-dropdown [style*="border-radius: 50%"][style*="width: 60px"]:not(#pe-z){background:linear-gradient(135deg,#DD1521,#7a0c16)!important;border-color:var(--solid)!important;box-shadow:0 0 0 1px rgba(221,21,33,.4),0 8px 24px rgba(221,21,33,.35)!important}

/* ===== Menu latéral : icônes modernisées (tous rôles) ===== */
html[data-pe] .iq-sidebar-menu li>a{align-items:center!important}
html[data-pe] .iq-sidebar-menu li>a>i:first-child:not(.iq-arrow-right):not(.wrapper-menu):not(#pe-z){flex:0 0 34px!important;width:34px!important;height:34px!important;min-width:34px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;margin-right:12px!important;font-size:14px!important;line-height:1!important;border-radius:11px!important;background:linear-gradient(145deg,rgba(255,255,255,.07),rgba(255,255,255,.015))!important;border:1px solid var(--border)!important;color:var(--muted)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.06)!important;transition:all .22s ease!important}
html[data-pe] .iq-sidebar-menu li>a:hover>i:first-child:not(.iq-arrow-right):not(#pe-z){color:#fff!important;border-color:rgba(221,21,33,.5)!important;background:linear-gradient(145deg,rgba(221,21,33,.28),rgba(221,21,33,.06))!important;transform:translateY(-1px)}
html[data-pe] .iq-sidebar-menu li.active>a>i:first-child:not(.iq-arrow-right):not(#pe-z),html[data-pe] .iq-sidebar-menu li>a[aria-expanded="true"]>i:first-child:not(.iq-arrow-right):not(#pe-z){color:#fff!important;border-color:transparent!important;background:linear-gradient(135deg,#DD1521,#8a0d18)!important;box-shadow:0 6px 18px rgba(221,21,33,.38),inset 0 1px 0 rgba(255,255,255,.18)!important}
/* sous-menus */
html[data-pe] .iq-sidebar-menu .iq-submenu{position:relative;margin-left:22px!important;padding-left:8px!important;border-left:1px solid var(--border)!important}
html[data-pe] .iq-sidebar-menu .iq-submenu li>a>i:first-child:not(.iq-arrow-right):not(#pe-z){flex:0 0 26px!important;width:26px!important;height:26px!important;min-width:26px!important;font-size:11.5px!important;border-radius:8px!important;margin-right:10px!important;background:transparent!important;border-color:transparent!important;box-shadow:none!important}
html[data-pe] .iq-sidebar-menu .iq-submenu li>a:hover>i:first-child:not(#pe-z){background:rgba(221,21,33,.12)!important;border-color:rgba(221,21,33,.3)!important;color:var(--ink)!important;transform:none}
html[data-pe] .iq-sidebar-menu .iq-submenu li.active>a>i:first-child:not(#pe-z){background:rgba(221,21,33,.18)!important;border-color:rgba(221,21,33,.45)!important;color:#ff5a64!important;box-shadow:none!important}
/* chevrons */
html[data-pe] .iq-sidebar-menu .iq-arrow-right:not(#pe-z){font-size:11px!important;width:22px!important;height:22px!important;display:inline-flex!important;align-items:center;justify-content:center;border-radius:7px!important;color:var(--muted)!important;margin-left:auto!important;transition:transform .25s ease,color .2s!important}
html[data-pe] .iq-sidebar-menu li>a:hover .iq-arrow-right:not(#pe-z){color:var(--ink)!important}
/* bouton burger */
html[data-pe] .wrapper-menu:not(#pe-z),html[data-pe] .iq-menu-bt .wrapper-menu:not(#pe-z){width:38px!important;height:38px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;border-radius:12px!important;font-size:16px!important;background:var(--panel2)!important;border:1px solid var(--border)!important;color:var(--ink)!important;transition:all .2s!important}
html[data-pe] .wrapper-menu:not(#pe-z):hover{border-color:rgba(221,21,33,.5)!important;background:rgba(221,21,33,.14)!important}
/* mode clair */
html[data-pe="light"] .iq-sidebar-menu li>a>i:first-child:not(.iq-arrow-right):not(.wrapper-menu):not(#pe-z){background:linear-gradient(145deg,#fff,#f3f4f8)!important;box-shadow:0 1px 2px rgba(20,20,40,.06)!important}
html[data-pe="light"] .iq-sidebar-menu li>a:hover>i:first-child:not(.iq-arrow-right):not(#pe-z){color:#DD1521!important;background:#fff0f1!important}
html[data-pe="light"] .iq-sidebar-menu li.active>a>i:first-child:not(.iq-arrow-right):not(#pe-z),html[data-pe="light"] .iq-sidebar-menu li>a[aria-expanded="true"]>i:first-child:not(.iq-arrow-right):not(#pe-z){color:#fff!important;background:linear-gradient(135deg,#DD1521,#a50f1b)!important}
html[data-pe="light"] .iq-sidebar-menu .iq-submenu li>a>i:first-child:not(.iq-arrow-right):not(#pe-z){background:transparent!important;box-shadow:none!important}
html[data-pe="light"] .iq-sidebar-menu .iq-submenu li.active>a>i:first-child:not(#pe-z){color:#DD1521!important;background:#fff0f1!important}

html[data-pe] .iq-sidebar-menu .iq-submenu:not(#pe-z){margin-left:30px!important;padding-left:6px!important;margin-right:10px!important}
html[data-pe] .iq-sidebar-menu .iq-submenu li>a:not(#pe-z){padding:9px 10px 9px 8px!important;border-radius:10px!important;min-width:0}
html[data-pe] .iq-sidebar-menu .iq-submenu li>a>span:not(#pe-z){overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}

html[data-pe] .d-lg-none .wrapper-menu:not(#pe-z){visibility:visible!important;position:relative!important;z-index:5!important;pointer-events:auto!important;opacity:1!important;font-size:18px!important;padding:0!important}

/* Cartes principales : effet verre (transparence + flou), menus flottants restent opaques */
html[data-pe]{--cardbg:rgba(20,20,34,.46)}
html[data-pe="light"]{--cardbg:rgba(255,255,255,.58)}
html[data-pe] .content-page .card:not(#pe-z):not(:has(table)):not(:has(.dataTables_wrapper)){-webkit-backdrop-filter:blur(16px) saturate(140%)!important;backdrop-filter:blur(16px) saturate(140%)!important}
html[data-pe] .content-page .card:not(#pe-z):has(table){background:rgba(20,20,34,.62)!important}
html[data-pe="light"] .content-page .card:not(#pe-z):has(table){background:rgba(255,255,255,.78)!important}
html[data-pe] .content-page .card:not(#pe-z){box-shadow:0 18px 50px rgba(0,0,0,.35),inset 0 1px 0 rgba(255,255,255,.05)!important}
html[data-pe="light"] .content-page .card:not(#pe-z){box-shadow:0 14px 40px rgba(20,20,40,.08),inset 0 1px 0 rgba(255,255,255,.7)!important}
html[data-pe] .content-page .card .card:not(#pe-z){-webkit-backdrop-filter:none!important;backdrop-filter:none!important}

html[data-pe] :is([id*="profile-dropdown"],.iq-user-dropdown) a[href*="logout"]:not(#pe-z):not(#pe-y){background:linear-gradient(135deg,rgba(221,21,33,.22),rgba(221,21,33,.06))!important;border:1px solid rgba(221,21,33,.5)!important}
html[data-pe="light"] :is([id*="profile-dropdown"],.iq-user-dropdown) a[href*="logout"]:not(#pe-z):not(#pe-y){background:#fff1f2!important;border-color:rgba(221,21,33,.35)!important}
/* Mode clair : le bouton de deconnexion (static) etait recouvert par l'ombre des cartes positionnees du dessus -> peint au-dessus (retouche 29/09/2026) */
html[data-pe="light"] :is([id*="profile-dropdown"],.iq-user-dropdown) a[href*="logout"]:not(#pe-z):not(#pe-y){position:relative!important;z-index:2!important}

/* Verre plus lisible : moins de flou, plus de transparence pour laisser voir le fond */
html[data-pe]{--cardbg:rgba(20,20,34,.38)}
html[data-pe="light"]{--cardbg:rgba(255,255,255,.34)}
html[data-pe] .content-page .card:not(#pe-z):not(:has(table)):not(:has(.dataTables_wrapper)){-webkit-backdrop-filter:blur(5px) saturate(130%)!important;backdrop-filter:blur(5px) saturate(130%)!important}
html[data-pe="light"] .content-page .card:not(#pe-z){border-color:rgba(255,255,255,.75)!important;box-shadow:0 14px 40px rgba(20,20,40,.07),inset 0 1px 0 rgba(255,255,255,.9),0 0 0 1px rgba(20,20,40,.06)!important}
html[data-pe="light"] .content-page .card:not(#pe-z):has(table){background:rgba(255,255,255,.72)!important}
html[data-pe] .content-page .card:not(#pe-z):has(table){background:rgba(20,20,34,.58)!important}

/* Correctif ordre : cartes avec tableau en mode clair */
html[data-pe="light"] .content-page .card:not(#pe-z):not(#pe-y):has(table),html[data-pe="light"] .content-page .card:not(#pe-z):not(#pe-y):has(.dataTables_wrapper){background:rgba(255,255,255,.78)!important}

/* Grilles de tuiles "prod-grid-N" : colonnes adaptées à la largeur */
@media (max-width:1399px){html[data-pe] .row[class*="prod-grid-"]>[class*="col"]:not(#pe-z){flex:0 0 33.333%!important;max-width:33.333%!important}}
@media (max-width:767px){html[data-pe] .row[class*="prod-grid-"]>[class*="col"]:not(#pe-z){flex:0 0 50%!important;max-width:50%!important}}
@media (max-width:479px){html[data-pe] .row[class*="prod-grid-"]>[class*="col"]:not(#pe-z){flex:0 0 100%!important;max-width:100%!important}}
html[data-pe] .row[class*="prod-grid-"]>[class*="col"]>*{height:100%;min-width:0}
html[data-pe] .row[class*="prod-grid-"] *{min-width:0}
html[data-pe] .row[class*="prod-grid-"] [class*="badge"],html[data-pe] .row[class*="prod-grid-"] span[style*="border-radius"]{white-space:normal!important;max-width:100%;overflow-wrap:anywhere}

/* prod-grid : les tuiles s'étirent pour remplir chaque ligne (pas de trou) */
@media (max-width:1399px){html[data-pe] .row[class*="prod-grid-"]>[class*="col"]:not(#pe-z):not(#pe-y){flex:1 1 230px!important;max-width:none!important}}
@media (max-width:479px){html[data-pe] .row[class*="prod-grid-"]>[class*="col"]:not(#pe-z):not(#pe-y){flex:1 1 100%!important}}

/* ===== Lisibilité & alignement des tuiles (toutes largeurs) ===== */
/* Grilles inline 3-6 colonnes : s'adaptent à la largeur réelle disponible */
html[data-pe] [data-pe-grid]:not(#pe-z){grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr))!important}
/* Rangées prod-grid : tuiles d'au moins 240px qui remplissent la ligne */
html[data-pe] .row[class*="prod-grid-"]>[class*="col"]:not(#pe-z):not(#pe-y):not(#pe-x){flex:1 1 240px!important;max-width:none!important}
/* Jamais de mot coupé au milieu */
html[data-pe] .content-page :is([data-pe-tile],[data-pe-surf],.row[class*="prod-grid-"]) *:not(#pe-z){overflow-wrap:normal!important;word-break:normal!important;hyphens:manual!important}
html[data-pe] .row[class*="prod-grid-"] *{min-width:auto}
html[data-pe] .row[class*="prod-grid-"] [class*="badge"]:not(#pe-z),html[data-pe] .row[class*="prod-grid-"] span[style*="border-radius"]:not(#pe-z){white-space:nowrap!important;overflow-wrap:normal!important}
html[data-pe] [data-pe-tile] :is(h1,h2,h3,h4,h5,h6,b,strong){line-height:1.15}
/* ===== Anti-flash : le contenu apparaît une fois le thème appliqué ===== */
@keyframes peReveal{to{opacity:1}}
html[data-pe]:not([data-pe-ready]):not([data-pe-auth]) .content-page{opacity:0;animation:peReveal .2s ease 1.8s forwards}
html[data-pe][data-pe-ready] .content-page{opacity:1;transition:opacity .22s ease}

/* prod-grid : colonnes selon la largeur réelle de la rangée (container queries) */
html[data-pe] .row[class*="prod-grid-"]{container-type:inline-size}
html[data-pe] .row[class*="prod-grid-"]>[class*="col"]:not(#pe-z):not(#pe-y):not(#pe-x):not(#pe-w){flex:1 1 20%!important;max-width:none!important}
@container (max-width:1060px){html[data-pe] .row[class*="prod-grid-"]>[class*="col"]:not(#pe-z):not(#pe-y):not(#pe-x):not(#pe-w){flex:1 1 33.333%!important}}
@container (max-width:640px){html[data-pe] .row[class*="prod-grid-"]>[class*="col"]:not(#pe-z):not(#pe-y):not(#pe-x):not(#pe-w){flex:1 1 50%!important}}
@container (max-width:400px){html[data-pe] .row[class*="prod-grid-"]>[class*="col"]:not(#pe-z):not(#pe-y):not(#pe-x):not(#pe-w){flex:1 1 100%!important}}

html[data-pe] .row[class*="prod-grid-"]>[class*="col"]{min-width:0!important}
html[data-pe] .row[class*="prod-grid-"] [class*="badge"]:not(#pe-z):not(#pe-y),html[data-pe] .row[class*="prod-grid-"] span[style*="border-radius"]:not(#pe-z):not(#pe-y){white-space:normal!important;line-height:1.25!important}

/* Rangées Bootstrap de tuiles (partout) : pas de tuiles trop étroites */
html[data-pe] .row:has(> [class*="col"] > [data-pe-tile]):not([class*="prod-grid-"]){container-type:inline-size}
@container (max-width:1060px){html[data-pe] .row:not([class*="prod-grid-"])>[class*="col"]:has(> [data-pe-tile]):not(#pe-z){min-width:33.333%!important;max-width:none!important;flex-grow:1!important}}
@container (max-width:680px){html[data-pe] .row:not([class*="prod-grid-"])>[class*="col"]:has(> [data-pe-tile]):not(#pe-z){min-width:50%!important}}
@container (max-width:420px){html[data-pe] .row:not([class*="prod-grid-"])>[class*="col"]:has(> [data-pe-tile]):not(#pe-z){min-width:100%!important}}

/* ===================== MOBILE (≤ 575px) : vrai responsive ===================== */
@media (max-width:575px){
  html[data-pe] .content-page:not(#pe-z){padding-left:10px!important;padding-right:10px!important}
  html[data-pe] .content-page .container-fluid{padding-left:0!important;padding-right:0!important}
  html[data-pe] .content-page .card:not(#pe-z){border-radius:16px!important;margin-bottom:12px!important}
  html[data-pe] .content-page .card-body{padding:14px!important}
  html[data-pe] .content-page .card-header{padding:12px 14px!important}
  /* Titres : taille maîtrisée, pas d'interligne géant */
  html[data-pe] .content-page :is(h1,h2,h3,.h1,.h2,.h3):not(#pe-z){font-size:clamp(16px,5vw,20px)!important;line-height:1.25!important;letter-spacing:.2px!important;word-break:normal!important}
  html[data-pe] .content-page .card-header:has(:is(h1,h2,h3)),html[data-pe] .content-page .card-body:has(> :is(h1,h2,h3)){gap:8px;flex-wrap:wrap}
  /* Onglets : une seule ligne défilante (swipe) */
  html[data-pe] .content-page :has(> button[class*="tab-btn"]:nth-of-type(3)):not(#pe-z){display:flex!important;flex-wrap:nowrap!important;overflow-x:auto!important;overflow-y:hidden!important;gap:8px!important;scrollbar-width:none;-webkit-overflow-scrolling:touch;scroll-snap-type:x proximity;padding:2px 2px 6px!important;margin-right:-10px!important;-webkit-mask-image:linear-gradient(90deg,#000 85%,transparent);mask-image:linear-gradient(90deg,#000 85%,transparent)}
  html[data-pe] .content-page :has(> button[class*="tab-btn"]:nth-of-type(3))::-webkit-scrollbar{display:none}
  html[data-pe] .content-page button[class*="tab-btn"]:not(#pe-z){flex:0 0 auto!important;white-space:nowrap!important;scroll-snap-align:start;margin:0!important}
  /* Filtres période : 2 par ligne, pleine largeur */
  html[data-pe] .content-page button[class*="filter-btn"]:not(#pe-z){flex:1 1 calc(50% - 8px)!important;min-width:calc(50% - 8px)!important;white-space:nowrap!important;margin:0!important;text-align:center!important;justify-content:center}
  html[data-pe] .content-page :has(> button[class*="filter-btn"]),html[data-pe] .content-page :has(> div > button[class*="filter-btn"]){gap:8px!important}
  html[data-pe] .content-page input[type="date"]:not(#pe-z),html[data-pe] .content-page input.flatpickr-input:not(#pe-z){flex:1 1 38%!important;min-width:0!important}
  html[data-pe] .content-page button[id$="ApplyBtn"]:not(#pe-z),html[data-pe] .content-page button[id$="applyBtn"]:not(#pe-z){flex:1 1 100%!important;width:100%!important}
  /* Colonnes "label + 2 tuiles" des grilles : 2 tuiles côte à côte */
  html[data-pe] [data-pe-g] > div:has(> [data-pe-tile] + [data-pe-tile]):not(:has(> [data-pe-tile] ~ [data-pe-tile] ~ [data-pe-tile])):not(:has([style*="1fr 0.5px 1fr"])){display:grid!important;grid-template-columns:1fr 1fr!important;gap:10px!important;align-items:stretch}
  html[data-pe] [data-pe-g] > div:has(> [data-pe-tile] + [data-pe-tile]) > :not([data-pe-tile]){grid-column:1/-1}
  html[data-pe] [data-pe-g] > div:has(> [data-pe-tile] + [data-pe-tile]) > [data-pe-tile]{margin:0!important;min-width:0}
  /* Tuile scindée (B2C | B2B) : garder côte à côte */
  html[data-pe] div[style*="grid-template-columns:1fr 0.5px 1fr"]:not(#pe-z){grid-template-columns:1fr 1px 1fr!important}
  html[data-pe] div[style*="grid-template-columns:1fr 0.5px 1fr"] > div[style*="width:0.5px"]{background:var(--border)!important;display:block!important}
  html[data-pe] div[style*="grid-template-columns:1fr 0.5px 1fr"] > div[style*="padding-left"]{padding-left:12px!important;margin:0!important;border:0!important}
  /* Tuiles : typo compacte */
  html[data-pe] [data-pe-tile]:not(#pe-z){padding:12px 12px 12px 14px!important;border-radius:14px!important}
  /* Tableaux : défilement horizontal propre */
  html[data-pe] .content-page .table-responsive,html[data-pe] .content-page .dataTables_wrapper{overflow-x:auto!important;-webkit-overflow-scrolling:touch}
  html[data-pe] .content-page table th,html[data-pe] .content-page table td{white-space:nowrap}
  html[data-pe] .dataTables_wrapper .row{margin:0!important;row-gap:8px}
  html[data-pe] .dataTables_length,html[data-pe] .dataTables_filter{text-align:left!important;width:100%}
  html[data-pe] .dataTables_filter label{width:100%!important}
  html[data-pe] .dataTables_filter input{flex:1;width:100%!important;margin-left:0!important}
  html[data-pe] .dataTables_paginate{justify-content:center!important;display:flex!important;flex-wrap:wrap;gap:4px}
  /* Modales plein écran propre */
  html[data-pe] .modal-dialog{margin:10px!important;max-width:calc(100% - 20px)!important}
}

html[data-pe] div[style*="grid-template-columns:1fr 0.5px 1fr"]>div:not(#pe-z){margin-top:0!important;padding-top:0!important;align-self:start}
html[data-pe] div[style*="grid-template-columns:1fr 0.5px 1fr"]>div[style*="width:0.5px"]:not(#pe-z){align-self:stretch}

/* Barre objectif : place pour l'étiquette "100%" */
html[data-pe] div[style*="position:relative"]:has(> div > div > div[style*="top: -20px"]),html[data-pe] div[style*="position:relative"]:has(> div > div > div[style*="top:-20px"]){margin-top:16px!important}
@media (max-width:575px){
  html[data-pe] div[style*="position:relative"]:has(> div > div > div[style*="top: -20px"]),html[data-pe] div[style*="position:relative"]:has(> div > div > div[style*="top:-20px"]){margin-top:26px!important}
  /* Navigation mois : [←][Mois en cours][→] sur une ligne */
  html[data-pe] .content-page button[data-pe-arrow]:not(#pe-z):not(#pe-y){flex:0 0 46px!important;min-width:46px!important;max-width:46px!important;padding-left:0!important;padding-right:0!important}
  html[data-pe] .content-page :has(> button[data-pe-arrow]) > button[class*="filter-btn"]:not([data-pe-arrow]):not(#pe-z):not(#pe-y){flex:1 1 0!important;min-width:0!important}
  html[data-pe] .content-page :has(> button[data-pe-arrow]) > input[type="month"]:not(#pe-z),html[data-pe] .content-page :has(> button[data-pe-arrow]) > select:not(#pe-z){flex:1 1 100%!important;width:100%!important}
  html[data-pe] .content-page input[type="month"]:not(#pe-z),html[data-pe] .content-page select.form-control:not(#pe-z),html[data-pe] .content-page select.form-select:not(#pe-z){max-width:100%!important}
  /* Lignes agents / listes en tuiles : nom, puis barre pleine largeur, puis badges */
  html[data-pe] [data-pe-tile]:has(> div[style*="flex:1;min-width:0"]:nth-child(n+3)):not(#pe-z){flex-wrap:wrap!important;row-gap:8px!important}
  html[data-pe] [data-pe-tile] > div[style*="flex:1;min-width:0"]:nth-child(n+3):not(#pe-z){flex:1 1 100%!important;order:5}
  html[data-pe] [data-pe-tile] > div[style*="flex:1;min-width:0"]:nth-child(n+3) ~ *:not(#pe-z){order:6}
  html[data-pe] [data-pe-tile] > :not(:first-child):has(~ div[style*="flex:1;min-width:0"]:nth-child(n+3)):not(#pe-z){flex:1 1 0!important;width:auto!important;min-width:0!important}
  html[data-pe] [data-pe-tile] > div[style*="flex:1;min-width:0"]:nth-child(n+3) span:not(#pe-z){white-space:normal!important}
}

/* Barres de défilement discrètes */
html[data-pe] *{scrollbar-width:thin;scrollbar-color:rgba(140,140,170,.28) transparent}
html[data-pe] ::-webkit-scrollbar{width:8px;height:6px}
html[data-pe] ::-webkit-scrollbar-thumb{background:rgba(140,140,170,.28);border-radius:8px}
html[data-pe] ::-webkit-scrollbar-track{background:transparent}
@media (max-width:575px){
  html[data-pe] .content-page table:not(#pe-z){min-width:100%;width:max-content!important;table-layout:auto!important}
  html[data-pe] .content-page table th:not(#pe-z),html[data-pe] .content-page table td:not(#pe-z){padding-left:10px!important;padding-right:10px!important}
  html[data-pe] .content-page .card-body:has(> table),html[data-pe] .content-page .card-body:has(> div > table){overflow-x:auto!important}
}

@media (max-width:575px){
  /* Lignes "bloc fixe + barre flexible" (véhicules, etc.) : bloc puis barre pleine largeur */
  html[data-pe] .content-page div:has(> :first-child[style*="flex-shrink"]:not([style*="50%"]):not([style*="height"]) + div[style*="flex:1;min-width:0"]):not(#pe-z){flex-wrap:wrap!important;row-gap:10px!important}
  html[data-pe] .content-page :first-child[style*="flex-shrink"]:not([style*="50%"]):not([style*="height"]):has(+ div[style*="flex:1;min-width:0"]):not(#pe-z){flex:1 1 100%!important;width:100%!important;max-width:100%!important}
  html[data-pe] .content-page :first-child[style*="flex-shrink"]:not([style*="50%"]):not([style*="height"]) + div[style*="flex:1;min-width:0"]:not(#pe-z){flex:1 1 100%!important;padding-left:0!important;padding-right:0!important}
  html[data-pe] .content-page :first-child[style*="flex-shrink"]:not([style*="50%"]):not([style*="height"]) + div[style*="flex:1;min-width:0"] *:not(#pe-z){white-space:normal}
}

@media (max-width:575px){
  /* Cartes statistiques du template (icône fa-3x) : 2 par ligne, icône en pastille */
  html[data-pe] .content-page .row:has(> [class*="col"] > .card.p-3.w-100) > [class*="col"]:not(#pe-z){flex:0 0 50%!important;max-width:50%!important;padding-left:5px!important;padding-right:5px!important}
  html[data-pe] .content-page .row:has(> [class*="col"] > .card.p-3.w-100){margin-left:-5px!important;margin-right:-5px!important}
  html[data-pe] .content-page .card.p-3.w-100:not(#pe-z){margin-left:0!important;margin-right:0!important;padding:12px!important;min-height:104px}
  html[data-pe] .content-page .card.p-3.w-100 .row{margin:0!important;flex-wrap:wrap}
  html[data-pe] .content-page .card.p-3.w-100 .row > [class*="col"]{flex:1 1 100%!important;max-width:100%!important;padding:0!important}
  html[data-pe] .content-page .card.p-3.w-100 :is(.fa-3x,.fa-2x,.fa-4x):not(#pe-z){font-size:17px!important;width:36px;height:36px;display:inline-flex!important;align-items:center;justify-content:center;border-radius:11px;background:rgba(221,21,33,.14);border:1px solid rgba(221,21,33,.3);color:#ff6b75!important;margin-bottom:8px}
  html[data-pe="light"] .content-page .card.p-3.w-100 :is(.fa-3x,.fa-2x,.fa-4x):not(#pe-z){color:#DD1521!important;background:#fff0f1}
  html[data-pe] .content-page .card.p-3.w-100 :is(h1,h2,h3,h4,h5,h6):not(#pe-z){font-size:20px!important;margin:0!important}
}



@media (max-width:575px){
  /* Tuiles statut (icône | texte | valeur) : rester en ligne */
  html[data-pe] [data-pe-tile].d-flex:not(#pe-z){flex-direction:row!important;align-items:center!important;flex-wrap:nowrap!important;gap:12px!important;text-align:left!important}
  html[data-pe] [data-pe-tile].d-flex > :first-child:not(:only-child):not(#pe-z){flex:0 0 40px!important;width:40px!important;min-width:40px!important;height:40px!important;margin:0!important;display:flex!important;align-items:center;justify-content:center}
  html[data-pe] [data-pe-tile].d-flex > :nth-child(2):not(:last-child):not(#pe-z){flex:1 1 auto!important;min-width:0!important;width:auto!important;margin:0!important;text-align:left!important}
  html[data-pe] [data-pe-tile].d-flex > :last-child:not(:first-child):not(#pe-z){flex:0 0 auto!important;width:auto!important;margin:0 0 0 auto!important;text-align:right!important;align-self:center!important}
}

/* Menus ouverts dans une carte : passent au-dessus des cartes suivantes, fond opaque */
html[data-pe] .content-page .card:has(:is([class*="menu"].open,[class*="menu"].show,.dropdown.show,[class*="dropdown"].open)):not(#pe-z){position:relative;z-index:60!important}
html[data-pe] .content-page :is([class*="upload-menu"],[class*="-menu"].open,[class*="dropdown"].open,.dropdown-menu.show):not(#pe-z){background:var(--solid)!important;background-image:none!important;border:1px solid var(--border)!important;box-shadow:0 22px 60px rgba(0,0,0,.5)!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important;z-index:1000!important}
html[data-pe="light"] .content-page :is([class*="upload-menu"],[class*="-menu"].open,[class*="dropdown"].open,.dropdown-menu.show):not(#pe-z){box-shadow:0 18px 44px rgba(20,20,40,.16)!important}
html[data-pe] .content-page [class*="upload-menu"] :is(a,button,label,div):not(#pe-z){color:var(--text)!important}
/* Titres "primary" : rouge de la marque */
html[data-pe] .content-page .card-title.text-primary:not(#pe-z),html[data-pe] .content-page .header-title .text-primary:not(#pe-z){color:#f0303c!important}
html[data-pe="light"] .content-page .card-title.text-primary:not(#pe-z),html[data-pe="light"] .content-page .header-title .text-primary:not(#pe-z){color:#DD1521!important}
/* Champs date vides sur mobile : afficher jj/mm/aaaa */
@media (hover:none) and (pointer:coarse){
  html[data-pe] input[type="date"][data-pe-empty]:not(:focus)::before{content:attr(placeholder);color:var(--muted);opacity:.85}
  html[data-pe] input[type="date"][data-pe-empty]:not(:focus)::-webkit-datetime-edit{color:transparent}
  html[data-pe] input[type="date"]{min-height:42px;display:flex;align-items:center}
}

/* Tuile scindée (B2C | B2B) : toujours côte à côte, alignées en haut, à toutes les largeurs */
html[data-pe] div[style*="grid-template-columns:1fr 0.5px 1fr"]:not(#pe-z):not(#pe-y){display:grid!important;grid-template-columns:minmax(0,1fr) 1px minmax(0,1fr)!important;align-items:start!important;column-gap:0!important}
html[data-pe] div[style*="grid-template-columns:1fr 0.5px 1fr"] > div:not(#pe-z):not(#pe-y){margin:0!important;padding-top:0!important;border:0!important;align-self:start!important}
html[data-pe] div[style*="grid-template-columns:1fr 0.5px 1fr"] > div:first-child:not(#pe-z):not(#pe-y){padding-left:0!important;padding-right:12px!important}
html[data-pe] div[style*="grid-template-columns:1fr 0.5px 1fr"] > div:last-child:not(#pe-z):not(#pe-y){padding-left:12px!important;padding-right:0!important}
html[data-pe] div[style*="grid-template-columns:1fr 0.5px 1fr"] > div[style*="width:0.5px"]:not(#pe-z):not(#pe-y){display:block!important;width:1px!important;background:var(--border)!important;align-self:stretch!important;padding:0!important}

@media (max-width:991px){
html[data-pe] [data-pe-g] > div:has(> [data-pe-tile] + [data-pe-tile]):not(:has(> [data-pe-tile] ~ [data-pe-tile] ~ [data-pe-tile])):not(:has([style*="1fr 0.5px 1fr"])){display:grid!important;grid-template-columns:1fr 1fr!important;gap:10px!important;align-items:stretch}
html[data-pe] [data-pe-g] > div:has(> [data-pe-tile] + [data-pe-tile]) > :not([data-pe-tile]){grid-column:1/-1}
html[data-pe] [data-pe-g] > div:has(> [data-pe-tile] + [data-pe-tile]) > [data-pe-tile]{margin:0!important;min-width:0}
}
