/* ============================================================
   VISION CONSEILS — main.css v2.0
   Design system : Navy (#1A2B4A) + Gold (#C8A951) + Light (#F5F3EE)
   ============================================================ */

:root {
    /* ── Palette ──────────────────────────────────────────── */
    --navy:        #1A2B4A;
    --navy-dark:   #0F1A2E;
    --navy-light:  #2D4267;
    --gold:        #C8A951;
    --gold-dark:   #A8893B;
    --gold-light:  #E5C875;
    --cream:       #F5F3EE;
    --white:       #FFFFFF;
    --black:       #1C1C1E;

    /* ── Statuts ──────────────────────────────────────────── */
    --success:     #059669;
    --success-bg:  #ECFDF5;
    --warning:     #D97706;
    --warning-bg:  #FFFBEB;
    --danger:      #DC2626;
    --danger-bg:   #FEF2F2;
    --info:        #2563EB;
    --info-bg:     #EFF6FF;

    /* ── Gris ─────────────────────────────────────────────── */
    --g50:  #F9FAFB;
    --g100: #F3F4F6;
    --g200: #E5E7EB;
    --g300: #D1D5DB;
    --g400: #9CA3AF;
    --g500: #6B7280;
    --g600: #4B5563;
    --g700: #374151;
    --g800: #1F2937;
    --g900: #111827;

    /* ── Layout ───────────────────────────────────────────── */
    --sidebar-w:        260px;
    --sidebar-w-mob:    240px;
    --header-h:         60px;
    --radius-sm:        4px;
    --radius:           8px;
    --radius-lg:        12px;
    --radius-xl:        16px;
    --shadow-sm:        0 1px 2px rgba(0,0,0,.05);
    --shadow:           0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -2px rgba(0,0,0,.05);
    --shadow-lg:        0 10px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.08);
    --shadow-xl:        0 25px 50px -12px rgba(0,0,0,.25);

    /* ── Typography ───────────────────────────────────────── */
    --font:  -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --mono:  ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, Consolas, monospace;

    /* ── Transitions ──────────────────────────────────────── */
    --t-fast:    150ms ease;
    --t:         250ms ease;
    --t-slow:    400ms ease;
}

/* ─── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; font-size: 14px; }
body {
    font-family: var(--font);
    line-height: 1.5;
    color: var(--g900);
    background: var(--cream);
    min-height: 100vh;
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--gold-dark); }

/* ─── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--g100); }
::-webkit-scrollbar-thumb { background: var(--g400); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--g500); }

/* ─── Layout principal ─────────────────────────────────────── */
.app-layout {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: var(--header-h) 1fr;
    grid-template-areas:
        "sidebar header"
        "sidebar main";
    min-height: 100vh;
}
.app-layout.no-sidebar {
    grid-template-columns: 1fr;
    grid-template-areas: "header" "main";
}

/* ─── Sidebar ──────────────────────────────────────────────── */
.sidebar {
    grid-area: sidebar;
    background: var(--navy);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
}
.sidebar-brand {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    gap: .75rem;
}
.sidebar-brand img { width: 32px; height: 32px; border-radius: 6px; }
.sidebar-brand-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .5px;
    color: var(--white);
}
.sidebar-brand-sub {
    font-size: 11px;
    color: rgba(255,255,255,.55);
    margin-top: 1px;
}
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}
.sidebar-section-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,.4);
    padding: 1rem 1.25rem .35rem;
    font-weight: 600;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem 1.25rem;
    color: rgba(255,255,255,.7);
    font-size: 13px;
    font-weight: 500;
    transition: var(--t-fast);
    position: relative;
    border-left: 3px solid transparent;
}
.sidebar-link:hover {
    background: rgba(255,255,255,.05);
    color: var(--white);
}
.sidebar-link.active {
    background: rgba(200,169,81,.1);
    color: var(--gold);
    border-left-color: var(--gold);
}
.sidebar-link-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.sidebar-link-badge {
    margin-left: auto;
    background: var(--danger);
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}
.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,.08);
    font-size: 11px;
    color: rgba(255,255,255,.4);
}

