
@media (max-width: 992px) {
    
    html, body {
        overflow-x: hidden !important;
        position: relative;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    * {
        box-sizing: border-box !important;
    }

    .container {
        padding: 8px !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        border: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        overflow-x: hidden !important;
    }


    .header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
        padding-bottom: 15px !important;
    }

    
    .nav-tabs-main {
        flex-wrap: wrap;
        white-space: normal;
        gap: 8px;
        justify-content: center;
        padding: 10px;
    }

    .nav-tabs-main button {
        flex: 1 1 calc(50% - 10px); 
        min-width: 140px;
        padding: 10px 10px;
        font-size: 11px;
        text-align: center;
    }

    
    .tabs-header {
        flex-wrap: wrap;
        white-space: normal;
        gap: 15px;
        justify-content: flex-start;
        padding-bottom: 15px;
    }

    .sub-tab {
        flex: none;
        font-size: 11px;
    }

    
    .grid-form, .grid-form-4, .grid-form-5 {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    .form-card {
        padding: 15px;
    }

    
    .main-table thead {
        display: none; 
    }

    .main-table, 
    .main-table tbody, 
    .main-table tr, 
    .main-table td {
        display: block;
        width: 100% !important;
        min-width: 0 !important;
    }

    .table-scroll-wrap {
        border: none !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    .main-table tr {
        background: #fff;
        border: 2px solid #e2e8f0;
        border-radius: 14px;
        margin-bottom: 20px;
        padding: 15px;
        box-shadow: 0 4px 6px rgba(0,0,0,0.02);
        position: relative;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden;
    }

    .main-table td {
        padding: 8px 0;
        border-bottom: 1px solid #f1f5f9;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        text-align: left;
        font-size: 15px;
        font-weight: 500;
        overflow-wrap: anywhere;
        white-space: normal;
    }

    .main-table td:last-child {
        border-bottom: none;
        padding-top: 15px;
        justify-content: center;
        gap: 10px;
    }

    
    .main-table td::before {
        content: attr(data-label);
        font-weight: 800;
        text-transform: uppercase;
        color: #94a3b8;
        font-size: 10px;
        letter-spacing: 0.5px;
    }

    .main-table td[data-label="Acciones"], 
    .main-table td[data-label="Acción"] {
        background: #f8fafc;
        margin: 10px -15px -15px -15px;
        padding: 15px;
        border-radius: 0 0 14px 14px;
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        gap: 20px;
    }

    .main-table td[data-label="Acciones"] button,
    .main-table td[data-label="Acción"] button {
        flex: 1;
        padding: 12px !important;
        font-size: 18px !important;
        border-radius: 10px;
        border: none;
        display: flex;
        justify-content: center;
        align-items: center;
        box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    }

    .btn-edit { background: #eff6ff; color: #1d4ed8; }
    .btn-del { background: #fef2f2; color: #dc2626; }

    .main-table td[data-label="Acciones"]::before,
    .main-table td[data-label="Acción"]::before {
        display: none;
    }

    
    .search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .count-badge {
        text-align: center;
    }
}
