/* Admin-only inbox layout; customer support keeps its existing presentation. */
body[data-admin-section="tickets"] .admin-hero{padding-top:8px;padding-bottom:16px;margin-bottom:0;min-height:0}
body[data-admin-section="tickets"] .admin-hero h1{font-size:28px;margin:5px 0 6px}
body[data-admin-section="tickets"] .admin-hero p{margin:0}
body[data-admin-section="tickets"] #refresh{display:none}
body[data-admin-section="tickets"] .ticket-notice{padding:10px 16px;margin-bottom:14px;gap:10px;font-size:12px}
body[data-admin-section="tickets"] #ticket-new-alert p{display:none}
body[data-admin-section="tickets"] .ticket-notice button{padding:7px 10px;font-size:11px}
#overview-tickets .service-desk{overflow:hidden}
#overview-tickets .service-desk-head{padding:17px 20px;margin:0;align-items:center;border-bottom:0}
#overview-tickets .service-desk-head h2{font-size:16px}
#overview-tickets .service-desk-head p{font-size:11px;margin:5px 0 0}
#overview-tickets #ticket-stats{display:flex;gap:4px;margin:0;padding:0 16px;border-bottom:1px solid #dfe6ef;overflow-x:auto;scrollbar-width:thin}
#overview-tickets .desk-status-tabs button{display:flex;align-items:center;gap:7px;flex:none;border:0;border-bottom:3px solid transparent;border-radius:0;padding:13px 10px;background:transparent;color:#64748b;font:inherit;font-size:12px;white-space:nowrap;cursor:pointer}
#overview-tickets .desk-status-tabs button b{padding:2px 6px;background:#edf1f6;border-radius:5px;font-size:11px}
#overview-tickets .desk-status-tabs button[aria-pressed="true"]{border-bottom-color:#326bd4;color:#2456b0;font-weight:700}
#overview-tickets .desk-status-tabs button[aria-pressed="true"] b{background:#e5eeff;color:#2456b0}
#overview-tickets .desk-status-tabs button:hover{background:#f6f9fd}
#overview-tickets .desk-status-tabs button:focus-visible{outline:2px solid #326bd4;outline-offset:-3px}
#overview-tickets .ticket-toolbar{display:flex;gap:12px;align-items:end;padding:16px 20px 10px;margin:0}
#overview-tickets .ticket-toolbar .desk-search{flex:1;min-width:120px;margin:0}
#overview-tickets .ticket-toolbar .desk-search input{min-width:0;width:100%;height:40px}
#overview-tickets .ticket-sort-field{display:grid;gap:5px;min-width:210px;flex:0 1 230px;font-size:10px;color:#6c7b90}
#overview-tickets .ticket-sort-field select{width:100%;height:40px;margin:0;padding:8px 10px;border:1px solid #d8e1ed;border-radius:8px;background:white;color:#354b69;font:inherit;font-size:12px}
#overview-tickets #refresh-tickets{min-height:40px;white-space:nowrap}
#overview-tickets .desk-list-meta{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;padding:8px 20px 14px;font-size:11px;color:#7b889a}
#overview-tickets .desk-list-count{color:#485e7a;font-weight:600}
#overview-tickets #ticket-risk-summary{margin-left:auto}
#overview-tickets .service-desk-grid{grid-template-columns:minmax(260px,32%) minmax(0,1fr);gap:0;padding:0;border-top:1px solid #e0e7f0;align-items:stretch}
#overview-tickets #ticket-list{position:static;border:0;border-radius:0;max-height:none;background:#f9fbfd;min-width:0}
#overview-tickets .ticket-row{display:grid;grid-template-columns:4px minmax(0,1fr);gap:10px;padding:17px 16px;border:0;border-bottom:1px solid #e4eaf2;border-left:3px solid transparent;border-radius:0;background:transparent;text-align:left}
#overview-tickets .ticket-row.is-selected{background:#eaf2ff;border-left-color:#326bd4}
#overview-tickets .ticket-row.is-unread:not(.is-selected){background:#f0f5ff;border-left-color:#9ab9ef}
#overview-tickets .ticket-row:hover{background:#edf3fb}
#overview-tickets .ticket-priority{grid-row:1/3;height:100%;min-height:20px}
#overview-tickets .ticket-row-main{min-width:0;gap:7px}
#overview-tickets .ticket-row-main>small{font-size:10px;line-height:1.6}
#overview-tickets .ticket-row-main strong{font-size:13px;line-height:1.5}
#overview-tickets .ticket-row-main>span{font-size:10px;line-height:1.6;overflow-wrap:anywhere}
#overview-tickets .ticket-row-meta{grid-column:2;display:flex;flex-direction:row;justify-content:space-between;align-items:center;flex-wrap:wrap;text-align:left}
#overview-tickets .ticket-row-meta small{font-size:10px}
#overview-tickets #ticket-detail{border:0;border-left:1px solid #dfe6ef;border-radius:0;min-height:480px}
#overview-tickets .tk-detail-head{padding:18px 22px}
#overview-tickets .tk-detail-head h3{font-size:19px;margin:9px 0}
#overview-tickets .tk-detail-actions{margin-top:12px}
#overview-tickets .tk-detail-actions button{padding:6px 9px;font-size:10px}
#overview-tickets .desk-ticket-management{border-bottom:1px solid #e4ebf4;background:#f8fafd}
#overview-tickets .desk-ticket-management>summary{padding:12px 22px;cursor:pointer;font-size:11px;color:#48607e;line-height:1.8}
#overview-tickets .desk-ticket-management>summary span{margin-left:14px;color:#738299;overflow-wrap:anywhere}
#overview-tickets .desk-ticket-management output:not(:empty){display:block;padding:10px 22px;color:#865d29;font-size:12px}
#overview-tickets .tk-manage{padding:14px 22px;border:0}
#overview-tickets .tk-thread-heading{padding:16px 22px 0}
#overview-tickets .tk-conversation{padding:18px 22px;gap:18px;max-height:420px;min-height:110px}
#overview-tickets .tk-message-body{padding:12px 15px;font-size:12px}
#overview-tickets .tk-composer{padding:18px 22px;gap:10px}
#overview-tickets .tk-mode-switch{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:start}
#overview-tickets .tk-mode-switch label,#overview-tickets .tk-mode-switch select{min-width:0;width:100%;box-sizing:border-box;font-size:11px}
#overview-tickets .tk-composer textarea{min-height:82px;padding:10px 12px}
#overview-tickets .tk-compose-footer .primary{font-size:12px;padding:10px 14px}
#overview-tickets .tk-history{padding:13px 22px}
body[data-admin-role="viewer"] #overview-tickets .desk-ticket-management{display:none}
@media(min-width:1001px){
 #overview-tickets .service-desk-grid{height:clamp(620px,calc(100dvh - 350px),900px)}
 #overview-tickets #ticket-list,#overview-tickets #ticket-detail{overflow:auto;overscroll-behavior:contain;height:100%;min-height:0;scrollbar-width:thin}
}
@media(min-width:761px) and (max-width:1000px){#overview-tickets .service-desk-grid{grid-template-columns:minmax(225px,34%) minmax(0,1fr)}#overview-tickets .ticket-row{padding:14px 10px}#overview-tickets .ticket-toolbar{flex-wrap:wrap}#overview-tickets .tk-mode-switch{grid-template-columns:1fr}}
@media(max-width:760px){
 body[data-admin-section="tickets"] .admin-hero{padding:0 0 14px}
 body[data-admin-section="tickets"] .admin-hero h1{font-size:24px}
 body[data-admin-section="tickets"] .admin-hero p{font-size:12px}
 body[data-admin-section="tickets"] .ticket-notice{padding:10px 12px}
 #overview-tickets .service-desk-head{padding:14px;gap:10px}
 #overview-tickets .service-desk-head p{display:none}
 #overview-tickets #open-ticket-create{font-size:11px;padding:9px}
 #overview-tickets #ticket-stats{padding:0 5px}
 #overview-tickets .desk-status-tabs button{padding:11px 8px;font-size:11px}
 #overview-tickets .ticket-toolbar{padding:12px 14px 6px;flex-wrap:wrap;gap:9px}
 #overview-tickets .ticket-toolbar .desk-search{flex-basis:100%}
 #overview-tickets .ticket-sort-field{min-width:0;flex:1}
 #overview-tickets #refresh-tickets{font-size:0;padding:9px 11px}
 #overview-tickets #refresh-tickets svg{width:18px;height:18px}
 #overview-tickets .desk-list-meta{padding:8px 14px 12px;font-size:10px}
 #overview-tickets #ticket-risk-summary{margin-left:0}
 #overview-tickets .service-desk-grid{grid-template-columns:1fr;padding:0;gap:0}
 #overview-tickets #ticket-detail{border:0;min-height:0}
 #overview-tickets.tk-show-detail :is(.desk-list-meta,.service-desk-head){display:none}
 #overview-tickets .tk-detail-head,#overview-tickets .tk-composer{padding:16px}
 #overview-tickets .tk-mode-switch{grid-template-columns:1fr}
 #overview-tickets .tk-conversation{padding:16px}
 #overview-tickets .tk-thread-heading{padding:16px 16px 0}
 #overview-tickets .desk-ticket-management>summary{padding:12px 16px}
 #overview-tickets .desk-ticket-management>summary span{display:block;margin-left:14px}
 #overview-tickets .tk-compose-footer{align-items:stretch;flex-direction:column}
}

/* Keep one page heading and one primary action. */
body:not([data-admin-section="tickets"]) #open-ticket-create{display:none}
#overview-tickets .service-desk-head{display:none}
#overview-tickets .ticket-toolbar .ticket-sort-field{padding:0;border:0;border-radius:0;background:transparent}
#overview-tickets .ticket-toolbar .desk-search input{border:0;background:transparent;box-shadow:none}
#overview-tickets .ticket-toolbar .desk-search:focus-within{outline:2px solid #b5cfff;outline-offset:1px}
#overview-tickets .ticket-toolbar .desk-search input:focus{outline:0}
@media(max-width:760px){body[data-admin-section="tickets"] .hero-actions{margin-top:12px}body[data-admin-section="tickets"] #open-ticket-create{font-size:12px;padding:10px 13px}}
#overview-tickets .ticket-row-main strong{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
@media(max-width:760px){body[data-admin-section="tickets"] .admin-hero{gap:8px}body[data-admin-section="tickets"] .hero-actions{margin-top:0}#overview-tickets .service-desk-grid{min-height:0}}

#overview-tickets .ticket-owner{color:#61728b;white-space:normal;font-size:11px;line-height:1.5}
#overview-tickets .ticket-owner.is-mine{color:#2456b0;font-weight:650}
#overview-tickets .tk-detail-actions #ticket-assign-me{font-size:12px;padding:9px 13px}
#overview-tickets #ticket-claim-message:not(:empty){display:block;margin-top:10px;font-size:12px;line-height:1.5;color:#485e7a}
