/* ========================================
   CSS RESPONSIVE AGRESIVO PARA 1366x768
   Solución específica y visible
======================================== */

/* SOLUCION DIRECTA PARA 1366x768 */
@media screen and (min-width: 1300px) and (max-width: 1450px) {
    
    /* REDUCIR TODO EL CONTENIDO */
    html {
        font-size: 14px !important; /* Reducir tamaño base */
    }
    
    body {
        font-size: 0.8rem !important; /* Texto más pequeño */
        zoom: 0.9 !important; /* Zoom general */
    }
    
    /* CONTENEDORES MAS COMPACTOS */
    .container-fluid {
        padding-left: 8px !important;
        padding-right: 8px !important;
        max-width: 98% !important;
    }
    
    .container {
        max-width: 1300px !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
    
    /* NAVBAR MAS PEQUEÑA */
    .navbar {
        min-height: 40px !important;
        padding: 0.2rem 0.5rem !important;
        font-size: 0.8rem !important;
    }
    
    .navbar-brand {
        font-size: 0.9rem !important;
        padding: 0.2rem 0 !important;
    }
    
    .navbar-nav .nav-link {
        padding: 0.2rem 0.5rem !important;
        font-size: 0.8rem !important;
    }
    
    /* AJUSTAR PADDING SUPERIOR DEL BODY */
    .page-with-navbar {
        padding-top: 45px !important;
    }
    
    /* CARDS MUCHO MAS COMPACTAS */
    .card {
        margin-bottom: 0.5rem !important;
        border-radius: 6px !important;
    }
    
    .card-body {
        padding: 0.8rem !important;
    }
    
    .card-title {
        font-size: 0.9rem !important;
        margin-bottom: 0.3rem !important;
    }
    
    .card-text {
        font-size: 0.75rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* FORMULARIOS MAS PEQUEÑOS */
    .form-control, .form-select {
        padding: 0.3rem 0.5rem !important;
        font-size: 0.8rem !important;
        height: auto !important;
        min-height: 32px !important;
    }
    
    .form-label {
        font-size: 0.8rem !important;
        margin-bottom: 0.2rem !important;
        font-weight: 600 !important;
    }
    
    .input-group-text {
        padding: 0.3rem 0.5rem !important;
        font-size: 0.8rem !important;
    }
    
    /* BOTONES MAS PEQUEÑOS */
    .btn {
        padding: 0.3rem 0.6rem !important;
        font-size: 0.8rem !important;
        line-height: 1.2 !important;
    }
    
    .btn-sm {
        padding: 0.2rem 0.4rem !important;
        font-size: 0.7rem !important;
    }
    
    .btn-lg {
        padding: 0.5rem 0.8rem !important;
        font-size: 0.9rem !important;
    }
    
    /* TABLAS MAS COMPACTAS */
    .table {
        font-size: 0.75rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .table th {
        padding: 0.3rem 0.4rem !important;
        font-size: 0.7rem !important;
        font-weight: 600 !important;
    }
    
    .table td {
        padding: 0.3rem 0.4rem !important;
        vertical-align: middle !important;
    }
    
    .table-responsive {
        font-size: 0.75rem !important;
    }
    
    /* MODALES MAS PEQUEÑOS */
    .modal-dialog {
        margin: 0.3rem auto !important;
        max-width: 90% !important;
    }
    
    .modal-lg {
        max-width: 80% !important;
    }
    
    .modal-xl {
        max-width: 90% !important;
    }
    
    .modal-header {
        padding: 0.5rem 0.8rem !important;
    }
    
    .modal-body {
        padding: 0.8rem !important;
    }
    
    .modal-footer {
        padding: 0.4rem 0.8rem !important;
    }
    
    .modal-title {
        font-size: 0.9rem !important;
    }
    
    /* ESPACIADO REDUCIDO */
    .mb-1 { margin-bottom: 0.15rem !important; }
    .mb-2 { margin-bottom: 0.3rem !important; }
    .mb-3 { margin-bottom: 0.5rem !important; }
    .mb-4 { margin-bottom: 0.7rem !important; }
    .mb-5 { margin-bottom: 0.9rem !important; }
    
    .mt-1 { margin-top: 0.15rem !important; }
    .mt-2 { margin-top: 0.3rem !important; }
    .mt-3 { margin-top: 0.5rem !important; }
    .mt-4 { margin-top: 0.7rem !important; }
    .mt-5 { margin-top: 0.9rem !important; }
    
    .py-1 { padding-top: 0.15rem !important; padding-bottom: 0.15rem !important; }
    .py-2 { padding-top: 0.3rem !important; padding-bottom: 0.3rem !important; }
    .py-3 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
    .py-4 { padding-top: 0.7rem !important; padding-bottom: 0.7rem !important; }
    .py-5 { padding-top: 0.9rem !important; padding-bottom: 0.9rem !important; }
    
    /* GRID MAS COMPACTO */
    .row {
        --bs-gutter-x: 0.5rem !important;
        --bs-gutter-y: 0.5rem !important;
    }
    
    .col-md-3, .col-md-4, .col-md-6 {
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }
    
    /* DEBUG BAR MAS PEQUEÑA */
    .debug-info-bar {
        padding: 0.1rem 0.5rem !important;
        font-size: 0.6rem !important;
        top: 40px !important;
    }
    
    /* HEADINGS MAS PEQUEÑOS */
    h1 { font-size: 1.5rem !important; }
    h2 { font-size: 1.3rem !important; }
    h3 { font-size: 1.1rem !important; }
    h4 { font-size: 1rem !important; }
    h5 { font-size: 0.9rem !important; }
    h6 { font-size: 0.8rem !important; }
    
    /* ICONOS MAS PEQUEÑOS */
    .bi {
        font-size: 0.9em !important;
    }
    
    /* ALERTS MAS COMPACTOS */
    .alert {
        padding: 0.5rem 0.8rem !important;
        font-size: 0.8rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* BREADCRUMBS */
    .breadcrumb {
        padding: 0.3rem 0.5rem !important;
        font-size: 0.75rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* PAGINATION */
    .pagination {
        font-size: 0.8rem !important;
    }
    
    .page-link {
        padding: 0.3rem 0.5rem !important;
    }
}

/* SOLUCION ESPECIFICA PARA 1366px EXACTO */
@media screen and (width: 1366px) {
    body::before {
        content: "🎯 OPTIMIZACIÓN 1366x768 ACTIVA";
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: rgba(0, 255, 0, 0.9);
        color: black;
        padding: 10px 20px;
        border-radius: 5px;
        z-index: 10000;
        font-weight: bold;
        animation: fadeOut 3s forwards;
    }
    
    @keyframes fadeOut {
        0% { opacity: 1; }
        70% { opacity: 1; }
        100% { opacity: 0; display: none; }
    }
}

/* FALLBACK AGRESIVO PARA RESOLUCIONES SIMILARES */
@media screen and (min-width: 1360px) and (max-width: 1370px) {
    * {
        font-size: 0.9em !important;
        padding: 0.8em !important;
        margin: 0.8em !important;
    }
    
    .container, .container-fluid {
        max-width: 95% !important;
        padding: 0.5rem !important;
    }
}
