/* ==========================================================================
   MEDICAL REALTIME CHAT & FILE SHARING STYLES
   ========================================================================== */

.chat-page-container {
    display: flex;
    height: calc(100vh - 80px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05), 0 0 0 1px #e2e8f0;
    overflow: hidden;
    position: relative;
}

/* ===== LEFT SIDEBAR (CONVERSATIONS LIST) ===== */
.chat-sidebar {
    width: 340px;
    min-width: 300px;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    transition: transform 0.25s ease;
    z-index: 20;
}

.chat-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-sidebar-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-sidebar-title h2 {
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.chat-badge-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-sidebar-search {
    padding: 12px 16px;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
}

.chat-room-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-room-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    background: transparent;
    position: relative;
}

.chat-room-item:hover {
    background: #e2e8f0;
}

.chat-room-item.active {
    background: #e0f2fe;
    box-shadow: 0 1px 3px rgba(2, 132, 199, 0.1);
}

.chat-room-avatar-wrap {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.chat-room-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #0284c7;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    object-fit: cover;
}

.chat-room-avatar.group {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
}

.chat-online-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #10b981;
    border: 2px solid #ffffff;
}

.chat-room-info {
    flex: 1;
    min-width: 0;
}

.chat-room-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3px;
}

.chat-room-name {
    font-size: 13.5px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-room-time {
    font-size: 11px;
    color: #94a3b8;
    flex-shrink: 0;
}

.chat-room-preview-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.chat-room-preview {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-unread-badge {
    background: #ef4444;
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 12px;
    flex-shrink: 0;
}

/* ===== MAIN CHAT AREA ===== */
.chat-main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f1f5f9;
    position: relative;
    min-width: 0;
}

.chat-main-header {
    height: 64px;
    padding: 0 20px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
}

.chat-header-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #0284c7;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
}

.chat-header-avatar.group {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
}

.chat-header-title h3 {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.2;
}

.chat-header-status {
    font-size: 11.5px;
    color: #10b981;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-header-status.offline {
    color: #94a3b8;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== MESSAGES LIST CONTAINER ===== */
.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-date-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 12px 0;
}

.chat-date-divider span {
    background: #e2e8f0;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 12px;
}

/* ===== MESSAGE ROW & BUBBLE ===== */
.chat-msg-row {
    display: flex;
    gap: 10px;
    max-width: 75%;
    align-items: flex-end;
}

.chat-msg-row.mine {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #0284c7;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    margin-bottom: 2px;
}

.chat-msg-content-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-msg-sender-name {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    margin-left: 4px;
}

.chat-msg-bubble {
    background: #ffffff;
    color: #1e293b;
    padding: 10px 14px;
    border-radius: 14px 14px 14px 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 0 0 1px #e2e8f0;
    font-size: 13.5px;
    line-height: 1.5;
    position: relative;
    word-break: break-word;
}

.chat-msg-row.mine .chat-msg-bubble {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    border-radius: 14px 14px 2px 14px;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

.chat-msg-forwarded-tag {
    font-size: 11px;
    color: #64748b;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
}

.chat-msg-row.mine .chat-msg-forwarded-tag {
    color: #bae6fd;
}

.chat-msg-reply-box {
    background: rgba(0, 0, 0, 0.05);
    border-left: 3px solid #0284c7;
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
    font-size: 11.5px;
}

.chat-msg-row.mine .chat-msg-reply-box {
    background: rgba(255, 255, 255, 0.18);
    border-left-color: #ffffff;
    color: #f0f9ff;
}

.chat-msg-time {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 4px;
    text-align: right;
}

.chat-msg-row.mine .chat-msg-time {
    color: #e0f2fe;
}

/* ===== ATTACHMENTS INSIDE MESSAGE ===== */
.chat-msg-attachments {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

.chat-img-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 6px;
    max-width: 320px;
}

.chat-img-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #000000;
    max-height: 200px;
}

.chat-img-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.chat-img-item:hover img {
    transform: scale(1.04);
}

.chat-doc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    border-radius: 10px;
    min-width: 220px;
    max-width: 320px;
}

.chat-msg-row.mine .chat-doc-item {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.chat-doc-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #e0f2fe;
    color: #0284c7;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-msg-row.mine .chat-doc-icon {
    background: #ffffff;
    color: #0284c7;
}

.chat-doc-meta {
    flex: 1;
    min-width: 0;
}

