/* ============================================================
   CASAQ ADMIN — admin.css
   Chargé dans base.html.twig après AdminLTE.
   Zéro style inline dans les templates.
   ============================================================ */

/* ── Variables ────────────────────────────────────────────── */
:root {
    --brand:          #2563eb;
    --brand-dark:     #1d4ed8;
    --brand-light:    #eff6ff;
    --sidebar-bg:     #0f172a;
    --sidebar-border: #1e293b;
    --sidebar-muted:  #475569;
    --sidebar-text:   #94a3b8;
    --nav-h:          58px;
    --text:           #1e293b;
    --text-muted:     #64748b;
    --text-light:     #94a3b8;
    --border:         #e2e8f0;
    --bg:             #f1f5f9;
    --bg-card:        #ffffff;
    --bg-table-head:  #f8fafc;
    --radius:         10px;
    --radius-sm:      8px;
    --radius-pill:    20px;
    --shadow-sm:      0 1px 3px rgba(0,0,0,.08);
    --shadow-md:      0 4px 16px rgba(0,0,0,.10);

    /* Couleurs sémantiques */
    --success:        #16a34a;
    --success-bg:     #f0fdf4;
    --danger:         #dc2626;
    --danger-bg:      #fef2f2;
    --warning:        #ca8a04;
    --warning-bg:     #fefce8;
    --info:           #2563eb;
    --info-bg:        #eff6ff;
    --purple:         #9333ea;
    --purple-bg:      #fdf4ff;
    --gray:           #64748b;
    --gray-bg:        #f1f5f9;
}
/*.theme-agence {*/
/*    --brand: #ac0000;*/
/*    --brand-dark: #770303;*/
/*    --brand-light: #eff6ff;*/
/*}*/

.theme-agence {
    --brand:          #e60000;
    --brand-dark:     #c30000;
    --brand-light:    #fff0f0;

    --sidebar-bg:     #1d1b25;
    --sidebar-border: #2e2b38;
    --sidebar-muted:  #6b6878;
    --sidebar-text:   #c8c6d2;

    --bg:             #e7e7e9;
    --bg-card:        #ffffff;
    --bg-table-head:  #f6f6f7;

    --text:           #1d1b25;
    --text-muted:     #6b6878;
    --text-light:     #a8a6b4;

    --border:         #dcdcde;

    --info:           #e60000;
    --info-bg:        #fff0f0;

    --purple:         #b30000;
    --purple-bg:      #fff0f0;

    --gray:           #6b6878;
    --gray-bg:        #f0f0f2;

    --shadow-sm:      0 1px 3px rgba(29, 27, 37, .07);
    --shadow-md:      0 4px 16px rgba(29, 27, 37, .10);
}

/* ── Sidebar ── */
.theme-agence .nav-sidebar .nav-link:hover,
.theme-agence .nav-sidebar .nav-link.active {
    background: rgba(255,255,255,.1) !important;
    color: #fff !important;
}
.theme-agence .nav-sidebar .nav-link.active {
    color: #ffb3b3 !important;
}
.theme-agence .sidebar-agence-selector {
    background: rgba(230, 0, 0, .10);
    border-color: rgba(230, 0, 0, .20);
}
.theme-agence .sidebar-agence-selector i,
.theme-agence .sidebar-agence-name {
    color: #ffb3b3;
}
.theme-agence .sidebar-logo-icon {
    background: #e60000;
}

/* ── Focus / inputs ── */
.theme-agence .form-control-admin:focus,
.theme-agence .form-group-c .form-control:focus,
.theme-agence #globalSearchInput:focus,
.theme-agence .pdf-search:focus,
.theme-agence .media-search input:focus,
.theme-agence .file-search input:focus {
    border-color: #e60000;
    box-shadow: 0 0 0 3px rgba(230, 0, 0, .10);
}

/* ── Select2 ── */
.theme-agence .select2-container--default.select2-container--focus .select2-selection--multiple,
.theme-agence .select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: #e60000;
    box-shadow: 0 0 0 3px rgba(230, 0, 0, .10);
}
.theme-agence .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: #fff0f0;
    border-color: rgba(230, 0, 0, .18);
    color: #e60000;
}
.theme-agence .select2-results__option--highlighted {
    background: #fff0f0 !important;
    color: #e60000 !important;
}

/* ── Boutons ── */
.theme-agence .btn-primary,
.theme-agence .bg-primary,
.theme-agence .badge-primary {
    background-color: #e60000 !important;
    border-color: #e60000 !important;
}
.theme-agence .btn-primary:hover,
.theme-agence .btn-primary:focus {
    background-color: #c30000 !important;
    border-color: #c30000 !important;
}

/* ── Nav contact / bien (border-left active) ── */
.theme-agence .contact-nav-item.active,
.theme-agence .bien-nav-item.active {
    border-left-color: #e60000;
    color: #e60000;
    background: #fff0f0;
}
.theme-agence .contact-nav-item:hover,
.theme-agence .bien-nav-item:hover {
    color: #e60000;
    background: #fff0f0;
}

/* ── Deal selector ── */
.theme-agence .deal-opt.selected-sale {
    border-color: #e60000;
    background: #fff0f0;
    color: #e60000;
}

