/* Bloc 17 — navigation type Explorateur Windows */

.project-explorer{max-width:1180px;margin:0 auto 40px}
.project-explorer *,.project-browserbar *{box-sizing:border-box}

.project-browserbar{
    display:flex;align-items:center;gap:10px;width:100%;
    margin:0 0 20px;padding:10px 12px;background:#fff;
    border:1px solid #e3e7eb;border-radius:10px;
    box-shadow:0 1px 2px rgba(0,0,0,.03)
}
.project-browserbar-root{margin-bottom:18px}
.project-browser-back{
    display:inline-flex;align-items:center;justify-content:center;
    flex:0 0 38px;width:38px;height:38px;
    border:1px solid #dde2e7;border-radius:8px;background:#f5f7f9;
    color:#2c3137;text-decoration:none;font-size:27px;font-weight:300;line-height:1
}
.project-browser-back:hover{background:#edf2f6;border-color:#cdd5dd}
.project-browser-path{
    display:flex;align-items:center;min-width:0;flex:1;min-height:38px;
    padding:0 12px;overflow:hidden;white-space:nowrap;
    border:1px solid #dfe3e7;border-radius:7px;background:#fff;font-size:14px
}
.project-browser-path a{
    min-width:0;color:#38404a;text-decoration:none;
    overflow:hidden;text-overflow:ellipsis
}
.project-browser-path a:hover{text-decoration:underline}
.project-browser-sep{flex:0 0 auto;padding:0 9px;color:#8b9299}
.project-browser-current{
    min-width:0;overflow:hidden;text-overflow:ellipsis;
    font-weight:650;color:#242a31
}

.has-project-browser .container > .pagehead .back{display:none}

.project-head{
    display:flex;align-items:flex-start;justify-content:space-between;
    gap:20px;margin-bottom:26px
}
.project-head h1{margin:0 0 4px;font-size:30px;line-height:1.18}
.project-head .muted{margin:0}
.project-head-actions{display:flex;gap:8px;flex-wrap:wrap}

.project-folder-section{margin-top:24px}
.project-folder-section-head{
    display:flex;align-items:center;justify-content:space-between;gap:12px;
    margin:0 0 10px;padding-bottom:9px;border-bottom:1px solid #e6e9ec
}
.project-folder-section-head h2{margin:0;font-size:17px;font-weight:650}
.project-folder-section-head span{font-size:12px;color:#7f8790}

.project-folder-list{display:flex;flex-direction:column;gap:6px}
.project-folder-row{
    display:flex;align-items:center;gap:14px;width:100%;min-height:66px;
    padding:10px 14px;color:inherit;text-decoration:none;background:#fff;
    border:1px solid #e3e7eb;border-radius:8px;
    transition:background .12s ease,border-color .12s ease,box-shadow .12s ease
}
.project-folder-row:hover{
    background:#f7fbff;border-color:#b8d2ea;
    box-shadow:0 1px 4px rgba(39,91,142,.06)
}
.project-folder-icon{
    position:relative;flex:0 0 42px;width:42px;height:30px;margin-top:5px;
    border-radius:3px;background:#f2c94c;
    box-shadow:inset 0 -1px 0 rgba(0,0,0,.10)
}
.project-folder-icon::before{
    content:"";position:absolute;left:0;top:-7px;width:20px;height:9px;
    border-radius:3px 3px 0 0;background:#e8bd3f
}
.project-folder-copy{min-width:0;flex:1}
.project-folder-copy strong{display:block;margin-bottom:3px;font-size:15px;line-height:1.25}
.project-folder-copy small{
    display:block;overflow:hidden;color:#79818a;font-size:12px;line-height:1.25;
    text-overflow:ellipsis;white-space:nowrap
}
.project-folder-meta{display:flex;align-items:center;gap:10px;flex:0 0 auto}
.project-folder-count{
    display:inline-flex;align-items:center;justify-content:center;
    min-width:28px;height:25px;padding:0 8px;border-radius:999px;
    background:#f1f3f5;color:#555e67;font-size:12px;font-weight:650
}
.project-folder-arrow{font-size:22px;color:#979ea5}

.project-admin-panel{
    margin-top:30px;padding:18px;background:#fafbfc;
    border:1px solid #e3e6e9;border-radius:10px
}
.project-admin-panel h2{margin:0 0 12px;font-size:16px}
.project-admin-actions{display:flex;gap:10px;flex-wrap:wrap}
.project-admin-actions form{margin:0}

/* --------------------------------------------------------------------------
   Bloc 17.3 — Plans
   -------------------------------------------------------------------------- */

.plans-pagehead{
    margin-bottom:18px;
}

.plans-headrow,
.plans-detail-head{
    align-items:flex-start;
}

.plans-pagehead h1{
    margin-bottom:3px;
}

.plans-search{
    max-width:none;
    margin-top:16px;
}

.plans-search input{
    width:100%;
}

.plans-explorer{
    margin-bottom:32px;
    overflow:hidden;
    background:#fff;
    border:1px solid #e2e6ea;
    border-radius:10px;
}

.plans-list-header{
    display:grid;
    grid-template-columns:minmax(320px,2fr) minmax(150px,1fr) minmax(170px,.8fr) 28px;
    gap:16px;
    align-items:center;
    min-height:38px;
    padding:0 14px;
    background:#f7f8fa;
    border-bottom:1px solid #e4e7ea;
    color:#747c85;
    font-size:12px;
    font-weight:650;
}

.plans-list{
    display:flex;
    flex-direction:column;
}

.plans-list-row{
    display:grid;
    grid-template-columns:minmax(320px,2fr) minmax(150px,1fr) minmax(170px,.8fr) 28px;
    gap:16px;
    align-items:center;
    min-height:70px;
    padding:10px 14px;
    color:inherit;
    text-decoration:none;
    border-bottom:1px solid #edf0f2;
    transition:background .12s ease;
}

.plans-list-row:last-child{
    border-bottom:0;
}

.plans-list-row:hover{
    background:#f7fbff;
}

.plans-main{
    display:flex;
    align-items:center;
    gap:13px;
    min-width:0;
}

.plans-file-icon{
    position:relative;
    flex:0 0 32px;
    width:32px;
    height:39px;
    border:1px solid #cfd5db;
    border-radius:3px;
    background:#fff;
    box-shadow:0 1px 2px rgba(0,0,0,.04);
}

.plans-file-icon::before{
    content:"";
    position:absolute;
    top:-1px;
    right:-1px;
    width:11px;
    height:11px;
    background:
        linear-gradient(225deg,#fff 49%,#cfd5db 50%,#cfd5db 55%,#eef1f4 56%);
    border-top-right-radius:2px;
}

.plans-file-icon::after{
    content:"";
    position:absolute;
    left:6px;
    right:6px;
    bottom:8px;
    height:2px;
    background:#d4d9de;
    box-shadow:0 -6px 0 #d4d9de,0 -12px 0 #d4d9de;
}

.plans-file-icon.small{
    flex-basis:25px;
    width:25px;
    height:31px;
}

.plans-file-icon.empty{
    opacity:.5;
}

.plans-file-copy{
    display:flex;
    flex-direction:column;
    min-width:0;
}

.plans-file-copy strong{
    display:block;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:14px;
}

.plans-file-copy small{
    display:block;
    margin-top:3px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    color:#737b84;
    font-size:12px;
}

.plans-version,
.plans-title-version{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:25px;
    height:22px;
    margin-left:5px;
    padding:0 7px;
    border:1px solid #dfe3e7;
    border-radius:5px;
    background:#f7f8fa;
    color:#59616a;
    font-size:12px;
    font-weight:700;
    vertical-align:middle;
}

.plans-discipline{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    color:#59616a;
    font-size:13px;
}

.plans-status{
    display:inline-flex;
    align-items:center;
    min-height:27px;
    padding:4px 9px;
    border:1px solid #dfe3e7;
    border-radius:999px;
    background:#f4f5f6;
    color:#505861;
    font-size:12px;
    font-weight:650;
    white-space:nowrap;
}

.plans-status-a_valider{
    border-color:#d5c89f;
    background:#fff9e7;
}

.plans-status-correction_demandee{
    border-color:#dfb4b4;
    background:#fff1f1;
}

.plans-status-valide_diffuse{
    border-color:#b8d7bf;
    background:#f0faf2;
}

.plans-row-arrow{
    justify-self:end;
    color:#979ea5;
    font-size:22px;
}

.plans-empty{
    display:flex;
    align-items:center;
    gap:14px;
    padding:22px;
}

.plans-empty strong,
.plans-empty span{
    display:block;
}

.plans-empty .muted{
    margin-top:3px;
    font-size:13px;
}

/* Formulaire plan */
.plans-form-heading{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
}

.plans-form{
    max-width:none;
}

.plans-form-section{
    padding:4px 0 24px;
    margin-bottom:22px;
    border-bottom:1px solid #e7eaed;
}

.plans-form-section:last-of-type{
    border-bottom:0;
    margin-bottom:10px;
}

.plans-form-section-title{
    display:flex;
    align-items:flex-start;
    gap:12px;
    margin-bottom:18px;
}

.plans-form-step{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 28px;
    width:28px;
    height:28px;
    border-radius:50%;
    background:#eef2f5;
    color:#515a63;
    font-size:13px;
    font-weight:700;
}

.plans-form-section-title h2{
    margin:1px 0 2px;
    font-size:16px;
}

.plans-form-section-title p{
    margin:0;
    color:#7b838b;
    font-size:12px;
}

.plans-file-upload input{
    margin-top:7px;
}

.plans-diffusion-fieldset{
    margin:0;
    padding:0;
    border:0;
}

.plans-form-actions{
    display:flex;
    justify-content:flex-end;
    gap:10px;
    padding-top:2px;
}

/* Fiche plan */
.plans-detail-layout{
    display:grid;
    grid-template-columns:minmax(0,2fr) minmax(260px,.85fr);
    gap:20px;
    align-items:start;
}

.plans-detail-main,
.plans-detail-side{
    display:flex;
    flex-direction:column;
    gap:16px;
}

.plans-detail-layout .detail-card,
.plans-detail-layout .action-card{
    margin:0;
}

.plans-document-card .section-title{
    align-items:center;
}

.plans-document-file{
    display:flex;
    align-items:center;
    gap:12px;
    margin-top:15px;
    padding:13px;
    border:1px solid #e5e8eb;
    border-radius:8px;
    background:#fafbfc;
}

.plans-document-file span:last-child{
    min-width:0;
}

.plans-document-file strong,
.plans-document-file small{
    display:block;
}

.plans-document-file small{
    margin-top:3px;
    color:#737b84;
}

.plans-pdf-icon{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 42px;
    width:42px;
    height:48px;
    border:1px solid #d4d9de;
    border-radius:4px;
    background:#fff;
    font-size:10px;
    font-weight:800;
}

.plans-action-card{
    display:grid;
    grid-template-columns:minmax(220px,.8fr) minmax(300px,1.2fr);
    gap:24px;
}

.plans-action-primary h2,
.plans-action-card-single h2{
    margin-top:0;
}

.plans-action-card-single{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
}

.plans-version-list{
    display:flex;
    flex-direction:column;
}

.plans-version-row{
    display:flex;
    align-items:center;
    gap:12px;
    min-height:54px;
    padding:8px 0;
    border-bottom:1px solid #edf0f2;
}

.plans-version-row:last-child{
    border-bottom:0;
}

.plans-version-copy{
    display:flex;
    flex:1;
    min-width:0;
    flex-direction:column;
}

.plans-version-copy small{
    margin-top:2px;
    color:#737b84;
}

.plans-version-pdf{
    flex:0 0 auto;
    font-size:12px;
    font-weight:700;
}

.plans-info-card .facts{
    margin-bottom:0;
}

.plans-diffusion-card .mini-list{
    margin-bottom:0;
}

.sr-only{
    position:absolute!important;
    width:1px!important;
    height:1px!important;
    padding:0!important;
    margin:-1px!important;
    overflow:hidden!important;
    clip:rect(0,0,0,0)!important;
    white-space:nowrap!important;
    border:0!important;
}

@media (max-width:900px){
    .plans-list-header{
        grid-template-columns:minmax(260px,1.7fr) minmax(130px,.8fr) minmax(150px,.8fr) 24px;
    }

    .plans-list-row{
        grid-template-columns:minmax(260px,1.7fr) minmax(130px,.8fr) minmax(150px,.8fr) 24px;
    }

    .plans-detail-layout{
        grid-template-columns:1fr;
    }

    .plans-detail-side{
        display:grid;
        grid-template-columns:1fr 1fr;
    }
}

@media (max-width:700px){
    .project-browserbar{align-items:flex-start}
    .project-browser-path{overflow-x:auto;white-space:nowrap}
    .project-head{flex-direction:column}
    .project-folder-row{min-height:62px;padding:10px 12px}
    .project-folder-copy small{white-space:normal}

    .plans-list-header{
        display:none;
    }

    .plans-list-row{
        grid-template-columns:minmax(0,1fr) auto;
        gap:10px;
        min-height:76px;
    }

    .plans-main{
        grid-column:1;
    }

    .plans-discipline{
        display:none;
    }

    .plans-list-row > span:nth-child(3){
        grid-column:1;
        margin-left:45px;
    }

    .plans-row-arrow{
        grid-column:2;
        grid-row:1 / span 2;
        align-self:center;
    }

    .plans-file-copy small{
        white-space:normal;
    }

    .plans-action-card{
        grid-template-columns:1fr;
    }

    .plans-action-card-single{
        align-items:flex-start;
        flex-direction:column;
    }

    .plans-detail-side{
        display:flex;
    }

    .plans-form-actions{
        justify-content:stretch;
    }

    .plans-form-actions .button{
        flex:1;
        text-align:center;
    }
}
/* --------------------------------------------------------------------------
   Bloc 17.4 — Contrats
   -------------------------------------------------------------------------- */

.contracts-pagehead{margin-bottom:18px}
.contracts-headrow,.contracts-detail-head{align-items:flex-start}
.contracts-pagehead h1{margin-bottom:3px}
.contracts-search{max-width:none;margin-top:16px}
.contracts-search input{width:100%}

.contracts-explorer{
    margin-bottom:32px;
    overflow:hidden;
    background:#fff;
    border:1px solid #e2e6ea;
    border-radius:10px;
}

.contracts-list-header{
    display:grid;
    grid-template-columns:minmax(260px,1.6fr) minmax(190px,1fr) minmax(120px,.65fr) minmax(150px,.8fr) 28px;
    gap:16px;
    align-items:center;
    min-height:38px;
    padding:0 14px;
    background:#f7f8fa;
    border-bottom:1px solid #e4e7ea;
    color:#747c85;
    font-size:12px;
    font-weight:650;
}

.contracts-list{
    display:flex;
    flex-direction:column;
}

.contracts-list-row{
    display:grid;
    grid-template-columns:minmax(260px,1.6fr) minmax(190px,1fr) minmax(120px,.65fr) minmax(150px,.8fr) 28px;
    gap:16px;
    align-items:center;
    min-height:70px;
    padding:10px 14px;
    color:inherit;
    text-decoration:none;
    border-bottom:1px solid #edf0f2;
    transition:background .12s ease;
}

.contracts-list-row:last-child{border-bottom:0}
.contracts-list-row:hover{background:#f7fbff}

.contracts-main{
    display:flex;
    align-items:center;
    gap:13px;
    min-width:0;
}

.contracts-file-icon{
    position:relative;
    flex:0 0 34px;
    width:34px;
    height:40px;
    border:1px solid #cfd5db;
    border-radius:3px;
    background:#fff;
    box-shadow:0 1px 2px rgba(0,0,0,.04);
}

.contracts-file-icon::before{
    content:"";
    position:absolute;
    top:-1px;
    right:-1px;
    width:11px;
    height:11px;
    background:linear-gradient(225deg,#fff 49%,#cfd5db 50%,#cfd5db 55%,#eef1f4 56%);
    border-top-right-radius:2px;
}

.contracts-file-icon::after{
    content:"";
    position:absolute;
    left:7px;
    right:7px;
    bottom:8px;
    height:2px;
    background:#d4d9de;
    box-shadow:0 -6px 0 #d4d9de,0 -12px 0 #d4d9de;
}

.contracts-file-icon.empty{opacity:.5}

.contracts-file-copy{
    display:flex;
    flex-direction:column;
    min-width:0;
}

.contracts-file-copy strong,
.contracts-file-copy small{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.contracts-file-copy strong{font-size:14px}
.contracts-file-copy small{
    margin-top:3px;
    color:#737b84;
    font-size:12px;
}

.contracts-company{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    color:#59616a;
    font-size:13px;
}

.contracts-status{
    display:inline-flex;
    align-items:center;
    min-height:27px;
    padding:4px 9px;
    border:1px solid #dfe3e7;
    border-radius:999px;
    background:#f4f5f6;
    color:#505861;
    font-size:12px;
    font-weight:650;
    white-space:nowrap;
}

.contracts-status-actif{
    border-color:#b8d7bf;
    background:#f0faf2;
}

.contracts-status-brouillon{
    border-color:#d7dce1;
    background:#f6f7f8;
}

.contracts-status-termine{
    border-color:#c6d0db;
    background:#f1f5f8;
}

.contracts-status-annule{
    border-color:#dfb4b4;
    background:#fff1f1;
}

.contracts-amount{
    text-align:right;
    white-space:nowrap;
    font-size:13px;
}

.contracts-row-arrow{
    justify-self:end;
    color:#979ea5;
    font-size:22px;
}

.contracts-empty{
    display:flex;
    align-items:center;
    gap:14px;
    padding:22px;
}

.contracts-empty strong,
.contracts-empty span{display:block}

.contracts-empty .muted{
    margin-top:3px;
    font-size:13px;
}

/* Formulaire contrat */

.contracts-form{max-width:none}

.contracts-form-section{
    padding:4px 0 24px;
    margin-bottom:22px;
    border-bottom:1px solid #e7eaed;
}

.contracts-form-section:last-of-type{
    border-bottom:0;
    margin-bottom:10px;
}

.contracts-form-section-title{
    display:flex;
    align-items:flex-start;
    gap:12px;
    margin-bottom:18px;
}

.contracts-form-step{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 28px;
    width:28px;
    height:28px;
    border-radius:50%;
    background:#eef2f5;
    color:#515a63;
    font-size:13px;
    font-weight:700;
}

.contracts-form-section-title h2{
    margin:1px 0 2px;
    font-size:16px;
}

.contracts-form-section-title p{
    margin:0;
    color:#7b838b;
    font-size:12px;
}

.contracts-conditions-fieldset{
    margin:0;
    padding:0;
    border:0;
}

.contracts-current-file{
    display:block;
    margin:5px 0 4px;
    color:#59616a;
    font-size:12px;
    font-weight:600;
}

.contracts-file-upload input{
    margin-top:7px;
}

.contracts-form-actions{
    display:flex;
    justify-content:flex-end;
    gap:10px;
    padding-top:2px;
}

/* Fiche contrat */

.contracts-detail-layout{
    display:grid;
    grid-template-columns:minmax(0,2fr) minmax(280px,.8fr);
    gap:20px;
    align-items:start;
}

.contracts-detail-main,
.contracts-detail-side{
    display:flex;
    flex-direction:column;
    gap:16px;
}

.contracts-detail-layout .detail-card{
    margin:0;
}

.contracts-economy-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:10px;
    margin-top:14px;
}

.contracts-economy-item{
    min-width:0;
    padding:13px 14px;
    border:1px solid #e6e9ec;
    border-radius:8px;
    background:#fafbfc;
}

.contracts-economy-item span,
.contracts-economy-item strong{
    display:block;
}

.contracts-economy-item span{
    margin-bottom:6px;
    color:#737b84;
    font-size:12px;
}

.contracts-economy-item strong{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:15px;
}

.contracts-economy-item.emphasis{
    border-color:#c6d7e5;
    background:#f3f8fc;
}

.contracts-linked-card h2{
    margin-bottom:12px;
}

.contracts-linked-row{
    display:grid;
    grid-template-columns:34px minmax(0,1fr) auto 24px;
    gap:12px;
    align-items:center;
    padding:11px 12px;
    color:inherit;
    text-decoration:none;
    border:1px solid #e5e8eb;
    border-radius:8px;
    background:#fafbfc;
}

.contracts-linked-row:hover{
    background:#f7fbff;
    border-color:#c7d8e7;
}

.contracts-linked-icon{
    position:relative;
    width:32px;
    height:25px;
    border-radius:3px;
    background:#f2c94c;
}

.contracts-linked-icon::before{
    content:"";
    position:absolute;
    top:-6px;
    left:0;
    width:15px;
    height:8px;
    border-radius:3px 3px 0 0;
    background:#e8bd3f;
}

.contracts-linked-icon.invoice{
    width:25px;
    height:32px;
    border:1px solid #cfd5db;
    border-radius:3px;
    background:#fff;
}

.contracts-linked-icon.invoice::before{
    top:7px;
    left:5px;
    width:13px;
    height:2px;
    border-radius:0;
    background:#d4d9de;
    box-shadow:0 5px 0 #d4d9de,0 10px 0 #d4d9de;
}

.contracts-linked-copy{
    display:flex;
    min-width:0;
    flex-direction:column;
}

.contracts-linked-copy small{
    margin-top:2px;
    color:#737b84;
}

.contracts-linked-value{
    white-space:nowrap;
    font-size:13px;
}

.contracts-conditions-card .facts{
    margin-bottom:0;
}

.contracts-order-row{
    grid-column:1 / -1;
}

.sr-only{
    position:absolute!important;
    width:1px!important;
    height:1px!important;
    padding:0!important;
    margin:-1px!important;
    overflow:hidden!important;
    clip:rect(0,0,0,0)!important;
    white-space:nowrap!important;
    border:0!important;
}

@media (max-width:1000px){
    .contracts-list-header,
    .contracts-list-row{
        grid-template-columns:minmax(240px,1.4fr) minmax(160px,.9fr) minmax(110px,.6fr) minmax(135px,.7fr) 24px;
    }

    .contracts-detail-layout{
        grid-template-columns:1fr;
    }
}

@media (max-width:760px){
    .contracts-list-header{display:none}

    .contracts-list-row{
        grid-template-columns:minmax(0,1fr) auto;
        gap:8px 10px;
        min-height:82px;
    }

    .contracts-main{
        grid-column:1;
        grid-row:1;
    }

    .contracts-company{
        grid-column:1;
        margin-left:47px;
    }

    .contracts-list-row > span:nth-child(3){
        grid-column:1;
        margin-left:47px;
    }

    .contracts-amount{
        grid-column:1;
        margin-left:47px;
        text-align:left;
    }

    .contracts-row-arrow{
        grid-column:2;
        grid-row:1 / span 4;
        align-self:center;
    }

    .contracts-file-copy small{
        white-space:normal;
    }

    .contracts-economy-grid{
        grid-template-columns:1fr 1fr;
    }

    .contracts-form-actions{
        justify-content:stretch;
    }

    .contracts-form-actions .button{
        flex:1;
        text-align:center;
    }

    .contracts-linked-row{
        grid-template-columns:30px minmax(0,1fr) 24px;
    }

    .contracts-linked-value{
        grid-column:2;
        font-size:12px;
    }

    .contracts-linked-row .contracts-row-arrow{
        grid-column:3;
        grid-row:1 / span 2;
    }
}

@media (max-width:520px){
    .contracts-economy-grid{
        grid-template-columns:1fr;
    }
}

/* ==========================================================================
   Bloc 17.5 — Harmonisation globale
   Avenants · Factures · Décisions · Économie · Équipe
   Objectif : même logique visuelle que Plans / Contrats, sans toucher au métier.
   ========================================================================== */

/* Titres et recherche */
.has-project-browser .pagehead{
    margin-bottom:18px;
}

.has-project-browser .pagehead .headrow{
    align-items:flex-start;
    gap:16px;
}

.has-project-browser .pagehead .headrow h1{
    margin-bottom:3px;
}

.has-project-browser .pagehead .search{
    max-width:none;
    margin-top:16px;
}

.has-project-browser .pagehead .search input,
.has-project-browser .pagehead .search select{
    width:100%;
}

/* --------------------------------------------------------------------------
   Listes : apparence type Explorateur Windows
   -------------------------------------------------------------------------- */

.has-project-browser .container > .list{
    overflow:hidden;
    margin-bottom:30px;
    background:#fff;
    border:1px solid #e2e6ea;
    border-radius:10px;
}

.has-project-browser .container > .list > .list-row{
    min-height:68px;
    padding:11px 14px;
    border-bottom:1px solid #edf0f2;
    border-radius:0;
    background:#fff;
}

.has-project-browser .container > .list > .list-row:last-child{
    border-bottom:0;
}

.has-project-browser .container > .list > a.list-row.link{
    position:relative;
    display:flex;
    align-items:center;
    gap:13px;
    color:inherit;
    text-decoration:none;
    transition:background .12s ease;
}

.has-project-browser .container > .list > a.list-row.link:hover{
    background:#f7fbff;
}

/* Icône document générique */
.has-project-browser .container > .list > a.list-row.link::before{
    content:"";
    position:relative;
    display:block;
    flex:0 0 31px;
    width:31px;
    height:38px;
    border:1px solid #cfd5db;
    border-radius:3px;
    background:
        linear-gradient(#d4d9de,#d4d9de) 6px 25px/17px 2px no-repeat,
        linear-gradient(#d4d9de,#d4d9de) 6px 19px/17px 2px no-repeat,
        linear-gradient(#d4d9de,#d4d9de) 6px 13px/17px 2px no-repeat,
        #fff;
    box-shadow:0 1px 2px rgba(0,0,0,.04);
}

.has-project-browser .container > .list > a.list-row.link > div:first-of-type{
    min-width:0;
    flex:1;
}

.has-project-browser .container > .list > a.list-row.link > div:first-of-type strong,
.has-project-browser .container > .list > a.list-row.link > div:first-of-type span,
.has-project-browser .container > .list > a.list-row.link > div:first-of-type small{
    display:block;
}

.has-project-browser .container > .list > a.list-row.link > div:first-of-type strong{
    margin-bottom:3px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.has-project-browser .container > .list > a.list-row.link > div:first-of-type span{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.has-project-browser .container > .list > a.list-row.link > div:first-of-type small{
    margin-top:3px;
    color:#737b84;
    font-size:12px;
}

.has-project-browser .container > .list .row-right{
    display:flex;
    align-items:center;
    gap:12px;
    flex:0 0 auto;
    margin-left:auto;
    text-align:right;
}

.has-project-browser .container > .list .row-right strong{
    white-space:nowrap;
}

.has-project-browser .container > .list > a.list-row.link > span:last-child{
    flex:0 0 auto;
    color:#979ea5;
    font-size:22px;
}

/* Les listes embarquées dans une fiche restent compactes */
.has-project-browser .detail-card .list-row.embedded{
    border:1px solid #e5e8eb;
    border-radius:8px;
    background:#fafbfc;
}

.has-project-browser .detail-card .list-row.embedded:hover{
    background:#f7fbff;
    border-color:#c7d8e7;
}

/* --------------------------------------------------------------------------
   Fiches
   -------------------------------------------------------------------------- */

.has-project-browser .detail-card{
    border:1px solid #e3e7eb;
    border-radius:10px;
    box-shadow:none;
}

.has-project-browser .detail-card > h2:first-child{
    margin-top:0;
}

.has-project-browser .section-title{
    align-items:center;
}

.has-project-browser .facts{
    gap:0;
    overflow:hidden;
    margin-top:12px;
    border:1px solid #e7eaed;
    border-radius:8px;
}

.has-project-browser .facts > div{
    padding:11px 13px;
    border-bottom:1px solid #edf0f2;
}

.has-project-browser .facts > div:last-child{
    border-bottom:0;
}

.has-project-browser .facts dt{
    color:#747c85;
    font-size:12px;
}

.has-project-browser .facts dd{
    font-weight:600;
}

/* Actions métier : validation, correction, décision, retransmission... */
.has-project-browser .action-card{
    border:1px solid #dfe5ea;
    border-radius:10px;
    background:#fafbfc;
    box-shadow:none;
}

.has-project-browser .action-card form{
    margin-bottom:0;
}

.has-project-browser .action-card textarea{
    width:100%;
}

/* --------------------------------------------------------------------------
   Formulaires
   -------------------------------------------------------------------------- */

.has-project-browser .form-card{
    max-width:none;
    border:1px solid #e3e7eb;
    border-radius:10px;
    box-shadow:none;
}

.has-project-browser .form-card fieldset{
    margin-top:22px;
    padding-top:18px;
    border:0;
    border-top:1px solid #e7eaed;
}

.has-project-browser .form-card legend{
    padding:0 0 12px;
    font-size:15px;
    font-weight:700;
}

.has-project-browser .form-card > button.button.primary:last-child{
    margin-top:8px;
}

/* --------------------------------------------------------------------------
   Statuts : cohérence visuelle globale
   -------------------------------------------------------------------------- */

.has-project-browser .status{
    display:inline-flex;
    align-items:center;
    min-height:27px;
    padding:4px 9px;
    border:1px solid #dfe3e7;
    border-radius:999px;
    background:#f4f5f6;
    color:#505861;
    font-size:12px;
    font-weight:650;
    white-space:nowrap;
}

/* --------------------------------------------------------------------------
   Historique
   -------------------------------------------------------------------------- */

.has-project-browser .timeline{
    margin-top:12px;
}

.has-project-browser .timeline > div{
    position:relative;
    padding:12px 12px 12px 20px;
    border-left:2px solid #e2e6ea;
}

.has-project-browser .timeline > div::before{
    content:"";
    position:absolute;
    left:-5px;
    top:17px;
    width:8px;
    height:8px;
    border-radius:50%;
    background:#a9b2bb;
}

.has-project-browser .timeline time{
    color:#7b838b;
    font-size:11px;
}

.has-project-browser .timeline strong{
    display:block;
    margin-top:3px;
}

/* --------------------------------------------------------------------------
   Économie
   Les tableaux restent des tableaux, mais avec le même langage visuel.
   -------------------------------------------------------------------------- */

.has-project-browser table{
    width:100%;
    border-collapse:separate;
    border-spacing:0;
    overflow:hidden;
    background:#fff;
    border:1px solid #e2e6ea;
    border-radius:9px;
}

.has-project-browser table th{
    padding:10px 12px;
    background:#f7f8fa;
    border-bottom:1px solid #e4e7ea;
    color:#69717a;
    font-size:12px;
    font-weight:700;
    text-align:left;
}

.has-project-browser table td{
    padding:10px 12px;
    border-bottom:1px solid #edf0f2;
}

.has-project-browser table tr:last-child td{
    border-bottom:0;
}

.has-project-browser table tbody tr:hover td{
    background:#f9fbfd;
}

/* --------------------------------------------------------------------------
   Équipe
   Les fiches personnes/intervenants ressemblent davantage à des éléments
   de dossier tout en gardant les actions existantes.
   -------------------------------------------------------------------------- */

.has-project-browser .mini-list > div{
    min-height:48px;
    padding:9px 0;
    border-bottom:1px solid #edf0f2;
}

.has-project-browser .mini-list > div:last-child{
    border-bottom:0;
}

.has-project-browser .checks{
    gap:7px;
}

.has-project-browser .check{
    border:1px solid #e5e8eb;
    border-radius:8px;
    background:#fafbfc;
}

.has-project-browser .check:hover{
    background:#f7fbff;
    border-color:#c7d8e7;
}

/* --------------------------------------------------------------------------
   Mobile
   -------------------------------------------------------------------------- */

@media (max-width:700px){
    .has-project-browser .container > .list > .list-row{
        min-height:64px;
        padding:10px 12px;
    }

    .has-project-browser .container > .list > a.list-row.link::before{
        flex-basis:26px;
        width:26px;
        height:33px;
        background:
            linear-gradient(#d4d9de,#d4d9de) 5px 22px/14px 2px no-repeat,
            linear-gradient(#d4d9de,#d4d9de) 5px 17px/14px 2px no-repeat,
            linear-gradient(#d4d9de,#d4d9de) 5px 12px/14px 2px no-repeat,
            #fff;
    }

    .has-project-browser .container > .list .row-right{
        gap:7px;
    }

    .has-project-browser .container > .list .row-right strong{
        font-size:12px;
    }

    .has-project-browser .facts > div{
        padding:10px 11px;
    }

    .has-project-browser table{
        display:block;
        overflow-x:auto;
        white-space:nowrap;
    }
}

/* ==========================================================================
   Bloc 17.6 — Sous-dossiers Plans
   ========================================================================== */

.plan-folders-section{
    margin-top:6px;
    margin-bottom:34px;
}

.plan-folder-context{
    display:flex;
    align-items:center;
    gap:13px;
    margin:0 0 16px;
    padding:12px 14px;
    border:1px solid #e3e7eb;
    border-radius:9px;
    background:#fafbfc;
}

.plan-folder-context .project-folder-icon{
    flex-basis:34px;
    width:34px;
    height:24px;
    margin-top:4px;
}

.plan-folder-context .project-folder-icon::before{
    top:-6px;
    width:17px;
    height:8px;
}

.plan-folder-context > span:last-child{
    display:flex;
    flex-direction:column;
}

.plan-folder-context small{
    color:#7b838b;
    font-size:11px;
}

.plan-folder-context strong{
    margin-top:2px;
    font-size:14px;
}

@media (max-width:700px){
    .plan-folders-section .project-folder-row{
        min-height:64px;
    }
}

/* ==========================================================================
   Bloc 17.7 — Dashboard À traiter
   ========================================================================== */

.dashboard-todo-section{
    margin-bottom:28px;
}

.dashboard-todo-card{
    text-decoration:none;
}

.dashboard-todo-card.is-empty{
    cursor:default;
    opacity:.58;
    user-select:none;
}

.dashboard-todo-card.todo-link:hover{
    background:#f7fbff;
    border-color:#b8d2ea;
}

.dashboard-todo-card.is-selected{
    border-color:#9fc3e1;
    background:#f2f8fd;
    box-shadow:0 0 0 1px rgba(100,153,198,.12);
}

.dashboard-todo-list-section{
    max-width:860px;
    margin:10px 0 30px;
}

.dashboard-todo-list-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:16px;
    margin-bottom:10px;
}

.dashboard-todo-list-head h2{
    margin-bottom:2px;
}

.dashboard-todo-list-head p{
    margin:0;
}

.dashboard-todo-close{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 34px;
    width:34px;
    height:34px;
    border:1px solid #dfe3e7;
    border-radius:8px;
    background:#fff;
    color:#626a72;
    text-decoration:none;
    font-size:22px;
    line-height:1;
}

.dashboard-todo-close:hover{
    background:#f3f5f7;
}

.dashboard-action-list{
    overflow:hidden;
    background:#fff;
    border:1px solid #e2e6ea;
    border-radius:10px;
}

.dashboard-action-row{
    display:grid;
    grid-template-columns:32px minmax(0,1fr) auto 24px;
    gap:13px;
    align-items:center;
    min-height:72px;
    padding:11px 14px;
    color:inherit;
    text-decoration:none;
    border-bottom:1px solid #edf0f2;
    transition:background .12s ease;
}

.dashboard-action-row:last-child{
    border-bottom:0;
}

.dashboard-action-row:hover{
    background:#f7fbff;
}

.dashboard-action-icon{
    position:relative;
    width:31px;
    height:38px;
    border:1px solid #cfd5db;
    border-radius:3px;
    background:
        linear-gradient(#d4d9de,#d4d9de) 6px 25px/17px 2px no-repeat,
        linear-gradient(#d4d9de,#d4d9de) 6px 19px/17px 2px no-repeat,
        linear-gradient(#d4d9de,#d4d9de) 6px 13px/17px 2px no-repeat,
        #fff;
    box-shadow:0 1px 2px rgba(0,0,0,.04);
}

.dashboard-action-main{
    display:flex;
    min-width:0;
    flex-direction:column;
}

.dashboard-action-main strong,
.dashboard-action-main span,
.dashboard-action-main small{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.dashboard-action-main span{
    margin-top:2px;
    color:#4e565e;
    font-size:13px;
}

.dashboard-action-main small{
    margin-top:4px;
    color:#737b84;
    font-size:12px;
}

.dashboard-action-amount{
    white-space:nowrap;
    font-size:13px;
}

.dashboard-action-arrow{
    justify-self:end;
    color:#979ea5;
    font-size:22px;
}

.dashboard-history-section{
    margin-top:28px;
}

@media (max-width:700px){
    .dashboard-action-row{
        grid-template-columns:28px minmax(0,1fr) 20px;
    }

    .dashboard-action-amount{
        grid-column:2;
        font-size:12px;
    }

    .dashboard-action-arrow{
        grid-column:3;
        grid-row:1 / span 2;
    }
}

/* ==========================================================================
   Bloc 17.9 — Identité typographique Helvetica
   Direction visuelle : SIA / bureau d'ingénieur / institutionnel suisse
   ========================================================================== */

:root{
    --ad-font-sans:"Helvetica Neue",Helvetica,Arial,sans-serif;
}

html,
body{
    font-family:var(--ad-font-sans);
    font-weight:400;
    letter-spacing:0;
}

button,
input,
select,
textarea,
option{
    font-family:var(--ad-font-sans);
}

h1,
h2,
h3,
h4,
h5,
h6{
    font-family:var(--ad-font-sans);
    font-weight:600;
    letter-spacing:-0.015em;
}

h1{
    font-weight:600;
}

strong,
b{
    font-weight:600;
}

.button,
.addbtn,
.topbar,
.bottomnav,
.project-browser-path,
.project-browser-back,
.status,
.plans-status,
.contracts-status,
.project-folder-row,
.dashboard-todo-card{
    font-family:var(--ad-font-sans);
}

.button{
    font-weight:500;
}

label,
legend,
th,
dt{
    font-family:var(--ad-font-sans);
}

th,
dt{
    font-weight:600;
}

input,
select,
textarea{
    font-weight:400;
}

.muted,
small,
time{
    font-family:var(--ad-font-sans);
}

/* Rendu plus institutionnel : titres légèrement plus compacts */
.pagehead h1,
.project-head h1{
    line-height:1.12;
}

/* Évite les graisses trop "app grand public" */
.project-folder-copy strong,
.plans-file-copy strong,
.contracts-file-copy strong,
.dashboard-action-main strong{
    font-weight:600;
}

/* ==========================================================================
   Bloc 17.10 — Suppression projet administrateur
   ========================================================================== */

.button.danger{
    border-color:#c9a3a3;
    background:#fff;
    color:#8a2f2f;
}

.button.danger:hover{
    border-color:#b67f7f;
    background:#fff5f5;
    color:#742424;
}

.project-delete-form{
    margin-left:auto;
}

.project-delete-note{
    display:flex;
    align-items:center;
    max-width:430px;
    margin-left:auto;
    color:#7b838b;
    font-size:12px;
    line-height:1.35;
}

@media (max-width:700px){
    .project-delete-form,
    .project-delete-note{
        margin-left:0;
        width:100%;
    }

    .project-delete-form .button{
        width:100%;
    }
}

/* ==========================================================================
   Bloc 17.11 — Suppression complète administrateur
   ========================================================================== */

.project-delete-zone{
    flex:1 0 100%;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    margin-top:8px;
    padding-top:16px;
    border-top:1px solid #e3e6e9;
}

.project-delete-warning{
    display:flex;
    flex:1;
    min-width:0;
    flex-direction:column;
    gap:3px;
    max-width:600px;
    color:#69717a;
    font-size:12px;
    line-height:1.4;
}

.project-delete-warning strong{
    color:#7d3030;
    font-weight:600;
}

.project-delete-form{
    flex:0 0 auto;
    margin-left:auto;
}

.button.danger{
    border-color:#c79b9b;
    background:#fff;
    color:#842d2d;
    font-weight:500;
}

.button.danger:hover{
    border-color:#ac7474;
    background:#fff4f4;
    color:#6f2020;
}

@media (max-width:700px){
    .project-delete-zone{
        align-items:stretch;
        flex-direction:column;
    }

    .project-delete-form{
        width:100%;
        margin-left:0;
    }

    .project-delete-form .button{
        width:100%;
    }
}

/* ==========================================================================
   Bloc 17.12 — Menu inférieur
   ========================================================================== */

.bottomnav{
    font-family:var(--ad-font-sans, "Helvetica Neue", Helvetica, Arial, sans-serif);
}

.bottomnav a{
    font-size:16px;
    font-weight:400;
    white-space:nowrap;
    line-height:1.15;
}

/* Recherche ne doit jamais apparaître en gras */
.bottomnav a[href="/recherche"]{
    font-weight:400 !important;
}

/* Annuaire des projets reste sur une seule ligne */
.bottomnav a[href="/projets"]{
    white-space:nowrap;
    min-width:max-content;
}

/* Le bouton + garde sa taille et son rôle visuel distinct */
.bottomnav .addbtn{
    font-size:30px !important;
    font-weight:300 !important;
}

@media (max-width:760px){
    .bottomnav a{
        font-size:15px;
    }
}

/* ==========================================================================
   Bloc 17.14 — Suppression intervenants / personnes
   ========================================================================== */

.directory-person-actions{
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
}

.directory-delete-inline{
    margin:0;
}

.directory-danger-zone{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    margin-top:28px;
    padding:18px;
    border:1px solid #e4d4d4;
    border-radius:10px;
    background:#fffafa;
}

.directory-danger-zone h2{
    margin:0 0 4px;
    color:#7d3030;
    font-size:16px;
}

.directory-danger-zone p{
    margin:0;
    max-width:650px;
    font-size:12px;
    line-height:1.4;
}

.directory-danger-zone form{
    flex:0 0 auto;
    margin:0;
}

@media (max-width:700px){
    .directory-danger-zone{
        align-items:stretch;
        flex-direction:column;
    }

    .directory-danger-zone .button{
        width:100%;
    }
}