.chat-doc-name {
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-doc-size {
    font-size: 11px;
    opacity: 0.75;
}

.chat-doc-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-doc-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: inherit;
    opacity: 0.8;
    transition: opacity 0.15s ease;
}

.chat-doc-btn:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
}

.chat-msg-actions-hover {
    position: absolute;
    top: -12px;
    right: 8px;
    display: none;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 2px 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    gap: 4px;
    z-index: 5;
}

.chat-msg-bubble:hover .chat-msg-actions-hover {
    display: flex;
}

.chat-msg-action-btn {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 11px;
    display: flex;
    align-items: center;
}

.chat-msg-action-btn:hover {
    color: #0284c7;
}

.chat-msg-action-btn.chat-msg-delete-btn:hover {
    color: #ef4444;
}

/* ===== INPUT BAR & ATTACHMENT PREVIEW ===== */
.chat-input-container {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.03);
    position: relative;
    z-index: 10;
}

.chat-reply-preview-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-left: 3.5px solid #0284c7;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12.5px;
    color: #0369a1;
}

.chat-pending-files-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0;
}

.chat-pending-file-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 500;
    color: #334155;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.chat-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 24px;
    padding: 3px 6px 3px 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-input-row:focus-within {
    background: #ffffff;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15), 0 2px 8px rgba(2, 132, 199, 0.08);
}

.chat-btn-attach {
    background: transparent;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    transition: all 0.18s ease;
    flex-shrink: 0;
}

.chat-btn-attach:hover {
    background: #e0f2fe;
    color: #0284c7;
    transform: scale(1.05);
}

.chat-btn-attach.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chat-textarea-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

.chat-input-native {
    width: 100%;
    border: none;
    border-radius: 0;
    padding: 6px 8px;
    font-size: 14.5px;
    font-family: inherit;
    line-height: 1.4;
    resize: none;
    outline: none;
    max-height: 120px;
    min-height: 34px;
    height: 34px;
    background: transparent;
    color: #0f172a;
    box-shadow: none !important;
    box-sizing: border-box;
    overflow-y: hidden;
}

.chat-input-native:focus {
    overflow-y: auto;
}

.chat-input-native::placeholder {
    color: #94a3b8;
    font-size: 13.5px;
}

.chat-btn-send {
    background: #e2e8f0;
    color: #94a3b8;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: not-allowed;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow: none;
}

.chat-input-native::placeholder {
    color: #94a3b8;
    font-size: 13.5px;
}

.chat-btn-send {
    background: #e2e8f0;
    color: #94a3b8;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: not-allowed;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    margin-bottom: 1px;
    box-shadow: none;
}

.chat-btn-send.active,
.chat-btn-send:not(:disabled) {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(2, 132, 199, 0.35);
}

.chat-btn-send:not(:disabled):hover {
    box-shadow: 0 5px 14px rgba(2, 132, 199, 0.45);
    transform: scale(1.06);
}

.chat-btn-send:not(:disabled):active {
    transform: scale(0.96);
}

/* ===== SHARED FILES DRAWER (RIGHT PANEL) ===== */
.chat-drawer-files {
    width: 300px;
    background: #ffffff;
    border-left: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    transition: all 0.25s ease;
    z-index: 15;
}

.chat-drawer-header {
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-drawer-header h4 {
    font-size: 14.5px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.chat-drawer-tabs {
    display: flex;
    border-bottom: 1px solid #f1f5f9;
}

.chat-drawer-tab-btn {
    flex: 1;
    padding: 10px;
    text-align: center;
    background: transparent;
    border: none;
    font-size: 12.5px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.chat-drawer-tab-btn.active {
    color: #0284c7;
    border-bottom-color: #0284c7;
}

.chat-drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-drawer-img-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.chat-drawer-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
    background: #f8fafc;
}

/* ===== LIGHTBOX MODAL ===== */
.chat-lightbox-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.chat-lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}

.chat-lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 8px;
    object-fit: contain;
}

