/* Charte logo Délégation Générale Wallonie-Bruxelles Kinshasa + lisibilité sur fond clair (WCAG) */
:root {
    --cwb-black: #111111;
    --cwb-red: #e21238;
    --cwb-red-dark: #c01030;
    --cwb-yellow: #ffd200;
    /* Jaune assombri pour texte sur blanc (le jaune logo seul manque de contraste) */
    --cwb-yellow-ink: #7a5f00;
    --cwb-yellow-soft: #fffbeb;
    --cwb-bg: #f6f7f9;
    --cwb-panel: #ffffff;
    --cwb-muted: #5c6370;
    --cwb-border: #e2e5eb;
    --cwb-font: "Montserrat", system-ui, sans-serif;
}

.cwb-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--cwb-font);
    background: var(--cwb-bg);
    color: var(--cwb-black);
}

.cwb-header {
    background: #ffffff;
    border-bottom: 3px solid var(--cwb-red) !important;
    box-shadow: inset 0 -4px 0 #d4a12a;
}

.cwb-logo {
    display: block;
    width: min(280px, 72vw);
    height: auto;
    max-height: 88px;
    object-fit: contain;
    object-position: left center;
    flex-shrink: 0;
}

.cwb-brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.1rem;
    line-height: 1.25;
    color: var(--cwb-black);
    font-weight: 700;
    font-size: clamp(0.85rem, 1.8vw, 1.05rem);
}

.cwb-brand-text__line {
    display: block;
}

.cwb-back-home {
    color: var(--cwb-muted);
    font-weight: 600;
    font-size: 0.95rem;
}

.cwb-back-home:hover,
.cwb-back-home:focus {
    color: var(--cwb-red);
}

.cwb-conseils {
    border: 1px solid var(--cwb-border);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.cwb-conseils__summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.95rem 1.1rem;
    cursor: pointer;
    font-weight: 700;
    color: var(--cwb-black);
    user-select: none;
}

.cwb-conseils__summary::-webkit-details-marker {
    display: none;
}

.cwb-conseils__chevron {
    color: var(--cwb-muted);
    transition: transform 0.2s ease;
}

.cwb-conseils[open] .cwb-conseils__chevron {
    transform: rotate(180deg);
}

.cwb-conseils__body {
    padding: 0 1.1rem 1.15rem;
    border-top: 1px solid var(--cwb-border);
}

.cwb-nav-link {
    color: var(--cwb-black) !important;
    font-weight: 600;
    position: relative;
    padding-bottom: 0.25rem !important;
}

.cwb-nav-link:hover,
.cwb-nav-link:focus { color: var(--cwb-red) !important; }

.cwb-nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--cwb-red);
    transition: width 0.2s ease;
}

.cwb-nav-link:hover::after {
    width: 100%;
}

.cwb-btn-primary {
    --bs-btn-color: #ffffff;
    --bs-btn-bg: var(--cwb-red);
    --bs-btn-border-color: var(--cwb-red);
    --bs-btn-hover-bg: var(--cwb-red-dark);
    --bs-btn-hover-border-color: var(--cwb-red-dark);
    --bs-btn-hover-color: #ffffff;
    --bs-btn-font-weight: 700;
    border-radius: 8px;
    letter-spacing: 0.02em;
}

.cwb-main {
    flex: 1;
}

.cwb-btn-outline {
    border: 1px solid var(--cwb-border);
    color: var(--cwb-black);
    background: #fff;
    border-radius: 8px;
    font-weight: 600;
}

.cwb-btn-outline:hover {
    border-color: var(--cwb-red);
    color: var(--cwb-red);
    background: #fffefb;
}

/* Bouton secondaire type logo : jaune + texte noir */
.cwb-btn-accent {
    --bs-btn-color: var(--cwb-black);
    --bs-btn-bg: var(--cwb-yellow);
    --bs-btn-border-color: #e6bc00;
    --bs-btn-hover-bg: #e6bc00;
    --bs-btn-hover-border-color: #ccaa00;
    --bs-btn-hover-color: var(--cwb-black);
    --bs-btn-font-weight: 700;
    border-radius: 8px;
}

.cwb-hero {
    padding: 2rem 0 1.25rem;
}

.cwb-hero h1 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--cwb-black);
}

.cwb-hero .lead {
    color: #4b5563;
    max-width: 40rem;
}

.cwb-accent-bar {
    width: 4px;
    background: linear-gradient(180deg, var(--cwb-yellow) 0%, var(--cwb-red) 100%);
    border-radius: 2px;
    flex-shrink: 0;
}

.cwb-card {
    background: var(--cwb-panel);
    border: 1px solid var(--cwb-border);
    border-radius: 14px;
    box-shadow: 0 8px 25px rgba(17, 24, 39, 0.06);
}

.cwb-card h2,
.cwb-card h3 {
    color: #111827;
    font-weight: 700;
    font-size: 1.1rem;
}

.cwb-card p,
.cwb-card li {
    color: #4b5563;
    font-size: 0.95rem;
}

.cwb-link-red {
    color: var(--cwb-red);
    font-weight: 600;
    text-decoration: none;
}

.cwb-link-red:hover {
    color: var(--cwb-red-dark);
    text-decoration: underline;
}

.cwb-footer {
    background: #ffffff;
    border-top: 1px solid var(--cwb-border);
}

/* Formulaire demande */
.cwb-form-panel {
    background: var(--cwb-panel);
    border: 1px solid var(--cwb-border);
    border-radius: 14px;
    padding: 2rem;
    box-shadow: 0 8px 25px rgba(17, 24, 39, 0.06);
}

.cwb-form-panel .form-label {
    color: #111827;
    font-weight: 600;
    font-size: 0.9rem;
}

.cwb-form-panel .form-control,
.cwb-form-panel .form-select {
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    color: #111827;
    border-radius: 8px;
}

.cwb-form-panel .form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 0.85rem 0.85rem;
    padding-right: 2.5rem;
    appearance: none;
    -webkit-appearance: none;
}

.cwb-form-panel .form-control:focus,
.cwb-form-panel .form-select:focus {
    border-color: var(--cwb-red);
    box-shadow: 0 0 0 0.2rem rgba(237, 28, 36, 0.18);
    background-color: #ffffff;
    color: #111827;
}

.cwb-form-panel .form-select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23e21238' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 0.85rem 0.85rem;
}

