/* ============================================================
                   RESET & BASE
============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f7f7f8;
    height: 100vh;
    overflow: hidden;
    display: flex;
    overflow: hidden;
}
/* ============================================================
                   SIDEBAR
                ============================================================ */
.sidebar {
    width: 280px;
    background: #202123;
    color: #ececf1;
    display: flex;
    flex-direction: column;
    padding: 12px;
    flex-shrink: 0;
    transition: all 0.3s;
    overflow: hidden;
}

.sidebar-header {
    padding: 8px 4px 16px 4px;
    border-bottom: 1px solid #2d2d30;
    margin-bottom: 12px;
}

    .sidebar-header .logo-small {
        font-size: 20px;
        font-weight: 700;
        display: flex;
        align-items: center;
        gap: 8px;
    }

        .sidebar-header .logo-small .conf {
            background: linear-gradient( 135deg, #4285f4, #34a853 );
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .sidebar-header .logo-small .sync {
            color: #ea4335;
            -webkit-text-fill-color: #ea4335;
        }

.new-chat-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid #4d4d4f;
    border-radius: 8px;
    color: #ececf1;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
}

    .new-chat-btn:hover {
        background: #2d2d30;
    }

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

    .history-list::-webkit-scrollbar {
        width: 4px;
    }

    .history-list::-webkit-scrollbar-track {
        background: transparent;
    }

    .history-list::-webkit-scrollbar-thumb {
        background: #4d4d4f;
        border-radius: 10px;
    }

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.15s;
    margin-bottom: 2px;
    font-size: 14px;
    color: #ececf1;
    gap: 8px;
}

    .history-item:hover {
        background: #2d2d30;
    }

    .history-item.active {
        background: #2d2d30;
    }

    .history-item .title {
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .history-item .delete-btn {
        background: none;
        border: none;
        color: #5f6368;
        cursor: pointer;
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 14px;
        transition: 0.2s;
        visibility: hidden;
    }

    .history-item:hover .delete-btn {
        visibility: visible;
    }

    .history-item .delete-btn:hover {
        color: #d93025;
        background: #3d3d40;
    }

.history-empty {
    color: #5f6368;
    text-align: center;
    padding: 40px 20px;
    font-size: 14px;
    line-height: 1.7;
}
/* ============================================================
                   USER PROFILE
                ============================================================ */
.sidebar-footer {
    border-top: 1px solid #2d2d30;
    padding-top: 12px;
    margin-top: 4px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.15s;
}

    .user-info:hover {
        background: #2d2d30;
    }

    .user-info .avatar {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: #1a73e8;
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        font-size: 14px;
        flex-shrink: 0;
    }

    .user-info .details {
        flex: 1;
        overflow: hidden;
    }

        .user-info .details .name {
            font-size: 14px;
            font-weight: 500;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .user-info .details .phone {
            font-size: 12px;
            color: #8e8ea0;
        }

    .user-info .user-actions {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-left: auto;
    }

    .user-info .change-password-btn {
        border: 1px solid #dadce0;
        background: #fff;
        color: #1a73e8;
        border-radius: 8px;
        padding: 6px 8px;
        font-size: 11px;
        cursor: pointer;
        white-space: nowrap;
    }

        .user-info .change-password-btn:hover {
            background: #f1f3f4;
        }

    .user-info .logout-icon {
        color: #8e8ea0;
        cursor: pointer;
        padding: 4px 8px;
        border-radius: 4px;
        transition: 0.2s;
        background: none;
        border: none;
        font-size: 16px;
    }

        .user-info .logout-icon:hover {
            color: #d93025;
            background: #3d3d40;
        }

.login-prompt {
    padding: 8px 12px;
    text-align: center;
}

    .login-prompt .login-side-btn {
        width: 100%;
        padding: 10px;
        background: #1a73e8;
        color: #fff;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        font-weight: 500;
        transition: 0.2s;
    }

        .login-prompt .login-side-btn:hover {
            background: #1557b0;
        }
/* ============================================================
                   MAIN CONTENT
                ============================================================ */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    position: relative;
    min-height: 0;
}
/* ============================================================
                   HEADER
                ============================================================ */
.chat-header {
    padding: 16px 32px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    flex-shrink: 0;
}

    .chat-header .title {
        font-size: 18px;
        font-weight: 600;
        color: #202123;
    }

    .chat-header .conf-badge {
        font-size: 13px;
        color: #5f6368;
        background: #f1f3f4;
        padding: 4px 16px;
        border-radius: 20px;
    }
/* ============================================================
                   MESSAGES_FORMS
                ============================================================ */
/* ============================================================
                   CHAT INPUT
                ============================================================ */

.chat-input-area {
    padding: 16px 32px 24px 32px;
    background: #fff;
    border-top: 1px solid #e5e5e5;
    flex-shrink: 0;
    width: 100%; /* ← اضافه کنید */
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #d9d9e3;
    border-radius: 12px;
    padding: 8px 12px 8px 8px;
    transition: 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    width: 100%; /* ← اضافه کنید */
    max-width: 100%; /* ← اضافه کنید */
}

    .input-wrapper:focus-within {
        border-color: #1a73e8;
        box-shadow: 0 2px 12px rgba(26, 115, 232, 0.12);
    }

    .input-wrapper textarea {
        flex: 1 1 auto;
        border: none;
        outline: none;
        resize: none;
        font-size: 15px;
        padding: 10px 12px;
        font-family: inherit;
        background: #e3f2fd; /* ← رنگ آبی برای دید بهتر */
        color: #202123;
        min-height: 48px;
        max-height: 150px;
        line-height: 1.5;
        min-width: 60%; /* ← حداقل 60% عرض */
        width: 100%;
        border-radius: 8px; /* ← برای زیبایی */
    }


        .input-wrapper textarea::placeholder {
            color: #8e8ea0;
        }

    .input-wrapper .input-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }

    .input-wrapper .conf-selector-btn {
        background: none;
        border: none;
        cursor: pointer;
        padding: 6px 8px;
        border-radius: 8px;
        transition: 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .input-wrapper .conf-selector-btn:hover {
            background: #f1f3f4;
        }

.dots-6 {
    display: grid;
    grid-template-columns: repeat(3, 5px);
    gap: 3px;
    padding: 2px;
}

    .dots-6 span {
        display: block;
        width: 5px;
        height: 5px;
        background: #5f6368;
        border-radius: 50%;
        transition: 0.2s;
    }

.conf-selector-btn:hover
.dots-6 span {
    background: #1a73e8;
}

.send-btn {
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
    height: 40px;
}

    .send-btn:hover:not(:disabled) {
        background: #1557b0;
        box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
    }

    .send-btn:disabled {
        background: #dadce0;
        color: #5f6368;
        cursor: not-allowed;
    }
/* ============================================================
                   CONFERENCE DROPDOWN
                ============================================================ */
.conf-dropdown {
    display: none;
    position: absolute;
    bottom: calc(100% + 12px);
    right: 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    padding: 16px 20px;
    min-width: 220px;
    z-index: 1000;
    border: 1px solid #e8eaed;
}

    .conf-dropdown.active {
        display: block;
    }

    .conf-dropdown h4 {
        font-size: 13px;
        color: #5f6368;
        margin-bottom: 12px;
        font-weight: 500;
        border-bottom: 1px solid #e8eaed;
        padding-bottom: 8px;
    }

.conf-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.15s;
    font-size: 14px;
    color: #222;
}

    .conf-item:hover {
        background: #f1f3f4;
    }

    .conf-item input[type="checkbox"] {
        width: 16px;
        height: 16px;
        cursor: pointer;
        accent-color: #1a73e8;
    }

    .conf-item label {
        cursor: pointer;
        flex: 1;
    }

