/* Tiên Giới Truyện 3D — CSKH V4.1.0 | Staff UI refresh, closed archive and unified composer */
:root{--bg:#0b1422;--panel:#102036;--line:#344b63;--gold:#e7b86a;--text:#f6eddd}
.app-shell{background:#091423}
.sidebar{background:linear-gradient(180deg,#0b1b34 0%,#0b1727 100%);border-color:#3b4b60;padding:15px 8px}
.header{background:linear-gradient(105deg,#102c56 0%,#102345 58%,#0e1c34 100%);border-bottom:1px solid #476181;box-shadow:none}
.header h1{color:#f8d18a}
.panel{border-radius:15px;box-shadow:0 7px 22px #09101a1a;overflow:hidden}
.dashboard,.dashboard.info-open{gap:11px}
.dashboard.info-closed{gap:11px}
.list-panel{background:#f9fbff;color:#1d354d;border-color:#b6c7d7}
.list-panel .panel-head{background:#f4f7fc;padding:12px 13px}
.list-panel .panel-head h2{font-weight:800}
.inbox-tabs{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:10px 10px 7px;background:#f7f9fd;border-bottom:1px solid #d8e2ef}
.inbox-tab{display:flex;align-items:center;justify-content:center;gap:7px;min-width:0;padding:9px 5px;border-radius:10px;border:1px solid #ced9e7;background:#fff;color:#405975;font-size:12px;font-weight:700;white-space:nowrap}
.inbox-tab.active{background:linear-gradient(105deg,#153c71,#245c92);border-color:#295b8b;color:#fff;box-shadow:0 3px 8px #183f7822}
.inbox-tab #archive-badge{min-width:18px;padding:1px 5px;background:#e9be78;color:#243954;border-radius:999px;font-size:11px}
.thread-row{position:relative;display:flex;align-items:stretch;border-bottom:1px solid #e1e8f1}
.list-panel .thread-row .thread{width:100%;min-width:0;border-bottom:0;flex:1;padding:12px 9px 11px;background:#fff}
.list-panel .thread-row .thread.selected{background:#e2efff;border-left:3px solid #377dbc;padding-left:6px}
.list-panel .thread-row .thread:hover{background:#ecf5ff}
.list-panel .archive-thread .thread{padding-right:5px}
.list-panel .thread-info strong{font-size:14px;color:#243f62}
.list-panel .thread-info small{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.archive-delete{align-self:center;flex:0 0 auto;margin-right:9px;border:1px solid #eac1bb;background:#fff5f3;color:#a54238;border-radius:8px;min-width:29px;min-height:30px;font-weight:800;font-size:14px}
.archive-delete:hover{background:#ffddd9}
.archive-pager{background:#f3f6fa;border-top:1px solid #d9e3ee;padding:9px 11px;color:#596f86;font-size:11px}
.archive-pager[hidden]{display:none}
.archive-hint{line-height:1.45}
.archive-pagination{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:4px}
.archive-pagination button{border:1px solid #b4cbe0;border-radius:6px;padding:4px 8px;color:#194d7e;background:#fff}
.archive-pagination button:disabled{opacity:.4}
.chat-panel{background:#f1f5fa;border:1px solid #bdcada;display:flex;flex-direction:column;min-height:0}
.chat-panel .empty{color:#74869c}
.conv-head{background:#f9fbff;border-bottom:1px solid #d4e0ec;color:#1c3a58;padding:12px 17px;min-height:68px}
.conv-head .conv-title{color:#153c68;font-weight:800}
.conv-head small{color:#627891}
.conv-head .toolbar{gap:6px}
.conv-head .btn{border-radius:9px;padding:8px 11px}
.conv-head .delete-closed{color:#ad443b;border-color:#df9c98;background:#fff6f4}
.messages{background:radial-gradient(circle at 28% 20%,#ffffffc9,transparent 43%),linear-gradient(170deg,#eff5fa,#e4edf5);gap:11px;padding:19px 35px 22px}
.bubble,.bubble.staff{max-width:min(74%,680px);padding:11px 14px;box-shadow:0 3px 12px #3c52621c;border-radius:15px;border:1px solid #d4e0ea;min-width:130px}
.bubble{background:#fff;color:#24384e;border-bottom-left-radius:5px}
.bubble.staff{background:#fff0d3;color:#3c3d35;border:1px solid #efd6a6;border-bottom-right-radius:5px}
.bubble .bubble-head,.bubble.staff .bubble-head{color:#647d92;font-size:11px}
.bubble.staff .bubble-head{color:#856528}
.bubble time,.bubble.staff time{color:#71859c}
.bubble-body{font-size:14px;line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere;color:#24384e}
.bubble.staff .bubble-body{color:#3b392d}
.bubble .manage{display:flex;gap:13px;margin-top:7px;opacity:1}
.bubble .manage button{color:#637f9a;font-size:11px}
.bubble.staff .manage button{color:#846d4f}
.bubble .tg-media-anchor{display:block;max-width:min(100%,380px);margin:7px 0 3px;border:1px solid #d7dfeb;border-radius:10px;overflow:hidden;background:#f4f8fc}
.bubble .tg-chat-image{display:block;max-width:100%;max-height:340px;width:auto;height:auto;object-fit:contain;border-radius:8px;cursor:zoom-in}
.bubble.staff .tg-media-anchor{background:#fff8e9;border-color:#e5c897}
.composer{padding:11px 15px 14px;display:flex!important;flex-direction:column;gap:9px;background:#fcfdff;border-top:1px solid #cedae7;flex:0 0 auto}
.composer .shortcuts{display:flex;gap:6px;padding:0 0 1px;overflow-x:auto;max-height:none;flex-wrap:nowrap;scrollbar-width:thin;width:100%;min-height:30px}
.composer .shortcut{background:#eef3fb;border:1px solid #d2e0ed;color:#345a7e;border-radius:999px;padding:6px 11px;white-space:nowrap;flex:0 0 auto;font-size:11px}
.compose-input{display:flex;gap:8px;align-items:stretch;width:100%;min-width:0}
.composer textarea{flex:1;grid-column:auto;grid-row:auto;width:100%;min-width:0;height:66px;min-height:62px;resize:vertical;max-height:160px;color:#243a50;background:#fff;border:1px solid #adc5d8;border-radius:11px;padding:12px 13px;font-size:13px}
.composer textarea::placeholder{color:#7b8c9d}
.composer .tg-photo-button{flex:0 0 auto;min-width:88px;min-height:62px!important;height:auto;grid-column:auto;grid-row:auto;display:flex;justify-content:center;align-items:center;gap:4px;background:#eaf2fc;border:1px solid #b4cbe2;border-radius:10px;color:#245580!important;font-weight:700;white-space:nowrap;padding:8px 12px}
.composer .tg-photo-button:hover{background:#dcecfb}
.composer .tg-photo-input{display:none}
.composer .tg-photo-preview{grid-column:auto;grid-row:auto;display:none;align-items:center;gap:10px;padding:9px 11px;border:1px dashed #b4cbe0;background:#f2f8fe;border-radius:11px;color:#264b69;font-size:12px;min-width:0}
.composer .tg-photo-preview.has-file{display:flex}
.composer .tg-photo-preview img{width:88px;height:66px;max-width:88px;max-height:66px;object-fit:contain;border-radius:8px;background:#fff}
.composer .tg-photo-preview span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.composer .preview-remove{flex:0 0 auto;color:#ab4a40;background:#fff0ec;border:1px solid #e5b5ae;border-radius:8px;padding:8px;font-size:12px}
.composer .composer-actions{grid-column:auto;grid-row:auto;display:flex;align-items:center;justify-content:space-between;gap:9px;width:100%;min-width:0}
.composer .composer-actions small{display:block;color:#70849a;flex:1;font-size:11px;line-height:1.4}
.composer .composer-actions .btn{background:linear-gradient(95deg,#d2a354,#efc97e);color:#2b2b25;border:1px solid #ce9b48;border-radius:10px;width:auto;min-width:150px;font-size:13px;font-weight:800;padding:10px 14px;box-shadow:0 3px 8px #a0732733}
.composer .composer-actions .btn:hover{filter:brightness(1.04)}
.archive-closed-banner{background:#fff8e8;color:#766244;border-top:1px solid #e3d3ae;padding:15px 20px;font-size:13px;line-height:1.5}
.customer-panel{background:#f8fbff;border-color:#b2c5d7;color:#20364f}
.customer-panel .panel-head{background:#f1f6fb}
.customer-panel .customer{color:#233e56}
@media(max-width:1250px){.dashboard,.dashboard.info-open,.dashboard.info-closed{grid-template-columns:minmax(220px,285px) minmax(0,1fr)}.customer-panel{display:none!important}.dashboard.info-open .customer-panel{display:flex!important}}
@media(max-width:880px){
 .app-shell{display:block;min-height:100dvh;height:auto;overflow:visible}
 .header{height:auto;min-height:0}
 .main{padding:9px}
 .dashboard,.dashboard.info-open,.dashboard.info-closed{grid-template-columns:1fr;min-height:65dvh;gap:0}
 .dashboard.show-detail .chat-panel{height:calc(100dvh - 205px);min-height:470px;max-height:none}
 .dashboard.show-detail .messages{padding:13px 15px;min-height:0;max-height:none;flex:1}
 .bubble,.bubble.staff{max-width:90%;font-size:12px}
 .composer{padding:9px}
 .composer .composer-actions .btn{min-width:112px}
 .composer .composer-actions small{font-size:10px}
 .inbox-tab{font-size:12px}
}
@media(max-width:430px){
 .dashboard.show-detail .chat-panel{height:calc(100dvh - 220px);min-height:460px}
 .composer .tg-photo-button{min-width:69px;padding:7px!important;font-size:12px!important}
 .composer textarea{min-height:55px;height:60px}
 .composer .composer-actions .btn{min-width:104px;font-size:12px;padding:9px 11px}
 .bubble .tg-chat-image{max-height:250px}
 .inbox-tab{font-size:11px}
}
