/* ==========================================================================
   Avocat – feuille de style de l'application (Bootstrap 5.3 RTL)
   ========================================================================== */

:root {
    --app-font: "Cairo", "Segoe UI", Tahoma, sans-serif;
    /* Couleurs de la charte INVUP AVOCAT : rouge bordeaux #8a0e16, gris anthracite #4c4c4c */
    --app-primary: #8a0e16;
    --app-primary-rgb: 138, 14, 22;
    --app-accent: #c9a227;
    --app-grey: #4c4c4c;
    --app-sidebar-bg: #23262b;
    --app-sidebar-fg: #cfd3da;
    --app-sidebar-active: rgba(255, 255, 255, 0.08);
    --app-sidebar-width: 264px;
    --app-topbar-height: 64px;
    --app-body-bg: #f3f5f9;
    --app-card-bg: #ffffff;
    --app-card-border: #e6e9f0;
    --app-text: #1f2937;
    --app-muted: #6b7280;
    --app-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.06);
    --app-radius: 14px;

    --bs-primary: var(--app-primary);
    --bs-primary-rgb: var(--app-primary-rgb);
    --bs-link-color: var(--app-primary);
    --bs-link-color-rgb: var(--app-primary-rgb);
    --bs-body-font-family: var(--app-font);
}

[data-bs-theme="dark"] {
    --app-body-bg: #0b1220;
    --app-card-bg: #141c2e;
    --app-card-border: #243049;
    --app-text: #e5e9f2;
    --app-muted: #9aa4b8;
    --app-sidebar-bg: #15171b;
    --app-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 18px rgba(0, 0, 0, 0.35);
    --bs-body-bg: var(--app-body-bg);
    --bs-body-color: var(--app-text);
}

html, body { height: 100%; }

body {
    font-family: var(--app-font);
    background: var(--app-body-bg);
    color: var(--app-text);
    font-size: 0.95rem;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-weight: 700; }

a { text-decoration: none; }
a:hover { text-decoration: none; }

/* --------------------------------------------------------------------------
   Boutons / composants Bootstrap re-teintés
   -------------------------------------------------------------------------- */
.btn { border-radius: 10px; font-weight: 600; }
.btn-primary, .btn-info {
    --bs-btn-bg: var(--app-primary);
    --bs-btn-border-color: var(--app-primary);
    --bs-btn-hover-bg: #6e0b11;
    --bs-btn-hover-border-color: #6e0b11;
    --bs-btn-active-bg: #57090e;
    --bs-btn-active-border-color: #57090e;
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
}
.btn-outline-primary { --bs-btn-color: var(--app-primary); --bs-btn-border-color: var(--app-primary); --bs-btn-hover-bg: var(--app-primary); --bs-btn-hover-border-color: var(--app-primary); --bs-btn-active-bg: var(--app-primary); --bs-btn-active-border-color: var(--app-primary); --bs-btn-active-color: #fff; }
.btn-rounded { border-radius: 999px; }
.btn-icon {
    width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px; border: 0; background: transparent; color: var(--app-muted); position: relative;
}
.btn-icon:hover { background: rgba(var(--app-primary-rgb), 0.08); color: var(--app-primary); }

.form-control, .form-select { border-radius: 10px; padding: 0.55rem 0.85rem; }
.form-control:focus, .form-select:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--app-primary-rgb), 0.15);
}
.form-group { margin-bottom: 1rem; }
label, .form-label { font-weight: 600; }

.card {
    border: 1px solid var(--app-card-border);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
    background: var(--app-card-bg);
    margin-bottom: 1.5rem;
}
.card-title { font-weight: 700; }
.card-header { background: transparent; border-bottom: 1px solid var(--app-card-border); font-weight: 700; }

.table { --bs-table-bg: transparent; }
.table thead th { font-weight: 700; color: var(--app-muted); font-size: 0.85rem; text-transform: none; border-bottom-width: 1px; }
.table td, .table th { vertical-align: middle; }
.table-hover > tbody > tr:hover > * { --bs-table-accent-bg: rgba(var(--app-primary-rgb), 0.04); }
.table .like, .table .remove { margin-inline: 0.35rem; font-size: 1.05rem; }
.table .remove i { color: #e5484d; }

.modal-content { border: 0; border-radius: var(--app-radius); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25); }
.modal-header { border-bottom: 1px solid var(--app-card-border); }
.modal-footer { border-top: 1px solid var(--app-card-border); }
.modal-title { font-weight: 700; }

