/* Tablet and below */
@media (max-width:991px) {
    .container_section {
        width: 100%;
        padding: 0px 10px;
        margin: 0px auto;
    }
    
    .content {
        padding: 10px;
    }
    
    .content .col-5 {
        width: 48%;
    }
    
    .page-headding h1 {
        font-size: 18px;
        line-height: 26px;
    }
    
    .pg-sections .card-title {
        font-weight: 600;
        color: #fff;
        font-size: 15px;
    }
    
    .pg-sections .card-balance {
        font-size: 1.25rem;
        font-weight: 600;
        margin-top: 10px;
        color: #fff;
    }

    .header-right-section .navbar-nav {
        margin-bottom: 0px !important;
        padding: 20px 0px;
    }
    
    .header-right-section .navbar-nav li {
        margin-top: 10px !important;
        margin-bottom: 10px !important;
        margin-left: 0px !important;
        margin-right: 0px !important;
    }
    
    button.navbar-toggler {
        margin: 0px;
        padding: 0px;
        border: 0px;
    }
    
    .navbar-toggler:focus {
        box-shadow: none !important;
    }
    
    .grid_main {
        padding: 15px;
    }
    
    .grid_header h6 {
        font-size: 16px;
    }
    
    /* Table responsive */
    table {
        font-size: 12px;
    }
    
    table tr th,
    table tr td {
        padding: 8px 5px;
        font-size: 11px;
    }
}

/* Mobile landscape and below */
@media (max-width:767px) {
    .login .login-section {
        width: 90%;
        padding: 30px 20px;
    }
    
    .login-headding {
        font-size: 24px;
        line-height: 30px;
    }
    
    .content .col-5 {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .menu-body {
        width: 100%;
    }
    
    .sidebar_nav {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar_nav.showSidebar {
        transform: translateX(0);
    }
    
    /* Make tables horizontally scrollable */
    .grid_body {
        overflow-x: auto;
    }
    
    table {
        font-size: 12px;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .button-wrapper {
        flex-direction: column;
        gap: 10px;
    }
    
    .button-wrapper .btn {
        width: 100%;
    }
    
    .add__btn {
        /* no fixed positioning overrides needed */
    }
    
    .modal-dialog {
        margin: 10px;
    }
    
    .grid_header {
        flex-wrap: wrap;
    }
    
    .grid_header h6 {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    /* Dashboard cards stack vertically */
    .dashboard-component .col-xxl-6,
    .dashboard-component .col-xl-6,
    .dashboard-component .col-lg-6,
    .dashboard-component .col-md-6 {
        width: 100%;
    }
}

/* Mobile portrait */
@media (max-width:480px) {
    .login .login-section {
        width: 95%;
        padding: 20px 15px;
    }
    
    .login-headding {
        font-size: 20px;
        line-height: 26px;
        margin-bottom: 15px;
    }
    
    #loginTabsContent form input.form-control {
        height: 38px;
        font-size: 14px;
    }
    
    .login_btn_section .login_btn {
        width: 100%;
        height: 45px;
        font-size: 18px;
    }
    
    .container_section {
        padding: 0px 10px;
        overflow-x: hidden;
    }
    
    .content {
        padding: 5px;
        overflow-x: hidden;
    }
    
    .grid_main {
        padding: 10px;
        margin-bottom: 15px;
    }
    
    .page-headding h1 {
        font-size: 16px;
        line-height: 22px;
    }
    
    .form-control {
        font-size: 13px;
        height: 38px;
    }
    
    label {
        font-size: 12px !important;
    }
    
    .button-wrapper .btn {
        padding: 6px 20px;
        font-size: 14px;
    }
    
    table {
        font-size: 10px;
    }
    
    table tr th,
    table tr td {
        padding: 6px 4px;
        font-size: 10px;
    }
    
    .add__btn {
        width: 45px !important;
        height: 45px !important;
        max-width: 45px;
        min-width: 45px;
        font-size: 18px;
    }
    
    .header {
        padding: 10px 0px;
    }
    
    .header .navbar-brand {
        font-size: 16px;
    }
    
    .modal-content {
        padding: 10px;
    }
    
    .modal-header h1 {
        font-size: 18px !important;
    }
    
    .forgot_password_section {
        width: 95%;
    }
    
    .signup_btn {
        width: 100%;
        height: 45px;
        font-size: 18px;
    }
    
    /* Adjust modal form fields */
    .modal-body .col-xxl-12 {
        width: 100%;
    }
    
    .modal-body .mb-3 {
        margin-bottom: 12px !important;
    }
    
    /* Better touch targets for mobile */
    .edit_icon i,
    .fas,
    .fa-solid {
        min-width: 24px;
        min-height: 24px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Improve spacing for action buttons */
    td .d-flex {
        gap: 8px;
    }
}

/* Extra small devices */
@media (max-width:360px) {
    .login .login-section {
        width: 98%;
        padding: 15px 10px;
    }
    
    .login-headding {
        font-size: 18px;
        line-height: 24px;
    }
    
    .container_section {
        padding: 0px 3px;
    }
    
    .grid_main {
        padding: 8px;
    }
    
    .form-control {
        font-size: 12px;
        height: 36px;
    }
    
    .button-wrapper .btn {
        padding: 5px 15px;
        font-size: 13px;
    }
}