.cwb-form-panel .form-text {
    color: #6b7280;
}

.cwb-btn-submit {
    background: var(--cwb-red);
    color: #fff;
    border: none;
    font-weight: 700;
    padding: 0.65rem 1.5rem;
    border-radius: 8px;
}

.cwb-btn-submit:hover {
    background: var(--cwb-red-dark);
    color: #fff;
}

.cwb-alert-error {
    background: #fff5f5;
    border: 1px solid #f9c6c9;
    color: #9f1239;
    border-radius: 10px;
}

.cwb-alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    border-radius: 10px;
}

/* Numéros d’étapes : lisibles sur fond clair */
.cwb-step-gold {
    color: var(--cwb-yellow-ink);
    font-weight: 800;
}

.cwb-step-red {
    color: var(--cwb-red);
    font-weight: 800;
}

/* Tom Select (formulaire public) : flèche + recherche dans la liste */
.cwb-form-panel .ts-wrapper.single .ts-control {
    position: relative;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding-right: 2.6rem;
    min-height: calc(1.5em + 0.75rem + 2px);
    box-shadow: none;
}

.cwb-form-panel .ts-wrapper.plugin-clear_button.single .ts-control {
    padding-right: 3.6rem;
}

.cwb-form-panel .ts-wrapper.plugin-clear_button .clear-button {
    right: 2.15rem !important;
}

.cwb-form-panel .ts-wrapper.single .ts-control::after {
    content: '';
    position: absolute;
    right: 0.95rem;
    top: 50%;
    width: 0.5rem;
    height: 0.5rem;
    margin-top: -0.35rem;
    border-right: 2px solid #6b7280;
    border-bottom: 2px solid #6b7280;
    transform: rotate(45deg);
    pointer-events: none;
    transition: transform 0.15s ease;
}

.cwb-form-panel .ts-wrapper.dropdown-active.single .ts-control::after {
    margin-top: -0.05rem;
    transform: rotate(225deg);
    border-color: var(--cwb-red);
}

.cwb-form-panel .ts-wrapper.focus .ts-control {
    border-color: var(--cwb-red);
    box-shadow: 0 0 0 0.2rem rgba(237, 28, 36, 0.18);
}

.cwb-form-panel .ts-wrapper.single .ts-control > input {
    min-width: 0 !important;
}

.cwb-form-panel .ts-dropdown {
    z-index: 1055;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(17, 24, 39, 0.12);
    overflow: hidden;
}

.cwb-form-panel .ts-dropdown .dropdown-input-wrap {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.55rem 0.65rem;
}

.cwb-form-panel .ts-dropdown .dropdown-input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.45rem 0.7rem;
    font-size: 0.9rem;
    color: #111827;
    background: #ffffff;
}

.cwb-form-panel .ts-dropdown .dropdown-input:focus {
    outline: 0;
    border-color: var(--cwb-red);
    box-shadow: 0 0 0 0.15rem rgba(237, 28, 36, 0.15);
}

.cwb-form-panel .ts-dropdown .option {
    padding: 0.55rem 0.85rem;
}

.cwb-form-panel .ts-dropdown .option.active,
.cwb-form-panel .ts-dropdown .option:hover {
    background: #fff5f5;
    color: #9f1239;
}

/* DataTables — intégrés au thème AdminLTE (pas un design parallèle) */
.cwb-adminlte .dt-container .dt-search input,
.cwb-adminlte .dt-container .dt-input,
.cwb-adminlte .dt-container .dt-length select {
    border: 1px solid var(--bs-border-color, #dee2e6) !important;
    border-radius: var(--bs-border-radius, 0.375rem);
    padding: 0.35rem 0.65rem;
    min-height: calc(1.5em + 0.75rem + 2px);
    font-size: 0.9rem;
}

.cwb-adminlte .dt-container .dt-search input:focus,
.cwb-adminlte .dt-container .dt-input:focus,
.cwb-adminlte .dt-container .dt-length select:focus {
    border-color: rgba(var(--lte-primary-rgb, 237, 28, 36), 0.55) !important;
    box-shadow: 0 0 0 0.2rem rgba(var(--lte-primary-rgb, 237, 28, 36), 0.15);
    outline: 0;
}

.cwb-adminlte .dt-buttons .btn {
    margin-bottom: 0.35rem;
}

.cwb-adminlte .table.dataTable > thead > tr > th,
.cwb-adminlte .table.dataTable > tbody > tr > td {
    vertical-align: middle;
}

/* Conteneur discret : le cadre AdminLTE reste la card parente */
.cwb-adminlte .cwb-datatable-wrap,
.cwb-adminlte .cwb-secretariat-table-wrap {
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: transparent;
    box-shadow: none;
}

.cwb-adminlte .cwb-datatable-wrap .dataTables_wrapper,
.cwb-adminlte .cwb-datatable-wrap .dt-container,
.cwb-adminlte .cwb-secretariat-table-wrap .dataTables_wrapper,
.cwb-adminlte .cwb-secretariat-table-wrap .dt-container {
    padding: 0;
}

.cwb-adminlte .cwb-datatable thead th,
.cwb-adminlte .cwb-secretariat-table thead th {
    font-size: 0.85rem;
    text-transform: none;
    letter-spacing: 0;
    color: #495057;
    border-bottom: 2px solid #dee2e6 !important;
    white-space: nowrap;
    background: #f8f9fa;
    font-weight: 600;
}

.cwb-adminlte .cwb-datatable tbody td,
.cwb-adminlte .cwb-secretariat-table tbody td {
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    border-color: #dee2e6;
}

.cwb-adminlte .cwb-datatable tbody tr:hover > * {
    background-color: rgba(var(--lte-primary-rgb, 237, 28, 36), 0.04);
}

.cwb-adminlte .cwb-dt-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.cwb-adminlte .cwb-dt-toolbar__left,
.cwb-adminlte .cwb-dt-toolbar__right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.cwb-adminlte .cwb-dt-toolbar__right {
    margin-left: auto;
}

.cwb-adminlte .cwb-dt-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px solid #dee2e6;
}

.cwb-adminlte .cwb-dt-footer__left,
.cwb-adminlte .cwb-dt-footer__center,
.cwb-adminlte .cwb-dt-footer__right {
    display: flex;
    align-items: center;
}

.cwb-adminlte .cwb-dt-footer__center {
    color: #6c757d;
    font-size: 0.875rem;
}