/* ── Badges / statuts ── */
.theme-agence .badge-abo-ok { background: #fff0f0; color: #e60000; }
.theme-agence .badge-role-agent { background: #e8f5e9; color: #16a34a; }

/* ── Activités ── */
.theme-agence .act-icon--demande,
.theme-agence .act-icon--rappel,
.theme-agence .act-icon--contact {
    background: #fff0f0;
    color: #e60000;
}

/* ── Dashboard KPI ── */
.theme-agence .kpi-blue,
.theme-agence .kpi-purple { background: #e60000; }
.theme-agence .ca-blue,
.theme-agence .ca-purple  { border-top-color: #e60000; }

/* ── Upload progress ── */
.theme-agence .upload-progress-bar,
.theme-agence .file-upload-progress-bar { background: #e60000; }

/* ── Alerts info ── */
.theme-agence .alert-info {
    background: #fff0f0;
    color: #c30000;
}

/* ── Form section icon ── */
.theme-agence .form-section-title i { color: #e60000; }
.theme-agence .card-icon { background: #fff0f0; color: #e60000; }

/* ── Links ── */

.theme-agence a:not(.btn):not(.nav-link):hover {
    color: #c30000;
}

/* ── Breadcrumb ── */
.theme-agence .breadcrumb-item a { color: #e60000; }

/* ── Pagination active ── */
.theme-agence .page-item.active .page-link {
    background: #e60000;
    border-color: #e60000;
}
.theme-agence .page-link { color: #e60000; }

/* ── Tabs active ── */
.theme-agence .detail-tab.active {
    color: #e60000;
    border-bottom-color: #e60000;
}
.theme-agence .detail-tab:hover { color: #e60000; background: #fff0f0; }
.theme-agence .detail-tab.active .tab-badge {
    background: #fff0f0;
    color: #e60000;
}

/* ── Cq-sel-count (commodités) ── */
.theme-agence .cq-sel-count { background: #e60000; }

/* ── Role cards ── */
.theme-agence .role-card:hover,
.theme-agence .role-card.selected,
.theme-agence .role-card:has(.role-card-input:checked) {
    border-color: #e60000;
    background: #fff0f0;
}
.theme-agence .role-card-icon { background: #fff0f0; color: #e60000; }
.theme-agence .role-card.selected .role-card-icon { background: #e60000; color: #fff; }

/* ── Search cards (critères contact) ── */
.theme-agence .search-badge--active { background: #e8f5e9; color: #16a34a; }
.theme-agence .search-card-icon--sale { background: #fff0f0; color: #e60000; }


.theme-admin {
    /* Couleur principale */
    --brand: #7c3aed;
    --brand-dark: #6d28d9;
    --brand-light: #f5f3ff;

    /* 👉 PLUS IMPORTANT : différencier l’ambiance */
    --sidebar-bg: #1e1b4b;        /* violet très foncé */
    --sidebar-border: #312e81;
    --sidebar-muted: #6366f1;
    --sidebar-text: #c7d2fe;

    --bg: #f8fafc;
    --bg-card: #ffffff;

    /* Accent secondaire */
    --purple: #8b5cf6;
    --info: #6366f1;
}

/* ── Reset / base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
}

/* ============================================================
   NAVBAR
   ============================================================ */
.main-header.navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    min-height: var(--nav-h);
    box-shadow: var(--shadow-sm);
    padding: 0 1.25rem;
}

.navbar-brand-custom {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--brand) !important;
    letter-spacing: -.3px;
    text-decoration: none;
}

.navbar-brand-icon {
    width: 32px;
    height: 32px;
    background: var(--brand);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 15px;
    flex-shrink: 0;
}

.navbar-nav .nav-link {
    color: var(--text-muted) !important;
    padding: .35rem .65rem !important;
    border-radius: var(--radius-sm);
    transition: background .15s, color .15s;
}
.navbar-nav .nav-link:hover {
    background: var(--brand-light);
    color: var(--brand) !important;
}

/* ── Avatar ── */
.avatar {
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--purple));
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.avatar-sm  { width: 28px; height: 28px; font-size: 11px; }
.avatar-md  { width: 34px; height: 34px; font-size: 13px; }
.avatar-lg  { width: 52px; height: 52px; font-size: 20px; }
.avatar-xl  { width: 60px; height: 60px; font-size: 24px; }
.avatar-square    { border-radius: var(--radius-sm); }
.avatar-square-lg { border-radius: 14px; }

/* ── Dropdown ── */
.dropdown-menu-admin {
    min-width: 200px;
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    border: 1px solid var(--border);
    padding: .5rem;
}
.dropdown-menu-admin .dropdown-item {
    border-radius: 7px;
    font-size: 13px;
    padding: 7px 12px;
}
.dropdown-menu-admin .dropdown-divider { border-color: var(--border); margin: .5rem 0; }
.dropdown-menu-admin .dropdown-header {
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: .25rem;
}
.dropdown-header-label  { font-size: 12px; color: var(--text-muted); }
.dropdown-header-value  { font-size: 13px; font-weight: 600; color: var(--text); }

/* ============================================================
   SIDEBAR
   ============================================================ */
.main-sidebar {
    background: var(--sidebar-bg) !important;
    width: 260px !important;
    box-shadow: 4px 0 24px rgba(0,0,0,.18);
}
.brand-link { display: none; }
.sidebar { padding: .5rem 0; }

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--sidebar-border);
    margin-bottom: .5rem;
}
.sidebar-logo-icon {
    width: 36px;
    height: 36px;
    background: var(--brand);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    color: #fff;
    flex-shrink: 0;
}
.sidebar-logo-name  { font-weight: 700; font-size: 15px; color: #fff; line-height: 1.1; }
.sidebar-logo-sub   { font-size: 10px; color: var(--sidebar-muted); letter-spacing: .5px; }

/* Nav items */
.nav-sidebar .nav-header {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--sidebar-muted);
    padding: 1.2rem 1.2rem .4rem;
}
.nav-sidebar .nav-item  { margin: 2px 10px; }
.nav-sidebar .nav-link  {
    border-radius: var(--radius-sm) !important;
    padding: 9px 14px !important;
    color: var(--sidebar-text) !important;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all .15s;
}
.nav-sidebar .nav-link:hover,
.nav-sidebar .nav-link.active {
    background: rgba(37,99,235,.18) !important;
    color: #fff !important;
}
.nav-sidebar .nav-link.active { color: #60a5fa !important; }
.nav-sidebar .nav-icon { font-size: 15px; width: 20px; text-align: center; color: inherit; }
.nav-sidebar .nav-link p { margin: 0; line-height: 1; font-size: 13.5px; }

.sidebar-divider { border-color: var(--sidebar-border); margin: 8px 10px; }

/* User info bas de sidebar */
.sidebar-user {
    position: absolute;
    bottom: 0;
    width: 100%;
    border-top: 1px solid var(--sidebar-border);
    background: var(--sidebar-bg);
    padding: .75rem 1rem;
    display: flex;
    align-items: center;
    gap: .75rem;
}
.sidebar-user-email {
    font-size: 12px;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-role { font-size: 10px; color: var(--sidebar-muted); }

/* ============================================================
   CONTENT
   ============================================================ */
.content-wrapper {
    background: var(--bg) !important;
    padding: 1.5rem !important;
    min-height: calc(100vh - var(--nav-h) - 44px);
}

/* ── Page header ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: .75rem;
}
.page-header h1       { font-size: 1.4rem; font-weight: 700; color: #0f172a; margin: 0; }
.page-header .breadcrumb { background: none; padding: 0; margin: 0; font-size: 12px; }
.page-header .breadcrumb-item + .breadcrumb-item::before { color: var(--text-light); }
.page-header .breadcrumb-item a           { color: var(--brand); text-decoration: none; }
.page-header .breadcrumb-item.active      { color: var(--text-muted); }

/* ── Footer ── */
.main-footer {
    background: var(--bg-card) !important;
    border-top: 1px solid var(--border) !important;
    color: var(--text-muted) !important;
    font-size: 12px !important;
    padding: .75rem 1.5rem !important;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-sm) !important;
    background: var(--bg-card);
}
.card-header {
    background: var(--bg-card) !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 1rem 1.25rem !important;
    border-radius: var(--radius) var(--radius) 0 0 !important;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header-left { display: flex; align-items: center; gap: 8px; }
.card-icon {
    width: 28px;
    height: 28px;
    background: var(--brand-light);
    color: var(--brand);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}
.card-body  { padding: 1.25rem !important; }
.card-footer-subtle {
    background: var(--bg-table-head);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    padding: .75rem 1.25rem;
    font-size: 11px;
    color: var(--text-muted);
}

/* ── Card accent top ── */
.card-accent { overflow: hidden; }
.card-accent-bar {
    height: 6px;
    background: linear-gradient(90deg, var(--brand), var(--purple));
}

/* ── Stat cards ── */
.stat-card {
    border-radius: var(--radius);
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
/* Variantes couleur stat-icon */
.stat-icon--blue   { background: var(--info-bg);    color: var(--info); }
.stat-icon--green  { background: var(--success-bg); color: var(--success); }
.stat-icon--yellow { background: var(--warning-bg); color: var(--warning); }
.stat-icon--red    { background: var(--danger-bg);  color: var(--danger); }
.stat-icon--purple { background: var(--purple-bg);  color: var(--purple); }
.stat-icon--gray   { background: var(--gray-bg);    color: var(--gray); }

.stat-value  { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-label  { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.stat-trend  { font-size: 11px; margin-top: 5px; color: var(--text-light); }
.stat-trend--up   { color: var(--success); }
.stat-trend--down { color: var(--danger); }

/* ============================================================
   TABLES
   ============================================================ */
.table thead th {
    background: var(--bg-table-head);
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: .75rem 1rem;
}
.table td { padding: .85rem 1rem; vertical-align: middle; border-color: var(--border); }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--bg-table-head); }

/* Cellule label (colonne gauche d'une table infos) */
.td-label {
    font-size: 12px;
    color: var(--text-muted);
    width: 40%;
}
.td-label--no-border { border-top: none !important; }
.td-value { font-size: 13px; }
.td-value--bold { font-weight: 600; }
.td-value--no-border { border-top: none !important; }

/* ============================================================
   BADGES
   ============================================================ */
.badge-pill-custom {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
}

/* Statut actif / inactif */
.badge-actif   { background: var(--success-bg); color: var(--success); }
.badge-inactif { background: var(--gray-bg);    color: var(--gray); }
.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.badge-dot--green { background: var(--success); }
.badge-dot--gray  { background: var(--text-light); }

/* Rôles */
.badge-role-admin   { background: var(--info-bg);    color: var(--info); }
.badge-role-agent   { background: var(--success-bg); color: var(--success); }
.badge-role-lecteur { background: var(--gray-bg);    color: var(--gray); }
.badge-role-super   { background: var(--purple-bg);  color: var(--purple); }

/* Abonnement */
.badge-abo-ok  { background: var(--success-bg); color: var(--success); }
.badge-abo-nok { background: var(--danger-bg);  color: var(--danger); }

/* ============================================================
   BOUTONS
   ============================================================ */
.btn-primary {
    background: var(--brand) !important;
    border-color: var(--brand) !important;
    border-radius: var(--radius-sm) !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    padding: 7px 16px !important;
    transition: background .15s, transform .1s !important;
}
.btn-primary:hover { background: var(--brand-dark) !important; transform: translateY(-1px); }
.btn-sm { padding: 4px 10px !important; font-size: 12px !important; }
.btn-outline-secondary { border-radius: var(--radius-sm) !important; font-size: 13px !important; }
.btn-icon { width: 16px; text-align: center; }

/* Bouton action liste (start-aligned) */
.btn-action {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
    border-radius: var(--radius-sm);
    font-size: 13px;
    border: 1px solid var(--border);
    color: var(--text);
    background: transparent;
    padding: 6px 12px;
    width: 100%;
    transition: background .15s;
}
.btn-action:hover { background: var(--bg-table-head); }
.btn-action--danger { border-color: #fecaca; color: var(--danger); }
.btn-action--danger:hover { background: var(--danger-bg); }

/* ============================================================
   ALERTS FLASH
   ============================================================ */
.alert {
    border: none !important;
    border-radius: var(--radius) !important;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success { background: var(--success-bg); color: #15803d; }
.alert-danger  { background: var(--danger-bg);  color: #b91c1c; }
.alert-warning { background: var(--warning-bg); color: #b45309; }
.alert-info    { background: var(--info-bg);    color: #1d4ed8; }

/* ============================================================
   ENTITY HEADER (bandeau fiche détail)
   ============================================================ */
.entity-header { padding: 1.25rem; }
.entity-header-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
}
.entity-header-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 3px;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}
.entity-header-meta-sep { color: var(--text-light); }

/* ============================================================
   UTILITAIRES
   ============================================================ */
.text-muted-sm  { font-size: 11px; color: var(--text-light); }
.fw-600         { font-weight: 600; }
.gap-2          { gap: .5rem; }
.id-cell        { color: var(--text-light); font-size: 12px; }

/* Search input dans card-header */
.card-search {
    border-radius: var(--radius-sm);
    font-size: 13px;
    width: 200px;
    border: 1px solid var(--border);
}

/* ============================================================
   FORMULAIRES
   ============================================================ */
.form-control-admin {
    border-radius: var(--radius-sm);
    font-size: 13px;
    border: 1px solid var(--border);
    transition: border-color .15s, box-shadow .15s;
}
.form-control-admin:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
    outline: none;
}
.form-label { font-size: 13px; }

.form-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.form-divider {
    border-color: var(--border);
    margin: .75rem 0;
}

/* ============================================================
   ONGLETS DÉTAIL
   ============================================================ */
.detail-tabs              { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; }
.detail-tab               { padding: 9px 18px; font-size: 13px; font-weight: 600; color: var(--text-muted);
    border: none; background: none; cursor: pointer;
    border-bottom: 2px solid transparent; margin-bottom: -2px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: color .15s, border-color .15s, background .15s;
    display: flex; align-items: center; gap: 7px; }
.detail-tab:hover         { color: var(--brand); background: var(--brand-light); }
.detail-tab.active        { color: var(--brand); border-bottom-color: var(--brand); }
.tab-badge                { font-size: 10px; background: var(--border); color: var(--text-muted);
    padding: 1px 6px; border-radius: 20px; font-weight: 700; }
.detail-tab.active .tab-badge { background: var(--brand-light); color: var(--brand); }
.tab-pane                 { display: none; }
.tab-pane.active          { display: block; }

/* ============================================================
   ENTITY HEADER (bandeau fiche)
   ============================================================ */
.agence-header            { padding: 1.25rem 1.5rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.agence-header-info       { flex: 1; min-width: 0; }
.agence-header-name       { font-size: 1.25rem; font-weight: 700; color: #0f172a; }
.agence-header-meta       { font-size: 13px; color: var(--text-muted); margin-top: 4px;
    display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.agence-header-badges     { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ============================================================
   FORMULAIRE AVANCÉ
   ============================================================ */
.form-section             { margin-bottom: 1.5rem; }
.form-section-title       { font-size: 11px; font-weight: 700; letter-spacing: .8px;
    text-transform: uppercase; color: var(--text-muted); margin-bottom: .75rem; }
.form-grid-2              { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid-3              { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
@media (max-width: 768px) { .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; } }
.form-group-admin         { display: flex; flex-direction: column; gap: 4px; }
.form-group-admin label   { font-size: 12px; font-weight: 600; color: var(--text); }
.required                 { color: var(--danger); }

/* ── Switch row ── */
.switch-row               { display: flex; align-items: center; justify-content: space-between;
    padding: .75rem 0; border-bottom: 1px solid var(--border); }
.switch-row:last-child    { border-bottom: none; }
.switch-label             { font-size: 13px; font-weight: 600; }
.switch-desc              { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Placeholder onglets vides ── */
.tab-placeholder          { text-align: center; padding: 4rem 2rem; color: var(--text-muted); }
.tab-placeholder i        { font-size: 2.5rem; color: var(--border); margin-bottom: 1rem; display: block; }
.tab-placeholder h4       { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: .5rem; }
.tab-placeholder p        { font-size: 13px; }

/* ============================================================
   ROLE CARDS (sélecteur de rôle)
   ============================================================ */
.role-cards           { display: flex; flex-direction: column; gap: .5rem; }
.role-card            { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem;
    border: 2px solid var(--border); border-radius: var(--radius);
    cursor: pointer; transition: border-color .15s, background .15s; }
.role-card:hover      { border-color: var(--brand); background: var(--brand-light); }
.role-card.selected   { border-color: var(--brand); background: var(--brand-light); }
.role-card-input      { display: none; }
.role-card-icon       { width: 36px; height: 36px; border-radius: var(--radius-sm);
    background: var(--brand-light); color: var(--brand);
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; flex-shrink: 0; }
.role-card.selected .role-card-icon { background: var(--brand); color: #fff; }
.role-card-label      { font-size: 13px; font-weight: 600; color: var(--text); }
.role-card-desc       { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
/* ============================================================
   LOGIN PAGE (AdminLTE login-page)
   ============================================================ */
.login-brand-name {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--brand);
}
.login-tagline {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text-muted);
    font-size: 13px;
}
.login-footer {
    text-align: center;
    margin-top: .75rem;
    font-size: 12px;
    color: var(--text-muted);
}
.login-page .card {
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-md) !important;
}

/* ============================================================
   SIDEBAR — sélecteur agence + badge soon
   ============================================================ */
.sidebar-agence-selector {
    display: flex;
    align-items: center;
    margin: 0 10px 4px;
    padding: 8px 12px;
    background: rgba(37,99,235,.12);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(37,99,235,.2);
}
.sidebar-agence-name {
    font-size: 12px;
    font-weight: 600;
    color: #60a5fa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Badge "soon" dans sidebar */
.sidebar-coming {
    margin-left: auto;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    background: rgba(255,255,255,.08);
    color: #64748b;
    padding: 2px 6px;
    border-radius: 10px;
    flex-shrink: 0;
}
.nav-link.sidebar-soon {
    opacity: .6;
    cursor: default;
    pointer-events: none;
}
.nav-link.sidebar-soon:hover {
    background: transparent !important;
    color: var(--sidebar-text) !important;
}
.role-card-input:checked + .role-card-icon {
    background: var(--brand);
    color: white;
}

.role-card-input:checked ~ div .role-card-label {
    color: var(--brand);
}

.role-card-input:checked ~ div .role-card-desc {
    color: var(--brand);
}

.role-card-input:checked ~ .role-card-icon {
    background: var(--brand);
    color: white;
}

/* 👉 LE PLUS IMPORTANT */
.role-card:has(.role-card-input:checked) {
    border-color: var(--brand);
    background: var(--brand-light);
}
.demande-item {
    border-bottom: 1px solid var(--border);
}

.demande-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .75rem 1rem;
    cursor: pointer;
    transition: background .15s;
}

.demande-header:hover {
    background: var(--bg-table-head);
}

.demande-content {
    display: none;
    border-top: 1px solid var(--border);
}

.demande-item.open .demande-content {
    display: block;
}

.toggle-icon {
    transition: transform .2s;
}

.demande-item.open .toggle-icon {
    transform: rotate(180deg);
}
.demande-content {
    display: none;
}

.js-accordion-item.open .demande-content {
    display: block;
}

/* ============================================================
   GLOBAL SEARCH (navbar)
   ============================================================ */

#globalSearchInput {
    width: 100%;
    border-radius: var(--radius-sm);
    font-size: 13px;
    border: 1px solid var(--border);
    padding: 6px 10px;
    transition: border-color .15s, box-shadow .15s;
}

#globalSearchInput:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
    outline: none;
}

/* Dropdown */
#searchDropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 9999;

    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);

    padding: 6px;
}

/* Item */
.search-item {
    display: block;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background .15s;
}

.search-item:hover {
    background: var(--bg-table-head);
}

/* Title */
.search-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
}

/* Subtitle */
.search-item-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Empty state */
.search-empty {
    padding: 10px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* Section label (option futur multi-type) */
.search-section {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-light);
    padding: 6px 8px 4px;
}



     /* ── Grilles stats ─────────────────────────────────────────── */
 .sg-4  { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.sg-3  { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.sg-2  { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; }
.sg-75 { display: grid; grid-template-columns: 7fr 5fr; gap: 14px; }
.sg-57 { display: grid; grid-template-columns: 5fr 7fr; gap: 14px; }
@media (max-width:991px) {
    .sg-4,.sg-3 { grid-template-columns: repeat(2,1fr); }
    .sg-75,.sg-57,.sg-2 { grid-template-columns: 1fr; }
}
@media (max-width:575px) {
    .sg-4,.sg-3,.sg-2 { grid-template-columns: 1fr; }
}

/* ── Section label ──────────────────────────────────────────── */
.stat-section-lbl {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: .75rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.stat-section-lbl i { color: var(--brand); }

/* ── KPI card colorée ───────────────────────────────────────── */
.kpi-card {
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    position: relative;
    overflow: hidden;
    color: #fff;
    min-height: 104px;
}
.kpi-card .kpi-bg-icon {
    position: absolute;
    right: 14px; top: 12px;
    font-size: 2.4rem;
    opacity: .15;
}
.kpi-card .kpi-value  { font-size: 1.7rem; font-weight: 700; line-height: 1.1; margin-bottom: 3px; }
.kpi-card .kpi-label  { font-size: .8rem; opacity: .88; }
.kpi-card .kpi-footer { font-size: .68rem; opacity: .65; margin-top: 6px; }

.kpi-blue    { background: var(--info);    }
.kpi-purple  { background: var(--purple);  }
.kpi-success { background: var(--success); }
.kpi-warning { background: var(--warning); }
.kpi-danger  { background: var(--danger);  }
.kpi-gray    { background: var(--gray);    }

/* ── Info box interne ───────────────────────────────────────── */
.ibox {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .9rem 1rem;
}
.ibox-label  { font-size: .72rem; color: var(--text-muted); margin-bottom: 2px; }
.ibox-value  { font-size: 1.45rem; font-weight: 700; color: var(--text); line-height: 1.1; }
.ibox-desc   { font-size: .68rem; color: var(--text-light); margin-top: 4px; }
.ibox-prog   { height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; margin-top: 8px; }
.ibox-prog-bar { height: 100%; border-radius: 3px; }

/* ── Stat card neutre ───────────────────────────────────────── */
.scard {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .85rem 1rem;
    text-align: center;
}
.scard-label { font-size: .72rem; color: var(--text-muted); margin-bottom: 3px; }
.scard-value { font-size: 1.3rem; font-weight: 700; color: var(--text); }
.scard-sub   { font-size: .68rem; color: var(--text-light); margin-top: 3px; }

/* ── Funnel ─────────────────────────────────────────────────── */
.funnel-wrap {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    flex-wrap: wrap;
    gap: 6px;
    padding: 1rem 0;
}
.funnel-step  { text-align: center; min-width: 80px; }
.funnel-num   { font-size: 2rem; font-weight: 700; line-height: 1; }
.funnel-lbl   { font-size: .75rem; color: var(--text-muted); margin-top: 5px; }
.funnel-sub   { font-size: .62rem; color: var(--text-light); margin-top: 2px; }
.funnel-arrow { text-align: center; flex-shrink: 0; }
.funnel-arrow i { font-size: .9rem; color: var(--border); }

/* ── Barre split ────────────────────────────────────────────── */
.prog-split { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; display: flex; }

/* ── Mini barre courtier ─────────────────────────────────────── */
.conv-bar      { flex: 1; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.conv-bar-fill { height: 100%; border-radius: 3px; }

/* ── Rank dot ───────────────────────────────────────────────── */
.rank-dot {
    width: 22px; height: 22px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .65rem; font-weight: 700;
    background: var(--bg-table-head); color: var(--text-muted);
    flex-shrink: 0;
}
.rank-dot.gold   { background: var(--warning-bg); color: var(--warning); }
.rank-dot.silver { background: var(--gray-bg);    color: var(--gray); }
.rank-dot.bronze { background: var(--danger-bg);  color: var(--danger); }

/* ── Broker avatar ──────────────────────────────────────────── */
.broker-av {
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .72rem; font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

/* ── Card accent top ────────────────────────────────────────── */
.ca-blue    { border-top: 3px solid var(--info); }
.ca-purple  { border-top: 3px solid var(--purple); }
.ca-success { border-top: 3px solid var(--success); }
.ca-warning { border-top: 3px solid var(--warning); }
.ca-danger  { border-top: 3px solid var(--danger); }
.ca-gray    { border-top: 3px solid var(--gray); }

/* ── Table stats ────────────────────────────────────────────── */
.tbl-stats th {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    background: var(--bg-table-head);
    border-bottom: 1px solid var(--border);
    padding: .6rem .85rem;
}
.tbl-stats td { padding: .65rem .85rem; vertical-align: middle; font-size: .84rem; }
.tbl-stats tr:hover td { background: var(--bg-table-head); }

/* ── SEO badges position ────────────────────────────────────── */
.pos-top    { background: var(--success-bg); color: var(--success); }
.pos-mid    { background: var(--warning-bg); color: var(--warning); }
.pos-bottom { background: var(--gray-bg);    color: var(--gray); }

/* ── Badges inline ──────────────────────────────────────────── */
.ibdg {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: .7rem;
    font-weight: 600;
}
.ibdg-info    { background: var(--info-bg);    color: var(--info); }
.ibdg-success { background: var(--success-bg); color: var(--success); }
.ibdg-warning { background: var(--warning-bg); color: var(--warning); }
.ibdg-danger  { background: var(--danger-bg);  color: var(--danger); }
.ibdg-purple  { background: var(--purple-bg);  color: var(--purple); }
.ibdg-gray    { background: var(--gray-bg);    color: var(--gray); }



/* ── Impersonation bar ──────────────────────────────────────── */
.impersonate-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--warning-bg);
    border: 1px solid var(--warning);
    border-radius: var(--radius-pill);
    padding: 4px 6px 4px 6px;
}
.impersonate-icon {
    width: 26px; height: 26px;
    background: var(--warning);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; flex-shrink: 0;
}
.impersonate-info {
    display: flex; flex-direction: column; line-height: 1.25;
}
.impersonate-label {
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em;
    color: var(--warning);
}
.impersonate-user {
    font-size: 12px; font-weight: 600; color: var(--text);
    max-width: 160px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.impersonate-exit {
    display: flex; align-items: center; gap: 4px;
    background: var(--warning); color: #fff !important;
    border-radius: var(--radius-pill);
    padding: 3px 10px; font-size: 11px; font-weight: 600;
    text-decoration: none; transition: background .15s;
    white-space: nowrap; margin-left: 2px;
}
.impersonate-exit:hover { background: var(--danger); color: #fff !important; text-decoration: none; }


     /* ── Grilles ──────────────────────────────────────────────── */
 .dg-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dg-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.dg-6-4 { display: grid; grid-template-columns: 6fr 4fr; gap: 16px; }
@media (max-width: 991px) {
    .dg-2, .dg-3, .dg-6-4 { grid-template-columns: 1fr; }
}

/* ── Section label ────────────────────────────────────────── */
.dash-section {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 1.5rem 0 .75rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.dash-section i { color: var(--brand); }
.dash-section:first-child { margin-top: 0; }

/* ── Welcome banner ───────────────────────────────────────── */
.welcome-banner {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--brand);
}
.welcome-banner-left { display: flex; align-items: center; gap: 1rem; }
.welcome-avatar {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand), var(--purple));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; font-weight: 700; flex-shrink: 0;
}
.welcome-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.welcome-sub   { font-size: .78rem; color: var(--text-muted); }
.welcome-date  { font-size: .78rem; color: var(--text-muted); text-align: right; }
.welcome-date strong { display: block; font-size: .85rem; color: var(--text); font-weight: 600; }

/* ── Activité feed ────────────────────────────────────────── */
.activity-feed { display: flex; flex-direction: column; }
.activity-item {
    display: flex;
    gap: 10px;
    padding: .7rem 0;
    border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
    width: 30px; height: 30px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem;
    flex-shrink: 0;
    margin-top: 1px;
}
.activity-dot--demande     { background: var(--info-bg);    color: var(--info); }
.activity-dot--email       { background: var(--purple-bg);  color: var(--purple); }
.activity-dot--sms         { background: var(--success-bg); color: var(--success); }
.activity-dot--visite      { background: var(--warning-bg); color: var(--warning); }
.activity-dot--note        { background: var(--gray-bg);    color: var(--gray); }
.activity-dot--offre       { background: var(--success-bg); color: var(--success); }
.activity-dot--statut      { background: var(--info-bg);    color: var(--info); }
.activity-dot--tache       { background: var(--danger-bg);  color: var(--danger); }
.activity-body { flex: 1; min-width: 0; }
.activity-title { font-size: .83rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.activity-desc  { font-size: .75rem; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-meta  { font-size: .68rem; color: var(--text-light); margin-top: 3px; display: flex; gap: 8px; align-items: center; }

/* ── Événements ───────────────────────────────────────────── */
.event-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: .7rem 0;
    border-bottom: 1px solid var(--border);
}
.event-item:last-child { border-bottom: none; }
.event-date-block {
    flex-shrink: 0;
    width: 42px;
    text-align: center;
    background: var(--bg-table-head);
    border-radius: var(--radius-sm);
    padding: 4px 0;
}
.event-day   { font-size: 1.1rem; font-weight: 700; color: var(--text); line-height: 1; }
.event-month { font-size: .62rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.event-body  { flex: 1; min-width: 0; }
.event-title { font-size: .83rem; font-weight: 600; color: var(--text); }
.event-meta  { font-size: .72rem; color: var(--text-muted); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 6px; }
.event-type-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    margin-top: 3px;
}
.event-type-dot--visite    { background: var(--warning); }
.event-type-dot--signature { background: var(--success); }
.event-type-dot--appel     { background: var(--info); }
.event-type-dot--reunion   { background: var(--purple); }
.event-type-dot--estimation{ background: var(--gray); }

/* ── Demandes mini ────────────────────────────────────────── */
.demande-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: .65rem 0;
    border-bottom: 1px solid var(--border);
}
.demande-mini:last-child { border-bottom: none; }
.demande-mini-info { flex: 1; min-width: 0; }
.demande-mini-name { font-size: .83rem; font-weight: 600; color: var(--text); }
.demande-mini-sub  { font-size: .72rem; color: var(--text-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Badges statut demande ────────────────────────────────── */
.bdg-statut {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: .68rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.bdg-nouveau  { background: var(--info-bg);    color: var(--info); }
.bdg-en_cours { background: var(--warning-bg); color: var(--warning); }
.bdg-qualifie { background: var(--purple-bg);  color: var(--purple); }
.bdg-attente  { background: var(--gray-bg);    color: var(--gray); }
.bdg-clos     { background: var(--success-bg); color: var(--success); }

/* ── Chart wrap ───────────────────────────────────────────── */
.chart-wrap { position: relative; width: 100%; height: 200px; }

/* ── Courtier mini ────────────────────────────────────────── */
.broker-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: .6rem 0;
    border-bottom: 1px solid var(--border);
}
.broker-row:last-child { border-bottom: none; }
.broker-av {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.broker-info { flex: 1; min-width: 0; }
.broker-name { font-size: .83rem; font-weight: 600; color: var(--text); }
.broker-sub  { font-size: .7rem; color: var(--text-muted); }
.broker-stat { font-size: .83rem; font-weight: 700; color: var(--text); text-align: right; flex-shrink: 0; }
.broker-stat small { font-size: .65rem; font-weight: 400; color: var(--text-muted); display: block; }

/* ── Quick actions ────────────────────────────────────────── */
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qa-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: .85rem .5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-muted);
    font-size: .75rem;
    font-weight: 600;
    transition: all .15s;
    cursor: pointer;
}
.qa-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); text-decoration: none; }
.qa-btn i { font-size: 1.1rem; }




     /* ── Layout ─────────────────────────────────────────────────── */
 .pdf-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; height: calc(100vh - 180px); min-height: 600px; }
@media (max-width: 991px) { .pdf-layout { grid-template-columns: 1fr; height: auto; } }

/* ── Panneau gauche ─────────────────────────────────────────── */
.pdf-panel { display: flex; flex-direction: column; overflow: hidden; }
.pdf-panel .card { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.pdf-panel .card-body { flex: 1; overflow-y: auto; padding: 0 !important; }

/* ── Toolbar ─────────────────────────────────────────────────── */
.pdf-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    background: var(--bg-table-head);
}
.pdf-toolbar select { font-size: .82rem; border-radius: var(--radius-sm); border: 1px solid var(--border); padding: 4px 8px; background: var(--bg-card); color: var(--text); }
.pdf-toolbar input  { font-size: .82rem; }

/* ── Filtres deal ────────────────────────────────────────────── */
.deal-tabs { display: flex; gap: 4px; padding: .6rem 1rem; border-bottom: 1px solid var(--border); }
.deal-tab {
    padding: 3px 12px;
    border-radius: var(--radius-pill);
    font-size: .75rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    transition: all .15s;
}
.deal-tab.active, .deal-tab:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ── Recherche ───────────────────────────────────────────────── */
.pdf-search-wrap { padding: .6rem 1rem; border-bottom: 1px solid var(--border); }
.pdf-search { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px; font-size: .83rem; color: var(--text); background: var(--bg-card); }
.pdf-search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.08); }

/* ── Liste biens ─────────────────────────────────────────────── */
.bien-list { padding: .5rem; }
.bien-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: .6rem .75rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .12s;
    margin-bottom: 4px;
}
.bien-item:hover { background: var(--brand-light); border-color: var(--brand); }
.bien-item.selected { background: var(--brand-light); border-color: var(--brand); }
.bien-item-thumb {
    width: 56px; height: 42px;
    border-radius: 6px;
    background: var(--bg-table-head);
    object-fit: cover;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-light); font-size: .75rem;
    overflow: hidden;
}
.bien-item-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.bien-item-info { flex: 1; min-width: 0; }
.bien-item-cat  { font-size: .83rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bien-item-sub  { font-size: .72rem; color: var(--text-muted); margin-top: 1px; }
.bien-item-price { font-size: .78rem; font-weight: 700; color: var(--brand); white-space: nowrap; }
.bien-item-check { width: 18px; height: 18px; border-radius: 4px; border: 2px solid var(--border); flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all .12s; }
.bien-item.selected .bien-item-check { background: var(--brand); border-color: var(--brand); }
.bien-item-check i { color: #fff; font-size: .65rem; display: none; }
.bien-item.selected .bien-item-check i { display: block; }

/* ── Badge deal ─────────────────────────────────────────────── */
.deal-pill { display: inline-block; padding: 1px 6px; border-radius: 10px; font-size: .62rem; font-weight: 700; flex-shrink: 0; }
.deal-pill--sale { background: var(--warning-bg); color: var(--warning); }
.deal-pill--rent { background: var(--info-bg);    color: var(--info); }

/* ── Sélection chips ─────────────────────────────────────────── */
.selection-bar {
    padding: .75rem 1rem;
    border-top: 1px solid var(--border);
    background: var(--bg-table-head);
    flex-shrink: 0;
}
.selection-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: .5rem; min-height: 32px; }
.sel-chip {
    display: flex; align-items: center; gap: 5px;
    background: var(--brand-light); border: 1px solid var(--brand);
    border-radius: var(--radius-pill);
    padding: 3px 8px 3px 10px;
    font-size: .75rem; font-weight: 600; color: var(--brand);
}
.sel-chip-remove { cursor: pointer; color: var(--brand); opacity: .6; }
.sel-chip-remove:hover { opacity: 1; }
.selection-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sel-count { font-size: .78rem; color: var(--text-muted); }

/* ── Panneau droit (preview) ─────────────────────────────────── */
.pdf-preview-panel { display: flex; flex-direction: column; }
.pdf-preview-panel .card { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.pdf-preview-frame { flex: 1; border: none; width: 100%; min-height: 500px; }
.pdf-preview-empty {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--text-light); text-align: center; padding: 2rem;
}
.pdf-preview-empty i { font-size: 3rem; color: var(--border); margin-bottom: 1rem; }
.pdf-preview-empty p { font-size: .85rem; color: var(--text-muted); }

/* ── Toolbar preview ─────────────────────────────────────────── */
.preview-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: .6rem 1rem;
    border-bottom: 1px solid var(--border);
    gap: 8px; flex-wrap: wrap;
    background: var(--bg-table-head);
}
.preview-status { font-size: .75rem; color: var(--text-muted); }





     /* ── Layout formulaire ── */
 .bien-form-layout { display: grid; grid-template-columns: 220px 1fr; gap: 0; min-height: 600px; }
@media (max-width: 991px) { .bien-form-layout { grid-template-columns: 1fr; } }

/* ── Navigation latérale ── */
.bien-nav {
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    height: fit-content;
}
.bien-nav-section { font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-light); padding: .75rem 1rem .25rem; }
.bien-nav-item {
    display: flex; align-items: center; gap: 8px;
    padding: .55rem 1rem;
    font-size: .83rem; font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all .12s;
    text-decoration: none;
}
.bien-nav-item:hover  { color: var(--brand); background: var(--brand-light); text-decoration: none; }
.bien-nav-item.active { color: var(--brand); border-left-color: var(--brand); background: var(--brand-light); }
.bien-nav-item i      { width: 16px; text-align: center; }

/* ── Contenu du formulaire ── */
.bien-content { padding: 0; }
.bien-pane    { display: none; }
.bien-pane.active { display: block; }

/* ── Sections accordéon ── */
.form-section {
    border-bottom: 1px solid var(--border);
}
.form-section-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: .85rem 1.25rem;
    cursor: pointer;
    user-select: none;
    transition: background .1s;
}
.form-section-header:hover { background: var(--bg-table-head); }
.form-section-title { font-size: .88rem; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.form-section-title i { color: var(--brand); }
.form-section-body { padding: 1.25rem; display: none; }
.form-section.open .form-section-body { display: block; }
.form-section-toggle { font-size: .75rem; color: var(--text-light); transition: transform .2s; }
.form-section.open .form-section-toggle { transform: rotate(180deg); }

/* ── Champs formulaire ── */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.form-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 767px) {
    .form-grid-2,.form-grid-3,.form-grid-4 { grid-template-columns: 1fr; }
}

.form-group-c { margin-bottom: .75rem; }
.form-group-c label { font-size: .78rem; font-weight: 600; color: var(--text); margin-bottom: 3px; display: block; }
.form-group-c label .req { color: var(--danger); }
.form-group-c .form-control {
    font-size: .84rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    transition: border-color .15s, box-shadow .15s;
    background: var(--bg-card);
    color: var(--text);
}
.form-group-c .form-control:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37,99,235,.08);
    outline: none;
}
.form-group-c .hint { font-size: .7rem; color: var(--text-light); margin-top: 3px; }

/* ── Switch toggle ── */
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.switch-row:last-child { border-bottom: none; }
.switch-label { font-size: .83rem; font-weight: 600; color: var(--text); }
.switch-desc  { font-size: .72rem; color: var(--text-muted); }

/* ── Sticky footer save ── */
.form-footer {
    position: sticky;
    bottom: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: .75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    z-index: 100;
    box-shadow: 0 -4px 12px rgba(0,0,0,.06);
}

/* ── Référence auto ── */
.ref-group { position: relative; }
.ref-auto-btn {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    font-size: .7rem; padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: var(--brand-light); color: var(--brand);
    border: none; cursor: pointer;
    transition: all .15s;
}
.ref-auto-btn:hover { background: var(--brand); color: #fff; }

/* ── Badge deal selector ── */
.deal-selector { display: flex; gap: 8px; }
.deal-opt {
    flex: 1; padding: .6rem; text-align: center; border-radius: var(--radius-sm);
    border: 2px solid var(--border); cursor: pointer; transition: all .15s;
    font-size: .83rem; font-weight: 600; color: var(--text-muted);
}
.deal-opt:hover { border-color: var(--brand); }
.deal-opt.selected-sale { border-color: var(--warning); background: var(--warning-bg); color: var(--warning); }
.deal-opt.selected-rent { border-color: var(--info); background: var(--info-bg); color: var(--info); }

/* ── Map placeholder ── */
.map-placeholder {
    height: 200px; border-radius: var(--radius-sm);
    background: var(--bg-table-head);
    border: 2px dashed var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: .83rem;
}


.pix-web{
    position: absolute;
    bottom: 72px;
    left: 30px;
    opacity: 0.9;
}
.pix-web svg{
    width: 120px;
    height: auto;
}




.cq-section-group { border-bottom: 1px solid var(--border); padding: 1.1rem 1.25rem; }
.cq-section-group:last-child { border-bottom: none; }
.cq-section-group-title {
    font-size: .78rem; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .07em;
    margin-bottom: .85rem; display: flex; align-items: center; gap: 7px;
}
.cq-section-group-title i { color: var(--brand); font-size: .75rem; }
.cq-commodites-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 767px) { .cq-commodites-grid { grid-template-columns: 1fr; } }
.cq-commodite-wrap { display: flex; flex-direction: column; }
.cq-commodite-label { font-size: .77rem; font-weight: 600; color: var(--text); margin-bottom: 4px; display: block; }
.cq-sel-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
    font-size: .65rem; font-weight: 700; background: var(--brand); color: #fff;
    margin-left: 6px; vertical-align: middle; opacity: 0; transition: opacity .15s;
}
.cq-sel-count.has-val { opacity: 1; }

/* ── Select2 thème CasaQ ── */
.select2-container { width: 100% !important; }
.select2-container--default .select2-selection--multiple {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); min-height: 36px; padding: 2px 4px;
    cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.08); outline: none;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: var(--brand-light); border: 1px solid rgba(37,99,235,.2); border-radius: 12px;
    color: var(--brand); font-size: .75rem; font-weight: 600;
    padding: 1px 8px 1px 22px; margin: 2px 3px 2px 0;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--brand);font-weight: 700; font-size: .8rem;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: var(--danger); background: none;
}
.select2-container--default .select2-selection--multiple .select2-selection__placeholder {
    color: var(--text-light); font-size: .82rem;
}
.select2-dropdown {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0,0,0,.12); background: var(--bg-card);
}
.select2-search--dropdown .select2-search__field {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 5px 8px; font-size: .82rem; color: var(--text); background: var(--bg-card);
}
.select2-search--dropdown .select2-search__field:focus { outline: none; border-color: var(--brand); }
.select2-results__option { font-size: .82rem; color: var(--text); padding: 5px 10px; }
.select2-results__option--highlighted { background: var(--brand-light) !important; color: var(--brand) !important; }
.select2-results__option[aria-selected="true"] { background: var(--brand-light); color: var(--brand); font-weight: 600; }
.select2-results__option[aria-selected="true"]::before { content: '✓ '; }


.media-card,
.file-card-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    margin: 1rem 1.25rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.03);
}

.media-card-header,
.file-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-table-head);
}

