/* ---- Charte : bleu du logo ---- */
:root {
    --bs-primary: #004469;
    --bs-primary-rgb: 0, 68, 105;
    --bs-link-color: #004469;
    --bs-link-color-rgb: 0, 68, 105;
    --bs-link-hover-color: #003656;
    --bs-link-hover-color-rgb: 0, 54, 86;
}
.btn-primary {
    --bs-btn-bg: #004469; --bs-btn-border-color: #004469;
    --bs-btn-hover-bg: #003656; --bs-btn-hover-border-color: #003656;
    --bs-btn-active-bg: #003656; --bs-btn-active-border-color: #003656;
    --bs-btn-disabled-bg: #004469; --bs-btn-disabled-border-color: #004469;
}
.btn-outline-primary {
    --bs-btn-color: #004469; --bs-btn-border-color: #004469;
    --bs-btn-hover-bg: #004469; --bs-btn-hover-border-color: #004469;
    --bs-btn-active-bg: #004469; --bs-btn-active-border-color: #004469;
}
.form-control:focus, .form-check-input:focus {
    border-color: #3a7ca5;
    box-shadow: 0 0 0 .25rem rgba(0, 68, 105, .2);
}
.form-check-input:checked { background-color: #004469; border-color: #004469; }
.msg-author { color: #004469; }

/* ---- Logo ---- */
.navbar-slc { background-color: #004469; }
.navbar-logo { height: 44px; width: 44px; object-fit: contain; border-radius: 6px; }
.login-card { overflow: hidden; }
.login-logo { background-color: #004469; padding: .5rem 0; }
.login-logo img { width: 230px; max-width: 80%; height: auto; display: block; margin: 0 auto; }

/* ---- Général ---- */
body { background: #f5f6f8; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
footer { flex-shrink: 0; }

/* ---- Messagerie ---- */
.chat-card { display: flex; flex-direction: column; }

#chat-box {
    height: calc(100vh - 290px);
    min-height: 320px;
    overflow-y: auto;
    padding: 1rem;
    background: #e9edf2;
    scroll-behavior: auto;
}
#chat-box.dragover { outline: 3px dashed #0d6efd; outline-offset: -8px; }

.msg { display: flex; margin-bottom: .55rem; }
.msg-me { justify-content: flex-end; }
.msg-other { justify-content: flex-start; }

.msg-bubble {
    max-width: min(75%, 640px);
    padding: .45rem .75rem .3rem;
    border-radius: .9rem;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .08);
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.msg-me .msg-bubble { background: #d6e8ff; border-bottom-right-radius: .25rem; }
.msg-other .msg-bubble { background: #fff; border-bottom-left-radius: .25rem; }

.msg-author { font-size: .78rem; font-weight: 600; color: #0a58ca; margin-bottom: .1rem; }
.msg-body { white-space: normal; }
.msg-time { font-size: .7rem; color: #6c757d; text-align: right; margin-top: .15rem; }

.msg-atts { margin-top: .35rem; display: flex; flex-direction: column; gap: .3rem; }
.msg-file {
    display: inline-block;
    padding: .25rem .5rem;
    border-radius: .4rem;
    background: rgba(0, 0, 0, .05);
    text-decoration: none;
    color: inherit;
    font-size: .9rem;
}
.msg-file:hover { background: rgba(0, 0, 0, .1); }
.msg-img { max-width: 100%; max-height: 240px; border-radius: .5rem; display: block; }

#chat-more-wrap { text-align: center; margin-bottom: .75rem; }

#chat-files .badge { font-weight: normal; }

#chat-form textarea { resize: none; max-height: 8rem; }

/* ---- Liste des conversations ---- */
.conv-row { cursor: pointer; }
.conv-row.unread td { font-weight: 600; }
.conv-preview { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 575.98px) {
    #chat-box { height: calc(100vh - 320px); }
    .msg-bubble { max-width: 88%; }
}