.cwb-adminlte .dt-container .dt-paging .page-link {
    border-radius: var(--bs-border-radius, 0.375rem) !important;
    margin: 0 0.1rem;
    border: 1px solid #dee2e6;
    color: #212529;
    min-width: 2rem;
    text-align: center;
}

.cwb-adminlte .dt-container .dt-paging .page-item.active .page-link {
    background-color: var(--lte-primary, #ed1c24);
    border-color: var(--lte-primary, #ed1c24);
    color: #fff;
}

.cwb-adminlte .dt-container .dt-paging .page-link:hover {
    background-color: rgba(var(--lte-primary-rgb, 237, 28, 36), 0.08);
    border-color: rgba(var(--lte-primary-rgb, 237, 28, 36), 0.35);
    color: var(--lte-primary, #ed1c24);
}

.cwb-adminlte .dtr-details {
    width: 100%;
}

.cwb-adminlte .dtr-details li {
    border-bottom: 1px solid #dee2e6;
    padding: 0.35rem 0;
}

@media (max-width: 767.98px) {
    .cwb-adminlte .cwb-dt-toolbar,
    .cwb-adminlte .cwb-dt-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .cwb-adminlte .cwb-dt-toolbar__right,
    .cwb-adminlte .cwb-dt-footer__left,
    .cwb-adminlte .cwb-dt-footer__center,
    .cwb-adminlte .cwb-dt-footer__right {
        margin-left: 0;
        width: 100%;
    }

    .cwb-adminlte .dt-container .dt-search,
    .cwb-adminlte .dt-container .dt-search input {
        width: 100% !important;
    }
}

/* Secrétariat — demandes */
.cwb-secretariat-card > .card-header {
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
}

.cwb-secretariat-heading .card-title {
    font-weight: 700;
    letter-spacing: -0.01em;
}

.cwb-toolbar-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
}

.cwb-toolbar-buttons .btn,
.cwb-action-buttons .btn,
.btn.cwb-btn-info,
.btn.cwb-btn-assign,
.btn.cwb-btn-reply,
.btn.cwb-btn-primary,
.btn.cwb-btn-outline {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.2;
}

.cwb-toolbar-buttons .btn i,
.cwb-action-buttons .btn i,
.cwb-btn-icon {
    order: 0;
    flex-shrink: 0;
    width: 1em;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85em;
}

.cwb-toolbar-buttons .btn span,
.cwb-action-buttons .cwb-btn-label,
.cwb-btn-label {
    order: 1;
}

.cwb-ref-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: #f3f4f6;
    border: 1px solid var(--cwb-border);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--cwb-black);
}

.cwb-secretariat-table thead th {
    white-space: nowrap;
}

.cwb-secretariat-table-wrap {
    /* Le cadre AdminLTE est la card ; pas de double bordure */
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: transparent;
}

.cwb-secretariat-table-wrap .dataTables_wrapper,
.cwb-secretariat-table-wrap .dt-container {
    padding: 0;
}

/* Actions tableau secrétariat — ordre : Détails → Affecter → Répondre */
.cwb-action-buttons {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.35rem;
}

.cwb-action-buttons .btn {
    min-height: 2rem;
    padding: 0.3rem 0.65rem;
    border-radius: 8px;
}

.cwb-btn-info {
    color: #0b5ed7;
    background: #eef5ff;
    border: 1px solid #b6d4fe;
}

.cwb-btn-info:hover {
    color: #084298;
    background: #dbe9ff;
    border-color: #9ec5fe;
}

.cwb-btn-assign {
    color: #0f5132;
    background: #eafaf1;
    border: 1px solid #a3cfbb;
}

.cwb-btn-assign:hover {
    color: #0a3622;
    background: #d8f3e4;
    border-color: #8ec8ad;
}

.cwb-btn-reply {
    color: #664d03;
    background: #fff8e1;
    border: 1px solid #ffe69c;
}

.cwb-btn-reply:hover {
    color: #533f03;
    background: #ffefc2;
    border-color: #ffda6a;
}

@media (max-width: 767.98px) {
    .cwb-action-buttons {
        justify-content: flex-start;
        width: 100%;
    }

    .cwb-action-buttons .btn {
        flex: 1 1 auto;
    }

    .cwb-toolbar-buttons {
        justify-content: flex-start;
        width: 100%;
    }
}

/* Cards AdminLTE — cohérence globale du contenu */
.cwb-adminlte .app-content .card {
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.125), 0 1px 3px rgba(0, 0, 0, 0.2);
    margin-bottom: 1rem;
}

.cwb-adminlte .app-content .card.card-outline.card-secondary {
    border-top: 3px solid #6c757d;
}

.cwb-adminlte .app-content .card.card-outline.card-danger {
    border-top: 3px solid var(--lte-primary, #ed1c24);
}

.cwb-adminlte .app-content .card > .card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.085);
}

.cwb-adminlte .app-content .card > .card-header .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.cwb-adminlte .app-content .breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 0;
}

.cwb-adminlte .app-content .breadcrumb-item + .breadcrumb-item::before {
    color: #adb5bd;
}