.conf-dropdown .apply-conf {
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s;
}

    .conf-dropdown .apply-conf:hover {
        background: #1557b0;
    }
/* ============================================================
                   AUTH MODAL
                ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

    .modal-overlay.active {
        display: flex;
    }

.modal-box {
    background: #fff;
    border-radius: 24px;
    padding: 40px 36px;
    max-width: 480px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-box .close-modal {
    position: absolute;
    top: 16px;
    left: 20px;
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    color: #5f6368;
    transition: 0.2s;
    line-height: 1;
}

    .modal-box .close-modal:hover {
        color: #d93025;
        transform: rotate(90deg);
    }

.modal-box h2 {
    font-size: 24px;
    color: #1a73e8;
    margin-bottom: 6px;
}

.modal-box .modal-sub {
    font-size: 14px;
    color: #5f6368;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
}

    .form-group label {
        display: block;
        font-size: 13px;
        font-weight: 500;
        color: #3c4043;
        margin-bottom: 5px;
    }

    .form-group input,
    .form-group select {
        width: 100%;
        padding: 10px 14px;
        border: 1px solid #dadce0;
        border-radius: 12px;
        font-size: 14px;
        transition: 0.2s;
        background: #fff;
        font-family: inherit;
    }

        .form-group input:focus,
        .form-group select:focus {
            outline: none;
            border-color: #1a73e8;
            box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
        }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn-primary {
    flex: 1;
    padding: 12px;
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    min-width: 120px;
}

    .btn-primary:hover:not(:disabled) {
        background: #1557b0;
        box-shadow: 0 2px 12px rgba(26, 115, 232, 0.3);
    }

    .btn-primary:disabled {
        opacity: 0.65;
        cursor: not-allowed;
    }

.btn-secondary {
    flex: 1;
    padding: 12px;
    background: #f1f3f4;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    min-width: 120px;
}

    .btn-secondary:hover {
        background: #e8eaed;
    }

.switch-auth {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: #5f6368;
}

    .switch-auth a {
        color: #1a73e8;
        cursor: pointer;
        font-weight: 500;
        text-decoration: none;
    }

        .switch-auth a:hover {
            text-decoration: underline;
        }

.form-error {
    color: #d93025;
    font-size: 13px;
    margin-top: 4px;
    display: none;
    padding: 8px 12px;
    background: #fce8e6;
    border-radius: 8px;
}

    .form-error.show {
        display: block;
    }

.form-success {
    color: #34a853;
    font-size: 13px;
    margin-top: 4px;
    display: none;
    padding: 8px 12px;
    background: #e6f4ea;
    border-radius: 8px;
}

    .form-success.show {
        display: block;
    }
/* ============================================================
                   MOBILE
                ============================================================ */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #202123;
    cursor: pointer;
    padding: 4px 8px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 99;
}

    .sidebar-overlay.active {
        display: block;
    }