.chat-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== MOBILE RESPONSIVENESS ===== */
@media (max-width: 768px) {
    .chat-page-container {
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        margin: 0;
    }

    .chat-sidebar {
        width: 100%;
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        z-index: 20;
    }

    .chat-sidebar.chat-mobile-hidden {
        transform: translateX(-100%);
        pointer-events: none;
    }

    .chat-main-area {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .chat-header {
        padding: 8px 12px;
    }

    .chat-messages-scroll {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 10px 12px;
    }

    .chat-input-container {
        padding: 6px 10px max(8px, env(safe-area-inset-bottom, 8px));
        gap: 6px;
        box-sizing: border-box;
        width: 100%;
    }

    .chat-input-row {
        border-radius: 20px;
        padding: 3px 5px 3px 6px;
        gap: 6px;
    }

    .chat-input-native {
        font-size: 16px; /* Chặn iOS Safari tự zoom in viewport khi focus */
        padding: 5px 4px;
        min-height: 22px;
    }

    .chat-input-native::placeholder {
        font-size: 13px;
    }

    .chat-btn-attach,
    .chat-btn-send {
        width: 34px;
        height: 34px;
        font-size: 14px;
        flex-shrink: 0;
    }

    .chat-drawer-files {
        position: absolute;
        top: 0;
        right: 0;
        height: 100%;
        width: 88%;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
        z-index: 25;
    }
}

/* ===== FILTER TABS IN SIDEBAR ===== */
.chat-filter-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    overflow-x: auto;
}
.chat-tab-btn {
    border: none;
    background: transparent;
    font-size: 11.5px;
    font-weight: 600;
    color: #475569;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.12s ease;
}
.chat-tab-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}
.chat-tab-btn.active {
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

/* ===== BOT ASSISTANT STYLING ===== */
.bot-item-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
    border: 1px solid #bbf7d0;
}
.bot-item-card:hover {
    background: #dcfce7;
}
.chat-room-avatar.bot {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    font-size: 20px;
}
.chat-room-name.bot-name {
    color: #047857;
    font-weight: 700;
}
.chat-online-dot.bot-dot {
    background: #10b981;
}
.chat-header-avatar.bot {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    font-size: 22px;
}
.chat-header-status.bot-status {
    color: #059669;
    font-weight: 600;
}

/* ===== BOT COMMAND CHIPS BAR ===== */
.bot-command-chips-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    overflow-x: auto;
    flex-shrink: 0;
}
.bot-chips-title {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.bot-chip-btn {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.12s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.bot-chip-btn:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(2, 132, 199, 0.25);
}

/* ===== BOT MESSAGES FORMATTING ===== */
.chat-msg-row.bot-msg-row .chat-msg-bubble.bot-bubble {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #0f172a;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08);
}
.chat-msg-avatar.bot-avatar {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    font-size: 18px;
}
.chat-msg-sender-name.bot-sender-name {
    color: #047857;
    display: flex;
    align-items: center;
    gap: 6px;
}
.bot-tag-badge {
    background: #dcfce7;
    color: #15803d;
    font-size: 9.5px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    border: 1px solid #86efac;
}
.bot-text-formatted {
    font-size: 13px;
    line-height: 1.55;
}
.chat-inline-link {
    color: #0284c7;
    font-weight: 600;
    text-decoration: underline;
}
.chat-msg-divider {
    border: none;
    border-top: 1px solid #cbd5e1;
    margin: 6px 0;
    width: 100%;
}
.chat-msg-row.mine .chat-msg-divider {
    border-top-color: rgba(255, 255, 255, 0.3);
}

/* ===== BOT WELCOME CARD ===== */
.bot-welcome-card {
    background: #ffffff;
    border: 1.5px solid #bbf7d0;
    border-radius: 14px;
    padding: 24px;
    max-width: 540px;
    text-align: center;
    box-shadow: 0 4px 18px rgba(16, 185, 129, 0.08);
    margin: 20px auto;
}
.bot-welcome-card h4 {
    color: #065f46;
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 8px;
}
.bot-welcome-card p {
    font-size: 12.5px;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 16px;
}
.bot-sample-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    text-align: left;
}
.bot-sample-card {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.12s ease;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.bot-sample-card:hover {
    background: #059669;
    color: #ffffff;
    border-color: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}
.bot-sample-card strong {
    font-size: 12px;
    color: #065f46;
}
.bot-sample-card:hover strong {
    color: #ffffff;
}
.bot-sample-card span {
    font-size: 10.5px;
    color: #475569;
}
.bot-sample-card:hover span {
    color: #dcfce7;
}

/* ===== WELCOME SCREEN BOT BUTTON ===== */
.welcome-bot-shortcut {
    margin-top: 18px;
}
.welcome-bot-btn {
    border: none;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: all 0.15s ease;
}
.welcome-bot-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
}

/* ===== HEADER ACTION BUTTONS ===== */
.chat-header-action-btn {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.12s ease;
}
.chat-header-action-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}
.btn-clear-history:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fca5a5;
}

