/**
 * Vendor Panel — mobile layout + density (vendor_panel.php).
 * Mission nav mobile behavior: aeris_mission_nav.php + aeris_panel_chrome.css
 */

body.panel-chrome.vendor-shell-theme {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

.vendor-shell-theme .command-header {
    flex: 0 0 auto;
}

.vendor-shell-theme .vendor-panel-layout {
    display: flex;
    flex: 1 1 auto;
    overflow: hidden;
    width: 100%;
    min-height: 0;
}

@media (max-width: 992px) {
    .vendor-shell-theme .vendor-panel-layout {
        flex-direction: column !important;
        overflow: visible !important;
    }

    .vendor-shell-theme .vendor-panel-layout > .main {
        order: 1;
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 10px 8px !important;
        gap: 12px !important;
        overflow-x: hidden;
    }

    .vendor-shell-theme .vendor-panel-layout > .sidebar {
        order: 2;
        width: 100% !important;
        max-width: 100% !important;
        flex-shrink: 0;
        border-right: none !important;
        border-top: 1px solid var(--border, rgba(255, 255, 255, 0.08));
        padding: 10px 8px 14px !important;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 6px;
        row-gap: 4px;
        align-content: start;
    }

    .vendor-shell-theme .sidebar .brand,
    .vendor-shell-theme .sidebar .nav-header,
    .vendor-shell-theme .sidebar > div[style*="flex: 1"],
    .vendor-shell-theme .sidebar > div:has(select) {
        grid-column: 1 / -1;
    }

    .vendor-shell-theme .sidebar .brand {
        margin-bottom: 8px !important;
        font-size: 1rem !important;
    }

    .vendor-shell-theme .sidebar .brand span {
        font-size: 0.85rem;
    }

    .vendor-shell-theme .sidebar .nav-header {
        margin: 8px 0 4px !important;
        font-size: 0.5625rem !important;
    }

    .vendor-shell-theme .sidebar .nav-item {
        padding: 7px 8px !important;
        margin-bottom: 2px !important;
        font-size: 0.625rem !important;
        gap: 8px !important;
        border-left-width: 2px !important;
    }

    .vendor-shell-theme .sidebar .nav-item i {
        font-size: 0.7rem;
        width: 14px;
        text-align: center;
    }

    .vendor-shell-theme .sidebar select.form-control {
        font-size: 0.625rem !important;
        padding: 6px 8px !important;
    }

    .vendor-shell-theme .command-header {
        padding: 6px 8px !important;
        margin-bottom: 8px !important;
    }

    .vendor-shell-theme .command-header-top {
        flex-wrap: wrap;
        gap: 8px;
    }

    .vendor-shell-theme .command-title h1 {
        font-size: 0.75rem !important;
    }

    .vendor-shell-theme .command-header-contacts {
        justify-content: flex-start;
    }

    .vendor-shell-theme .command-header-badge {
        font-size: 0.5625rem !important;
    }

    .vendor-shell-theme .dashboard-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    .vendor-shell-theme .dashboard-grid[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    .vendor-shell-theme .card {
        padding: 12px 10px !important;
        border-radius: 12px !important;
    }

    .vendor-shell-theme .stat-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 6px !important;
        padding: 10px 6px !important;
    }

    .vendor-shell-theme .stat-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.9rem !important;
        border-radius: 8px !important;
    }

    .vendor-shell-theme .stat-info h3 {
        font-size: 0.95rem !important;
    }

    .vendor-shell-theme .stat-info p {
        font-size: 0.5625rem !important;
        line-height: 1.2;
    }

    .vendor-shell-theme .header {
        flex-wrap: wrap;
        gap: 8px;
        padding-bottom: 12px !important;
    }

    .vendor-shell-theme .welcome h1 {
        font-size: 1.05rem !important;
    }

    .vendor-shell-theme .welcome p {
        font-size: 0.625rem !important;
    }

    .vendor-shell-theme .btn {
        padding: 8px 12px !important;
        font-size: 0.625rem !important;
        border-radius: 8px !important;
    }

    .vendor-shell-theme .tab-bar {
        overflow-x: auto;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .vendor-shell-theme .tab-btn {
        flex: 0 0 auto;
        font-size: 0.625rem !important;
        padding: 8px 10px !important;
    }

    .vendor-shell-theme .table {
        font-size: 0.625rem !important;
    }

    .vendor-shell-theme .table th,
    .vendor-shell-theme .table td {
        padding: 0.35rem 0.45rem !important;
        white-space: nowrap;
    }

    .vendor-shell-theme .table-responsive {
        -webkit-overflow-scrolling: touch;
        margin: 0 -2px;
    }

    .vendor-shell-theme .badge {
        font-size: 0.5rem !important;
        padding: 2px 6px !important;
    }

    .vendor-shell-theme .form-control {
        font-size: 0.6875rem !important;
        padding: 8px 10px !important;
    }

    .vendor-shell-theme #apf-panel-footer-strip.apf-shell {
        margin-top: 12px !important;
    }
}

@media (max-width: 480px) {
    .vendor-shell-theme .command-header-contacts .command-header-badge:nth-child(n+3) {
        display: none;
    }

    .vendor-shell-theme .dashboard-grid {
        gap: 6px !important;
    }

    .vendor-shell-theme .stat-info h3 {
        font-size: 0.8125rem !important;
    }
}
