:root{
  --bg:#eef0f4; --card:#fff; --line:#e6e8ee; --text:#1f2430; --muted:#8b93a7;
  --primary:#3b4fd1; --primary-d:#2b3aa0; --primary-soft:#eef1ff; --sidebar:#fff;
  --shadow:0 1px 3px rgba(16,24,40,.06),0 1px 2px rgba(16,24,40,.04);
  --donut-track:#eef1f6;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  background:var(--bg);color:var(--text);font-size:14px}
a{color:inherit;text-decoration:none}
.app{display:flex;min-height:100vh}

/* ── Sidebar ── */
.sidebar{width:256px;flex:0 0 256px;background:var(--sidebar);border-right:1px solid var(--line);
  display:flex;flex-direction:column;position:sticky;top:0;height:100vh}
.sb-brand{display:flex;align-items:center;gap:.7rem;padding:1rem 1.1rem;font-weight:800;font-size:1.1rem}
.sb-logo{width:30px;height:30px;display:block}
.sb-cbc-logo{height:26px;width:auto;margin-left:auto}
.sb-nav{padding:.4rem .6rem;overflow-y:auto;flex:1}
.nav-item{display:flex;align-items:center;gap:.7rem;padding:.62rem .8rem;border-radius:9px;
  color:#4a5163;font-weight:600;font-size:.86rem;cursor:pointer;margin-bottom:2px}
.nav-item:hover{background:#f4f5f8}
.nav-item.active{background:var(--primary-soft);color:var(--primary)}
.nav-item svg{width:18px;height:18px;flex:0 0 18px;stroke:currentColor;fill:none;stroke-width:1.8}
.nav-group>.nav-item .chev{margin-left:auto;transition:transform .15s}
.nav-group.open>.nav-item .chev{transform:rotate(180deg)}
.nav-sub{display:none;padding-left:.4rem;margin:.1rem 0 .3rem}
.nav-group.open .nav-sub{display:block}
.nav-sub .nav-item{font-weight:500;font-size:.83rem;padding-left:2.4rem;color:#5b6274}
.nav-sub .nav-item.active{color:var(--primary);background:transparent;position:relative}
.nav-sub .nav-item.active::before{content:"";position:absolute;left:1.5rem;top:50%;transform:translateY(-50%);
  width:6px;height:6px;border-radius:50%;background:var(--primary)}

/* ── Topbar ── */
.main{flex:1;min-width:0;display:flex;flex-direction:column}
.topbar{height:60px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;
  gap:1rem;padding:0 1.2rem;position:sticky;top:0;z-index:10}
.tb-burger{border:none;background:none;cursor:pointer;color:#6b7280;display:flex;padding:.3rem}
.tb-search{flex:1;max-width:620px;margin:0 auto;position:relative}
.tb-search input{width:100%;border:1px solid var(--line);background:#f7f8fb;border-radius:24px;
  padding:.6rem 2.6rem;font-size:.88rem;outline:none}
.tb-search input:focus{border-color:#c7ccdb;background:#fff}
.tb-search .si{position:absolute;left:1rem;top:50%;transform:translateY(-50%);color:#9aa1b2;width:18px;height:18px}
.tb-right{display:flex;align-items:center;gap:1.1rem;margin-left:auto}
.tb-icon{color:#6b7280;cursor:pointer;display:flex}
.tb-user-wrap{position:relative}
.tb-user{display:flex;align-items:center;gap:.5rem;font-weight:700;font-size:.82rem;color:#374151;cursor:pointer;text-transform:uppercase;letter-spacing:.02em;background:none;border:none;padding:.2rem}
.tb-user .av{width:30px;height:30px;border-radius:50%;background:var(--primary);color:#fff;display:flex;align-items:center;justify-content:center;font-size:.78rem}
.tb-user-menu{position:absolute;right:0;top:calc(100% + 8px);min-width:214px;background:var(--card);
    border:1px solid var(--line);border-radius:12px;box-shadow:0 12px 32px rgba(16,24,40,.18);padding:.4rem;display:none;z-index:60}
.tb-user-menu.open{display:block}
.tb-menu-row{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.5rem .7rem;font-size:.82rem;color:var(--text)}
.tb-menu-link{display:block;padding:.55rem .7rem;border-radius:8px;font-size:.82rem;color:var(--text);text-decoration:none;border-top:1px solid var(--line);margin-top:.2rem}
.tb-menu-link:hover{background:var(--primary-soft);color:var(--primary)}
.switch{position:relative;display:inline-block;width:38px;height:22px;flex:0 0 auto}
.switch input{opacity:0;width:0;height:0}
.switch .slider{position:absolute;inset:0;background:#cbd5e1;border-radius:22px;transition:.2s;cursor:pointer}
.switch .slider:before{content:"";position:absolute;height:16px;width:16px;left:3px;top:3px;background:#fff;border-radius:50%;transition:.2s}
.switch input:checked + .slider{background:var(--primary)}
.switch input:checked + .slider:before{transform:translateX(16px)}

/* ── Content ── */
.content{padding:1.4rem 1.6rem;flex:1}
.card{background:var(--card);border-radius:14px;box-shadow:var(--shadow);border:1px solid var(--line)}
.card-toolbar{display:flex;align-items:center;gap:.8rem;padding:.9rem 1.1rem;border-bottom:1px solid var(--line)}
.grow{flex:1}
.page-title{font-size:1.35rem;font-weight:800;margin:0 0 1.1rem}
.page-sub{color:var(--muted);font-size:.9rem;margin:-.7rem 0 1.3rem}

.btn{border:none;border-radius:9px;padding:.55rem 1rem;font-weight:700;font-size:.83rem;cursor:pointer;display:inline-flex;align-items:center;gap:.4rem}
.btn-primary{background:var(--primary-d);color:#fff}
.btn-primary:hover{background:#25317f}
.btn-ghost{background:#fff;border:1px solid var(--line);color:#4a5163}
.btn-ghost:hover{border-color:#c7ccdb}
.btn-danger{background:#fee2e2;color:#b91c1c}

.field{display:block;margin-bottom:1rem}
.field label{display:block;font-size:.78rem;font-weight:700;color:#4a5163;margin-bottom:.3rem}
.field input,.field select,.field textarea{width:100%;border:1.5px solid var(--line);border-radius:9px;
  padding:.55rem .7rem;font-size:.86rem;outline:none;font-family:inherit}
.field input:focus,.field textarea:focus{border-color:var(--primary)}
.hint{font-size:.75rem;color:var(--muted);margin-top:.3rem}

.table-scroll{overflow-x:auto}
.table{width:100%;border-collapse:collapse}
.table td{overflow-wrap:anywhere}
.table th{text-align:left;font-size:.7rem;text-transform:uppercase;letter-spacing:.04em;color:#8b93a7;
  font-weight:700;padding:.7rem 1.1rem;border-bottom:1px solid var(--line)}
.table td{padding:.65rem 1.1rem;border-bottom:1px solid #f1f2f6;font-size:.85rem}
.table tr:hover td{background:#fafbfc}
.contract-row{cursor:pointer}
.contract-row:hover td{background:#eef2ff}
.badge{font-size:.66rem;font-weight:700;border-radius:20px;padding:.12rem .55rem}
.badge.ok{background:#dcfce7;color:#15803d}.badge.none{background:#f1f5f9;color:#64748b}
.badge.warn{background:#fef3c7;color:#92400e}.badge.error{background:#fee2e2;color:#b91c1c}

.health-dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-left:6px;flex:0 0 auto}
.health-dot.health-warn{background:#f59e0b}.health-dot.health-error{background:#dc2626}
.health-row{display:flex;align-items:center;gap:.4rem}
.health-msg{font-size:.74rem;color:var(--muted)}

.bp-toggle{display:flex;gap:.3rem}
.bp-btn{border:1.5px solid var(--line);background:#fff;color:#94a3b8;border-radius:7px;
    padding:.28rem .55rem;font-size:.74rem;font-weight:700;cursor:pointer}
.bp-btn:hover{border-color:#c7ccdb}
.bp-btn.bp-ok.active{background:#dcfce7;border-color:#86efac;color:#15803d}
.bp-btn.bp-issue.active{background:#fef3c7;border-color:#fcd34d;color:#92400e}
.bp-btn.bp-na.active{background:#f1f5f9;border-color:#cbd5e1;color:#475569}
.bp-btn.bp-risk.active{background:#ffedd5;border-color:#fdba74;color:#9a3412}
.item-toggle{display:flex;gap:.3rem;flex:0 0 auto}

.collapsible .collapsible-body{display:none}
.collapsible.open .collapsible-body{display:block}
.collapsible .card-toolbar .chev{transition:transform .15s;flex:0 0 auto}
.collapsible.open .card-toolbar .chev{transform:rotate(180deg)}

/* ── Onglets fiche client ── */
.client-tabs{display:flex;gap:1.6rem;border-bottom:1px solid var(--line);margin-bottom:1.2rem}
.client-tab{background:none;border:none;border-bottom:2px solid transparent;padding:.3rem 0 .7rem;
    font-size:.82rem;font-weight:700;color:var(--muted);cursor:pointer;text-transform:uppercase;
    letter-spacing:.03em;display:flex;align-items:center;gap:.4rem}
.client-tab.active{color:var(--primary);border-color:var(--primary)}
.client-tab .tab-count{background:#f1f5f9;color:#64748b;border-radius:20px;font-size:.66rem;padding:.05rem .4rem}
.client-tab.active .tab-count{background:var(--primary-soft);color:var(--primary)}
.client-pane{display:none}
.client-pane.active{display:block}

/* ── Sous-onglets par catégorie (Points contrôlés) ── */
.cat-subtabs{display:flex;flex-wrap:wrap;gap:.4rem;margin-bottom:1.2rem}
.cat-subtab{background:#f6f8fb;border:1px solid var(--line);border-radius:8px;padding:.4rem .8rem;
    font-size:.8rem;font-weight:700;color:var(--muted);cursor:pointer;display:flex;align-items:center;gap:.5rem}
.cat-subtab:hover{background:#eef2f8}
.cat-subtab.active{background:var(--primary-soft);border-color:var(--primary);color:var(--primary)}
.cat-subtab-pct{font-size:.68rem;font-weight:800;color:#fff;border-radius:20px;padding:.05rem .45rem;line-height:1.5}
.cat-reorder{font-size:1rem;font-weight:800;line-height:1;color:#94a3b8;padding:0 .1rem;cursor:pointer;border-radius:4px}
.cat-reorder:hover{color:var(--primary);background:rgba(0,0,0,.05)}
.cat-subpane{display:none}
.cat-subpane.active{display:block}
.cat-subtab-ignored{color:#94a3b8;border-style:dashed}
.cat-subtab-ignored.active{background:#eef2f8;border-color:#94a3b8;color:#475569;border-style:solid}
.cat-ignored-pane.active + .cat-ignored-pane.active{margin-top:1.4rem;padding-top:1.4rem;border-top:1px solid var(--line)}
.ignored-cat-title{font-size:.8rem;font-weight:800;text-transform:uppercase;letter-spacing:.04em;color:#94a3b8;margin-bottom:.7rem}
.cat-subpane-toolbar{display:flex;justify-content:flex-end;margin-bottom:.6rem}
.cat-subpane-toolbar .cat-devices-btn{margin-left:0;text-transform:none;letter-spacing:0;font-weight:700}
/* récapitulatif de catégorie (remplace les tuiles) */
.cat-summary{display:flex;flex-wrap:wrap;gap:1.4rem;align-items:center;padding:.7rem 1.1rem;margin-bottom:1rem;
    background:#f6f8fb;border:1px solid var(--line);border-radius:10px;font-size:.82rem}
.cat-summary .cs-item{display:flex;align-items:center;gap:.35rem}
.cat-summary .cs-item b{font-weight:800}
/* détails développés directement */
.cat-details{margin-top:0;display:flex;flex-direction:column;gap:.9rem}
.pdi-inactive{opacity:.6}
.pdi{scroll-margin-top:1rem}
.pdi-hdr{display:flex;align-items:center;gap:.6rem;padding:.6rem 1.1rem;border-bottom:1px solid var(--line)}
.pdi-hdr strong{font-size:.9rem}
.pdi-score{font-size:.8rem;font-weight:800;color:var(--muted)}
.pdi.selected{box-shadow:0 0 0 2px var(--primary);transition:box-shadow .2s}

/* ── Tuiles bonnes pratiques ── */
.practice-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:1rem}
.practice-tile{background:#fff;border:1.5px solid var(--line);border-radius:12px;padding:.9rem 1rem;
    box-shadow:var(--shadow);cursor:pointer;border-left:4px solid #cbd5e1}
.practice-tile:hover{border-color:#c7ccdb}
.practice-tile.status-ok{border-left-color:#16a34a}
.practice-tile.status-issue{border-left-color:#f59e0b}
.practice-tile.status-na{border-left-color:#cbd5e1}
.practice-tile.score-full{border-left-color:#16a34a}
.practice-tile.score-partial{border-left-color:#f59e0b}
.practice-tile.score-empty{border-left-color:#dc2626}
.practice-tile-hdr{display:flex;align-items:center;justify-content:space-between;margin-bottom:.3rem}
.practice-tile-name{font-weight:800;font-size:.9rem;color:#0f172a}
.practice-tile-icon{font-size:.95rem;font-weight:800}
.practice-tile.status-ok .practice-tile-icon{color:#16a34a}
.practice-tile.status-issue .practice-tile-icon{color:#f59e0b}
.practice-tile.status-na .practice-tile-icon{color:#94a3b8}
.practice-tile.score-full .practice-tile-icon{color:#16a34a}
.practice-tile.score-partial .practice-tile-icon{color:#f59e0b}
.practice-tile.score-empty .practice-tile-icon{color:#dc2626}
.practice-tile-desc{font-size:.76rem;color:var(--muted);margin-bottom:.7rem}
.practice-tile-bar{height:6px;border-radius:4px;background:#f1f5f9;overflow:hidden;margin-bottom:.4rem}
.practice-tile-bar-fill{height:100%;background:#16a34a;border-radius:4px;transition:width .2s}
.practice-tile.score-partial .practice-tile-bar-fill{background:#f59e0b}
.practice-tile.score-empty .practice-tile-bar-fill{background:#dc2626}

.practice-check-name{display:block;font-size:.84rem;font-weight:700;color:#1e293b}
.practice-check-desc{display:block;font-size:.75rem;color:var(--muted)}

.pcheck{border-bottom:1px solid #f1f2f6}
.pcheck-row{display:flex;align-items:center;gap:.6rem;padding:.55rem 0;cursor:pointer}
.pcheck-row .practice-check-name{flex:0 0 auto}
.pcheck-row .chev{color:var(--muted);font-size:.9rem;transition:transform .15s;flex:0 0 auto}
.pcheck.open .pcheck-row .chev{transform:rotate(180deg)}
.pcheck-body{display:none;padding:0 0 .7rem 1.8rem}
.pcheck.open .pcheck-body{display:block}
.pcheck-result{font-size:.75rem;font-weight:600;color:#1e293b;background:#f8fafc;border-left:3px solid var(--primary);padding:.35rem .6rem;border-radius:4px;margin-top:.35rem}

.pcheck-dot{width:9px;height:9px;border-radius:50%;flex:0 0 auto}
.pcheck-dot-ok{background:#16a34a}
.pcheck-dot-ko{background:#dc2626}
.pcheck-dot-risk{background:#f59e0b}
.pcheck-dot-none{background:#cbd5e1}

.pcheck-error .pcheck-result{border-left-color:#b91c1c;background:#fef2f2;color:#b91c1c}
.pcheck-risk .pcheck-result{border-left-color:#f59e0b;background:#fffbeb;color:#9a3412}
.pcheck-risk-form{margin-top:.4rem}
.pcheck-risk-label{display:block;font-size:.72rem;font-weight:700;color:#9a3412;margin-bottom:.3rem}
.pcheck-risk-row{display:flex;gap:.4rem}
.risk-comment-input{flex:1;border:1.5px solid var(--line);border-radius:6px;padding:.35rem .6rem;font-size:.8rem;outline:none}
.risk-comment-input:focus{border-color:#f59e0b}

.job-vms-chev{display:inline-block;color:var(--muted);font-size:.8rem;width:.8rem}
.veeam-job-vms-body{padding:.3rem 0 .6rem}

.dg-filter-bar{display:flex;align-items:center;gap:.5rem;padding:.3rem 0 .6rem}
.dg-filter-bar label{font-size:.72rem;color:var(--muted);font-weight:700}
.dg-filter-bar select{font-size:.78rem;padding:.25rem .5rem;border:1.5px solid var(--line);border-radius:6px;background:#fff}

.hostname-suggest{position:absolute;top:100%;left:0;right:0;z-index:20;background:#fff;
    border:1.5px solid var(--line);border-radius:8px;margin-top:2px;max-height:220px;overflow-y:auto;
    box-shadow:0 4px 14px rgba(15,23,42,.1)}
.hostname-suggest-row{display:flex;align-items:center;justify-content:space-between;gap:.5rem;
    padding:.4rem .6rem;font-size:.8rem;cursor:pointer}
.hostname-suggest-row:hover{background:#f4f5f8}
.hostname-suggest-row + .hostname-suggest-row{border-top:1px solid #f1f2f6}
.device-grid-wrap{overflow-x:auto;margin-bottom:.3rem}
.device-grid{border-collapse:collapse;width:100%;font-size:.78rem}
.device-grid th,.device-grid td{padding:.4rem .6rem;border-bottom:1px solid #f1f2f6;text-align:center;white-space:nowrap}
.device-grid th{font-size:.66rem;text-transform:uppercase;letter-spacing:.03em;color:#8b93a7;font-weight:800}
.device-grid td.dg-host{text-align:left;font-weight:700;color:#0f172a}
.dg-host-meta{font-size:.7rem;font-weight:500;color:var(--muted);white-space:normal}
.dg-cell{width:24px;height:24px;border-radius:6px;display:inline-flex;align-items:center;justify-content:center;
    cursor:pointer;font-weight:800;font-size:.75rem;border:1.5px solid var(--line);user-select:none}
.dg-cell.ok{background:#dcfce7;border-color:#86efac;color:#15803d}
.dg-cell.ko{background:#fee2e2;border-color:#fca5a5;color:#b91c1c}
.dg-cell.risk{background:#ffedd5;border-color:#fdba74;color:#9a3412}
.dg-cell.none{background:#f1f5f9;border-color:#e2e8f0;color:#94a3b8}

/* Cellule de grille postes : 3 boutons (manuel) ou badge + risque accepté (auto) */
.dg-cell-wrap{white-space:nowrap}
.dg-btn{width:18px;height:18px;border-radius:5px;display:inline-flex;align-items:center;justify-content:center;
    cursor:pointer;font-weight:800;font-size:.64rem;border:1.5px solid var(--line);background:#fff;
    color:#c7ccdb;padding:0;margin:0 1px;vertical-align:middle}
.dg-btn:hover{border-color:#94a3b8;color:#64748b}
.dg-btn.dg-btn-ok.active{background:#dcfce7;border-color:#86efac;color:#15803d}
.dg-btn.dg-btn-ko.active{background:#fee2e2;border-color:#fca5a5;color:#b91c1c}
.dg-btn.dg-btn-risk.active{background:#ffedd5;border-color:#fdba74;color:#9a3412}
.dg-badge{width:18px;height:18px;border-radius:5px;display:inline-flex;align-items:center;justify-content:center;
    font-weight:800;font-size:.64rem;border:1.5px solid var(--line);margin-right:2px;vertical-align:middle}
.dg-badge-ok{background:#dcfce7;border-color:#86efac;color:#15803d}
.dg-badge-ko{background:#fee2e2;border-color:#fca5a5;color:#b91c1c}
.dg-badge-risk{background:#ffedd5;border-color:#fdba74;color:#9a3412}
.dg-badge-none{background:#f1f5f9;border-color:#e2e8f0;color:#94a3b8}
.dg-detail{max-width:220px;margin-top:.2rem;font-size:.66rem;line-height:1.3;color:var(--muted);
    white-space:normal;word-break:break-all;text-align:left}

/* ── Panneau de détail (sous la grille de tuiles) ── */
.practice-tile.selected{outline:2px solid var(--primary);outline-offset:1px}
.practice-detail-panel{margin-top:1rem}

/* ── Cartes bonnes pratiques (Paramètres) ── */
.practice-admin-card{border:1.5px solid var(--line);border-radius:10px;margin-bottom:.6rem;overflow:hidden}
.practice-admin-hdr{display:flex;align-items:center;gap:.6rem;padding:.6rem .85rem;cursor:pointer;background:#fafbfc}
.practice-admin-hdr:hover{background:#f4f5f8}
.practice-admin-hdr .chev{transition:transform .15s;flex:0 0 auto}
.practice-admin-card.open .practice-admin-hdr .chev{transform:rotate(180deg)}
.practice-admin-body{display:none;border-top:1px solid var(--line)}
.practice-admin-card.open .practice-admin-body{display:block}
.reorder-btns{display:flex;gap:.2rem;flex:0 0 auto}
.practice-cat-group{margin-bottom:1.2rem}
.practice-cat-hdr{font-size:.72rem;text-transform:uppercase;letter-spacing:.05em;font-weight:800;
    color:#8b93a7;margin-bottom:.5rem;padding-left:.1rem;display:flex;align-items:center;gap:.5rem;cursor:pointer;user-select:none}
.practice-cat-hdr .cat-chev{transition:transform .15s;flex:0 0 auto}
.practice-cat-group:not(.open) .cat-chev{transform:rotate(-90deg)}
.practice-cat-group:not(.open) .practice-grid{display:none}
.cat-score-bar{width:90px;height:5px;border-radius:3px;background:#e2e6ee;overflow:hidden;flex:0 0 auto;margin-left:.3rem}
.cat-score-fill{display:block;height:100%;border-radius:3px}
.cat-score-pct{font-size:.72rem;font-weight:800;color:#64748b;flex:0 0 auto}
.cat-devices-btn{margin-left:.6rem;text-transform:none;letter-spacing:0;font-weight:700}
.cat-device-row{display:flex;align-items:center;justify-content:space-between;gap:.4rem;padding:.3rem 0;border-bottom:1px solid #f1f2f6;font-size:.82rem;font-weight:600}
.dg-ignored{opacity:.5}
.practice-tile.tile-inactive{opacity:.45;cursor:default!important}

.practice-tile.has-donut .practice-tile-hdr{justify-content:center;margin-bottom:0}
.practice-tile.has-donut .practice-tile-name{text-align:center}
.tile-donut-wrap{position:relative;width:120px;height:120px;margin:.3rem auto .7rem}
.tile-donut{width:100%;height:100%}
.tile-donut circle{transition:stroke-dasharray .25s}
.tile-donut-center{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center}
.tile-donut-pct{font-size:1.5rem;font-weight:800;color:#1e293b;line-height:1.1}
.tile-donut-frac{font-size:.8rem;color:var(--muted);font-weight:700}
.tile-legend{font-size:.79rem}
.tl-row{display:flex;align-items:center;gap:.45rem;padding:.18rem 0;color:#334155}
.tl-dot{width:9px;height:9px;border-radius:50%;flex:0 0 auto}
.tl-dot.tl-ok{background:#16a34a}
.tl-dot.tl-ko{background:#dc2626}
.tl-dot.tl-risk{background:#f59e0b}
.tl-dot.tl-none{background:#cbd5e1}
.auto-badge{margin-left:.4rem;font-size:.62rem}
.edit-actions{display:flex;gap:.2rem;flex:0 0 auto}
.edit-form input{border:1.5px solid var(--line);border-radius:6px;padding:.25rem .5rem;font-size:.8rem;outline:none}
.edit-form input:focus{border-color:var(--primary)}

/* ── Matching clients ── */
.match-combo{width:100%;border:1.5px solid var(--line);border-radius:7px;padding:.4rem .6rem;font-size:.83rem;outline:none}
.match-combo:focus{border-color:var(--primary)}
.match-dropdown{display:none;position:absolute;left:0;right:0;top:100%;z-index:20;background:#fff;
    border:1px solid var(--line);border-radius:8px;box-shadow:0 6px 20px rgba(16,24,40,.12);
    max-height:220px;overflow-y:auto;margin-top:2px}
.match-opt{padding:.5rem .7rem;font-size:.82rem;cursor:pointer}
.match-opt:hover{background:#f4f5f8}
.match-stat-card{background:#fff;border:1.5px solid var(--line);border-radius:12px;padding:.6rem 1rem;
    cursor:pointer;box-shadow:var(--shadow)}
.match-stat-card:hover{border-color:#c7ccdb}
.match-stat-card.active{outline:2px solid var(--primary);outline-offset:-1px}
.match-filters{display:flex;gap:.4rem}
.filter-btn{border:1.5px solid var(--line);background:#fff;color:#64748b;border-radius:7px;
    padding:.4rem .7rem;font-size:.78rem;font-weight:700;cursor:pointer}
.filter-btn:hover{border-color:#c7ccdb}
.filter-btn.active{background:var(--primary-soft);border-color:var(--primary);color:var(--primary)}

.match-col-view{display:flex;align-items:center;gap:.5rem;font-size:.83rem;padding:.2rem 0}
.match-col-view .match-col-edit{opacity:0;font-size:.75rem;color:var(--muted);margin-left:auto;transition:opacity .1s}
.match-col-view:hover .match-col-edit{opacity:1}
.match-col-form{display:flex;gap:.3rem;align-items:center}
.match-col-form .match-combo{flex:1;min-width:160px}

.flash{background:#eef1ff;border:1px solid #c7cffb;color:#2b3aa0;border-radius:10px;padding:.7rem .9rem;
  font-size:.85rem;margin-bottom:1rem}

/* ── Login ── */
.login-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;background:var(--bg)}
.login-box{background:#fff;border-radius:16px;box-shadow:0 10px 40px rgba(16,24,40,.12);
  padding:2.2rem 2.2rem 2rem;width:360px;max-width:92vw}
.login-logo{display:flex;align-items:center;gap:.7rem;justify-content:center;margin-bottom:.4rem}
.login-box h1{font-size:1.35rem;text-align:center;margin:.4rem 0 .1rem}
.login-box .sub{text-align:center;color:var(--muted);font-size:.85rem;margin-bottom:1.3rem}
.ms-btn{display:flex;align-items:center;justify-content:center;gap:.6rem;width:100%;padding:.7rem;
  border:1.5px solid #cbd2e0;border-radius:10px;font-weight:700;font-size:.9rem;background:#fff;cursor:pointer}
.ms-btn:hover{background:#f7f8fb}

/* ══════════════════ MODE SOMBRE ══════════════════ */
:root[data-theme="dark"]{
  --bg:#0e131a; --card:#181f28; --line:#2b3542; --text:#e6e9f0; --muted:#95a0b3;
  --primary:#7c8bff; --primary-d:#5b6ae6; --primary-soft:#222c47; --sidebar:#141a22;
  --shadow:0 1px 3px rgba(0,0,0,.45); --donut-track:#2b3542;
}
[data-theme="dark"] .topbar{background:var(--sidebar)}
[data-theme="dark"] .tb-user{color:#cfd6e4}
[data-theme="dark"] .nav-item{color:#aeb6c6}
[data-theme="dark"] .nav-item:hover{background:#212a35}
[data-theme="dark"] .nav-sub .nav-item{color:#95a0b3}
[data-theme="dark"] .tb-burger,[data-theme="dark"] .tb-icon{color:#95a0b3}
[data-theme="dark"] .tb-search input{background:#212a35;color:var(--text)}
[data-theme="dark"] .tb-search input:focus{background:#262f3b;border-color:#3a4657}
[data-theme="dark"] .btn-ghost{background:#1f2732;color:#cfd6e4}
[data-theme="dark"] .btn-ghost:hover{border-color:#3a4657}
[data-theme="dark"] .field input,[data-theme="dark"] .field select,[data-theme="dark"] .field textarea{background:#1f2732;color:var(--text)}
[data-theme="dark"] .table tr:hover td{background:#1f2732}
[data-theme="dark"] .contract-row:hover td{background:#222c47}
[data-theme="dark"] .table th{color:#8b93a7}
[data-theme="dark"] .bp-btn{background:#1f2732;color:#95a0b3}
[data-theme="dark"] .badge.none{background:#262f3b;color:#a3adbf}
[data-theme="dark"] .client-tab .tab-count{background:#212a35;color:#aeb6c6}
[data-theme="dark"] .cat-subtab{background:#1f2732;color:#aeb6c6}
[data-theme="dark"] .cat-subtab:hover{background:#262f3b}
[data-theme="dark"] .cat-subtab.active{background:var(--primary-soft);color:#c3ccff}
[data-theme="dark"] .cat-subtab-ignored.active{background:#262f3b;color:#cfd6e4}
[data-theme="dark"] .cat-summary{background:#1f2732}
[data-theme="dark"] .practice-tile{background:#181f28}
[data-theme="dark"] .practice-tile-bar,[data-theme="dark"] .cat-score-bar{background:#2b3542}
[data-theme="dark"] .pcheck-result{background:#20293a;color:#dbe2f0}
[data-theme="dark"] .dg-filter-bar select,[data-theme="dark"] .dg-btn,[data-theme="dark"] .filter-btn,[data-theme="dark"] .match-stat-card{background:#1f2732;color:#cfd6e4}
[data-theme="dark"] .dg-cell.none{background:#212a35;border-color:#2b3542;color:#7a8496}
[data-theme="dark"] .hostname-suggest,[data-theme="dark"] .match-dropdown,[data-theme="dark"] .role-editor{background:#1f2732 !important;border-color:#2b3542}
[data-theme="dark"] .hostname-suggest-row:hover,[data-theme="dark"] .match-opt:hover{background:#262f3b}
[data-theme="dark"] .practice-admin-hdr{background:#161d26}
[data-theme="dark"] .practice-admin-hdr:hover{background:#1f2732}
[data-theme="dark"] .flash{background:#222c47;border-color:#3a4657;color:#c7cffb}
[data-theme="dark"] .switch .slider{background:#3a4657}

/* ── Inventaire d'une catégorie : badges de contrôle par ligne ── */
.cat-matrix{margin:.2rem 0 1rem}
.dv-bar{display:flex;flex-wrap:wrap;gap:.4rem;padding:.5rem 0 .7rem}
.dv-prac-chip{display:inline-flex;align-items:center;gap:.35rem;background:var(--card);border:1px solid var(--line);
    border-radius:20px;padding:.15rem .6rem;font-size:.72rem;font-weight:700;color:var(--muted)}
.dv-prac-chip b{color:var(--text);font-weight:800}
.dv-ign-all,.dv-ign{border:none;background:none;cursor:pointer;font-size:.7rem;opacity:.4;padding:0 .1rem}
.dv-ign-all:hover,.dv-ign:hover{opacity:1}
.dv-tools{display:flex;align-items:center;gap:.5rem;padding:0 0 .6rem}
.dv-tools .dv-search{flex:1;max-width:280px;border:1px solid var(--line);background:var(--card);color:var(--text);
    border-radius:8px;padding:.32rem .6rem;font-size:.78rem;outline:none;font-family:inherit}
.dv-tools .dv-search:focus{border-color:var(--primary)}
.dv-tools .dv-filter{border:1px solid var(--line);background:var(--card);color:var(--text);border-radius:8px;
    padding:.32rem .5rem;font-size:.78rem;outline:none;font-family:inherit;cursor:pointer}
.dv-count-wrap{font-size:.72rem;color:var(--muted)}
.dv-count-wrap b{color:var(--text);font-weight:800}
.dv-list{display:flex;flex-direction:column;gap:.5rem}
.dv-row{background:var(--card);border:1px solid var(--line);border-radius:10px;padding:.6rem .85rem}
.dv-row:hover{border-color:#c7ccdb}
.dv-hdr{display:flex;align-items:center;gap:.4rem;flex-wrap:wrap;margin-bottom:.35rem}
.dv-name{font-weight:700;font-size:.84rem}
.dv-meta{font-size:.68rem;color:var(--muted);text-transform:uppercase;letter-spacing:.02em}
.dv-score{font-size:.72rem;font-weight:800;color:var(--muted)}
.dv-prac{display:flex;align-items:flex-start;gap:.5rem;padding:.12rem 0}
.dv-prac-name{flex:0 0 8.5rem;font-size:.68rem;font-weight:700;color:var(--muted);text-transform:uppercase;
    letter-spacing:.03em;padding-top:.2rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dv-checks{display:flex;flex-wrap:wrap;gap:.25rem;flex:1}
.chk{display:inline-flex;align-items:center;gap:.25rem;font-size:.72rem;font-weight:600;border-radius:6px;
    padding:.12rem .45rem;cursor:pointer;border:1px solid transparent;white-space:nowrap}
.chk:hover{filter:brightness(.96);border-color:var(--line)}
.chk-ok{background:#dcfce7;color:#15803d}
.chk-ko{background:#fee2e2;color:#b91c1c}
.chk-risk{background:#ffedd5;color:#9a3412}
.chk-none{background:#f1f5f9;color:#64748b}
.chk-ign{background:#f1f5f9;color:#94a3b8;font-style:italic}
.chk-auto{font-style:normal;font-size:.6rem;opacity:.6;font-weight:700}
.chk-hint{font-style:normal;font-size:.62rem;font-weight:700;opacity:.85;padding-left:.15rem}
.chk-menu-hint{color:#9a3412;background:#fff7ed}
[data-theme="dark"] .chk-menu-hint{color:#fdba74;background:#3b2410}
.chk-menu{position:absolute;z-index:200;min-width:210px;background:var(--card);border:1px solid var(--line);
    border-radius:10px;box-shadow:0 10px 30px rgba(16,24,40,.18);padding:.3rem;font-size:.8rem}
.chk-menu-hdr{font-weight:800;font-size:.78rem;padding:.35rem .5rem .1rem}
.chk-menu-desc{font-size:.72rem;color:var(--muted);padding:0 .5rem .3rem}
.chk-menu-detail{font-size:.72rem;color:var(--text);background:var(--bg);border-radius:5px;
    padding:.3rem .45rem;margin:.2rem .35rem .35rem}
.chk-mi{padding:.35rem .5rem;border-radius:6px;cursor:pointer}
.chk-mi:hover{background:var(--primary-soft);color:var(--primary)}
.chk-mi.active{font-weight:800}
.matrix-chev{display:inline-block;transition:transform .15s;font-size:.7rem;color:var(--muted)}
.collapsible:not(.open) .matrix-chev{transform:rotate(-90deg)}
[data-theme="dark"] .chk-ok{background:#14371f;color:#86efac}
[data-theme="dark"] .chk-ko{background:#3b1618;color:#fca5a5}
[data-theme="dark"] .chk-risk{background:#3b2410;color:#fdba74}
[data-theme="dark"] .chk-none,[data-theme="dark"] .chk-ign{background:#262f3b;color:#95a0b3}
[data-theme="dark"] .dv-row:hover{border-color:#3a4657}

/* ── Secure Score Microsoft (au-dessus des comptes 365) ── */
.ss-card{padding:.7rem .95rem;margin-bottom:.8rem}
.ss-top{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}
.ss-title{font-size:.78rem;font-weight:800;text-transform:uppercase;letter-spacing:.03em;color:var(--muted)}
.ss-body{display:flex;align-items:center;gap:1rem}
.ss-pct{font-size:1.6rem;font-weight:800;line-height:1;flex:0 0 auto;min-width:3.2rem}
.ss-mid{flex:1;min-width:0}
.ss-bar{position:relative;height:8px;border-radius:5px;background:var(--donut-track);overflow:visible}
.ss-fill{height:100%;border-radius:5px}
.ss-mark{position:absolute;top:-3px;width:2px;height:14px;background:var(--muted);opacity:.75;border-radius:1px}
.ss-cmp{font-size:.72rem;color:var(--muted);margin-top:.35rem}
.ss-cmp b{color:var(--text)}
.perm-warn{margin-top:.5rem;font-size:.74rem;line-height:1.5;background:#fff7ed;border-left:3px solid #f59e0b;
    color:#9a3412;border-radius:0 6px 6px 0;padding:.4rem .6rem}
.perm-warn code{background:rgba(0,0,0,.06);border-radius:4px;padding:0 .25rem;font-size:.72rem}
.perm-ok{margin-top:.45rem;font-size:.72rem;color:#16a34a;font-weight:600}
[data-theme="dark"] .perm-warn{background:#3b2410;color:#fdba74}
.ss-adj{font-size:.6rem;font-weight:800;text-transform:uppercase;letter-spacing:.04em;
    vertical-align:middle;margin-left:.3rem;background:var(--primary-soft);color:var(--primary);
    border-radius:20px;padding:.1rem .4rem}
.ss-raw{font-size:.7rem;color:var(--muted);margin-top:.2rem}
.ss-raw b{color:var(--text)}

/* ── Onglet Recommandations ── */
.reco-cat{font-size:.7rem;font-weight:800;text-transform:uppercase;letter-spacing:.04em;
    color:var(--muted);margin:1rem 0 .4rem}
.reco-cat:first-child{margin-top:0}
.reco{border-left:3px solid #dc2626;padding:.1rem 0 .1rem .7rem;margin-bottom:.7rem}
.reco-hdr{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}
.reco-title{font-weight:700;font-size:.86rem}
.reco-why{font-size:.8rem;color:var(--muted);margin-top:.1rem}
.reco-detail{font-size:.78rem;color:#9a3412;background:#fff7ed;border-radius:4px;
    padding:.12rem .4rem;display:inline-block;margin-top:.2rem}
.reco-targets{font-size:.75rem;color:var(--muted);margin-top:.2rem}
[data-theme="dark"] .reco-detail{background:#3b2410;color:#fdba74}
.reco-group{margin-bottom:.2rem}
.reco-cat{display:flex;align-items:center;gap:.45rem;cursor:pointer;user-select:none}


/* Marche à suivre d'un point de contrôle : repliée par défaut, elle ne sert qu'au
   moment d'agir et alourdirait la lecture de la liste si elle était dépliée. */
.pcheck-howto{margin-top:.35rem;font-size:.76rem}
.pcheck-howto summary{cursor:pointer;color:var(--primary);user-select:none}
.pcheck-howto > div{margin-top:.3rem;padding:.45rem .6rem;border-left:3px solid var(--primary);
    background:var(--bg);border-radius:0 6px 6px 0;line-height:1.5;color:var(--text)}
