/* --- Responsive Fixes for Admin Panel --- */

/* Breakpoint adjustment: Mobile and Tablet */
@media (max-width: 1170px) {
    .sidebar {
        margin-left: -300px;
        transition: all 0.5s;
    }
    
    section.content {
        margin-left: 0 !important;
        transition: all 0.5s;
    }

    body.overlay-open .sidebar {
        margin-left: 0;
        z-index: 11;
    }
    
    body.overlay-open .overlay {
        display: block;
        z-index: 10;
    }
}

/* Specific Mobile Fixes (Phones) */
@media (max-width: 767px) {
    .navbar-brand {
        font-size: 18px !important;
        padding: 20px 10px !important;
    }

    .navbar-header {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .navbar .bars {
        margin-left: 10px !important;
        margin-right: 0 !important;
    }

    .dashboard-title {
        font-size: 24px !important;
    }

    .dashboard-container {
        padding: 16px 12px !important;
    }

    .card-inner {
        padding: 20px 16px !important;
        min-height: 140px !important;
    }

    .card-count {
        font-size: 24px !important;
    }
    
    /* Table responsiveness improvement */
    .table-responsive {
        border: none !important;
        margin-bottom: 0 !important;
    }
}

/* Sidebar Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: none;
}

/* Ensure sidebar is above overlay but below navbar */
.sidebar {
    z-index: 999 !important;
}

/* Adjust navbar z-index to be highest */
.navbar {
    z-index: 1000 !important;
}

/* Fix for cards in dashboard */
.dashboard-card {
    height: 100%;
}

.row.clearfix {
    display: flex;
    flex-wrap: wrap;
}

.row.clearfix > [class*="col-"] {
    display: flex;
    flex-direction: column;
}

/* Custom button scaling for mobile */
@media (max-width: 480px) {
    .button-rounded {
        padding: 8px 16px !important;
        font-size: 12px !important;
    }
    
    .header h2 {
        font-size: 16px !important;
    }
}