.badge { font-weight: 600; border-radius: 8px; padding: 0.4em 0.65em; }
.breadcrumb { margin: 0; font-size: 0.85rem; }
.breadcrumb-item + .breadcrumb-item::before { content: "‹"; }
.dropdown-menu { border-radius: 12px; border: 1px solid var(--app-card-border); box-shadow: var(--app-shadow); }
.alert { border-radius: 12px; }

/* --------------------------------------------------------------------------
   Structure : sidebar + topbar + contenu
   -------------------------------------------------------------------------- */
.app { display: flex; min-height: 100vh; }

.app-sidebar {
    width: var(--app-sidebar-width);
    background: var(--app-sidebar-bg);
    color: var(--app-sidebar-fg);
    position: fixed; inset-block: 0; inset-inline-start: 0;
    display: flex; flex-direction: column;
    z-index: 1040;
    transition: transform 0.25s ease;
    overflow-y: auto;
}
.sidebar-brand {
    height: var(--app-topbar-height);
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0 1.25rem;
    color: #fff; font-weight: 800; font-size: 1.05rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar-brand img { height: 42px; width: auto; max-width: 100%; object-fit: contain; }
.sidebar-nav { padding: 1rem 0.75rem; flex: 1; }
.sidebar-nav .nav-section { font-size: 0.72rem; letter-spacing: 0.04em; color: rgba(255, 255, 255, 0.35); padding: 1rem 0.75rem 0.35rem; font-weight: 700; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.6rem 0.85rem; margin-bottom: 2px;
    color: var(--app-sidebar-fg); border-radius: 10px; font-weight: 600;
}
.sidebar-nav a i { width: 20px; text-align: center; font-size: 1rem; opacity: 0.85; }
.sidebar-nav a:hover { background: var(--app-sidebar-active); color: #fff; }
.sidebar-nav a.active { background: var(--app-primary); color: #fff; }
.sidebar-nav a .badge { margin-inline-start: auto; }
.sidebar-footer { padding: 1rem; border-top: 1px solid rgba(255, 255, 255, 0.06); font-size: 0.85rem; }
.sidebar-footer .user { display: flex; align-items: center; gap: 0.65rem; color: #fff; }
.sidebar-footer .avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--app-accent); color: #23262b; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }

.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 1035; }

.app-main {
    flex: 1; min-width: 0;
    margin-inline-start: var(--app-sidebar-width);
    display: flex; flex-direction: column; min-height: 100vh;
    transition: margin 0.25s ease;
}

.app-topbar {
    height: var(--app-topbar-height);
    background: var(--app-card-bg);
    border-bottom: 1px solid var(--app-card-border);
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0 1.25rem;
    position: sticky; top: 0; z-index: 1030;
}
.topbar-search { position: relative; flex: 1; max-width: 480px; }
.topbar-search input { padding-inline-start: 2.5rem; background: var(--app-body-bg); border-color: transparent; }
.topbar-search > i { position: absolute; pointer-events: none; inset-inline-start: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--app-muted); }
.topbar-badge {
    position: absolute; top: 2px; inset-inline-end: 2px;
    min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px;
    background: #e5484d; color: #fff; font-size: 0.7rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.topbar-user { display: flex; align-items: center; gap: 0.6rem; padding: 0.3rem 0.6rem; border-radius: 10px; color: var(--app-text); }
.topbar-user:hover { background: rgba(var(--app-primary-rgb), 0.06); }
.topbar-user .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--app-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }

.app-content { flex: 1; padding: 1.5rem 1.25rem; }
.app-footer { padding: 1rem 1.25rem; color: var(--app-muted); font-size: 0.85rem; border-top: 1px solid var(--app-card-border); }

/* Sidebar repliée (bureau) */
body.sidebar-collapsed .app-sidebar { transform: translateX(100%); }
body.sidebar-collapsed .app-main { margin-inline-start: 0; }

@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(100%); }
    .app-main { margin-inline-start: 0; }
    body.sidebar-open .app-sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop { display: block; }
    .app-content { padding: 1rem 0.75rem; }
    .topbar-user .name { display: none; }
}

