/* =========================================================================
   DASHBOARD email36 — Theme "Blue SaaS unified" (PRO)
   Chargé APRÈS le <style> inline de index.html (override par cascade).
   Direction validée Yossef Haim 2026-05-29 : bleu #2563eb unifié, clair, auto.
   Doc: DOCS/discussions/web/2026-05-29_Dashboard_email36_Refonte_Design_Pro.md
   ========================================================================= */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-600: #2563eb;
    --app-bg: #f6f8fc;
    --surface: #ffffff;
    --line: #e7ebf3;
    --line-soft: #eef1f7;
    --ring: 0 0 0 3px rgba(37, 99, 235, .18);
    --shadow-card: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
    --shadow-soft: 0 4px 12px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .05);
}

body,
.dashboard {
    background: var(--app-bg);
}

/* ---------- Sidebar : claire ---------- */
.sidebar {
    background: #ffffff;
    border-left: 1px solid var(--line);
    box-shadow: none;
    width: 272px;
}

[dir="ltr"] .sidebar {
    border-left: none;
    border-right: 1px solid var(--line);
    box-shadow: none;
}

.sidebar-header {
    border-bottom: 1px solid var(--line-soft);
    padding: 22px 18px;
    gap: 14px;
}

.sidebar-logo-container {
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.sidebar-logo-img {
    height: 54px;
}

.sidebar-user-phone {
    background: var(--primary-50);
    color: var(--primary-dark);
    font-weight: 700;
    border: 1px solid var(--primary-100);
}

.nav-section-title {
    color: #9aa6bf;
    font-size: .66rem;
    letter-spacing: 1.4px;
}

.nav-item {
    color: #475569;
    border-radius: 11px;
    font-weight: 500;
}

.nav-item:hover {
    background: #f1f5fb;
    color: #0f172a;
}

.nav-item.active {
    background: var(--primary-50);
    color: var(--primary-dark);
    font-weight: 600;
}

.nav-item.active::before {
    background: var(--primary);
    width: 3px;
    height: 62%;
}

.nav-item .badge {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 1px 2px rgba(37, 99, 235, .35);
}

.sidebar-footer {
    border-top: 1px solid var(--line-soft);
}

/* ---------- Icônes SVG monochromes ---------- */
.nav-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 1rem;
}

.nav-item.active .nav-icon {
    color: var(--primary);
}

.nav-item:hover .nav-icon {
    color: #0f172a;
}

.nav-icon svg {
    width: 20px;
    height: 20px;
}

/* ---------- Header ---------- */
.main-header {
    background: rgba(255, 255, 255, .85);
    backdrop-filter: saturate(160%) blur(8px);
    -webkit-backdrop-filter: saturate(160%) blur(8px);
    border-bottom: 1px solid var(--line);
    padding: 14px 26px;
}

.search-box input {
    background: #f3f6fc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    height: 42px;
    transition: all .15s ease;
}

.search-box input:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: var(--ring);
    outline: none;
}

.search-box .search-icon {
    color: #94a3b8;
}

/* ---------- Liste mail ---------- */
.mail-list {
    padding: 6px 14px 14px;
}

.mail-item {
    align-items: center;
    gap: 14px;
    border: 1px solid transparent;
    border-bottom: 1px solid var(--line-soft);
    border-radius: 12px;
    padding: 14px 16px;
    transition: background .12s, box-shadow .12s, border-color .12s;
}

.mail-item:hover {
    background: #fff;
    border-color: var(--line);
    box-shadow: var(--shadow-soft);
}

.mail-item.unread {
    background: linear-gradient(90deg, rgba(37, 99, 235, .05), transparent 60%);
}

.mail-item.unread .mail-sender {
    font-weight: 700;
    color: #0f172a;
}

/* Avatar expéditeur */
.mail-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .95rem;
    color: #fff;
    box-shadow: 0 2px 6px rgba(16, 24, 40, .14);
    letter-spacing: .5px;
    position: relative;
    user-select: none;
}

.mail-item.unread .mail-avatar::after {
    content: "";
    position: absolute;
    top: -2px;
    inset-inline-end: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid #fff;
}

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

.mail-sender {
    font-weight: 600;
    color: #1e293b;
    font-size: .95rem;
}

.mail-date {
    color: #94a3b8;
    font-size: .78rem;
}

