:root{--brand-950:#063d38;--brand-900:#075e54;--brand-700:#0d8c78;--brand-500:#16a085;--brand-100:#dff5ef;--ink:#172522;--muted:#697874;--line:#dfe7e4;--surface:#fff;--surface-2:#f5f8f7;--danger:#b42318;--shadow:0 16px 48px rgba(6,61,56,.12);--text-primary:#173f3a;--text-secondary:#536f6a;--text-muted:#697f7b;--text-subtle:#879a96;--border-color:#dce9e7;--border-soft:#e9f0ef;--surface-primary:#fff;--surface-secondary:#f4f8f7;--surface-tertiary:#edf5f3;--surface-hover:#f8fbfa;--dashboard-glow:#dff6f0;--shadow-card:0 10px 30px #17473e0a;color-scheme:light}
html[data-theme="dark"]{--brand-950:#071d1d;--brand-900:#2ac0a7;--brand-700:#24ab95;--brand-500:#2cc6a9;--brand-100:#173c38;--ink:#e9f4f1;--muted:#9eb3af;--line:#29413f;--surface:#132220;--surface-2:#0c1717;--danger:#ff8177;--shadow:0 18px 50px #0008;--text-primary:#e8f2ef;--text-secondary:#b4c8c4;--text-muted:#91a9a5;--text-subtle:#718985;--border-color:#29413f;--border-soft:#233936;--surface-primary:#132220;--surface-secondary:#0c1717;--surface-tertiary:#1b302d;--surface-hover:#192c29;--dashboard-glow:#133a34;--shadow-card:0 12px 35px #0005;color-scheme:dark}
.rail-link svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.rail-link .inbox-chat-icon{width:25px;height:25px;stroke-width:1.7}.rail-link small{font-size:9px}
.notification-link{position:relative}.nav-notification-badge{position:absolute;top:3px;right:6px;min-width:18px;height:18px;padding:0 4px;border-radius:999px;background:#e5484d;color:white;border:2px solid var(--brand-950);display:grid;place-items:center;font-size:8px;line-height:1}
.status-pill.out{background:#eee4fa!important;color:#684198!important}
.presence-control{margin-top:18px;padding:12px 10px;border:1px solid var(--line);border-radius:12px;background:white;display:grid;gap:7px}.presence-control>span{font-size:11px;font-weight:800;color:var(--brand-900)}.presence-control select{border:1px solid var(--line);border-radius:9px;padding:8px;background:white}.presence-control small{font-size:9px;line-height:1.4;color:var(--muted)}
.presence-control.presence-7{border-color:#cdb8e8;background:#f7f2fc}.presence-control.presence-7>span{color:#684198}.closure-select{max-width:130px}.status-pill.state-3,.status-pill.state-7{background:#eee4fa;color:#684198}.status-pill.state-1{background:#fff1d6;color:#946000}.status-pill.state-2{background:#d9f6ea;color:#007b61}.status-pill.state-4{background:#edf1f0;color:#60716e}
*{box-sizing:border-box}html,body{height:100%;margin:0;font-family:Inter,"Segoe UI",system-ui,sans-serif;color:var(--ink);background:var(--surface-2)}button,input,textarea,select{font:inherit}button{cursor:pointer}button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,a:focus-visible{outline:3px solid rgba(13,140,120,.28);outline-offset:2px}h1[tabindex="-1"]:focus{outline:none}button:disabled{cursor:not-allowed;opacity:.55}
.app-shell{height:100vh;display:grid;grid-template-columns:72px minmax(0,1fr);overflow:hidden}.app-rail{background:linear-gradient(180deg,var(--brand-950),#042e2a);color:white;display:flex;flex-direction:column;align-items:center;padding:14px 8px;z-index:20}.app-main{min-width:0;min-height:0}.brand-mark,.login-brand{width:46px;height:46px;border-radius:15px;display:grid;place-items:center;background:linear-gradient(135deg,#29d4ad,#12a181);box-shadow:0 8px 24px rgba(22,160,133,.35);font-weight:850;font-size:13px;letter-spacing:-.5px}.brand-mark span,.login-brand span{color:white}.rail-nav{display:flex;flex-direction:column;width:100%;gap:8px;margin-top:30px}.rail-link{border:0;background:transparent;color:#b8d3cd;text-decoration:none;min-height:58px;border-radius:14px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px}.rail-link span{font-size:22px;line-height:1}.rail-link small{font-size:10px}.rail-link.active{background:rgba(255,255,255,.14);color:white}.rail-link.future{opacity:.5}.rail-footer{margin-top:auto;display:grid;gap:8px;place-items:center}.rail-profile{display:grid;place-items:center}.rail-avatar,.avatar{display:grid;place-items:center;border-radius:50%;font-weight:750;flex:0 0 auto}.rail-avatar{width:46px;height:46px;background:#fff;color:var(--brand-900);font-size:10px;grid-template-rows:auto auto;align-content:center;gap:4px}.rail-avatar.no-rating{grid-template-rows:auto;gap:0;font-size:11px}.rail-avatar.no-rating>span{transform:none}.rail-avatar>span{line-height:1;transform:translateY(-1px)}.rail-avatar>small{font-size:9px;font-weight:850;line-height:1;white-space:nowrap}.rail-avatar>small.rating-gold{color:#d79a00}.rail-avatar>small.rating-orange{color:#e56a00}.rail-avatar>small.rating-red{color:#d92d20}.logout-button,.icon-button,.back-button{border:0;background:transparent}.logout-button{color:#cce1dc;font-size:22px}
.inbox-workspace{height:100vh;display:grid;grid-template-columns:220px minmax(270px,330px) minmax(420px,1fr) 300px;background:var(--surface);overflow:hidden}.filter-panel,.conversation-panel,.chat-panel,.details-panel{min-width:0;min-height:0;border-right:1px solid var(--line)}.filter-panel{padding:24px 16px;background:#fbfcfc;display:flex;flex-direction:column;overflow:auto}.workspace-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}.workspace-title h1{font-size:22px;margin:2px 0}.eyebrow{font-size:10px;font-weight:800;letter-spacing:1.5px;color:var(--brand-700);margin:0}.welcome-name{font-weight:650;letter-spacing:0;text-transform:none;color:var(--muted);margin-left:4px}.icon-button{width:36px;height:36px;border-radius:11px;color:var(--muted);font-size:18px}.icon-button:hover{background:var(--surface-2);color:var(--brand-900)}.search-box{height:42px;background:white;border:1px solid var(--line);border-radius:12px;display:flex;align-items:center;gap:8px;padding:0 11px}.search-box input{border:0;outline:0;width:100%;min-width:0}.field-label{font-size:11px;font-weight:700;color:var(--muted);margin:20px 0 7px}.filter-panel>select,.chat-actions select,.template-composer select{border:1px solid var(--line);background:white;border-radius:10px;padding:9px;color:var(--ink);min-width:0}.filter-list{display:grid;gap:5px;margin-top:24px}.filter-list button{height:42px;border:0;background:transparent;border-radius:10px;padding:0 12px;display:flex;justify-content:space-between;align-items:center;color:#4e5e59}.filter-list button:hover,.filter-list button.active{background:var(--brand-100);color:var(--brand-900)}.filter-list button.active{font-weight:750}.filter-list b{font-size:11px;border-radius:999px;padding:2px 7px;background:rgba(7,94,84,.08)}.filter-help{margin-top:auto;display:flex;gap:10px;padding:14px 10px;background:#eef8f5;border-radius:12px;color:var(--brand-900)}.filter-help>span{font-size:10px;color:#20bd86}.filter-help div{display:grid}.filter-help strong{font-size:12px}.filter-help small{font-size:10px;color:var(--muted);line-height:1.4;margin-top:2px}
.conversation-panel{display:flex;flex-direction:column;background:white}.conversation-scroll{overflow:auto}.conversation-card{width:100%;min-height:91px;padding:14px 12px;border:0;border-bottom:1px solid #edf1f0;background:white;text-align:left;display:grid;grid-template-columns:44px minmax(0,1fr) auto;gap:10px;align-items:center;position:relative}.conversation-card:hover{background:#f8fbfa}.conversation-card.selected{background:#e8f6f2}.conversation-card.selected:before{content:"";position:absolute;left:0;top:9px;bottom:9px;width:3px;border-radius:3px;background:var(--brand-500)}.avatar{width:42px;height:42px;font-size:12px}.avatar.large{width:76px;height:76px;font-size:20px}.tone-0{background:#d8eee9;color:#08715f}.tone-1{background:#e7e1fb;color:#6046aa}.tone-2{background:#ffe6cf;color:#a34b00}.tone-3{background:#dceafa;color:#1b5f99}.tone-4{background:#f8dfea;color:#9d2f62}.conversation-copy{display:grid;min-width:0;gap:5px}.conversation-heading,.conversation-meta{display:flex;align-items:center;gap:4px}.conversation-heading strong{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.conversation-heading time{margin-left:auto;color:#899691;font-size:10px}.message-preview{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.conversation-meta small{font-size:9px;color:#8c9894;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.unread-badge{align-self:center;background:#18a984;color:white;border-radius:999px;min-width:21px;height:21px;padding:0 6px;display:grid;place-items:center;font-size:10px;font-weight:750}.loading-list{padding:14px;display:grid;gap:12px}.loading-list i{height:64px;border-radius:12px;background:linear-gradient(90deg,#f0f3f2,#fafafa,#f0f3f2);background-size:200%;animation:shimmer 1.2s infinite}@keyframes shimmer{to{background-position:-200%}}
.chat-panel{display:flex;flex-direction:column;background:#f1f6f4;position:relative}.chat-header{height:66px;flex:0 0 auto;background:white;border-bottom:1px solid var(--line);padding:0 14px;display:flex;align-items:center;gap:10px}.chat-contact{display:grid;min-width:0}.chat-contact strong{font-size:14px}.chat-contact small{font-size:10px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-actions{margin-left:auto;display:flex;gap:7px;align-items:center}.chat-actions select{max-width:180px;font-size:11px}.resolve-button,.send-button,.note-form button,.template-composer button{border:0;border-radius:10px;background:var(--brand-700);color:white;font-weight:750}.resolve-button{height:36px;padding:0 14px;font-size:11px}.back-button{display:none;font-size:22px;color:var(--ink)}.message-history{flex:1;overflow:auto;padding:28px clamp(16px,4vw,58px);display:flex;flex-direction:column;gap:9px;background-color:#eef4f2;background-image:radial-gradient(rgba(7,94,84,.045) 1px,transparent 1px);background-size:18px 18px}.history-start{margin:auto;color:var(--muted);font-size:12px}.message-bubble{max-width:min(72%,620px);border-radius:13px;padding:10px 12px 7px;box-shadow:0 1px 2px rgba(25,48,41,.09);font-size:13px;line-height:1.45}.message-bubble p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}.message-bubble.incoming{align-self:flex-start;background:white;border-bottom-left-radius:4px}.message-bubble.outgoing{align-self:flex-end;background:#ccefe4;border-bottom-right-radius:4px}.message-bubble.internal{align-self:center;background:#fff5c7;border:1px dashed #dfc868}.message-bubble footer{display:flex;justify-content:flex-end;align-items:center;gap:4px;margin-top:4px;color:#73827d;font-size:9px}.message-bubble.outgoing footer span{color:#1686aa}.attachment-card{display:flex;gap:10px;align-items:center;padding:10px;border-radius:9px;background:rgba(255,255,255,.6);color:inherit;text-decoration:none;margin-bottom:5px}.attachment-card>span:first-child{font-size:24px}.attachment-card>span:last-child{display:grid}.attachment-card strong{font-size:11px}.attachment-card small{font-size:9px;color:var(--muted)}.composer{flex:0 0 auto;background:white;border-top:1px solid var(--line);padding:10px 14px}.composer-row{display:grid;grid-template-columns:38px minmax(0,1fr) 42px;align-items:end;gap:8px}.composer textarea{resize:none;min-height:42px;max-height:120px;border:1px solid var(--line);border-radius:13px;padding:10px 12px;outline:0}.attach-button{width:38px;height:38px;display:grid;place-items:center;border-radius:10px;color:var(--brand-700);font-size:24px;overflow:hidden;position:relative}.attach-button:hover{background:var(--brand-100)}.attach-button input{position:absolute;width:1px;height:1px;opacity:0}.send-button{width:42px;height:42px;font-size:18px}.pending-file,.composer-error,.composer-locked{font-size:11px;padding:7px 10px;border-radius:8px;margin-bottom:7px}.pending-file{background:var(--brand-100);display:flex;justify-content:space-between}.pending-file button{border:0;background:transparent}.composer-error{background:#fee4e2;color:var(--danger)}.composer-locked{background:#f0f2f1;text-align:center;color:var(--muted)}.template-composer{display:grid;grid-template-columns:auto minmax(140px,1fr) auto;align-items:center;gap:9px;font-size:11px}.template-composer button{padding:9px 13px}
.details-panel{background:#fbfcfc;overflow:auto;border-right:0}.details-panel>header{height:58px;padding:0 16px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;font-size:13px;font-weight:750}.contact-hero{text-align:center;padding:25px 15px 19px;border-bottom:1px solid var(--line);display:grid;justify-items:center}.contact-hero h2{font-size:17px;margin:11px 0 2px}.contact-hero p{font-size:11px;color:var(--muted);margin:0 0 9px}.status-pill{font-size:9px;padding:4px 8px;border-radius:999px;font-weight:750}.status-pill.open{background:#d9f5e8;color:#087354}.status-pill.closed{background:#ecefee;color:#64736e}.detail-section{padding:16px;border-bottom:1px solid var(--line)}.detail-section h3{font-size:11px;text-transform:uppercase;letter-spacing:.8px;color:#71807b;margin:0 0 13px}.detail-section dl{margin:0;display:grid;gap:11px}.detail-section dl div{display:grid;grid-template-columns:75px minmax(0,1fr);gap:8px;font-size:11px}.detail-section dt{color:#86938f;font-weight:500}.detail-section dd{margin:0;overflow-wrap:anywhere}.note-form{display:grid;gap:7px}.note-form textarea{height:70px;resize:vertical;border:1px solid var(--line);border-radius:9px;padding:8px;font-size:11px}.note-form button{padding:8px;font-size:10px}.note-card{margin-top:10px;padding:10px;background:white;border:1px solid var(--line);border-radius:9px;font-size:10px}.note-card p{margin:4px 0;white-space:pre-wrap}.note-card time{color:var(--muted);font-size:8px}.stars{color:#f3b61f;letter-spacing:2px}.rating p{font-size:11px}.empty-state{margin:auto;padding:30px;text-align:center;max-width:310px;color:var(--muted)}.empty-state>span{width:58px;height:58px;border-radius:18px;display:grid;place-items:center;margin:0 auto 13px;background:var(--brand-100);color:var(--brand-700);font-size:26px}.empty-state h2{font-size:15px;color:var(--ink);margin:0 0 5px}.empty-state p{font-size:11px;line-height:1.5;margin:0}.mobile-only{display:none}
.auth-layout{min-height:100vh;display:grid;place-items:center;padding:24px;background:radial-gradient(circle at 20% 10%,#dff8ef,transparent 35%),linear-gradient(140deg,#f8fbfa,#eaf3f0)}.login-card{width:min(100%,420px);background:white;border:1px solid rgba(7,94,84,.1);border-radius:24px;padding:38px;box-shadow:var(--shadow)}.login-brand{margin-bottom:22px}.login-card h1{font-size:30px;margin:5px 0}.login-subtitle{color:var(--muted);font-size:13px;line-height:1.5;margin:0 0 22px}.alert-panel,.success-panel{padding:10px;border-radius:10px;font-size:12px;margin-bottom:15px}.alert-panel{background:#fee4e2;color:var(--danger)}.success-panel{background:#dcfae6;color:#087f5b}.login-form{display:grid;gap:8px}.login-form label{font-size:11px;font-weight:700;color:#53625e;margin-top:7px}.login-form input:not([type=checkbox]){height:46px;border:1px solid var(--line);border-radius:11px;padding:0 12px}.login-form .otp-input{text-align:center;font-size:22px;font-weight:800;letter-spacing:8px}.login-form .remember{display:flex;gap:7px;align-items:center;font-weight:500}.login-form button{height:46px;border:0;border-radius:12px;margin-top:12px;background:linear-gradient(135deg,var(--brand-900),var(--brand-500));color:white;font-weight:750;display:flex;align-items:center;justify-content:space-between;padding:0 17px}.login-security{text-align:center;color:#93a09c;font-size:9px;margin:18px 0 0}.auth-back-link{display:block;margin-top:18px;text-align:center;color:var(--brand-700);font-size:12px;text-decoration:none;font-weight:700}
#blazor-error-ui{display:none;position:fixed;bottom:0;left:0;right:0;padding:10px 18px;background:#fff3cd;color:#664d03;z-index:9999}.dismiss{float:right}.reload{color:inherit;font-weight:700}
@media(max-width:1199px){.inbox-workspace{grid-template-columns:210px 300px minmax(380px,1fr)}.details-panel{position:fixed;right:0;top:0;bottom:0;width:320px;z-index:30;box-shadow:var(--shadow);transform:translateX(105%);transition:transform .2s}.mobile-details .details-panel{transform:translateX(0)}}
@media(max-width:767px){.app-shell{grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) 58px}.app-rail{grid-row:2;padding:5px 10px;flex-direction:row;justify-content:center}.app-main{grid-row:1}.brand-mark,.rail-footer{display:none}.rail-nav{margin:0;flex-direction:row;justify-content:center}.rail-link{min-height:46px;width:68px}.rail-link span{font-size:18px}.inbox-workspace{height:calc(100vh - 58px);display:block;position:relative}.filter-panel,.conversation-panel,.chat-panel,.details-panel{position:absolute;inset:0;width:100%;height:100%;transform:translateX(110%);transition:transform .18s;background:white}.mobile-filters .filter-panel,.mobile-list .conversation-panel,.mobile-chat .chat-panel,.mobile-details .details-panel{transform:translateX(0)}.filter-panel{padding:20px}.conversation-panel{display:flex}.chat-panel{display:flex;background:#eef4f2}.details-panel{z-index:5;box-shadow:none}.mobile-only{height:54px;padding:0 14px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line)}.back-button{display:inline-grid;place-items:center}.chat-header{padding:0 8px}.resolve-button{padding:0 9px}.message-history{padding:16px 10px}.message-bubble{max-width:88%}.composer{padding:8px}.template-composer{grid-template-columns:1fr}.template-composer span{display:none}.details-panel>header .back-button{display:block}.login-card{padding:28px 23px;border-radius:18px}}

.message-bubble.outgoing footer .message-status{color:#73827d;font-weight:800}
.message-bubble.outgoing footer .message-status.status-5{color:#1d9bf0}
.message-bubble.outgoing footer .message-status.status-6{color:var(--danger)}
.note-form button:disabled{background:#83c7bd;color:white;opacity:1}.note-form button.enabled{background:var(--brand-900)}.release-button{background:#d97706}.release-button:hover{background:#b85f04}.confirmation-backdrop{position:fixed;inset:0;z-index:1000;background:rgba(5,37,33,.55);display:grid;place-items:center;padding:20px}.confirmation-dialog{width:min(100%,440px);background:white;border-radius:18px;padding:25px;box-shadow:0 24px 70px rgba(0,0,0,.24);text-align:center}.confirmation-warning{width:48px;height:48px;border-radius:50%;display:grid;place-items:center;margin:0 auto 12px;background:#fff0dc;color:#b85f04;font-size:24px;font-weight:850}.confirmation-dialog h2{font-size:19px;margin:0 0 9px}.confirmation-dialog p{margin:0;color:var(--muted);font-size:12px;line-height:1.6}.confirmation-dialog>div{display:flex;justify-content:flex-end;gap:9px;margin-top:22px}.confirmation-dialog button{height:38px;padding:0 15px;border-radius:10px;font-size:11px;font-weight:750}.confirmation-cancel{border:1px solid var(--line);background:white;color:var(--ink)}.confirmation-release{border:0;background:#d97706;color:white}
.composer-row{grid-template-columns:38px auto auto minmax(160px,1fr) 42px}.composer-tool{height:38px;border:1px solid var(--line);border-radius:10px;background:#f8faf9;color:var(--brand-900);padding:0 10px;font-size:11px;font-weight:700;white-space:nowrap}.composer-tool:hover{background:var(--brand-100)}.composer-tool.recording{background:#fee4e2;border-color:#f4a7a1;color:var(--danger);animation:recording-pulse 1.25s ease-in-out infinite}.composer-hint{display:block;margin:6px 0 0 46px;color:var(--muted);font-size:9px}@keyframes recording-pulse{50%{box-shadow:0 0 0 4px rgba(180,35,24,.12)}}
.pending-file.rich-preview{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px;align-items:center}.pending-file.rich-preview img{grid-column:1/-1;max-width:min(340px,100%);max-height:210px;border-radius:9px;object-fit:contain;background:#fff}.pending-file.rich-preview audio{grid-column:1/-1;width:min(430px,100%);height:38px}.pending-file.rich-preview small{grid-column:1/-1;color:var(--muted)}
.message-image{display:block;margin:2px 0 5px}.message-image img{display:block;max-width:min(420px,100%);max-height:360px;border-radius:9px;object-fit:contain;background:#f7f8f8}.message-sticker img{width:min(240px,62vw);max-height:240px;background:transparent;border-radius:0}.media-download{display:inline-block;margin-bottom:4px;font-size:9px;color:var(--brand-900)}.message-audio{display:grid;gap:3px;min-width:min(360px,62vw)}.message-audio audio{width:100%;height:38px}.message-audio a{font-size:9px;color:var(--brand-900)}.message-video{max-width:min(420px,100%);max-height:360px;border-radius:9px}.attachment-card.pending{opacity:.72}.attachment-card.document{margin-top:3px;align-items:center}.document-icon{position:relative!important;width:35px!important;height:43px!important;flex:0 0 35px;display:grid!important;place-items:end center!important;padding:0 3px 6px;border-radius:5px;background:#64748b;color:white;box-shadow:inset 0 -14px 0 rgba(0,0,0,.14);font-size:24px!important}.document-icon i{position:absolute;right:0;top:0;width:13px;height:13px;background:linear-gradient(135deg,rgba(255,255,255,.72) 0 50%,rgba(0,0,0,.18) 51%);border-bottom-left-radius:3px}.document-icon b{font-size:9px;line-height:1;font-weight:900;letter-spacing:0;color:white}.doc-pdf .document-icon{background:#e53935}.doc-word .document-icon{background:#185abd}.doc-excel .document-icon{background:#107c41}.doc-powerpoint .document-icon{background:#c43e1c}.doc-json .document-icon{background:#374151}.doc-powerbi .document-icon{background:#f2c811;color:#111827}.doc-powerbi .document-icon b{color:#111827}.doc-text .document-icon{background:#5b677a}.doc-file .document-icon{background:#64748b}.attachment-actions{display:flex!important;gap:10px;margin-top:5px}.attachment-actions a{color:var(--brand-900);font-size:10px;font-weight:700}.location-card,.shared-contact-card{display:flex;gap:10px;align-items:center;min-width:min(330px,65vw);padding:11px;border-radius:10px;background:rgba(255,255,255,.72);color:inherit;text-decoration:none;margin:3px 0}.location-pin,.shared-contact-card>span:first-child{width:38px;height:38px;display:grid;place-items:center;border-radius:50%;background:var(--brand-100);color:var(--brand-900);font-size:20px}.location-card>span:last-child,.shared-contact-card>span:last-child{display:grid;gap:2px;min-width:0}.location-card strong,.shared-contact-card strong{font-size:11px}.location-card small,.shared-contact-card small{font-size:9px;color:var(--muted)}.location-card em,.shared-contact-card a{font-size:9px;color:var(--brand-900);font-style:normal;font-weight:700}
.location-composer{border:1px solid var(--line);border-radius:12px;background:#f8fbfa;padding:11px;margin-bottom:8px;display:grid;gap:8px;font-size:10px}.location-heading{display:flex;align-items:center;justify-content:space-between}.location-composer label{display:grid;gap:4px;color:var(--muted)}.location-composer input{height:34px;border:1px solid var(--line);border-radius:8px;padding:0 9px;background:white}.coordinate-row{display:grid;grid-template-columns:1fr 1fr;gap:8px}.primary-action,.secondary-action{border:0;border-radius:9px;padding:9px 12px;font-weight:700}.primary-action{background:var(--brand-700);color:white}.secondary-action{background:var(--brand-100);color:var(--brand-900);justify-self:start}
@media(max-width:900px){.composer-row{grid-template-columns:38px auto auto 1fr 42px}.recording-control{max-width:85px;overflow:hidden;text-overflow:ellipsis}.composer-hint{margin-left:0}}
@media(max-width:520px){.composer-row{grid-template-columns:34px 1fr auto}.composer-row .attach-button{grid-column:1}.composer-row .recording-control{grid-column:2}.composer-row .composer-tool:not(.recording-control){grid-column:3}.composer-row textarea{grid-column:1/3}.composer-row .send-button{grid-column:3}.location-card,.shared-contact-card{min-width:0}.message-audio{min-width:min(270px,75vw)}}
.composer-toolbar{display:flex;align-items:center;gap:6px;margin:0 0 7px 2px}.composer-icon-button{position:relative;width:36px;height:36px;display:grid;place-items:center;border:1px solid transparent;border-radius:50%;background:transparent;color:var(--brand-900);cursor:pointer}.composer-icon-button:hover,.composer-icon-button:focus-visible{background:var(--brand-100);border-color:#b9ddd5;outline:0}.composer-icon-button svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}.composer-icon-button .stop-icon{fill:currentColor;stroke:none}.composer-icon-button.recording{background:#fee4e2;color:var(--danger);animation:recording-pulse 1.25s ease-in-out infinite}.composer-icon-button input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.composer-input-row{display:grid;grid-template-columns:minmax(0,1fr) 42px;align-items:end;gap:8px}.composer-input-row textarea{width:100%}.composer-hint{display:block;margin:6px 0 0 3px}.attachment-card.failed{background:#fff1f0;border:1px solid #f4b9b4}.attachment-card.failed>span:first-child{width:25px;height:25px;display:grid;place-items:center;border-radius:50%;background:var(--danger);color:white;font-weight:800;font-size:13px}
@media(max-width:520px){.composer-toolbar{margin-left:0}.composer-icon-button{width:34px;height:34px}.composer-input-row{grid-template-columns:minmax(0,1fr) 40px}}
.message-bubble{position:relative}
.message-reply-button{position:absolute;z-index:2;top:5px;right:5px;width:27px;height:27px;border:1px solid #d7e2df;border-radius:50%;display:grid;place-items:center;background:rgba(255,255,255,.94);color:#54706a;opacity:1;cursor:pointer;box-shadow:0 1px 2px rgba(25,48,41,.08)}
.message-reply-button:hover,.message-reply-button:focus-visible{background:#eef8f5;outline:2px solid rgba(7,143,125,.22);outline-offset:1px}.message-reply-button:disabled{cursor:not-allowed;color:#a8b5b1}.message-reply-button svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.message-bubble:has(.message-reply-button)>p:first-of-type{padding-right:27px}
.quoted-message{display:grid;gap:1px;padding:6px 9px;margin:0 0 7px;border-left:3px solid var(--brand-600);border-radius:5px;background:rgba(255,255,255,.58);min-width:150px;max-width:440px}.quoted-message strong{font-size:10px;color:var(--brand-800)}.quoted-message span{font-size:11px;color:#49605a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.quoted-message.quoted-agent{border-left-color:#1686aa}
.message-bubble.incoming .quoted-message{background:#f1f4f3}
.composer-reply-preview{display:grid;grid-template-columns:4px minmax(0,1fr) 30px;align-items:center;gap:9px;padding:7px 8px;margin-bottom:7px;border-radius:9px;background:#f3f7f6}.composer-reply-preview .reply-accent{height:100%;min-height:36px;border-radius:4px;background:var(--brand-600)}.composer-reply-preview div{display:grid;min-width:0}.composer-reply-preview strong{font-size:10px;color:var(--brand-800)}.composer-reply-preview div span{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.composer-reply-preview button{border:0;background:transparent;color:var(--muted);font-size:20px;cursor:pointer}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}
.global-error-state{min-height:100vh;display:grid;place-content:center;justify-items:center;gap:.75rem;padding:2rem;text-align:center;background:#f5faf9;color:#163c38}.global-error-state h1{font-size:1.35rem;margin:0}.global-error-state p{max-width:42rem;margin:0;color:#5d716f}.global-error-state button{border:0;border-radius:.65rem;background:#078f7d;color:#fff;font-weight:700;padding:.7rem 1.15rem;cursor:pointer}

/* Tema global persistente: sol para claro y luna para oscuro. */
.app-main{position:relative}.theme-toggle{position:fixed;top:14px;right:16px;z-index:1200;width:38px;height:38px;display:grid;place-items:center;border:1px solid var(--border-color);border-radius:10px;background:color-mix(in srgb,var(--surface-primary) 92%,transparent);color:var(--text-primary);box-shadow:0 8px 24px #0002;backdrop-filter:blur(12px);transition:background .2s,color .2s,transform .2s}.theme-toggle:hover{background:var(--surface-tertiary);transform:translateY(-1px)}.theme-toggle svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.dashboard-header,.admin-header,.schedule-header,.notifications-header,.detail-header,.details-panel>header{padding-right:3.6rem}
html[data-theme="dark"] body{background:var(--surface-2);color:var(--ink)}html[data-theme="dark"] .app-rail{background:linear-gradient(180deg,#071f1e,#050f10)}
html[data-theme="dark"] :is(input,textarea,select){background:var(--surface-primary)!important;color:var(--text-primary)!important;border-color:var(--border-color)!important}html[data-theme="dark"] :is(input,textarea)::placeholder{color:#718884}
html[data-theme="dark"] :is(.filter-panel,.details-panel){background:#101d1c}html[data-theme="dark"] :is(.inbox-workspace,.conversation-panel,.chat-header,.composer,.conversation-card,.note-card,.search-box){background:var(--surface-primary)}html[data-theme="dark"] .conversation-card{border-color:var(--border-soft)}html[data-theme="dark"] .conversation-card:hover{background:var(--surface-hover)}html[data-theme="dark"] .conversation-card.selected{background:#173b36}
html[data-theme="dark"] .filter-list button{color:var(--text-secondary)}html[data-theme="dark"] .filter-list button:hover,html[data-theme="dark"] .filter-list button.active{background:#173c38;color:#5ee0c3}html[data-theme="dark"] .filter-help{background:#132e2b;color:#65d8c0}
html[data-theme="dark"] .chat-panel,html[data-theme="dark"] .message-history{background-color:#0d1918}html[data-theme="dark"] .message-history{background-image:radial-gradient(#4bc6ab10 1px,transparent 1px)}html[data-theme="dark"] .message-bubble.incoming{background:#1b2927;color:#edf5f3}html[data-theme="dark"] .message-bubble.outgoing{background:#135246;color:#effaf7}html[data-theme="dark"] .message-bubble.internal{background:#4b4019;color:#fff4c2;border-color:#7c6b2d}
html[data-theme="dark"] :is(.attachment-card,.location-card,.shared-contact-card){background:#ffffff12}html[data-theme="dark"] .message-bubble.incoming .quoted-message{background:#101b1a}html[data-theme="dark"] .quoted-message{background:#ffffff10}html[data-theme="dark"] .quoted-message span{color:#b8cbc7}html[data-theme="dark"] :is(.composer-reply-preview,.location-composer){background:#172a27}html[data-theme="dark"] :is(.composer-tool,.confirmation-cancel){background:#172724;color:var(--text-primary)}html[data-theme="dark"] .confirmation-dialog{background:var(--surface-primary);color:var(--text-primary)}html[data-theme="dark"] .rail-avatar{background:#eaf5f2;color:#075e54}
html[data-theme="dark"] :is(.admin-page,.schedule-page,.contacts-page,.notifications-page){background:var(--surface-secondary)!important;color:var(--text-primary)!important}html[data-theme="dark"] :is(.admin-card,.agent-list-card,.schedule-card,.contacts-list,.notification-workspace,.notification-detail,.protected-account,.reset-box,.delete-box){background:var(--surface-primary)!important;border-color:var(--border-color)!important;color:var(--text-primary)}html[data-theme="dark"] :is(.admin-list button,.agent-list-card button,.contact-items button,.notification-row){background:var(--surface-primary)!important;color:var(--text-primary)!important;border-color:var(--border-soft)!important}html[data-theme="dark"] :is(.admin-list button.selected,.agent-list-card button.selected,.contact-items button.selected,.notification-row.selected){background:#173b36!important}
html[data-theme="dark"] :is(.card-heading,.detail-header,.permission-grid label,.week-grid article,.contact-search){border-color:var(--border-color)!important}html[data-theme="dark"] .week-grid article.off{background:#101c1b}html[data-theme="dark"] :is(.secondary-button,.notifications-header button){background:var(--surface-primary)!important;color:#57d5bc!important;border-color:var(--border-color)!important}html[data-theme="dark"] :is(.reset-box,.notification-body){background:#261d1b!important}html[data-theme="dark"] .mode-pill,html[data-theme="dark"] .timezone{background:var(--surface-tertiary)!important}html[data-theme="dark"] .notification-message{color:var(--text-primary)}html[data-theme="dark"] .notification-type{filter:saturate(.9) brightness(.92)}
html[data-theme="dark"] .auth-layout{background:radial-gradient(circle at 20% 10%,#123a34,transparent 35%),linear-gradient(140deg,#091312,#101f1d)}html[data-theme="dark"] .login-card{background:var(--surface-primary);border-color:var(--border-color);color:var(--text-primary)}html[data-theme="dark"] .login-form label{color:var(--text-secondary)}html[data-theme="dark"] .global-error-state{background:var(--surface-secondary);color:var(--text-primary)}
@media(max-width:767px){.theme-toggle{top:10px;right:10px;width:36px;height:36px}.dashboard-header,.admin-header,.schedule-header,.notifications-header{padding-right:2.8rem}html[data-theme="dark"] :is(.filter-panel,.conversation-panel,.chat-panel,.details-panel){background:var(--surface-primary)}}

/* Barra superior compartida por todas las páginas autenticadas. */
.app-main{display:grid;grid-template-rows:60px minmax(0,1fr);overflow:hidden}.app-topbar{min-width:0;display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:0 18px 0 24px;border-bottom:1px solid var(--border-color);background:color-mix(in srgb,var(--surface-primary) 94%,transparent);color:var(--text-primary);box-shadow:0 2px 14px #123d3808;z-index:40}.topbar-welcome{min-width:0;display:flex;align-items:center;gap:9px;white-space:nowrap}.topbar-welcome strong{color:var(--brand-700);font-size:11px;letter-spacing:.16em}.topbar-welcome i{width:1px;height:15px;background:var(--border-color)}.topbar-welcome span{overflow:hidden;text-overflow:ellipsis;color:var(--text-muted);font-size:11px}.topbar-welcome b{color:var(--text-primary)}.topbar-actions{display:flex;align-items:center;gap:8px}.topbar-actions form{display:flex}.app-topbar .theme-toggle,.topbar-logout{position:static;width:38px;height:38px;display:grid;place-items:center;border:1px solid var(--border-color);border-radius:10px;background:var(--surface-primary);color:var(--text-primary);box-shadow:none}.app-topbar .theme-toggle:hover,.topbar-logout:hover{background:var(--surface-tertiary);transform:none}.topbar-logout svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.app-content{position:relative;min-width:0;min-height:0;overflow:hidden}.app-content>.inbox-workspace,.app-content>.notifications-page{height:100%}.app-content>.global-error-state{min-height:100%}.auth-layout>.theme-toggle{position:fixed}.dashboard-header,.admin-header,.schedule-header,.notifications-header,.detail-header,.details-panel>header{padding-right:initial}.details-panel>header{justify-content:flex-start;gap:8px}
html[data-theme="dark"] .app-topbar{background:color-mix(in srgb,var(--surface-primary) 94%,transparent);box-shadow:0 2px 18px #0004}
@media(max-width:767px){.app-main{grid-template-rows:52px minmax(0,1fr)}.app-topbar{padding:0 10px 0 13px}.topbar-welcome{gap:6px}.topbar-welcome strong{font-size:9px}.topbar-welcome span{font-size:10px;max-width:45vw}.app-topbar .theme-toggle,.topbar-logout{width:34px;height:34px}.app-content>.inbox-workspace,.app-content>.notifications-page{height:100%}.auth-layout>.theme-toggle{position:fixed;top:10px;right:10px}.details-panel>header{padding-right:16px}}
.app-content>.notifications-page{height:100%!important}
