:root{--orange:#f58220;--orange2:#ffad42;--black:#171717;--muted:#707070;--line:#ececec;--bg:#f6f7f9}*{box-sizing:border-box}body{margin:0;font-family:Inter,Segoe UI,Arial,sans-serif;color:var(--black);background:var(--bg)}button,input,select,textarea{font:inherit}button,a{transition:.18s ease}.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:inherit;font-size:21px;font-weight:800;letter-spacing:-.6px}.brand strong{color:var(--orange)}.brand-mark{display:grid;place-items:center;width:38px;height:38px;border-radius:12px;background:linear-gradient(145deg,#ffb347,var(--orange));color:#fff;font-weight:900;font-size:17px;box-shadow:0 5px 14px #f5822038}.auth-page{min-height:100vh;display:grid;place-items:center;padding:22px;background:radial-gradient(circle at 10% 5%,#ffe7d1 0,transparent 32%),var(--bg)}.auth-card{width:min(100%,440px);background:white;padding:34px;border-radius:24px;box-shadow:0 18px 60px #2020200d}.auth-card h1{font-size:28px;line-height:1.15;margin:28px 0 10px;letter-spacing:-.8px}.muted{color:var(--muted);line-height:1.55;font-size:14px}.tabs{display:flex;gap:6px;background:#f4f4f4;padding:5px;border-radius:12px;margin:24px 0 20px}.tab{flex:1;border:0;background:transparent;padding:11px;border-radius:9px;color:#666;font-weight:700;cursor:pointer}.tab.active{background:white;color:var(--black);box-shadow:0 2px 8px #0000000c}.auth-form,.auth-form label,#contactForm{display:flex;flex-direction:column;gap:14px}.auth-form label,#contactForm label{display:flex;flex-direction:column;gap:7px;font-size:13px;font-weight:700}.auth-form input,#contactForm input,#contactForm select,#contactForm textarea,.toolbar input,.toolbar select{width:100%;border:1px solid #e1e1e1;background:#fff;border-radius:10px;padding:12px 13px;outline:none;min-width:0}.auth-form input:focus,#contactForm input:focus,#contactForm textarea:focus,.toolbar input:focus{border-color:var(--orange);box-shadow:0 0 0 3px #f582201a}.primary,.secondary{border:0;border-radius:11px;padding:12px 17px;font-weight:750;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:7px}.primary{background:var(--orange);color:white;box-shadow:0 5px 12px #f5822028}.primary:hover{background:#e87310;transform:translateY(-1px)}.secondary{background:#fff;border:1px solid #e6e6e6;color:#333}.message{font-size:13px;color:#b42318;min-height:18px}.footnote{margin:22px 0 0;color:#999;text-align:center;font-size:11px}.hidden{display:none!important}.topbar{height:72px;background:white;border-bottom:1px solid var(--line);padding:0 max(22px,calc((100% - 1180px)/2));display:flex;align-items:center;justify-content:space-between;gap:20px}.top-actions{display:flex;align-items:center;gap:14px}.user-name{font-size:13px;color:#555}.logout{color:#555;text-decoration:none;font-size:13px}.layout{max-width:1180px;margin:0 auto;padding:38px 22px}.welcome{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:28px}.welcome h1{font-size:clamp(25px,3vw,36px);letter-spacing:-1.1px;margin:4px 0 8px}.welcome .muted{max-width:650px;margin:0}.eyebrow{font-size:11px;font-weight:800;letter-spacing:1.8px;color:var(--orange);margin:0}.toolbar{display:flex;align-items:center;gap:12px;margin-bottom:20px}.toolbar input{flex:1}.toolbar select{width:170px}.status{font-size:12px;color:#777;white-space:nowrap}.contact-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.contact-card{background:white;border:1px solid #eeeeee;border-radius:16px;padding:17px;display:flex;gap:13px;align-items:flex-start;min-width:0;box-shadow:0 4px 14px #00000003}.avatar{width:43px;height:43px;flex:0 0 43px;border-radius:14px;background:#fff0e2;color:#c75b00;display:grid;place-items:center;font-weight:850}.contact-main{flex:1;min-width:0}.contact-main h3{font-size:15px;margin:2px 0 6px;overflow-wrap:anywhere}.contact-main p{margin:3px 0;font-size:13px;color:#505050;overflow-wrap:anywhere}.contact-email{color:#888!important;font-size:12px!important}.group-tag{display:inline-block;margin-top:8px;background:#f4f4f4;color:#666;border-radius:6px;padding:4px 7px;font-size:10px;font-weight:700}.contact-actions{display:flex;gap:5px;align-items:center}.round-action{width:30px;height:30px;border:1px solid #eee;background:white;color:#555;border-radius:9px;display:grid;place-items:center;text-decoration:none;cursor:pointer;font-size:15px}.round-action:hover{border-color:var(--orange);color:var(--orange)}.round-action.danger:hover{border-color:#d92d20;color:#d92d20}.empty{text-align:center;padding:56px 22px;background:white;border:1px dashed #ddd;border-radius:18px}.empty-icon{margin:auto;width:48px;height:48px;border-radius:15px;background:#fff0e2;color:var(--orange);display:grid;place-items:center;font-size:28px}.empty h2{font-size:20px}.empty p{max-width:420px;margin:0 auto 18px;color:#777;font-size:14px;line-height:1.5}dialog{width:min(94vw,480px);border:0;border-radius:20px;padding:0;box-shadow:0 20px 80px #0003}dialog::backdrop{background:#16161688;backdrop-filter:blur(3px)}#contactForm{padding:25px;gap:13px}.dialog-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:5px}.dialog-head h2{margin:0;font-size:21px}.icon-button{border:0;background:#f4f4f4;border-radius:9px;width:32px;height:32px;font-size:22px;cursor:pointer}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:4px}#contactForm textarea{resize:vertical}@media(max-width:760px){.topbar{height:auto;min-height:65px;padding:13px 16px;flex-wrap:wrap}.top-actions{gap:9px}.user-name{display:none}.layout{padding:25px 15px}.welcome{align-items:flex-start;flex-direction:column}.welcome .primary{width:100%}.toolbar{flex-wrap:wrap}.toolbar input{flex-basis:100%}.toolbar select{flex:1;width:auto}.status{flex:1;text-align:right}.contact-grid{grid-template-columns:1fr}.contact-card{padding:13px}.contact-actions{flex-direction:column}.auth-card{padding:25px 21px}.brand{font-size:19px}}
.brand-logo{height:48px;width:48px;object-fit:contain}.number-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:9px}.number-head strong{font-size:13px}.number-head button{padding:7px 9px;font-size:12px}.number-row{display:flex;gap:6px;margin-bottom:8px}.number-row select{width:125px!important;flex:0 0 125px}.number-row input{flex:1;min-width:0}.remove-number{border:0;border-radius:9px;padding:0 10px;font-size:20px;background:#fff0ed;color:#b42318;cursor:pointer}.avatar{overflow:hidden}.avatar img{width:100%;height:100%;object-fit:cover}.numbers-list small{color:#888}.photo-preview-row{display:flex;align-items:center;gap:12px}.photo-preview{width:62px;height:62px;border-radius:14px;object-fit:cover}@media(max-width:480px){.number-row select{width:105px!important;flex-basis:105px}.brand-logo{height:40px;width:40px}}

.brand-logo{width:48px;height:48px;object-fit:contain;flex-shrink:0}.phone-fields{display:flex;flex-direction:column;gap:8px}.phone-row{display:flex;gap:8px}.phone-row input{flex:1}.phone-row button{min-width:38px;padding:8px}.add-phone{align-self:flex-start;font-size:13px}.photo-preview-wrap{display:flex;align-items:center;gap:12px}.photo-preview{width:78px;height:78px;object-fit:cover;border-radius:16px;border:1px solid #eee}.avatar{overflow:hidden}.avatar img{width:100%;height:100%;object-fit:cover}.phone-link{color:inherit;text-decoration:none}.phone-link:hover{color:var(--orange);text-decoration:underline}

.brand-ds{display:inline-flex;align-items:center;justify-content:center;margin-left:6px;padding:3px 6px;border-radius:6px;background:var(--orange);color:#fff;font-size:11px;font-style:normal;font-weight:900;letter-spacing:.2px;vertical-align:middle}

html{min-height:100%;}body{min-height:100vh;}body.auth-page{display:flex;flex-direction:column;align-items:center;justify-content:center;}body.auth-page .auth-card{margin:auto;} .site-footer{width:100%;padding:18px 20px;text-align:center;background:#171717;color:#d7d7d7;border-top:3px solid #f58220;font-size:12px;line-height:1.7;margin-top:34px;}body.auth-page .site-footer{margin-top:28px;} .site-footer p{margin:2px 0;} .site-footer strong{color:#fff;} .site-footer a{color:#ff9b38;text-decoration:none;font-weight:700;} .site-footer a:hover{text-decoration:underline;color:#ffc078;}

/* Récupération du compte — lien visible et interface mobile */
.forgot-link-wrap{margin:-5px 0 2px;text-align:right;font-size:13px;}
.forgot-link,.back-link a{color:var(--orange);font-weight:800;text-decoration:none;}
.forgot-link:hover,.back-link a:hover{text-decoration:underline;color:#c85b00;}
.back-link{text-align:center;font-size:13px;margin:18px 0 0;}
.brand-home{color:inherit;}
.auth-form button:disabled{opacity:.65;cursor:wait;}
@media(max-width:480px){.auth-page{padding:12px;align-items:flex-start}.auth-card{margin:12px auto!important;padding:24px 19px;border-radius:18px}.auth-card h1{font-size:25px;margin-top:24px}.forgot-link-wrap{font-size:14px}}

/* Correctifs robustes du formulaire et des photos — ContactGest DS */
#contactDialog{max-height:92dvh;overflow:auto;overscroll-behavior:contain}
#contactForm{min-width:0}
#contactForm .photo-preview-wrap{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
#contactForm .photo-preview{width:110px;height:110px;object-fit:contain;background:#f7f7f7;border-radius:12px;border:1px solid #e5e5e5;padding:3px}
.contact-card .avatar{width:64px;height:64px;flex:0 0 64px;display:flex;align-items:center;justify-content:center;background:#fff7ef;border-radius:14px;overflow:hidden}
.contact-card .avatar img{width:100%;height:100%;object-fit:contain;background:#f7f7f7}
#numberFields{display:flex;flex-direction:column;gap:8px;min-width:0}
.number-row{display:grid;grid-template-columns:minmax(95px,125px) minmax(0,1fr) 36px;gap:7px;align-items:center;margin:0}
.number-row select,.number-row input{width:100%;min-width:0;padding:10px 8px}
.remove-number{height:40px}
#contactForm input[type=file]{padding:9px;font-size:13px}
#contactForm .dialog-actions{position:sticky;bottom:-25px;background:#fff;padding:12px 0 2px;z-index:2}
#formMessage{overflow-wrap:anywhere;margin:0;min-height:18px}
@media(max-width:520px){dialog#contactDialog{width:calc(100vw - 16px);max-width:none;max-height:94dvh;border-radius:16px}#contactForm{padding:18px 15px;gap:12px}.dialog-head h2{font-size:19px}.number-row{grid-template-columns:100px minmax(0,1fr) 34px;gap:5px}.number-row select,.number-row input{font-size:13px;padding:10px 6px}.contact-card .avatar{width:56px;height:56px;flex-basis:56px}.contact-actions{flex-direction:row;flex-wrap:wrap}.topbar .brand-logo{object-fit:contain}}

/* Inscription par e-mail ou téléphone — ContactGest DS */
.auth-hint{font-size:12px;line-height:1.55;margin:-4px 0 2px}
#registerMethod{width:100%;padding:12px;border:1px solid #ddd;border-radius:10px;background:#fff;color:#222;font:inherit}
.auth-form .hidden{display:none!important}
/* Action d'appel directe depuis chaque numéro */
.numbers-list .contact-phone-row{display:flex;align-items:center;flex-wrap:wrap;gap:5px 8px}
.numbers-list .call-link{display:inline-flex;align-items:center;gap:5px;margin-left:3px;padding:5px 9px;border:1px solid #f58220;border-radius:8px;background:#fff7ef;color:#c75b00;font-size:11px;font-weight:800;text-decoration:none;white-space:nowrap}
.numbers-list .call-link:hover,.numbers-list .call-link:focus-visible{background:#f58220;color:#fff;outline:none}
.numbers-list .call-link span{font-size:13px;line-height:1}
@media(max-width:520px){.numbers-list .contact-phone-row{gap:5px 7px}.numbers-list .call-link{padding:6px 9px;font-size:11px}}

/* Bouton SMS dans la fiche contact */
.numbers-list .sms-link{display:inline-flex;align-items:center;gap:5px;margin-left:3px;padding:5px 9px;border:1px solid #25865a;border-radius:8px;background:#effaf4;color:#176b45;font-size:11px;font-weight:800;text-decoration:none;white-space:nowrap}
.numbers-list .sms-link:hover,.numbers-list .sms-link:focus-visible{background:#25865a;color:#fff;outline:none}
.numbers-list .sms-link span{font-size:13px;line-height:1}
@media(max-width:520px){.numbers-list .sms-link{padding:6px 9px;font-size:11px}}