.mail-subject {
    color: #334155;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mail-preview {
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-badge {
    background: #f1f5fb;
    color: #475569;
    border: 1px solid var(--line);
    border-radius: 8px;
}

/* Checkbox visible au survol / si coché (pattern pro) */
.mail-checkbox {
    opacity: 0;
    transition: opacity .12s ease;
}

.mail-item:hover .mail-checkbox,
.mail-checkbox:has(input:checked) {
    opacity: 1;
}

/* ---------- Boutons ---------- */
.btn-primary {
    background: var(--primary);
    box-shadow: 0 1px 2px rgba(37, 99, 235, .4);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(37, 99, 235, .35);
}

/* ---------- Accents divers ---------- */
.mail-view-avatar,
.avatar-img {
    box-shadow: 0 2px 6px rgba(16, 24, 40, .12);
}

.empty-state-icon {
    color: var(--primary);
    opacity: .85;
}

.spinner {
    border-top-color: var(--primary);
}

.pagination-page.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

/* ---------- Réglages ---------- */
.settings-nav-btn.active {
    background: var(--primary-50);
    color: var(--primary-dark);
}

.settings-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: #64748b;
    flex: 0 0 auto;
}

.settings-icon svg {
    width: 19px;
    height: 19px;
}

.settings-nav-btn.active .settings-icon {
    color: var(--primary);
}

.settings-card {
    box-shadow: var(--shadow-card);
    border-radius: 14px;
}

/* ---------- Switcher de langue (custom, fin) ---------- */
.lang-switch {
    appearance: none;
    -webkit-appearance: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    border: 1px solid var(--line);
    border-radius: 10px;
    height: 40px;
    font: inherit;
    font-weight: 600;
    font-size: .88rem;
    color: #334155;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}

[dir="ltr"] .lang-switch {
    padding: 0 34px 0 14px;
    background-position: right 11px center;
}

[dir="rtl"] .lang-switch {
    padding: 0 14px 0 34px;
    background-position: left 11px center;
}

.lang-switch:hover {
    border-color: #cbd5e1;
    background-color: #f8fafc;
}

.lang-switch:focus {
    border-color: var(--primary);
    box-shadow: var(--ring);
    outline: none;
}

/* ---------- Sidebar header : carte utilisateur (nom + tel) ---------- */
.sidebar-header {
    padding: 18px 16px 16px;
    gap: 14px;
}

.sidebar-logo-img {
    height: 46px;
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 10px 12px;
    background: var(--primary-50);
    border: 1px solid var(--primary-100);
    border-radius: 13px;
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: .95rem;
    box-shadow: 0 2px 6px rgba(16, 24, 40, .16);
}

.sidebar-user-info {
    min-width: 0;
    flex: 1;
    text-align: start;
}

.sidebar-user-name {
    font-weight: 700;
    font-size: .92rem;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-tel {
    font-size: .8rem;
    font-weight: 600;
    color: var(--primary-dark);
    letter-spacing: .3px;
}

/* ---------- Sidebar : logout propre ---------- */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--line-soft);
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #94a3b8;
    font-size: .9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.sidebar-logout:hover {
    background: #fef2f2;
    color: #dc2626;
}

.sidebar-logout .nav-icon {
    color: inherit;
}

/* ---------- Contacts : avatar gravatar + initiales (fix crop) ---------- */
.contact-avatar {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: .95rem;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(16, 24, 40, .14);
    user-select: none;
}

.contact-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* ---------- Refonte menu Réglages ---------- */
.settings-nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 14px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: #475569;
    font-size: .9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .14s ease;
    text-align: start;
}

.settings-nav-btn:hover {
    background: #f1f5fb;
    color: #0f172a;
}

.settings-nav-btn.active {
    background: var(--primary-50);
    color: var(--primary-dark);
    border-color: var(--primary-100);
    font-weight: 600;
}

.settings-card {
    box-shadow: var(--shadow-card);
    border-radius: 16px;
    border: 1px solid var(--line);
}

.settings-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}

/* ---------- Header affiné ---------- */
.main-header {
    gap: 14px;
}

.search-box {
    max-width: 460px;
    width: 100%;
}

.header-actions {
    gap: 10px;
    align-items: center;
}

.search-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.search-icon svg {
    width: 17px;
    height: 17px;
}

.header-icon-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    color: #475569;
}

.header-icon-btn svg {
    width: 18px;
    height: 18px;
}

.header-spin {
    display: inline-flex;
    animation: pro-spin .8s linear infinite;
}

@keyframes pro-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- FIX CRITIQUE : panneau de lecture invisible en mode anglais (LTR) ----------
   `[dir="ltr"] .mail-view-panel { transform: translateX(-100%) }` (0,2,0) ecrasait
   `.mail-view-panel.open { transform: translateX(0) }` (meme specificite) -> en anglais,
   ouvrir un mail ajoutait .open mais le panneau restait hors-ecran a gauche -> "ne s'ouvre pas".
   On force l'etat ouvert dans les deux directions. */