/* ─── Header ───────────────────────────────────────────────── */
.header {
    grid-area: header;
    background: var(--white);
    border-bottom: 1px solid var(--g200);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--shadow-sm);
}
.header-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--navy);
    flex: 1;
}
.header-actions { display: flex; align-items: center; gap: .75rem; }
.header-icon-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    color: var(--g600);
    position: relative;
    transition: var(--t-fast);
}
.header-icon-btn:hover { background: var(--g100); color: var(--navy); }
.header-icon-btn .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger);
    color: var(--white);
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}
.header-user {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .35rem .75rem;
    border-radius: var(--radius);
    cursor: pointer;
}
.header-user:hover { background: var(--g100); }
.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--navy);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }

/* ─── Main ─────────────────────────────────────────────────── */
.main {
    grid-area: main;
    padding: 1.5rem;
    overflow-y: auto;
}
.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: .25rem;
}
.page-subtitle {
    font-size: 13px;
    color: var(--g500);
    margin-bottom: 1.5rem;
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ─── Cards ────────────────────────────────────────────────── */
.card {
    background: var(--white);
    border: 1px solid var(--g200);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--g100);
}
.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--navy);
}

/* ─── KPI Cards ────────────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.kpi {
    background: var(--white);
    border: 1px solid var(--g200);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border-left: 3px solid var(--gold);
    position: relative;
}
.kpi-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--g500);
    margin-bottom: .5rem;
    font-weight: 600;
}
.kpi-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.1;
}
.kpi-unit { font-size: 14px; color: var(--g500); margin-left: 2px; }
.kpi-trend { font-size: 12px; margin-top: .35rem; }
.kpi-trend.up   { color: var(--success); }
.kpi-trend.down { color: var(--danger); }

/* ─── Boutons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem 1.25rem;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    transition: var(--t-fast);
    border: 1px solid transparent;
    white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
    background: var(--navy);
    color: var(--white);
}
.btn-primary:hover:not(:disabled) { background: var(--navy-dark); transform: translateY(-1px); }
.btn-gold {
    background: var(--gold);
    color: var(--navy);
}
.btn-gold:hover:not(:disabled) { background: var(--gold-dark); color: var(--white); }
.btn-outline {
    border-color: var(--g300);
    background: var(--white);
    color: var(--g700);
}
.btn-outline:hover:not(:disabled) { border-color: var(--navy); color: var(--navy); }
.btn-danger {
    background: var(--danger);
    color: var(--white);
}
.btn-danger:hover:not(:disabled) { background: #B91C1C; }
.btn-success {
    background: var(--success);
    color: var(--white);
}
.btn-ghost {
    color: var(--g600);
}
.btn-ghost:hover { background: var(--g100); color: var(--navy); }
.btn-sm { padding: .35rem .85rem; font-size: 12px; }
.btn-lg { padding: .75rem 1.5rem; font-size: 14px; }
.btn-block { width: 100%; justify-content: center; }

/* ─── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--g700);
    margin-bottom: .35rem;
}
.form-label.required::after {
    content: ' *';
    color: var(--danger);
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: .55rem .85rem;
    border: 1px solid var(--g300);
    border-radius: var(--radius);
    background: var(--white);
    font-size: 13px;
    transition: var(--t-fast);
    color: var(--g900);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(26,43,74,.1);
}
.form-input.error { border-color: var(--danger); }
.form-input.error:focus { box-shadow: 0 0 0 3px rgba(220,38,38,.1); }
.form-help { font-size: 11px; color: var(--g500); margin-top: .25rem; }
.form-error { font-size: 11px; color: var(--danger); margin-top: .25rem; }
.form-textarea { resize: vertical; min-height: 80px; font-family: var(--font); }
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* ─── Tables ───────────────────────────────────────────────── */
.table-wrapper {
    background: var(--white);
    border: 1px solid var(--g200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    overflow-x: auto;
}
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th {
    background: var(--g50);
    padding: .75rem 1rem;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--g600);
    border-bottom: 1px solid var(--g200);
    white-space: nowrap;
}
.table td {
    padding: .85rem 1rem;
    font-size: 13px;
    border-bottom: 1px solid var(--g100);
    color: var(--g900);
}
.table tbody tr:hover { background: var(--g50); }
.table tbody tr:last-child td { border-bottom: none; }
.table-actions {
    display: flex;
    gap: .35rem;
    justify-content: flex-end;
}

