/* ==================================================================
   Nexum WHMCS Theme — Responsive CSS
   Breakpoints, Mobile Navigation Drawer, Data Table Transformations
   ================================================================== */

/* Mobile Off-Canvas Drawer Backdrop */
.nx-mobile-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    transition: opacity .25s ease;
}

body.nx-mobile-nav-open .nx-mobile-backdrop {
    display: block;
    opacity: 1;
}

/* Mobile Toggle Hamburger (Hidden on Desktop) */
.nx-mobile-nav-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 18px;
    color: var(--nx-text);
    cursor: pointer;
    padding: 8px;
    align-items: center;
    justify-content: center;
}

/* Mobile Drawer (MUST BE HIDDEN ON DESKTOP) */
.nx-mobile-drawer {
    display: none;
}

/* Breakpoint: <= 991.98px (Tablets & Mobile) */
@media (max-width: 991.98px) {
    .nx-mobile-nav-toggle {
        display: flex;
    }

    .nx-desktop-nav {
        display: none !important; /* Hide top desktop items */
    }

    /* Off-canvas mobile drawer */
    .nx-mobile-drawer {
        display: flex;
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        background: var(--nx-card-bg);
        border-right: 1px solid var(--nx-border);
        z-index: 1050;
        padding: 20px;
        flex-direction: column;
        transition: left .25s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        box-shadow: var(--nx-shadow);
    }

    body.nx-mobile-nav-open .nx-mobile-drawer {
        left: 0;
    }

    .nx-mobile-drawer .nx-nav-items {
        display: flex;
        flex-direction: column;
        gap: 6px;
        width: 100%;
        margin-top: 16px;
    }

    .nx-mobile-drawer .nx-nav-link {
        width: 100%;
        padding: 10px 14px;
    }

    .nx-dash-grid {
        grid-template-columns: 1fr;
    }

    .nx-main-container,
    #main-body {
        padding: 16px;
    }

    .nx-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Breakpoint: <= 575.98px (Mobile Portrait) */
@media (max-width: 575.98px) {
    .nx-stat-grid {
        grid-template-columns: 1fr;
    }

    .nx-welcome-hero {
        padding: 20px;
    }

    .nx-welcome-actions {
        width: 100%;
        flex-direction: column;
    }

    .nx-welcome-actions .nx-btn {
        width: 100%;
    }

    .nx-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .nx-invoice-container {
        padding: 16px;
    }

    .nx-invoice-parties {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}