.media-card-title,
.file-card-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    font-size: .95rem;
    font-weight: 700;
    color: var(--text);
}

.media-card-title i,
.file-card-title i {
    color: var(--brand);
}

.media-toolbar-left,
.media-toolbar-right,
.file-toolbar-left,
.file-toolbar-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}

.media-badge,
.file-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    border-radius: 999px;
    padding: .25rem .55rem;
    font-size: .72rem;
    font-weight: 600;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.media-badge-success,
.file-badge-success {
    background: rgba(25,135,84,.1);
    border-color: rgba(25,135,84,.25);
    color: #198754;
}

.media-badge-saving,
.file-badge-saving {
    background: rgba(255,193,7,.12);
    border-color: rgba(255,193,7,.3);
    color: #9a6a00;
}

.d-none {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════
   DROPZONE COMMUNE
═══════════════════════════════════════════════════════ */

.dropzone-area,
.file-dropzone-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2.2rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .2s;
    background: var(--bg-table-head);
}

.dropzone-area:hover,
.dropzone-area.drag-over,
.file-dropzone-area:hover,
.file-dropzone-area.drag-over {
    border-color: var(--brand);
    background: var(--brand-light);
    color: var(--brand);
    transform: translateY(-1px);
}

.dropzone-area i,
.file-dropzone-area i {
    font-size: 2.15rem;
    margin-bottom: .6rem;
    display: block;
}

