/* Espace Mairie — Layout */
.em-wrap{display:flex;min-height:100vh;background:#F8F7F5;font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif}

/* Sidebar */
.em-sidebar{width:260px;background:linear-gradient(180deg,#003366 0%,#002244 100%);display:flex;flex-direction:column;position:fixed;top:0;left:0;bottom:0;z-index:100}
.em-sidebar-brand{padding:20px 18px;border-bottom:1px solid rgba(255,255,255,.08);display:flex;align-items:center;gap:12px}
.em-brand-icon{width:36px;height:36px;background:#e27d60;color:white;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:800;flex-shrink:0}
.em-brand-name{display:block;color:white;font-size:14px;font-weight:700}
.em-brand-sub{display:block;color:rgba(255,255,255,.4);font-size:11px}
.em-nav{flex:1;padding:12px 10px;overflow-y:auto}
.em-nav-item{display:flex;align-items:center;gap:10px;padding:10px 14px;border-radius:8px;color:rgba(255,255,255,.6);font-size:13px;font-weight:500;text-decoration:none;transition:all .15s;margin-bottom:2px}
.em-nav-item:hover{background:rgba(255,255,255,.06);color:rgba(255,255,255,.9);text-decoration:none}
.em-nav-active{background:rgba(226,125,96,.15) !important;color:#e27d60 !important;font-weight:700}
.em-nav-item svg{flex-shrink:0;opacity:.7}
.em-nav-active svg{opacity:1}
.em-sidebar-footer{padding:14px 18px;border-top:1px solid rgba(255,255,255,.08);display:flex;align-items:center;justify-content:space-between;gap:8px}
.em-user{display:flex;align-items:center;gap:10px;min-width:0}
.em-user-avatar{width:32px;height:32px;background:#e27d60;color:white;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;flex-shrink:0}
.em-user-name{display:block;color:rgba(255,255,255,.85);font-size:12px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.em-user-role{display:block;color:rgba(255,255,255,.35);font-size:10px}
.em-logout{color:rgba(255,255,255,.4);transition:color .15s}
.em-logout:hover{color:#e27d60}

/* Content */
.em-content{margin-left:260px;flex:1;padding:28px 32px;min-width:0}
.em-page-header{margin-bottom:24px}
.em-page-header h1{font-size:22px;font-weight:800;color:#003366;margin:0 0 4px}
.em-page-header p{color:#566573;font-size:13px;margin:0}

/* Stats grid */
.em-stats-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px;margin-bottom:24px}
.em-stat{background:white;border:1px solid #e8e5e2;border-radius:12px;padding:18px;display:flex;align-items:flex-start;gap:14px}
.em-stat-icon{width:40px;height:40px;background:#f8f7f5;border-radius:10px;display:flex;align-items:center;justify-content:center;color:#566573;flex-shrink:0}
.em-stat-terra .em-stat-icon{background:rgba(226,125,96,.1);color:#e27d60}
.em-stat-blue .em-stat-icon{background:rgba(0,51,102,.08);color:#003366}
.em-stat-green .em-stat-icon{background:rgba(46,125,50,.08);color:#2e7d32}
.em-stat-num{font-size:26px;font-weight:800;color:#003366;line-height:1}
.em-stat-label{font-size:12px;color:#888;margin-top:2px}
.em-stat-detail{font-size:11px;color:#aaa;margin-top:4px}

/* Cards */
.em-grid-2{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:20px}
.em-grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-bottom:20px}
.em-card{background:white;border:1px solid #e8e5e2;border-radius:12px;padding:20px}
.em-card h3{font-size:14px;font-weight:700;color:#003366;margin:0 0 14px}
.em-card-link{display:block;margin-top:12px;font-size:12px;color:#e27d60;font-weight:600;text-decoration:none}
.em-card-link:hover{text-decoration:underline}
.em-empty{color:#aaa;font-size:13px;font-style:italic}

/* List items */
.em-list{display:flex;flex-direction:column;gap:0}
.em-list-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 0;border-bottom:1px solid #edecea}
.em-list-item:last-child{border-bottom:none}
.em-list-main{min-width:0}
.em-list-main strong{display:block;font-size:13px;color:#333}
.em-list-main span{display:block;font-size:11px;color:#888;margin-top:1px}
.em-badge{display:inline-block;padding:2px 10px;border-radius:20px;font-size:10px;font-weight:700;text-transform:capitalize}
.em-badge-green{background:#e8f5e9;color:#2e7d32}
.em-badge-orange{background:#fff3e0;color:#e65100}
.em-badge-red{background:#fce4ec;color:#c62828}

/* Mini stats */
.em-mini-stat{background:white;border:1px solid #e8e5e2;border-radius:10px;padding:16px;text-align:center}
.em-ms-num{display:block;font-size:24px;font-weight:800;color:#e27d60}
.em-ms-label{display:block;font-size:11px;color:#888;margin-top:4px}

/* Module wrapper — hide old sidebar from gestionnaire views */
.em-module-wrap .nxv-gestionnaire-wrap{display:block}
.em-module-wrap .nxv-sidebar{display:none !important}
.em-module-wrap .nxv-gestionnaire-wrapper{display:block}
.em-module-wrap .nxv-gestionnaire-wrapper .nxv-sidebar,
.em-module-wrap .nxv-gestionnaire-wrapper aside.nxv-sidebar{display:none !important}
.em-module-wrap .nxv-main-content{margin:0;padding:0;max-width:100%}
.em-module-wrap .nxv-gestionnaire-wrapper main{margin:0;padding:0}

/* Responsive */
@media(max-width:1024px){
    .em-sidebar{width:220px}
    .em-content{margin-left:220px;padding:20px}
    .em-grid-2{grid-template-columns:1fr}
    .em-grid-3{grid-template-columns:1fr 1fr}
}
@media(max-width:768px){
    .em-sidebar{display:none}
    .em-content{margin-left:0}
}
