/* Workbench spacing and sort controls checked against the QuickCEP Tickets reference. */
.tsla-workbench .tickets-sidebar{background:#fafafa}
.tsla-workbench .ticket-mode-row{height:69px}
.tsla-workbench .ticket-mode-row .segmented button.active{box-shadow:none}
.tsla-workbench .new-conversation-ticket{margin:16px 0 13px}
.tsla-workbench .tickets-menu>button{color:#62656d}
.tsla-workbench .tickets-menu>button.active{color:#212429;background:#faf0e9}
.tsla-workbench .tickets-menu>button.active .ticket-icon{color:#f60}
.tsla-workbench .ticket-menu-label{display:flex;align-items:center;justify-content:space-between;height:38px;padding-top:13px;padding-bottom:0}
.tsla-menu-edit{height:22px;width:24px}
.tsla-workbench .tickets-list h2{height:42px}
.tsla-workbench .ticket-list-toolbar{margin-bottom:10px}
.tsla-workbench .ticket-list-toolbar>div:last-child{padding-right:20px;gap:16px}
.tsla-workbench .ticket-list-toolbar .button{font-size:13px;color:#555;line-height:20px;padding:0 8px;border-color:#d9d9d9;border-radius:5px}
.tsla-workbench .ticket-list-toolbar .tsla-refresh{width:48px;justify-content:center}
.tsla-workbench .tickets-table{min-width:1504px;color:#24262b;font-size:13px}
.tsla-workbench .tickets-table th{background:#f7f7f7;color:#161719;height:46px}
.tsla-workbench .tickets-table td{height:56px}
.tsla-workbench .tickets-table th:first-child,.tsla-workbench .tickets-table td:first-child{width:42px}
.tsla-workbench .tickets-table .col-subject{width:270px}
.tsla-workbench .tickets-table .col-status{width:160px}
.tsla-workbench .tickets-table .col-sla{width:218px}
.tsla-workbench .tickets-table .col-priority,.tsla-workbench .tickets-table .col-requester,.tsla-workbench .tickets-table .col-recent,.tsla-workbench .tickets-table .col-created{width:160px}
.tsla-workbench .ticket-subject{color:#2861ff;font-size:13px}
.tsla-workbench .ticket-status-badge{font-size:13px;background:#e8f2ff;color:#10141c;padding:6px 11px;line-height:18px;border-radius:10px}
.tsla-workbench .ticket-status-badge[data-ticket-status="处理中"]{background:#cfddff}
.tsla-workbench .ticket-status-badge[data-ticket-status="待回访"]{background:#f6efff}
.tsla-workbench .ticket-status-badge[data-ticket-status="已解决"]{background:#d1f8e1}
.tsla-workbench .ticket-status-badge[data-ticket-status="已关闭归档"]{background:#eee}
.tsla-workbench .tickets-table input[type="checkbox"]{appearance:none;width:16px;height:16px;border:1px solid #d9d9d9;border-radius:4px;background:#fff;vertical-align:middle}
.tsla-workbench .tickets-table input[type="checkbox"]:checked{background:#f60;border-color:#f60}
.tsla-workbench .tickets-table input[type="checkbox"]:checked:after{content:"";display:block;width:8px;height:4px;border-left:2px solid white;border-bottom:2px solid white;transform:rotate(-45deg);margin:3px 0 0 2px}
.tsla-trashed td{opacity:.54}
.tsla-workbench .ticket-pagination{height:55px;color:#151515;gap:6px}
.tsla-workbench .ticket-pagination select{padding:0 5px;color:#151515}
.tsla-badge{display:inline-block;padding:2px 9px;border-radius:8px;font-size:13px;white-space:nowrap;line-height:20px}
.tsla-late{background:#fbe2da;color:#ff4d39}
.tsla-due{background:#fef1dc;color:#b86a16}
.tsla-workbench .button.tsla-active,.tsla-view-dialog .button.tsla-active{color:#f60;background:#fff5ed;border-color:#ffbd95}
.tsla-sort-panel{position:absolute;z-index:54;width:526px;max-width:calc(100% - 20px);border-radius:8px;background:#fff;box-shadow:0 5px 24px #0002,0 1px 5px #00000009;padding:14px 16px 26px;color:#242424;text-align:left}
.tsla-workbench .tsla-sort-panel{left:80px;top:92px}
.tsla-panel-head{display:flex;align-items:center;justify-content:space-between;height:21px;color:#999;margin:0 0 14px;font-size:14px}
.tsla-panel-head:only-child{margin:0}
.tsla-add-field{display:flex;align-items:center;gap:3px;font-size:13px;color:#2861ff}
.tsla-add-field:disabled{color:#bfbfbf;cursor:default}
.tsla-add-field .ticket-icon{width:12px;height:12px}
.tsla-sort-row{display:grid;grid-template-columns:12px minmax(90px,1fr) 94px 22px;gap:12px;align-items:center;min-height:38px;border-radius:6px}
.tsla-sort-row+.tsla-sort-row{margin-top:16px}
.tsla-sort-row.dragging{opacity:.45}
.tsla-sort-row.drop-target{box-shadow:0 -2px #ff6600}
.tsla-grip,.tsla-remove{border:0;background:transparent;padding:0;display:grid;place-items:center;color:#bfbfbf;height:28px;min-width:0}
.tsla-grip{cursor:grab}
.tsla-grip:active{cursor:grabbing}
.tsla-remove:hover{color:#f60}
.tsla-sort-field-wrap{position:relative;min-width:0}
.tsla-sort-field{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;height:32px;border:1px solid #d9d9d9;border-radius:6px;background:#fff;color:#484848;font-size:14px;padding:0 10px;text-align:left}
.tsla-sort-field:focus-visible,.tsla-search-field{outline:none;border-color:#f60}
.tsla-sort-field .ticket-icon{width:13px;height:13px;color:#a6a6a6}
.tsla-placeholder{color:#bbb}
.tsla-search-field input{border:0;outline:none;min-width:0;background:white;flex:1;padding:0;color:#222}
.tsla-search-field input::placeholder{color:#bfbfbf}
.tsla-sort-options{position:absolute;top:36px;left:0;right:0;z-index:55;max-height:264px;overflow-y:auto;padding:4px;border-radius:7px;background:#fff;box-shadow:0 5px 20px #0002;scrollbar-width:thin}
.tsla-sort-options button{width:100%;line-height:32px;min-height:32px;display:block;border:0;background:#fff;color:#222;text-align:left;border-radius:4px;padding:0 11px;font-size:14px}
.tsla-sort-options button:hover{background:#f4f4f4}
.tsla-sort-options button[aria-selected=true]{background:#fff4e7}
.tsla-options-upward{bottom:36px;top:auto}
.tsla-sort-options button:disabled,.tsla-no-options{color:#bfbfbf}
.tsla-no-options{padding:8px 10px}
.tsla-directions{box-sizing:border-box;display:grid;grid-template-columns:1fr 1fr;height:38px;padding:2px;border:1px solid #e5e7eb;border-radius:9px;background:#f5f5f5}
.tsla-directions button{border:0;background:transparent;border-radius:7px;color:#8f8f8f;font-size:14px;padding:0}
.tsla-directions button[aria-pressed=true]{background:#fff;box-shadow:0 1px 4px #c9ccd6;color:#f60}
.tsla-directions.locked button{color:#a9a9a9;cursor:not-allowed;opacity:1}
.tsla-directions.locked button[aria-pressed=true]{color:#666;background:#e9eaed;box-shadow:0 1px 2px #d7d9de}
.tsla-work-filter{position:absolute;top:92px;left:10px;z-index:53;width:min(872px,calc(100% - 20px));padding:24px 26px;background:#fff;border-radius:8px;box-shadow:0 5px 24px #0002}
.tsla-condition-group{background:#f7f7f7;border-radius:8px;padding:24px}
.tsla-condition-row{display:grid;grid-template-columns:minmax(130px,200px) minmax(115px,140px) minmax(105px,1fr) 16px;gap:10px;align-items:center}
.tsla-condition-row .control{width:100%;min-width:0;height:32px;text-align:left;font-size:13px}
.tsla-condition-add{margin-top:9px;color:#2861ff}
.tsla-condition-start{margin-top:0;color:#2861ff;box-shadow:0 3px 15px #3557ad26;border-color:#fff}
.tsla-condition-group~.tsla-condition-start{margin-top:22px}
.tsla-condition-and{font-size:12px;color:#b0b0b0;padding:8px 0}
.tsla-or{display:flex;align-items:center;gap:16px;color:#13b3b9;margin:16px 0}
.tsla-or:before,.tsla-or:after{content:"";height:1px;flex:1;background:#e4e7ec}
.tsla-or span{background:#e4fbfb;border-radius:6px;padding:3px 7px}
.tsla-filter-footer{margin-top:26px;display:flex;gap:10px}
.tsla-settings-page.settings-page{padding:0 0 4px;gap:0}
.tsla-settings-page.settings-page>.segmented{display:inline-flex;margin:0 0 16px;border-radius:7px}
.tsla-settings-page.settings-page>.segmented>button{padding:0 19px!important}
.tsla-settings-page.settings-page>.segmented>button:after{display:none!important}
.tsla-settings-content{padding:24px;min-height:calc(100vh - 116px)}
.tsla-settings-toolbar{display:flex;align-items:center;gap:16px;margin-bottom:24px}
.tsla-settings-toolbar input,.tsla-settings-toolbar select{width:240px;height:32px}
.tsla-settings-toolbar select{width:272px}
.tsla-settings-toolbar .outline{color:#f60;border-color:#f60}
.tsla-settings-table{width:100%;table-layout:fixed;border-spacing:0;text-align:left}
.tsla-settings-table th,.tsla-settings-table td{padding:0 16px;height:46px;text-align:left;font-weight:400;border:0}
.tsla-settings-table th{background:#f7f7f7;color:#141414}
.tsla-settings-table th:nth-child(1){width:37%}
.tsla-settings-table th:nth-child(2){width:18%}
.tsla-settings-table th:nth-child(3){width:27%}
.tsla-settings-table .plain{color:#2861ff}
.tsla-settings-table td i{height:12px;border-left:1px solid #ddd;display:inline-block;margin:0 8px}
.tsla-shade{position:fixed;inset:0;background:#0008;z-index:300;display:grid;place-items:center;padding:18px}
.tsla-view-dialog{position:relative;background:#fff;border-radius:12px;width:min(990px,100%);max-height:calc(100vh - 36px);color:#181818;display:flex;flex-direction:column}
.tsla-view-dialog.compact{width:min(420px,100%)}
.tsla-view-dialog header{display:flex;justify-content:space-between;align-items:center;height:60px;padding:0 25px;flex:none;font-size:17px}
.tsla-view-dialog header strong{font-weight:550}
.tsla-view-dialog header .icon-button{font-size:20px;color:#202020;height:26px;width:26px}
.tsla-dialog-body{padding:31px 42px 4px;overflow:auto}
.tsla-view-dialog.compact .tsla-dialog-body{padding:6px 25px 4px}
.tsla-form-label{display:block;margin-bottom:10px}
.tsla-form-label em{font-style:normal;color:#f44}
.tsla-dialog-body>.control{width:100%;height:32px;font-size:14px}
.tsla-form-section{margin-top:28px}
.tsla-form-section .button{height:32px}
.tsla-form-section .ticket-icon{margin-right:4px}
.tsla-form-anchor{position:relative}
.tsla-info{font-style:normal;color:#989da3}
.tsla-skill-row{display:flex;gap:20px}
.tsla-skill-row input{accent-color:#f60;vertical-align:-2px}
.tsla-skill-options{padding:12px 0 0 16px}
.tsla-view-dialog footer{display:flex;justify-content:flex-end;gap:16px;padding:42px 22px 20px;flex:none}
.tsla-view-dialog.compact footer{padding-top:18px}
.tsla-view-dialog footer .button,.tsla-filter-footer .button{height:32px;min-width:64px}
.tsla-view-dialog .tsla-sort-panel{position:fixed;left:0;top:0;width:min(526px,calc(100vw - 24px));bottom:auto}
.tsla-view-dialog .tsla-sort-panel .tsla-sort-options{max-height:230px}
.tsla-view-fields{position:absolute;left:0;bottom:38px;width:220px;padding:12px;background:#fff;border-radius:7px;box-shadow:0 5px 24px #0002;z-index:53}
.tsla-field-head{color:#73777d;margin-bottom:4px}
.tsla-view-fields .plain{display:flex;align-items:center;justify-content:space-between;width:100%;height:29px;text-align:left}
.tsla-view-fields .plain .icon{width:16px;height:16px}
.tsla-error{color:#f44;margin-top:16px}
.tsla-demo{width:306px;padding:14px}
.tsla-demo h3{margin:0 0 10px;font-size:16px}
.tsla-demo label{display:block;margin-bottom:10px}
.tsla-demo .control{display:block;width:100%;height:31px;margin-top:4px}
.tsla-demo-actions{display:grid;gap:6px}
.tsla-demo p{margin:9px 0 0}
@media(max-width:850px){
 .tsla-workbench .tsla-sort-panel{left:10px}
 .tsla-sort-row{gap:6px}
 .tsla-settings-toolbar input,.tsla-settings-toolbar select{width:150px}
}

.tsla-condition-picker{position:relative;min-width:0}
.tsla-condition-trigger{width:100%;height:32px;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 11px;color:#262626;background:#fff;border:1px solid #d9d9d9;border-radius:6px;font:inherit;text-align:left}
.tsla-condition-trigger>span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.tsla-condition-trigger.is-placeholder,.tsla-condition-trigger input::placeholder{color:#bfbfbf}
.tsla-condition-trigger.is-open,.tsla-condition-trigger:focus-visible{border-color:#f60;outline:none}
.tsla-condition-trigger .ticket-icon{width:13px;height:13px;color:#b5b5b5}
.tsla-condition-trigger input:focus{box-shadow:none}
.tsla-condition-trigger input{flex:1;width:0;min-width:0;outline:none;border:0;background:#fff;color:#262626;padding:0;font:inherit}
.tsla-condition-options{position:fixed;z-index:59;background:#fff;border-radius:8px;box-shadow:0 6px 20px #0002,0 3px 6px #0000000d;overflow:auto;scrollbar-width:thin;scrollbar-color:#dedede transparent;padding:4px 8px}
.tsla-condition-options button{display:block;width:100%;height:32px;padding:0 8px;border:0;border-radius:4px;text-align:left;background:#fff;color:#262626;font:inherit;white-space:nowrap}
.tsla-condition-options button:hover,.tsla-condition-options button:focus-visible{background:#f4f4f4;outline:none}
.tsla-condition-options button[aria-selected=true]{background:#fff4e7}
.tsla-condition-option-group{height:32px;padding:0 8px;display:flex;align-items:center;color:#999;font-size:12px}
.tsla-condition-option-group~button[data-part="field"]{padding-left:24px}
.tsla-condition-empty{display:grid;justify-items:center;align-content:center;gap:8px;height:90px;color:#999}
.tsla-skill-row label{display:inline-flex;align-items:center;gap:8px}
.tsla-skill-row input[type="radio"]{appearance:none;position:relative;flex:none;width:16px;height:16px;margin:0;border-radius:50%;border:1px solid #d9d9d9;background:#fff;cursor:pointer}
.tsla-skill-row input[type="radio"]:checked{border-color:#f60}
.tsla-skill-row input[type="radio"]:checked::after{position:absolute;inset:3px;content:"";border-radius:50%;background:#f60}
.tsla-skill-row input[type="radio"]:focus-visible{outline:2px solid #ffdbc3;outline-offset:1px}
.tsla-chat-sort-anchor{position:relative;flex:none}
.tsla-chat-sort{position:absolute;z-index:62;left:-16px;top:-66px;width:min(277px,calc(100vw - 16px));border-radius:8px;box-shadow:0 6px 24px #0002;background:#fff;padding:14px 16px 18px;color:#444}
.tsla-chat-sort-label{font-size:12px;color:#bfbfbf;line-height:18px}
.tsla-chat-sort-row{display:flex;align-items:center;justify-content:space-between;min-height:20px;margin-top:3px}
.tsla-chat-sort-row>span,.tsla-chat-sort-current>span{display:flex;align-items:center;gap:7px}
.tsla-chat-sort-row .switch{width:28px;height:16px;min-width:28px;border:0;background:#bfbfbf}
.tsla-chat-sort-row .switch::after{content:"";position:absolute;top:2px;left:2px;width:12px;height:12px;background:#fff;border-radius:50%;transform:none}
.tsla-chat-sort-row .switch.on{background:#f60}
.tsla-chat-sort-row .switch.on::after{left:14px;transform:none}
.tsla-chat-sort p{margin:4px 0 18px 24px;font-size:11px;color:#9b9b9b}
.tsla-chat-sort hr{border:0;border-top:1px dashed #e7e7e7;margin:0 0 16px}
.tsla-chat-sort-current{padding:6px 10px 8px;border-radius:8px;background:#fff4ed;color:#503d32}
.tsla-chat-sort-current small{display:block;color:#9c9c9c;font-size:11px;line-height:16px;margin:1px 0 0 25px}
.tsla-chat-timer{position:absolute;z-index:3;left:8px;top:49px;display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 8px;border-radius:6px;color:#fa8c16;background:#fff;box-shadow:0 2px 8px #0002;font:12px/1 Arial,sans-serif;font-variant-numeric:tabular-nums;pointer-events:none}
.tsla-chat-timer[data-expired=true]{color:#ff2639}
.tsla-chat-timer[hidden]{display:none}


.tsla-skill-picker{margin-top:18px}
.tsla-skill-trigger{height:auto;min-height:32px;padding:2px 5px;justify-content:flex-start;flex-wrap:wrap;gap:4px}
.tsla-skill-trigger input{min-width:50px;flex:1;height:24px;padding:0 5px}
.tsla-skill-arrow{display:grid;place-items:center;width:23px;height:24px;padding:0;border:0;background:transparent;cursor:pointer}
.tsla-skill-chip{display:inline-flex;align-items:center;gap:4px;padding:1px 4px 1px 7px;height:24px;border-radius:3px;border:1px solid #ededed;background:#f5f5f5;white-space:nowrap}
.tsla-skill-chip button{display:grid;place-items:center;width:15px;height:17px;padding:0;border:0;background:transparent;color:#999;line-height:1;cursor:pointer}
.tsla-skill-chip button:hover{color:#383838}
.tsla-skill-menu{padding:4px}
.tsla-skill-menu button{display:flex;align-items:center;justify-content:space-between;padding:0 10px 0 12px}
.tsla-skill-menu button[aria-selected=true]{background:#fff4e6}
.tsla-skill-menu .ticket-icon{color:#f60;margin:0}

@media(min-height:760px){
 .tsla-view-dialog:has(.tsla-skill-menu) .tsla-dialog-body{overflow:visible}
 .tsla-skill-picker{position:relative}
 .tsla-skill-picker .tsla-skill-menu{position:absolute;top:calc(100% + 4px)!important;left:0!important;width:100%!important}
}
