:root{--blue:#0f49b7;--cyan:#11a8ee;--bg:#f3f6fb;--line:#dce5f0;--text:#17304f;--muted:#6d7c90;--green:#2b9d6f;--danger:#c63d4a}*{box-sizing:border-box}html,body{margin:0;font-family:Arial,Helvetica,sans-serif;color:var(--text);background:var(--bg)}button,input,select,textarea{font:inherit}a{color:var(--blue);text-decoration:none}.btn{border:1px solid var(--line);background:white;color:var(--text);padding:10px 14px;border-radius:9px;cursor:pointer;font-weight:700}.btn.primary{background:var(--blue);color:white;border-color:var(--blue)}.btn.secondary{background:#eef3f9}.btn.sm{padding:7px 10px;font-size:13px}.full{width:100%}.hidden{display:none!important}.muted{color:var(--muted)}.pad{padding:16px}.auth-page{min-height:100vh;display:grid;place-items:center;padding:24px;background:linear-gradient(145deg,#eef8ff,#f7f9fd)}.auth-card{width:min(460px,100%);background:white;border-radius:22px;padding:32px;box-shadow:0 20px 60px #17304f1f;border:1px solid #e8eef5}.auth-logo{width:100%;max-height:130px;object-fit:contain}.auth-card h1{text-align:center;margin:20px 0 6px;color:var(--blue)}.auth-card>p{text-align:center;color:var(--muted)}label{display:grid;gap:6px;margin:14px 0;font-weight:700}input,select,textarea{width:100%;border:1px solid #cfd9e6;border-radius:9px;padding:11px 12px;background:white;color:var(--text)}input:focus,select:focus,textarea:focus{outline:2px solid #12a8ee33;border-color:var(--cyan)}small{font-weight:400;color:var(--muted)}.alert{padding:12px 14px;border-radius:10px;margin:14px 0}.alert.success{background:#eaf8f1;color:#176848}.alert.danger{background:#fdecee;color:#9d2734}.topbar{height:74px;background:white;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:8px 24px}.brand-mini img{height:54px;max-width:360px;object-fit:contain}.topbar nav{display:flex;gap:18px;font-weight:700}.page{max-width:1280px;margin:28px auto;padding:0 20px}.page.narrow{max-width:760px}.panel{background:white;border:1px solid var(--line);border-radius:16px;padding:20px;box-shadow:0 8px 24px #17304f0b}.profile-panel{display:grid;grid-template-columns:180px 1fr;gap:28px;align-items:start}.avatar{width:42px;height:42px;border-radius:50%;object-fit:cover;background:#dfeaf8}.avatar.sm{width:32px;height:32px}.avatar.xl{width:150px;height:150px;border-radius:18px}.tabs{display:flex;gap:8px;margin-bottom:18px}.tabs a{background:white;border:1px solid var(--line);padding:10px 14px;border-radius:9px;font-weight:700}.tabs a.active{background:var(--blue);color:white}.admin-grid{display:grid;grid-template-columns:360px 1fr;gap:20px}.table-wrap{overflow:auto}table{border-collapse:collapse;width:100%}th,td{text-align:left;border-bottom:1px solid var(--line);padding:10px;vertical-align:middle}th{font-size:13px;color:var(--muted)}.inline{display:inline}.actions{white-space:nowrap}.usercell{display:flex;align-items:center;gap:8px}.chat-body{overflow:hidden}.app-shell{height:100vh;display:grid;grid-template-columns:360px 1fr;background:white}.sidebar{display:grid;grid-template-rows:auto 1fr auto;border-right:1px solid var(--line);min-width:0}.sidebar-head{padding:14px;border-bottom:1px solid var(--line)}.sidebar-head>img{width:100%;height:72px;object-fit:contain;margin-bottom:10px}.me{display:flex;gap:10px;align-items:center}.me div{min-width:0}.me strong,.me small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.quick-actions{display:flex;gap:8px;margin:12px 0}.search{padding:10px 12px}.conversation-list{overflow:auto}.conversation{width:100%;border:0;border-bottom:1px solid #edf1f6;background:white;padding:12px;display:grid;grid-template-columns:48px 1fr auto;gap:10px;text-align:left;cursor:pointer}.conversation:hover,.conversation.active{background:#eff7ff}.conv-icon{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;background:#eaf4ff;font-size:22px;overflow:hidden}.conv-icon img{width:100%;height:100%;object-fit:cover}.conv-text{min-width:0}.conv-text>div{display:flex;justify-content:space-between;gap:8px}.conv-text strong,.conv-text p{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.conv-text p{margin:5px 0 0;color:var(--muted);font-size:13px}.conv-text time{font-size:11px;color:var(--muted);white-space:nowrap}.badge{align-self:center;background:var(--cyan);color:white;border-radius:20px;min-width:22px;height:22px;padding:0 6px;display:grid;place-items:center;font-size:12px}.sidebar-foot{display:flex;gap:14px;flex-wrap:wrap;padding:14px;border-top:1px solid var(--line);font-size:13px;font-weight:700}.chat-main{background:#f4f7fb;min-width:0}.empty-state{height:100%;display:grid;place-items:center;text-align:center;color:var(--muted)}.bubble-mark{font-size:52px}.chat-pane{height:100vh;display:grid;grid-template-rows:72px 1fr auto auto}.chat-header{background:white;border-bottom:1px solid var(--line);display:flex;align-items:center;padding:0 20px}.chat-header h2{margin:0 0 4px}.messages{padding:22px;overflow:auto;background:linear-gradient(#f4f7fb,#eef4fa)}.msg-row{display:flex;margin:8px 0}.msg-row.mine{justify-content:flex-end}.msg{max-width:min(720px,82%);background:white;border:1px solid #e1e8f0;border-radius:14px 14px 14px 4px;padding:10px 12px;box-shadow:0 2px 8px #17304f0b;line-height:1.4}.mine .msg{background:#dcf1ff;border-color:#c4e8ff;border-radius:14px 14px 4px 14px}.msg b{display:block;font-size:12px;color:var(--blue);margin-bottom:4px}.msg time{display:block;text-align:right;font-size:10px;color:var(--muted);margin-top:4px}.attachment{display:block;margin-top:8px;padding:9px 10px;background:#ffffffaa;border:1px solid var(--line);border-radius:8px;font-weight:700}.composer{background:white;border-top:1px solid var(--line);padding:12px;display:grid;grid-template-columns:44px 1fr auto;gap:8px;align-items:end}.composer textarea{resize:none;min-height:44px;max-height:120px}.attach-btn{width:44px;height:44px;margin:0;border:1px solid var(--line);border-radius:9px;display:grid;place-items:center;cursor:pointer;font-size:20px}.attach-btn input{display:none}#fileHint{grid-column:2/-1}.modal{position:fixed;inset:0;background:#10243a8c;display:grid;place-items:center;padding:20px;z-index:10}.modal-card{position:relative;width:min(560px,100%);max-height:85vh;overflow:auto;background:white;border-radius:16px;padding:22px}.close{position:absolute;right:12px;top:8px;border:0;background:transparent;font-size:30px;cursor:pointer}.picker{display:grid;gap:4px;margin-top:12px}.pick-user,.check-user{border:1px solid var(--line);background:white;border-radius:10px;padding:9px;display:flex;gap:10px;align-items:center;text-align:left;cursor:pointer}.pick-user span,.check-user span{display:grid}.pick-user small,.check-user small{display:block}.check-user input{width:auto}.checks{max-height:340px;overflow:auto}@media(max-width:800px){.app-shell{grid-template-columns:130px 1fr}.sidebar-head>img{height:45px}.me div,.quick-actions,.search,.conv-text,.badge,.sidebar-foot a{display:none}.sidebar-foot{justify-content:center}.conversation{grid-template-columns:1fr;padding:10px}.conv-icon{margin:auto}.admin-grid{grid-template-columns:1fr}.profile-panel{grid-template-columns:1fr}.topbar{padding:8px 12px}.topbar nav{gap:10px;font-size:13px}.brand-mini img{max-width:180px}.msg{max-width:92%}}@media(max-width:520px){.app-shell{grid-template-columns:82px 1fr}.sidebar-head{padding:8px}.conversation{padding:8px}.chat-header{padding:0 12px}.messages{padding:12px}.composer{grid-template-columns:40px 1fr}.composer .btn{grid-column:2}.attach-btn{width:40px;height:40px}.auth-card{padding:22px}.topbar nav a:nth-child(2){display:none}}
/* SEMECT Chat 1.6 */
.chat-body{--blue:var(--user-primary,#0f49b7);--bg:var(--user-chat-bg,#f4f7fb)}
.chat-main{background:var(--user-chat-bg,#f4f7fb)}
.messages{background:var(--user-chat-bg,#f4f7fb)}
.msg{background:var(--user-other,#fff)}
.mine .msg{background:var(--user-mine,#dcf1ff)}
.header-avatar{width:48px;height:48px;margin-right:12px;flex:0 0 auto}.chat-head-text{min-width:0;flex:1}.chat-head-text h2,.chat-head-text small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}.avatar-wrap,.conv-icon{position:relative}.online-dot{width:11px;height:11px;border-radius:50%;background:#24b36b;border:2px solid white;position:absolute;right:0;bottom:0}.inline-dot{position:static;display:inline-block;vertical-align:-1px;border:0;width:9px;height:9px;margin-right:4px}
.message-editor{min-height:44px;max-height:120px;overflow:auto;border:1px solid #cfd9e6;border-radius:9px;padding:11px 12px;background:#fff;outline:none;font-family:Arial,Helvetica,sans-serif;font-size:14px;resize:none}.message-editor:focus{outline:2px solid #12a8ee33;border-color:var(--cyan)}.composer{grid-template-columns:44px 1fr auto}.composer #fileHint{grid-column:2/-1}.msg-top{display:flex;align-items:center;justify-content:space-between;gap:12px}.msg-delete{border:0;background:transparent;opacity:.5;cursor:pointer;font-size:13px;padding:0}.msg-delete:hover{opacity:1}.msg-body{overflow-wrap:anywhere}.msg-body a{color:#0a5fc4;text-decoration:underline}.msg-meta{display:flex;justify-content:flex-end;align-items:center;gap:7px;margin-top:5px}.msg-meta time{margin:0}.read-state{font-size:10px;color:#51677f}.deleted{font-style:italic;color:#78879a}.deleted-note{font-size:13px}.theme-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 16px}.theme-grid label{margin:6px 0}.theme-grid input[type=color]{height:44px;padding:4px}.chat-header .btn{margin-left:10px}
@media(max-width:700px){.theme-grid{grid-template-columns:1fr}.chat-header h2{font-size:16px}.header-avatar{width:42px;height:42px}.composer{grid-template-columns:40px 1fr}.composer .btn{grid-column:2}}