.modal-box::-webkit-scrollbar {
    width: 6px;
}

.modal-box::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 10px;
}

.modal-box::-webkit-scrollbar-thumb {
    background: #dadce0;
    border-radius: 10px;
}

@media (max-width: 768px) {

    .sidebar {
        height: calc(100dvh - 20px);
        top: 10px;
        bottom: 10px;
        width: 0;
        padding: 0;
        overflow: hidden;
        flex-shrink: 0;
        border-radius: 0 12px 12px 0;
    }

        .sidebar.open {
            width: 280px;
            padding: 12px;
            position: fixed;
            top: 10px;
            bottom: 10px;
            height: calc(100dvh - 20px);
            z-index: 100;
            box-shadow: 2px 0 20px rgba(0,0,0,0.3);
        }

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

    .chat-input-area {
        padding: 12px 16px 16px 16px;
    }

    .modal-box {
        padding: 28px 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .message {
        gap: 10px;
        padding: 14px 0;
    }

        .message .msg-avatar {
            width: 28px;
            height: 28px;
            font-size: 13px;
        }

    .send-btn {
        padding: 6px 14px;
        font-size: 13px;
        height: 36px;
    }

    .menu-toggle {
        display: flex !important;
    }

    .chat-header .conf-badge {
        display: none;
    }
}



/* ============================================================
           MESSAGES AREA
        ============================================================ */
.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 12px 32px 12px 32px;
    background: #ffffff;
    min-height: 0;
}

    .messages-area::-webkit-scrollbar {
        width: 6px;
    }

    .messages-area::-webkit-scrollbar-track {
        background: #f1f3f4;
        border-radius: 10px;
    }

    .messages-area::-webkit-scrollbar-thumb {
        background: #dadce0;
        border-radius: 10px;
    }