/* ─── Badges ───────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.badge-navy    { background: rgba(26,43,74,.1);  color: var(--navy); }
.badge-gold    { background: rgba(200,169,81,.15);color: var(--gold-dark); }
.badge-success { background: var(--success-bg);   color: var(--success); }
.badge-warning { background: var(--warning-bg);   color: var(--warning); }
.badge-danger  { background: var(--danger-bg);    color: var(--danger); }
.badge-info    { background: var(--info-bg);      color: var(--info); }
.badge-grey    { background: var(--g100);         color: var(--g600); }

/* ─── Alertes ──────────────────────────────────────────────── */
.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 1rem;
    border-left: 3px solid;
}
.alert-success { background: var(--success-bg); border-color: var(--success); color: #064E3B; }
.alert-warning { background: var(--warning-bg); border-color: var(--warning); color: #78350F; }
.alert-danger  { background: var(--danger-bg);  border-color: var(--danger);  color: #7F1D1D; }
.alert-info    { background: var(--info-bg);    border-color: var(--info);    color: #1E3A8A; }

/* ─── Modal ────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn .2s ease;
}
.modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    max-width: 540px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp .25s ease;
}
.modal.modal-lg { max-width: 720px; }
.modal.modal-xl { max-width: 960px; }
.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--g100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--navy);
}
.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    color: var(--g500);
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-close:hover { background: var(--g100); color: var(--danger); }
.modal-body { padding: 1.5rem; }
.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--g100);
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Toasts ───────────────────────────────────────────────── */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    pointer-events: none;
}
.toast {
    background: var(--white);
    border: 1px solid var(--g200);
    border-left: 3px solid var(--navy);
    border-radius: var(--radius);
    padding: .85rem 1.25rem;
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    max-width: 380px;
    pointer-events: auto;
    animation: slideInRight .25s ease;
}
.toast.toast-success { border-left-color: var(--success); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-danger  { border-left-color: var(--danger); }
.toast.toast-info    { border-left-color: var(--info); }
.toast.fade-out { animation: slideOutRight .25s ease forwards; }
@keyframes slideInRight  { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOutRight { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }

/* ─── Login page ───────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--cream);
}
.login-brand {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: var(--white);
    position: relative;
    overflow: hidden;
}
.login-brand::before {
    content: '';
    position: absolute;
    top: -50%; right: -30%;
    width: 70%; height: 200%;
    background: radial-gradient(circle, rgba(200,169,81,.15) 0%, transparent 70%);
}
.login-brand-content { position: relative; z-index: 1; }
.login-brand h1 { font-size: 38px; font-weight: 800; line-height: 1.1; margin-bottom: 1rem; }
.login-brand h1 span { color: var(--gold); }
.login-brand p { font-size: 15px; opacity: .8; max-width: 360px; line-height: 1.6; }
.login-brand-footer { font-size: 12px; opacity: .5; position: relative; z-index: 1; }

.login-form-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}
.login-form {
    width: 100%;
    max-width: 400px;
}
.login-form h2 { font-size: 24px; font-weight: 700; color: var(--navy); margin-bottom: .5rem; }
.login-form .subtitle { font-size: 14px; color: var(--g500); margin-bottom: 2rem; }

.welcome-banner {
    background: linear-gradient(135deg, rgba(200,169,81,.1), rgba(26,43,74,.05));
    border: 1px solid var(--gold);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideUp .3s ease;
}
.welcome-banner .avatar { background: var(--gold); color: var(--navy); }
.welcome-banner-text strong { color: var(--navy); display: block; font-size: 14px; }
.welcome-banner-text span { font-size: 12px; color: var(--g600); }

/* ─── Empty states ─────────────────────────────────────────── */
.empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--g500);
}
.empty-icon { font-size: 48px; margin-bottom: 1rem; opacity: .4; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--g700); margin-bottom: .35rem; }
.empty-text { font-size: 13px; }

/* ─── Loader ───────────────────────────────────────────────── */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--g200);
    border-top-color: var(--navy);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
    position: relative;
    min-height: 200px;
}