.mail-view-panel.open {
    transform: translateX(0) !important;
}

/* ---------- FIX CRITIQUE : loading-screen masqué bloquait les clics ----------
   #loading-screen.hidden restait opacity:1/visibility:visible/pointer-events:auto en rendu
   (z-index 9999, plein écran) -> overlay invisible interceptant TOUS les clics du contenu.
   Force le masquage complet une fois la classe .hidden posée par l'app. */
#loading-screen.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    display: none !important;
}

/* ---------- FIX CRITIQUE : toast-container ne doit PAS bloquer les clics ----------
   Deux definitions (.toast-container dans dashboard.css = top+right, et inline = bottom+left)
   fusionnaient en top+bottom+left+right -> l'element s'etirait en plein ecran (1249x1223),
   z-index 2000, pointer-events auto -> interceptait TOUS les clics de la zone contenu.
   On annule l'etirement + pointer-events none sur le conteneur (auto sur les toasts). */
.toast-container {
    top: auto;
    right: auto;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: 92vw;
    pointer-events: none;
    z-index: 3000;
}

.toast-container .toast {
    pointer-events: auto;
}

/* ---------- Vues de contenu en cartes centrées ---------- */
.view-pane {
    width: 100%;
    margin: 20px auto;
    padding: 26px 28px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
}

/* ---------- Liste mail : carte centrée + direction du contenu (hébreu) ---------- */
.mail-list {
    direction: rtl;
    max-width: 1120px;
    width: 100%;
    margin: 16px auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    padding: 6px;
}

.mail-list > div {
    /* wrapper v-for : laisse les items remplir la carte */
    width: 100%;
}

.mail-item:last-child {
    border-bottom: none;
}

/* Etat vide centré dans la carte */
.empty-state {
    direction: rtl;
}

/* ---------- FileCloud : lignes fichiers ---------- */
.file-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    cursor: pointer;
    transition: background .12s, box-shadow .12s, border-color .12s;
}

.file-item:hover {
    background: #fff;
    border-color: var(--line);
    box-shadow: var(--shadow-soft);
}

.file-icon {
    font-size: 30px;
    line-height: 1;
    flex: 0 0 auto;
}

.file-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity .12s;
}

.file-item:hover .file-actions {
    opacity: 1;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--bg-tertiary, #f1f5f9);
    border: 1px solid transparent;
    font-size: 1rem;
    cursor: pointer;
    transition: background .12s, border-color .12s;
}

.btn-icon:hover {
    background: #e2e8f0;
    border-color: var(--line);
}

/* ---------- FileCloud : modale de preview ---------- */
.preview-overlay {
    background: rgba(15, 23, 42, .6);
}

