.preventive-workspace{min-width:0}.pv-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:14px}.pv-toolbar p{margin:5px 0;color:var(--muted)}.pv-actions,.pv-tabs{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:12px 0}.pv-tabs{position:sticky;top:0;z-index:2;background:var(--card,#fff);padding:10px 0;border-bottom:1px solid var(--line,#a9b4c3)}.pv-counters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:16px 0}.pv-counters>div{border:1px solid var(--line,#a9b4c3);border-radius:10px;background:var(--pale,#e5ebf2);padding:14px;display:grid;gap:7px}.pv-counters strong{font-size:24px;color:var(--ink,#17344e)}.pv-warning strong{color:#af2831}.pv-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:14px 0}.preventive-workspace label,.preventive-modal-body label{display:grid;gap:7px;margin:10px 0;font-weight:600}.preventive-workspace input,.preventive-workspace select,.preventive-workspace textarea,.preventive-modal-body input,.preventive-modal-body select,.preventive-modal-body textarea{width:100%;min-width:0;border:1px solid var(--line,#a9b4c3);border-radius:8px;padding:10px 12px;background:var(--card,#fff);color:var(--ink,#17344e);font:inherit}.pv-wide{grid-column:1/-1}.pv-check{display:flex!important;align-items:center;gap:10px!important}.pv-check input{width:18px;height:18px;min-height:0!important;flex:none}.pv-check-editor,.pv-result,.pv-evidence{border:1px solid var(--line,#a9b4c3);border-radius:10px;padding:18px;margin:16px 0;background:var(--card,#fff)}.pv-date-row{display:grid;grid-template-columns:1fr 1fr 1.2fr 1.5fr auto auto;gap:12px;align-items:end;border-bottom:1px solid var(--line);padding:10px 0}.pv-period{max-width:440px}.pv-sheet-summary{display:flex;justify-content:space-between;align-items:center;gap:16px;border:1px solid var(--line,#a9b4c3);border-radius:9px;padding:14px;margin:12px 0}.pv-sheet-summary>div:first-child{display:grid;gap:6px;min-width:0}.pv-sheet-summary span,.pv-sheet-summary small,.pv-trace{color:var(--muted)}.pv-history{border-bottom:1px solid var(--line);padding:12px 0}.preventive-dialog{width:min(1100px,calc(100vw - 30px));max-width:none;max-height:calc(100dvh - 30px);padding:0;border:1px solid var(--line);border-radius:13px;background:var(--card,#fff);color:var(--ink);overflow:hidden}.preventive-dialog>header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px 20px;border-bottom:1px solid var(--line)}.preventive-dialog h2{margin:0;font-size:20px}.preventive-modal-body{padding:16px 22px;max-height:calc(100dvh - 125px);overflow:auto}.preventive-workspace [data-preventive-error],.preventive-modal-body [data-preventive-error]{color:#ae2634;white-space:pre-wrap}.dark-mode .pv-tabs,.dark-mode .pv-check-editor,.dark-mode .pv-result,.dark-mode .pv-evidence,.dark-mode .preventive-dialog{background:#172231}.dark-mode .pv-counters>div{background:#203044}.dark-mode .preventive-workspace input,.dark-mode .preventive-workspace select,.dark-mode .preventive-workspace textarea,.dark-mode .preventive-modal-body input,.dark-mode .preventive-modal-body select,.dark-mode .preventive-modal-body textarea{background:#172231;color:#e7eef8;border-color:#64748b}.dark-mode .pv-warning strong,.dark-mode [data-preventive-error]{color:#ffb6bd}@media(max-width:760px){.pv-toolbar,.pv-sheet-summary{align-items:stretch;flex-direction:column}.pv-counters,.pv-form-grid{grid-template-columns:1fr 1fr}.pv-date-row{grid-template-columns:1fr 1fr}.pv-tabs{position:static}.preventive-modal-body{padding:12px}.preventive-dialog>header h2{font-size:16px}.pv-sheet-summary .btn{width:100%}}@media(max-width:480px){.pv-form-grid{grid-template-columns:1fr}.pv-counters strong{font-size:21px}.pv-wide{grid-column:auto}.pv-date-row{grid-template-columns:1fr}.pv-tabs .btn{flex:1 1 45%}.pv-toolbar .pv-actions .btn{flex:1}.pv-result,.pv-check-editor{padding:12px}}

.pv-collection{display:grid;gap:8px;padding:14px;border:1px solid var(--line,#a9b4c3);border-left:4px solid #c58113;border-radius:8px;margin:12px 0;background:var(--pale,#e5ebf2)}.pv-collection p{margin:0}.pv-collection small{overflow-wrap:anywhere}.pv-collection-ok{border-left-color:#16815c}.pv-collection-error{border-left-color:#c32d3b}.pv-collection .btn{justify-self:start;max-width:100%;white-space:normal}.dark-mode .pv-collection{background:#203044;color:#e7eef8}
.preventive-dialog>header [data-pv-close]{flex:0 0 auto;white-space:nowrap}.preventive-dialog>header h2{min-width:0;overflow-wrap:anywhere}

/* V166: sections courtes, champs conservés lors du changement d'onglet. */
.preventive-workspace [hidden],.preventive-modal-body [hidden]{display:none!important}
#detailDialog[data-preventive-ui=true] #detailFields{display:none}
#detailDialog[data-preventive-ui=true] .detail-extras{margin-top:0}
.pv-intro{padding:14px 16px;background:var(--pale,#e5ebf2);border-left:4px solid var(--blue,#2476d3);border-radius:8px;line-height:1.6}
.pv-config-tabs{position:static}
.pv-config-footer{background:var(--card,#fff);border-top:1px solid var(--line,#a9b4c3);padding:12px 0;margin-top:18px}
.pv-config-footer>p{font-size:13px;line-height:1.5}
.pv-config-footer [data-pv-draft]{display:inline-block;margin:8px 12px;color:var(--muted)}
.pv-date-row{grid-template-columns:repeat(2,minmax(0,1fr));padding:16px;border:1px solid var(--line,#a9b4c3);border-radius:10px;margin:14px 0;align-items:center}
.pv-date-row .btn{justify-self:end}
.preventive-workspace h3,.preventive-modal-body h3{margin:20px 0 10px}
.preventive-modal-body [data-pv-item-picker]{width:100%}
.pv-tabs .btn{white-space:normal;text-align:center;min-height:42px}
.pv-tabs .btn.primary{box-shadow:inset 0 -3px 0 rgba(0,0,0,.18)}
.dark-mode .pv-config-footer{background:#172231}
.dark-mode .pv-intro{background:#203044}
@media(max-width:600px){.pv-date-row{grid-template-columns:1fr}.pv-date-row .btn{justify-self:stretch}.pv-config-footer{position:static}.pv-tabs{gap:8px}.pv-tabs .btn{flex:1 1 45%;padding:10px}.pv-counters{gap:8px}.pv-counters>div{padding:10px}}

/* V171: consultation et éditeur dédiés, modèles dans Outils. */
.preventive-dialog .pv-config-footer{position:static;z-index:3;padding:12px;background:var(--card,#fff)}
.dark-mode .preventive-dialog .pv-config-footer{background:#172231}
.preventive-workspace dl{overflow-wrap:anywhere}.pv-sheet-summary ul{padding-left:20px}
.preventive-dialog input:disabled,.preventive-dialog select:disabled,.preventive-dialog textarea:disabled{opacity:1;cursor:default}
@media(max-width:600px){.preventive-dialog .pv-config-footer{position:static}.pv-config-footer .btn{width:100%}}

/* V172 — mêmes bandeau, commandes et retraits que les formulaires de fiches. */
.preventive-dialog>.dialog-head{flex-wrap:nowrap;gap:16px;padding:16px 24px;background:linear-gradient(125deg,var(--navy),var(--teal));color:#fff;border-bottom-color:transparent}
.pv-dialog-heading{display:flex;align-items:center;gap:12px;flex:1 1 auto;min-width:0}
.pv-dialog-heading>img{width:36px;height:36px;object-fit:contain;flex:none}
.pv-dialog-heading>div{min-width:0}
.pv-dialog-heading small{display:block;color:#d7e5f3;font-size:10px;letter-spacing:.08em;margin-bottom:4px}
.preventive-dialog>.dialog-head h2{color:#fff;line-height:1.3}
.preventive-modal-body{padding:22px 26px}
.preventive-dialog>.dialog-head .icon-btn{width:40px;min-width:40px;height:40px;min-height:40px;padding:0;background:rgba(255,255,255,.16);color:#fff}
.preventive-dialog>.dialog-head .icon-btn:hover{background:rgba(255,255,255,.28)}
@media(max-width:600px){.preventive-dialog>.dialog-head{padding:14px 16px;gap:10px}.pv-dialog-heading{gap:8px}.pv-dialog-heading>img{display:none}.preventive-modal-body{padding:18px 16px}.preventive-dialog>.dialog-head h2{font-size:16px}}

/* General maintenance report: client and dates first, content and PDF actions second. */
.pv-general-report [data-pv-report-form]{display:grid;grid-template-columns:minmax(240px,1fr) auto auto;gap:16px;align-items:end}
.pv-general-report [data-pv-report-form]>.pv-form-grid{display:contents}
.pv-general-report [data-pv-report-form]>.pv-form-grid>label{margin:0;min-width:0}
.pv-general-report [data-pv-report-form]>.pv-form-grid>label:nth-child(1){grid-column:1;grid-row:1}
.pv-general-report [data-pv-report-form]>.pv-form-grid>label:nth-child(2){grid-column:2;grid-row:1}
.pv-general-report [data-pv-report-form]>.pv-form-grid>label:nth-child(3){grid-column:3;grid-row:1}
.pv-general-report [data-pv-report-form]>.pv-form-grid>label:nth-child(4){grid-column:1;grid-row:2}
.pv-general-report [data-pv-report-form]>.pv-actions{grid-column:2/4;grid-row:2;justify-content:flex-end;flex-wrap:nowrap;margin:0}
.pv-general-report [data-pv-report-form]>[data-preventive-error]{grid-column:1/-1;margin:0}
.pv-general-report [data-pv-report-form] input[type=date]{width:170px;max-width:100%;box-sizing:border-box}
@media(max-width:850px){.pv-general-report [data-pv-report-form]{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.pv-general-report [data-pv-report-form]>.pv-form-grid>label:nth-child(1){grid-column:1/-1;grid-row:1}.pv-general-report [data-pv-report-form]>.pv-form-grid>label:nth-child(2){grid-column:1;grid-row:2}.pv-general-report [data-pv-report-form]>.pv-form-grid>label:nth-child(3){grid-column:2;grid-row:2}.pv-general-report [data-pv-report-form]>.pv-form-grid>label:nth-child(4){grid-column:1/-1;grid-row:3}.pv-general-report [data-pv-report-form]>.pv-actions{grid-column:1/-1;grid-row:4;flex-wrap:wrap}.pv-general-report [data-pv-report-form] input[type=date]{width:100%}}