/* ===== SHARE MODAL & SHEET ===== */
.share-modal-dialog {
    max-width: 480px;
}
.share-preview-card {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}
.share-preview-sender {
    font-size: 11.5px;
    color: #64748b;
    margin-bottom: 4px;
}
.share-preview-text {
    font-size: 13px;
    color: #0f172a;
    font-weight: 500;
    line-height: 1.45;
    max-height: 100px;
    overflow-y: auto;
}
.share-preview-attachments {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.share-att-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.share-options-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.share-option-btn {
    border: 1px solid #e2e8f0;
    background: #ffffff;
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    text-align: left;
    transition: all 0.12s ease;
}
.share-option-btn:hover {
    background: #f0f9ff;
    border-color: #0284c7;
    transform: translateX(2px);
}
.share-btn-icon {
    font-size: 20px;
    flex-shrink: 0;
}
.share-btn-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.share-btn-text strong {
    font-size: 13px;
    color: #0f172a;
}
.share-btn-text span {
    font-size: 11px;
    color: #64748b;
}

.zalo-direct-share-box {
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
}
.zalo-share-input-row {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}
.fluent-btn-zalo-send {
    border: none;
    background: #0068ff;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 0 16px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.12s ease;
}
.fluent-btn-zalo-send:hover:not(:disabled) {
    background: #0052cc;
}
.fluent-btn-zalo-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== DANGER CLEAR HISTORY MODAL ===== */
.modal-danger .danger-header {
    background: #fef2f2;
    border-bottom: 1px solid #fecdd3;
}
.modal-danger .danger-header h3 {
    color: #991b1b;
}
.danger-warning-box {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 8px;
    padding: 14px;
    font-size: 12.5px;
    color: #881337;
    line-height: 1.5;
}
.danger-warning-box p {
    margin-bottom: 6px;
}
.danger-warning-box p:last-child {
    margin-bottom: 0;
}
.fluent-btn-delete-confirm {
    border: none;
    background: #dc2626;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.12s ease;
}
.fluent-btn-delete-confirm:hover:not(:disabled) {
    background: #b91c1c;
}
.fluent-btn-delete-confirm:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .chat-page-container {
        height: calc(100dvh - 75px);
        height: calc(100vh - 75px);
        border-radius: 8px;
        margin: 0;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        border-left: none;
        border-right: none;
    }
    .chat-sidebar {
        width: 100%;
        min-width: 100%;
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        z-index: 20;
    }
    .chat-sidebar.chat-mobile-hidden {
        transform: translateX(-100%);
        pointer-events: none;
    }
    .mobile-back-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 30px;
        min-width: 30px;
        border-radius: 8px;
        background: #f1f5f9;
        color: #334155;
        border: 1px solid #cbd5e1;
        margin-right: 2px;
        flex-shrink: 0;
        cursor: pointer;
    }
    .hide-mobile {
        display: none !important;
    }
    .chat-main-header {
        padding: 8px 10px;
        height: auto;
        min-height: 50px;
    }
    .chat-header-avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
        border-radius: 8px;
    }
    .chat-header-title h3 {
        font-size: 13.5px;
    }
    .chat-header-status {
        font-size: 10.5px;
    }
    .chat-messages-container {
        padding: 10px 8px;
        gap: 8px;
    }
    .chat-msg-row {
        max-width: 95%;
        gap: 6px;
    }
    .chat-msg-avatar {
        width: 26px;
        height: 26px;
        font-size: 10px;
        border-radius: 6px;
    }
    .chat-msg-bubble {
        padding: 7px 10px;
        font-size: 12.5px;
    }
    .bot-command-chips-bar {
        padding: 5px 8px;
        gap: 4px;
    }
    .bot-chip-btn {
        padding: 3px 8px;
        font-size: 11px;
    }
    .chat-input-wrapper {
        padding: 6px 8px;
    }
    .chat-input-box {
        padding: 2px 4px 2px 8px;
        gap: 4px;
    }
    .chat-attach-btn {
        width: 28px;
        height: 28px;
    }
    .chat-send-btn {
        width: 32px;
        height: 32px;
    }
    .chat-right-drawer {
        position: absolute;
        top: 0;
        right: 0;
        width: 100%;
        height: 100%;
        z-index: 30;
    }
    .chat-msg-actions-hover {
        display: none !important;
    }
}
