/* ===== Sidebar & Layout ===== */

/* Desktop: sidebar is always visible, fixed width */
@media (min-width: 992px) {
    #sidebarOffcanvas {
        width: 280px !important;
        min-height: 100vh;
        -ms-flex-negative: 0;
            flex-shrink: 0;
    }

    #sidebarOffcanvas .offcanvas-body {
        overflow-y: auto;
    }
}

/* Mobile: full-height offcanvas sidebar */
@media (max-width: 991.98px) {
    #sidebarOffcanvas {
        width: 280px !important;
    }

    #wrapper {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
            -ms-flex-direction: column;
                flex-direction: column;
    }

    #wrapper > main {
        height: auto !important;
        min-height: calc(100vh - 56px);
    }
}

/* Nav pills styling for sidebar */
#sidebarOffcanvas .nav-pills .nav-link {
    color: rgba(255, 255, 255, 0.8);
}

#sidebarOffcanvas .nav-pills .nav-link:hover {
    color: #fff;
}

#sidebarOffcanvas .nav-pills .nav-link.active {
    background-color: var(--bs-primary);
    color: #fff;
}

/* Dashboard action buttons */
.dashboard-actions {
    gap: 0.5rem;
}

/* Mobile dashboard action buttons - keep primary actions side by side and easy to tap */
@media (max-width: 575.98px) {
    .dashboard-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .dashboard-actions .btn {
        width: 100%;
        min-height: 3.25rem;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
        margin-right: 0 !important;
        font-size: 0.95rem;
    }
}

/* ===== Mobile Filter Toggle ===== */

/* Rotate chevron icon when filter collapse is open */
[data-bs-target="#filterCollapse"] .fa-chevron-down {
    -webkit-transition: -webkit-transform 0.3s ease;
    transition: -webkit-transform 0.3s ease;
    transition: transform 0.3s ease;
    transition: transform 0.3s ease, -webkit-transform 0.3s ease;
}

[data-bs-target="#filterCollapse"][aria-expanded="true"] .fa-chevron-down {
    -webkit-transform: rotate(180deg);
            transform: rotate(180deg);
}

/* ===== Mobile Card View ===== */
#cylindersMobile .list-group-item {
    border-left: 0;
    border-right: 0;
    -webkit-transition: background-color 0.15s ease;
    transition: background-color 0.15s ease;
}

#cylindersMobile .list-group-item:active {
    background-color: var(--bs-light);
}

/* Add spacing between mobile card items */
@media (max-width: 991.98px) {
    #cylindersMobile.list-group-flush .list-group-item {
        margin-bottom: 0.5rem;
        border: 1px solid var(--bs-border-color);
        border-radius: var(--bs-border-radius) !important;
    }

    #cylindersMobile.list-group-flush .list-group-item:last-child {
        margin-bottom: 0;
    }
}

/* ===== Mobile Pagination ===== */
@media (max-width: 575.98px) {
    /* Stack card-footer vertically on mobile */
    .card-footer.d-flex {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
            -ms-flex-direction: column;
                flex-direction: column;
        -webkit-box-align: stretch !important;
            -ms-flex-align: stretch !important;
                align-items: stretch !important;
        gap: 0.5rem;
    }

    .card-footer .d-flex {
        -webkit-box-pack: center;
            -ms-flex-pack: center;
                justify-content: center;
    }

    .card-footer .text-muted {
        text-align: center;
    }
}

/* Statistics charts */
.statistics-chart {
    display: block;
    min-height: 260px;
}