.cwb-adminlte .app-content .breadcrumb-item a {
    color: var(--lte-primary, #ed1c24);
    text-decoration: none;
}

.cwb-adminlte .app-content .table {
    margin-bottom: 0;
}

/* AdminLTE adaptation CWB */
.cwb-adminlte {
    --lte-primary: #ed1c24;
    --lte-primary-rgb: 237, 28, 36;
    font-family: var(--cwb-font);
}

.cwb-adminlte .app-sidebar,
.cwb-adminlte .app-sidebar.cwb-sidebar-light,
.cwb-adminlte .app-sidebar[data-bs-theme="light"],
.cwb-adminlte .app-sidebar[data-bs-theme="dark"] {
    background: #ffffff !important;
    border-right: 1px solid #e5e7eb;
    color: #111111;
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
}

.cwb-adminlte .app-header.navbar {
    border-bottom: 2px solid #ffd200;
    background: #ffffff !important;
}

.cwb-adminlte .app-footer {
    border-top: 1px solid #e2e5eb;
    color: #4b5563;
}

.cwb-adminlte .cwb-sidebar-brand,
.cwb-adminlte .sidebar-brand {
    display: flex !important;
    align-items: center;
    justify-content: center;
    visibility: visible !important;
    opacity: 1 !important;
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 88px;
    max-height: 100px;
    padding: 0.55rem 0.65rem;
    background: #ffffff !important;
    border-bottom: 2px solid #ed1c24 !important;
    overflow: hidden !important;
}

.cwb-adminlte .brand-link {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 70px;
    max-height: 84px;
    padding: 0.25rem !important;
    margin: 0 !important;
    border: 0 !important;
    text-decoration: none;
}

.cwb-adminlte .brand-link .cwb-sidebar-logo,
.cwb-adminlte .brand-link .brand-image.cwb-sidebar-logo {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    float: none !important;
    width: 100% !important;
    max-width: 190px !important;
    height: auto !important;
    max-height: 72px !important;
    object-fit: contain !important;
    margin: 0 auto !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.cwb-adminlte .cwb-sidebar-user {
    flex: 0 0 auto !important;
    padding: 0.55rem 0.85rem 0.65rem;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
    text-align: center;
}

.cwb-adminlte .cwb-sidebar-user__name {
    font-weight: 700;
    color: #111111;
    font-size: 0.88rem;
    line-height: 1.25;
}

.cwb-adminlte .cwb-sidebar-user__role {
    margin-top: 0.25rem;
}

.cwb-adminlte .cwb-sidebar-user__poste {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #4b5563;
    font-weight: 600;
}

/* Zone menu scrollable — conserve la position (voir cwb-sidebar.js) */
.cwb-adminlte .app-sidebar .sidebar-wrapper {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scroll-behavior: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
}

/* Notifications — aperçu + détails */
.cwb-notifications-table .cwb-notif-row {
    cursor: pointer;
}

.cwb-notifications-table .cwb-notif-row:focus-visible {
    outline: 2px solid var(--cwb-red);
    outline-offset: -2px;
}

.cwb-notifications-table .cwb-notif-excerpt {
    color: #374151;
    line-height: 1.45;
    max-width: 36rem;
}

.cwb-ref-pill {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    font-size: 0.8rem;
    font-weight: 600;
    color: #111827;
}

.cwb-adminlte .app-sidebar .sidebar-wrapper::-webkit-scrollbar {
    width: 6px;
}

.cwb-adminlte .app-sidebar .sidebar-wrapper::-webkit-scrollbar-thumb {
    background: #cfd4dc;
    border-radius: 999px;
}

.cwb-adminlte .app-sidebar .sidebar-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.cwb-adminlte .app-sidebar .sidebar-menu {
    padding-bottom: 1.25rem;
}

.cwb-adminlte .cwb-user-meta {
    text-align: right;
    line-height: 1.25;
    padding: 0.15rem 0.35rem;
}

.cwb-adminlte .cwb-user-meta__name {
    font-weight: 700;
    color: #111111;
    font-size: 0.9rem;
}

.cwb-adminlte .cwb-user-meta__details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
    align-items: center;
    margin-top: 0.15rem;
}

.cwb-adminlte .cwb-user-meta__poste {
    font-size: 0.75rem;
    color: #4b5563;
    font-weight: 600;
}

.cwb-adminlte.sidebar-collapse .cwb-sidebar-brand,
.cwb-adminlte.sidebar-mini .cwb-sidebar-brand {
    display: flex !important;
    min-height: 64px;
    max-height: 72px;
}

.cwb-adminlte.sidebar-collapse .cwb-sidebar-logo,
.cwb-adminlte.sidebar-mini .cwb-sidebar-logo {
    max-width: 44px !important;
    max-height: 44px !important;
}

.cwb-adminlte.sidebar-collapse .cwb-sidebar-user {
    display: none;
}

/* Rapprochement visuel AdminLTE v3 (cards plus sobres) */
.cwb-adminlte .app-content-header {
    padding-top: 0.6rem;
    padding-bottom: 0.35rem;
}

.cwb-adminlte .cwb-card,
.cwb-adminlte .cwb-form-panel {
    border-radius: 0.5rem;
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cwb-adminlte .sidebar-menu > .nav-item > .nav-link {
    color: #111111 !important;
}

.cwb-adminlte .sidebar-menu > .nav-item > .nav-link .nav-icon {
    color: #4b5563 !important;
}

.cwb-adminlte .sidebar-menu > .nav-item > .nav-link.active,
.cwb-adminlte .sidebar-menu > .nav-item > .nav-link:hover {
    background: rgba(237, 28, 36, 0.1) !important;
    color: #ed1c24 !important;
    border-left: 3px solid #ed1c24;
}

.cwb-adminlte .sidebar-menu > .nav-item > .nav-link.active .nav-icon,
.cwb-adminlte .sidebar-menu > .nav-item > .nav-link:hover .nav-icon {
    color: #ed1c24 !important;
}

.cwb-adminlte .sidebar-menu .nav-header {
    color: #ed1c24 !important;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.cwb-adminlte .app-main .container-fluid {
    max-width: 1400px;
}

.cwb-adminlte .cwb-page-title {
    font-weight: 700;
    color: #111827;
}

.cwb-adminlte .cwb-card,
.cwb-adminlte .cwb-form-panel {
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 6px 24px rgba(17, 24, 39, 0.07);
}

.cwb-adminlte .card {
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(17, 24, 39, 0.08);
}

.cwb-adminlte .card-outline.card-secondary {
    border-top: 3px solid #111111;
}

.cwb-adminlte .card-outline.card-danger {
    border-top: 3px solid var(--cwb-red);
}

.cwb-adminlte .card-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.cwb-adminlte .card-title {
    font-weight: 700;
    font-size: 1.05rem;
}

.cwb-adminlte .breadcrumb a {
    color: var(--cwb-red);
    text-decoration: none;
}

.cwb-adminlte .breadcrumb a:hover {
    text-decoration: underline;
}

/* Dashboard info-boxes */
.cwb-adminlte .cwb-info-box {
    display: flex;
    align-items: stretch;
    min-height: 90px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(17, 24, 39, 0.08);
    overflow: hidden;
    margin-bottom: 0;
}

.cwb-adminlte a.cwb-info-box-link {
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
}

.cwb-adminlte a.cwb-info-box-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(17, 24, 39, 0.12);
    border-color: #ed1c24;
}

.cwb-adminlte a.cwb-info-box-link:hover .info-box-more {
    color: #ed1c24;
}

.cwb-adminlte .cwb-info-box .info-box-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    font-size: 1.5rem;
    color: #fff;
    flex-shrink: 0;
}

