/* HABYS – Service social */
:root{--bg-main:#e5e7eb;--card-bg:#fff;--text-main:#0f172a;--text-muted:#4b5563;--radius-lg:12px;--primary:#1d4ed8;--border-soft:#e5e7eb;--danger:#dc2626;--success:#16a34a;--warn:#d97706;--purple:#7c3aed}
*{box-sizing:border-box;margin:0;padding:0;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
body{background:var(--bg-main);color:var(--text-main);min-height:100vh;font-size:16px}.sidebar{position:fixed;top:0;left:0;width:260px;height:100vh;background:linear-gradient(rgba(100,150,200,.06) 1px,transparent 1px),linear-gradient(90deg,rgba(100,150,200,.06) 1px,transparent 1px),linear-gradient(135deg,#0a1628 0%,#1a2740 50%,#0f1e33 100%);background-size:40px 40px,40px 40px,auto;color:#e5e7eb;padding:24px 18px;display:flex;flex-direction:column;gap:24px;overflow:hidden}.sidebar-logo{display:flex;flex-direction:column;align-items:center;gap:8px}.sidebar-logo span{font-size:.9rem;text-align:center;color:#e5e7eb}.sidebar-nav{list-style:none;display:flex;flex-direction:column;gap:6px;flex:1}.sidebar-nav li a{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:8px;text-decoration:none;font-size:.95rem;color:#e5e7eb!important}.sidebar-nav li a.active{font-weight:600;color:#fff!important}.icon-img{width:40px;height:40px;object-fit:contain;flex-shrink:0}.sidebar-footer{font-size:.8rem;color:rgba(229,231,235,.8);text-align:center}.main{margin-left:260px;padding:24px 28px 36px;min-height:100vh;width:calc(100% - 260px)}.main-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;gap:12px;flex-wrap:wrap}.main-title{font-size:2rem;font-weight:600}.user-pill{display:inline-flex;align-items:center;gap:8px;padding:10px 16px;border-radius:999px;background:#fff;box-shadow:0 1px 3px rgba(15,23,42,.15);font-size:.95rem;color:var(--text-muted)}.logout-link{cursor:pointer;text-decoration:underline;color:var(--danger);font-size:.9rem}.intro{font-size:1rem;color:var(--text-muted);margin-bottom:14px;line-height:1.45}.page-tabs{display:flex;gap:0;border-bottom:2px solid #e5e7eb;margin-bottom:16px;background:transparent;flex-wrap:wrap}.page-tab{padding:10px 22px;font-size:.95rem;font-weight:700;cursor:pointer;border:none;border-bottom:3px solid transparent;color:var(--text-muted);background:none;margin-bottom:-2px;text-decoration:none}.page-tab:hover{color:var(--primary)}.page-tab.active{color:var(--primary);border-bottom-color:var(--primary)}.filters,.zone,.panel{background:#fff;border:1px solid var(--border-soft);border-radius:var(--radius-lg);box-shadow:0 2px 4px rgba(15,23,42,.06)}.filters{padding:14px;display:flex;gap:10px;flex-wrap:wrap;align-items:end;margin-bottom:14px}.f-group{display:flex;flex-direction:column;gap:6px;min-width:180px;flex:1}.f-group label,.fg label{font-size:.85rem;color:var(--text-muted);font-weight:800}.filters select,.filters input,.fg input,.fg select,.fg textarea{padding:10px 12px;border-radius:10px;border:1px solid #e5e7eb;outline:none;font-size:.95rem;background:#fff}.fg textarea{min-height:100px;resize:vertical}.fg input:focus,.fg select:focus,.fg textarea:focus,.filters select:focus,.filters input:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(29,78,216,.08)}.f-actions{display:flex;gap:8px;align-items:center;margin-left:auto;flex-wrap:wrap}.btn{padding:9px 14px;border-radius:10px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;font-weight:800;font-size:.92rem;white-space:nowrap;text-decoration:none;color:#111827;display:inline-flex;align-items:center;justify-content:center;gap:6px}.btn:hover{box-shadow:0 6px 14px rgba(15,23,42,.08)}.btn-primary{border:none;background:var(--primary);color:#fff}.btn-danger{border:none;background:var(--danger);color:#fff}.btn-success{border:none;background:var(--success);color:#fff}.btn-warn{border:none;background:var(--warn);color:#fff}.btn-purple{border:none;background:var(--purple);color:#fff}.result-count{font-size:.9rem;color:var(--text-muted);font-weight:800;padding:8px 10px;border-radius:10px;background:#f9fafb;border:1px solid #eef2f7}.zone{padding:18px}.zone-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;border-bottom:1px solid #e5e7eb;padding-bottom:10px;gap:10px;flex-wrap:wrap}.zone-title{font-size:1.25rem;font-weight:800}.zone-tag{font-size:.85rem;padding:4px 10px;border-radius:999px;background:#e5e7eb;color:#374151;font-weight:800}.table-wrap{width:100%;overflow:auto;border-radius:12px;border:1px solid #e5e7eb;background:#fff}table{border-collapse:collapse;width:100%;min-width:1100px}thead th{position:sticky;top:0;background:#f9fafb;z-index:2;border-bottom:1px solid #e5e7eb;font-size:.88rem;text-align:left;padding:9px 10px;white-space:nowrap}tbody td{border-bottom:1px solid #eef2f7;padding:9px 10px;font-size:.9rem;vertical-align:top}tbody tr:nth-child(even) td{background:rgba(15,23,42,.02)}.mini{padding:5px 9px;border-radius:8px;border:1px solid #e5e7eb;background:#fff;font-weight:900;cursor:pointer;font-size:.82rem}.mini.primary{border:none;background:var(--primary);color:#fff}.mini.danger{border:none;background:var(--danger);color:#fff}.mini.success{border:none;background:var(--success);color:#fff}.mini.warn{border:none;background:var(--warn);color:#fff}.badge{display:inline-flex;align-items:center;padding:3px 9px;border-radius:999px;font-weight:900;font-size:.8rem;border:1px solid rgba(29,78,216,.18);background:rgba(29,78,216,.1);color:#1e40af;white-space:nowrap}.badge-soft{background:#f3f4f6;color:#374151;border-color:#e5e7eb}.badge-danger{background:#fee2e2;color:#dc2626;border-color:#fca5a5}.badge-success{background:#dcfce7;color:#15803d;border-color:#86efac}.muted{color:#6b7280;font-weight:700;font-size:.9rem}.row-actions{display:flex;gap:6px;flex-wrap:wrap}.modal-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.55);display:none;align-items:center;justify-content:center;z-index:50;padding:18px}.modal-backdrop.show{display:flex}.modal{width:min(1080px,100%);background:#fff;border-radius:14px;border:1px solid #e5e7eb;box-shadow:0 20px 50px rgba(0,0,0,.25);display:flex;flex-direction:column;max-height:90vh;overflow:hidden}.modal-head{padding:13px 16px;display:flex;align-items:center;justify-content:space-between;gap:10px;border-bottom:1px solid #eef2f7;background:#f9fafb;flex-shrink:0}.modal-title{font-size:1.05rem;font-weight:900}.modal-scroll{overflow-y:auto;flex:1}.modal-body{padding:16px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.fg{display:flex;flex-direction:column;gap:6px}.fg-full{grid-column:1/-1}.modal-foot{padding:13px 16px;display:flex;gap:10px;justify-content:flex-end;border-top:1px solid #eef2f7;background:#fff;flex-shrink:0;flex-wrap:wrap}.toast{position:fixed;right:18px;bottom:18px;z-index:300;background:#111827;color:#fff;border-radius:12px;padding:12px 16px;font-weight:800;box-shadow:0 12px 30px rgba(0,0,0,.25);display:none;max-width:min(520px,90vw);line-height:1.35}.toast.show{display:block}.logo-animation{display:flex;flex-direction:column;align-items:center;gap:6px;pointer-events:none}.building-container{opacity:0;transform:translateX(-300px) rotate(-10deg);animation:buildingEnter .8s ease-out .3s forwards}@keyframes buildingEnter{0%{opacity:0;transform:translateX(-300px) rotate(-10deg) scale(.5)}60%{opacity:1;transform:translateX(20px) rotate(8deg) scale(1.2)}75%{transform:translateX(-10px) rotate(-4deg) scale(.95)}90%{transform:translateX(5px) rotate(2deg) scale(1.05)}100%{opacity:1;transform:translateX(0) rotate(0deg) scale(1)}}.building-img{width:130px;height:130px;object-fit:contain;filter:drop-shadow(0 15px 40px rgba(0,0,0,.6));animation:buildingLookAround 1s ease-in-out 1.2s,buildingBigJump .6s cubic-bezier(.36,0,.66,-.56) 2s,buildingBreathe 3.5s ease-in-out 3.8s infinite}@keyframes buildingLookAround{0%,100%{transform:rotate(0) scale(1)}15%{transform:rotate(-8deg) scale(1.05)}30%{transform:rotate(10deg) scale(1.08)}45%{transform:rotate(-6deg) scale(1.03)}60%{transform:rotate(8deg) scale(1.06)}75%{transform:rotate(-4deg) scale(1.02)}90%{transform:rotate(2deg) scale(1.01)}}@keyframes buildingBigJump{0%{transform:translateY(0) rotate(0) scaleY(1) scaleX(1)}10%{transform:translateY(0) rotate(0) scaleY(.8) scaleX(1.15)}35%{transform:translateY(-60px) rotate(-15deg) scaleY(1.25) scaleX(.9)}50%{transform:translateY(-70px) rotate(0) scaleY(1.15) scaleX(.95)}65%{transform:translateY(0) rotate(10deg) scaleY(.85) scaleX(1.2)}75%{transform:translateY(-20px) rotate(-5deg) scaleY(1.1) scaleX(.95)}85%{transform:translateY(0) rotate(3deg) scaleY(.95) scaleX(1.05)}92%{transform:translateY(-8px) rotate(-2deg) scaleY(1.05) scaleX(.98)}100%{transform:translateY(0) rotate(0) scaleY(1) scaleX(1)}}@keyframes buildingBreathe{0%,100%{transform:scale(1,1) rotate(0)}15%{transform:scale(1.04,.98) rotate(1.5deg)}35%{transform:scale(.98,1.05) rotate(-1deg)}50%{transform:scale(.97,1.06) rotate(-1.5deg)}65%{transform:scale(1.03,.99) rotate(1deg)}85%{transform:scale(1.02,1.01) rotate(.5deg)}}.text-wrapper{display:flex;flex-direction:column;align-items:center;gap:4px}.text-container{display:flex;gap:2px}.letter{font-size:96px;font-weight:900;color:#fff;text-shadow:1px 1px 0 #d0d0d0,2px 2px 0 #b0b0b0,3px 3px 0 #909090,4px 4px 0 #707070,5px 5px 0 #505050,6px 6px 0 #303030,0 0 20px rgba(100,150,200,.4),0 8px 20px rgba(0,0,0,.6);opacity:0;display:inline-block;line-height:1}.letter-h{animation:letterArrive .4s cubic-bezier(.68,-.55,.265,1.55) .5s forwards,breatheLetters 2.8s ease-in-out 3.8s infinite}.letter-a{animation:letterArrive .4s cubic-bezier(.68,-.55,.265,1.55) .6s forwards,breatheLetters 3s ease-in-out 3.9s infinite}.letter-b{animation:letterArrive .4s cubic-bezier(.68,-.55,.265,1.55) .7s forwards,breatheLetters 2.6s ease-in-out 4s infinite}.letter-y{animation:letterArrive .4s cubic-bezier(.68,-.55,.265,1.55) .8s forwards,breatheLetters 3.2s ease-in-out 4.1s infinite}.letter-s{animation:letterArrive .4s cubic-bezier(.68,-.55,.265,1.55) .9s forwards,breatheLetters 2.9s ease-in-out 4.2s infinite}@keyframes letterArrive{0%{opacity:0;transform:translateY(-40px) scale(.5,.5) rotate(-15deg)}60%{opacity:1;transform:translateY(5px) scale(1.2,.85) rotate(5deg)}80%{transform:translateY(-3px) scale(.9,1.15) rotate(-2deg)}100%{opacity:1;transform:translateY(0) scale(1,1) rotate(0)}}@keyframes breatheLetters{0%,100%{transform:scale(1,1) translateY(0)}25%{transform:scale(1.05,.97) translateY(2px)}50%{transform:scale(.97,1.06) translateY(-5px)}75%{transform:scale(1.03,.99) translateY(1px)}}.kpi-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;margin-bottom:14px}.kpi{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:16px;box-shadow:0 2px 4px rgba(15,23,42,.06)}.kpi-value{font-size:2rem;font-weight:900;color:#0f172a}.kpi-label{font-size:.88rem;color:#6b7280;font-weight:800;margin-top:4px}.bar-list{display:flex;flex-direction:column;gap:9px}.bar-row{display:grid;grid-template-columns:220px 1fr 60px;gap:10px;align-items:center}.bar-label{font-size:.9rem;font-weight:800;color:#374151;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bar-track{height:18px;background:#e5e7eb;border-radius:999px;overflow:hidden}.bar-fill{height:100%;background:#1d4ed8;border-radius:999px}.bar-count{text-align:right;font-weight:900;color:#111827}.settings-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(360px,1fr));gap:14px}.panel{padding:16px}.panel h2{font-size:1.15rem;margin-bottom:12px}.simple-list{display:flex;flex-direction:column;gap:8px;margin-top:10px}.simple-item{border:1px solid #e5e7eb;border-radius:10px;padding:10px;background:#fff;display:flex;justify-content:space-between;gap:10px;align-items:flex-start}.color-dot{display:inline-block;width:14px;height:14px;border-radius:50%;border:1px solid #d1d5db;vertical-align:middle;margin-right:6px}.photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px;margin-top:10px}.photo-card{border:1px solid #e5e7eb;border-radius:10px;overflow:hidden;background:#fff}.photo-card img{width:100%;height:120px;object-fit:cover;display:block;cursor:pointer}.photo-card .pc-foot{padding:8px;font-size:.78rem;color:#6b7280;display:flex;justify-content:space-between;gap:6px}.import-box{border:2px dashed #cbd5e1;border-radius:14px;padding:18px;background:#f8fafc;text-align:center;margin-bottom:14px}.preview-wrap{max-height:420px;overflow:auto;border:1px solid #e5e7eb;border-radius:12px;background:#fff}.lightbox{position:fixed;inset:0;background:rgba(0,0,0,.88);display:none;align-items:center;justify-content:center;z-index:200;padding:24px}.lightbox.show{display:flex}.lightbox img{max-width:100%;max-height:100%;border-radius:8px;box-shadow:0 20px 60px rgba(0,0,0,.5)}.lightbox-close{position:absolute;top:18px;right:22px;font-size:2rem;color:#fff;cursor:pointer;font-weight:900;line-height:1}@media(max-width:900px){.sidebar{display:none}.main{margin-left:0;padding:16px;width:100%}.modal-body{grid-template-columns:1fr}.settings-grid{grid-template-columns:1fr}.bar-row{grid-template-columns:1fr}.f-group{min-width:100%}.f-actions{width:100%;margin-left:0}}

/* Organisation du modal rapport social */
.modal-body-organized{
  display:flex!important;
  flex-direction:column!important;
  gap:14px!important;
  padding:16px!important;
}
.modal-section{
  border:1px solid #e5e7eb;
  background:#ffffff;
  border-radius:14px;
  padding:14px;
  box-shadow:0 1px 4px rgba(15,23,42,.05);
}
.modal-section-general{background:#f7f9fb;border-color:#d7e0e8;}
.modal-section-logement{background:#f6faf8;border-color:#d5e3dc;}
.modal-section-rapport{background:#fbfaf6;border-color:#e6dfd1;}
.modal-section-suivi{background:#f8f7fa;border-color:#dfdce5;}
.modal-section-photos{background:#f7f9fb;border-color:#dce3e9;}
.modal-section-title{
  font-size:.98rem;
  font-weight:900;
  color:#0f172a;
  margin-bottom:12px;
  padding-bottom:8px;
  border-bottom:1px solid #e5e7eb;
}
.modal-grid{display:grid;gap:12px;align-items:start;}
.modal-grid.one-col{grid-template-columns:1fr;}
.modal-grid.two-cols{grid-template-columns:repeat(2,minmax(0,1fr));}
.modal-grid.three-cols{grid-template-columns:repeat(3,minmax(0,1fr));}
.modal-grid.four-cols{grid-template-columns:repeat(4,minmax(0,1fr));}
.modal-grid .fg-full{grid-column:1/-1;}
.report-textarea textarea{
  color:#0b2f66!important;
  font-weight:650;
  line-height:1.55;
  background:#f8fbff!important;
  border-color:#bfdbfe!important;
  min-height:120px;
}
.report-textarea textarea:focus{
  border-color:#1d4ed8!important;
  box-shadow:0 0 0 3px rgba(29,78,216,.12)!important;
}
.report-textarea label{color:#0b2f66!important;}

.modal-identity-row{
  padding:0;
  margin:0;
}
.contentieux-value{
  min-height:41px;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid #d8dee6;
  background:#fff;
  color:#374151;
  display:flex;
  align-items:center;
  font-size:.95rem;
  font-weight:850;
}
.contentieux-value.is-empty{color:#6b7280;font-weight:700;background:#fafbfc;}
.contentieux-value.has-contentieux{background:#f8f6f3;border-color:#ded6cc;}
.contentieux-value.loading{background:#f8fafc;color:#64748b;}
.contentieux-vert{color:#2f6b47!important;border-color:#c8ddcf!important;background:#f4f8f5!important;}
.contentieux-orange{color:#b86218!important;border-color:#e5c6aa!important;background:#fbf6f1!important;}
.contentieux-bordeaux{color:#7a2638!important;border-color:#d9b7bf!important;background:#faf4f6!important;}
.fiche-row-contentieux{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;min-width:120px;gap:3px;}
.fiche-contentieux-label{font-size:.72rem;font-weight:900;text-transform:uppercase;letter-spacing:.02em;color:#64748b;}
.fiche-contentieux-amount{font-size:1rem;font-weight:950;white-space:nowrap;padding:5px 8px;border:1px solid transparent;border-radius:9px;}
.fiche-contentieux-empty{color:#94a3b8;font-weight:800;text-align:center;width:100%;}

@media(max-width:1100px){.modal-grid.four-cols{grid-template-columns:repeat(2,minmax(0,1fr));}.modal-grid.three-cols{grid-template-columns:repeat(3,minmax(0,1fr));}}
@media(max-width:700px){.modal-grid.two-cols,.modal-grid.three-cols,.modal-grid.four-cols{grid-template-columns:1fr;}}

/* Onglets Service social avec images */
.page-tabs-images{
  display:flex;
  gap:10px;
  align-items:stretch;
  border-bottom:2px solid #dbe4f0;
  margin-bottom:16px;
  flex-wrap:wrap;
}
.page-tabs-images .page-tab{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 16px 12px;
  min-height:62px;
  border-radius:14px 14px 0 0;
  border-bottom:4px solid transparent;
  text-decoration:none;
  font-size:1rem;
  font-weight:900;
  color:#334155;
  background:rgba(255,255,255,.45);
  transition:transform .18s, background .18s, color .18s, border-color .18s, box-shadow .18s;
}
.page-tabs-images .page-tab:hover{
  background:#ffffff;
  color:#1d4ed8;
  transform:translateY(-2px);
  box-shadow:0 8px 18px rgba(15,23,42,.08);
}
.page-tabs-images .page-tab.active{
  background:#ffffff;
  color:#1d4ed8;
  border-bottom-color:#1d4ed8;
  box-shadow:0 4px 12px rgba(15,23,42,.06);
}
.page-tab-icon{
  width:48px;
  height:48px;
  object-fit:contain;
  flex-shrink:0;
  display:block;
}
@media(max-width:900px){
  .page-tabs-images .page-tab{width:100%;justify-content:flex-start;}
  .page-tab-icon{width:42px;height:42px;}
}

/* Vue fiches locataires / logements */
.zone-subtitle{margin-top:4px;color:var(--text-muted);font-weight:700;font-size:.92rem;line-height:1.35}.fiches-zone{padding:18px}.fiches-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(330px,1fr));gap:14px}.fiche-card{background:#fff;border:1px solid #e5e7eb;border-radius:16px;padding:14px;box-shadow:0 2px 5px rgba(15,23,42,.06);cursor:pointer;transition:transform .16s,box-shadow .16s,border-color .16s}.fiche-card:hover{transform:translateY(-2px);box-shadow:0 12px 24px rgba(15,23,42,.12);border-color:rgba(29,78,216,.35)}.fiche-card-head{display:flex;align-items:flex-start;gap:12px;margin-bottom:12px}.fiche-avatar{width:48px;height:48px;border-radius:14px;background:linear-gradient(135deg,#1d4ed8,#0ea5e9);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:950;font-size:1.25rem;box-shadow:0 8px 14px rgba(29,78,216,.18);flex-shrink:0}.fiche-title-wrap{min-width:0;flex:1}.fiche-title-wrap h3{font-size:1.05rem;line-height:1.2;margin:0;color:#0f172a}.fiche-title-wrap p{font-size:.87rem;color:#64748b;margin:4px 0 0;line-height:1.35}.fiche-status{flex-shrink:0}.fiche-last{display:flex;gap:8px;align-items:flex-start;padding:10px;border-radius:12px;background:#f8fafc;border:1px solid #eef2f7;min-height:58px}.fiche-last strong{color:#0f172a}.fiche-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:12px 0}.fiche-stats div{background:#f9fafb;border:1px solid #eef2f7;border-radius:12px;padding:8px;text-align:center}.fiche-stats strong{display:block;font-size:1.2rem;color:#1d4ed8}.fiche-stats span{display:block;font-size:.72rem;color:#64748b;font-weight:900;text-transform:uppercase;letter-spacing:.02em}.fiche-types{display:flex;gap:6px;flex-wrap:wrap;min-height:30px;margin-bottom:12px}.fiche-actions{display:flex;gap:8px;flex-wrap:wrap}.fiche-actions .btn{flex:1;min-width:140px}.fiche-source{margin-top:10px;padding-top:10px;border-top:1px dashed #e5e7eb;font-size:.78rem;color:#64748b;font-weight:800}.empty-state{grid-column:1/-1;background:#fff;border:1px dashed #cbd5e1;border-radius:14px;padding:24px;text-align:center;color:#334155}.fiche-modal{width:min(1180px,100%)}.fiche-modal-body{padding:16px;display:flex;flex-direction:column;gap:14px}.fiche-detail-card{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;background:#f8fafc;border:1px solid #e5e7eb;border-radius:16px;padding:16px;flex-wrap:wrap}.fiche-detail-side{display:flex;flex-direction:column;align-items:flex-end;gap:12px;min-width:190px}.fiche-detail-contentieux{display:flex;flex-direction:column;align-items:flex-end;gap:3px;min-width:150px}.fiche-detail-contentieux .fiche-contentieux-empty{text-align:right}.fiche-detail-contentieux .fiche-contentieux-label{text-align:right}.fiche-detail-title{font-size:1.35rem;font-weight:950;color:#0f172a}.fiche-detail-subtitle{margin-top:4px;color:#475569;font-weight:750}.fiche-detail-badges{margin-top:10px;display:flex;gap:6px;flex-wrap:wrap}.fiche-history{display:flex;flex-direction:column;gap:12px}.history-item{display:grid;grid-template-columns:120px minmax(0,1fr);gap:12px;background:#fff;border:1px solid #e5e7eb;border-radius:16px;padding:14px;box-shadow:0 2px 5px rgba(15,23,42,.05)}.history-date{border-right:1px solid #e5e7eb;padding-right:12px;color:#0f172a}.history-date strong{display:block;font-size:.98rem}.history-date span{display:inline-block;margin-top:6px;color:#64748b;font-weight:900;font-size:.82rem}.history-body{min-width:0}.history-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;flex-wrap:wrap}.history-badges{display:flex;gap:6px;flex-wrap:wrap}.history-body h4{margin:8px 0 6px;font-size:1.02rem;color:#0f172a}.history-block{margin-top:8px;padding:10px 12px;border-radius:12px;background:#f8fafc;border:1px solid #eef2f7}.history-block strong{display:block;margin-bottom:4px;color:#0f172a}.history-block p{line-height:1.5;color:#111827;font-weight:600}.history-block-blue p{color:#0f2f5f}.history-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:10px}.color-dot{display:inline-block;width:10px;height:10px;border-radius:999px;margin-right:6px;vertical-align:middle;border:1px solid rgba(15,23,42,.1)}
@media(max-width:900px){.fiches-grid{grid-template-columns:1fr}.history-item{grid-template-columns:1fr}.history-date{border-right:none;border-bottom:1px solid #e5e7eb;padding-right:0;padding-bottom:8px}.fiche-stats{grid-template-columns:repeat(2,1fr)}}
@media print{body{background:#fff}.sidebar,.filters,.page-tabs,.user-pill,.toast,.lightbox,.fiche-actions,.history-actions,.modal-foot,#btnCloseFiche{display:none!important}.main{margin-left:0;width:100%;padding:0}.modal-backdrop.show{position:static;background:#fff;display:block;padding:0}.modal{box-shadow:none;border:none;max-height:none;width:100%;overflow:visible}.modal-scroll{overflow:visible}.modal-head{background:#fff}.fiche-detail-card,.history-item{break-inside:avoid;box-shadow:none}.fiches-zone{display:none}}

/* V4 – fiches compactes + association listing locataires */
.badge-warn{background:#fef3c7;color:#92400e;border-color:#fbbf24}.fiches-list{display:flex;flex-direction:column;gap:10px}.fiches-zone-compacte{padding:18px}.fiches-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin:12px 0}.summary-pill{background:#f8fafc;border:1px solid #e5e7eb;border-radius:12px;padding:10px 12px;display:flex;align-items:baseline;justify-content:space-between;gap:8px}.summary-pill strong{font-size:1.25rem;color:#1d4ed8}.summary-pill span{font-size:.82rem;color:#64748b;font-weight:900;text-transform:uppercase}.fiches-toolbar{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;margin:10px 0 12px}.fiches-toolbar-right{display:flex;align-items:center;gap:8px;color:#64748b;font-size:.86rem;font-weight:900}.fiches-toolbar-right select{padding:8px 10px;border:1px solid #e5e7eb;border-radius:10px;background:#fff;font-weight:800}.fiche-row{display:grid;grid-template-columns:54px 112px minmax(250px,1.35fr) minmax(240px,1.1fr) 140px 150px 130px;gap:12px;align-items:center;background:#fff;border:1px solid #e5e7eb;border-left:6px solid #cbd5e1;border-radius:14px;padding:12px 14px;box-shadow:0 2px 5px rgba(15,23,42,.05);cursor:pointer;transition:.15s}.fiche-row:hover{border-color:#bfdbfe;border-left-color:#1d4ed8;box-shadow:0 9px 20px rgba(15,23,42,.09);transform:translateY(-1px)}.fiche-row.linked{border-left-color:#16a34a}.fiche-row.unlinked{border-left-color:#d97706}.fiche-avatar-sm{width:42px;height:42px;border-radius:12px;background:linear-gradient(135deg,#1d4ed8,#0ea5e9);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:950;font-size:.92rem}.fiche-row-reference{font-size:1rem;font-weight:950;color:#0f172a;line-height:1.2;white-space:nowrap;display:flex;align-items:center;min-height:42px}.fiche-row-title{font-size:1rem;font-weight:950;color:#0f172a;display:flex;align-items:center;gap:6px;flex-wrap:wrap}.fiche-row-sub{margin-top:4px;color:#475569;font-weight:750;font-size:.88rem;line-height:1.35}.fiche-row-types{margin-top:7px;display:flex;gap:5px;flex-wrap:wrap}.fiche-row-last{font-size:.88rem;line-height:1.35}.fiche-row-last strong{color:#0f172a}.fiche-row-numbers{display:grid;grid-template-columns:1fr;gap:5px}.fiche-row-numbers span{background:#f8fafc;border:1px solid #eef2f7;border-radius:9px;padding:5px 8px;color:#64748b;font-size:.78rem;font-weight:900}.fiche-row-numbers strong{font-size:1rem;color:#1d4ed8}.fiche-row-actions{display:flex;justify-content:flex-end;gap:6px;flex-wrap:wrap}.fiche-row-actions .mini{min-width:66px}.fiches-pagination{display:flex;justify-content:center;gap:10px;margin-top:14px;align-items:center}.fiches-pagination .btn:disabled{opacity:.45;cursor:not-allowed}.locataire-ref-box{margin-top:10px;background:#eefdf3;border:1px solid #bbf7d0;border-radius:12px;padding:10px;color:#14532d;font-weight:650}.locataire-ref-box.warn{background:#fff7ed;border-color:#fed7aa;color:#92400e}.association-modal{width:min(880px,100%)}.assoc-current-box{background:#f8fafc;border:1px solid #e5e7eb;border-radius:12px;padding:12px}.assoc-search-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.assoc-search-row input{flex:1;min-width:240px;padding:10px 12px;border-radius:10px;border:1px solid #e5e7eb;outline:none}.assoc-search-row input:focus{border-color:#1d4ed8;box-shadow:0 0 0 3px rgba(29,78,216,.08)}.assoc-results{display:flex;flex-direction:column;gap:8px;margin-top:10px;max-height:320px;overflow:auto}.locataire-result{display:flex;justify-content:space-between;gap:12px;align-items:center;border:1px solid #e5e7eb;border-radius:12px;padding:10px;background:#fff;cursor:pointer}.locataire-result:hover{border-color:#1d4ed8;background:#f8fbff}.assoc-selected{margin-top:10px}.simple-item.selected{border-color:#16a34a;background:#f0fdf4}.import-box-locataires{border-color:#93c5fd;background:#f8fbff}.preview-wrap table{min-width:900px}.preview-wrap th,.preview-wrap td{font-size:.84rem}
@media(max-width:1250px){.fiche-row{grid-template-columns:48px 112px minmax(240px,1fr);}.fiche-row-last,.fiche-row-contentieux,.fiche-row-numbers,.fiche-row-actions{grid-column:3/-1}.fiche-row-actions{justify-content:flex-start}.fiche-row-numbers{grid-template-columns:repeat(3,minmax(90px,1fr))}.fiche-detail-side{align-items:flex-start}.fiche-detail-contentieux{align-items:flex-start}}
@media(max-width:760px){.fiche-row{grid-template-columns:110px minmax(0,1fr)}.fiche-row-id{display:none}.fiche-row-reference{grid-column:1}.fiche-row-main{grid-column:2}.fiche-row-last,.fiche-row-contentieux,.fiche-row-numbers,.fiche-row-actions{grid-column:1/-1}.fiche-row-numbers{grid-template-columns:1fr}.fiches-summary{grid-template-columns:1fr}.assoc-search-row{display:block}.assoc-search-row .btn{margin-top:8px;width:100%}.fiche-detail-side{width:100%;align-items:flex-start}.fiche-detail-contentieux{align-items:flex-start}}
@media print{.association-modal,.fiches-toolbar,.fiches-pagination,.fiche-row-actions,.locataire-ref-box.warn{display:none!important}}

/* v5 — recherche locataire dans le modal rapport + édition coordonnées */
.rapport-locataire-search-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.rapport-locataire-search-row input{flex:1;min-width:260px;padding:10px 12px;border-radius:10px;border:1px solid #e5e7eb;outline:none;background:#fff;font-size:.95rem}
.rapport-locataire-search-row input:focus{border-color:#1d4ed8;box-shadow:0 0 0 3px rgba(29,78,216,.08)}
.modal-locataire-results{max-height:250px}
.locataire-edit-modal{width:min(880px,100%)}
.locataire-ref-box .btn{margin-top:8px}

/* Statistiques sociales – graphiques en bâtonnets */
.stats-filters .f-group{min-width:160px}.stats-panel-large{margin-bottom:14px}.stats-secondary-grid{margin-top:14px}.baton-chart,.stacked-month-chart,.grouped-month-chart{width:100%;overflow-x:auto;padding:6px 0 2px}.baton-chart-inner{min-height:310px;display:flex;align-items:flex-end;gap:14px;padding:14px 6px 6px;border-bottom:1px solid #e5e7eb}.baton-item{min-width:86px;max-width:140px;flex:1;display:flex;flex-direction:column;align-items:center;gap:8px}.baton-value{font-weight:950;color:#0f172a;font-size:.9rem}.baton-wrap{height:230px;width:44px;border-radius:14px 14px 8px 8px;background:#eef2f7;border:1px solid #e5e7eb;display:flex;align-items:flex-end;overflow:hidden;box-shadow:inset 0 1px 2px rgba(15,23,42,.08)}.baton-fill{width:100%;border-radius:12px 12px 6px 6px;min-height:8px;box-shadow:inset 0 8px 14px rgba(255,255,255,.18)}.baton-label{font-size:.78rem;font-weight:900;color:#334155;text-align:center;line-height:1.25;max-width:135px;word-break:break-word}.stacked-chart-inner,.compare-chart-inner{min-height:310px;display:flex;align-items:flex-end;gap:16px;padding:16px 8px 8px;border-bottom:1px solid #e5e7eb;min-width:920px}.stacked-month,.compare-month{flex:1;min-width:62px;display:flex;flex-direction:column;align-items:center;gap:7px}.stacked-total{height:18px;font-weight:950;font-size:.82rem;color:#0f172a}.stacked-wrap{height:230px;width:42px;background:#eef2f7;border:1px solid #e5e7eb;border-radius:14px 14px 8px 8px;display:flex;align-items:flex-end;overflow:hidden;box-shadow:inset 0 1px 2px rgba(15,23,42,.08)}.stacked-bar{width:100%;display:flex;flex-direction:column-reverse;border-radius:12px 12px 6px 6px;overflow:hidden}.stacked-segment{width:100%;min-height:3px;border-top:1px solid rgba(255,255,255,.25)}.stacked-label,.compare-label{font-size:.8rem;font-weight:950;color:#475569;text-align:center}.chart-legend{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.legend-pill{display:inline-flex;align-items:center;gap:6px;border:1px solid #e5e7eb;background:#f8fafc;border-radius:999px;padding:5px 9px;font-size:.82rem;font-weight:900;color:#334155}.legend-dot{width:12px;height:12px;border-radius:999px;display:inline-block;border:1px solid rgba(15,23,42,.12);flex-shrink:0}.compare-bars{height:230px;display:flex;align-items:flex-end;gap:5px;padding:0 4px}.compare-bar{width:18px;min-height:0;border-radius:8px 8px 3px 3px;display:flex;align-items:flex-start;justify-content:center;box-shadow:inset 0 7px 12px rgba(255,255,255,.18)}.compare-bar span{transform:translateY(-18px);font-size:.68rem;font-weight:950;color:#0f172a;white-space:nowrap}.year-legend{justify-content:center}.year-total-list{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}.year-total-card{display:flex;align-items:center;gap:8px;border:1px solid #e5e7eb;background:#fff;border-radius:12px;padding:9px 12px;box-shadow:0 1px 2px rgba(15,23,42,.05);font-weight:850;color:#334155}.year-total-card strong{font-size:1rem;color:#0f172a}.year-total-card span:last-child{color:#64748b}.bar-fill{background:#1d4ed8}@media(max-width:900px){.baton-chart-inner{min-width:720px}.stats-filters .f-group{min-width:100%}.compare-chart-inner,.stacked-chart-inner{min-width:760px}.baton-item{min-width:76px}.baton-wrap,.stacked-wrap,.compare-bars{height:200px}}
@media print{.filters,.btn,.sidebar,.user-pill,.page-tabs{display:none!important}.main{margin-left:0;width:100%;padding:10px}.panel,.kpi{box-shadow:none}.baton-chart,.stacked-month-chart,.grouped-month-chart{overflow:visible}.baton-chart-inner,.stacked-chart-inner,.compare-chart-inner{min-width:0;page-break-inside:avoid}}

/* Statistiques compactes v10 : un seul diagramme de synthèse */
.stats-filters-compact .f-group{min-width:145px;flex:0 1 190px}.stats-filters-compact .f-actions{margin-left:auto}.stats-compact-panel{padding:16px;margin-top:12px}.stats-compact-head{margin-bottom:10px}.stats-mini-kpis{display:grid;grid-template-columns:repeat(5,minmax(120px,1fr));gap:8px;margin:8px 0 12px}.stats-mini-kpi{border:1px solid #e5e7eb;background:#f8fafc;border-radius:12px;padding:8px 10px;display:flex;align-items:baseline;justify-content:space-between;gap:8px}.stats-mini-kpi strong{font-size:1.25rem;color:#0f172a;font-weight:950}.stats-mini-kpi span{font-size:.78rem;text-transform:uppercase;letter-spacing:.02em;color:#64748b;font-weight:950;text-align:right}.stats-unified-chart{width:100%;overflow-x:auto;border:1px solid #e5e7eb;border-radius:14px;background:linear-gradient(#fff,#fbfdff);padding:8px 10px 4px}.stats-grouped-inner{height:300px;min-width:760px;display:flex;align-items:flex-end;gap:14px;padding:10px 6px 8px;border-bottom:1px solid #e5e7eb}.stats-grouped-block{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:6px;flex:0 0 auto}.stats-unified-total{height:18px;font-size:.82rem;font-weight:950;color:#0f172a}.stats-grouped-wrap{height:220px;width:100%;display:flex;align-items:flex-end;justify-content:center;gap:4px;padding:0 6px 0;border-bottom:1px solid #cbd5e1;background:repeating-linear-gradient(to top,#f8fafc 0,#f8fafc 43px,#e2e8f0 44px);border-radius:10px 10px 4px 4px}.stats-type-slot{height:100%;width:16px;display:flex;align-items:flex-end;justify-content:center}.stats-type-bar{width:14px;min-height:0;border-radius:7px 7px 0 0;box-shadow:inset 0 8px 14px rgba(255,255,255,.15),0 1px 2px rgba(15,23,42,.16);border:1px solid rgba(15,23,42,.08)}.stats-unified-label{font-size:.82rem;font-weight:950;color:#475569;text-align:center;white-space:nowrap}.stats-unified-legend{margin-top:10px;max-height:86px;overflow:auto;padding-right:4px}.stats-details-compact{margin-top:12px;border:1px solid #e5e7eb;border-radius:12px;background:#f8fafc;padding:0}.stats-details-compact summary{cursor:pointer;font-weight:950;color:#334155;padding:10px 12px;list-style:none}.stats-details-compact summary::-webkit-details-marker{display:none}.stats-details-compact summary:before{content:'▸';display:inline-block;margin-right:8px;transition:transform .15s}.stats-details-compact[open] summary:before{transform:rotate(90deg)}.stats-compact-details-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;border-top:1px solid #e5e7eb;padding:12px}.stats-compact-details-grid h3{font-size:1rem;margin:0 0 8px;color:#0f172a}.bar-list.compact .bar-row{grid-template-columns:170px 1fr 48px;gap:8px}.bar-list.compact .bar-label{font-size:.82rem}.bar-list.compact .bar-track{height:13px}.bar-list.compact .bar-count{font-size:.82rem}.chart-legend{display:flex;gap:8px;flex-wrap:wrap}.legend-pill{display:inline-flex;align-items:center;gap:6px;border:1px solid #e5e7eb;background:#f8fafc;border-radius:999px;padding:5px 9px;font-size:.82rem;font-weight:900;color:#334155}.legend-dot{width:12px;height:12px;border-radius:999px;display:inline-block;border:1px solid rgba(15,23,42,.12);flex-shrink:0}@media(max-width:1100px){.stats-mini-kpis{grid-template-columns:repeat(3,minmax(120px,1fr))}.stats-filters-compact .f-group{flex:1 1 220px}}@media(max-width:800px){.stats-mini-kpis{grid-template-columns:repeat(2,minmax(120px,1fr))}.stats-compact-details-grid{grid-template-columns:1fr}.stats-grouped-inner{min-width:680px;height:280px}.stats-grouped-wrap{height:200px}.stats-filters-compact .f-group{min-width:100%;flex:1 1 100%}}@media print{.filters,.btn,.sidebar,.user-pill,.page-tabs,.stats-details-compact{display:none!important}.main{margin-left:0;width:100%;padding:10px}.panel{box-shadow:none}.stats-unified-chart{overflow:visible}.stats-grouped-inner{min-width:0;page-break-inside:avoid}}


/* v13 – statistiques en bâtonnets classiques plus hauts, type par type */
.stats-unified-chart{
  width:100%;
  overflow:hidden;
  border:1px solid #e5e7eb;
  border-radius:14px;
  background:#fff;
  padding:12px;
}
.stats-baton-chart{
  display:grid;
  grid-template-columns:58px minmax(0,1fr);
  gap:10px;
  align-items:end;
}
.stats-baton-yaxis{
  height:calc(var(--stats-plot-h, 330px) + 54px);
  padding:0 0 54px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  align-items:flex-end;
  color:#475569;
  font-size:.82rem;
  font-weight:900;
  line-height:1;
}
.stats-baton-scroll{
  overflow-x:auto;
  overflow-y:hidden;
  padding-bottom:4px;
}
.stats-baton-plot{
  position:relative;
  min-height:calc(var(--stats-plot-h, 330px) + 54px);
  display:flex;
  align-items:flex-end;
  gap:34px;
  padding:0 20px 54px;
  border-left:2px solid #334155;
  border-bottom:2px solid #334155;
  background:
    repeating-linear-gradient(to top,#fff 0,#fff 65px,#e2e8f0 66px),
    linear-gradient(#fff,#fff);
  border-radius:10px 10px 4px 4px;
}
.stats-baton-group{
  height:var(--stats-plot-h, 330px);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-end;
  flex:0 0 auto;
  position:relative;
}
.stats-baton-bars{
  height:var(--stats-plot-h, 330px);
  display:flex;
  align-items:flex-end;
  justify-content:center;
  gap:7px;
  width:100%;
  padding:0 8px;
}
.stats-baton-slot{
  height:var(--stats-plot-h, 330px);
  min-width:18px;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  flex:1 1 24px;
  position:relative;
}
.stats-baton-value{
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  z-index:3;
  font-size:.78rem;
  font-weight:950;
  color:#0f172a;
  line-height:1;
  white-space:nowrap;
  text-shadow:0 1px 0 #fff, 0 -1px 0 #fff, 1px 0 0 #fff, -1px 0 0 #fff;
}
.stats-baton-bar{
  width:100%;
  max-width:28px;
  min-width:14px;
  min-height:0;
  border-radius:4px 4px 0 0;
  border:1px solid rgba(15,23,42,.18);
  box-shadow:inset 0 8px 14px rgba(255,255,255,.18),0 1px 2px rgba(15,23,42,.18);
  transition:filter .12s ease, transform .12s ease;
}
.stats-baton-bar.has-value{min-height:8px}
.stats-baton-slot:hover .stats-baton-bar{filter:brightness(.96);transform:translateY(-1px)}
.stats-baton-label{
  position:absolute;
  bottom:-29px;
  left:50%;
  transform:translateX(-50%);
  font-size:.86rem;
  font-weight:950;
  color:#0f172a;
  text-align:center;
  white-space:nowrap;
}
.stats-baton-group-total{
  position:absolute;
  bottom:-48px;
  left:50%;
  transform:translateX(-50%);
  font-size:.72rem;
  font-weight:900;
  color:#64748b;
  white-space:nowrap;
}
.stats-unified-legend{
  margin-top:12px;
  max-height:92px;
  overflow:auto;
  padding-right:4px;
}
.stats-compact-panel{padding:14px;margin-top:12px}
.stats-mini-kpis{margin-bottom:10px}
@media(max-width:800px){
  .stats-baton-chart{grid-template-columns:44px minmax(0,1fr)}
  .stats-baton-yaxis{font-size:.72rem}
  .stats-baton-plot{gap:22px;padding-left:14px;padding-right:14px}
  .stats-baton-bars{gap:5px}
  .stats-baton-value{font-size:.7rem}
}
@media print{
  .stats-baton-scroll{overflow:visible}
  .stats-baton-plot{min-width:0!important;gap:18px}
  .stats-baton-slot{min-width:10px;flex-basis:14px}
  .stats-baton-bar{min-width:8px;max-width:16px}
}

/* v14 – statistiques demandées : axe horizontal par type, axe vertical par nombre */
.stats-type-chart{
  display:grid;
  grid-template-columns:58px minmax(0,1fr);
  gap:10px;
  align-items:end;
}
.stats-type-yaxis{
  height:calc(var(--stats-plot-h, 360px) + 82px);
  padding:0 0 82px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  align-items:flex-end;
  color:#475569;
  font-size:.82rem;
  font-weight:950;
  line-height:1;
}
.stats-type-scroll{
  overflow-x:auto;
  overflow-y:hidden;
  padding-bottom:4px;
}
.stats-type-plot{
  position:relative;
  min-height:calc(var(--stats-plot-h, 360px) + 82px);
  display:flex;
  align-items:flex-end;
  gap:18px;
  padding:0 24px 82px;
  border-left:2px solid #334155;
  border-bottom:2px solid #334155;
  background:
    repeating-linear-gradient(to top,#fff 0,#fff 71px,#e2e8f0 72px),
    linear-gradient(#fff,#fff);
  border-radius:10px 10px 4px 4px;
}
.stats-type-group{
  height:var(--stats-plot-h, 360px);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-end;
  flex:0 0 auto;
  position:relative;
}
.stats-type-bars{
  height:var(--stats-plot-h, 360px);
  display:flex;
  align-items:flex-end;
  justify-content:center;
  width:100%;
  padding:0 10px;
}
.stats-type-bar-slot{
  height:var(--stats-plot-h, 360px);
  display:flex;
  align-items:flex-end;
  justify-content:center;
  position:relative;
  flex:0 0 auto;
}
.stats-type-bar{
  width:100%;
  min-height:0;
  border-radius:5px 5px 0 0;
  border:1px solid rgba(15,23,42,.18);
  box-shadow:inset 0 8px 14px rgba(255,255,255,.18),0 1px 2px rgba(15,23,42,.18);
  transition:filter .12s ease, transform .12s ease;
}
.stats-type-bar.has-value{min-height:10px}
.stats-type-bar-slot:hover .stats-type-bar{filter:brightness(.96);transform:translateY(-1px)}
.stats-type-value{
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  z-index:3;
  font-size:.8rem;
  font-weight:950;
  color:#0f172a;
  line-height:1;
  white-space:nowrap;
  text-shadow:0 1px 0 #fff,0 -1px 0 #fff,1px 0 0 #fff,-1px 0 0 #fff;
}
.stats-type-year-label{
  position:absolute;
  bottom:-20px;
  left:50%;
  transform:translateX(-50%) rotate(-45deg);
  transform-origin:center;
  font-size:.66rem;
  font-weight:950;
  color:#64748b;
  white-space:nowrap;
}
.stats-type-label{
  position:absolute;
  bottom:-68px;
  left:50%;
  transform:translateX(-50%);
  width:100%;
  max-width:150px;
  min-height:36px;
  display:flex;
  align-items:flex-start;
  justify-content:center;
  text-align:center;
  color:#0f172a;
  font-size:.75rem;
  font-weight:950;
  line-height:1.1;
  overflow:hidden;
}
.legend-pill.year-legend{
  background:#eef2ff;
  color:#1e3a8a;
  border-color:#c7d2fe;
}
@media(max-width:800px){
  .stats-type-chart{grid-template-columns:44px minmax(0,1fr)}
  .stats-type-yaxis{font-size:.72rem}
  .stats-type-plot{padding-left:14px;padding-right:14px;gap:12px}
  .stats-type-value{font-size:.7rem}
  .stats-type-label{font-size:.68rem}
}
@media print{
  .stats-type-scroll{overflow:visible}
  .stats-type-plot{min-width:0!important;gap:10px;padding-left:10px;padding-right:10px}
  .stats-type-bar-slot{width:14px!important}
  .stats-type-label{font-size:.62rem}
}

/* v15 — statistiques compactes exportables Word A4 */
.stats-unified-chart{
  width:100%;
  overflow:visible;
  border:1px solid #e5e7eb;
  border-radius:14px;
  background:#fff;
  padding:10px;
}
.stats-svg-chart{
  display:block;
  width:100%;
  height:auto;
  max-height:560px;
  background:#fff;
}
.stats-unified-legend{
  margin-top:8px;
  max-height:78px;
  overflow:auto;
}
@media print{
  #btnSaveStatsImage{display:none!important}
  .stats-unified-chart{padding:4px;border:none;overflow:visible}
  .stats-svg-chart{max-height:none;width:100%}
  .stats-unified-legend{max-height:none;overflow:visible}
}

/* Impression fiche locataire / rapports sociaux : uniquement à l'impression */
.ss-print-date{display:none;}
@media print{
  .intro,
  .ss-print-hide,
  .theme-switch,
  .theme-switcher,
  .theme-selector,
  .theme-panel,
  .theme-pill,
  .theme-controls,
  .theme-options,
  .theme-picker,
  .theme-toggle,
  [id*="theme" i],
  [class*="theme" i]{
    display:none!important;
  }
  .ss-print-date{
    display:block!important;
    margin:0 0 12px 0;
    padding:7px 10px;
    border:1px solid #dbe4f0;
    border-radius:8px;
    background:#f8fafc;
    color:#334155;
    font-size:.9rem;
    font-weight:850;
    text-align:right;
  }
  .main-header{
    margin-bottom:6px!important;
    padding-bottom:8px!important;
    border-bottom:1px solid #dbe4f0!important;
  }
  .main-title{
    font-size:1.75rem!important;
    line-height:1.15!important;
  }
}

/* Intervenants : initiales et couleur stable par personne */
.fiche-avatar-sm.agent-pm{background:linear-gradient(135deg,#15803d,#22c55e)}
.fiche-avatar-sm.agent-pl{background:linear-gradient(135deg,#1d4ed8,#38bdf8)}
.fiche-avatar-sm.agent-rc{background:linear-gradient(135deg,#c2410c,#f59e0b)}
.fiche-avatar-sm.agent-cd{background:linear-gradient(135deg,#6d28d9,#a78bfa)}
.fiche-avatar-sm.agent-gc{background:linear-gradient(135deg,#0f766e,#2dd4bf)}
.fiche-avatar-sm.agent-visiteur{background:linear-gradient(135deg,#475569,#94a3b8)}
.fiche-avatar-sm.agent-auto-0{background:linear-gradient(135deg,#0369a1,#22d3ee)}
.fiche-avatar-sm.agent-auto-1{background:linear-gradient(135deg,#166534,#4ade80)}
.fiche-avatar-sm.agent-auto-2{background:linear-gradient(135deg,#9a3412,#fb923c)}
.fiche-avatar-sm.agent-auto-3{background:linear-gradient(135deg,#6b21a8,#c084fc)}
.fiche-avatar-sm.agent-auto-4{background:linear-gradient(135deg,#0f766e,#5eead4)}
.fiche-avatar-sm.agent-auto-5{background:linear-gradient(135deg,#9f1239,#fb7185)}
.fiche-row-actions .create-report-btn{min-width:112px;padding-left:12px;padding-right:12px}


/* Service social — actions principales et état SMTP */
.btn.btn-success,
.create-report-btn{
  background:#16a34a!important;
  border-color:#15803d!important;
  color:#fff!important;
}
.btn.btn-success:hover,
.create-report-btn:hover{
  background:#15803d!important;
}
.mail-smtp-status.ok{
  background:#ecfdf5;
  border-color:#bbf7d0;
  color:#166534;
}
.mail-smtp-status.error{
  background:#fef2f2;
  border-color:#fecaca;
  color:#991b1b;
}

.locataire-phone{
  color:#173f73!important;
  font-weight:950!important;
  white-space:nowrap;
}
.fiche-row-sub,.fiche-detail-subtitle{
  display:flex;
  align-items:center;
  gap:7px;
  flex-wrap:wrap;
}
.fiche-phone-sep{
  color:#94a3b8;
  font-weight:800;
}
.modal-contentieux-row{
  max-width:420px;
}

.photo-drop-zone{
  border:2px dashed #c8d2dc;
  border-radius:12px;
  background:#fbfcfd;
  padding:20px 18px;
  text-align:center;
  cursor:pointer;
  transition:border-color .18s ease,background .18s ease,box-shadow .18s ease,transform .18s ease;
  outline:none;
}
.photo-drop-zone:hover,.photo-drop-zone:focus-visible{
  border-color:#7c8fa6;
  background:#f5f8fb;
  box-shadow:0 0 0 3px rgba(51,65,85,.07);
}
.photo-drop-zone.drag-over{
  border-color:#355b84;
  background:#edf3f8;
  box-shadow:0 0 0 4px rgba(53,91,132,.10);
  transform:translateY(-1px);
}
.photo-drop-title{font-size:.95rem;font-weight:900;color:#334155;}
.photo-drop-subtitle{font-size:.82rem;font-weight:700;color:#64748b;margin-top:4px;}
.photo-upload-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:10px;}

/* Statistiques sociales : vue harmonisée, spécifique à statistiques.html */
body[data-page="stats"] .stats-presentation-options{display:flex;align-items:end;gap:14px;flex-wrap:wrap;margin:12px 0 14px;border:1px solid #e2e8f0;border-radius:12px;background:#f8fafc;padding:12px 14px}
body[data-page="stats"] .stats-option-group{display:flex;flex-direction:column;gap:5px;min-width:180px}
body[data-page="stats"] .stats-option-group label{font-weight:800;font-size:.84rem;color:#475569}
body[data-page="stats"] .stats-option-group select{min-height:39px;border:1px solid #cbd5e1;border-radius:8px;padding:8px 10px;color:#0f172a;background:white;font-weight:700}
body[data-page="stats"] .stats-method-note{flex:1;font-size:.8rem;line-height:1.5;color:#64748b;font-weight:650;padding-bottom:9px}
body[data-page="stats"] .stats-unified-chart{overflow-x:auto;padding:8px;border:1px solid #e2e8f0;border-radius:12px;background:#fff}
body[data-page="stats"] .stats-horizontal-svg{width:100%;max-height:none;min-width:850px;height:auto}
body[data-page="stats"] .stats-unified-legend{max-height:none;overflow:visible;margin:7px 0 0;color:#64748b;font-size:.83rem;font-weight:700}
body[data-page="stats"] .stats-consistency{font-size:.84rem;color:#475569;margin:8px 0 15px;padding:8px 10px;border-radius:9px;background:#f8fafc;border:1px solid #e2e8f0}
body[data-page="stats"] .stats-consistency-warning{color:#92400e;background:#fffbeb;border-color:#fde68a}
body[data-page="stats"] .stats-table-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:18px 0 10px;flex-wrap:wrap}
body[data-page="stats"] .stats-table-heading h2{font-size:1.12rem;margin:0;font-weight:900}
body[data-page="stats"] .stats-table-scroll{overflow:auto;border:1px solid #e2e8f0;border-radius:12px}
body[data-page="stats"] .stats-totals-table{width:100%;min-width:590px;border-collapse:collapse}
body[data-page="stats"] .stats-totals-table th,body[data-page="stats"] .stats-totals-table td{padding:10px 12px;border-bottom:1px solid #e5e7eb;font-size:.85rem;vertical-align:middle;line-height:1.4}
body[data-page="stats"] .stats-totals-table th{background:#f1f5f9;text-align:left;font-size:.8rem;font-weight:900}
body[data-page="stats"] .stats-totals-table .stats-index{width:48px;text-align:center;color:#64748b}
body[data-page="stats"] .stats-totals-table .stats-name{min-width:220px}
body[data-page="stats"] .stats-totals-table .stats-num{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums;min-width:76px}
body[data-page="stats"] .stats-totals-table .stats-highlight{font-weight:900;color:#1e40af}
body[data-page="stats"] .stats-totals-table .stats-total-row td{background:#eaf1fb;font-weight:900;border-top:2px solid #cbd5e1}
body[data-page="stats"] .stats-color-dot{display:inline-block;width:10px;height:10px;border-radius:3px;vertical-align:middle;margin-right:9px}
body[data-page="stats"] .stats-origins{margin:5px 0 0 19px;font-size:.8rem;color:#64748b;font-weight:600}
body[data-page="stats"] .stats-origins summary{cursor:pointer;color:#2563eb;font-weight:800}
body[data-page="stats"] .stats-origins[open]{margin-top:9px;padding:8px 10px;border:1px solid #dbeafe;border-radius:8px;background:#f8fbff}
body[data-page="stats"] .stats-origin-row{display:flex;justify-content:space-between;gap:16px;padding:4px 0;border-bottom:1px solid #e2e8f0}
body[data-page="stats"] .stats-origin-row:last-child{border-bottom:none}
body[data-page="stats"] .stats-origin-row strong{font-variant-numeric:tabular-nums}
@media(max-width:900px){body[data-page="stats"] .stats-horizontal-svg{min-width:850px}}
@media print{
  body[data-page="stats"] .stats-presentation-options,body[data-page="stats"] #btnExportStatsCsv,body[data-page="stats"] .stats-consistency{display:none!important}
  body[data-page="stats"] .stats-horizontal-svg{min-width:0;max-height:none;width:100%}
  body[data-page="stats"] .stats-unified-chart{border:none;overflow:visible;padding:0}
  body[data-page="stats"] .stats-totals-table{min-width:0}
  body[data-page="stats"] .stats-totals-table th,body[data-page="stats"] .stats-totals-table td{padding:5px 7px;font-size:.75rem}
  body[data-page="stats"] .stats-totals-table thead{display:table-header-group}
  body[data-page="stats"] .stats-totals-table tr{break-inside:avoid}
  body[data-page="stats"] .stats-origins{display:none}
  body[data-page="stats"] .stats-table-heading{break-after:avoid}
  body[data-page="stats"] .stats-mini-kpis{break-inside:avoid}
}


/* Statistiques HABYS V2 : présentation épurée et lisible */
body[data-page="stats"] .stats-compact-panel{padding:22px 22px 25px;margin-top:13px}
body[data-page="stats"] .stats-mini-kpis{grid-template-columns:repeat(5,minmax(130px,1fr));gap:12px;margin:16px 0 20px}
body[data-page="stats"] .stats-mini-kpi{background:#fff;border:1px solid #dbe4ef;box-shadow:0 2px 5px rgba(15,23,42,.035);border-radius:12px;display:flex;flex-direction:column-reverse;align-items:flex-start;justify-content:center;padding:14px 16px;min-height:82px;gap:8px}
body[data-page="stats"] .stats-mini-kpi span{font-size:.78rem;letter-spacing:.03em;color:#64748b;text-align:left}
body[data-page="stats"] .stats-mini-kpi strong{font-size:1.85rem;font-weight:900;line-height:1;color:#172c50}
body[data-page="stats"] .stats-mini-kpi:first-child{border-top:3px solid #1d4ed8}
body[data-page="stats"] .stats-mini-kpi:nth-child(2){border-top:3px solid #d97706}
body[data-page="stats"] .stats-mini-kpi:nth-child(3){border-top:3px solid #dc2626}
body[data-page="stats"] .stats-mini-kpi:nth-child(4){border-top:3px solid #16a34a}
body[data-page="stats"] .stats-mini-kpi:nth-child(5){border-top:3px solid #0891b2}
body[data-page="stats"] .stats-unified-chart{padding:14px;overflow-x:auto;border:1px solid #dde5ee;border-radius:12px;background:#fff}
body[data-page="stats"] .stats-horizontal-svg{min-width:760px;width:100%;height:auto;max-height:none}
body[data-page="stats"] .stats-table-heading{margin-top:24px}
body[data-page="stats"] .stats-totals-table{min-width:760px}
body[data-page="stats"] .stats-totals-table tbody tr:hover td{background:#f1f6ff}
body[data-page="stats"] .stats-totals-table .stats-total-row td{background:#eaf1fb}
body[data-page="stats"] .stats-compact-head .zone-title{font-size:1.2rem}
body[data-page="stats"] .stats-compact-head .zone-subtitle{font-weight:650;font-size:.85rem}
body[data-page="stats"] .stats-details-compact{margin-top:18px}
@media(max-width:1100px){body[data-page="stats"] .stats-mini-kpis{grid-template-columns:repeat(3,minmax(130px,1fr))}}
@media(max-width:800px){body[data-page="stats"] .stats-mini-kpis{grid-template-columns:repeat(2,minmax(120px,1fr))}body[data-page="stats"] .stats-compact-panel{padding:14px}body[data-page="stats"] .stats-unified-chart{padding:8px}}
@media print{body[data-page="stats"] .stats-mini-kpi{box-shadow:none;min-height:56px;padding:8px}body[data-page="stats"] .stats-horizontal-svg{min-width:0!important;width:100%}body[data-page="stats"] .stats-unified-chart{overflow:visible;border:none}body[data-page="stats"] .stats-totals-table{min-width:0!important}}


/* Statistiques HABYS V3 : impression et capture simplifiées */
body[data-page="stats"] .stats-compact-panel{padding:18px 20px 22px}
body[data-page="stats"] .stats-unified-chart{padding:12px 14px;overflow-x:auto}
body[data-page="stats"] .stats-horizontal-svg{display:block;min-width:960px;width:100%;height:auto}
body[data-page="stats"] .stats-breakdown-table{margin-top:0}
body[data-page="stats"] .stats-table-heading{margin-top:20px}
body[data-page="stats"] .stats-totals-table{min-width:720px}
body[data-page="stats"] .stats-mini-kpis{margin:14px 0 16px}
@media (max-width: 1000px){body[data-page="stats"] .stats-horizontal-svg{min-width:900px}}

@media print{
  html,body{background:#fff!important}
  body[data-page="stats"] .sidebar,
  body[data-page="stats"] .main-header,
  body[data-page="stats"] .intro,
  body[data-page="stats"] .page-tabs,
  body[data-page="stats"] .filters,
  body[data-page="stats"] .f-actions,
  body[data-page="stats"] .user-pill,
  body[data-page="stats"] .toast,
  body[data-page="stats"] .lightbox,
  body[data-page="stats"] #btnExportStatsCsv,
  body[data-page="stats"] .stats-details-compact{display:none!important}
  body[data-page="stats"] .main{margin:0!important;padding:0!important;width:100%!important;max-width:none!important}
  body[data-page="stats"] .panel,
  body[data-page="stats"] .stats-compact-panel{border:none!important;box-shadow:none!important;padding:0!important;margin:0!important}
  body[data-page="stats"] .zone-header{border-bottom:none!important;padding-bottom:8px!important;margin-bottom:10px!important}
  body[data-page="stats"] .stats-unified-chart{border:none!important;padding:0!important;overflow:visible!important}
  body[data-page="stats"] .stats-horizontal-svg{min-width:0!important;width:100%!important;max-width:100%!important}
  body[data-page="stats"] .stats-totals-table{min-width:0!important}
  body[data-page="stats"] .stats-totals-table th, body[data-page="stats"] .stats-totals-table td{font-size:.72rem!important;padding:5px 7px!important}
  body[data-page="stats"] .stats-origins{display:none!important}
  body[data-page="stats"] .stats-consistency{display:none!important}
}


/* Statistiques HABYS V4 — répartitions compactes à l'écran */
body[data-page="stats"] .stats-compact-panel{padding:15px 17px 20px}
body[data-page="stats"] .stats-unified-chart{border:1px solid #dfe7f0;padding:8px 11px;overflow-x:auto}
body[data-page="stats"] .stats-horizontal-svg{width:100%;max-width:1100px;min-width:760px;height:auto;margin:0 auto}
body[data-page="stats"] .stats-mini-kpis{gap:9px;margin:10px 0 12px}
body[data-page="stats"] .stats-mini-kpi{min-height:64px;padding:9px 12px;gap:5px}
body[data-page="stats"] .stats-mini-kpi strong{font-size:1.48rem}
body[data-page="stats"] .stats-table-heading{margin-top:16px}