/* ─── Equilibre indicator (saisie écritures) ───────────────── */
.balance-indicator {
    background: var(--white);
    border: 1px solid var(--g200);
    border-radius: var(--radius-lg);
    padding: .85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    bottom: 1rem;
    box-shadow: var(--shadow-lg);
    z-index: 50;
}
.balance-indicator.balanced { border-color: var(--success); background: var(--success-bg); }
.balance-indicator.unbalanced { border-color: var(--danger); background: var(--danger-bg); }
.balance-item { font-size: 13px; }
.balance-item strong { display: block; font-size: 16px; font-weight: 700; color: var(--navy); }

/* ─── Messagerie ───────────────────────────────────────────── */
.chat-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    background: var(--white);
    border: 1px solid var(--g200);
    border-radius: var(--radius-lg);
    height: calc(100vh - 180px);
    min-height: 500px;
    overflow: hidden;
}
.chat-sidebar { border-right: 1px solid var(--g200); overflow-y: auto; }
.chat-item {
    padding: 1rem;
    border-bottom: 1px solid var(--g100);
    cursor: pointer;
    transition: var(--t-fast);
    position: relative;
}
.chat-item:hover { background: var(--g50); }
.chat-item.active { background: rgba(200,169,81,.08); border-left: 3px solid var(--gold); }
.chat-item.urgent { background: var(--danger-bg); border-left: 3px solid var(--danger); }
.chat-item-title { font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 2px; }
.chat-item-preview { font-size: 11px; color: var(--g500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--danger);
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
}
.chat-main {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.chat-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--g200);
    display: flex;
    align-items: center;
    gap: .75rem;
}
.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    background: var(--cream);
}
.chat-message {
    margin-bottom: 1rem;
    max-width: 70%;
}
.chat-message.mine { margin-left: auto; }
.chat-message.urgent .chat-bubble { border: 2px solid var(--danger); background: var(--danger-bg); }
.chat-bubble {
    padding: .75rem 1rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    font-size: 13px;
    box-shadow: var(--shadow-sm);
}
.mine .chat-bubble { background: var(--navy); color: var(--white); }
.chat-meta { font-size: 10px; color: var(--g500); margin-top: 3px; padding: 0 4px; }
.chat-input {
    padding: 1rem;
    border-top: 1px solid var(--g200);
    background: var(--white);
}

/* ─── Onboarding ───────────────────────────────────────────── */
.onboarding-wizard {
    max-width: 480px;
    margin: 0 auto;
    padding: 2rem;
}
.onboarding-progress {
    display: flex;
    gap: .5rem;
    margin-bottom: 2rem;
}
.onboarding-step {
    flex: 1;
    height: 4px;
    background: var(--g200);
    border-radius: 2px;
}
.onboarding-step.active { background: var(--gold); }
.onboarding-step.done { background: var(--success); }

/* ─── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
    .login-page { grid-template-columns: 1fr; }
    .login-brand { display: none; }
}

@media (max-width: 768px) {
    .app-layout {
        grid-template-columns: 1fr;
        grid-template-areas: "header" "main";
    }
    .sidebar {
        position: fixed;
        left: 0; top: 0;
        height: 100vh;
        width: var(--sidebar-w-mob);
        transform: translateX(-100%);
        transition: transform var(--t);
        box-shadow: var(--shadow-xl);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay {
        position: fixed; inset: 0;
        background: rgba(0,0,0,.4);
        z-index: 99;
        opacity: 0;
        pointer-events: none;
        transition: var(--t);
    }
    .sidebar-overlay.open { opacity: 1; pointer-events: auto; }
    .header-toggle-sidebar { display: flex; }
    .main { padding: 1rem; }
    .chat-container { grid-template-columns: 1fr; }
    .chat-sidebar { display: none; }
    .chat-sidebar.mobile-show { display: block; }
}

@media (min-width: 769px) {
    .header-toggle-sidebar { display: none; }
}

/* ─── Utilitaires ──────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.flex-1 { flex: 1; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-navy { color: var(--navy); }
.text-gold { color: var(--gold-dark); }
.text-grey { color: var(--g500); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.mb-1 { margin-bottom: .25rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: .75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: .5rem; }
.mt-4 { margin-top: 1rem; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.divider { height: 1px; background: var(--g200); margin: 1rem 0; }
