/* Team Chat — global widgets (sidebar badge + notification toast)
   Loaded from dashboard.html so they work on any page. */

.tc-nav-badge {
    display: inline-block;
    margin-left: auto;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.4;
}
.sidebar.collapsed .tc-nav-badge {
    position: absolute;
    top: 6px; right: 6px;
    margin: 0;
}

.tcg-toast-root {
    position: fixed;
    top: 80px;
    right: 22px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.tcg-toast {
    pointer-events: auto;
    width: 340px;
    background: #fff;
    color: #1e293b;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(15,23,42,0.18), 0 4px 10px rgba(15,23,42,0.06);
    padding: 12px 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.32s cubic-bezier(.2,.8,.2,1), opacity 0.2s;
    border-left: 4px solid #3b82f6;
    position: relative;
    overflow: hidden;
}
.tcg-toast.show { transform: translateX(0); opacity: 1; }
.tcg-toast::after {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 100%;
    background: linear-gradient(135deg, rgba(59,130,246,0.08), transparent 60%);
    pointer-events: none;
}
.tcg-toast-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
    flex-shrink: 0;
    overflow: hidden;
    text-transform: uppercase;
}
.tcg-toast-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tcg-toast-body { flex: 1; min-width: 0; }
.tcg-toast-title {
    font-weight: 600;
    font-size: 13.5px;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.tcg-toast-group {
    font-size: 10.5px;
    color: #2563eb;
    background: #dbeafe;
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: 500;
}
.tcg-toast-group i { margin-right: 3px; font-size: 9px; }
.tcg-toast-msg {
    font-size: 12.5px;
    color: #475569;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.35;
    word-break: break-word;
}
.tcg-toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    padding: 2px 6px;
    border-radius: 50%;
    font-size: 12px;
    flex-shrink: 0;
}
.tcg-toast-close:hover { background: #f1f5f9; color: #1e293b; }

/* Header icon — bubble + pulse on incoming */
#teamChatBtn { position: relative; }
#teamChatBtn .tcg-header-badge {
    position: absolute;
    top: 4px; right: 4px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 10px;
    min-width: 16px;
    height: 16px;
    line-height: 14px;
    text-align: center;
    border: 2px solid #fff;
    display: none;
    align-items: center;
    justify-content: center;
}
#teamChatBtn.has-unread i {
    color: #3b82f6;
}
#teamChatBtn.tcg-pulse {
    animation: tcgPulse 0.85s ease-in-out;
}
@keyframes tcgPulse {
    0%   { transform: scale(1); }
    20%  { transform: scale(1.18) rotate(-8deg); }
    40%  { transform: scale(1.05) rotate(8deg); }
    60%  { transform: scale(1.12) rotate(-4deg); }
    100% { transform: scale(1) rotate(0); }
}
#teamChatBtn.tcg-pulse i {
    color: #3b82f6;
}