/* ============================================================
           MESSAGE
        ============================================================ */
.message {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.25s ease;
    max-width: 100%;
}



    .message .msg-content {
        flex: 1; /* ← تغییر از flex: 1 به flex: 0 1 auto */
        line-height: 1.5;
        color: #202123;
        font-size: 14px;
        white-space: normal; /* به جای pre-wrap */
        word-break: break-word;
        padding: 2px 14px;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        min-width: 60%; /* ← حداقل 60% عرض */
        width: 100%;
    }


    /* پیام کاربر - آبی */
    .message.user .msg-content {
        background: #e3f2fd;
        border-radius: 14px 14px 4px 14px;
        color: #0d47a1;
        max-width: 62%;
        align-self: flex-end;
    }

    /* پیام مدل - سفید */
    .message.assistant .msg-content {
        background: #fafafa;
        border-radius: 14px 14px 14px 4px;
        max-width: 82%;
        border: 1px solid #f0f0f0;
        align-self: flex-start;
    }

    .message .msg-content .msg-text {
        display: block;
    }

    /* ============================================================
           فوتر بیرون از کادر - فقط تاریخ
        ============================================================ */
    .message .msg-footer-outside {
        display: flex;
        justify-content: flex-end;
        width: 55%;
        padding: 0px 4px 0px 4px;
        font-size: 9px;
    }

    .message.user .msg-footer-outside {
        align-self: flex-end;
    }

    .message.assistant .msg-footer-outside {
        align-self: flex-start;
        justify-content: flex-start;
        width: 82%;
    }

    .message .msg-footer-outside .msg-time {
        color: #9e9e9e;
        font-size: 9px;
    }

    .message.user .msg-footer-outside .msg-time {
        color: #64b5f6;
    }


/* ============================================================
           LOADING SPINNER - DOTS
        ============================================================ */
.input-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.loading-spinner {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

    .loading-spinner.active {
        display: flex;
    }

.spinner-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

    .spinner-dots span {
        display: block;
        width: 10px;
        height: 10px;
        background: #1a73e8;
        border-radius: 50%;
        animation: dots 1.4s infinite ease-in-out both;
    }

        .spinner-dots span:nth-child(1) {
            animation-delay: -0.32s;
        }

        .spinner-dots span:nth-child(2) {
            animation-delay: -0.16s;
        }

        .spinner-dots span:nth-child(3) {
            animation-delay: 0s;
        }

@keyframes dots {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.3;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* استایل کلید جدید برای باز کردن مودال */
.chat-header .input-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0; /* جلوگیری از کوچک شدن */
}

/* استایل برای گروه action */
.action-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0; /* جلوگیری از کوچک شدن */
    flex-wrap: nowrap; /* جلوگیری از رفتن به زیر هم */
}

/* استایل دکمه modal */
.modal-trigger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #6C63FF, #5A52D5);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(108, 99, 255, 0.25);
    white-space: nowrap; /* جلوگیری از شکستن متن */
    height: 34px;
    line-height: 1;
    flex-shrink: 0; /* جلوگیری از کوچک شدن */
}

    .modal-trigger-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 16px rgba(108, 99, 255, 0.35);
        background: linear-gradient(135deg, #7B73FF, #6C63FF);
    }

    .modal-trigger-btn:active {
        transform: scale(0.95);
    }

    .modal-trigger-btn svg {
        width: 14px;
        height: 14px;
        fill: currentColor;
        flex-shrink: 0; /* جلوگیری از کوچک شدن آیکون */
    }

    .modal-trigger-btn .btn-text {
        font-size: 11px;
        letter-spacing: 0.3px;
        white-space: nowrap; /* جلوگیری از شکستن متن */
    }