/* Mobile : la recherche globale passe sur une 2e ligne pleine largeur sous les icônes */
@media (max-width: 767.98px) {
    .app-topbar { height: auto; min-height: var(--app-topbar-height); flex-wrap: wrap; row-gap: 0.5rem; padding: 0.55rem 0.75rem 0.65rem; }
    .topbar-search { order: 10; flex: 0 0 100%; max-width: none; }
    .topbar-search input { font-size: 16px; height: 42px; } /* 16px : évite le zoom auto d'iOS */
    .search-suggest { max-height: 65vh; }
}

/* --------------------------------------------------------------------------
   En-tête de page
   -------------------------------------------------------------------------- */
.page-header { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-bottom: 1.25rem; }
.page-header .page-title { font-size: 1.35rem; font-weight: 800; margin: 0; display: flex; align-items: center; gap: 0.6rem; }
.page-header .page-title i { color: var(--app-primary); font-size: 1.2rem; }
.page-header .page-actions { margin-inline-start: auto; display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   Tableau de bord
   -------------------------------------------------------------------------- */
.stat-card { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; }
.stat-card .stat-icon { width: 52px; height: 52px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; color: #fff; flex-shrink: 0; }
.stat-card .stat-value { font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.stat-card .stat-label { color: var(--app-muted); font-weight: 600; font-size: 0.85rem; }
.bg-grad-1 { background: linear-gradient(135deg, #8a0e16, #c43a42); }
.bg-grad-2 { background: linear-gradient(135deg, #0ea5a4, #22c7b9); }
.bg-grad-3 { background: linear-gradient(135deg, #c9a227, #e3c466); }
.bg-grad-4 { background: linear-gradient(135deg, #e5484d, #f08a8d); }
.bg-grad-5 { background: linear-gradient(135deg, #6d28d9, #9d6bff); }
.bg-grad-6 { background: linear-gradient(135deg, #4c4c4c, #7d7d7d); }
.chart-box { position: relative; height: 280px; }
.list-audiences .item { display: flex; gap: 0.9rem; align-items: flex-start; padding: 0.75rem 0; border-bottom: 1px solid var(--app-card-border); }
.list-audiences .item:last-child { border-bottom: 0; }
.list-audiences .date { min-width: 58px; text-align: center; background: rgba(var(--app-primary-rgb), 0.08); border-radius: 10px; padding: 0.35rem 0.25rem; }
.list-audiences .date .d { font-size: 1.25rem; font-weight: 800; line-height: 1; color: var(--app-primary); }
.list-audiences .date .m { font-size: 0.72rem; color: var(--app-muted); }

/* --------------------------------------------------------------------------
   Fiche affaire
   -------------------------------------------------------------------------- */
.detail-list dt { color: var(--app-muted); font-weight: 600; font-size: 0.82rem; }
.detail-list dd { font-weight: 600; margin-bottom: 0.8rem; }
.nav-tabs { border-bottom: 1px solid var(--app-card-border); }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--app-muted); font-weight: 700; }
.nav-tabs .nav-link.active { color: var(--app-primary); border-bottom-color: var(--app-primary); background: transparent; }

/* --------------------------------------------------------------------------
   Connexion
   -------------------------------------------------------------------------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; grid-auto-rows: minmax(100vh, auto); background: #15171b; }
.login-visual {
    position: relative; overflow: hidden; color: #fff;
    background: url("../../assets/images/login-bg.jpg") center / cover no-repeat;
    display: flex; flex-direction: column; justify-content: flex-end; padding: 3rem;
}
.login-visual::before {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(21, 23, 27, 0.35) 0%, rgba(21, 23, 27, 0.55) 55%, rgba(138, 14, 22, 0.85) 100%);
}
.login-visual > * { position: relative; }
.login-visual .brand img { height: 64px; }
.login-visual h2 { font-weight: 800; font-size: 1.6rem; margin: 1.5rem 0 0.5rem; }
.login-visual p { color: rgba(255, 255, 255, 0.85); max-width: 32rem; margin: 0; }
.login-visual .features { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: 1.5rem; font-size: 0.9rem; }
.login-visual .features span { display: inline-flex; align-items: center; gap: 0.45rem; background: rgba(255, 255, 255, 0.12); padding: 0.4rem 0.8rem; border-radius: 999px; backdrop-filter: blur(4px); }
.login-form { display: flex; align-items: center; justify-content: center; padding: 2rem 1.5rem; background: var(--app-body-bg); }
.login-card { width: 100%; max-width: 420px; padding: 2.25rem 2rem; }
.login-card .logo { height: 70px; width: auto; margin: 0 auto 1.25rem; display: block; }
.login-card .input-group-text { background: transparent; color: var(--app-muted); border-radius: 10px 0 0 10px; }
.login-card .form-control { border-radius: 0 10px 10px 0; }
.login-card .input-group .btn { border-radius: 10px 0 0 10px; }
.login-card .input-group .form-control:not(:last-child) { border-radius: 0; }
.login-card .btn-primary { padding: 0.7rem; font-size: 1.05rem; }
.login-foot { color: var(--app-muted); font-size: 0.8rem; text-align: center; margin-top: 1.5rem; }
@media (max-width: 991.98px) {
    .login-page { grid-template-columns: 1fr; grid-auto-rows: auto; }
    .login-visual { min-height: 38vh; padding: 1.75rem; }
    .login-visual h2 { font-size: 1.25rem; }
    .login-visual .features { display: none; }
    .login-form { padding: 1.5rem 1rem 2.5rem; }
}

/* --------------------------------------------------------------------------
   Calendrier
   -------------------------------------------------------------------------- */
.fc { --fc-border-color: var(--app-card-border); --fc-page-bg-color: var(--app-card-bg); --fc-today-bg-color: rgba(201, 162, 39, 0.12); --fc-event-bg-color: var(--app-primary); --fc-event-border-color: var(--app-primary); font-family: var(--app-font); }
.fc .fc-toolbar-title { font-size: 1.15rem; font-weight: 800; }
.fc .fc-button { border-radius: 8px; font-family: var(--app-font); font-weight: 600; }
.fc .fc-button-primary { background: var(--app-primary); border-color: var(--app-primary); }

/* --------------------------------------------------------------------------
   DataTables / Select2 / SweetAlert
   -------------------------------------------------------------------------- */
div.dt-container .dt-buttons .btn { margin-inline-end: 0.35rem; margin-bottom: 0.75rem; }
div.dt-container div.dt-search input { border-radius: 10px; }
div.dt-container .dt-paging .dt-paging-button { border-radius: 8px; }
.select2-container--bootstrap-5 .select2-selection { border-radius: 10px; min-height: 42px; font-family: var(--app-font); }
.select2-container--bootstrap-5 .select2-dropdown { font-family: var(--app-font); }
.swal2-popup { font-family: var(--app-font) !important; border-radius: 16px !important; }
.swal2-title { font-weight: 800 !important; }

/* --------------------------------------------------------------------------
   Compatibilité avec les anciennes classes du thème (Material Pro)
   -------------------------------------------------------------------------- */
.text-themecolor { color: var(--app-primary) !important; }
.m-t-0 { margin-top: 0 !important; } .m-t-5 { margin-top: 5px !important; } .m-t-10 { margin-top: 10px !important; }
.m-t-15 { margin-top: 15px !important; } .m-t-20 { margin-top: 20px !important; } .m-t-30 { margin-top: 30px !important; } .m-t-40 { margin-top: 40px !important; }
.m-b-0 { margin-bottom: 0 !important; } .m-b-5 { margin-bottom: 5px !important; } .m-b-10 { margin-bottom: 10px !important; }
.m-b-15 { margin-bottom: 15px !important; } .m-b-20 { margin-bottom: 20px !important; } .m-b-30 { margin-bottom: 30px !important; } .m-b-40 { margin-bottom: 40px !important; }
.m-r-10 { margin-inline-end: 10px !important; } .m-l-10 { margin-inline-start: 10px !important; }
.p-20 { padding: 20px !important; } .p-10 { padding: 10px !important; }
.no-block { display: block; }
.waves-effect { position: relative; }
.text-cyan { color: #0ea5a4 !important; } .bg-cyan { background: #0ea5a4 !important; }
.text-success { color: #16a34a !important; }
.icon-card { font-size: 1.6rem; }
.font-bold { font-weight: 700; }
.wizard-content .wizard > .steps > ul > li a { font-family: var(--app-font); }

/* --------------------------------------------------------------------------
   Tableaux : défilement horizontal (DataTables scrollX) en RTL
   -------------------------------------------------------------------------- */
div.dt-container div.dt-scroll { direction: rtl; }
div.dt-container div.dt-scroll-body { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
div.dt-container div.dt-scroll-body::-webkit-scrollbar { height: 10px; }
div.dt-container div.dt-scroll-body::-webkit-scrollbar-thumb { background: rgba(var(--app-primary-rgb), 0.35); border-radius: 6px; }
div.dt-container table.dataTable { margin-bottom: 0 !important; }
div.dt-container table.dataTable th, div.dt-container table.dataTable td { white-space: nowrap; }
.table-responsive { overflow-x: auto; }

/* --------------------------------------------------------------------------
   Module Archive
   -------------------------------------------------------------------------- */
.dropzone { border: 2px dashed rgba(var(--app-primary-rgb), 0.35); border-radius: var(--app-radius); padding: 1.5rem; text-align: center; background: rgba(var(--app-primary-rgb), 0.03); transition: all .15s; }
.dropzone.is-over { border-color: var(--app-primary); background: rgba(var(--app-primary-rgb), 0.08); transform: scale(1.005); }
.upload-queue li { display: grid; grid-template-columns: 1fr auto auto; gap: .25rem .75rem; align-items: center; font-size: .85rem; padding: .35rem 0; border-bottom: 1px solid var(--app-card-border); transition: opacity .4s; }
.upload-queue li .progress { grid-column: 1 / -1; height: 4px; }
.upload-queue li .q-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-queue li .q-cat { color: var(--app-muted); font-size: .75rem; }
.upload-queue li.done { opacity: .45; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: .9rem; }
.doc-card { border: 1px solid var(--app-card-border); border-radius: 12px; overflow: hidden; background: var(--app-card-bg); cursor: pointer; transition: box-shadow .15s, transform .15s; display: flex; flex-direction: column; }
.doc-card:hover, .doc-card:focus { box-shadow: var(--app-shadow); transform: translateY(-2px); outline: none; border-color: rgba(var(--app-primary-rgb), .4); }
.doc-thumb { position: relative; aspect-ratio: 4 / 3; background: var(--app-body-bg); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.doc-thumb .doc-icon { font-size: 2.6rem; }
.doc-thumb .doc-pages { position: absolute; bottom: 6px; inset-inline-start: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: .7rem; padding: 1px 6px; border-radius: 6px; }
.doc-body { padding: .6rem .7rem .7rem; }
.doc-title { font-weight: 700; font-size: .86rem; line-height: 1.3; max-height: 2.6em; overflow: hidden; }
.doc-meta { font-size: .74rem; margin-top: .25rem; display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.doc-table tr { cursor: pointer; }
.viewer-pane { min-height: 70vh; background: #3a3f47; display: flex; align-items: center; justify-content: center; }
.viewer-pane iframe, .viewer-pane .viewer-pdf { width: 100%; height: 78vh; border: 0; background: #fff; display: block; }
.viewer-img { width: 100%; height: 78vh; overflow: auto; text-align: center; padding: 1rem; }
.viewer-img img { max-width: 100%; height: auto; box-shadow: 0 6px 24px rgba(0,0,0,.4); }
.viewer-empty { color: #fff; text-align: center; padding: 3rem; }
.modal-fullscreen-lg-down .viewer-pane iframe, .modal-fullscreen-lg-down .viewer-pane .viewer-pdf, .modal-fullscreen-lg-down .viewer-img { height: 70vh; }
.scan-pages { display: flex; gap: .6rem; flex-wrap: wrap; }
.scan-page { position: relative; width: 110px; height: 150px; border-radius: 8px; overflow: hidden; border: 1px solid var(--app-card-border); }
.scan-page img { width: 100%; height: 100%; object-fit: cover; }
.scan-page .n { position: absolute; top: 4px; inset-inline-start: 4px; background: var(--app-primary); color: #fff; font-size: .7rem; padding: 0 6px; border-radius: 6px; }
.scan-page .btn { position: absolute; top: 4px; inset-inline-end: 4px; padding: 0 .35rem; }
.search-thumb { width: 54px; height: 70px; object-fit: cover; object-position: top; border-radius: 6px; border: 1px solid var(--app-card-border); }
.search-snippet { font-size: .82rem; color: var(--app-muted); background: rgba(var(--app-primary-rgb), .04); border-inline-start: 3px solid var(--app-accent); padding: .35rem .6rem; margin-top: .35rem; border-radius: 6px; }
mark { background: #ffe58a; padding: 0 2px; border-radius: 3px; }
[data-bs-theme="dark"] mark { background: #7a5c00; color: #fff; }
.min-w-0 { min-width: 0; }

/* --------------------------------------------------------------------------
   Suggestions de la recherche globale
   -------------------------------------------------------------------------- */
.topbar-search { position: relative; }
.search-suggest { position: absolute; top: calc(100% + 6px); inset-inline: 0; background: var(--app-card-bg); border: 1px solid var(--app-card-border); border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18); z-index: 1050; max-height: 70vh; overflow: auto; display: none; }
.search-suggest.show { display: block; }
.search-suggest .sg-group { font-size: .72rem; font-weight: 700; color: var(--app-muted); padding: .55rem .9rem .2rem; letter-spacing: .02em; }
.search-suggest .sg-item { display: flex; gap: .7rem; align-items: center; padding: .5rem .9rem; color: var(--app-text); cursor: pointer; text-decoration: none; }
.search-suggest .sg-item i { width: 20px; text-align: center; color: var(--app-primary); }
.search-suggest .sg-item .sg-label { font-weight: 700; font-size: .9rem; }
.search-suggest .sg-item .sg-sub { font-size: .76rem; color: var(--app-muted); }
.search-suggest .sg-item:hover, .search-suggest .sg-item.active { background: rgba(var(--app-primary-rgb), .08); }
.search-suggest .sg-more { display: block; text-align: center; padding: .55rem; font-size: .82rem; border-top: 1px solid var(--app-card-border); color: var(--app-primary); font-weight: 700; }
.search-suggest .sg-empty { padding: .9rem; text-align: center; color: var(--app-muted); font-size: .85rem; }
.search-suggest mark { background: rgba(201, 162, 39, .35); padding: 0; }

/* --------------------------------------------------------------------------
   Module financier
   -------------------------------------------------------------------------- */
.top-clients .tc-row { display: flex; gap: .7rem; align-items: flex-start; padding: .55rem 0; border-bottom: 1px solid var(--app-card-border); color: var(--app-text); }
.top-clients .tc-row:last-child { border-bottom: 0; }
.top-clients .tc-rank { width: 26px; height: 26px; border-radius: 50%; background: rgba(var(--app-primary-rgb), .1); color: var(--app-primary); font-weight: 800; font-size: .8rem; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; }
.top-clients .tc-body { flex: 1; min-width: 0; }
.top-clients .tc-bar { display: block; height: 6px; background: var(--app-body-bg); border-radius: 4px; overflow: hidden; margin: .3rem 0 .15rem; }
.top-clients .tc-bar span { display: block; height: 100%; background: linear-gradient(90deg, #0ea5a4, #22c7b9); border-radius: 4px; }
.finance-card .card-header .btn-link { padding: 0; color: var(--app-muted); }

/* --------------------------------------------------------------------------
   Listes déroulantes avec recherche (Select2) : finitions + mode sombre
   -------------------------------------------------------------------------- */
.select2-container--bootstrap-5 .select2-selection--single { display: flex; align-items: center; }
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered { color: var(--app-text); }
.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection { border-color: var(--app-primary); box-shadow: 0 0 0 .2rem rgba(var(--app-primary-rgb), .15); }
.select2-container--bootstrap-5 .select2-selection.select2--small { min-height: 31px; border-radius: 8px; font-size: .875rem; }
.select2-container--bootstrap-5 .select2-dropdown { border-color: var(--app-card-border); border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, .15); overflow: hidden; z-index: 1060; }
.select2-container--bootstrap-5 .select2-dropdown .select2-search .select2-search__field { border-radius: 8px; }
.select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option.select2-results__option--highlighted { background-color: rgba(var(--app-primary-rgb), .1); color: var(--app-text); }
.select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option.select2-results__option--selected,
.select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option[aria-selected=true]:not(.select2-results__option--highlighted) { background-color: var(--app-primary); color: #fff; }
.select2-container--bootstrap-5 .select2-results__option strong { font-weight: inherit; }
.modal .select2-container--bootstrap-5 { z-index: auto; }
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection,
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-dropdown,
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-dropdown .select2-search .select2-search__field { background-color: var(--app-card-bg); border-color: var(--app-card-border); color: var(--app-text); }
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option { color: var(--app-text); }
[data-bs-theme="dark"] .select2-container--bootstrap-5.select2-container--disabled .select2-selection { background-color: #1b2438; }

/* ---------- DocScan : scanner de documents (archive) ---------- */
.docscan { position: fixed; inset: 0; z-index: 2000; background: #111317; color: #fff; display: none; flex-direction: column; font-family: inherit; }
.docscan.open { display: flex; }
.docscan .ds-top { display: flex; align-items: center; gap: .75rem; padding: .6rem .9rem; background: #1b1e24; }
.docscan .ds-title { font-weight: 700; }
.docscan .ds-hint { margin-inline-start: auto; color: #aab; font-size: .85rem; }
.docscan .ds-stage { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; }
.docscan .ds-wrap { position: relative; }
.docscan .ds-canvas { width: 100%; height: 100%; display: block; box-shadow: 0 6px 30px rgba(0,0,0,.6); background: #fff; }
.docscan .ds-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.docscan .ds-h { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; border: 3px solid #c9a227; background: rgba(255,255,255,.25); touch-action: none; cursor: grab; box-shadow: 0 0 0 3px rgba(0,0,0,.35); }
.docscan .ds-loupe { position: absolute; display: none; width: 120px; height: 120px; border-radius: 50%; border: 3px solid #c9a227; box-shadow: 0 4px 18px rgba(0,0,0,.6); pointer-events: none; background: #000; }
.docscan .ds-busy { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,.35); }
.docscan .ds-bar { padding: .6rem .75rem calc(.6rem + env(safe-area-inset-bottom)); background: #1b1e24; display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.docscan .ds-filter { display: none; flex-direction: column; align-items: stretch; }
.docscan.filter-mode .ds-filter { display: flex; }
.docscan.filter-mode .ds-crop { display: none; }
.docscan .ds-btn { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; padding: .45rem .7rem; border: 0; border-radius: 10px; background: #2a2e36; color: #fff; font-size: .78rem; }
.docscan .ds-btn i { font-size: 1.15rem; }
.docscan .ds-btn.ds-main { background: #8a0e16; }
.docscan .ds-btn.ds-ghost { background: transparent; min-width: 0; padding: .2rem .5rem; }
.docscan .ds-chips { display: flex; gap: .4rem; justify-content: center; flex-wrap: wrap; }
.docscan .ds-chip { border: 1px solid #444a55; background: transparent; color: #ddd; border-radius: 20px; padding: .3rem .9rem; font-size: .85rem; }
.docscan .ds-chip.active { background: #c9a227; border-color: #c9a227; color: #111; font-weight: 700; }
.docscan .ds-actions { display: flex; gap: .4rem; justify-content: center; flex-wrap: wrap; }
.scan-page .ds-edit { position: absolute; top: auto; bottom: 4px; inset-inline-end: 4px; padding: 0 .35rem; }
.scan-page .ds-move { position: absolute; bottom: 4px; inset-inline-start: 4px; display: flex; gap: 2px; }
.scan-page .ds-move .btn { position: static; padding: 0 .3rem; }
.scan-page .badge-filter { position: absolute; top: 28px; inset-inline-start: 4px; font-size: .62rem; }

/* ---------- الإجراءات ---------- */
tr.ejraa-done td:not(:first-child):not(:last-child) { color: var(--app-muted); }
tr.ejraa-done td b { text-decoration: line-through; text-decoration-color: rgba(0,0,0,.25); }
.form-check-input:checked { background-color: var(--app-primary); border-color: var(--app-primary); }
.form-check-input:focus { border-color: rgba(var(--app-primary-rgb), .5); box-shadow: 0 0 0 .2rem rgba(var(--app-primary-rgb), .15); }
