.chat-app-container{display:flex;height:calc(100vh - 80px);min-height:560px;background:#fff;border-radius:16px;box-shadow:0 4px 20px #0f172a0f;border:1px solid #e2e8f0;overflow:hidden;position:relative;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.portal-chat-wrapper{width:100%;box-sizing:border-box}.portal-chat-wrapper .chat-app-container{height:calc(100vh - 120px);width:100%;margin:0}.chat-sidebar{width:360px;min-width:320px;max-width:400px;border-right:1px solid #f1f5f9;display:flex;flex-direction:column;background:#fff;transition:all .25s ease;z-index:10}.chat-sidebar-header{padding:16px 20px 12px;border-bottom:1px solid #f1f5f9;background:#fff}.chat-sidebar-title-row{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.chat-sidebar-title-row h3{margin:0;font-size:18px;font-weight:800;color:#0f172a;display:flex;align-items:center;gap:8px}.chat-sidebar-actions{display:flex;align-items:center;gap:8px}.chat-action-btn{display:inline-flex;align-items:center;justify-content:center;gap:5px;padding:6px 12px;font-size:12px;font-weight:700;border-radius:8px;border:1px solid #e2e8f0;background:#f8fafc;color:#334155;cursor:pointer;transition:all .15s ease}.chat-action-btn:hover{background:#eff6ff;border-color:#bfdbfe;color:#2563eb}.chat-action-btn.primary{background:#2563eb;border-color:#2563eb;color:#fff}.chat-action-btn.primary:hover{background:#1d4ed8}.chat-search-wrap{position:relative;margin-bottom:10px}.chat-search-input{width:100%;box-sizing:border-box;padding:9px 12px 9px 34px;font-size:13px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:10px;color:#1e293b;outline:none;transition:all .2s}.chat-search-input:focus{background:#fff;border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f61f}.chat-search-icon{position:absolute;left:10px;top:50%;transform:translateY(-50%);font-size:14px;color:#94a3b8;pointer-events:none}.chat-filter-tabs{display:flex;gap:4px;background:#f1f5f9;padding:3px;border-radius:10px}.chat-filter-tab{flex:1;text-align:center;padding:6px 4px;font-size:11.5px;font-weight:700;color:#64748b;background:transparent;border:none;border-radius:7px;cursor:pointer;transition:all .15s;display:flex;align-items:center;justify-content:center;gap:4px}.chat-filter-tab.active{background:#fff;color:#2563eb;box-shadow:0 2px 5px #0000000f}.chat-filter-badge{background:#ef4444;color:#fff;font-size:9.5px;font-weight:800;padding:1px 5px;border-radius:10px}.chat-list-container{flex:1;overflow-y:auto;padding:8px 10px}.chat-list-empty{text-align:center;padding:40px 16px;color:#94a3b8}.chat-list-empty-icon{font-size:32px;margin-bottom:8px}.chat-item{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:12px;cursor:pointer;transition:background .15s ease;margin-bottom:3px;border:1px solid transparent}.chat-item:hover{background:#f8fafc}.chat-item.active{background:#eff6ff;border-color:#dbeafe}.chat-avatar{width:44px;height:44px;border-radius:50%;background:linear-gradient(135deg,#3b82f6,#1d4ed8);color:#fff;display:flex;align-items:center;justify-content:center;font-size:15px;font-weight:800;flex-shrink:0;position:relative;box-shadow:0 2px 6px #2563eb33}.chat-avatar.group{background:linear-gradient(135deg,#8b5cf6,#6d28d9)}.chat-avatar.contractor{background:linear-gradient(135deg,#059669,#047857)}.chat-avatar.admin{background:linear-gradient(135deg,#dc2626,#b91c1c)}.chat-online-dot{position:absolute;bottom:1px;right:1px;width:10px;height:10px;border-radius:50%;background:#22c55e;border:2px solid #ffffff}.chat-item-content{flex:1;min-width:0}.chat-item-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:3px}.chat-item-name{font-size:13.5px;font-weight:700;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-item.active .chat-item-name{color:#1e40af}.chat-item-time{font-size:11px;color:#94a3b8;flex-shrink:0;margin-left:6px}.chat-item-footer{display:flex;align-items:center;justify-content:space-between}.chat-item-preview{font-size:12px;color:#64748b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1}.chat-item-badges{display:flex;align-items:center;gap:4px;margin-left:6px}.chat-role-pill{font-size:9.5px;font-weight:700;padding:1px 6px;border-radius:8px;text-transform:uppercase;letter-spacing:.3px}.chat-role-pill.emp{background:#f1f5f9;color:#475569}.chat-role-pill.mgr{background:#e0e7ff;color:#3730a3}.chat-role-pill.admin{background:#fee2e2;color:#991b1b}.chat-role-pill.contr{background:#dcfce7;color:#166534}.chat-unread-badge{background:#2563eb;color:#fff;font-size:10px;font-weight:800;padding:2px 6px;border-radius:10px;min-width:14px;text-align:center}.chat-section-divider{font-size:11px;font-weight:800;color:#94a3b8;text-transform:uppercase;letter-spacing:.6px;padding:10px 10px 4px}.chat-main{flex:1;display:flex;flex-direction:column;background:#f8fafc;position:relative;min-width:0}.chat-main-header{height:64px;padding:0 20px;background:#fff;border-bottom:1px solid #e2e8f0;display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;z-index:5}.chat-header-user-info{display:flex;align-items:center;gap:12px;min-width:0}.chat-back-btn{display:none;align-items:center;justify-content:center;width:34px;height:34px;border-radius:8px;border:1px solid #e2e8f0;background:#fff;cursor:pointer;font-size:16px;color:#334155;flex-shrink:0}.chat-header-details{min-width:0}.chat-header-name{font-size:15px;font-weight:800;color:#0f172a;display:flex;align-items:center;gap:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-header-sub{font-size:11.5px;color:#64748b;display:flex;align-items:center;gap:6px}.chat-messages-viewport{flex:1;overflow-y:auto;padding:20px;display:flex;flex-direction:column;gap:10px;background-color:#f8fafc;background-image:radial-gradient(#e2e8f0 .75px,transparent .75px);background-size:20px 20px}.chat-date-separator{align-self:center;background:#e2e8f0;color:#475569;font-size:11px;font-weight:700;padding:3px 12px;border-radius:20px;margin:8px 0}.chat-bubble-row{display:flex;flex-direction:column;max-width:72%}.chat-bubble-row.mine{align-self:flex-end;align-items:flex-end}.chat-bubble-row.other{align-self:flex-start;align-items:flex-start}.chat-bubble-sender{font-size:11px;font-weight:700;color:#475569;margin-bottom:2px;margin-left:6px;display:flex;align-items:center;gap:4px}.chat-bubble{padding:10px 14px;border-radius:16px;font-size:13.5px;line-height:1.45;position:relative;word-break:break-word;box-shadow:0 1px 3px #0000000a}.chat-bubble-row.mine .chat-bubble{background:#2563eb;color:#fff;border-bottom-right-radius:4px}.chat-bubble-row.other .chat-bubble{background:#fff;color:#1e293b;border:1px solid #e2e8f0;border-bottom-left-radius:4px}.chat-bubble-time{font-size:10px;margin-top:4px;text-align:right;display:flex;align-items:center;justify-content:flex-end;gap:4px}.chat-bubble-row.mine .chat-bubble-time{color:#ffffffbf}.chat-bubble-row.other .chat-bubble-time{color:#94a3b8}.chat-empty-state{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 20px;text-align:center;color:#64748b}.chat-empty-icon{width:70px;height:70px;border-radius:20px;background:#eff6ff;color:#2563eb;display:flex;align-items:center;justify-content:center;font-size:32px;margin-bottom:16px;border:1px solid #bfdbfe}.chat-input-bar{padding:14px 20px;background:#fff;border-top:1px solid #e2e8f0;display:flex;align-items:center;gap:10px}.chat-input-field{flex:1;padding:11px 16px;font-size:13.5px;background:#f8fafc;border:1px solid #cbd5e1;border-radius:22px;outline:none;resize:none;color:#1e293b;font-family:inherit;line-height:1.4;max-height:100px;transition:all .2s}.chat-input-field:focus{background:#fff;border-color:#2563eb;box-shadow:0 0 0 3px #2563eb1f}.chat-send-btn{width:44px;height:44px;border-radius:50%;background:#2563eb;color:#fff;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:18px;transition:all .2s;box-shadow:0 4px 10px #2563eb4d;flex-shrink:0}.chat-send-btn:hover{background:#1d4ed8;transform:scale(1.05)}.chat-send-btn:active{transform:scale(.96)}.chat-send-btn:disabled{background:#94a3b8;cursor:not-allowed;box-shadow:none;transform:none}.chat-modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:#0f172aa6;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;z-index:10000;padding:16px}.chat-modal-card{background:#fff;border-radius:18px;width:100%;max-width:580px;max-height:90vh;display:flex;flex-direction:column;box-shadow:0 25px 50px -12px #00000040;border:1px solid #e2e8f0;overflow:hidden;animation:chatModalIn .2s cubic-bezier(.16,1,.3,1)}@keyframes chatModalIn{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}.chat-modal-header{padding:20px 24px;border-bottom:1px solid #f1f5f9;display:flex;align-items:center;justify-content:space-between}.chat-modal-header h3{margin:0;font-size:18px;font-weight:800;color:#0f172a}.chat-modal-close{background:none;border:none;font-size:20px;color:#94a3b8;cursor:pointer;padding:4px;border-radius:6px}.chat-modal-close:hover{color:#0f172a;background:#f1f5f9}.chat-modal-body{padding:20px 24px;overflow-y:auto;flex:1}.chat-modal-footer{padding:16px 24px;border-top:1px solid #f1f5f9;background:#f8fafc;display:flex;align-items:center;justify-content:flex-end;gap:10px}.chat-settings-section{background:#f8fafc;border:1px solid #e2e8f0;border-radius:12px;padding:16px;margin-bottom:16px}.chat-settings-section-title{font-size:13.5px;font-weight:800;color:#0f172a;margin-bottom:4px;display:flex;align-items:center;gap:6px}.chat-settings-section-desc{font-size:12px;color:#64748b;margin-bottom:12px;line-height:1.4}.chat-checkbox-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:10px}.chat-toggle-item{display:flex;align-items:center;gap:10px;background:#fff;padding:10px 12px;border-radius:8px;border:1px solid #e2e8f0;cursor:pointer;-webkit-user-select:none;user-select:none;transition:all .15s}.chat-toggle-item:hover{border-color:#3b82f6;background:#eff6ff}.chat-toggle-item input[type=checkbox]{width:17px;height:17px;accent-color:#2563eb;cursor:pointer}.chat-toggle-label{font-size:12.5px;font-weight:600;color:#334155;flex:1}.chat-participant-item{display:flex;align-items:center;gap:12px;padding:8px 10px;border-radius:8px;cursor:pointer;transition:background .15s}.chat-participant-item:hover{background:#f1f5f9}@media (max-width: 768px){.chat-app-container{height:calc(100vh - 110px);border-radius:0;border:none}.chat-sidebar{width:100%;max-width:100%}.chat-main{display:none;width:100%}.chat-app-container.mobile-thread-open .chat-sidebar{display:none}.chat-app-container.mobile-thread-open .chat-main{display:flex}.chat-back-btn{display:inline-flex}.chat-bubble-row{max-width:86%}}