/* استایل badge */
.conf-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: linear-gradient(135deg, #f0f0ff, #e8e6ff);
    color: #5A52D5;
    border: 1px solid #d5d0ff;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    height: 34px;
    white-space: nowrap; /* جلوگیری از شکستن متن */
    letter-spacing: 0.2px;
    box-shadow: 0 1px 4px rgba(108, 99, 255, 0.08);
    flex-shrink: 0; /* جلوگیری از کوچک شدن */
}

/* استایل هدر چت */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #ffffff;
    border-bottom: 1px solid #e8ecf1;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    gap: 12px;
    flex-wrap: nowrap; /* جلوگیری از رفتن به زیر هم در کل هدر */
}

    /* برای اطمینان از اینکه عنوان و بخش راست در یک ردیف باشند */
    .chat-header > div:first-child {
        display: flex;
        align-items: center;
        gap: 12px;
        flex-shrink: 0; /* جلوگیری از کوچک شدن */
    }

/* ریسپانسیو برای موبایل */
@media (max-width: 480px) {
    .chat-header {
        padding: 8px 12px;
        gap: 8px;
        flex-wrap: nowrap; /* حفظ حالت یک ردیفی */
    }

    .title {
        font-size: 13px;
        white-space: nowrap;
    }

    .menu-toggle {
        font-size: 18px;
        padding: 2px 6px;
        flex-shrink: 0;
    }

    .action-group {
        gap: 4px;
    }

    .modal-trigger-btn {
        padding: 4px 8px;
        height: 28px;
        border-radius: 14px;
        min-width: 28px;
    }

        .modal-trigger-btn .btn-text {
            display: none; /* مخفی کردن متن در موبایل */
        }

        .modal-trigger-btn svg {
            width: 16px;
            height: 16px;
        }

    .conf-badge {
        padding: 4px 8px;
        font-size: 8px;
        height: 28px;
        border-radius: 14px;
        border-width: 1px;
    }
}

@media (max-width: 768px) {
    html,
    body {
        width: 100%;
        height: 100%;
        height: 100dvh;
        margin: 0;
        overflow: hidden;
    }

    .main-content {
        width: 100%;
        height: 100dvh;
        min-height: 0;
        margin-left: 0;
        display: flex;
        flex-direction: column;
    }

    .messages-area {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
    }

    .chat-input-area {
        flex-shrink: 0;
    }
}
/* ===== TOAST ===== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    border-radius: 8px;
    background-color: #3d3d40; /* رنگ زمینه */
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: none;
    align-items: center;
    gap: 12px;
    animation: slideDown 0.4s ease-out;
    max-width: 90%;
}

    .toast.show {
        display: flex;
    }

    .toast.success {
        background: var(--success);
    }

    .toast.error {
        background: var(--error);
    }

    .toast.warning {
        background: var(--warning);
    }

    .toast.info {
        background: var(--info);
    }

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.message-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    margin-bottom: 6px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.04);
    direction: ltr;
}

.message-tool {
    border: none;
    background: transparent;
    width: 32px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

    .message-tool:hover {
        background: rgba(0, 0, 0, 0.10);
    }

    .message-tool.delete-btn:hover {
        background: rgba(220, 50, 50, 0.15);
    }

    .message-tool.copied {
        color: #10a37f;
    }
/* ===== TOAST ===== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    border-radius: 8px;
    background-color: #3d3d40; /* رنگ زمینه */
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: none;
    align-items: center;
    gap: 12px;
    animation: slideDown 0.4s ease-out;
    max-width: 90%;
}

    .toast.show {
        display: flex;
    }

    .toast.success {
        background: var(--success);
    }

    .toast.error {
        background: var(--error);
    }

    .toast.warning {
        background: var(--warning);
    }

    .toast.info {
        background: var(--info);
    }

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.message-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    margin-bottom: 6px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.04);
    direction: ltr;
}