.cwb-adminlte .cwb-info-box .info-box-content {
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.cwb-adminlte .cwb-info-box .info-box-text {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b7280;
    font-weight: 600;
}

.cwb-adminlte .cwb-info-box .info-box-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.cwb-adminlte .cwb-info-box .info-box-more {
    font-size: 0.75rem;
    color: #9ca3af;
}

.cwb-adminlte .cwb-info-box--red .info-box-icon {
    background: var(--cwb-red);
}

.cwb-adminlte .cwb-info-box--dark .info-box-icon {
    background: #111111;
}

.cwb-adminlte .cwb-info-box--gold .info-box-icon {
    background: #e6bc00;
    color: #111111;
}

.cwb-adminlte .cwb-dash-card .card-header {
    padding: 0.75rem 1.1rem;
}

/* Login AdminLTE */
.cwb-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(135deg, rgba(17, 17, 17, 0.92) 0%, rgba(237, 28, 36, 0.85) 55%, rgba(255, 210, 0, 0.75) 100%),
        #111111;
    font-family: var(--cwb-font);
    padding: 1.5rem;
}

.cwb-login-box {
    width: 100%;
    max-width: 420px;
}

.cwb-login-logo {
    display: block;
    width: min(280px, 80vw);
    height: auto;
    max-height: 100px;
    margin: 0 auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}

.cwb-login-card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.cwb-login-card .login-card-body {
    padding: 1.75rem;
}

.cwb-login-card .input-group-text {
    background: #f8f9fa;
}

/* Fiche prestations / heures supplémentaires (inspirée Excel) */
.cwb-hs-banner {
    display: inline-block;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--cwb-red);
    border-bottom: 3px solid var(--cwb-yellow);
    padding-bottom: 0.15rem;
}

.cwb-hs-rules {
    background: #fffef8;
    border: 1px solid #f0e6b8;
    border-radius: 10px;
    padding: 0.9rem 1rem;
}

.cwb-hs-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.cwb-hs-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid transparent;
}

/* Couleurs fiche HS — appliquées sur les cellules (Bootstrap masque le fond des <tr>) */
.cwb-hs-chip.cwb-hs-weekend {
    background: #fde8e8 !important;
    color: #9b1c1c;
    border-color: #f5c2c7;
}

.cwb-hs-table tbody tr.cwb-hs-row-weekend > td,
.cwb-hs-table tbody tr.cwb-hs-row-weekend > th {
    background-color: #fde8e8 !important;
    --bs-table-bg: #fde8e8;
    --bs-table-accent-bg: #fde8e8;
    --bs-table-bg-type: #fde8e8;
    box-shadow: inset 0 0 0 9999px #fde8e8;
}

.cwb-hs-chip.cwb-hs-ferie {
    background: #fff3cd !important;
    color: #664d03;
    border-color: #ffe69c;
}

.cwb-hs-table tbody tr.cwb-hs-row-ferie > td,
.cwb-hs-table tbody tr.cwb-hs-row-ferie > th {
    background-color: #fff3cd !important;
    --bs-table-bg: #fff3cd;
    --bs-table-accent-bg: #fff3cd;
    --bs-table-bg-type: #fff3cd;
    box-shadow: inset 0 0 0 9999px #fff3cd;
}

.cwb-hs-chip.cwb-hs-recup {
    background: #cfe2ff !important;
    color: #084298;
    border-color: #9ec5fe;
}

.cwb-hs-table tbody tr.cwb-hs-row-recup > td,
.cwb-hs-table tbody tr.cwb-hs-row-recup > th {
    background-color: #cfe2ff !important;
    --bs-table-bg: #cfe2ff;
    --bs-table-accent-bg: #cfe2ff;
    --bs-table-bg-type: #cfe2ff;
    box-shadow: inset 0 0 0 9999px #cfe2ff;
}

.cwb-hs-chip.cwb-hs-conge {
    background: #f5c2c7 !important;
    color: #842029;
    border-color: #dc3545;
}

.cwb-hs-table tbody tr.cwb-hs-row-conge > td,
.cwb-hs-table tbody tr.cwb-hs-row-conge > th {
    background-color: #f8d7da !important;
    --bs-table-bg: #f8d7da;
    --bs-table-accent-bg: #f8d7da;
    --bs-table-bg-type: #f8d7da;
    box-shadow: inset 0 0 0 9999px #f8d7da;
    color: #842029;
}

.cwb-hs-table tbody tr.cwb-hs-row-weekend .form-control,
.cwb-hs-table tbody tr.cwb-hs-row-weekend .form-check-input,
.cwb-hs-table tbody tr.cwb-hs-row-ferie .form-control,
.cwb-hs-table tbody tr.cwb-hs-row-ferie .form-check-input,
.cwb-hs-table tbody tr.cwb-hs-row-recup .form-control,
.cwb-hs-table tbody tr.cwb-hs-row-recup .form-check-input,
.cwb-hs-table tbody tr.cwb-hs-row-conge .form-control,
.cwb-hs-table tbody tr.cwb-hs-row-conge .form-check-input {
    background-color: rgba(255, 255, 255, 0.72);
}

.cwb-hs-table-wrap {
    border: 1px solid var(--cwb-border);
    border-radius: 10px;
    overflow: auto;
    background: #fff;
}

.cwb-hs-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #111111;
    color: #fff;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    border-color: #111 !important;
}

.cwb-hs-table tbody td {
    vertical-align: middle;
}

.cwb-hs-table .cwb-hs-time {
    min-width: 7.5rem;
}

.cwb-hs-total {
    background: #fff8db;
}

.cwb-hs-total td {
    background-color: #fff8db !important;
    border-top: 2px solid var(--cwb-yellow) !important;
    box-shadow: inset 0 0 0 9999px #fff8db;
}

.cwb-hs-sign {
    border: 1px dashed #cfd4dc;
    border-radius: 10px;
    padding: 1rem;
    min-height: 110px;
    background: #fafbfc;
}

/* Attestation de congé */
.cwb-attestation-doc {
    max-width: 820px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 2rem 2.25rem;
    box-shadow: 0 8px 28px rgba(17, 24, 39, 0.06);
}

