:root{--navy:#153b58;--teal:#0e6bae;--green:#bdd052;--sky:#e9f3f7;--white:#fff;--text:#1c2b36;--muted:#5d7080;--border:#d3e2ea;--danger:#b3261e;--ok:#1e7d4f;--radius:14px}*{box-sizing:border-box}body,html{margin:0;padding:0}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Arial,sans-serif;font-size:18px;line-height:1.5;color:var(--text);background:var(--sky);min-height:100vh}a{color:var(--teal)}h1,h2,h3{color:var(--navy);line-height:1.25;margin:0 0 .5em}h1{font-size:1.6rem}h2{font-size:1.25rem}.header{justify-content:space-between;padding:10px 20px;background:var(--white);border-bottom:3px solid var(--green);position:-webkit-sticky;position:sticky;top:0;z-index:10}.brand,.header{display:flex;align-items:center;color:var(--navy)}.brand{gap:12px;text-decoration:none}.header-logo{height:52px;width:auto;display:block}.brand-title{font-size:.85rem;font-weight:700;color:var(--teal);border-left:2px solid var(--border);padding-left:12px}.auth-logo{width:100%;max-width:340px;height:auto;display:block;margin:0 auto 8px}.logo{background:var(--teal);color:var(--white);font-weight:800;letter-spacing:1px;border-radius:10px;padding:6px 10px;font-size:1.05rem}.brand-text{font-weight:700;letter-spacing:2px;display:flex;flex-direction:column;line-height:1.1}.brand-text small{font-weight:400;letter-spacing:0;font-size:.75rem;opacity:.85}.header-nav{display:flex;align-items:center;gap:16px}.btn-link,.header-nav a{color:var(--teal);background:none;border:0;font:inherit;font-size:.95rem;cursor:pointer;text-decoration:underline;padding:0}.container{max-width:720px;margin:0 auto;padding:20px}.card{background:var(--white);border-radius:var(--radius);padding:22px;box-shadow:0 2px 10px rgba(21,59,88,.08);margin-bottom:18px}.center{text-align:center}.muted{color:var(--muted)}.error{color:var(--danger)}.error,.success{font-weight:600;margin:8px 0}.success{color:var(--ok)}label{display:block;font-weight:600;margin:14px 0 6px;color:var(--navy)}input,select,textarea{width:100%;font:inherit;padding:13px 14px;border:2px solid var(--border);border-radius:10px;background:var(--white);color:var(--text)}input:focus,select:focus,textarea:focus{outline:none;border-color:var(--teal)}textarea{resize:vertical}.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;background:var(--teal);color:var(--white);border:0;border-radius:12px;font:inherit;font-weight:700;padding:14px 22px;cursor:pointer;text-decoration:none;min-height:52px}.btn:hover{filter:brightness(1.07)}.btn:disabled{opacity:.5;cursor:not-allowed}.btn.block{width:100%;margin-top:18px}.btn.navy{background:var(--navy)}.btn.ghost{background:transparent;color:var(--navy);border:2px solid var(--border)}.btn.big{font-size:1.15rem;min-height:64px}.tabs{display:flex;gap:6px;background:var(--sky);padding:5px;border-radius:12px;margin-bottom:8px}.tabs button{flex:1 1;border:0;background:transparent;font:inherit;font-weight:600;padding:10px;border-radius:9px;cursor:pointer;color:var(--navy)}.tabs button.active{background:var(--white);box-shadow:0 1px 4px rgba(0,0,0,.1)}.auth-wrap{min-height:100vh;display:flex;flex-direction:column;justify-content:center;padding:20px}.auth-box{max-width:440px;width:100%;margin:0 auto}.auth-brand{text-align:center;margin-bottom:20px}.auth-brand .logo{font-size:2rem;padding:10px 18px;display:inline-block}.auth-brand h1{margin-top:12px;letter-spacing:3px}.conv-list{list-style:none;margin:0;padding:0}.conv-item{display:flex;gap:12px;align-items:flex-start;padding:14px;border-radius:12px;text-decoration:none;color:inherit;border:2px solid transparent;cursor:pointer;background:none;width:100%;text-align:left;font:inherit}.conv-item.selected,.conv-item:hover{background:var(--sky)}.conv-item.selected{border-color:var(--teal)}.conv-main{flex:1 1;min-width:0}.conv-title{font-weight:700;color:var(--navy);display:flex;justify-content:space-between;gap:8px}.conv-preview{overflow:hidden;text-overflow:ellipsis;font-size:.95rem}.conv-date,.conv-preview{color:var(--muted);white-space:nowrap}.conv-date{font-size:.8rem;font-weight:400}.badge{background:var(--danger);color:var(--white);font-size:.8rem;min-width:24px;height:24px;padding:0 7px;display:inline-flex;align-items:center;justify-content:center}.badge,.status{font-weight:700;border-radius:999px}.status{font-size:.78rem;padding:2px 10px;display:inline-block}.status.nouveau{background:#fde7e5;color:var(--danger)}.status.en_cours{background:#fff3d6;color:#8a5a00}.status.termine{background:#dff3e8;color:var(--ok)}.chat{display:flex;flex-direction:column;height:100%;min-height:0}.chat-messages{flex:1 1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:10px}.bubble-row{display:flex}.bubble-row.mine{justify-content:flex-end}.bubble{max-width:82%;padding:10px 14px;border-radius:16px;background:var(--white);box-shadow:0 1px 3px rgba(0,0,0,.08)}.bubble-row.mine .bubble{background:var(--teal);color:var(--white);border-bottom-right-radius:4px}.bubble-row.theirs .bubble{border-bottom-left-radius:4px}.bubble-author{font-size:.78rem;font-weight:700;opacity:.8}.bubble-body{white-space:pre-wrap;word-wrap:break-word}.bubble-meta{font-size:.75rem;opacity:.75;text-align:right;margin-top:2px}.chat-input{display:flex;gap:10px;background:var(--white);border-top:1px solid var(--border);padding:12px 12px calc(12px + env(safe-area-inset-bottom))}.chat-input textarea{flex:1 1;min-height:52px;max-height:160px}.page-chat{display:flex;flex-direction:column;height:100vh;height:100dvh}.page-chat .chat-head{background:var(--white);padding:12px 20px;border-bottom:1px solid var(--border)}.page-chat .chat-head h1{font-size:1.15rem;margin:0}.page-chat .chat{flex:1 1;max-width:820px;width:100%;margin:0 auto;min-height:0}.dash{display:grid;grid-template-columns:380px 1fr;height:calc(100vh - 75px)}.dash-side{background:var(--white);border-right:1px solid var(--border);min-height:0}.dash-filters,.dash-side{display:flex;flex-direction:column}.dash-filters{padding:12px;border-bottom:1px solid var(--border);gap:8px}.dash-filters .tabs{margin:0;flex-wrap:wrap}.dash-filters .tabs button{font-size:.85rem;padding:8px 6px}.dash-list{overflow-y:auto;flex:1 1;padding:8px}.dash-main{display:flex;flex-direction:column;min-height:0}.dash-head{background:var(--white);padding:12px 18px;border-bottom:1px solid var(--border);display:flex;flex-wrap:wrap;gap:12px;align-items:center;justify-content:space-between}.dash-head h2{margin:0;font-size:1.1rem}.dash-head .client-info{font-size:.9rem;color:var(--muted)}.dash-head select{width:auto;padding:8px 10px;font-size:.9rem}.dash-head .controls{display:flex;gap:8px;flex-wrap:wrap}.dash-empty{flex:1 1;display:flex;align-items:center;justify-content:center;color:var(--muted)}.stats{display:flex;gap:8px;font-size:.85rem}.stats span{background:var(--sky);padding:4px 10px;border-radius:8px}@media (max-width:860px){.dash{grid-template-columns:1fr;height:auto}.dash.has-selection .dash-side,.dash:not(.has-selection) .dash-main{display:none}.dash-main{height:calc(100dvh - 64px)}.back-mobile{display:inline-flex!important}}.back-mobile{display:none!important}@media (max-width:520px){.header-logo{height:34px}.brand-title{display:none}.header-nav{gap:12px}}.attach-btn{min-height:52px;padding:0 14px;font-size:1.3rem}.chat-tools{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:8px 12px 0;background:var(--white);border-top:1px solid var(--border)}.chat-tools select{width:auto;padding:8px 10px;font-size:.9rem}.file-chip{background:var(--sky);border-radius:999px;padding:6px 12px;font-size:.9rem;display:inline-flex;gap:8px;align-items:center;max-width:100%;overflow:hidden}.file-chip button{border:0;background:none;cursor:pointer;font-size:1rem;color:var(--danger)}.attachment{margin:4px 0}.attachment-img{display:block;max-width:240px;max-height:240px;border-radius:10px;margin-bottom:4px}.attachment-link{font-size:.9rem;font-weight:600;word-break:break-all}.bubble-row.mine .attachment-link{color:var(--white)}.tiles{display:grid;grid-template-columns:repeat(2,1fr);grid-gap:12px;gap:12px;margin:18px 0}.tile{background:var(--white);border-radius:var(--radius);padding:18px 14px;text-align:center;text-decoration:none;color:var(--navy);font-weight:700;box-shadow:0 2px 10px rgba(21,59,88,.08);display:flex;flex-direction:column;align-items:center;gap:6px;border:2px solid transparent}.tile:hover{border-color:var(--teal)}.tile .ico{font-size:2rem;line-height:1}.tile small{font-weight:400;color:var(--muted);font-size:.8rem}.tile.primary{background:var(--teal);color:var(--white);grid-column:1/-1;flex-direction:row;justify-content:center;font-size:1.15rem}.tile.primary small{color:hsla(0,0%,100%,.85)}.news-item{border-bottom:1px solid var(--border);padding:12px 0}.news-item:last-child{border-bottom:0}.news-item h3{font-size:1.05rem;margin:0 0 4px}.news-item p{margin:4px 0;white-space:pre-wrap}.news-date{font-size:.8rem;color:var(--muted)}.radio-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));grid-gap:10px;gap:10px}.radio-cards button{border:2px solid var(--border);background:var(--white);border-radius:12px;padding:14px 8px;font:inherit;font-weight:600;color:var(--navy);cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:4px}.radio-cards button.active{border-color:var(--teal);background:var(--sky)}.radio-cards .ico{font-size:1.6rem}.row2{display:grid;grid-template-columns:1fr 1fr;grid-gap:0 12px;gap:0 12px}@media (max-width:520px){.row2{grid-template-columns:1fr}}.back{display:inline-block;margin-bottom:10px}.dash-body{display:flex;flex:1 1;min-height:0}.dash-body .chat{flex:1 1;min-width:0}.client-panel{width:320px;border-left:1px solid var(--border);background:var(--white);overflow-y:auto;padding:14px;font-size:.95rem}.client-panel h3{font-size:1rem;margin:14px 0 6px}.client-panel h3:first-child{margin-top:0}.note{background:#fffbe6;border:1px solid #f1e3a6;border-radius:10px;padding:8px 10px;margin-bottom:8px;white-space:pre-wrap}.note small{display:block;color:var(--muted);font-size:.75rem;margin-top:4px}.client-panel textarea{font-size:.95rem}.client-panel .btn{min-height:40px;padding:8px 14px;font-size:.9rem}.mini-conv{display:block;padding:6px 0;border-bottom:1px solid var(--border);font-size:.9rem;text-decoration:none}@media (max-width:1100px){.client-panel{position:fixed;right:0;top:75px;bottom:0;z-index:20;box-shadow:-4px 0 20px rgba(0,0,0,.15)}}.list-row{display:flex;justify-content:space-between;gap:10px;align-items:flex-start;border-bottom:1px solid var(--border);padding:12px 0}.list-row:last-child{border-bottom:0}.list-row .actions{display:flex;gap:6px;flex-shrink:0}.btn.small{min-height:36px;padding:6px 12px;font-size:.85rem}.btn.danger{background:var(--danger)}button.tile{font:inherit;font-weight:700;cursor:pointer}.header-nav{flex-wrap:wrap;justify-content:flex-end;row-gap:4px}@media (max-width:860px){.header{flex-wrap:wrap;gap:8px}.header-nav .btn-link,.header-nav a{font-size:.85rem}}.camera-overlay{position:fixed;inset:0;background:rgba(0,0,0,.75);z-index:100;display:flex;align-items:center;justify-content:center;padding:16px}.camera-box{background:var(--white);border-radius:var(--radius);padding:16px;width:min(720px,100%)}.camera-video{width:100%;max-height:70vh;border-radius:10px;background:#000;display:block}.camera-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:12px;flex-wrap:wrap}@media (max-width:520px){.attach-btn{padding:0 10px}.chat-input{flex-wrap:wrap;gap:8px}.chat-input textarea{flex:1 1 100%;order:-1;min-height:56px}.chat-input button[type=submit]{flex:1 1;min-height:48px}.chat-input .attach-btn{min-height:48px}}