.message-tool {
    border: none;
    background: transparent;
    width: 32px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

    .message-tool:hover {
        background: rgba(0, 0, 0, 0.10);
    }

    .message-tool.delete-btn:hover {
        background: rgba(220, 50, 50, 0.15);
    }

    .message-tool.copied {
        color: #10a37f;
    }

.sidebar-tabs {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 12px 14px 8px;
    padding: 4px;
    background: #f1f2f6;
    border-radius: 12px;
    flex-shrink: 0;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.sidebar-tab {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 12px;
    background: transparent;
    border: none;
    border-radius: 9px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: color 0.25s ease, transform 0.15s ease;
    user-select: none;
}

    .sidebar-tab .tab-icon {
        font-size: 15px;
        line-height: 1;
        transition: transform 0.25s ease;
    }

    .sidebar-tab:hover {
        color: #374151;
    }

        .sidebar-tab:hover .tab-icon {
            transform: scale(1.15);
        }

    .sidebar-tab:active {
        transform: scale(0.97);
    }

    .sidebar-tab.active {
        color: #1a73e8;
    }

        .sidebar-tab.active .tab-icon {
            transform: scale(1.1);
        }

/* ===== انیمیشن پس‌زمینه‌ی تب فعال ===== */
.tab-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 6px);
    height: calc(100% - 8px);
    background: #ffffff;
    border-radius: 9px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    pointer-events: none;
}

/* وقتی تب Report فعاله، ایندیكاتور بره سمت راست */
.sidebar-tabs[data-active="report-tab"] .tab-indicator {
    transform: translateX(calc(100% + 4px));
}

/* ===== محتوای تب‌ها ===== */
.sidebar-tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    flex-direction: column;
    animation: tabFadeIn 0.25s ease;
}

    .sidebar-tab-content.active {
        display: flex;
    }

@keyframes tabFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Report Header ===== */
.report-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid #ececf1;
    flex-shrink: 0;
}

.report-title {
    font-size: 14px;
    font-weight: 600;
    color: #202123;
    margin: 0;
}

.report-count {
    background: #e8f0fe;
    color: #1a73e8;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

/* ===== Report List ===== */
.report-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ===== Report Item ===== */
.report-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    /* استایل حالت هاور به حالت عادی منتقل شد */
    background: #f7f8fa;
    border: 1px solid #ececf1;
    transform: translateX(2px);
}

    /* هاور: حالت را کمی برجسته‌تر می‌کنیم */
    .report-item:hover {
        background: #f0f2f5;
        border-color: #dcdfe6;
        transform: translateX(4px);
    }

    .report-item:active {
        transform: translateX(4px) scale(0.98);
    }

.report-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* استایل هاور آیکون به حالت عادی منتقل شد */
    background: #e8f0fe;
    border-radius: 9px;
    font-size: 17px;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.report-item:hover .report-icon {
    background: #dbe7fd;
}

.report-content {
    flex: 1;
    min-width: 0;
}

.report-name {
    font-size: 13px;
    font-weight: 500;
    color: #202123;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.report-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #8e8ea0;
}

.report-badge {
    background: #e6f4ea;
    color: #137333;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 6px;
}

    .report-badge.badge-blue {
        background: #e8f0fe;
        color: #1a73e8;
    }