.cwb-attestation-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 3px solid #ffd200;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.cwb-attestation-logo {
    height: 64px;
    width: auto;
    object-fit: contain;
}

.cwb-attestation-org {
    font-weight: 800;
    font-size: 1.05rem;
    color: #111;
}

.cwb-attestation-sub {
    color: #6b7280;
    font-size: 0.9rem;
}

.cwb-attestation-title {
    text-align: center;
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    margin: 0 0 1.25rem;
    color: #111;
}

.cwb-attestation-intro,
.cwb-attestation-outro {
    line-height: 1.55;
    margin-bottom: 1rem;
}

.cwb-attestation-dl {
    display: grid;
    gap: 0.75rem;
    margin: 1.25rem 0 1.5rem;
}

.cwb-attestation-dl > div {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 0.75rem;
    padding: 0.55rem 0.7rem;
    background: #fafbfc;
    border: 1px solid #eef0f3;
    border-radius: 8px;
}

.cwb-attestation-dl dt {
    font-weight: 700;
    color: #4b5563;
    margin: 0;
}

.cwb-attestation-dl dd {
    margin: 0;
    font-weight: 600;
    color: #111;
}

.cwb-attestation-sign-row {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin-top: 2.5rem;
}

.cwb-attestation-sign {
    min-width: 220px;
    text-align: center;
}

.cwb-attestation-sign-space {
    margin-top: 3.5rem;
    border-top: 1px solid #cfd4dc;
    padding-top: 0.4rem;
    font-size: 0.85rem;
    color: #6b7280;
}

.cwb-attestation-foot {
    margin-top: 2rem;
    padding-top: 0.75rem;
    border-top: 1px dashed #d1d5db;
    font-size: 0.78rem;
    color: #6b7280;
}

@media print {
    @page {
        size: A4;
        margin: 14mm;
    }

    body.cwb-print-doc {
        background: #fff !important;
    }

    .cwb-no-print,
    .app-header,
    .app-sidebar,
    .app-content-header,
    .app-footer,
    .cwb-attestation-toolbar {
        display: none !important;
    }

    .app-wrapper,
    .app-main,
    .app-content,
    .container-fluid {
        padding: 0 !important;
        margin: 0 !important;
        max-width: none !important;
    }

    .cwb-attestation-doc {
        border: none;
        box-shadow: none;
        border-radius: 0;
        max-width: none;
        padding: 0;
    }

    .cwb-hs-print-doc .cwb-hs-table {
        font-size: 11px;
    }
}


