/* MOBILE OPTIMIZATION */
@media (max-width: 768px) {

    h1.h3 {
        font-size: 18px !important;
        margin-bottom: 15px !important;
    }

    /* Aggressive Reset for mobile squishing */
    #wrapper, #content-wrapper, #content, .container-fluid {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 10px !important;
        display: block !important;
        flex: none !important;
    }

    /* Fix Topbar squishing */
    .topbar {
        width: 100% !important;
        height: auto !important;
        padding: 10px 15px !important;
    }

    .topbar .navbar-brand {
        white-space: normal !important;
        font-size: 16px !important;
    }

    .card {
        margin-bottom: 15px !important;
        width: calc(100% - 20px) !important;
        margin-left: 10px !important;
        margin-right: 10px !important;
    }

    .card-body {
        padding: 12px !important;
    }

    /* Fix horizontal scroll */
    body {
        overflow-x: hidden !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        padding-bottom: 80px !important;
    }

    table {
        font-size: 11px;
        width: 100% !important;
    }

    .table th,
    .table td {
        padding: 6px !important;
    }

    .btn {
        font-size: 12px !important;
        padding: 6px 10px !important;
    }

    .badge {
        font-size: 11px !important;
    }

    /* Status Box Wrapper */
    .status-box {
        padding: 10px;
    }

    .status-box i {
        font-size: 2rem !important;
        margin-bottom: 8px;
    }

    .status-box h3 {
        font-size: 14px !important;
        margin-top: 5px;
    }

    /* Stacked Table Layout */
    .table-mobile-stacked thead {
        display: none;
    }

    .table-mobile-stacked tbody tr {
        display: block;
        margin-bottom: 10px;
        border: 1px solid #eee;
        border-radius: 8px;
        padding: 8px;
    }

    .table-mobile-stacked tbody td {
        display: flex;
        justify-content: space-between;
        border: none !important;
        padding: 4px 0 !important;
    }

    /* Modal Tweaks */
    .modal-dialog {
        margin: 10px;
    }

    .modal-body h2 {
        font-size: 18px;
    }

    .modal-body h4 {
        font-size: 14px;
    }

    /* Safe Space for Bottom Navbar */
    body {
        padding-bottom: 80px !important;
    }

    /* Bottom Navbar Premium Design */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 70px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        display: flex;
        justify-content: space-around;
        align-items: center;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        z-index: 1050;
        border-top: 1px solid #eee;
    }

    .mobile-bottom-nav .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: #858796;
        font-size: 10px;
        transition: 0.3s;
        flex: 1;
        padding: 5px 0;
    }

    .mobile-bottom-nav .nav-item i {
        font-size: 20px;
        margin-bottom: 4px;
    }

    .mobile-bottom-nav .nav-item.active {
        color: #4e73df;
    }

    .mobile-bottom-nav .nav-item.active i {
        transform: translateY(-2px);
    }

    /* Summary Card Optimization */
    .card-body .d-flex.justify-content-between {
        font-size: 13px !important;
    }

    .card-body .d-flex.justify-content-between.h5 {
        font-size: 16px !important;
        margin-top: 10px;
        padding-top: 10px;
    }

    hr {
        margin-top: 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }
}
