:root{--ema:#d81b78;--ema-dark:#20152a;--ema-bg:#f7f5f8;--ema-border:#e8e2ea;--ema-text:#2d2631;--ema-muted:#746b78;--ema-red:#d93025;--ema-orange:#ef8d22;--ema-green:#27865b}
body:has(.ema-app),body:has(.ema-login-page){margin:0;background:var(--ema-bg)}
.ema-app{min-height:100vh;display:grid;grid-template-columns:245px 1fr;color:var(--ema-text);font:15px/1.45 Inter,system-ui,-apple-system,"Segoe UI",sans-serif}
.ema-app *{box-sizing:border-box}.ema-sidebar{position:sticky;top:0;height:100vh;background:var(--ema-dark);padding:24px 16px;display:flex;flex-direction:column;color:#fff}.ema-logo{width:150px;max-height:70px;object-fit:contain;margin:0 auto 28px;filter:brightness(0) invert(1)}.ema-sidebar nav{display:flex;flex-direction:column;gap:5px}.ema-sidebar button{appearance:none;border:0;background:transparent;color:#ddd1e0;text-align:left;padding:11px 14px;border-radius:9px;font-weight:600;cursor:pointer}.ema-sidebar button:hover,.ema-sidebar button.active{background:var(--ema);color:#fff}.ema-logout{margin-top:auto;color:#cfc4d2;text-decoration:none;padding:12px}
.ema-main{min-width:0;padding:28px 34px 60px}.ema-topbar{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:25px}.ema-topbar h1{font-size:27px;margin:0}.ema-topbar p{color:var(--ema-muted);margin:4px 0 0}.ema-primary,.ema-actions button,.ema-form button,.ema-calendar-head button,.ema-toolbar button{border:1px solid var(--ema-border);border-radius:8px;background:#fff;padding:10px 15px;cursor:pointer;font-weight:700}.ema-primary{background:var(--ema)!important;border-color:var(--ema)!important;color:#fff!important}.ema-danger{color:var(--ema-red)!important;border-color:#f0b7b3!important}.ema-loading,.ema-empty{text-align:center;padding:32px;color:var(--ema-muted)}
.ema-floating-alert{position:fixed;z-index:50;right:25px;bottom:22px;width:min(440px,calc(100vw - 40px));padding:14px 16px;background:#9e1b15;color:#fff;border-radius:12px;box-shadow:0 12px 30px #42100d55}.ema-floating-alert>div{display:flex;flex-direction:column;margin-top:7px}.ema-floating-alert button{border:0;border-top:1px solid #ffffff30;background:transparent;color:#fff;text-align:left;padding:7px 0;cursor:pointer}
.ema-cards{display:grid;grid-template-columns:repeat(4,minmax(130px,1fr));gap:14px;margin-bottom:20px}.ema-cards article,.ema-panel{background:#fff;border:1px solid var(--ema-border);border-radius:12px;box-shadow:0 2px 8px #2a153008}.ema-cards article{padding:18px}.ema-cards b{display:block;font-size:29px;color:var(--ema)}.ema-cards span{color:var(--ema-muted)}.ema-cards .danger b{color:var(--ema-red)}.ema-cards .warning b{color:var(--ema-orange)}.ema-panel{padding:18px;margin-bottom:20px}.ema-panel h2{font-size:18px;margin:0 0 15px}.ema-grid-2{display:grid;grid-template-columns:1fr 1fr;gap:20px}
.ema-table-wrap{overflow:auto;background:#fff;border:1px solid var(--ema-border);border-radius:11px}.ema-table-wrap table{width:100%;border-collapse:collapse;min-width:700px}.ema-table-wrap th,.ema-table-wrap td{padding:11px 12px;border-bottom:1px solid var(--ema-border);text-align:left;vertical-align:middle}.ema-table-wrap th{background:#faf8fb;color:var(--ema-muted);font-size:12px;text-transform:uppercase;letter-spacing:.03em}.ema-table-wrap tr:last-child td{border-bottom:0}.ema-table-wrap tbody tr[data-edit-task]{cursor:pointer}.ema-table-wrap tbody tr:hover{background:#fff8fc}.ema-table-wrap input,.ema-table-wrap select{max-width:145px;padding:7px;border:1px solid var(--ema-border);border-radius:6px}.ema-status,.ema-tag{display:inline-block;border-radius:999px;padding:4px 8px;background:#eee7f0;font-size:12px}.s-en_cours{background:#dbeaff;color:#17599b}.s-en_attente{background:#fff0cf;color:#865900}.s-a_valider{background:#e4dcff;color:#5635a5}.s-termine,.s-facture{background:#dcf3e7;color:#17613e}.ema-dot{display:block;color:var(--ema-red);font-size:11px}.is-urgent{border-left:3px solid var(--ema-red)}
.ema-due>div{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:9px;padding:9px 0;border-bottom:1px solid var(--ema-border)}.ema-due>div:last-child{border:0}.ema-due time{color:var(--ema-muted)}.ema-toolbar,.ema-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:16px}.ema-toolbar input,.ema-toolbar select,.ema-actions input{padding:10px;border:1px solid var(--ema-border);border-radius:8px;background:#fff}
.ema-board{display:grid;grid-template-columns:repeat(6,minmax(195px,1fr));gap:12px;overflow:auto;padding-bottom:10px}.ema-board>section{background:#eeeaf0;border-radius:12px;padding:10px;min-height:430px}.ema-board h3{display:flex;justify-content:space-between;font-size:14px;margin:3px 3px 12px}.ema-board h3 b{background:#fff;border-radius:999px;padding:1px 7px}.ema-task{background:#fff;border:1px solid var(--ema-border);border-radius:9px;padding:12px;margin-bottom:8px;box-shadow:0 2px 5px #2a15300a;cursor:pointer}.ema-task.urgent{border-left:4px solid var(--ema-red)}.ema-task strong,.ema-task small{display:block}.ema-task small{color:var(--ema-muted);margin:6px 0}.ema-task>div{display:flex;justify-content:space-between;color:var(--ema-muted);font-size:11px}
.ema-calendar-head{display:flex;justify-content:center;align-items:center;gap:20px;margin-bottom:10px}.ema-calendar-head h2{text-transform:capitalize;min-width:210px;text-align:center;margin:0}.ema-weekdays,.ema-calendar{display:grid;grid-template-columns:repeat(7,1fr)}.ema-weekdays b{text-align:center;color:var(--ema-muted);padding:7px}.ema-day{min-height:120px;border-top:1px solid var(--ema-border);border-left:1px solid var(--ema-border);padding:6px;background:#fff;overflow:hidden}.ema-day:nth-child(7n){border-right:1px solid var(--ema-border)}.ema-day.other{background:#fafafa;color:#aaa}.ema-day.today>b{background:var(--ema);color:#fff;border-radius:999px;padding:3px 7px}.ema-event{display:block;width:100%;border:0;border-radius:5px;background:#fde1ef;color:#76113f;text-align:left;font-size:11px;padding:4px;margin-top:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}.u-2{background:#d8f3f2;color:#155c5b}.u-3{background:#ddf2e3;color:#1f6434}.ema-calendar.compact .ema-day{min-height:82px}.ema-calendar.compact .ema-event:nth-of-type(n+3){display:none}
.ema-modal[hidden]{display:none}.ema-modal{position:fixed;z-index:1000;inset:0;background:#1b101dcc;display:flex;justify-content:center;align-items:center;padding:25px}.ema-modal-card{position:relative;width:min(760px,100%);max-height:92vh;overflow:auto;background:#fff;border-radius:15px;padding:27px}.ema-close{position:absolute;right:13px;top:10px;border:0;background:transparent;font-size:28px;cursor:pointer}.ema-form>h2,.ema-modal h2{margin-top:0}.ema-form,.ema-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:13px}.ema-form>label,.ema-form-grid label{display:flex;flex-direction:column;gap:5px;font-weight:600}.ema-form input,.ema-form select,.ema-form textarea{width:100%;border:1px solid #d9d0dc;border-radius:7px;padding:10px;background:#fff}.ema-form textarea{min-height:90px}.ema-form .wide,.ema-form h2,.ema-form-grid,.ema-form-actions,.ema-files{grid-column:1/-1}.ema-form .ema-check{display:flex;flex-direction:row;align-items:center}.ema-form .ema-check input{width:auto}.ema-form-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:8px}.ema-files{display:flex;gap:8px;flex-wrap:wrap}.ema-files a{background:#f3edf5;padding:6px 9px;border-radius:6px}
.ema-toast{position:fixed;z-index:2000;left:50%;bottom:25px;transform:translateX(-50%);background:#20152a;color:#fff;padding:11px 18px;border-radius:8px;box-shadow:0 6px 18px #0003}.ema-login-page{min-height:100vh;display:grid;place-items:center;background:linear-gradient(135deg,#29182f,#d81b78);padding:20px;font:15px/1.5 Inter,system-ui,sans-serif}.ema-login-card{width:min(420px,100%);background:#fff;border-radius:18px;padding:36px;box-shadow:0 25px 60px #16061d66;text-align:center}.ema-login-card img{width:210px;max-height:100px;object-fit:contain}.ema-login-card label{text-align:left;display:block;margin:12px 0 5px;font-weight:600}.ema-login-card input[type=text],.ema-login-card input[type=password]{width:100%;box-sizing:border-box;padding:12px;border:1px solid #d9d0dc;border-radius:8px}.ema-login-card .login-submit input{width:100%;border:0;border-radius:8px;padding:12px;background:var(--ema);color:#fff;font-weight:700}.ema-login-card a{color:var(--ema)}
@media(max-width:1000px){.ema-app{grid-template-columns:78px 1fr}.ema-sidebar{padding:18px 8px}.ema-logo{width:58px}.ema-sidebar button{font-size:0;text-align:center}.ema-sidebar button:before{font-size:18px;content:'•'}.ema-logout{font-size:0}.ema-cards{grid-template-columns:1fr 1fr}.ema-grid-2{grid-template-columns:1fr}.ema-main{padding:22px 18px}.ema-day{min-height:85px}}
@media(max-width:650px){.ema-app{display:block}.ema-sidebar{position:fixed;z-index:90;bottom:0;top:auto;width:100%;height:auto;padding:6px;overflow:auto}.ema-sidebar .ema-logo,.ema-sidebar .ema-logout{display:none}.ema-sidebar nav{flex-direction:row}.ema-sidebar button{font-size:11px!important;white-space:nowrap;padding:8px}.ema-sidebar button:before{display:none}.ema-main{padding:18px 10px 85px}.ema-topbar{align-items:flex-start}.ema-topbar h1{font-size:22px}.ema-topbar p{display:none}.ema-cards{gap:8px}.ema-cards article{padding:12px}.ema-cards b{font-size:22px}.ema-weekdays{display:none}.ema-calendar{grid-template-columns:1fr}.ema-day,.ema-day.other{min-height:auto;border:1px solid var(--ema-border);display:none}.ema-day:has(.ema-event),.ema-day.today{display:block}.ema-day>b:after{content:' — échéances'}.ema-form,.ema-form-grid{grid-template-columns:1fr}.ema-floating-alert{bottom:66px;right:10px;width:calc(100vw - 20px)}}
.ema-tech-group{margin:0 0 12px;background:#fff;border:1px solid var(--ema-border);border-radius:11px;overflow:hidden}.ema-tech-group>summary{cursor:pointer;padding:14px 17px;font-weight:800;background:#faf8fb}.ema-tech-group>summary b{float:right;background:var(--ema);color:#fff;border-radius:999px;padding:1px 9px}.ema-tech-group .ema-table-wrap{border:0;border-radius:0}.ema-tech-group td:first-child small{display:block;color:var(--ema-muted);font-weight:400}.ema-tech-group input,.ema-tech-group select{min-width:92px}