.dropzone-area p,
.file-dropzone-area p {
    margin: 0;
    font-size: .9rem;
    font-weight: 600;
}

.dropzone-area small,
.file-dropzone-area small {
    display: block;
    margin-top: .35rem;
    font-size: .72rem;
    color: var(--text-light);
}

.upload-progress,
.file-upload-progress {
    display: none;
    height: 5px;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
    margin-top: .75rem;
}

.upload-progress-bar,
.file-upload-progress-bar {
    height: 100%;
    background: var(--brand);
    width: 0%;
    transition: width .25s;
}

/* ═══════════════════════════════════════════════════════
   ACTIONS GROUPÉES COMMUNES
═══════════════════════════════════════════════════════ */

.bulk-menu-wrap,
.file-bulk-menu-wrap {
    position: relative;
}

.bulk-menu,
.file-bulk-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 320px;
    max-width: 380px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 30px rgba(0,0,0,.12);
    z-index: 40;
    display: none;
    padding: .55rem;
}

.bulk-menu.is-open,
.file-bulk-menu.is-open {
    display: block;
}

.bulk-row,
.file-bulk-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .45rem;
    border-radius: var(--radius-sm);
}

.bulk-row:hover,
.file-bulk-row:hover {
    background: var(--bg-table-head);
}

.bulk-name,
.file-bulk-name {
    min-width: 0;
    flex: 1;
    font-size: .78rem;
    color: var(--text);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.bulk-count,
.file-bulk-count {
    font-size: .7rem;
    color: var(--text-muted);
    background: var(--bg-table-head);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: .16rem .45rem;
    white-space: nowrap;
}

.bulk-actions,
.file-bulk-actions {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
}

.bulk-btn,
.file-bulk-btn {
    border: none;
    background: transparent;
    padding: .22rem .45rem;
    font-size: .68rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-muted);
}

.bulk-btn:hover,
.file-bulk-btn:hover {
    background: var(--brand-light);
    color: var(--brand);
}

.bulk-btn-on:hover {
    color: #198754;
}

.bulk-btn-off:hover {
    color: var(--danger);
}

/* ═══════════════════════════════════════════════════════
   SEARCH COMMUN
═══════════════════════════════════════════════════════ */

.media-search,
.file-search {
    position: relative;
}

.media-search i,
.file-search i {
    position: absolute;
    left: .6rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: .75rem;
    color: var(--text-muted);
}

.media-search input,
.file-search input {
    height: 32px;
    min-width: 190px;
    padding: .35rem .65rem .35rem 1.8rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--text);
    font-size: .78rem;
    outline: none;
}

.media-search input:focus,
.file-search input:focus {
    border-color: var(--brand);
}

.compact-toggle {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .76rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

/* ═══════════════════════════════════════════════════════
   BOUTONS PASSERELLES COMMUNS
═══════════════════════════════════════════════════════ */

.img-pass-btn,
.file-pass-btn {
    border: 1px solid var(--border);
    background: var(--brand-light);
    color: var(--brand);
    border-radius: 999px;
    padding: .18rem .42rem;
    font-size: .66rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    max-width: 100%;
    transition: all .12s ease;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

.img-pass-btn::before,
.file-pass-btn::before {
    content: "✓";
    font-size: .62rem;
    font-weight: 900;
}

.img-pass-btn:hover,
.file-pass-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
}

.img-pass-btn.is-off,
.file-pass-btn.is-off {
    background: var(--bg-table-head);
    color: var(--text-muted);
    opacity: .58;
    text-decoration: line-through;
}

.img-pass-btn.is-off::before,
.file-pass-btn.is-off::before {
    content: "×";
}

.img-pass-btn.is-loading,
.file-pass-btn.is-loading {
    opacity: .45;
    pointer-events: none;
}

.img-pass-btn-label {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════════════════
   IMAGES UNIQUEMENT
═══════════════════════════════════════════════════════ */

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
    padding: 1rem;
}

.images-grid.is-compact {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.images-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.images-empty i {
    font-size: 3rem;
    color: var(--border);
    margin-bottom: 1rem;
    display: block;
}

.img-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-card);
    position: relative;
    transition: box-shadow .15s, opacity .15s, transform .15s;
}

.img-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    transform: translateY(-1px);
}

.img-card.is-cover {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px var(--brand);
}

.img-card.is-saving {
    opacity: .6;
    pointer-events: none;
}

.img-card.sortable-ghost {
    opacity: .35;
}

.img-card.sortable-chosen {
    box-shadow: 0 14px 32px rgba(0,0,0,.18);
}

.img-thumb-wrap {
    position: relative;
    height: 140px;
    overflow: hidden;
    background: var(--bg-table-head);
}

.images-grid.is-compact .img-thumb-wrap {
    height: 100px;
}

.img-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .2s;
}

.img-card:hover .img-thumb-wrap img {
    transform: scale(1.045);
}

.img-thumb-link {
    display: block;
    width: 100%;
    height: 100%;
}

.img-cover-badge {
    position: absolute;
    top: 7px;
    left: 7px;
    background: var(--brand);
    color: #fff;
    font-size: .65rem;
    font-weight: 800;
    padding: 3px 7px;
    border-radius: 999px;
    display: none;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

.img-card.is-cover .img-cover-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

.img-order-badge {
    position: absolute;
    bottom: 7px;
    left: 7px;
    background: rgba(0,0,0,.62);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
}

.img-actions {
    position: absolute;
    top: 7px;
    right: 7px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    opacity: 0;
    transition: opacity .15s;
}

.img-card:hover .img-actions {
    opacity: 1;
}

.img-action-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    cursor: pointer;
    transition: all .12s;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
}

.img-action-btn.drag-handle {
    background: rgba(0,0,0,.58);
    color: #fff;
    cursor: grab;
}

.img-action-btn.cover-btn,
.img-action-btn.toggle-all-image-btn {
    background: rgba(255,255,255,.94);
    color: var(--text-muted);
}

.img-action-btn.cover-btn:hover,
.img-action-btn.toggle-all-image-btn:hover {
    background: var(--brand);
    color: #fff;
}

.img-action-btn.delete-btn {
    background: rgba(255,255,255,.94);
    color: var(--text-muted);
}

.img-action-btn.delete-btn:hover {
    background: var(--danger);
    color: #fff;
}

.img-card-footer {
    padding: .55rem .6rem;
    border-bottom: 1px solid var(--border);
}

.img-alt-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: .76rem;
    color: var(--text-muted);
    background: transparent;
    padding: 0;
}

.img-alt-input:focus {
    color: var(--text);
}

.img-passerelles {
    padding: .5rem .55rem .6rem;
    display: flex;
    flex-wrap: wrap;
    gap: .32rem;
    background: var(--bg-card);
}

.img-passerelle-row {
    display: inline-flex;
    min-width: 0;
}

.images-grid.is-compact .img-card-footer {
    display: none;
}

.images-grid.is-compact .img-passerelles {
    padding: .35rem;
    gap: .22rem;
}

.images-grid.is-compact .img-pass-btn {
    font-size: .58rem;
    padding: .12rem .32rem;
}

/* ═══════════════════════════════════════════════════════
   DOCUMENTS UNIQUEMENT
═══════════════════════════════════════════════════════ */

.files-list {
    display: flex;
    flex-direction: column;
    gap: .65rem;
    padding: 1rem;
}

.file-item {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: .75rem;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    padding: .65rem;
    transition: box-shadow .15s, opacity .15s, transform .15s;
}

.file-item:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,.08);
    transform: translateY(-1px);
}

.file-item.sortable-ghost {
    opacity: .35;
}

.file-item.sortable-chosen {
    box-shadow: 0 12px 28px rgba(0,0,0,.16);
}

.file-item.is-saving {
    opacity: .6;
    pointer-events: none;
}

.file-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-light);
    color: var(--brand);
    font-size: 1.05rem;
}

.file-main {
    min-width: 0;
}

.file-name-input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text);
    font-weight: 700;
    font-size: .84rem;
    padding: 0;
}

.file-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .25rem;
    color: var(--text-muted);
    font-size: .68rem;
}

.file-actions {
    display: flex;
    align-items: center;
    gap: .35rem;
}

.file-action-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .12s;
}

.file-action-btn:hover {
    background: var(--brand-light);
    color: var(--brand);
}

.file-action-btn.delete:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.file-passerelles {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: .32rem;
    padding-top: .4rem;
    border-top: 1px solid var(--border);
}

.files-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.files-empty i {
    font-size: 3rem;
    color: var(--border);
    margin-bottom: 1rem;
    display: block;
}

.files-list.is-compact .file-passerelles {
    padding-top: .25rem;
}

.files-list.is-compact .file-pass-btn {
    font-size: .58rem;
    padding: .12rem .32rem;
}

.files-list.is-compact .file-name-input {
    font-size: .78rem;
}

@media (max-width: 768px) {
    .media-card-header,
    .file-card-header {
        align-items: flex-start;
    }

    .media-toolbar-left,
    .media-toolbar-right,
    .file-toolbar-left,
    .file-toolbar-right {
        width: 100%;
    }

    .media-search,
    .file-search {
        width: 100%;
    }

    .media-search input,
    .file-search input {
        width: 100%;
    }

    .bulk-menu,
    .file-bulk-menu {
        left: 0;
        right: auto;
        min-width: 280px;
    }

    .file-item {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .file-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}


/******
CONTACT
 */
     /* ── Layout ── */
 .contact-form-layout {
     display: grid;
     grid-template-columns: 240px 1fr;
     min-height: 70vh;
     border-radius: var(--radius);
     overflow: hidden;
 }
@media (max-width: 991px) { .contact-form-layout { grid-template-columns: 1fr; } }

/* ── Nav latérale ── */
.contact-nav {
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: .5rem 0 2rem;
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow-y: auto;
}
.contact-nav-section {
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-light);
    padding: .9rem 1rem .2rem;
}
.contact-nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: .5rem 1rem;
    font-size: .82rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all .12s;
}
.contact-nav-item:hover  { color: var(--brand); background: var(--brand-light); text-decoration: none; }
.contact-nav-item.active { color: var(--brand); border-left-color: var(--brand); background: var(--brand-light); font-weight: 600; }
.contact-nav-item i      { width: 16px; text-align: center; flex-shrink: 0; font-size: .8rem; }
.contact-nav-item .nav-badge {
    margin-left: auto;
    font-size: .6rem;
    padding: 1px 5px;
    border-radius: 8px;
    background: var(--brand-light);
    color: var(--brand);
    font-weight: 700;
}
.nav-soon { opacity: .45; pointer-events: none; }
.contact-nav-divider { border-top: 1px solid var(--border); margin: .4rem 0; }

/* ── Panes ── */
.contact-content { overflow: hidden; }
.contact-pane    { display: none; }
.contact-pane.active { display: block; }

/* ── Sections accordéon ── */
.form-section { border-bottom: 1px solid var(--border); }
.form-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 1.25rem;
    cursor: pointer;
    user-select: none;
    transition: background .1s;
}
.form-section-header:hover { background: var(--bg-table-head); }
.form-section-title { font-size: .88rem; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.form-section-title i { color: var(--brand); }
.form-section-body { padding: 1.25rem; display: none; }
.form-section.open .form-section-body { display: block; }
.form-section-toggle { transition: transform .2s; color: var(--text-light); font-size: .75rem; }
.form-section.open .form-section-toggle { transform: rotate(180deg); }

/* ── Grilles & champs ── */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
@media (max-width: 767px) { .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; } }

.form-group-c { margin-bottom: .75rem; }
.form-group-c label { font-size: .78rem; font-weight: 600; color: var(--text); margin-bottom: 3px; display: block; }
.form-group-c .req { color: var(--danger); }
.form-group-c .form-control {
    font-size: .84rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    background: var(--bg-card);
    color: var(--text);
    width: 100%;
    transition: border-color .15s, box-shadow .15s;
}
.form-group-c .form-control:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37,99,235,.08);
    outline: none;
}
.form-group-c .hint { font-size: .7rem; color: var(--text-light); margin-top: 3px; }