.preview-modal {
    background: var(--surface);
    border-radius: 16px;
    width: min(900px, 94vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}

.preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.preview-name {
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-head-actions {
    display: flex;
    gap: 6px;
    flex: 0 0 auto;
}

.preview-body {
    padding: 18px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: #f8fafc;
}

.preview-img {
    max-width: 100%;
    max-height: 76vh;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}

.preview-video {
    max-width: 100%;
    max-height: 76vh;
    border-radius: 10px;
    background: #000;
}

.preview-frame {
    width: 100%;
    height: 76vh;
    border: none;
    border-radius: 8px;
    background: #fff;
}

.preview-text {
    width: 100%;
    align-self: stretch;
}

.preview-text pre {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: .85rem;
    line-height: 1.5;
    color: #334155;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px;
    max-height: 76vh;
    overflow: auto;
    margin: 0;
}

.preview-none {
    text-align: center;
    padding: 30px;
}

/* ---------- Modale de confirmation non-bloquante ---------- */
.ask-modal {
    max-width: 420px;
    width: 92vw;
    text-align: center;
    padding: 26px 24px 22px;
}

.ask-message {
    font-size: 1rem;
    color: #1e293b;
    line-height: 1.5;
    margin: 0 0 22px;
}

.ask-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.ask-actions .btn {
    min-width: 110px;
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
    .mail-avatar {
        width: 38px;
        height: 38px;
        font-size: .85rem;
    }

    .file-actions {
        opacity: 1;
    }

    .preview-frame,
    .preview-img,
    .preview-video,
    .preview-text pre {
        max-height: 70vh;
    }

    .mail-list {
        margin: 10px;
        border-radius: 14px;
    }

    .search-box {
        max-width: none;
    }
}

/* ======================================================================
   PREMIUM PASS — niveau "50M users" (overrides finaux, chargés en dernier)
   ====================================================================== */
:root {
    --app-bg: #f4f6fb;
    --line: #e9edf5;
    --line-soft: #eff2f8;
    --shadow-card: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 10px rgba(16, 24, 40, .05);
    --shadow-soft: 0 8px 24px rgba(16, 24, 40, .08), 0 2px 6px rgba(16, 24, 40, .05);
}

/* ---- Sidebar premium ---- */
.sidebar {
    width: 278px;
    background: #ffffff;
    border-color: var(--line);
}

.sidebar-header {
    padding: 20px 16px 12px;
}

.sidebar-user-card {
    background: #f5f8fe;
    border: 1px solid #eaf0fb;
    border-radius: 14px;
    padding: 11px 12px;
}

.sidebar-user-avatar {
    box-shadow: 0 0 0 3px #fff, 0 3px 8px rgba(37, 99, 235, .22);
}

.nav-section-title {
    font-size: .67rem;
    letter-spacing: 1.6px;
    color: #aab4cb;
    margin: 16px 6px 6px;
}

.nav-item {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: .92rem;
    margin-bottom: 3px;
}

.nav-item.active {
    background: var(--primary-50);
    color: var(--primary-dark);
    font-weight: 600;
}

.nav-item.active::before {
    display: none;
}

.nav-item .badge {
    background: var(--primary);
    box-shadow: none;
}

/* ---- Header premium ---- */
.main-header {
    padding: 15px 28px;
    background: rgba(255, 255, 255, .9);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 0 rgba(16, 24, 40, .03);
}

.search-box input {
    height: 44px;
    border-radius: 13px;
    background: #f1f5fc;
    font-size: .92rem;
}

/* ---- Profondeur des surfaces ---- */
.mail-list,
.view-pane,
.settings-card {
    box-shadow: var(--shadow-soft);
    border-radius: 18px;
}

.mail-item {
    border-radius: 13px;
}

.mail-item:hover {
    box-shadow: 0 6px 18px rgba(16, 24, 40, .07);
}

/* ---- Boutons premium ---- */
.btn-primary {
    border-radius: 11px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, .28);
}

.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(37, 99, 235, .32);
}

/* ---- Avatars mail : anneau blanc ---- */
.mail-avatar {
    box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(16, 24, 40, .14);
}

/* ======================================================================
   PREMIUM v2 — header, vue mail ouvert, typo/densité, DARK MODE
   ====================================================================== */

/* ---- Header premium ---- */
.header-title {
    font-size: 1.18rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -.01em;
    white-space: nowrap;
    flex: 0 0 auto;
}

.search-box {
    flex: 1 1 auto;
    max-width: 520px;
    margin-inline: auto;
}

.header-compose {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 18px;
    border-radius: 12px;
    font-weight: 600;
    font-size: .92rem;
    white-space: nowrap;
}

.header-compose svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 820px) {
    .header-title { display: none; }
    .header-compose-label { display: none; }
    .header-compose { width: 44px; padding: 0; justify-content: center; }
}

