html,
body {
    height: 100%;
    margin: 0;
}

.sidebar {
    width: 250px;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
}

    .sidebar .nav-link {
        padding: 10px 15px;
        border-radius: 5px;
        margin-bottom: 3px;
    }

        .sidebar .nav-link:hover {
            background-color: rgba(255, 255, 255, 0.12);
        }
.sidebar-section-title {
    margin: 22px 16px 8px;
    font-size: 11px;
    font-weight: 700;
    color: #8f969d;
    text-transform: uppercase;
    letter-spacing: .6px;
}

.sidebar-link {
    display: block;
    padding: 9px 16px;
    color: #f1f3f5;
    text-decoration: none;
    font-size: 14px;
    border-radius: 6px;
    margin: 2px 8px;
    transition: background-color .15s ease;
}

    .sidebar-link:hover {
        color: #ffffff;
        background: rgba(255,255,255,.08);
        text-decoration: none;
    }

    .sidebar-link:focus {
        color: #ffffff;
        text-decoration: none;
    }

.menu-title {
    font-size: 12px;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 5px;
    padding-left: 15px;
    opacity: 0.6;
}

.main-content {
    margin-left: 250px;
    width: calc(100% - 250px);
    min-height: 100vh;
    background-color: #f5f6f8;
}

.top-header {
    height: 65px;
    background-color: white;
    padding: 0 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-dashboard {
    border: none;
    border-radius: 10px;
}


/* =========================================================
   RESPONSIVE ADMIN LAYOUT
   ========================================================= */
body {
    overflow-x: hidden;
}

.admin-menu-toggle {
    width: 42px;
    height: 38px;
    padding: 0;
    font-size: 1.25rem;
    line-height: 1;
}

@media (max-width: 991.98px) {
    .sidebar {
        width: min(82vw, 280px);
        z-index: 1050;
        overflow-y: auto;
        transform: translateX(-105%);
        transition: transform .22s ease;
        box-shadow: 12px 0 32px rgba(0, 0, 0, .22);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        min-width: 0;
    }

    .top-header {
        min-height: 62px;
        height: auto;
        padding: 10px 14px;
        gap: 10px;
    }

    .top-header > .d-flex:last-child {
        gap: .5rem !important;
        font-size: .86rem;
    }

    .admin-header-title {
        font-size: 1rem;
    }

    .admin-main-content {
        min-width: 0;
        overflow-x: hidden;
    }

    body.admin-menu-open::after {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 1040;
        background: rgba(0, 0, 0, .35);
    }

    .card .card-body {
        padding: 1rem;
    }

    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 575.98px) {
    .top-header > .d-flex:last-child > span {
        display: none;
    }

    .admin-main-content h2 {
        font-size: 1.45rem;
    }

    .admin-main-content .d-flex.justify-content-between.align-items-center {
        align-items: flex-start !important;
        gap: .75rem;
        flex-wrap: wrap;
    }

    .admin-main-content .btn {
        max-width: 100%;
    }

    .admin-main-content .row > [class*="col-"] {
        min-width: 0;
    }
}

/* =========================================================
   ADMIN - TABLET / MOBILE OFF-CANVAS NAVIGATION
   Keep dashboard content full-width on phones and tablets.
   ========================================================= */
@media (max-width: 1199.98px) {
    .sidebar {
        width: min(82vw, 270px) !important;
        position: fixed !important;
        left: 0;
        top: 0;
        bottom: 0;
        min-height: 100dvh;
        z-index: 1055;
        overflow-y: auto;
        transform: translateX(-105%);
        transition: transform .22s ease;
        box-shadow: 12px 0 32px rgba(0, 0, 0, .22);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0;
    }

    .admin-menu-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
    }

    .top-header {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .top-header {
        padding: 9px 12px;
    }

    .admin-header-title {
        font-size: .95rem;
        line-height: 1.15;
    }

    .admin-main-content {
        padding: 14px !important;
    }

    .admin-main-content .row {
        --bs-gutter-x: .8rem;
        --bs-gutter-y: .8rem;
    }

    .admin-main-content .card-dashboard,
    .admin-main-content .card {
        border-radius: 8px;
    }
}
