.mailbox-chat {
    width: 100%;
    border: 1px solid #a9bccb;
    background: #ffffff;
    display: flex;
    flex-direction: column;
}

.mailbox-chat__header {
    min-height: 40px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 16px;
}

.mailbox-chat__secure {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #ffffff;
    font-family: "Inter", Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-weight: 600;
}

.mailbox-chat__secure img {
    width: 14px;
    height: 14px;
    object-fit: contain;
    display: block;
}

.mailbox-chat__empty {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    text-align: center;
}

.mailbox-chat__empty-icon {
    margin-bottom: 10px;
    font-size: 46px;
    line-height: 1;
    color: #2f73a6;
}

.mailbox-chat__empty-title {
    margin: 0 0 6px;
    font-family: "Inter", Arial, Helvetica, sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #205f8a;
}

.mailbox-chat__empty-text {
    margin: 0;
    font-family: "Inter", Arial, Helvetica, sans-serif;
    font-size: 11px;
    color: #444444;
}

.mailbox-chat__form {
    padding: 0 10px 10px;
    flex-shrink: 0;
}

.mailbox-chat__input-wrap {
    position: relative;
    margin: 0;
    border: 1px solid #a9bccb;
    background: #ffffff;
    padding: 12px 110px 14px 14px;
    min-height: 126px;
}

.mailbox-chat__label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    font-family: "Inter", Arial, Helvetica, sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: #1f4f73;
}

.mailbox-chat__textarea {
    width: 100%;
    min-height: 58px;
    border: none;
    resize: none;
    outline: none;
    padding: 0;
    font-family: "Inter", Arial, Helvetica, sans-serif;
    font-size: 12px;
    line-height: 1.5;
    color: #1f1f1f;
    background: transparent;
}

.mailbox-chat__textarea::placeholder {
    color: #7a7a7a;
}

.mailbox-chat__actions {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mailbox-chat__attach {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;

    min-width: 130px;
    height: 30px;
    padding: 0 10px;

    border-radius: 8px;
    background: #7fa6c7;
    color: #ffffff;

    font-family: "Inter", Arial, Helvetica, sans-serif;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.mailbox-chat__attach img {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

.mailbox-chat__send {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.mailbox-chat__send svg {
    width: 15px;
    height: 15px;
    display: block;
}

.mailbox-chat__messages {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 16px 20px;
    height: 300px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.mailbox-message {
    display: flex;
    width: 100%;
}

.mailbox-message--user {
    justify-content: flex-end;
}

.mailbox-message--responsable {
    justify-content: flex-start;
}

.mailbox-message__bubble {
    display: inline-block;
    width: auto;
    max-width: 320px;
    padding: 12px 14px;
    border-radius: 14px;
    font-family: "Inter", Arial, Helvetica, sans-serif;
    font-size: 12px;
    line-height: 1.5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.mailbox-message--user .mailbox-message__bubble {
    background: #dfeef9;
    color: #163d5a;
    border-bottom-right-radius: 4px;
}

.mailbox-message--responsable .mailbox-message__bubble {
    background: #f1f3f5;
    color: #222222;
    border-bottom-left-radius: 4px;
}

.mailbox-message__meta {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 6px;
    font-size: 10px;
    line-height: 1.3;
    color: #6b7280;
}

.mailbox-message__author {
    font-weight: 700;
}

.mailbox-message__content {
    word-break: break-word;
}

.mailbox-file-link {
    color: var(--primary);
    text-decoration: none;
    font-family: "Inter", Arial, Helvetica, sans-serif;
    font-size: 12px;
    line-height: 1.5;
}

.mailbox-file-link:hover {
    text-decoration: underline;
}

.mailbox-chat__selected-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    margin-right: 150px;
}

.mailbox-chat__file-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 240px;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 14px;
    background: #eef3f7;
    border: 1px solid #c9d6e2;
    font-family: "Inter", Arial, Helvetica, sans-serif;
    font-size: 11px;
    color: #1f1f1f;
}

.mailbox-chat__file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mailbox-chat__file-remove {
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    color: #666666;
}

.mailbox-message__attachments {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mailbox-chat__blocked {
    padding: 16px 18px;
    border-top: 1px solid #e5e7eb;
    background: #fff7ed;
    color: #9a3412;
    font-size: 13px;
    line-height: 1.5;
}

/* =========================
   MODAL ERRORES
========================= */
.chat-modal[hidden] {
    display: none !important;
}

.chat-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.chat-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.38);
}

.chat-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 520px);
    background: #ffffff;
    border-radius: 10px;
    padding: 24px 24px 20px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    font-family: "Inter", Arial, Helvetica, sans-serif;
}

.chat-modal__close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    color: #666666;
    cursor: pointer;
}

.chat-modal__title {
    margin: 0 0 14px;
    font-size: 18px;
    line-height: 1.3;
    font-weight: 700;
    color: #111111;
}

.chat-modal__text {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #222222;
}

.chat-modal__actions {
    margin-top: 22px;
    display: flex;
    justify-content: flex-end;
}

.chat-modal__button {
    min-width: 120px;
    height: 36px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    font-family: "Inter", Arial, Helvetica, sans-serif;
    cursor: pointer;
}

.chat-modal__button--primary {
    background: #2f73a6;
    color: #ffffff;
}