/* ── Footer sticky ── */
.form-footer {
    position: sticky;
    bottom: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: .75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
    box-shadow: 0 -4px 16px rgba(0,0,0,.07);
}
.form-footer-label { font-size: .75rem; color: var(--text-muted); }

/* ── Placeholder panes vides ── */
.pane-placeholder { text-align: center; padding: 4rem 2rem; color: var(--text-muted); }
.pane-placeholder i { font-size: 2.5rem; color: var(--border); margin-bottom: 1rem; display: block; }
.pane-placeholder p { font-size: .9rem; margin-bottom: .25rem; }
.pane-placeholder small { font-size: .78rem; }




.act-tab {
    padding:5px 12px;
    font-size:12px;
    font-weight:600;
    border-radius:20px;
    border:1.5px solid var(--border);
    background:none;
    cursor:pointer;
    color:var(--text-muted);
    transition:all .15s;
    text-decoration:none;
    display:inline-flex;
    align-items:center;
}

.act-tab:hover,
.act-tab.active {
    background:var(--brand);
    border-color:var(--brand);
    color:#fff;
    text-decoration:none;
}

.act-tab--manual.active {
    background:var(--warning);
    border-color:var(--warning);
}

.act-timeline {
    display:flex;
    flex-direction:column;
    gap:0;
}

.act-item {
    display:grid;
    grid-template-columns:36px 20px 1fr;
    gap:0 .75rem;
    position:relative;
    padding-bottom:1.25rem;
}

.act-item:last-child {
    padding-bottom:0;
}



.act-timeline--compact .act-item {
    grid-template-columns:30px 14px 1fr;
    gap:0 .55rem;
    padding-bottom:1rem;
}

.act-timeline--compact .act-icon {
    width:30px;
    height:30px;
    font-size:11px;
}

.act-timeline--compact .act-line {
    margin-top:30px;
}

.act-item--manual .act-content {
    background:var(--warning-bg);
    border-radius:var(--radius-sm);
    padding:.75rem;
    border-left:3px solid var(--warning);
}

.act-icon {
    width:36px;
    height:36px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:13px;
    flex-shrink:0;
    z-index:1;
}

.act-icon--email {
    background:var(--brand-light);
    color:var(--brand);
}

.act-icon--sms {
    background:var(--success-bg);
    color:var(--success);
}

.act-icon--demande {
    background:#fdf4ff;
    color:#9333ea;
}

.act-icon--bien {
    background:var(--brand-light);
    color:var(--brand);
}

.act-icon--visite {
    background:var(--brand-light);
    color:var(--brand);
}

.act-icon--offre {
    background:var(--success-bg);
    color:var(--success);
}

.act-icon--contact {
    background:#ecfeff;
    color:#0891b2;
}

.act-icon--note {
    background:var(--warning-bg);
    color:var(--warning);
}

.act-icon--appel {
    background:var(--success-bg);
    color:var(--success);
}

.act-icon--tache {
    background:var(--brand-light);
    color:var(--brand);
}

.act-icon--rappel {
    background:#f5f3ff;
    color:#7c3aed;
}

.act-icon--rapport {
    background:var(--gray-bg);
    color:var(--gray);
}

.act-icon--systeme {
    background:var(--gray-bg);
    color:var(--gray);
}

.act-line {
    width:2px;
    background:var(--border);
    margin:0px 0 0;
    border-radius:1px;
}

.act-content {
    padding-top:6px;
    min-width:0;
    width: 100%;
}

.act-titre {
    font-size:13px;
    font-weight:600;
    color:var(--text);
}

.act-date {
    font-size:11px;
    color:var(--text-muted);
    white-space:nowrap;
    margin-left:.5rem;
}

.act-desc {
    font-size:12px;
    color:var(--text-muted);
    margin:.25rem 0 .5rem;
    line-height:1.45;
}

.act-meta {
    font-size:11px;
    background:var(--gray-bg);
    color:var(--gray);
    padding:2px 8px;
    border-radius:10px;
    display:inline-flex;
    align-items:center;
    gap:4px;
}

.act-meta--bien {
    background:var(--brand-light);
    color:var(--brand);
}

.act-meta--reminder {
    background:#f5f3ff;
    color:#7c3aed;
}

.act-manual-badge,
.act-auto-badge {
    font-size:10px;
    font-weight:700;
    padding:1px 6px;
    border-radius:10px;
    margin-left:6px;
    vertical-align:middle;
}

.act-manual-badge {
    background:var(--warning-bg);
    color:var(--warning);
}

.act-auto-badge {
    background:var(--gray-bg);
    color:var(--gray);
}

.act-delete-form {
    margin-top:.5rem;
}

.act-delete-btn {
    border:none;
    background:none;
    color:var(--danger, #dc2626);
    padding:0;
    font-size:11px;
    cursor:pointer;
}

.act-delete-btn:hover {
    text-decoration:underline;
}

.act-empty {
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    color:var(--text-muted);
    padding:2.5rem 1rem;
    text-align:center;
    font-size:13px;
}

.act-empty i {
    font-size:28px;
    opacity:.35;
    margin-bottom:.5rem;
}

.activity-modal {
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.45);
    z-index:9999;
    align-items:center;
    justify-content:center;
    padding:1rem;
}

.activity-modal__box {
    background:#fff;
    border-radius:var(--radius);
    padding:1.5rem;
    width:100%;
    max-width:540px;
    box-shadow:var(--shadow-md);
}

.activity-modal__close {
    background:none;
    border:none;
    font-size:20px;
    line-height:1;
    cursor:pointer;
    color:var(--text-muted);
}

.activity-modal__close:hover {
    color:var(--text);
}

.activity-help {
    font-size:12px;
    border-radius:var(--radius-sm);
    padding:.65rem .75rem;
}

.activity-help--note {
    background:var(--gray-bg);
    color:var(--gray);
}

@media (max-width: 768px) {
    .act-item {
        grid-template-columns:32px 14px 1fr;
        gap:0 .55rem;
    }

    .act-icon {
        width:32px;
        height:32px;
        font-size:12px;
    }

    .act-line {
        margin-top:32px;
    }

    .act-date {
        display:block;
        margin-left:0;
        margin-top:.15rem;
    }

    .activity-modal__box {
        max-width:100%;
    }
}
.activity-modal .select2-container {
    width: 100% !important;
}

.activity-modal .select2-container--default .select2-selection--single {
    height: 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
}

.activity-modal .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 36px;
    font-size: 13px;
    color: var(--text);
    padding-left: 12px;
}

.activity-modal .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
}

.activity-modal .select2-dropdown {
    border-color: var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.activity-modal .select2-results__option {
    font-size: 13px;
    padding: 8px 10px;
}
.act-actions {
    display:flex;
    align-items:center;
    gap:.75rem;
    margin-top:.5rem;
}

.act-action-btn,
.act-delete-btn {
    border:none;
    background:none;
    padding:0;
    font-size:11px;
    cursor:pointer;
}

.act-action-btn {
    color:var(--brand);
}

.act-action-btn:hover,
.act-delete-btn:hover {
    text-decoration:underline;
}

.act-delete-form {
    margin:0;
}

.act-delete-btn {
    color:var(--danger, #dc2626);
}


 .search-card {
     border: 1px solid var(--border);
     border-radius: var(--radius);
     background: var(--bg-card);
     margin: 1rem 1.25rem;
     overflow: hidden;
     transition: box-shadow .15s;
 }
.search-card:hover { box-shadow: var(--shadow-md); }
.search-card.is-inactive { opacity: .6; }
.search-card.is-archived { opacity: .5; }

.search-card-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-table-head);
}
.search-card-icon {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem; flex-shrink: 0;
}
.search-card-icon--sale { background: var(--warning-bg); color: var(--warning); }
.search-card-icon--rent { background: var(--info-bg);    color: var(--info); }

.search-card-title { font-size: .9rem; font-weight: 700; color: var(--text); flex: 1; min-width: 0; }
.search-card-summary { font-size: .72rem; color: var(--text-muted); margin-top: 2px; }

.search-card-badges { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }

.search-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: var(--radius-pill);
    font-size: .68rem; font-weight: 700;
}
.search-badge--sale     { background: var(--warning-bg); color: var(--warning); }
.search-badge--rent     { background: var(--info-bg);    color: var(--info); }
.search-badge--active   { background: var(--success-bg); color: var(--success); }
.search-badge--inactive { background: var(--gray-bg);    color: var(--gray); }
.search-badge--archived { background: var(--danger-bg);  color: var(--danger); }

.search-card-body {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: .5rem 1rem;
    padding: .85rem 1rem;
}
.search-criteria-item { display: flex; flex-direction: column; }
.search-criteria-label { font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-light); margin-bottom: 2px; }
.search-criteria-value { font-size: .82rem; font-weight: 600; color: var(--text); }
.search-criteria-value--empty { color: var(--text-light); font-weight: 400; font-style: italic; }

.search-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .5rem 1rem;
    border-top: 1px solid var(--border);
    gap: .5rem;
}
.search-footer-date { font-size: .68rem; color: var(--text-light); }

.search-empty {
    text-align: center;
    padding: 3.5rem 2rem;
    color: var(--text-muted);
    margin: 1rem 1.25rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
}
.search-empty i { font-size: 2.5rem; color: var(--border); margin-bottom: .75rem; display: block; }
.search-empty p { margin: 0 0 .25rem; font-size: .9rem; }
.search-empty small { font-size: .78rem; }





 .form-grid-4 {
     display:grid;
     grid-template-columns:repeat(4, 1fr);
     gap:1rem;
 }

@media (max-width: 991px) {
    .form-grid-4 {
        grid-template-columns:1fr 1fr;
    }
}

@media (max-width: 576px) {
    .form-grid-4 {
        grid-template-columns:1fr;
    }
}

.demande-list {
    display:flex;
    flex-direction:column;
}

.demande-item {
    border-bottom:1px solid var(--border);
}

.demande-head {
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:1rem 1.25rem;
    cursor:pointer;
    transition:background .12s;
}

.demande-head:hover {
    background:var(--bg-table-head);
}

.demande-title {
    font-size:13px;
    font-weight:700;
    color:var(--text);
}

.demande-sub {
    font-size:12px;
    color:var(--text-muted);
}

.demande-head-meta {
    display:flex;
    align-items:center;
    gap:.5rem;
}

.demande-chevron {
    color:var(--text-light);
    font-size:12px;
}

.demande-body {
    padding:1rem 1.25rem 1.25rem;
    background:#fbfdff;
    border-top:1px solid var(--border);
}

.demande-grid {
    display:grid;
    grid-template-columns:repeat(3, 1fr);
    gap:1rem;
}

@media (max-width: 991px) {
    .demande-grid {
        grid-template-columns:1fr;
    }
}

.demande-section-title {
    font-size:12px;
    font-weight:700;
    color:var(--text);
    margin-bottom:.4rem;
}

.demande-info {
    font-size:12px;
    color:var(--text-muted);
    display:flex;
    flex-direction:column;
    gap:.25rem;
}

.demande-info i {
    width:15px;
    color:var(--brand);
}

.demande-message {
    margin-top:1rem;
    padding:.75rem;
    border-left:3px solid var(--brand);
    background:#fff;
    border-radius:var(--radius-sm);
    font-size:13px;
    color:var(--text-muted);
}

.demande-actions {
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:.5rem;
    margin-top:1rem;
}

.demande-assign-form {
    display:flex;
    align-items:center;
    gap:.4rem;
}

.demande-assign-form select {
    min-width:180px;
}

.demande-empty {
    padding:3rem 1rem;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    color:var(--text-muted);
    font-size:13px;
}

.demande-empty i {
    font-size:32px;
    opacity:.3;
    margin-bottom:.5rem;
}

.demande-modal {
    position:fixed;
    inset:0;
    z-index:9999;
    background:rgba(0,0,0,.45);
    align-items:center;
    justify-content:center;
    padding:1rem;
}

.demande-modal__box {
    background:#fff;
    border-radius:var(--radius);
    box-shadow:var(--shadow-md);
    width:100%;
    max-width:900px;
    max-height:90vh;
    overflow:auto;
    padding:1.5rem;
}

.demande-modal__close {
    background:none;
    border:none;
    font-size:22px;
    color:var(--text-muted);
    cursor:pointer;
}

.demande-modal__close:hover {
    color:var(--text);
}
 .form-grid-3 {
     display:grid;
     grid-template-columns:repeat(3, 1fr);
     gap:1rem;
 }

@media (max-width: 991px) {
    .form-grid-3 {
        grid-template-columns:1fr;
    }
}

.demande-modal .select2-container {
    width:100% !important;
}

.demande-modal .select2-container--default .select2-selection--single {
    height:38px;
    border:1px solid var(--border);
    border-radius:var(--radius-sm);
    display:flex;
    align-items:center;
}

.demande-modal .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height:36px;
    font-size:13px;
    color:var(--text);
    padding-left:12px;
}

.demande-modal .select2-container--default .select2-selection--single .select2-selection__arrow {
    height:36px;
}
.cq-ajax-select {
    position: relative;
    width: 100%;
}

.cq-ajax-select-control {
    position: relative;
}

.cq-ajax-select-input {
    padding-right: 34px !important;
}

.cq-ajax-select-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: none;
    background: var(--gray-bg);
    color: var(--text-muted);
    border-radius: 50%;
    font-size: 16px;
    line-height: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cq-ajax-select-clear:hover {
    background: var(--danger, #dc2626);
    color: #fff;
}

.cq-ajax-select-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 10050;
    max-height: 240px;
    overflow-y: auto;
}

.cq-ajax-select-item {
    padding: 9px 11px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}

.cq-ajax-select-item:last-child {
    border-bottom: none;
}

.cq-ajax-select-item:hover,
.cq-ajax-select-item.active {
    background: var(--brand-light);
}

.cq-ajax-select-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.cq-ajax-select-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.cq-ajax-select-empty,
.cq-ajax-select-loading {
    padding: 10px 11px;
    font-size: 12px;
    color: var(--text-muted);
}


/*Demandes*/
.demande-list {
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.demande-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.demande-card__main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.demande-card__contact {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    min-width: 0;
}

.demande-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.demande-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.demande-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .75rem;
    margin-top: .45rem;
    font-size: 11px;
    color: var(--text-muted);
}

.demande-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.demande-card__right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .35rem;
    flex-shrink: 0;
}

.demande-badge,
.demande-priority {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
}

.demande-badge--new,
.demande-badge--nouveau {
    background: var(--brand-light);
    color: var(--brand);
}

.demande-badge--in_progress,
.demande-badge--en_cours {
    background: var(--warning-bg);
    color: var(--warning);
}

.demande-badge--closed,
.demande-badge--clos {
    background: var(--success-bg);
    color: var(--success);
}

.demande-priority--high,
.demande-priority--haute {
    background: #fee2e2;
    color: #dc2626;
}

.demande-priority--normal,
.demande-priority--normale {
    background: var(--gray-bg);
    color: var(--gray);
}

.demande-priority--low,
.demande-priority--basse {
    background: var(--gray-bg);
    color: var(--text-muted);
}

