    /* Chat header default holatda yashirin */
    #chat-header-content {
        visibility: hidden;
    }

    /* Chat tayyor bo‘lganda ko‘rsatamiz */
    body.chat-ready #chat-header-content {
        visibility: visible;
    }


    /* Sticky header joyi */
    .chat-sticky-date {
        position: sticky;
        top: 0;
        z-index: 5;
        background: #FEF3E1;
        text-align: center;
        font-size: 0.8rem;
        padding: 5px 0;
        border-bottom: 1px solid #e1e1e1;
    }

    .chat-date-divider {
        text-align: center;
        font-size: 0.8rem;
        margin: 10px 0;
        position: relative;
    }
    .chat-date-divider::before,
    .chat-date-divider::after {
        content: "";
        position: absolute;
        top: 50%;
        width: 35%;
        height: 1px;
        background: #ccc;
    }
    .chat-date-divider::before { left: 0; }
    .chat-date-divider::after { right: 0; }
    .chat-date-divider span {
        padding: 0 10px;
    }

    .chat-list .odd .chat-message {
      border-radius: 8px;
    }
    .chat-list .chat-group .chat-message {
      border-radius: 8px;}
    .file-msg {color: #fff;}

    /* === Avatar wrapper (existing .avatar-md ishlatiladi) === */
    .avatar-md {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* === Status dot (default: hidden) === */
    .avatar-md .status-dot {
        position: absolute;
        right: 0.1em;
        bottom: 0.1em;

        width: clamp(8px, 0.6em, 10px);
        height: clamp(8px, 0.6em, 10px);

        border-radius: 50%;
        background-color: #adb5bd;
        border: 2px solid #fff;

        opacity: 0;
        transform: scale(0.6);
        transition:
            opacity 0.2s ease,
            transform 0.2s ease,
            background-color 0.2s ease;
    }

    /* === ONLINE === */
    .avatar-md.chat-avatar-online .status-dot {
        opacity: 1;
        transform: scale(1);
        background-color: #28c76f;
        animation: status-pulse 1.8s infinite ease-in-out;
    }

    /* === OFFLINE === */
    .avatar-md.chat-avatar-offline .status-dot {
        opacity: 0; /* Telegram’dagi kabi: ko‘rinmaydi */
        animation: none;
    }

    /* === GROUP / ICON avatars === */
    /* Agar ichida <img> bo‘lmasa — status ko‘rsatmaymiz */
    .avatar-md:not(:has(img)) .status-dot {
        display: none;
    }

    /* === Pulse animation (subtle) === */
    @keyframes status-pulse {
        0% {
            box-shadow: 0 0 0 0 rgba(40, 199, 111, 0.6);
        }
        70% {
            box-shadow: 0 0 0 6px rgba(40, 199, 111, 0);
        }
        100% {
            box-shadow: 0 0 0 0 rgba(40, 199, 111, 0);
        }
    }

    #sticky-date {
        display: none;
    }


    /* ===== FILE PREVIEW WRAPPER ===== */
    #filePreview {
        width: 100%;
        }

        #filePreview .card {
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        }

        /* ===== IMAGE PREVIEW ===== */
        #filePreviewImg {
        flex-shrink: 0;
        }

        /* ===== FILE ICON (non-image files) ===== */
        #filePreviewIcon {
        flex-shrink: 0;
        }

        /* ===== FILE INFO ===== */
        #filePreviewName {
        /* Fayl nomini cheklash */
        max-width: 100%;
        line-height: 1.3;
        }

        #filePreviewSize {
        line-height: 1;
        margin-top: 2px;
        }

        /* ===== REMOVE BUTTON ===== */
        #removeFilePreview {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        }

        /* ===== RESPONSIVE: Mobile uchun ===== */
        @media (max-width: 576px) {
        #filePreview .card-body {
            padding: 8px !important;
        }

        #filePreviewImg,
        #filePreviewIcon {
            width: 40px !important;
            height: 40px !important;
        }

        #filePreviewName {
            font-size: 0.85rem;
        }

        #removeFilePreview {
            width: 28px !important;
            height: 28px !important;
        }
    }

    .chat-info-modal {
        border-radius: 16px;
        overflow: hidden;
        box-shadow: 0 12px 30px rgba(0,0,0,0.15);
    }

    /* === HERO HEADER === */
    .chat-info-header {
        background: linear-gradient(135deg, #4f46e5, #6366f1);
        padding: 20px 16px 16px;
        color: #fff;
        position: relative;
    }

    .chat-info-avatar {
        width: 80px;
        height: 80px;
        object-fit: cover;
        border-radius: 50%;
        border: 3px solid #fff;
        background: #fff;
    }

    .chat-info-header h5 {
        font-weight: 600;
    }

    .chat-info-header .badge {
        margin-top: 6px;
        font-size: 0.75rem;
    }

    /* === BODY INFO === */
    .chat-info-row {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 4px;
        font-size: 0.9rem;
        color: #444;
    }

    .chat-info-row i {
        font-size: 18px;
        color: #6366f1;
    }


    .chat-message {
        position: relative;
        padding-bottom: 16px; /* meta uchun joy */
    }
    .chat-message .chat-edited {
        position: absolute;
        right: 26px;          /* status icon oldida */
        bottom: 2px;

        font-size: 0.7rem;
        color: #ff9f43;       /* ko‘rinadigan sariq */
        font-style: italic;
        opacity: 0.9;
    }
    .chat-message .message-status {
        position: absolute;
        right: 6px;
        bottom: 2px;
        font-size: 0.8rem;
    }
