/* Charte Forez.net */
:root { --navy:#162138; --orange:#f88b21; --muted:#526982; }
body { background:#f4f6f8; color:#162138; font-family:"Segoe UI",system-ui,sans-serif; }
.app-shell:not(.hidden) { display:block; }
.sidebar { position:sticky; top:0; z-index:10; width:100%; height:auto; min-height:0; padding:14px 24px; display:flex; flex-direction:row; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; background:white; color:#162138; border-bottom:1px solid #dce5ef; box-shadow:0 5px 24px #16213809; }
.sidebar .brand { display:flex; color:#162138; font-size:1rem; margin:0; gap:12px; align-items:center; }
.sidebar .brand>div { display:block; border-left:1px solid #dbe4ed; padding-left:12px; }
.sidebar .brand strong { color:#526982; }
.forez-logo { width:62px; height:32px; object-fit:contain; }
#side-nav { display:flex; flex-wrap:wrap; gap:3px; }
.sidebar .nav { display:flex; align-items:center; justify-content:center; gap:6px; width:auto; margin:0; padding:9px 10px; background:transparent; color:#3a4b62; border:0; border-radius:10px; font-size:.83rem; }
.sidebar .nav>span:last-child { display:inline; }
.sidebar .nav:hover { background:#f0f4f8; color:#162138; }
.sidebar .nav.active { background:#f88b21; color:#162138; box-shadow:0 3px 8px #f88b2140; }
.sidebar .nav.active .nav-icon { color:inherit; }
.sidebar .sidebar-foot { display:flex; position:static; margin:0; padding:0; align-items:center; gap:8px; }
.sidebar .status-mini { display:none; }
.sidebar .nav.logoff { color:white; background:#162138; }
.workspace { min-width:0; }
.topbar { position:static; height:auto; min-height:54px; justify-content:space-between; background:#f4f6f8; }
.top-search { width:min(570px,65%); background:white; border:1px solid #dce5ef; }
.content { max-width:1240px; padding-top:22px; }
.page-heading { background:#10233a; color:white; padding:21px 24px; border-radius:16px; box-shadow:0 5px 14px #10233a18; }
.page-heading p,.page-heading .head-actions>span { color:#dce6f2; }
.card,.login-card { border-radius:16px; }
.card th { background:#f4f6f8; }
.button.accent { background:#f88b21; border-color:#f88b21; color:#162138; }
.button.accent:hover { background:#ffa247; }
.login-logo { align-items:center; }
@media(max-width:760px) {
    .sidebar { padding:9px 12px; position:static; }
    #side-nav { flex-basis:100%; order:3; flex-wrap:nowrap; overflow-x:auto; }
    .top-search { display:flex; }
    .page-heading { padding:16px; }
}
@media print {
    .sidebar,.topbar,.head-actions,button,footer { display:none !important; }
    .content { padding:0; }
    .card { break-inside:avoid; box-shadow:none; }
    .page-heading { color:#162138; background:white; box-shadow:none; }
    .page-heading p { color:#526982; }
}
.capacity { width:100%; accent-color:#f88b21; } .spark-col progress { width:100%; accent-color:#338bc9; }
@media(min-width:1100px) {
    .sidebar { padding-inline:20px; gap:10px; }
    .sidebar .nav { padding-inline:8px; font-size:.8rem; }
    .sidebar .nav-icon { width:auto; font-size:1rem; }
}
.topbar { margin:14px auto 0; width:calc(100% - 46px); max-width:1186px; min-height:52px; padding:6px 12px; border:1px solid #dce5ef; border-radius:13px; background:white; box-shadow:0 2px 5px #16213808; color:#162138; }
.topbar .top-search { border:0; }
.topbar .top-search input,.topbar .top-actions,.topbar .icon-btn { color:#344962; }
.topbar .top-search input::placeholder { color:#667c96; }
.topbar .separator { background:#dde6ef; }
.spark-col progress { writing-mode:vertical-lr; direction:rtl; inline-size:132px; block-size:16px; margin-inline:auto; align-self:center; }
.offer-card h2 { margin:0; font-size:1.2rem; }
.offer-price { font-size:2rem; font-weight:800; margin:12px 0 0; color:#10233a; }
.offer-price small { font-size:.9rem; color:#516780; }
.offer-card ul { margin:14px 0 0; padding-left:20px; line-height:1.7; }
@media(min-width:1100px) { .sidebar .nav { padding-inline:6px; } }

.offer-cadence { background:#fff4e7; color:#754411; padding:12px; border-radius:9px; font-weight:650; }
.device-overview { display:flex; justify-content:space-between; flex-wrap:wrap; gap:20px; background:#f2f6fb; padding:18px; border-radius:12px; margin-bottom:18px; }
.modal { width:min(940px,100%); }
.modal hr { border:0; border-top:1px solid #dce5ef; margin:24px 0; }
.modal details { padding:12px 0; }
.modal details summary { cursor:pointer; margin-bottom:12px; }

.offer-card { display:flex; flex-direction:column; }
.offer-benefits { flex:1; padding-left:20px; line-height:1.7; margin:12px 0 20px; }
.offer-card .button { align-self:flex-start; }
/* 0.7 — navigation et assistants */
.sidebar .nav-icon { width:19px;height:19px;flex-shrink:0; }
#advanced-nav { width:auto;max-width:165px;border:1px solid #dce5ef;background:#fff;color:#263b55;border-radius:9px;padding:8px;font:inherit; }
.restore-steps {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;}
.restore-steps section {border:1px solid #dce5ef;border-radius:12px;padding:16px;background:#fff;min-width:0;}
.restore-steps h3 {margin:0 0 14px;color:#162138;font-size:1rem;}
.file-picker,.device-picker {max-height:250px;overflow:auto;}
.file-option {display:block;width:100%;text-align:left;padding:8px;border:0;border-bottom:1px solid #e4eaf0;background:#fff;color:#162138;overflow-wrap:anywhere;cursor:pointer;}
.file-option:hover,.device-option:hover {background:#edf4fa;}
.device-picker {border:1px solid #dce5ef;border-radius:10px;padding:10px;}
.device-picker .device-option {display:flex;flex-direction:row;align-items:center;gap:12px;padding:10px;border-bottom:1px solid #e4eaf0;cursor:pointer;}
.device-option input {width:auto;flex:none;}.device-option small {display:block;color:#526982;}
summary {cursor:pointer;font-weight:600;}
@media(max-width:700px){.restore-steps{grid-template-columns:1fr;}}
/* Navigation complète et sélection des machines */
#side-nav { flex-basis:100%; order:3; justify-content:center; gap:5px; flex-wrap:wrap; }
.sidebar .nav { white-space:nowrap; padding:10px 9px; }
.device-select { border:1px solid #dce5ef;border-radius:12px;padding:12px;background:#fff; }
.device-select summary { display:flex; align-items:center; gap:8px; cursor:pointer; }
.device-select summary::before { content:'▸'; color:#526982; }
.device-select[open] summary::before { content:'▾'; }
#license-selection-count { margin-left:auto; color:#526982;font-size:.8rem; }
.device-picker {border:0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:8px;}
.device-picker .device-option {border:1px solid #dce5ef;border-radius:10px;background:#fff;margin:0;}
.device-picker .device-option:has(input:checked) {border-color:#e99031;background:#fff4e7;}
@media(min-width:1500px){#side-nav{flex-basis:auto;order:0;flex:1;}}
.group-create{display:flex;align-items:end;gap:12px;max-width:680px}.group-create label{flex:1}.explorer-group,.explorer-device{border:1px solid #dce5ef;border-radius:10px;margin:10px 0;background:white}.explorer-group>summary,.explorer-device>summary{cursor:pointer;padding:14px;font-weight:650}.explorer-group>summary .muted,.explorer-device>summary .muted{font-weight:400;margin-left:12px}.explorer-children{padding:0 16px 14px 24px}.explorer-backup{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid #dce5ef;overflow-wrap:anywhere}.explorer-backup>div{display:flex;gap:6px;flex-wrap:wrap}.explorer-device label{max-width:420px}

/* Explorateur et inscription */
.explorer-group summary,.explorer-device summary{align-items:center;gap:.6rem}
.explorer-icon{display:inline-block;flex:none;vertical-align:middle;color:#35619a}
.folder-icon{color:#a65a12}
.explorer-assign{display:flex;flex-wrap:wrap;align-items:end;gap:.75rem;margin:.5rem 0 1rem}
.explorer-assign label{margin:0;flex:0 1 350px}
.explorer-assign label select,.explorer-assign label input{width:100%}
.enrollment-form{display:grid;gap:.9rem}
.enrollment-form .button{justify-self:start}

/* Listes et actions Forez */
.explorer-group>summary .explorer-icon,.explorer-device>summary .explorer-icon,.explorer-backup>span .explorer-icon{margin-inline-end:2mm}
.explorer-group>summary:focus-visible,.explorer-device>summary:focus-visible{outline:2px solid #547bbc;outline-offset:2px;border-radius:8px}
.simple-backup-row{display:grid;grid-template-columns:minmax(13rem,1.35fr) minmax(9rem,1fr) minmax(11rem,1fr) auto;gap:16px;align-items:center;padding:16px 0;border-bottom:1px solid #dce5ef}
.simple-backup-row:last-child{border-bottom:0}
.simple-device,.backup-last,.file-option{display:flex;gap:9px;align-items:center}
.simple-device p{margin:4px 0 0}
.file-option{width:100%;text-align:left}
.file-option.selected{background:#e9f1fd;border-left:3px solid #35619a}
.card pre{white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:950px){.simple-backup-row{grid-template-columns:1fr 1fr}}
@media(max-width:520px){.simple-backup-row{grid-template-columns:1fr}}

/* Fenêtres et position stable de la navigation */
html{overflow-y:scroll;scrollbar-gutter:stable}
.sidebar .nav,.sidebar .nav.active{font-weight:600;border-width:0}
.modal [hidden]{display:none!important}
.policy-hero,.snapshot-heading{display:flex;justify-content:space-between;gap:12px;align-items:center;background:#152138;color:white;padding:15px;border-radius:12px;flex-wrap:wrap}
.policy-hero>div{display:flex;gap:10px;align-items:center}
.policy-hero .explorer-icon{color:white}
.policy-tabs,.snapshot-crumbs{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:14px 0}
.policy-tabs .button[aria-pressed=true]{background:#eaf1fd;border-color:#becfec;color:#204d85}
.policy-section{border:1px solid #dee7f1;border-radius:12px;padding:16px}
.policy-section h3{font-size:1rem;margin:0 0 12px}
.policy-actions,.snapshot-footer{display:flex;justify-content:flex-end;align-items:center;gap:10px;flex-wrap:wrap;padding-top:14px}
.snapshot-footer{justify-content:space-between;overflow-wrap:anywhere}
.snapshot-footer>div:first-child{min-width:0}
.snapshot-footer .row-actions{flex-wrap:wrap}
.restore-selection{padding:12px;background:#f3f7fc;border:1px solid #dfe8f2;border-radius:9px;overflow-wrap:anywhere}
.snapshot-list{max-height:42vh;min-height:7rem;overflow:auto;border:1px solid #dfe8f2;border-radius:9px;padding:8px}
.snapshot-entry{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:12px;align-items:center;padding:4px;border-bottom:1px solid #eef2f8}
.snapshot-name{display:flex;align-items:center;gap:10px;text-align:left;border:0;border-radius:6px;padding:8px;background:transparent;min-width:0;overflow-wrap:anywhere;color:inherit}
.snapshot-name:hover,.snapshot-name.selected{background:#eaf1fd}

.live-backup{display:grid;gap:8px;padding:12px 0;border-bottom:1px solid #dce5ef}
.live-backup :first-child{min-width:0}
.live-backup>div:first-child,.live-bar{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.live-bar progress{flex:1;min-width:8rem}
.live-backup .button{justify-self:start}