.demande-message {
    margin-top: .85rem;
    padding: .75rem;
    background: var(--gray-bg);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.45;
}

.demande-linked {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .75rem;
}

.demande-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--gray-bg);
    color: var(--gray);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
}

.demande-chip:hover {
    background: var(--brand-light);
    color: var(--brand);
    text-decoration: none;
}

.demande-bien-preview {
    margin-top: .85rem;
    display: grid;
    grid-template-columns: 82px 1fr 18px;
    gap: .75rem;
    align-items: center;
    padding: .65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: all .15s;
}

.demande-bien-preview:hover {
    border-color: var(--brand);
    background: var(--brand-light);
    text-decoration: none;
}

.demande-bien-preview__image {
    width: 82px;
    height: 58px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--gray-bg);
    flex-shrink: 0;
}

.demande-bien-preview__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.demande-bien-preview__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.demande-bien-preview__title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.demande-bien-preview__name {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.demande-bien-preview__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .35rem;
    font-size: 11px;
    color: var(--text-muted);
}

.demande-bien-preview__meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.demande-bien-preview__arrow {
    color: var(--text-muted);
    font-size: 11px;
}

.demande-actions {
    display: flex;
    justify-content: flex-end;
    gap: .4rem;
    margin-top: .85rem;
}

.demande-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

.demande-empty i {
    font-size: 28px;
    opacity: .35;
    margin-bottom: .5rem;
}

@media (max-width: 768px) {
    .demande-card__main {
        flex-direction: column;
    }

    .demande-card__right {
        align-items: flex-start;
        flex-direction: row;
    }

    .demande-bien-preview {
        grid-template-columns: 64px 1fr;
    }

    .demande-bien-preview__image {
        width: 64px;
        height: 52px;
    }

    .demande-bien-preview__arrow {
        display: none;
    }

    .demande-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}




 .email-shell{display:flex;flex-direction:column;gap:1rem}
.email-topbar{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:1.1rem 1.25rem;display:flex;align-items:center;justify-content:space-between;gap:1rem;box-shadow:var(--shadow-sm)}
.email-topbar h2{font-size:1.2rem;font-weight:800;margin:0;color:var(--text)}
.email-topbar p{margin:.25rem 0 0;font-size:13px;color:var(--text-muted)}
.email-topbar-actions{display:flex;align-items:center;gap:.5rem;flex-shrink:0}
.email-tabs{display:flex;align-items:center;gap:.25rem;border-bottom:1px solid var(--border)}
.email-tab{border:none;background:transparent;color:var(--text-muted);font-size:13px;font-weight:700;padding:.7rem 1rem;border-bottom:2px solid transparent;display:inline-flex;align-items:center;gap:.45rem;cursor:pointer;transition:all .15s}
.email-tab:hover{color:var(--brand);background:var(--brand-light)}
.email-tab.active{color:var(--brand);border-bottom-color:var(--brand)}
.email-tab-badge{font-size:10px;font-weight:800;background:var(--brand-light);color:var(--brand);padding:1px 7px;border-radius:99px}
.email-tab-pane{display:none}
.email-tab-pane.active{display:block}
.email-compose-layout{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:1rem;align-items:start}
.email-compose-main{min-width:0}
.email-compose-side{position:sticky;top:1rem;display:flex;flex-direction:column;gap:.75rem}

.email-compose-card,
.email-side-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.email-side-card {
    overflow: hidden;
}

.email-compose-card {
    overflow: visible;
}

.email-compose-fields {
    overflow: visible;
}

.email-property-box {
    overflow: visible;
}

.email-compose-card-header{padding:1rem 1.25rem;border-bottom:1px solid var(--border);background:var(--bg-table-head);display:flex;align-items:center;justify-content:space-between;gap:1rem}
.email-compose-card-header h3{margin:0;font-size:1rem;font-weight:800;color:var(--text)}
.email-compose-card-header p{margin:.2rem 0 0;font-size:12px;color:var(--text-muted)}
.email-compose-status{font-size:11px;font-weight:700;color:var(--text-muted);background:var(--gray-bg);border-radius:99px;padding:3px 9px;white-space:nowrap}
.email-compose-fields{padding:.75rem 1.25rem 1.25rem}
.email-line{display:flex;align-items:center;gap:.75rem;border-bottom:1px solid var(--border);min-height:48px;padding:.45rem 0}
.email-line-muted{background:var(--bg-table-head);margin:0 -1.25rem;padding-left:1.25rem;padding-right:1.25rem}
.email-line-label{width:48px;flex-shrink:0;font-size:11px;font-weight:800;color:var(--text-muted);text-transform:uppercase;letter-spacing:.05em}
.email-chip-zone{display:flex;align-items:center;flex-wrap:wrap;gap:.35rem;flex:1;min-height:34px;min-width:0}
.email-chip-input,.email-subject-input,.email-clean-select{border:none;outline:none;background:transparent;color:var(--text);font-size:13px;min-width:180px;flex:1;padding:4px 0}
.email-subject-input{font-weight:700}
.email-clean-select{width:100%}
.email-counter{font-size:11px;color:var(--text-light);white-space:nowrap}
.email-link-btn{border:none;background:transparent;color:var(--brand);font-size:12px;font-weight:700;cursor:pointer;padding:3px 6px;border-radius:var(--radius-sm);white-space:nowrap}
.email-link-btn:hover{background:var(--brand-light)}
.email-chip-tag{background:var(--brand-light);color:var(--brand);font-size:12px;font-weight:700;padding:3px 9px;border-radius:99px;display:inline-flex;align-items:center;gap:6px}
.email-chip-tag button{background:none;border:none;color:inherit;cursor:pointer;padding:0;line-height:1;font-size:12px}
.email-property-box{margin:.9rem 0;border:1.5px solid var(--border);border-radius:var(--radius);background:var(--bg-table-head);overflow:hidden}
.email-property-head{padding:.85rem 1rem;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;gap:.75rem}
.email-property-head strong{display:block;font-size:13px;font-weight:800;color:var(--text)}
.email-property-head span{display:block;font-size:11px;color:var(--text-muted);margin-top:2px}
.email-property-search{display:flex;align-items:center;gap:.65rem;padding:.75rem 1rem;background:#fff}
.email-property-search i{color:var(--brand)}
.email-property-selected{display:grid;grid-template-columns:75px minmax(0,1fr) auto;gap:.75rem;align-items:center;padding:.75rem 1rem;border-top:1px solid var(--border);background:#fff}
.email-property-icon{width:38px;height:38px;border-radius:var(--radius-sm);background:var(--brand-light);color:var(--brand);display:flex;align-items:center;justify-content:center}
.email-property-info{min-width:0}
.email-property-info strong{display:block;font-size:13px;font-weight:800;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.email-property-info span{display:block;font-size:11px;color:var(--text-muted);margin-top:2px}
.email-property-actions{display:none;gap:.4rem;flex-wrap:wrap;justify-content:flex-end}
.email-editor-wrap{padding-top:1rem}
.email-editor-head{display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin-bottom:.5rem}
.email-editor-title{font-size:12px;font-weight:800;color:var(--text)}
.email-editor-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:.25rem}
.email-editor-btn{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-sm);padding:4px 8px;font-size:12px;color:var(--text-muted);cursor:pointer;transition:all .12s;display:inline-flex;align-items:center;gap:4px}
.email-editor-btn:hover{background:var(--brand-light);border-color:var(--brand);color:var(--brand)}
.email-editor-sep{width:1px;height:18px;background:var(--border);margin:0 3px}
.email-editor{min-height:340px;border:1.5px solid var(--border);border-radius:var(--radius-sm);padding:1rem;font-size:14px;line-height:1.7;color:var(--text);outline:none;background:#fff}
.email-editor:focus{border-color:var(--brand);box-shadow:0 0 0 3px rgba(159,29,36,.08)}
.email-editor:empty::before{content:attr(data-placeholder);color:var(--text-light);pointer-events:none}
.vars-panel{background:var(--bg-table-head);border:1px solid var(--border);border-radius:var(--radius-sm);padding:.6rem;margin-bottom:.6rem}
.vars-grid{display:flex;flex-wrap:wrap;gap:.35rem}
.var-chip{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-sm);font-size:11px;font-family:monospace;padding:3px 8px;cursor:pointer;color:var(--brand);transition:all .12s}
.var-chip:hover{background:var(--brand);color:#fff;border-color:var(--brand)}
.email-pdf-inline,.email-attachments-inline{margin-top:1rem;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-card);overflow:hidden}
.email-pdf-inline.is-disabled{opacity:.65}
.email-pdf-inline-head,.email-attachments-head{padding:.85rem 1rem;background:var(--bg-table-head);border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;gap:.75rem}
.email-pdf-inline-head strong,.email-attachments-head strong{display:block;font-size:13px;font-weight:800;color:var(--text)}
.email-pdf-inline-head span,.email-attachments-head span{display:block;font-size:11px;color:var(--text-muted);margin-top:2px}
.email-switch{display:inline-flex;align-items:center;gap:.45rem;font-size:12px;font-weight:700;color:var(--text);margin:0;cursor:pointer;white-space:nowrap}
.email-switch input{accent-color:var(--brand)}
.email-pdf-options{padding:1rem}
.email-pdf-format-grid{display:grid;grid-template-columns:1fr;gap:.5rem}
.email-pdf-format{border:1.5px solid var(--border);border-radius:var(--radius-sm);padding:.7rem .75rem;cursor:pointer;background:#fff;transition:all .15s;display:grid;grid-template-columns:18px 1fr;gap:.5rem .65rem;margin:0}
.email-pdf-format input{grid-row:span 2;margin-top:2px;accent-color:var(--brand)}
.email-pdf-format strong{font-size:12px;font-weight:800;color:var(--text)}
.email-pdf-format span{font-size:11px;color:var(--text-muted);line-height:1.35}
.email-pdf-format.is-selected{border-color:var(--brand);background:var(--brand-light)}
.email-pdf-settings{display:grid;grid-template-columns:1fr 1fr;gap:.75rem;margin-top:1rem}
.email-pdf-settings .email-check-list{grid-column:1/-1;flex-direction:row;flex-wrap:wrap}
.email-check-list{display:flex;flex-direction:column;gap:.35rem}
.email-check-list label{display:flex;align-items:center;gap:.45rem;font-size:12px;color:var(--text-muted);margin:0;cursor:pointer}
.dropzone{border:2px dashed var(--border);border-radius:var(--radius-sm);padding:1.25rem;text-align:center;color:var(--text-muted);font-size:13px;cursor:pointer;transition:all .15s;background:var(--bg-table-head)}
.dropzone:hover,.dropzone.active{border-color:var(--brand);background:var(--brand-light);color:var(--brand)}
.dropzone i{font-size:24px;margin-bottom:.5rem;display:block}
.email-dropzone-compact{margin:1rem;padding:1rem}
.email-dropzone-compact small{display:block;margin-top:3px;font-size:11px;color:var(--text-light)}
.email-attachments-inline #attachList{padding:0 1rem 1rem}
.email-attach-row{display:flex;align-items:center;gap:.5rem;padding:.45rem .5rem;border:1px solid var(--border);border-radius:var(--radius-sm);margin-top:.35rem;font-size:12px;background:var(--bg-card)}
.email-attach-row span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.email-side-card{padding:0}
.email-side-card-primary{padding:1rem}
.email-side-title{font-size:13px;font-weight:800;color:var(--text);display:flex;align-items:center;gap:.45rem;margin-bottom:.75rem}
.email-side-title i{color:var(--brand)}
.email-side-toggle{width:100%;border:none;background:var(--bg-card);padding:.85rem 1rem;font-size:13px;font-weight:800;color:var(--text);cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:.75rem;border-bottom:1px solid var(--border)}
.email-side-toggle span{display:flex;align-items:center;gap:.45rem}
.email-side-toggle span i{color:var(--brand)}
.email-side-toggle>i{color:var(--text-light);transition:transform .15s}
.email-side-toggle.is-open>i{transform:rotate(180deg)}
.email-side-panel{padding:1rem}
.email-schedule-box{background:var(--bg-table-head);border:1px solid var(--border);border-radius:var(--radius-sm);padding:.75rem;margin-bottom:.5rem}
.signature-preview{border:1px solid var(--border);border-radius:var(--radius-sm);padding:.75rem;min-height:72px;font-size:12px;color:var(--text-muted);line-height:1.6;background:var(--bg-table-head)}
.email-recap-table td{font-size:12px;padding:.55rem .25rem!important}
.email-recap-table td:first-child{color:var(--text-muted);width:45%}
.email-recap-table td:last-child{font-weight:700;color:var(--text);text-align:right}
.hist-statut{font-size:11px;font-weight:700;padding:3px 10px;border-radius:20px}
.hist-statut--sent{background:var(--success-bg);color:var(--success)}
.hist-statut--failed{background:var(--danger-bg);color:var(--danger)}
.hist-statut--draft{background:var(--gray-bg);color:var(--gray)}
.email-bien-tag{font-size:10px;background:var(--brand-light);color:var(--brand);padding:2px 7px;border-radius:10px;font-weight:700}
.email-empty-state{text-align:center;padding:2.5rem 1rem;color:var(--text-muted);display:flex;flex-direction:column;gap:.35rem;align-items:center}
.email-empty-state i{font-size:2rem;color:var(--text-light);opacity:.45}
.email-empty-state strong{color:var(--text);font-size:14px}
.email-section-head{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:1rem 1.25rem;margin-bottom:1rem;display:flex;align-items:center;justify-content:space-between;gap:1rem}
.email-section-head h3{font-size:1rem;font-weight:800;margin:0;color:var(--text)}
.email-section-head p{font-size:12px;color:var(--text-muted);margin:.25rem 0 0}
.tpl-card{display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);transition:box-shadow .15s,transform .15s;height:100%}
.tpl-card:hover{box-shadow:var(--shadow-md);transform:translateY(-1px)}
.tpl-card-icon{width:44px;height:44px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:18px;flex-shrink:0}
.tpl-card-body{flex:1;min-width:0}
.tpl-card-name{font-size:13px;font-weight:800;color:var(--text)}
.tpl-card-desc{font-size:12px;color:var(--text-muted);margin-top:2px;line-height:1.4}
.tpl-card-meta{font-size:11px;color:var(--text-muted)}
.tpl-card-actions{display:flex;flex-direction:column;flex-shrink:0}
.sig-card{background:var(--bg-card);border:1.5px solid var(--border);border-radius:var(--radius);padding:1rem;height:100%}
.sig-card--default{border-color:var(--brand)}
.sig-card-header{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:.75rem}
.sig-default-badge{display:inline-flex;font-size:10px;font-weight:700;background:var(--brand-light);color:var(--brand);padding:2px 7px;border-radius:10px;margin-top:.25rem}
.sig-preview{font-size:12px;color:var(--text-muted);line-height:1.6;background:var(--bg-table-head);border-radius:var(--radius-sm);padding:.75rem;white-space:pre-line}
.email-preview-modal{position:fixed;inset:0;z-index:9999}
.email-preview-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.45)}
.email-preview-box{position:relative;z-index:1;background:#fff;width:min(760px,calc(100vw - 2rem));max-height:calc(100vh - 2rem);overflow:auto;margin:1rem auto;border-radius:var(--radius);box-shadow:var(--shadow-md)}
.email-preview-head{padding:1rem 1.25rem;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between}
.email-preview-head button{border:none;background:transparent;color:var(--text-muted);cursor:pointer}
.email-preview-meta{padding:.75rem 1.25rem;border-bottom:1px solid var(--border);background:var(--bg-table-head);display:grid;grid-template-columns:1fr;gap:.35rem}
.email-preview-meta span{display:inline-block;width:48px;font-size:11px;font-weight:800;color:var(--text-muted);text-transform:uppercase}
.email-preview-meta strong{font-size:13px;color:var(--text)}
.email-preview-body{padding:1.25rem;font-size:14px;line-height:1.7;color:var(--text)}
@media(max-width:1100px){.email-compose-layout{grid-template-columns:1fr}.email-compose-side{position:static}}
@media(max-width:768px){.email-topbar,.email-section-head,.email-compose-card-header{flex-direction:column;align-items:flex-start}.email-topbar-actions{width:100%}.email-tabs{overflow-x:auto;white-space:nowrap}.email-line{align-items:flex-start;flex-direction:column;gap:.35rem}.email-line-label{width:auto}.email-editor-head{align-items:flex-start;flex-direction:column}.email-editor{min-height:260px}.email-property-selected{grid-template-columns:38px 1fr}.email-property-actions{grid-column:1/-1;justify-content:flex-start}.email-pdf-settings{grid-template-columns:1fr}.email-pdf-inline-head,.email-attachments-head{align-items:flex-start;flex-direction:column}}
.email-chip-zone {
    position: relative;
}

.email-suggest-box {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 10080;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    max-height: 260px;
    overflow-y: auto;
    padding: 4px;
}

.email-suggest-item {
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.email-suggest-item:hover,
.email-suggest-item.is-active {
    background: var(--brand-light);
}

.email-suggest-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand-light);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    flex-shrink: 0;
}