/* ---- Vue mail ouvert (premium) ---- */
.mvp { display: flex; flex-direction: column; height: 100%; background: var(--surface); }
.mvp-head { display: flex; align-items: center; gap: 14px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.mvp-back { width: 40px; height: 40px; border: none; border-radius: 11px; background: #f1f5fb; color: #475569; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background .14s; }
.mvp-back:hover { background: #e2e8f0; }
.mvp-back svg { width: 20px; height: 20px; }
[dir="rtl"] .mvp-back svg { transform: scaleX(-1); }
.mvp-subject { flex: 1; margin: 0; font-size: 1.15rem; font-weight: 700; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mvp-sender { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.mvp-avatar { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 1.1rem; flex: 0 0 auto; box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(16, 24, 40, .16); }
.mvp-sender-info { min-width: 0; }
.mvp-sender-name { font-weight: 700; color: #0f172a; font-size: 1rem; }
.mvp-sender-meta { font-size: .82rem; color: #94a3b8; }
.mvp-body { flex: 1; padding: 24px 26px; overflow-y: auto; }
.mvp-content { line-height: 1.75; color: #1e293b; font-size: .95rem; word-break: break-word; }
.mvp-content img { max-width: 100%; height: auto; }
.mvp-attachments { margin-bottom: 20px; padding: 14px 16px; background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; }
.mvp-attachments-title { font-weight: 600; font-size: .82rem; color: #64748b; margin-bottom: 8px; }
.mvp-attachments-list { display: flex; flex-wrap: wrap; gap: 8px; }
.mail-view-panel { width: 62%; max-width: 780px; box-shadow: -16px 0 56px rgba(16, 24, 40, .18); }
[dir="ltr"] .mail-view-panel { box-shadow: 16px 0 56px rgba(16, 24, 40, .18); }

/* ---- Typographie / densité ---- */
body { font-size: 15px; color: #1e293b; }
.form-label { font-weight: 600; font-size: .85rem; color: #475569; }
.form-input { border-radius: 11px; }

/* ======================================================================
   DARK MODE soigné (suit l'OS — thème Auto)
   ====================================================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --app-bg: #0b1120;
        --surface: #141d2e;
        --line: #26324a;
        --line-soft: #1d2840;
        --primary-50: #15233f;
        --primary-100: #1e3358;
        --primary-dark: #93c5fd;
        --shadow-card: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 10px rgba(0, 0, 0, .35);
        --shadow-soft: 0 10px 30px rgba(0, 0, 0, .45);
    }

    body { color: #e2e8f0; }
    body, .dashboard { background: var(--app-bg); }

    .sidebar { background: #0f1626; border-color: #1f2a3d; }
    .sidebar-header { border-color: #1f2a3d; }
    .sidebar-user-card { background: #16213a; border-color: #24345a; }
    .sidebar-user-name { color: #f1f5f9; }
    .sidebar-user-tel { color: #93c5fd; }
    .nav-section-title { color: #5b6b8a; }
    .nav-item { color: #9aa6c0; }
    .nav-item:hover { background: #1a2540; color: #fff; }
    .nav-item:hover .nav-icon { color: #fff; }
    .nav-item.active { background: #16233f; color: #bfdbfe; }
    .nav-item.active .nav-icon { color: #bfdbfe; }
    .sidebar-footer { border-color: #1f2a3d; }
    .sidebar-logout { color: #6b7a96; }
    .sidebar-logout:hover { background: #3a1c1c; color: #fca5a5; }

    .main-header { background: rgba(15, 22, 38, .92); border-color: #1f2a3d; }
    .header-title { color: #f1f5f9; }
    .search-box input { background: #1a2540; border-color: #26324a; color: #e2e8f0; }
    .search-box input:focus { background: #0f1626; }
    .search-box .search-icon, .header-icon-btn { color: #8aa0c6; }
    .header-icon-btn { background: #1a2540; }

    .mail-list, .view-pane, .settings-card, .mvp, .preview-modal, .modal-content, .ask-modal { background: var(--surface); }
    .mail-item { border-bottom-color: #1f2a3d; }
    .mail-item:hover { background: #1a2540; border-color: #26324a; }
    .mail-item.unread { background: linear-gradient(90deg, rgba(59, 130, 246, .14), transparent 60%); }
    .mail-sender { color: #cbd5e1; }
    .mail-item.unread .mail-sender { color: #fff; }
    .mail-subject { color: #cbd5e1; }
    .mail-preview, .mail-date { color: #748099; }

    .mvp-head, .mvp-sender { border-color: #26324a; }
    .mvp-subject, .mvp-sender-name { color: #f1f5f9; }
    .mvp-sender-meta { color: #8aa0c6; }
    .mvp-content { color: #d8dee9; }
    .mvp-back { background: #1a2540; color: #cbd5e1; }
    .mvp-back:hover { background: #243150; }
    .mvp-attachments { background: #16213a; border-color: #26324a; }

    .file-item { background: #16213a; border-color: #1f2a3d; }
    .file-item:hover { background: #1a2540; border-color: #26324a; }
    .preview-body { background: #0f1626; }
    .preview-head { border-color: #26324a; }
    .preview-name { color: #e2e8f0; }
    .preview-text pre { background: #0f1626; border-color: #26324a; color: #cbd5e1; }

    .form-input, .lang-switch { background: #1a2540 !important; border-color: #26324a; color: #e2e8f0; }
    .settings-nav-btn { color: #9aa6c0; }
    .settings-nav-btn:hover { background: #1a2540; color: #fff; }
    .settings-nav-btn.active { background: #16233f; color: #bfdbfe; }
    .settings-section-title { color: #f1f5f9; }
    .ask-message { color: #e2e8f0; }
    .attachment-badge { background: #16213a; border-color: #26324a; color: #cbd5e1; }
    h2, h3 { color: #f1f5f9; }
}
