/* Reference layout: neutral company identity, protected employee data. */
:root{--accent:#2563eb;--ink:#303b4b;--muted:#8c98a7;--line:#edf0f5;color:var(--ink);background:#c1d8f8;font-family:"Microsoft YaHei",Arial,system-ui,sans-serif;font-size:13px}body{background:linear-gradient(160deg,#c0d7f8 0%,#c7daf8 48%,#a8e2ec 100%);background-attachment:fixed}button,input,select,textarea{font-size:13px}input,textarea,select{border-color:#e4e7ed;border-radius:7px;padding:8px 10px}.primary:hover{background:#1d4ed8}.text-button{color:#315db8}.text-button:hover,.icon-button:hover{background:#edf4ff;color:#2563eb}.outline:hover{background:#f3f7ff}.avatar{background:#e7ecff;color:#5663a6}.login-intro{background:linear-gradient(160deg,#c8dcfc,#b8e9ef)}.login-card input,.login-card select{width:100%;margin-top:9px}.login-card select{display:block}.security-line,.intro-body p{color:#6685ae}#workspace{--nav-width:200px;--view-width:138px;--list-width:246px;--detail-width:242px;min-height:100dvh}.work-header{position:fixed;inset:0 0 auto;height:46px;z-index:20;background:transparent;border:0;padding:0 18px 0 16px;gap:12px}.header-brand{width:calc(var(--nav-width) - 20px);display:flex;align-items:center;gap:7px;flex-shrink:0;color:#244d92;font-size:16px}.brand-symbol{font-size:25px;color:#2e70db}.page-heading{display:flex;align-items:center;gap:12px;white-space:nowrap;min-width:160px}.page-heading strong{font-size:16px;color:#26394f}.page-heading .icon-button{font-size:18px;color:#536c88;padding:3px}.header-search{margin-left:auto;display:flex;align-items:center;gap:8px;background:#ffffffd9;height:34px;border:1px solid #e0e9fa;border-radius:9px;padding:0 10px;width:255px;color:#8597ae}.header-search input{padding:0;border:0;background:transparent;min-width:0;flex:1;width:100%;font-size:12px;box-shadow:none}.header-search kbd{font-family:inherit;white-space:nowrap;font-size:10px;color:#a4afbd}.top-right{gap:9px;font-size:12px;white-space:nowrap}.user-caption{display:flex;flex-direction:column;line-height:1.5;min-width:60px}.user-caption small{font-size:10px;color:#94a4b8}.top-right .avatar.small{width:32px;height:32px;background:#e8edf4;color:#7587a0}.live-state{font-size:10px;color:#6f88a5}.rail{top:46px;width:var(--nav-width);border:0;background:transparent;padding:25px 10px 14px;align-items:stretch;z-index:15}.rail nav{gap:8px}.rail-tab{height:40px;width:100%;flex-direction:row;justify-content:flex-start;gap:14px;padding:10px 14px;border-radius:16px;font-size:14px;color:#65788e}.rail-tab svg{width:17px;height:17px;stroke-width:1.6}.rail-tab.active{background:#2860ec;color:#fff}.rail-tab:not(.active):hover{background:#ffffff44;color:#2a5eaa}.nav-chevron{margin-left:auto;font-size:16px}.rail-tab.bottom{font-size:12px;color:#6d859a}.work-main{margin-left:var(--nav-width);padding-top:46px}.chat-layout,.chat-layout.with-customer{display:grid;grid-template-columns:var(--view-width) var(--list-width) minmax(0,1fr);gap:6px;height:calc(100dvh - 46px);padding:0 12px 6px 0;background:transparent}.chat-layout.with-customer{grid-template-columns:var(--view-width) var(--list-width) minmax(0,1fr) var(--detail-width)}.view-sidebar{background:#f5f9ff;border-radius:15px 0 0 15px;min-height:0;padding:13px 8px;display:flex;flex-direction:column}.view-title{height:30px;display:flex;align-items:center;justify-content:space-between;padding:0 4px}.view-title .icon-button{font-size:18px}.view-search{display:flex;align-items:center;gap:6px;background:#fff;border-radius:9px;margin:10px 0;color:#a3afbf;padding:8px}.view-search input{min-width:0;width:100%;border:0;padding:0;font-size:11px;box-shadow:none}.view-item{display:flex;align-items:center;gap:12px;width:100%;height:38px;text-align:left;border-radius:5px;padding:0 10px;font-size:13px;color:#65748a;margin:1px 0}.view-item>span{font-size:16px;width:17px;color:#7d8ba1}.view-item.active{background:#deebff;color:#2b64d6;border-left:2px solid #2865ef;padding-left:8px}.view-item.active>span{color:#2b64d6}.view-item:hover{background:#e9f1ff}.view-note{margin-top:auto;line-height:1.8;padding:12px 5px;color:#a6b3c4;font-size:10px}.conversations{border:0;border-radius:0 14px 14px 0;background:#fff;min-width:0;overflow:hidden}.list-header{padding:6px 0 0;flex-shrink:0;border-bottom:1px solid #eef1f6}.conversation-tools{display:flex;align-items:center;gap:3px;padding:3px 7px 7px}.conversation-tools .search-box{margin:0;min-width:0;flex:1;border:0;background:#f8fafc;padding:0 7px;height:30px}.conversation-tools .search-box input{font-size:12px}.tool-button{display:inline-grid;place-items:center;min-width:27px;height:29px;padding:3px 5px;border-radius:5px;color:#7d8c9c;font-size:18px;line-height:1}.tool-button:hover{background:#eaf2ff;color:#2765da}.filters{padding:0 7px 7px;gap:4px}.filters select{min-width:0;padding:6px 4px;font-size:10px}.conversation-tabs{display:flex;height:40px;gap:0;align-items:stretch}.conversation-tabs button{font-size:11px;padding:0 9px;color:#8a96a8;white-space:nowrap;border-bottom:2px solid transparent}.conversation-tabs button.active{color:#2969d7;border-bottom-color:#2969d7}.conversation-list{background:#f9fcff}.conversation-row{min-height:85px;border-radius:0;padding:12px 9px;gap:9px;border-bottom:1px solid #f0f2f6;border-left:3px solid transparent;background:transparent;text-align:left}.conversation-row.active{background:#deebff;border-left-color:#2e67ee}.conversation-row:hover:not(.active){background:#eef5ff}.conversation-row .avatar{width:35px;height:35px;font-size:14px;position:relative;overflow:visible;background:#e7ecff}.conversation-row .avatar img{border-radius:50%}.conversation-row .avatar:after{content:'';width:10px;height:10px;background:#27c87b;position:absolute;bottom:0;right:-2px;border:2px solid #f7fbff;border-radius:50%}.conv-name{font-size:13px;font-weight:600;color:#364256}.conv-time{font-size:10px;color:#8a96a8}.conv-snippet{font-size:12px;color:#8f9bab;line-height:1.6}.conv-channel{font-size:11px;color:#3569d2;margin-top:3px}.badge{background:#f3747e;color:white;font-size:10px;min-width:16px;height:16px;padding:1px 4px;border-radius:10px}.conversations .pager{height:38px;padding:3px;min-height:38px;background:#fff;border-top:1px solid #edf0f6;gap:6px;justify-content:center;font-size:10px;color:#98a6b8}.conversations .pager button{font-size:17px;padding:2px 12px}.chat-panel{background:#f7fbff;border-radius:14px;min-width:0;overflow:hidden}#activeChat{height:100%;display:flex;flex-direction:column}.chat-heading{height:101px;min-height:101px;display:flex;flex-wrap:wrap;padding:12px 14px 8px;gap:5px 8px;border-bottom:1px solid #edf1f6;background:#fff;align-content:space-between}.chat-heading>.avatar{display:none}.chat-heading-title{width:100%;flex:auto;min-width:0}.chat-heading h3{font-size:14px;font-weight:600;color:#303a4d;margin:0}.chat-heading small{font-size:10px;color:#a0adbe;margin-top:3px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;display:block}.chat-actions{display:flex;align-items:center;justify-content:flex-end;gap:5px;width:100%}.channel-connection{font-size:10px;color:#7ba949;background:#f0f9e9;border-radius:3px;padding:3px 5px;margin-right:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.history-bar{padding:3px 0;min-height:6px;background:transparent;border:0;flex-shrink:0}.history-bar button{font-size:11px;padding:3px}.messages{padding:10px 14px;gap:0;min-height:0;flex:1;overflow:auto;background:#f7fbff}.message-group{position:relative;padding-left:39px;padding-right:0;margin:12px 0;max-width:94%;align-self:flex-start;align-items:flex-start}.message-group.outbound{padding-left:0;padding-right:39px;align-self:flex-end;align-items:flex-end}.message-avatar{position:absolute;left:0;top:2px;width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:#8a9c45;color:#fff;font-size:12px;overflow:hidden}.message-avatar img{width:100%;height:100%;object-fit:cover}.outbound .message-avatar{left:auto;right:0;background:#8f9d4e}.message-author{font-size:10px;line-height:1.5;color:#9aa6b5;margin-bottom:4px}.message-bubble,.outbound .message-bubble{border:1px solid #edf0f5;background:#fff;color:#3e4654;border-radius:10px;padding:10px 12px;box-shadow:0 1px 2px #2a4c6e05;font-size:13px;line-height:1.65;max-width:100%;overflow-wrap:anywhere}.message-bubble img{max-height:280px;max-width:100%;border-radius:7px}.message-bubble video{max-width:100%;max-height:280px}.message-bubble audio{max-width:100%;width:250px}.message-meta{font-size:10px;color:#929fb1;gap:7px;margin-top:4px;display:flex;align-items:center}.message-meta button{font-size:10px;color:#7f97ba;padding:2px}.message-translation{font-size:12px;color:#8091a9;border-top:1px solid #edf0f6;padding-top:7px;margin-top:7px}.composer{margin:5px 13px 14px;background:white;border:1px solid #e9eef6;border-radius:13px;flex-shrink:0;position:relative;overflow:visible}.composer-toolbar{height:34px;display:flex;align-items:center;justify-content:space-between;padding:2px 9px;background:#fafcff;border-radius:13px 13px 0 0;border-bottom:1px solid #f5f7fb}.composer-toolbar>div{display:flex;gap:5px}.translation-state{font-size:10px;color:#5f85bf}.composer textarea{height:68px;min-height:55px;resize:vertical;width:100%;border:0;border-radius:0;box-shadow:none;background:transparent;padding:12px;font-size:12px}.composer-footer{padding:5px 10px 8px;justify-content:flex-end;gap:10px;align-items:center;border:0;display:flex}.composer-footer .keyboard-hint{font-size:10px;color:#9aa7b7}.composer-footer .primary{padding:5px 13px;font-size:11px;border-radius:5px}.send-state{font-size:10px;margin:0;padding:0 10px 4px;color:#b77c4c}.send-state:empty{display:none}.reply-preview,.attachment-preview{background:#eff5ff;border:0;border-bottom:1px solid #e1eafa;font-size:11px;color:#647d9f;border-radius:10px 10px 0 0}.emoji-picker{position:absolute;bottom:145px;left:10px;background:white;box-shadow:0 4px 22px #466fa828;border:1px solid #e5edfb;border-radius:8px;padding:8px;z-index:5;display:flex}.emoji-picker button{font-size:22px;padding:5px}.message-search-bar{display:flex;padding:7px 12px;background:#fff;gap:6px}.message-search-bar input{min-width:0;flex:1;font-size:12px}.customer-panel{position:relative;right:auto;top:auto;bottom:auto;width:auto;box-shadow:none;z-index:0;background:#f7fbff;border:0;border-radius:0 14px 14px 0;overflow:auto}.panel-heading{height:48px;min-height:48px;border-bottom:1px solid #edf0f5;padding:0 13px;display:flex;align-items:center;justify-content:space-between;background:#fff}.panel-heading h3{font-size:13px;font-weight:600;margin:0;color:#344055}.panel-heading .icon-button{font-size:22px;color:#8c9bad}.customer-profile{padding:18px 14px 14px;display:grid;grid-template-columns:38px 1fr;gap:7px 10px;align-items:center;text-align:left}.customer-profile>.avatar{width:37px;height:37px;grid-row:1/3}.customer-profile h3{font-size:13px;margin:0;text-align:left}.customer-profile>small{font-size:10px;color:#9ba7b8;text-align:left;word-break:break-all}.customer-fields{padding:4px 13px 17px;gap:10px}.customer-fields label{font-size:11px;color:#8291a7}.customer-fields input,.customer-fields textarea{font-size:11px;padding:7px 8px;margin-top:4px;background:#fff;border-color:#e8edf4}.customer-fields textarea{min-height:65px}.customer-fields .primary,.customer-fields .outline{font-size:11px;padding:7px 10px}.info-row{display:flex;gap:10px;justify-content:space-between;font-size:11px;padding:9px 0;border-bottom:1px solid #eef2f7}.info-row>span{color:#8b9cb4;white-space:nowrap}.info-row strong{font-weight:400;color:#677e9d;overflow-wrap:anywhere;text-align:right}.field-pair{gap:8px}.customer-fields .field-pair label{min-width:0}.profile-section-title{background:#edf3fc;border-radius:5px;padding:8px;margin:7px 0;color:#61718a;font-size:11px}.customers-view{padding:0 7px 6px 0;height:calc(100dvh - 46px);display:grid;grid-template-columns:216px minmax(0,1fr);gap:6px;overflow:hidden;background:transparent}.customer-navigation{background:#f7fbff;border-radius:14px;padding:22px 10px}.customer-navigation>small{display:block;color:#94a5bc;font-size:11px;margin:0 10px 13px}.customer-navigation>button{display:flex;align-items:center;gap:12px;width:100%;padding:11px 10px;font-size:13px;color:#65758d;text-align:left;border-radius:6px;margin:2px 0}.customer-navigation>button>span{font-size:18px;color:#8b9aaf}.customer-navigation>button.active{background:#edf4ff;color:#2968da;font-weight:600}.customer-navigation>button.active>span{color:#2968da}.customer-content{background:#fff;border-radius:14px;min-width:0;overflow:hidden;display:flex;flex-direction:column;padding:15px 15px 8px}.customer-filter-bar{display:flex;flex-wrap:wrap;align-items:end;gap:9px;flex-shrink:0}.customer-filter-bar label:not(.search-box){font-size:10px;color:#9aa5b4;display:flex;align-items:center;gap:7px}.customer-filter-bar input[type=date]{width:145px;font-size:11px;color:#8493a6}.customer-filter-bar>select{width:180px;font-size:11px;height:33px}.customer-filter-bar>#customerCountryFilter{width:130px;font-size:11px;height:33px}.customer-filter-bar .search-box{width:370px;min-width:200px;flex:1;height:33px;margin:0;padding:0 9px;border:1px solid #e4e7ed;border-radius:7px}.customer-filter-bar .search-box input{font-size:11px}.customer-filter-bar .primary,.customer-filter-bar .outline{height:33px;padding:6px 16px;font-size:12px}.customer-result-summary{height:45px;flex-shrink:0;display:flex;align-items:center;justify-content:space-between;gap:10px;color:#8696ac;font-size:11px}.customer-result-summary small{font-size:10px;color:#a0aec0}.customer-content .table-wrap{flex:1;min-height:0;overflow:auto;border:1px solid #edf0f5;border-radius:11px;background:#fff}.customer-grid{min-width:1400px;table-layout:fixed;font-size:12px}.customer-grid th{background:#f7f9fc;font-size:11px;padding:14px 12px;color:#7d8ba1;position:sticky;top:0;z-index:2;border-right:1px solid #f0f2f7;height:43px;font-weight:500}.customer-grid td{padding:12px;border-top:1px solid #f3f4f7;border-right:1px solid #f6f7f9;color:#717e90;height:55px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-size:12px}.customer-grid th:nth-child(1){width:125px}.customer-grid th:nth-child(2){width:170px}.customer-grid th:nth-child(3){width:145px}.customer-grid th:nth-child(5){width:170px}.customer-grid th:nth-child(9),.customer-grid th:nth-child(10){width:165px}.customer-grid th:last-child{width:150px}.customer-grid tr:nth-child(even) td{background:#fafbfd}.customer-grid tr:hover td{background:#f0f6ff}.customer-grid td .customer-cell{gap:8px}.customer-grid .customer-cell .avatar{width:30px;height:30px;font-size:11px}.customer-grid td strong{color:#5a6a83;font-size:12px;font-weight:400}.customer-grid .sticky-action{position:sticky;right:0;background:#fff;z-index:1;box-shadow:-3px 0 6px #dae2ef33}.customer-grid th.sticky-action{background:#f7f9fc;z-index:3}.customer-grid .text-button{padding:4px;font-size:11px;white-space:nowrap}.customer-content>.pager{justify-content:flex-end;height:46px;min-height:46px;border:0;gap:8px;padding:7px 0;font-size:11px;color:#8595ab}.customer-content .pager .outline{padding:6px 9px;font-size:11px}.page-number{background:#2864e7;color:white;padding:6px 9px;border-radius:3px}.empty.large{background:#f8fcff}.empty.large h2{font-size:18px;font-weight:400;color:#7890ae}.empty.large p{font-size:12px;color:#a6b5c9}.empty-symbol{color:#c1d5f1;font-size:56px}.nav-collapsed{--nav-width:64px!important}.nav-collapsed .header-brand{width:32px}.nav-collapsed .header-brand strong,.nav-collapsed .rail-tab>span{display:none}.nav-collapsed .rail-tab{justify-content:center;padding:10px}.nav-collapsed .rail{padding-inline:7px}#backChat{display:none}.admin-view{background:#f2f6fc}.admin-view .topbar{background:#fff}.admin-form label{color:#7288a6}.admin-title h1{color:#354c70}.code-result{background:#edf4ff;border-color:#bdd3f9;color:#3b65a8}#toast{background:#315c96}
@media(max-width:1150px){#workspace{--nav-width:160px;--view-width:116px;--list-width:230px;--detail-width:218px}.header-search{width:200px}.page-heading{min-width:100px}.customer-fields{padding-inline:10px}.keyboard-hint{display:none}.customers-view{grid-template-columns:180px minmax(0,1fr)}}
@media(max-width:1050px){.chat-layout,.chat-layout.with-customer{grid-template-columns:var(--view-width) var(--list-width) minmax(0,1fr)}.customer-panel{display:none;position:fixed;right:12px;top:46px;bottom:6px;width:280px;z-index:18;box-shadow:-8px 0 25px #5e85b82b}.chat-layout.customer-open .customer-panel{display:block}.live-state{display:none}.customer-result-summary small{display:none}}
@media(max-width:850px){#workspace{--nav-width:64px;--view-width:103px;--list-width:220px}.header-brand{width:32px}.header-brand strong,.rail-tab>span{display:none}.rail{padding-inline:7px}.rail-tab{justify-content:center;padding:10px}.page-heading{min-width:90px}.header-search{width:190px}.view-item{font-size:12px;gap:7px;padding-inline:6px}.chat-heading{padding:10px}.chat-actions{gap:1px}.customers-view{grid-template-columns:155px minmax(0,1fr)}.customer-navigation{padding:17px 6px}.customer-navigation>button{font-size:12px;gap:8px}.customer-content{padding:12px 10px 6px}}
@media(max-width:650px){#workspace{--nav-width:54px;--view-width:94px}.work-header{height:46px;padding-inline:10px;gap:7px}.header-brand{width:28px}.header-search{display:none}.page-heading{gap:5px}.page-heading strong{font-size:14px}.top-right{margin-left:auto}.user-caption{max-width:90px;min-width:0}.user-caption>span{overflow:hidden;text-overflow:ellipsis}.rail{top:46px;padding-top:18px}.work-main{margin-left:var(--nav-width);padding-top:46px}.chat-layout,.chat-layout.with-customer{display:grid;grid-template-columns:94px minmax(0,1fr);height:calc(100dvh - 46px);padding:0 5px 5px 0;position:relative}.view-sidebar{padding-inline:5px}.view-note{font-size:9px}.conversations{height:100%;width:auto}.chat-panel{display:none;position:absolute;inset:0 5px 5px 0;z-index:12}.chat-layout.chat-selected .chat-panel{display:block}.chat-heading:before{display:none}#backChat{display:inline-grid;margin-right:5px}.chat-heading-title{display:flex;align-items:center;flex-wrap:wrap}.chat-heading-title h3{flex:1}.chat-heading-title small{width:100%}.customer-panel{top:46px;right:5px;bottom:5px;width:calc(100vw - 64px);border-radius:12px}.messages{padding:8px 10px}.message-group{max-width:96%}.customers-view{height:calc(100dvh - 46px);grid-template-columns:110px minmax(0,1fr);padding-right:5px;gap:5px}.customer-navigation{padding:16px 5px}.customer-navigation>button{font-size:11px;padding:10px 6px;gap:5px}.customer-navigation>button>span{font-size:14px}.customer-filter-bar input[type=date]{width:110px}.customer-filter-bar>select{width:100%}.customer-filter-bar .search-box{width:100%;min-width:100px;flex:auto}.customer-filter-bar label{max-width:100%}.customer-result-summary{height:34px}.customer-filter-bar>#customerCountryFilter{width:100%}.customer-content{padding:10px 7px 5px}.customer-filter-bar{gap:5px}.customer-content>.pager{gap:5px;font-size:10px}.customer-content>.pager>span:first-child{display:none}.customer-content .pager .outline{font-size:10px;padding:5px}.customer-content .page-number{font-size:10px;white-space:nowrap}}

#workspace{scrollbar-color:#c2cddd transparent;scrollbar-width:thin}#workspace *{scrollbar-width:thin;scrollbar-color:#c2cddd transparent}.tool-button svg,.page-heading .icon-button svg,.view-title .icon-button svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.composer textarea{height:52px;min-height:52px}.composer-footer{min-height:27px}.customer-grid th:nth-child(4){width:110px}

.composer{padding:0}.composer-toolbar{height:32px}.composer textarea{display:block;height:44px;min-height:44px;padding:10px 12px}.composer-footer{padding:3px 10px 6px}.composer-footer .primary{padding:4px 13px}

@media(max-width:650px){.customers-view{display:flex;flex-direction:column;gap:5px}.customer-navigation{display:flex;flex-shrink:0;gap:3px;padding:4px;background:#f7fbff;border-radius:10px}.customer-navigation>small{display:none}.customer-navigation>button{width:auto;flex:1;justify-content:center;white-space:nowrap;gap:4px;margin:0;padding:8px 4px;font-size:10px}.customer-navigation>button>span{font-size:12px}.customer-content{flex:1;min-height:0}.customer-grid .sticky-action{position:static;box-shadow:none}.customer-filter-bar input[type=date]{width:112px}.customer-filter-bar label:not(.search-box){font-size:9px;gap:3px}}

/* Management follows the same navigation and panel geometry as the employee app. */
.admin-view{min-height:100dvh;background:transparent}.admin-header{position:fixed;inset:0 0 auto;height:46px;padding:0 18px;gap:18px;z-index:25;background:transparent!important;border:0}.admin-header .brand{width:164px;font-size:16px;color:#244d92;flex-shrink:0;gap:8px}.admin-header>strong{font-size:16px}.admin-header-actions{display:flex;gap:8px;align-items:center;margin-left:auto}.admin-header-actions .outline{font-size:11px;padding:6px 10px;background:#ffffffb8}.admin-navigation{position:fixed;top:46px;left:0;bottom:0;width:200px;padding:23px 10px;display:flex;flex-direction:column}.admin-navigation>small{color:#8193ad;margin:0 14px 15px;font-size:11px}.admin-navigation nav{display:grid;gap:8px}.admin-navigation button{display:flex;align-items:center;gap:13px;padding:12px 16px;border-radius:15px;text-align:left;color:#62778f;font-size:15px}.admin-navigation button span{font-size:13px}.admin-navigation button.active{background:#2860ec;color:#fff}.admin-navigation button:hover:not(.active){background:#ffffff50}.admin-navigation>p{margin-top:auto;padding:10px;color:#7890ac;font-size:10px;line-height:1.8}.admin-content{max-width:none;margin:0 0 0 200px;padding:58px 14px 22px 0;min-height:100dvh}.admin-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:12px}.admin-stat{background:#ffffffdc;border:1px solid #ffffff90;border-radius:12px;padding:15px 18px;color:#7f91a9;font-size:11px}.admin-stat strong{display:block;font-size:24px;color:#365a90;font-weight:550;margin-top:6px}.admin-stat small{color:#94a4b8;font-size:10px}.admin-card{margin:0;padding:23px;border:0;border-radius:14px;min-height:calc(100dvh - 175px);overflow:hidden}.admin-card h2{font-size:17px;color:#374b68;margin:0 0 10px}.admin-section-heading{display:flex;align-items:start;justify-content:space-between;gap:15px;margin-bottom:18px}.admin-section-heading p{font-size:12px;margin:0}.admin-section-heading .primary{font-size:12px;padding:8px 15px;white-space:nowrap}.admin-filter{display:flex;gap:10px;align-items:center;margin:18px 0}.admin-filter input{width:260px;font-size:12px}.admin-filter select{font-size:12px}.admin-filter .muted{margin-left:auto;font-size:11px}.admin-table-wrap{overflow:auto;border:1px solid #edf0f5;border-radius:9px}.admin-table-wrap table{min-width:650px}.admin-table-wrap th{background:#f7f9fc;color:#8291a7;padding:13px;font-size:11px}.admin-table-wrap td{padding:14px 13px;border-color:#f0f3f8;color:#687c97}.admin-table-wrap td strong{color:#42618a}.admin-table-wrap tr:nth-child(even){background:#fafcff}.admin-table-wrap td small{color:#9ca9bb}.admin-table-wrap .text-button{font-size:11px;padding:5px}.admin-pill{display:inline-block;color:#38845d;background:#eef9f2;border-radius:5px;padding:4px 7px;font-size:11px}.admin-pill.off{color:#8b97a8;background:#f0f2f6}.admin-view details{background:#f9fbff;border:1px solid #e9eff9;border-radius:8px;padding:12px 15px}.admin-view summary{cursor:pointer;color:#5c76a0;font-size:12px}.admin-form{margin:18px 0 4px}.admin-form label>span{display:block;font-size:10px;margin-top:3px}.admin-form .check-label{min-width:120px;flex:0 1 auto}.admin-form fieldset{background:#fff;border-color:#e7edf6}.admin-form .channel-choices{max-height:200px;overflow:auto}.admin-form h3{flex-basis:100%;font-size:14px;color:#58759e}.connection-grid{display:grid;grid-template-columns:180px 1fr;gap:0;margin:23px 0}.connection-grid dt,.connection-grid dd{margin:0;padding:14px;border-bottom:1px solid #edf1f7;color:#6f85a3;font-size:12px}.connection-grid dt{background:#f8faff;color:#8a9cb6}.admin-limit-note{background:#f4f8ff;border:1px solid #e8effa;padding:15px;border-radius:8px;color:#8395ae;line-height:1.8;font-size:12px}
@media(max-width:850px){.admin-navigation{width:150px}.admin-header .brand{width:114px;font-size:13px}.admin-content{margin-left:150px}.admin-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.admin-card{padding:16px}.admin-navigation button{padding:12px;font-size:13px}.admin-header-actions .text-button{display:none}}
@media(max-width:550px){.admin-header .brand{width:auto;font-size:12px}.admin-header>strong{font-size:12px}.admin-header{gap:8px;padding:0 9px}.admin-header-actions{gap:4px}.admin-header-actions .outline{font-size:10px;padding:5px}.admin-navigation{position:static;width:auto;padding:52px 6px 6px}.admin-navigation>small,.admin-navigation>p{display:none}.admin-navigation nav{display:flex;gap:4px}.admin-navigation button{padding:9px 7px;flex:1;justify-content:center;gap:3px;border-radius:8px}.admin-navigation button span{font-size:10px}.admin-content{margin:0;padding:0 6px 15px}.admin-summary{gap:6px;margin-bottom:6px}.admin-stat{padding:10px}.admin-stat strong{font-size:20px}.admin-card{padding:13px;min-height:300px}.admin-filter{flex-wrap:wrap;gap:6px}.admin-filter input{width:100%}.admin-filter .muted{font-size:10px}.admin-section-heading p{font-size:11px}.admin-section-heading h2{font-size:15px}.admin-form label{min-width:100%;flex:1}.connection-grid{grid-template-columns:110px 1fr}.connection-grid dt,.connection-grid dd{padding:12px 8px;font-size:11px}}

.customer-navigation>button{min-height:40px}.customer-grid td,.customer-grid td strong{font-size:13px}.customer-grid th{font-size:12px}.customer-pagination #customerPageSize{font-size:11px;color:#7b8ca5;max-width:125px;padding:6px 8px}.page-jump-label{display:flex;align-items:center;gap:5px;white-space:nowrap;color:#8b9bb0;font-size:11px}.page-jump-label input{width:58px;padding:5px 6px;font-size:11px}.customer-content>.customer-pagination{height:auto;min-height:46px;flex-wrap:wrap}
@media(max-width:650px){.customer-pagination #customerPageSize{font-size:10px;max-width:95px;padding:5px}.page-jump-label{font-size:10px}.page-jump-label input{width:44px;padding:4px}.customer-content>.customer-pagination{gap:5px}.customer-grid td,.customer-grid td strong{font-size:12px}}

.channel-connection[data-state="offline"],.channel-connection[data-state="invalid"]{color:#b76060;background:#fff0f0}.channel-connection[data-state="connecting"]{color:#a17b34;background:#fff7df}.channel-connection[data-state="unknown"]{color:#8b96a7;background:#edf1f6}
.customer-profile-readonly{position:relative;padding-right:40px}.customer-profile-readonly .customer-edit{position:absolute;right:12px;top:24px;width:22px;min-width:22px;height:22px}.customer-edit svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}.customer-readonly{padding:0 14px 20px}.customer-remark{margin:4px 0 18px;color:#8291a5;font-size:12px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere}.customer-section{margin-top:18px}.customer-section>summary{padding:9px 10px;background:#edf3fc;border-radius:5px;color:#62748c;font-size:11px;cursor:pointer}.customer-section[open]>summary{margin-bottom:10px}.customer-tags{display:flex;flex-wrap:wrap;gap:6px;padding:8px 0}.customer-tags>span{padding:4px 7px;border:1px solid #dce7f8;border-radius:4px;color:#57769f;background:#f2f7ff;font-size:11px;overflow-wrap:anywhere;max-width:100%}.customer-tags>small{font-size:11px;color:#99a7b9}.customer-readonly .info-row{align-items:start;gap:9px}.customer-readonly .info-row>strong{min-width:0}

/* Resize handles float in the existing gaps; they never create grid tracks. */
.chat-layout{position:relative}
.panel-resizer{position:absolute;top:0;bottom:6px;width:10px;margin-left:-5px;z-index:9;cursor:col-resize;touch-action:none;outline:none;background:transparent}
.panel-resizer::after{content:"";position:absolute;left:4px;top:10px;bottom:10px;width:2px;border-radius:2px;background:transparent}
.panel-resizer:hover::after,.panel-resizer:focus-visible::after,.panel-resizer.dragging::after{background:#5a8fea}
.panel-resizer:focus-visible{outline:2px solid #2563eb;outline-offset:-2px;border-radius:4px}
.resizing-panels,.resizing-panels *{cursor:col-resize!important;user-select:none!important}
@media(max-width:650px){.panel-resizer{display:none!important}}

.conv-type{flex-shrink:0;color:#6b9b45;background:#edf7df;border:1px solid #deedcf;border-radius:2px;font-size:10px;line-height:15px;padding:0 3px;margin-left:auto;white-space:nowrap}.conv-type:empty{display:none}.conv-type.group{color:#536eab;background:#eef3ff;border-color:#dbe4fa}.conv-line .conv-time{flex-shrink:0}

.voice-panel{display:flex;flex-direction:column;gap:8px;padding:9px 10px;border:1px solid #dbe5f5;background:#f1f6ff;border-radius:8px;margin:5px 0}.voice-panel[hidden]{display:none}.voice-panel audio{width:100%;height:34px}.voice-panel>span{font-size:12px;color:#45618b}.voice-panel>div{display:flex;gap:6px;align-items:center}.voice-panel button{padding:6px 9px;font-size:12px}#recordVoice[aria-pressed="true"]{color:#d43e4b;background:#fff0f1}

/* Bounded historical window and explicit return to current conversation. */
.history-bar{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;padding:3px 12px;min-height:27px}
#historyWindowStatus{font-size:10px;line-height:1.5}
#latestMessages{margin-left:auto;white-space:nowrap}
@media(max-width:650px){#historyWindowStatus{width:100%;order:3}.history-bar{gap:3px}}
#historySearchDialog{width:640px;max-width:94vw;padding:0;overflow:auto;color:#425673}
#historySearchForm{padding:15px 18px 5px}#historySearchForm label{display:block;font-size:12px;margin-bottom:7px;color:#7c8ea7}
#historySearchForm>div{display:flex;gap:8px}#historySearchQuery{min-width:0;flex:1}#historySearchSubmit{white-space:nowrap;font-size:12px}
#historySearchStatus{padding:5px 18px;font-size:12px;line-height:1.7}
#historySearchResults{padding:0 18px;max-height:48vh;overflow:auto;overscroll-behavior:contain}
.history-search-result{display:block;text-align:left;width:100%;padding:13px 12px;border:1px solid #e4ebf5;border-radius:8px;background:#f8fbff;margin:10px 0;overflow-wrap:anywhere}
.history-search-result>span,.history-search-result>small{font-size:11px;color:#6c83a3}.history-search-result>p{white-space:pre-wrap;font-size:13px;line-height:1.7;margin:7px 0;max-height:180px;overflow:auto}
.history-search-result:focus-visible{outline:2px solid #2864e7;outline-offset:2px}#historySearchDialog>footer{padding:13px 18px;display:flex;justify-content:flex-end}
.history-search-selected .message-bubble{outline:2px solid #5b94ee;outline-offset:3px}
@media(max-width:650px){#historySearchForm>div{flex-wrap:wrap}#historySearchSubmit{margin-left:auto}.message-search-bar{flex-wrap:wrap}}
.customer-grid .customer-cell{flex-wrap:wrap}.customer-grid .customer-lifecycle{display:block;flex-basis:100%;padding-left:38px;font-size:10px;color:#8b9db6;overflow:hidden;text-overflow:ellipsis}

/* Administrator configuration forms. */
[data-admin-panel="lifecycle"] fieldset>label,[data-admin-panel="ai"] fieldset>label{margin:12px 0}
#lifecycleRows,#aiEmployeeRows{margin:20px 0}#lifecycleStatus,#aiStatus{font-size:13px;line-height:1.8;overflow-wrap:anywhere}
#lifecycleStageColor{height:40px;max-width:120px}#lifecycleSettingsFields>button,#lifecycleStageFields>div,#aiCreateFields>button{margin-top:14px}
.ai-config-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:20px}.ai-config-fields label{min-width:0}.ai-config-fields textarea{display:block;width:100%;resize:vertical;font:inherit;font-size:13px;border:1px solid var(--line);border-radius:7px;padding:10px;margin-top:7px;min-height:90px}.ai-config-fields label:has(textarea){grid-column:1/-1}#aiEditor>h3{margin-top:24px}#aiEditor .admin-header-actions{flex-wrap:wrap}
@media(max-width:650px){.ai-config-fields{grid-template-columns:1fr}}

#groupsStatus{font-size:13px;line-height:1.8;overflow-wrap:anywhere}.group-device-label{display:block;max-width:520px;margin:18px 0;font-size:13px}.group-device-label select{display:block;width:100%;margin-top:8px}[data-admin-panel="groups"] fieldset>label{margin:12px 0}[data-admin-panel="groups"] textarea{display:block;width:100%;resize:vertical;border:1px solid var(--line);border-radius:7px;padding:10px;font:inherit;font-size:13px;margin-top:7px}[data-admin-panel="groups"] fieldset>button{margin-top:12px}

#knowledgeApp textarea,#toolsApp textarea,.skill-card textarea{display:block;width:100%;font:inherit;font-size:13px;padding:9px;border:1px solid var(--line);border-radius:7px;resize:vertical;margin:7px 0}#knowledgeApp fieldset>label,#toolsApp fieldset>label{margin:12px 0}#kbStatus,#toolsStatus{font-size:13px;line-height:1.8;overflow-wrap:anywhere}#toolsApp table input,#toolsApp table select{min-width:110px}#toolsApp section{margin:20px 0}.skill-card{padding:18px;border:1px solid var(--line);border-radius:8px;margin:15px 0;background:#f9fbff}.skill-card>label{margin:12px 0}.skill-parameter,.skill-step{display:flex;flex-wrap:wrap;gap:10px;border-bottom:1px solid var(--line);padding:12px 0}.skill-parameter label,.skill-step label{min-width:110px;flex:1}.skill-card h4,#aiParts h4{font-size:13px;margin:15px 0 10px}#aiParts>h3{margin-top:24px}#aiParts{margin-bottom:20px}#aiVersions{margin:15px 0}

#aiRuntime{border-top:1px solid var(--line);margin-top:25px;padding-top:15px}#aiRuntimeStatus{font-size:13px;line-height:1.8}#aiRuntime pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:300px;overflow:auto;padding:10px;background:#f4f7fc;border-radius:7px;font-size:12px}#aiRuntime details{margin:12px 0;padding:10px;border:1px solid var(--line);border-radius:7px}#aiRuntime textarea{display:block;width:100%;padding:10px;font:inherit;border:1px solid var(--line);border-radius:7px}#aiRuntime fieldset>label{margin:12px 0}#aiMemoryRows td{max-width:250px;white-space:pre-wrap;overflow-wrap:anywhere}

.custom-view-label{display:flex;align-items:center;gap:8px;font-size:11px;color:#879bb7;margin:8px 0}.custom-view-label select{min-width:0;flex:1;font-size:11px;padding:7px;border:1px solid var(--line);border-radius:5px}#viewsStatus{font-size:13px;line-height:1.8}#viewsApp fieldset>label{margin:12px 0}#viewChannels,#viewMembers{margin:15px 0}

#toolTestResult{white-space:pre-wrap;overflow-wrap:anywhere;max-height:350px;overflow:auto;background:#f4f7fc;padding:12px;border-radius:7px;font-size:12px}#toolTestResult:empty{display:none}#toolReview>h3{margin-top:24px}

#kbUrlPreview{white-space:pre-wrap;overflow-wrap:anywhere;max-height:350px;overflow:auto;background:#f4f7fc;padding:12px;border-radius:7px;font-size:12px}#kbUrlPreview:empty{display:none}

/* ---- 2026-10-20 可读性与聊天体验调整 ---- */
/* 我方消息蓝底白字，与客户消息区分 */
.outbound .message-bubble{background:#2563eb;border-color:#2563eb;color:#fff}
.outbound .message-bubble a{color:#fff;text-decoration:underline}
.outbound .message-bubble .quoted-message{background:#ffffff26;color:#eef4ff;border-color:#ffffff59}
.outbound .message-bubble .message-translation{color:#dbe7ff;border-top-color:#ffffff40}
/* 头像：去掉不代表真实在线状态的绿点，字母头像按客户分配颜色 */
.avatar:after{display:none}
.avatar-letter{display:grid;place-items:center;width:100%;height:100%;border-radius:50%;color:#fff;font-weight:600}
.tone-0{background:#2563eb}.tone-1{background:#0f8a7e}.tone-2{background:#7c4dce}.tone-3{background:#c2541a}
.tone-4{background:#b8326b}.tone-5{background:#3d6b1f}.tone-6{background:#0e7490}.tone-7{background:#5b5f97}
.message-avatar{background:#64748b}
.outbound .message-avatar{background:#1e40af}
/* 最小字号 12px，浅灰文字加深 */
.conv-time,.badge,.view-note,.message-meta,.message-meta button,.chat-heading small,.keyboard-hint,.conv-channel,.conv-type{font-size:12px}
.conv-time{color:#5f6b7c}
.view-note,.keyboard-hint{color:#647184}
.chat-heading small{color:#5f6b7c}
.message-meta{color:#5f6b7c}
.message-meta button{color:#2f5fb3}
.message-translation{color:#4f5d72;font-size:12.5px}
.badge{background:#d92d3a;color:#fff}
.empty{color:#5f6b7c;font-size:13px}
/* 键盘焦点统一为蓝色，输入框获得焦点时有明显光圈 */
:focus-visible{outline:2px solid #2563eb;outline-offset:2px}
input:focus,textarea:focus,select:focus,.search-box input:focus{outline:none;box-shadow:0 0 0 3px #2563eb40!important;border-color:#2563eb}
/* 消息操作按钮在悬停或键盘聚焦时显示；触屏设备保持常显 */
@media (hover:hover){
 .message-meta button{opacity:0;transition:opacity .12s}
 .message-group:hover .message-meta button,.message-group:focus-within .message-meta button{opacity:1}
}
/* 输入框至少约 3 行 */
.composer textarea{min-height:66px}
/* 往上翻阅时的新消息提示 */
.new-messages-jump{position:absolute;top:-44px;left:50%;transform:translateX(-50%);z-index:5;border:0;border-radius:999px;background:#2563eb;color:#fff;font-size:13px;padding:7px 16px;box-shadow:0 4px 14px #1e3a8a40;cursor:pointer}
.new-messages-jump:hover{background:#1d4ed8}
.new-messages-jump[hidden]{display:none}
/* 提示条：错误红色、可点击关闭 */
#toast{cursor:pointer}
#toast.toast-error{background:#b42318;color:#fff}

/* ---- 2026-10-20 第二批 ---- */
/* 视图栏 SVG 图标 */
.view-icon{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;display:block}
.view-icon .fill{fill:#d92d3a;stroke:none}
/* 聊天头部：一行放得下时只占一行，放不下自动换行 */
.chat-heading{height:auto;min-height:60px;align-content:center;padding:10px 14px}
/* 表情面板贴在输入区上方，不再写死距离 */
.emoji-picker{bottom:calc(100% + 8px);top:auto;left:10px;flex-wrap:wrap;max-width:min(340px,calc(100% - 20px))}
/* 输入框随内容增高，最多约 8 行 */
.composer textarea{resize:none;max-height:190px;overflow-y:auto;font-size:13px;line-height:1.6}
/* 加载骨架 */
.skeleton-list{padding:8px 10px}
.skeleton-row{display:flex;align-items:center;gap:10px;padding:10px 4px}
.skeleton-dot{width:34px;height:34px;border-radius:50%;flex-shrink:0}
.skeleton-lines{flex:1;display:grid;gap:7px}
.skeleton-lines i{display:block;height:10px;border-radius:5px}
.skeleton-lines i:last-child{width:60%}
.skeleton-dot,.skeleton-lines i{background:linear-gradient(90deg,#eef2f8 25%,#e2e8f2 50%,#eef2f8 75%);background-size:200% 100%;animation:skeleton-shimmer 1.2s infinite linear}
@keyframes skeleton-shimmer{from{background-position:200% 0}to{background-position:-200% 0}}
@media (prefers-reduced-motion:reduce){.skeleton-dot,.skeleton-lines i{animation:none}}
/* 提醒开关、译文显示方式 */
.alert-toggle{font-size:12px;color:#2f5fb3;white-space:nowrap;padding:4px 8px;border-radius:6px}
.alert-toggle[aria-pressed="false"]{color:#647184}
.alert-toggle:hover{background:#eef3ff}
.translation-mode{height:30px;font-size:12px;padding:0 6px;border-radius:6px;border:1px solid #dfe5ee;background:#fff;color:#3e4654}
.translation-label{display:inline-block;font-size:11px;line-height:1;padding:3px 5px;margin-right:6px;border-radius:4px;background:#eef2f8;color:#4f5d72;vertical-align:1px}
.translation-label.inline{margin:0 0 0 6px}
.outbound .message-bubble .translation-label{background:#ffffff2e;color:#fff}
/* 客户表格：首列冻结；屏幕较窄时隐藏次要列，减少横向滚动 */
.customer-grid th:first-child,.customer-grid td:first-child{position:sticky;left:0;z-index:1;background:#fff;box-shadow:1px 0 0 #edf0f5}
.customer-grid th:first-child{z-index:3;background:#f7f9fc}
/* 社媒渠道、语言在客户详情中可见；时间列只在很窄时隐藏"最后更新" */
@media (max-width:1600px){
 .customer-grid{min-width:1200px}
 .customer-grid th:nth-child(4),.customer-grid td:nth-child(4),
 .customer-grid th:nth-child(7),.customer-grid td:nth-child(7){display:none}
}
@media (max-width:1100px){
 .customer-grid{min-width:1030px}
 .customer-grid th:nth-child(10),.customer-grid td:nth-child(10){display:none}
}

/* ---- 手机宽度：客户表格改为卡片 ---- */
@media (max-width:650px){
 .customer-grid,.customer-grid tbody,.customer-grid tr,.customer-grid td{display:block;min-width:0;width:auto}
 .customer-grid{min-width:0!important}
 .customer-grid thead{display:none}
 .customer-grid tr{margin:0 0 10px;border:1px solid #e6ebf3;border-radius:10px;background:#fff;padding:6px 12px}
 .customer-grid td,.customer-grid td:nth-child(n){display:flex;gap:12px;justify-content:space-between;align-items:center;height:auto;min-height:34px;padding:6px 0;border:0;border-top:1px solid #f1f4f8;white-space:normal;position:static;box-shadow:none;text-align:right}
 .customer-grid td:first-child{border-top:0}
 .customer-grid td::before{content:attr(data-label);color:#647184;font-size:12px;flex-shrink:0;text-align:left}
 .customer-grid td:nth-child(4),.customer-grid td:nth-child(7),.customer-grid td:nth-child(10){display:none}
}

/* 启动时在登录状态返回前显示，避免空白页 */
.boot-loading{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;gap:10px;font-size:14px;color:#4f5d72;background:#f5f8fd;z-index:50}
.boot-spinner{width:18px;height:18px;border-radius:50%;border:2px solid #c9d6ea;border-top-color:#2563eb;animation:boot-spin .8s linear infinite}
@keyframes boot-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.boot-spinner{animation:none}}

.usage-warning{color:#b42318;background:#fef3f2;border:1px solid #fecdca;border-radius:6px;padding:8px 10px;font-size:13px}
.admin-usage h3,.admin-errors h3{font-size:14px;margin:16px 0 8px}