.email-suggest-main {
    min-width: 0;
    flex: 1;
}

.email-suggest-label {
    font-size: 13px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
}

.email-suggest-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.email-suggest-empty {
    padding: 9px 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.email-chip-tag small {
    font-size: 10px;
    font-weight: 600;
    opacity: .75;
}
.email-property-search {
    position: relative;
    overflow: visible;
    z-index: 30;
}

.email-property-box {
    overflow: visible;
    position: relative;
    z-index: 20;
}

.email-bien-suggest-box {
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: calc(100% - .25rem);
    z-index: 99999;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 14px 36px rgba(0,0,0,.16);
    max-height: 360px;
    overflow-y: auto;
    padding: 4px;
}

.email-bien-suggest-item {
    width: 100%;
    border: none;
    background: #fff;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem .75rem;
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.email-bien-suggest-item:hover,
.email-bien-suggest-item.is-active {
    background: var(--brand-light);
}
.email-bien-suggest-box {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 10050;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    max-height: 360px;
    overflow-y: auto;
}

.email-bien-suggest-item {
    width: 100%;
    border: none;
    background: #fff;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem .75rem;
    text-align: left;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}

.email-bien-suggest-item:last-child {
    border-bottom: none;
}

.email-bien-suggest-item:hover,
.email-bien-suggest-item.is-active {
    background: var(--brand-light);
}

.email-bien-suggest-thumb {
    width: 58px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--gray-bg);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.email-bien-suggest-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.email-bien-suggest-main {
    min-width: 0;
    flex: 1;
}

.email-bien-suggest-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-bien-suggest-sub {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.35;
}

.email-bien-suggest-empty {
    padding: .85rem;
    font-size: 12px;
    color: var(--text-muted);
}

.email-property-thumb {
    width: 74px;
    height: 56px;
    border-radius: var(--radius-sm);
    background: var(--gray-bg);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.email-property-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/*calendar*/
/* Calendrier */
.calendar-root {
    padding: 1rem;
}

.fc {
    font-size: 13px;
}

.fc .fc-toolbar-title {
    font-size: 18px;
    font-weight: 700;
}

.fc .fc-button {
    border-radius: var(--radius-sm) !important;
    font-size: 12px !important;
}

.fc-event {
    border-radius: 7px !important;
    padding: 2px 4px !important;
    cursor: pointer;
}

.calendar-modal-box {
    max-width: 760px;
}

/* Dans la modal calendrier, on évite que le footer colle aux bords */
.calendar-modal-box .form-footer {
    margin-top: 0;
}

/* Le composant ajax-select doit passer au-dessus dans la modal */
.calendar-modal-box .cq-ajax-select-dropdown {
    z-index: 10080;
}
.cal-date-sep {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text-muted);
    padding: .5rem 1rem .25rem;
    background: var(--bg-table-head);
    border-bottom: 1px solid var(--border);
}

.cal-event-item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
    transition: background .12s;
}

.cal-event-item:hover {
    background: var(--bg-table-head);
}

.cal-event-time {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 38px;
    margin-top: 2px;
}

.cal-event-bar {
    width: 3px;
    border-radius: 3px;
    align-self: stretch;
    flex-shrink: 0;
}

.cal-event-bar--visite { background: #2563eb; }
.cal-event-bar--appel { background: #16a34a; }
.cal-event-bar--signature { background: #9333ea; }
.cal-event-bar--reunion { background: #ca8a04; }
.cal-event-bar--estimation { background: #dc2626; }
.cal-event-bar--tache { background: #64748b; }
.cal-event-bar--autre { background: #6b7280; }

.cal-type-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
}

.cal-type-badge--visite {
    background: var(--brand-light);
    color: var(--brand);
}

.cal-type-badge--appel {
    background: var(--success-bg);
    color: var(--success);
}

.cal-type-badge--signature {
    background: #fdf4ff;
    color: #9333ea;
}

.cal-type-badge--reunion {
    background: var(--warning-bg);
    color: var(--warning);
}

.cal-type-badge--estimation {
    background: var(--danger-bg);
    color: var(--danger);
}

.cal-type-badge--tache {
    background: #f1f5f9;
    color: #475569;
}

.cal-type-badge--autre {
    background: #f3f4f6;
    color: #4b5563;
}

.cal-statut {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.cal-statut--confirme {
    background: var(--success-bg);
    color: var(--success);
}

.cal-statut--en_attente {
    background: var(--warning-bg);
    color: var(--warning);
}

.cal-statut--annule {
    background: var(--danger-bg);
    color: var(--danger);
}

.cal-legend {
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.cal-legend::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
}

.cal-legend--visite::before { background: #2563eb; }
.cal-legend--appel::before { background: #16a34a; }
.cal-legend--signature::before { background: #9333ea; }
.cal-legend--reunion::before { background: #ca8a04; }
.cal-legend--estimation::before { background: #dc2626; }
.cal-legend--tache::before { background: #64748b; }
.projet-upload-zone {
    position: relative;
    border: 2px dashed var(--border);
    background: var(--bg-table-head);
    border-radius: var(--radius-sm);
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .15s;
}

.projet-upload-zone:hover {
    border-color: var(--brand);
    background: var(--brand-light);
    color: var(--brand);
}

.projet-upload-zone i {
    font-size: 2rem;
    display: block;
    margin-bottom: .5rem;
}

.projet-upload-zone strong {
    display: block;
    color: var(--text);
    margin-bottom: .25rem;
}

.projet-upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.projet-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.projet-image-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    overflow: hidden;
}

.projet-image-thumb {
    height: 140px;
    background: var(--bg-table-head);
}

.projet-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.projet-image-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .5rem;
}





     /* ═══════════════════════════════════════════════════════
        LAYOUT GLOBAL
     ═══════════════════════════════════════════════════════ */

 .media-card {
     border: 1px solid var(--border);
     border-radius: var(--radius);
     background: var(--bg-card);
     margin: 1rem 1.25rem;
     overflow: hidden;
     box-shadow: 0 2px 8px rgba(0,0,0,.03);
 }

.media-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-table-head);
}

.media-card-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    font-size: .95rem;
    font-weight: 700;
    color: var(--text);
}

.media-card-title i {
    color: var(--brand);
}

.media-toolbar-left,
.media-toolbar-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}

.media-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    border-radius: 999px;
    padding: .25rem .55rem;
    font-size: .72rem;
    font-weight: 600;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.media-badge-success {
    background: rgba(25,135,84,.1);
    border-color: rgba(25,135,84,.25);
    color: #198754;
}

.media-badge-saving {
    background: rgba(255,193,7,.12);
    border-color: rgba(255,193,7,.3);
    color: #9a6a00;
}

.d-none {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════
   UPLOAD
═══════════════════════════════════════════════════════ */

.dropzone-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2.2rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .2s;
    background: var(--bg-table-head);
}

.dropzone-area:hover,
.dropzone-area.drag-over {
    border-color: var(--brand);
    background: var(--brand-light);
    color: var(--brand);
    transform: translateY(-1px);
}

.dropzone-area i {
    font-size: 2.15rem;
    margin-bottom: .6rem;
    display: block;
}

.dropzone-area p {
    margin: 0;
    font-size: .9rem;
    font-weight: 600;
}

.dropzone-area small {
    display: block;
    margin-top: .35rem;
    font-size: .72rem;
    color: var(--text-light);
}

.upload-progress {
    display: none;
    height: 5px;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
    margin-top: .75rem;
}

.upload-progress-bar {
    height: 100%;
    background: var(--brand);
    width: 0%;
    transition: width .25s;
}

/* ═══════════════════════════════════════════════════════
   ACTIONS GROUPÉES
═══════════════════════════════════════════════════════ */

.bulk-menu-wrap {
    position: relative;
}

.bulk-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 320px;
    max-width: 380px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 30px rgba(0,0,0,.12);
    z-index: 40;
    display: none;
    padding: .55rem;
}

.bulk-menu.is-open {
    display: block;
}

.bulk-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .45rem;
    border-radius: var(--radius-sm);
}

.bulk-row:hover {
    background: var(--bg-table-head);
}

.bulk-name {
    min-width: 0;
    flex: 1;
    font-size: .78rem;
    color: var(--text);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.bulk-count {
    font-size: .7rem;
    color: var(--text-muted);
    background: var(--bg-table-head);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: .16rem .45rem;
    white-space: nowrap;
}

.bulk-actions {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
}

.bulk-btn {
    border: none;
    background: transparent;
    padding: .22rem .45rem;
    font-size: .68rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-muted);
}

.bulk-btn:hover {
    background: var(--brand-light);
    color: var(--brand);
}

.bulk-btn-on:hover {
    color: #198754;
}

.bulk-btn-off:hover {
    color: var(--danger);
}

.media-search {
    position: relative;
}

.media-search i {
    position: absolute;
    left: .6rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: .75rem;
    color: var(--text-muted);
}

.media-search input {
    height: 32px;
    min-width: 190px;
    padding: .35rem .65rem .35rem 1.8rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--text);
    font-size: .78rem;
    outline: none;
}

.media-search input:focus {
    border-color: var(--brand);
}

.compact-toggle {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .76rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

/* ═══════════════════════════════════════════════════════
   GRID
═══════════════════════════════════════════════════════ */

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
    padding: 1rem;
}

.images-grid.is-compact {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.images-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.images-empty i {
    font-size: 3rem;
    color: var(--border);
    margin-bottom: 1rem;
    display: block;
}

/* ═══════════════════════════════════════════════════════
   IMAGE CARD
═══════════════════════════════════════════════════════ */

.img-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-card);
    position: relative;
    transition: box-shadow .15s, opacity .15s, transform .15s;
}

.img-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    transform: translateY(-1px);
}

.img-card.is-cover {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px var(--brand);
}

.img-card.is-saving {
    opacity: .6;
    pointer-events: none;
}

.img-card.sortable-ghost {
    opacity: .35;
}

.img-card.sortable-chosen {
    box-shadow: 0 14px 32px rgba(0,0,0,.18);
}

.img-thumb-wrap {
    position: relative;
    height: 140px;
    overflow: hidden;
    background: var(--bg-table-head);
}

.images-grid.is-compact .img-thumb-wrap {
    height: 100px;
}

.img-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .2s;
}

.img-card:hover .img-thumb-wrap img {
    transform: scale(1.045);
}

.img-thumb-link {
    display: block;
    width: 100%;
    height: 100%;
}

.img-cover-badge {
    position: absolute;
    top: 7px;
    left: 7px;
    background: var(--brand);
    color: #fff;
    font-size: .65rem;
    font-weight: 800;
    padding: 3px 7px;
    border-radius: 999px;
    display: none;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

.img-card.is-cover .img-cover-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

.img-order-badge {
    position: absolute;
    bottom: 7px;
    left: 7px;
    background: rgba(0,0,0,.62);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
}

.img-actions {
    position: absolute;
    top: 7px;
    right: 7px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    opacity: 0;
    transition: opacity .15s;
}

.img-card:hover .img-actions {
    opacity: 1;
}

.img-action-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    cursor: pointer;
    transition: all .12s;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
}

.img-action-btn.drag-handle {
    background: rgba(0,0,0,.58);
    color: #fff;
    cursor: grab;
}

.img-action-btn.cover-btn,
.img-action-btn.toggle-all-image-btn {
    background: rgba(255,255,255,.94);
    color: var(--text-muted);
}

.img-action-btn.cover-btn:hover,
.img-action-btn.toggle-all-image-btn:hover {
    background: var(--brand);
    color: #fff;
}

.img-action-btn.delete-btn {
    background: rgba(255,255,255,.94);
    color: var(--text-muted);
}

.img-action-btn.delete-btn:hover {
    background: var(--danger);
    color: #fff;
}

.img-card-footer {
    padding: .55rem .6rem;
    border-bottom: 1px solid var(--border);
}

.img-alt-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: .76rem;
    color: var(--text-muted);
    background: transparent;
    padding: 0;
}

.img-alt-input:focus {
    color: var(--text);
}

/* ═══════════════════════════════════════════════════════
   PASSERELLES PAR IMAGE - BOUTONS LIGHT
═══════════════════════════════════════════════════════ */

.img-passerelles {
    padding: .5rem .55rem .6rem;
    display: flex;
    flex-wrap: wrap;
    gap: .32rem;
    background: var(--bg-card);
}

.img-passerelle-row {
    display: inline-flex;
    min-width: 0;
}

.img-pass-btn {
    border: 1px solid var(--border);
    background: var(--brand-light);
    color: var(--brand);
    border-radius: 999px;
    padding: .18rem .42rem;
    font-size: .66rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    max-width: 100%;
    transition: all .12s ease;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

.img-pass-btn::before {
    content: "✓";
    font-size: .62rem;
    font-weight: 900;
}

.img-pass-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
}

.img-pass-btn.is-off {
    background: var(--bg-table-head);
    color: var(--text-muted);
    opacity: .58;
    text-decoration: line-through;
}

.img-pass-btn.is-off::before {
    content: "×";
}

.img-pass-btn.is-loading {
    opacity: .45;
    pointer-events: none;
}

.img-pass-btn-label {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.images-grid.is-compact .img-card-footer {
    display: none;
}

.images-grid.is-compact .img-passerelles {
    padding: .35rem;
    gap: .22rem;
}

.images-grid.is-compact .img-pass-btn {
    font-size: .58rem;
    padding: .12rem .32rem;
}

@media (max-width: 768px) {
    .media-card-header {
        align-items: flex-start;
    }

    .media-toolbar-left,
    .media-toolbar-right {
        width: 100%;
    }

    .media-search {
        width: 100%;
    }

    .media-search input {
        width: 100%;
    }

    .bulk-menu {
        left: 0;
        right: auto;
        min-width: 280px;
    }
}

.match-collapse {
    display: none;
}

.match-collapse.open {
    display: block;
}

.js-match-toggle .fa-chevron-down {
    transition: transform .15s ease;
}

.js-match-toggle.open .fa-chevron-down {
    transform: rotate(180deg);
}




     /* ── Welcome ─────────────────────────────────────────── */
 .welcome-banner {
     display: flex; align-items: center; justify-content: space-between;
     background: var(--card-bg,#fff); border: 1px solid var(--border,#e8edf2);
     border-radius: 10px; padding: 14px 20px; margin-bottom: 16px;
     box-shadow: 0 1px 3px rgba(0,0,0,.06);
 }
.welcome-left  { display:flex; align-items:center; gap:12px; }
.welcome-av    { width:40px; height:40px; border-radius:50%; background:var(--brand,#2563eb); color:#fff; display:flex; align-items:center; justify-content:center; font-size:1rem; font-weight:800; }
.welcome-title { font-size:.9rem; font-weight:700; color:var(--text,#1e293b); }
.welcome-sub   { font-size:.72rem; color:var(--text-muted,#64748b); margin-top:1px; }
.welcome-right { text-align:right; font-size:.72rem; color:var(--text-muted,#64748b); }
.welcome-right strong { display:block; font-size:.82rem; color:var(--text,#1e293b); }

/* ── KPI ─────────────────────────────────────────────── */
.db-kpi-section { margin-bottom:16px; transition:opacity .2s; }
.db-kpi-section.db-hidden { display:none; }

.kpi-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
.kpi-card {
    background:var(--card-bg,#fff); border-radius:10px;
    border:1px solid var(--border,#e8edf2); padding:16px 18px;
    display:flex; flex-direction:column; gap:6px;
    box-shadow:0 1px 3px rgba(0,0,0,.05); transition:box-shadow .15s;
}
.kpi-card:hover { box-shadow:0 4px 12px rgba(0,0,0,.09); }
.kpi-card-top { display:flex; align-items:center; justify-content:space-between; }
.kpi-icon { width:34px; height:34px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:.78rem; }
.kpi-value { font-size:1.8rem; font-weight:800; color:var(--text,#1e293b); line-height:1; }
.kpi-label { font-size:.7rem; color:var(--text-muted,#64748b); font-weight:600; text-transform:uppercase; letter-spacing:.04em; }
.kpi-trend { font-size:.68rem; color:var(--success,#16a34a); font-weight:600; }

/* ── Widgets grid ────────────────────────────────────── */
.db-widgets-grid {
    display:grid; grid-template-columns:repeat(3,1fr);
    gap:14px; align-items:start;
}

.db-widget {
    background:var(--card-bg,#fff); border-radius:10px;
    border:1px solid var(--border,#e8edf2);
    box-shadow:0 1px 3px rgba(0,0,0,.05);
    display:flex; flex-direction:column; min-height:260px;
    position:relative; overflow:hidden;
    transition:box-shadow .15s, border-color .15s;
}
.db-widget:hover { box-shadow:0 4px 14px rgba(0,0,0,.09); }
.db-widget.db-hidden { display:none; }

/* Edit mode */
body.db-edit-mode .db-widget {
    border-color:var(--brand,#2563eb);
    border-style:dashed;
    cursor:grab;
}
body.db-edit-mode .db-widget:active { cursor:grabbing; }
.db-widget.sortable-ghost  { opacity:.3; }
.db-widget.sortable-chosen { box-shadow:0 10px 32px rgba(37,99,235,.22); transform:rotate(1deg) scale(1.02); z-index:100; cursor:grabbing; }

/* Widget header */
.widget-header {
    display:flex; align-items:center; justify-content:space-between;
    padding:12px 14px 10px; border-bottom:1px solid var(--border,#e8edf2);
    flex-shrink:0; user-select:none;
}
.widget-header-left { display:flex; align-items:center; gap:8px; }
.widget-icon {
    width:26px; height:26px; border-radius:6px;
    background:var(--brand-bg,#eff6ff); color:var(--brand,#2563eb);
    display:flex; align-items:center; justify-content:center;
    font-size:.65rem; flex-shrink:0;
}
.widget-title { font-size:.76rem; font-weight:700; color:var(--text,#1e293b); }

/* Drag icon (visible seulement en edit) */
.widget-grip {
    display:none; color:var(--text-muted,#94a3b8);
    font-size:.8rem; margin-right:2px;
}
body.db-edit-mode .widget-grip { display:block; }

.widget-body { flex:1; overflow-y:auto; padding:12px 14px; min-height:0; }

/* ── Activity ────────────────────────────────────────── */
.act-item { display:flex; gap:9px; padding:7px 0; border-bottom:1px solid var(--border,#e8edf2); }
.act-item:last-child { border-bottom:none; }
.act-dot { width:26px; height:26px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:.58rem; flex-shrink:0; margin-top:1px; }
.act-dot--demande{background:#eff6ff;color:#2563eb}.act-dot--email{background:#f0fdf4;color:#16a34a}
.act-dot--note{background:#fefce8;color:#ca8a04}.act-dot--visite{background:#faf5ff;color:#7c3aed}
.act-dot--offre{background:#fff7ed;color:#ea580c}.act-dot--sms{background:#f0f9ff;color:#0284c7}
.act-body { flex:1; min-width:0; }
.act-title { font-size:.75rem; font-weight:700; color:var(--text,#1e293b); }
.act-desc  { font-size:.69rem; color:var(--text-muted,#64748b); margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.act-meta  { font-size:.65rem; color:var(--text-light,#94a3b8); margin-top:3px; display:flex; gap:7px; flex-wrap:wrap; }

/* ── Events ──────────────────────────────────────────── */
.ev-item { display:flex; gap:10px; padding:8px 0; border-bottom:1px solid var(--border,#e8edf2); }
.ev-item:last-child { border-bottom:none; }
.ev-date { width:36px; text-align:center; flex-shrink:0; background:var(--bg,#f8fafc); border-radius:7px; border:1px solid var(--border,#e8edf2); padding:3px 0; }
.ev-day   { font-size:.95rem; font-weight:800; color:var(--text,#1e293b); line-height:1; }
.ev-mon   { font-size:.55rem; font-weight:700; color:var(--text-muted,#64748b); text-transform:uppercase; }
.ev-body  { flex:1; min-width:0; }
.ev-title { font-size:.75rem; font-weight:700; color:var(--text,#1e293b); }
.ev-meta  { font-size:.67rem; color:var(--text-muted,#64748b); margin-top:3px; display:flex; gap:6px; flex-wrap:wrap; }
.ev-dot   { width:7px; height:7px; border-radius:50%; flex-shrink:0; margin-top:2px; }
.ev-dot--visite{background:#7c3aed}.ev-dot--appel{background:#2563eb}
.ev-dot--signature{background:#16a34a}.ev-dot--reunion{background:#ca8a04}

/* ── Demandes ────────────────────────────────────────── */
.dm-item { display:flex; align-items:center; gap:9px; padding:7px 0; border-bottom:1px solid var(--border,#e8edf2); }
.dm-item:last-child { border-bottom:none; }
.dm-av   { width:30px; height:30px; border-radius:50%; background:var(--brand,#2563eb); color:#fff; display:flex; align-items:center; justify-content:center; font-size:.68rem; font-weight:700; flex-shrink:0; }
.dm-info { flex:1; min-width:0; }
.dm-name { font-size:.75rem; font-weight:700; color:var(--text,#1e293b); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dm-sub  { font-size:.67rem; color:var(--text-muted,#64748b); }
.bdg     { font-size:.6rem; font-weight:700; padding:2px 7px; border-radius:20px; white-space:nowrap; text-transform:uppercase; letter-spacing:.03em; }
.bdg-nouveau{background:#eff6ff;color:#2563eb}.bdg-en_cours{background:#fef3c7;color:#b45309}
.bdg-qualifie{background:#f0fdf4;color:#16a34a}.bdg-attente{background:#f5f3ff;color:#7c3aed}
.bdg-clos{background:#f1f5f9;color:#64748b}

/* ── Courtiers ───────────────────────────────────────── */
.bk-row  { display:flex; align-items:center; gap:9px; padding:7px 0; border-bottom:1px solid var(--border,#e8edf2); }
.bk-row:last-child { border-bottom:none; }
.bk-av   { width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:.65rem; font-weight:700; color:#fff; flex-shrink:0; }
.bk-info { flex:1; min-width:0; }
.bk-name { font-size:.75rem; font-weight:700; color:var(--text,#1e293b); }
.bk-sub  { font-size:.67rem; color:var(--text-muted,#64748b); }
.bk-stat { text-align:right; font-size:1rem; font-weight:800; color:var(--text,#1e293b); }
.bk-stat small { display:block; font-size:.6rem; color:var(--text-muted,#64748b); font-weight:600; }

/* ── Quick actions ───────────────────────────────────── */
.qa-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.qa-btn  {
    display:flex; flex-direction:column; align-items:center; gap:5px;
    padding:11px 6px; border-radius:8px; border:1px solid var(--border,#e8edf2);
    background:var(--bg,#f8fafc); color:var(--text,#1e293b);
    text-decoration:none; font-size:.67rem; font-weight:600;
    transition:all .12s; text-align:center;
}
.qa-btn:hover { background:var(--brand,#2563eb); color:#fff; border-color:var(--brand,#2563eb); text-decoration:none; }
.qa-btn i { font-size:.9rem; }

/* ── Correspondances ─────────────────────────────────── */
.co-item { border:1px solid var(--border,#e8edf2); border-radius:8px; padding:9px 11px; margin-bottom:8px; background:var(--bg,#f8fafc); }
.co-item:last-child { margin-bottom:0; }
.co-ref   { font-size:.7rem; font-weight:800; color:var(--brand,#2563eb); }
.co-titre { font-size:.75rem; font-weight:600; color:var(--text,#1e293b); margin-bottom:5px; }
.co-match { display:flex; align-items:center; justify-content:space-between; padding:3px 0; }
.co-mname { font-size:.7rem; font-weight:600; }
.co-msub  { font-size:.64rem; color:var(--text-muted,#64748b); }
.co-score { font-size:.68rem; font-weight:800; padding:2px 7px; border-radius:20px; }
.co-score.high{background:#f0fdf4;color:#16a34a} .co-score.mid{background:#fef3c7;color:#b45309}

/* ══════════════════════════════════════════════════════
   BARRE DE PERSONNALISATION (bas de page, toujours visible en mode édition)
   ══════════════════════════════════════════════════════ */
.customize-bar {
    display: none;
    position: fixed;
    bottom: 0; left: 250px; right: 0;
    background: var(--card-bg, #fff);
    border-top: 2px solid var(--brand, #2563eb);
    box-shadow: 0 -4px 20px rgba(0,0,0,.12);
    z-index: 500;
    padding: 12px 24px;
    gap: 12px;
    align-items: center;
}
body.db-edit-mode .customize-bar { display: flex; }
/* Sidebar collapsed */
body.sidebar-collapse .customize-bar { left: 0; }

.customize-bar-title {
    font-size: .78rem; font-weight: 700;
    color: var(--brand, #2563eb);
    white-space: nowrap;
    display: flex; align-items: center; gap: 6px;
}

.customize-bar-widgets {
    display: flex; flex-wrap: wrap; gap: 8px;
    flex: 1;
}

.cw-chip {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 20px;
    border: 1.5px solid var(--border, #e8edf2);
    background: var(--bg, #f8fafc);
    font-size: .72rem; font-weight: 600;
    color: var(--text-muted, #64748b);
    cursor: pointer; user-select: none;
    transition: all .12s;
}
.cw-chip:hover { border-color: var(--brand, #2563eb); color: var(--brand, #2563eb); }
.cw-chip.is-active {
    background: var(--brand, #2563eb);
    border-color: var(--brand, #2563eb);
    color: #fff;
}
.cw-chip i { font-size: .6rem; }

.customize-bar-actions {
    display: flex; gap: 8px; flex-shrink: 0;
}

/* Padding bas de page quand barre ouverte */
body.db-edit-mode #pageContent,
body.db-edit-mode .content-wrapper,
body.db-edit-mode main {
    padding-bottom: 80px !important;
}

/* Hint en haut */
.edit-hint {
    display: none;
    background: var(--brand-bg, #eff6ff);
    border: 1px solid var(--brand, #2563eb);
    border-radius: 8px; padding: 8px 14px;
    font-size: .74rem; color: var(--brand, #2563eb);
    font-weight: 600; margin-bottom: 14px;
    align-items: center; gap: 8px;
}
body.db-edit-mode .edit-hint { display: flex; }

@media (max-width: 900px) {
    .kpi-grid { grid-template-columns:repeat(2,1fr); }
    .db-widgets-grid { grid-template-columns:repeat(2,1fr); }
    .qa-grid { grid-template-columns:repeat(2,1fr); }
}
@media (max-width: 600px) {
    .db-widgets-grid { grid-template-columns:1fr; }
    .customize-bar { flex-direction:column; align-items:flex-start; padding:12px 16px; }
}


.saved-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .8rem 1rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, var(--bg-card), var(--bg-table-head));
}

.saved-filter-left {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 220px;
}

.saved-filter-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--brand-light);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
}

.saved-filter-title {
    font-size: .82rem;
    font-weight: 700;
    color: var(--text);
}

.saved-filter-subtitle {
    font-size: .68rem;
    color: var(--text-muted);
}

.saved-filter-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.saved-filter-select {
    min-width: 240px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text);
    font-size: .78rem;
    padding: 4px 8px;
}

.saved-filter-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.saved-filter-modal.d-none {
    display: none;
}

.saved-filter-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .45);
}

.saved-filter-modal-card {
    position: relative;
    width: 420px;
    max-width: calc(100vw - 32px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
    overflow: hidden;
}

.saved-filter-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.saved-filter-modal-head strong {
    display: block;
    font-size: .95rem;
    color: var(--text);
}

.saved-filter-modal-head span {
    display: block;
    margin-top: 2px;
    font-size: .72rem;
    color: var(--text-muted);
}

.saved-filter-modal-head button {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.saved-filter-modal-body {
    padding: 1rem;
}

.saved-filter-modal-body label {
    font-size: .75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: .35rem;
}

.saved-filter-check {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin-top: .9rem;
    font-weight: 500 !important;
    color: var(--text-muted) !important;
}

.saved-filter-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    padding: .85rem 1rem;
    border-top: 1px solid var(--border);
    background: var(--bg-table-head);
}

@media (max-width: 768px) {
    .saved-filter-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .saved-filter-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .saved-filter-select {
        width: 100%;
    }
}
.contacts-filters-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.contacts-filters-bar .form-control {
    width: auto;
    min-width: 150px;
}

.contacts-filters-bar input[type="search"] {
    min-width: 220px;
}



/* ── Éditeur de blocs site ───────────────────────────── */
.bloc-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    margin-bottom: 12px;
    overflow: hidden;
}
.bloc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-table-head);
    border-bottom: 1px solid var(--border);
    cursor: grab;
    user-select: none;
}
.bloc-header .bloc-type {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
}
.bloc-body { padding: 14px; }
.bloc-card.collapsed .bloc-body { display: none; }
.bloc-card.inactive { opacity: .5; }
