/* =============================================
   RESPONSIVE — Tablette & Mobile
   Tablette : <= 991px  |  Mobile : <= 767px
   ============================================= */

/* ------ Offcanvas sidebar ------ */
.offcanvas {
    position: fixed;
    top: 0;
    left: -270px;
    width: 260px;
    height: 100%;
    background: #1e2d3d;
    z-index: 9999;
    transition: left 0.28s ease;
    overflow-y: auto;
    box-shadow: 2px 0 8px rgba(0,0,0,0.4);
}
.offcanvas.show { left: 0; }

.offcanvas-menu { padding-top: 55px; }
.offcanvas-menu ul { padding: 0; margin: 0; }
.offcanvas-menu ul li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    color: #c8d6e5;
    font-size: 13px;
    border-bottom: 1px solid #2e4057;
    text-decoration: none;
    transition: background 0.15s;
}
.offcanvas-menu ul li a:hover,
.offcanvas-menu ul li a.active {
    background: #2e4057;
    color: #74b9ff;
}

.offcanvas-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9998;
}
.offcanvas-overlay.show { display: block; }

.close-canvas {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #cd5a5a !important;
    font-weight: bold;
    border: none;
    color: white;
}

/* Hamburger — caché sur desktop */
#toggleNav {
    display: none;
    cursor: pointer;
    align-items: center;
    height: 37px;
    padding: 0 12px;
    color: white;
    font-size: 22px;
    background-color: #C8361A;
    border: none;
    float: left;
}

/* ========================
   TABLETTE : <= 991px
   ======================== */
@media (max-width: 991px) {

    #toggleNav { display: inline-flex !important; }

    /* Masquer le menu onglets horizontal */
    .main-menus { display: none !important; }

    /* Barre titre/actions : hauteur auto */
    .app-titles-buttons-bar {
        height: auto !important;
        min-height: 49px;
    }

    /* Filtres : table → flex wrap */
    .filter-table,
    .filter-table tbody {
        display: flex !important;
        flex-wrap: wrap;
        width: 100%;
    }
    .filter-table tr {
        display: flex !important;
        flex-wrap: wrap;
        width: 100%;
        align-items: center;
    }
    .filter-table td {
        display: inline-flex !important;
        align-items: center;
        padding: 2px 5px;
        flex-shrink: 0;
    }

    /* Deuxième barre de filtres (consultations) */
    .div-top-filters2 .filter-table tr { justify-content: flex-start; }
    .div-top-filters2 table { margin-left: 0 !important; }
}

/* ========================
   MOBILE : <= 767px
   ======================== */
@media (max-width: 767px) {

    /* Filtres en colonne */
    .filter-table td { width: 100%; }
    .filter-table td .form-control {
        width: 100% !important;
        max-width: 100%;
    }
    .filter-table td .select2-container { width: 100% !important; }

    /* Titre dynamique */
    .title-wrapper { width: auto !important; flex: 1; }

    /* Actions : taille réduite */
    .menu-actions a {
        font-size: 11px;
        padding: 23px 6px 4px 6px;
    }

    /* Correction top de l'app-content */
    .app-content { top: 85px !important; }
}