/* Chat RH public + secrétariat */
.cwb-chat-widget { position: fixed; right: 1rem; bottom: 1rem; z-index: 1090; font-family: Montserrat, Arial, sans-serif; }
.cwb-chat-launcher { display: inline-flex; align-items: center; gap: .5rem; border: 0; border-radius: 999px; padding: .7rem 1.1rem; background: #cf0a2c; color: #fff; font-weight: 700; box-shadow: 0 8px 24px rgba(0,0,0,.18); cursor: pointer; }
.cwb-chat-launcher.is-disabled { opacity: .75; }
.cwb-chat-panel { width: min(380px, calc(100vw - 1.5rem)); height: min(520px, calc(100vh - 5rem)); background: #fff; border: 1px solid #d7dce4; border-radius: 14px; box-shadow: 0 16px 40px rgba(17,24,39,.18); display: flex; flex-direction: column; overflow: hidden; margin-bottom: .65rem; }
.cwb-chat-panel__head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; padding: .85rem 1rem; background: #111; color: #fff; }
.cwb-chat-hours { font-size: .75rem; opacity: .9; margin-top: .15rem; }
.cwb-chat-hours.is-open { color: #86efac; }
.cwb-chat-hours.is-closed { color: #fca5a5; }
.cwb-chat-icon-btn { border: 0; background: transparent; color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.cwb-chat-prestart, .cwb-chat-main { padding: .85rem; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.cwb-chat-log, .cwb-sec-chat-log { flex: 1; overflow: auto; background: #f7f8fa; border: 1px solid #e5e7eb; border-radius: 10px; padding: .65rem; display: flex; flex-direction: column; gap: .55rem; min-height: 220px; max-height: 420px; }
.cwb-chat-bubble { max-width: 92%; padding: .55rem .7rem; border-radius: 10px; font-size: .88rem; }
.cwb-chat-bubble__meta { font-size: .7rem; opacity: .75; margin-bottom: .2rem; }
.cwb-chat-bubble--visitor { align-self: flex-end; background: #cf0a2c; color: #fff; }
.cwb-chat-bubble--bot { align-self: flex-start; background: #fff; border: 1px solid #e5e7eb; }
.cwb-chat-bubble--sec { align-self: flex-start; background: #111; color: #fff; }
.cwb-chat-bubble--sys { align-self: center; background: #fff8db; border: 1px solid #ffe69c; color: #664d03; font-size: .8rem; }
.cwb-chat-actions { display: flex; gap: .4rem; margin: .55rem 0; flex-wrap: wrap; }
.cwb-chat-compose { display: flex; gap: .4rem; }
.cwb-chat-compose .form-control { flex: 1; }
/* Chat RH — icône seule + panneau */
.cwb-chat-widget { position: fixed; right: 1rem; bottom: 1rem; z-index: 1090; font-family: Montserrat, Arial, sans-serif; display: flex; flex-direction: column; align-items: flex-end; gap: .65rem; }
.cwb-chat-launcher { width: 3.5rem; height: 3.5rem; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; padding: 0; background: #cf0a2c; color: #fff; font-size: 1.35rem; box-shadow: 0 8px 24px rgba(0,0,0,.2); cursor: pointer; }
.cwb-chat-launcher:hover { background: #a80824; }
.cwb-chat-launcher.is-disabled { opacity: .7; }
.cwb-chat-launcher.is-open { box-shadow: 0 0 0 3px rgba(207,10,44,.25); }
.cwb-chat-panel { width: min(380px, calc(100vw - 1.5rem)); height: min(520px, calc(100vh - 6rem)); background: #fff; border: 1px solid #d7dce4; border-radius: 14px; box-shadow: 0 16px 40px rgba(17,24,39,.18); display: flex; flex-direction: column; overflow: hidden; }
.cwb-chat-panel__head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; padding: .85rem 1rem; background: #111; color: #fff; }
.cwb-chat-hours { font-size: .75rem; opacity: .9; margin-top: .15rem; }
.cwb-chat-hours.is-open { color: #86efac; }
.cwb-chat-hours.is-closed { color: #fca5a5; }
.cwb-chat-icon-btn { border: 0; background: transparent; color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.cwb-chat-prestart, .cwb-chat-main { padding: .85rem; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.cwb-chat-form-error { background: #fff5f5; border: 1px solid #f9c6c9; color: #9f1239; border-radius: 8px; padding: .5rem .65rem; font-size: .8rem; margin-bottom: .65rem; }
.cwb-chat-log, .cwb-sec-chat-log { flex: 1; overflow: auto; background: #f7f8fa; border: 1px solid #e5e7eb; border-radius: 10px; padding: .65rem; display: flex; flex-direction: column; gap: .55rem; min-height: 220px; max-height: 420px; }
.cwb-chat-bubble { max-width: 92%; padding: .55rem .7rem; border-radius: 10px; font-size: .88rem; }
.cwb-chat-bubble__meta { font-size: .7rem; opacity: .75; margin-bottom: .2rem; }
.cwb-chat-bubble--visitor { align-self: flex-end; background: #cf0a2c; color: #fff; }
.cwb-chat-bubble--bot { align-self: flex-start; background: #fff; border: 1px solid #e5e7eb; }
.cwb-chat-bubble--sec { align-self: flex-start; background: #111; color: #fff; }
.cwb-chat-bubble--sys { align-self: center; background: #fff8db; border: 1px solid #ffe69c; color: #664d03; font-size: .8rem; }
.cwb-chat-actions { display: flex; gap: .4rem; margin: .55rem 0; flex-wrap: wrap; }
.cwb-chat-compose { display: flex; gap: .4rem; }
.cwb-chat-compose .form-control { flex: 1; }


/* Chat RH — show/hide (display:none par défaut ; .is-open / .is-visible pour afficher) */
.cwb-chat-widget { position: fixed; right: 1rem; bottom: 1rem; z-index: 1090; font-family: Montserrat, Arial, sans-serif; display: flex; flex-direction: column; align-items: flex-end; gap: .65rem; }
.cwb-chat-launcher { width: 3.5rem; height: 3.5rem; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; padding: 0; background: #cf0a2c; color: #fff; font-size: 1.35rem; box-shadow: 0 8px 24px rgba(0,0,0,.2); cursor: pointer; }
.cwb-chat-launcher:hover { background: #a80824; }
.cwb-chat-launcher.is-disabled { opacity: .7; }
.cwb-chat-launcher.is-open { box-shadow: 0 0 0 3px rgba(207,10,44,.25); }
.cwb-chat-panel { display: none !important; width: min(380px, calc(100vw - 1.5rem)); height: min(520px, calc(100vh - 6rem)); background: #fff; border: 1px solid #d7dce4; border-radius: 14px; box-shadow: 0 16px 40px rgba(17,24,39,.18); flex-direction: column; overflow: hidden; }
.cwb-chat-panel.is-open { display: flex !important; }
.cwb-chat-panel[hidden] { display: none !important; }
.cwb-chat-panel__head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; padding: .85rem 1rem; background: #111; color: #fff; }
.cwb-chat-hours { font-size: .75rem; opacity: .9; margin-top: .15rem; }
.cwb-chat-hours.is-open { color: #86efac; }
.cwb-chat-hours.is-closed { color: #fca5a5; }
.cwb-chat-icon-btn { border: 0; background: transparent; color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.cwb-chat-prestart, .cwb-chat-main { display: none !important; padding: .85rem; flex: 1; flex-direction: column; min-height: 0; }
.cwb-chat-prestart.is-visible, .cwb-chat-main.is-visible { display: flex !important; }
.cwb-chat-prestart[hidden], .cwb-chat-main[hidden] { display: none !important; }
.cwb-chat-form-error { background: #fff5f5; border: 1px solid #f9c6c9; color: #9f1239; border-radius: 8px; padding: .5rem .65rem; font-size: .8rem; margin-bottom: .65rem; }
.cwb-chat-form-error[hidden] { display: none !important; }
.cwb-chat-log, .cwb-sec-chat-log { flex: 1; overflow: auto; background: #f7f8fa; border: 1px solid #e5e7eb; border-radius: 10px; padding: .65rem; display: flex; flex-direction: column; gap: .55rem; min-height: 220px; max-height: 420px; }
.cwb-chat-bubble { max-width: 92%; padding: .55rem .7rem; border-radius: 10px; font-size: .88rem; }
.cwb-chat-bubble__meta { font-size: .7rem; opacity: .75; margin-bottom: .2rem; }
.cwb-chat-bubble--visitor { align-self: flex-end; background: #cf0a2c; color: #fff; }
.cwb-chat-bubble--bot { align-self: flex-start; background: #fff; border: 1px solid #e5e7eb; }
.cwb-chat-bubble--sec { align-self: flex-start; background: #111; color: #fff; }
.cwb-chat-bubble--sys { align-self: center; background: #fff8db; border: 1px solid #ffe69c; color: #664d03; font-size: .8rem; }
.cwb-chat-actions { display: flex; gap: .4rem; margin: .55rem 0; flex-wrap: wrap; }
.cwb-chat-compose { display: flex; gap: .4rem; }
.cwb-chat-compose .form-control { flex: 1; }

/* Bibliothèque agents + upload progress */
.cwb-bib { margin-bottom: 1.5rem; }
.cwb-bib-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.35rem 1.5rem;
    margin-bottom: 1.25rem;
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(226,18,56,.08), rgba(255,210,0,.12)),
        linear-gradient(180deg, #fff 0%, #f7f8fb 100%);
    border: 1px solid var(--cwb-border);
    position: relative;
    overflow: hidden;
}
.cwb-bib-hero::after {
    content: "";
    position: absolute;
    right: -40px;
    top: -40px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(226,18,56,.12), transparent 70%);
    pointer-events: none;
}
.cwb-bib-hero__eyebrow {
    margin: 0 0 .35rem;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--cwb-red);
}
.cwb-bib-hero__title {
    margin: 0 0 .4rem;
    font-size: clamp(1.45rem, 2.2vw, 1.85rem);
    font-weight: 800;
    color: var(--cwb-black);
}
.cwb-bib-hero__lead {
    margin: 0;
    max-width: 36rem;
    color: var(--cwb-muted);
    font-size: .92rem;
}
.cwb-bib-hero__stats { display: flex; gap: .75rem; }
.cwb-bib-stat {
    min-width: 5.5rem;
    padding: .7rem .9rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--cwb-border);
    text-align: center;
}
.cwb-bib-stat__value {
    display: block;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--cwb-black);
}
.cwb-bib-stat__label {
    display: block;
    font-size: .72rem;
    color: var(--cwb-muted);
    margin-top: .15rem;
}
.cwb-bib-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1rem;
    align-items: center;
    margin-bottom: 1rem;
}
.cwb-bib-search {
    position: relative;
    flex: 1 1 16rem;
    min-width: 12rem;
}
.cwb-bib-search > i {
    position: absolute;
    left: .85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cwb-muted);
    pointer-events: none;
}
.cwb-bib-search .form-control {
    padding-left: 2.35rem;
    border-radius: 10px;
    border-color: var(--cwb-border);
}
.cwb-bib-filters { display: flex; flex-wrap: wrap; gap: .4rem; }
.cwb-bib-chip {
    border: 1px solid var(--cwb-border);
    background: #fff;
    color: var(--cwb-black);
    border-radius: 999px;
    padding: .35rem .85rem;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.cwb-bib-chip:hover { border-color: var(--cwb-red); color: var(--cwb-red); }
.cwb-bib-chip.is-active {
    background: var(--cwb-red);
    border-color: var(--cwb-red);
    color: #fff;
}
.cwb-bib-folders {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin-bottom: .85rem;
}
.cwb-bib-folder {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    border: 1px solid var(--cwb-border);
    background: #fff;
    border-radius: 10px;
    padding: .55rem .8rem;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.cwb-bib-folder:hover {
    border-color: rgba(226,18,56,.35);
    box-shadow: 0 6px 16px rgba(17,17,17,.06);
    transform: translateY(-1px);
}
.cwb-bib-folder.is-active {
    border-color: var(--cwb-red);
    box-shadow: 0 0 0 2px rgba(226,18,56,.12);
}
.cwb-bib-folder > i { color: #d4a017; }
.cwb-bib-folder__name {
    font-size: .86rem;
    font-weight: 650;
    color: var(--cwb-black);
}
.cwb-bib-folder__count {
    font-size: .72rem;
    font-weight: 700;
    color: var(--cwb-muted);
    background: var(--cwb-bg);
    border-radius: 999px;
    padding: .1rem .45rem;
}
.cwb-bib-results-meta {
    margin: 0 0 .75rem;
    font-size: .82rem;
    color: var(--cwb-muted);
}
.cwb-bib-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.cwb-bib-card {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    padding: 1rem;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--cwb-border);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    animation: cwbBibCardIn .35s ease both;
}
.cwb-bib-card:hover {
    transform: translateY(-2px);
    border-color: rgba(226,18,56,.25);
    box-shadow: 0 10px 24px rgba(17,17,17,.07);
}
@keyframes cwbBibCardIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.cwb-bib-card__icon {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}
.cwb-bib-card__icon--pdf { background: #fde8ec; color: #c01030; }
.cwb-bib-card__icon--word { background: #e8f0fe; color: #1a56db; }
.cwb-bib-card__icon--image { background: #e9f8ef; color: #0f7a3a; }
.cwb-bib-card__icon--file { background: #f1f3f6; color: #5c6370; }
.cwb-bib-card__folder {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .72rem;
    font-weight: 700;
    color: #8a6d00;
    background: var(--cwb-yellow-soft);
    border-radius: 999px;
    padding: .15rem .55rem;
    margin-bottom: .35rem;
}
.cwb-bib-card__folder--muted {
    color: var(--cwb-muted);
    background: var(--cwb-bg);
}
.cwb-bib-card__title {
    margin: 0 0 .35rem;
    font-size: 1rem;
    font-weight: 750;
    line-height: 1.3;
    color: var(--cwb-black);
}
.cwb-bib-card__meta,
.cwb-bib-card__file {
    margin: 0;
    font-size: .78rem;
    color: var(--cwb-muted);
}
.cwb-bib-card__file {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cwb-bib-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: auto;
    padding-top: .35rem;
}
.cwb-bib-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--cwb-muted);
    border: 1px dashed var(--cwb-border);
    border-radius: 14px;
    background: #fff;
}
.cwb-bib-empty > i {
    font-size: 1.6rem;
    margin-bottom: .5rem;
    display: block;
    color: var(--cwb-red);
}
.cwb-bib-folder-admin-list {
    display: flex;
    flex-direction: column;
    gap: .65rem;
}
.cwb-bib-folder-admin-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .75rem .9rem;
    border: 1px solid var(--cwb-border);
    border-radius: 10px;
    background: #fff;
}
.cwb-bib-folder-admin-item__main {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
}
.cwb-bib-move-form .form-select { min-width: 9rem; max-width: 12rem; }

/* Overlay progression upload */
.cwb-upload-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(17, 17, 17, .45);
    backdrop-filter: blur(2px);
    padding: 1rem;
}
.cwb-upload-overlay.is-visible { display: flex; }
body.cwb-upload-locked { overflow: hidden; }
.cwb-upload-dialog {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 14px;
    border: 1px solid var(--cwb-border);
    box-shadow: 0 18px 48px rgba(0,0,0,.22);
    padding: 1.35rem 1.4rem 1.2rem;
    text-align: center;
}
.cwb-upload-dialog__icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto .75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(226,18,56,.1);
    color: var(--cwb-red);
    font-size: 1.25rem;
}
.cwb-upload-dialog__label {
    margin: 0 0 .85rem;
    font-weight: 700;
    color: var(--cwb-black);
}
.cwb-upload-track {
    height: .55rem;
    border-radius: 999px;
    background: #eef0f4;
    overflow: hidden;
}
.cwb-upload-bar {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--cwb-red), #ff5a75);
    transition: width .12s linear;
}
.cwb-upload-pct {
    margin: .7rem 0 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--cwb-black);
}
.cwb-upload-detail {
    margin: .2rem 0 0;
    font-size: .78rem;
    color: var(--cwb-muted);
    min-height: 1.1em;
}

@media (max-width: 576px) {
    .cwb-bib-hero { padding: 1.1rem; }
    .cwb-bib-hero__stats { width: 100%; }
    .cwb-bib-stat { flex: 1; }
}
