/* V187 — Densité intelligente : chaque page tient au maximum dans l'écran (grille adaptative, cartes côte à côte, tableaux à défilement interne, en-têtes fixes). Visuel uniquement. */
html body .djf-main,html body #main .djf-main{max-width:none!important;width:100%!important;margin:0!important;padding:10px 14px 14px!important;box-sizing:border-box;display:block!important;column-width:350px;column-gap:12px;column-fill:balance}
html body .djf-main>*,html body #main .djf-main>*{min-width:0;margin-top:0!important;margin-bottom:10px!important;break-inside:avoid;box-sizing:border-box}
html body .djf-main>:is(#ag-root,#dp-root,.dp-root,.ag-root),html body #main .djf-main>:is(#ag-root,#dp-root,.dp-root,.ag-root){display:contents!important}
html body .djf-main>:is(h1,.djf-lead,.djf-sub,.sub,.dakar-hero,.dp-cards,.presence-hero,.cards,.msg,.err,.ok,[data-full]),html body #main .djf-main>:is(h1,.djf-lead,.djf-sub,.sub,.dakar-hero,.dp-cards,.presence-hero,.cards,.msg,.err,.ok,[data-full]),html body .djf-main>.card:has(table),html body #main .djf-main>.card:has(table),html body .djf-main>.card:has(.table-wrap),html body #main .djf-main>.card:has(.table-wrap),html body .djf-main>.card:has(textarea),html body #main .djf-main>.card:has(textarea),html body .djf-main>.card:has(.djf-inline>:nth-child(7)),html body #main .djf-main>.card:has(.djf-inline>:nth-child(7)),html body .djf-main>section.card,html body #main .djf-main>section.card,html body .djf-main :is(#ag-root,#dp-root)>:is(h1,.dp-cards,section.card,.card:has(table)),html body #main .djf-main :is(#ag-root,#dp-root)>:is(h1,.dp-cards,section.card,.card:has(table)){column-span:all}
html body .djf-main>h2,html body #main .djf-main>h2{font-size:13px!important;margin:0 0 4px!important;break-after:avoid;color:#10285b}
html body .djf-main>p:not(.djf-lead):not(.djf-msg),html body #main .djf-main>p:not(.djf-lead):not(.djf-msg){break-inside:avoid}
html body .djf-main .djf-inline>:is(button,.btn),html body #main .djf-main .djf-inline>:is(button,.btn){white-space:nowrap}
html body .djf-title,html body #main .djf-title,html body .djf-main>h1,html body #main .djf-main>h1{font-size:18px!important;line-height:1.2!important;margin:0!important;padding:0!important}
html body .djf-main .card>:is(h2,h3,h4),html body #main .djf-main .card>:is(h2,h3,h4),html body .djf-main .card :is(h2,h3):first-child,html body #main .djf-main .card :is(h2,h3):first-child{font-size:14px!important;line-height:1.25!important;margin:0 0 8px!important}
html body .djf-main p,html body #main .djf-main p,html body .djf-main .hint,html body #main .djf-main .hint,html body .djf-main .intro,html body #main .djf-main .intro{font-size:12.5px!important;line-height:1.4!important;margin:0 0 6px}
html body .djf-main .djf-inline,html body #main .djf-main .djf-inline,html body .djf-main #tGrid,html body #main .djf-main #tGrid,html body .djf-main :is(div,section):has(>label+label),html body #main .djf-main :is(div,section):has(>label+label){grid-template-columns:repeat(auto-fit,minmax(min(100%,128px),1fr))!important;gap:6px 8px!important;margin:4px 0!important}
html body .djf-main label,html body #main .djf-main label{font-size:12px!important}
html body .djf-main .card,html body #main .djf-main .card,html body .djf-main section.card,html body #main .djf-main section.card{padding:10px 12px!important;margin:0!important;border-radius:12px!important}
html body .djf-main .card>h2+p,html body #main .djf-main .card>h2+p,html body .djf-main .card>h3+p,html body #main .djf-main .card>h3+p{margin-top:-2px}
html body .djf-main .table-wrap,html body #main .djf-main .table-wrap{max-height:calc(100vh - 250px);overflow:auto;border-radius:10px}
html body .djf-main table th,html body #main .djf-main table th,html body .djf-main table td,html body #main .djf-main table td{padding:6px 10px!important;font-size:12.5px!important;line-height:1.3!important}
html body .djf-main table thead th,html body #main .djf-main table thead th{position:sticky;top:0;z-index:2}
html body .djf-main table tbody tr:hover td,html body #main .djf-main table tbody tr:hover td{background:#f1f8f3}
html body .djf-main .dp-tools,html body #main .djf-main .dp-tools,html body .djf-main .ag-head,html body #main .djf-main .ag-head,html body .djf-main .toolbar,html body #main .djf-main .toolbar,html body .djf-main .tools,html body #main .djf-main .tools{display:flex;flex-wrap:wrap;gap:6px 8px;align-items:center;margin:0 0 6px}
html body .djf-main .dp-cards,html body #main .djf-main .dp-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px}
html body .djf-main .dp-cards>*,html body #main .djf-main .dp-cards>*,html body .djf-main .stat,html body #main .djf-main .stat{padding:8px 12px!important;border-radius:10px!important}
html body .djf-main .stat strong,html body #main .djf-main .stat strong,html body .djf-main .dp-cards strong,html body #main .djf-main .dp-cards strong{font-size:20px!important;line-height:1.1}
html body .djf-top .djf-bar,html body #main .djf-top .djf-bar{padding-top:4px!important;padding-bottom:4px!important}
html body .djf-nav,html body #main .djf-nav{padding:4px 14px!important;gap:5px!important}
html body .djf-nav a,html body #main .djf-nav a{padding:5px 11px!important;font-size:12.5px!important;line-height:1.2!important}
html body .pres,html body #main .pres{padding:10px 14px!important;max-width:none!important}
html body .presence-hero,html body #main .presence-hero{padding:12px 16px!important;margin-bottom:10px!important;border-radius:12px!important;flex-direction:row!important;align-items:center!important}
html body .presence-hero h2,html body #main .presence-hero h2{font-size:19px!important}
html body .pres .cards,html body #main .pres .cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px!important;margin-bottom:10px!important}
html body .presence-panel,html body #main .presence-panel{padding:10px 12px!important;border-radius:12px!important}
html body .dakar-hero,html body #main .dakar-hero{padding:10px 14px!important;border-radius:12px!important}
html body .dakar-steps,html body #main .dakar-steps{gap:6px!important;margin:6px 0 0!important}

/* Mobile : retour à une colonne */
@media(max-width:700px){html body :is(.djf-main,#main .djf-main){column-width:auto!important;columns:1!important;padding:8px!important}html body .pres .cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* Écrans très larges : 3 colonnes pour les petites cartes */
@media(min-width:1700px){html body :is(.djf-main,#main .djf-main){column-width:420px}}

/* Contenu intégré : ne force plus 100 % de la hauteur de l'écran */
html body #main #ext,html body #main .djf-page-in{min-height:0!important}
html body #main #ext>.djf-main{flex:0 0 auto}
/* ===== Application principale (index.html) : le tableau de bord tient dans l'écran ===== */
html body #main .dash{min-height:540px!important}
html body #main .dash .k{min-height:70px!important;padding:.55em .8em!important}
html body #main .dash .k strong{font-size:1.6em!important}
html body #main .dash .wf{padding:.35em .7em .45em!important}
html body #main .dash .left{grid-template-rows:auto minmax(0,1fr) auto!important}
html body #main .dash .b3{min-height:0}
html body #main .dash .b3 .cb{overflow:auto;max-height:100%;padding:.4em .7em!important;font-size:.9em}
html body #main .dash .dj-empty-period{font-size:11px!important;line-height:1.3;margin:4px 0!important}
html body #main .dash .qa{grid-template-columns:repeat(9,minmax(0,1fr));gap:6px!important}
html body #main .dash .qa .a{padding:.45em .3em!important;font-size:.85em}
html body #main .dash .qt{margin:0!important;font-size:.95em!important}
html body #main table th,html body #main table td{padding:6px 9px;font-size:12.5px;line-height:1.3}
html body #main .tb{gap:6px 8px;margin-bottom:6px}
html body #main .top h1{font-size:18px}

/* ===== Présences & connexions : catégories côte à côte, carte et visites sur une même ligne ===== */
html body .pres,html body #main .pres{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 12px;align-items:start}
html body :is(.pres,#main .pres)>:is(.presence-hero,.cards,.presence-panel:first-of-type,dialog){grid-column:1/-1}
html body :is(.pres,#main .pres) .stat{padding:8px 14px!important;border-radius:10px!important}
html body :is(.pres,#main .pres) .stat strong{font-size:22px!important;line-height:1.1;display:block}
html body :is(.pres,#main .pres) #p-device-groups{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:8px 10px}
html body :is(.pres,#main .pres) .presence-category{margin-top:0!important;padding:8px 10px!important}
html body :is(.pres,#main .pres) .empty-category{padding:8px 10px!important}
html body :is(.pres,#main .pres) .presence-section-head h3{font-size:15px!important;margin:0 0 3px!important}
html body :is(.pres,#main .pres) #presence-map{height:220px!important;min-height:0!important}
html body :is(.pres,#main .pres) .scroller{max-height:240px;overflow:auto}
html body :is(.pres,#main .pres) #p-devices-total{margin:4px 0!important}
html body :is(.pres,#main .pres) .notice{font-size:11px!important;margin:6px 0 0!important}
@media(max-width:900px){html body :is(.pres,#main .pres){grid-template-columns:minmax(0,1fr)}}
html body :is(.pres,#main .pres) #p-device-groups{grid-template-columns:repeat(auto-fit,minmax(300px,1fr))}
html body :is(.pres,#main .pres) .device-grid{display:grid!important;grid-template-columns:repeat(auto-fill,minmax(150px,1fr))!important;gap:8px!important}
html body :is(.pres,#main .pres) .device-tile{min-width:140px!important;width:auto!important}
html body :is(.pres,#main .pres) #presence-map{height:170px!important}
html body :is(.pres,#main .pres) .presence-hero{padding:9px 16px!important}
html body :is(.pres,#main .pres) .presence-hero .intro{font-size:12px!important}
html body :is(.pres,#main .pres) .presence-panel{margin:0!important}