.report-arrow {
    /* استایل هاور فلش به حالت عادی منتقل شد */
    color: #1a73e8;
    font-size: 20px;
    font-weight: 300;
    line-height: 1;
    transform: translateX(2px);
    transition: transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.report-item:hover .report-arrow {
    color: #1557b0;
    transform: translateX(4px);
}

/* ===== اسکرول‌بار شیک ===== */
.report-list::-webkit-scrollbar {
    width: 6px;
}

.report-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

    .report-list::-webkit-scrollbar-thumb:hover {
        background: #9ca3af;
    }

.sidebar-tabs {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 12px 14px 8px;
    padding: 4px;
    background: #f1f2f6;
    border-radius: 12px;
    flex-shrink: 0;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.sidebar-tab {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 12px;
    background: transparent;
    border: none;
    border-radius: 9px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: color 0.25s ease, transform 0.15s ease;
    user-select: none;
}

    .sidebar-tab .tab-icon {
        font-size: 15px;
        line-height: 1;
        transition: transform 0.25s ease;
    }

    .sidebar-tab:hover {
        color: #374151;
    }

        .sidebar-tab:hover .tab-icon {
            transform: scale(1.15);
        }

    .sidebar-tab:active {
        transform: scale(0.97);
    }

    .sidebar-tab.active {
        color: #1a73e8;
    }

        .sidebar-tab.active .tab-icon {
            transform: scale(1.1);
        }

/* ===== انیمیشن پس‌زمینه‌ی تب فعال ===== */
.tab-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 6px);
    height: calc(100% - 8px);
    background: #ffffff;
    border-radius: 9px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    pointer-events: none;
}

/* وقتی تب Report فعاله، ایندیكاتور بره سمت راست */
.sidebar-tabs[data-active="report-tab"] .tab-indicator {
    transform: translateX(calc(100% + 4px));
}

/* ===== محتوای تب‌ها ===== */
.sidebar-tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    flex-direction: column;
    animation: tabFadeIn 0.25s ease;
}

    .sidebar-tab-content.active {
        display: flex;
    }

@keyframes tabFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Report Header ===== */
.report-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid #ececf1;
    flex-shrink: 0;
}

.report-title {
    font-size: 14px;
    font-weight: 600;
    color: #202123;
    margin: 0;
}

.report-count {
    background: #e8f0fe;
    color: #1a73e8;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

/* ===== Report List ===== */
.report-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ===== Report Item ===== */
.report-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    /* استایل حالت هاور به حالت عادی منتقل شد */
    background: #f7f8fa;
    border: 1px solid #ececf1;
    transform: translateX(2px);
}

    /* هاور: حالت را کمی برجسته‌تر می‌کنیم */
    .report-item:hover {
        background: #f0f2f5;
        border-color: #dcdfe6;
        transform: translateX(4px);
    }

    .report-item:active {
        transform: translateX(4px) scale(0.98);
    }

.report-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* استایل هاور آیکون به حالت عادی منتقل شد */
    background: #e8f0fe;
    border-radius: 9px;
    font-size: 17px;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.report-item:hover .report-icon {
    background: #dbe7fd;
}

.report-content {
    flex: 1;
    min-width: 0;
}

.report-name {
    font-size: 13px;
    font-weight: 500;
    color: #202123;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.report-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #8e8ea0;
}

.report-badge {
    background: #e6f4ea;
    color: #137333;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 6px;
}

    .report-badge.badge-blue {
        background: #e8f0fe;
        color: #1a73e8;
    }

.report-arrow {
    /* استایل هاور فلش به حالت عادی منتقل شد */
    color: #1a73e8;
    font-size: 20px;
    font-weight: 300;
    line-height: 1;
    transform: translateX(2px);
    transition: transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.report-item:hover .report-arrow {
    color: #1557b0;
    transform: translateX(4px);
}

/* ===== اسکرول‌بار شیک ===== */
.report-list::-webkit-scrollbar {
    width: 6px;
}

.report-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

    .report-list::-webkit-scrollbar-thumb:hover {
        background: #9ca3af;
    }



/* ============================================================
                   MAIN VIEW SWITCHER (WORK / REPORT)
                ============================================================ */
.main-view {
    display: none;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

    .main-view.active {
        display: flex;
        flex-direction: column;
    }

.report-main-view {
    background: #ffffff;
}

.report-frame {
    display: block;
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    border: 0;
    outline: 0;
    background: #ffffff;
}

@media (max-width: 768px) {
    .main-view,
    .main-view.active,
    .report-main-view,
    .report-frame {
        width: 100%;
        min-width: 0;
        min-height: 0;
    }

        .main-view,
        .main-view.active,
        .report-main-view {
            height: 100%;
        }

    .report-frame {
        height: 100%;
    }
}

