/* C2E AuditHub : organigramme CUD / phases, mêmes surfaces que le catalogue R5.5 */
.r57-head-grid{display:flex;gap:20px;justify-content:space-between;align-items:center;flex-wrap:wrap}
.r57-phase-section{margin:24px 0 28px}.r57-phase-section>h2{font-size:1.32rem;font-weight:800;color:var(--r56-ink)}.r57-phase-section>p{color:var(--r56-muted);margin-bottom:16px}
.r57-phase-grid,.r57-access-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.r57-phase-card{background:var(--r56-surface);border:1px solid var(--r56-border);padding:22px;border-radius:15px;min-width:0;box-shadow:0 4px 12px rgba(31,52,87,.04)}.r57-phase-card h2{font-size:1.1rem;font-weight:750;margin:0 0 10px;color:var(--r56-ink)}
.r57-phase-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:16px}.r57-phase-heading h3{font-size:1.12rem;font-weight:750;line-height:1.35;margin:8px 0 0;color:var(--r56-ink)}.r57-code{display:inline-block;font-weight:750;color:var(--r56-muted);font-size:.75rem;letter-spacing:.02em;word-break:break-word}
.r57-phase-state{display:inline-flex;align-items:center;white-space:nowrap;border-radius:999px;padding:5px 10px;font-size:.73rem;font-weight:750;background:#f0f3f7;color:#344054}.state-open{background:#def5e8;color:#11633a}.state-planned{background:#e8f0fa;color:#23558a}.state-completed{background:#e3f6ef;color:#176547}.state-paused{background:#fff2d6;color:#895608}.state-archived{background:#edf0f5;color:#55657d}
.r57-phase-footer{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-top:14px}.r57-phase-footer span{font-size:.77rem;color:var(--r56-muted)}.r57-muted-box{padding:20px;border-radius:14px;border:1px solid var(--r56-border);background:var(--r56-surface)}
.r57-access-grid .form-select{flex:1;min-width:165px;max-width:320px}.r57-access-grid .r57-phase-card h2{margin-bottom:8px}
.r57-chart-shell{border:1px solid var(--r56-border);border-radius:17px;background:var(--r56-surface);box-shadow:0 4px 14px rgba(20,40,65,.035);overflow:hidden}
.r57-chart-toolbar{padding:20px 22px;border-bottom:1px solid var(--r56-border);display:flex;align-items:end;flex-wrap:wrap;gap:12px}.r57-chart-toolbar>div:first-child{flex:1;min-width:220px}.r57-chart-toolbar label{display:block;font-weight:750;margin-bottom:8px}.r57-chart-buttons{display:flex;gap:8px;flex-wrap:wrap}.r57-hint{font-size:.81rem;color:var(--r56-muted);line-height:1.5}
.r57-chart-scroller{overflow:auto;max-height:75vh;padding:24px 24px 38px;overscroll-behavior:contain}
.r57-tree,.r57-tree ul{list-style:none;padding:0;margin:0}.r57-tree-children{margin:8px 0 0 22px!important;padding:5px 0 4px 24px!important;border-left:2px solid var(--r56-border)}
.r57-tree-item{position:relative;min-width:0}.r57-tree-children>.r57-tree-item{margin:12px 0}.r57-tree-children>.r57-tree-item:before{content:"";position:absolute;width:23px;height:2px;background:var(--r56-border);top:27px;left:-24px}
.r57-tree-row{display:flex;align-items:flex-start;gap:9px}.r57-tree-toggle,.r57-tree-leaf{width:32px;height:38px;flex:0 0 32px;margin-top:13px;border:1px solid var(--r56-border);border-radius:9px;background:var(--r56-bg);display:flex;align-items:center;justify-content:center;color:var(--r56-ink);font-size:1.2rem;font-weight:800}.r57-tree-toggle{cursor:pointer}.r57-tree-toggle[aria-expanded="false"] span{transform:rotate(-90deg)}.r57-tree-toggle:hover{border-color:#b4232c}.r57-tree-leaf{color:#7b8ba2;font-size:.85rem}
.r57-tree-card{border:1px solid var(--r56-border);border-left:4px solid #c51d23;border-radius:13px;background:var(--r56-surface);padding:14px 17px;min-width:260px;max-width:680px;width:min(100%,680px);box-shadow:0 2px 10px rgba(29,47,77,.05)}.r57-tree-card-head{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
.r57-unit-type{text-transform:capitalize;font-size:.75rem;color:#8b3044;font-weight:750;letter-spacing:.02em}.r57-tree-card h3{font-size:1rem;font-weight:800;line-height:1.4;color:var(--r56-ink);margin:6px 0}.r57-tree-card p{margin:0;font-size:.81rem;color:var(--r56-muted)}
.r57-tree-actions{display:flex;gap:15px;flex-wrap:wrap;align-items:center;margin-top:12px}.r57-tree-actions a,.r57-tree-actions button{font-size:.85rem;font-weight:750;background:transparent;padding:0;border:0;color:#a31926;text-decoration:none;cursor:pointer}.r57-tree-actions button{color:#285e99}.r57-tree-actions :is(a,button):hover{text-decoration:underline}
.r57-dialog{border:1px solid var(--r56-border);border-radius:18px;padding:26px;max-width:min(650px,94vw);width:100%;max-height:88vh;overflow:auto;color:var(--r56-ink);background:var(--r56-surface);box-shadow:0 18px 70px rgba(10,29,51,.2)}.r57-dialog::backdrop{background:rgba(18,32,52,.62)}.r57-dialog-top{display:flex;gap:20px;align-items:start;justify-content:space-between}.r57-dialog-top h2{font-weight:800;font-size:1.35rem;margin:5px 0 12px}.r57-dialog h3{font-size:1rem;font-weight:800;margin:18px 0 7px}.r57-dialog-text{white-space:pre-wrap;line-height:1.65;color:var(--r56-ink);background:var(--r56-bg);border:1px solid var(--r56-border);border-radius:11px;padding:12px 14px}
.r57-unit-links{display:flex;flex-wrap:wrap;gap:10px;margin:0 0 18px}.r57-unit-intro{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px;margin-bottom:15px}.r57-unit-detail-card{background:var(--r56-surface);border:1px solid var(--r56-border);border-radius:15px;padding:23px 25px;min-width:0;margin:0}.r57-unit-detail-card h2{color:var(--r56-ink);font-size:1.12rem;font-weight:800;margin:0 0 10px}.r57-unit-detail-card p{color:var(--r56-ink);font-size:.94rem;line-height:1.65;white-space:pre-wrap}.r57-unit-detail-card>span{font-size:.8rem;color:var(--r56-muted)}
.r57-children-box{margin-bottom:18px}.r57-children-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:17px}.r57-child-card{display:grid;gap:7px;text-decoration:none!important;padding:16px;border:1px solid var(--r56-border);border-radius:12px;background:var(--r56-bg);min-width:0;color:var(--r56-ink)}.r57-child-card:hover{border-color:#c51d23;box-shadow:0 3px 12px rgba(0,0,0,.06)}.r57-child-card small,.r57-child-card span{font-size:.77rem;color:var(--r56-muted)}.r57-child-card strong{font-size:.93rem;color:var(--r56-ink)}
[data-bs-theme="dark"] .state-archived,[data-bs-theme="dark"] .state-planned{color:#e5f0ff;background:#394c65}[data-bs-theme="dark"] .state-open,[data-bs-theme="dark"] .state-completed{color:#c8f8dd;background:#1c543f}[data-bs-theme="dark"] .r57-tree-actions button{color:#a4c9f9}
@media(max-width:900px){.r57-phase-grid,.r57-unit-intro{grid-template-columns:1fr}.r57-children-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.r57-access-grid,.r57-children-grid{grid-template-columns:1fr}.r57-phase-card{padding:17px}.r57-chart-scroller{padding:13px 10px}.r57-tree-children{margin-left:10px!important;padding-left:11px!important}.r57-tree-children>.r57-tree-item:before{left:-12px;width:11px}.r57-tree-card{min-width:0;padding:11px 12px}.r57-tree-toggle,.r57-tree-leaf{width:24px;flex-basis:24px;font-size:1rem}.r57-chart-toolbar{padding:16px}.r57-phase-heading{flex-wrap:wrap}.r57-dialog{padding:17px}}
