/**
 * FIX MÓVIL - ESTILOS FORZADOS PARA SMARTPHONES
 * Este archivo fuerza estilos móviles con máxima prioridad
 */

/* ============================================
   LOGO RESPONSIVE - MÓVILES Y TABLETS
   ============================================ */

/* Tablets (768px - 992px) */
@media screen and (max-width: 992px) and (min-width: 769px) {
    .logo-header {
        height: 65px !important;
        width: 65px !important;
        min-width: 65px !important;
        max-width: 65px !important;
        object-fit: contain !important;
    }
    
    .brand-text {
        font-size: 1rem !important;
    }
    
    .navbar-brand {
        font-size: 1.1rem !important;
    }
}

/* Móviles (hasta 768px) - LOGO MUCHO MÁS PEQUEÑO */
@media screen and (max-width: 768px) {
    .logo-header {
        height: 35px !important;
        width: 35px !important;
        min-width: 35px !important;
        max-width: 35px !important;
        object-fit: contain !important;
        padding: 2px !important;
        border-width: 1px !important;
    }
    
    .logo-header.logo-favicon {
        height: 32px !important;
        width: 32px !important;
        min-width: 32px !important;
        max-width: 32px !important;
    }
    
    .brand-text {
        font-size: 0.75rem !important;
    }
    
    .navbar-brand {
        font-size: 0.8rem !important;
        padding: 0.25rem 0 !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.25rem !important;
    }
    
    .navbar-brand .me-2 {
        margin-right: 0.25rem !important;
    }
}

/* Móviles pequeños (hasta 480px) - LOGO AÚN MÁS PEQUEÑO */
@media screen and (max-width: 480px) {
    .logo-header {
        height: 30px !important;
        width: 30px !important;
        min-width: 30px !important;
        max-width: 30px !important;
        padding: 1px !important;
    }
    
    .logo-header.logo-favicon {
        height: 28px !important;
        width: 28px !important;
        min-width: 28px !important;
        max-width: 28px !important;
    }
    
    .brand-text {
        font-size: 0.7rem !important;
    }
    
    .navbar-brand {
        font-size: 0.75rem !important;
    }
}

/* Móviles extra pequeños (hasta 360px) - LOGO MÍNIMO */
@media screen and (max-width: 360px) {
    .logo-header {
        height: 28px !important;
        width: 28px !important;
        min-width: 28px !important;
        max-width: 28px !important;
        padding: 1px !important;
    }
    
    .logo-header.logo-favicon {
        height: 26px !important;
        width: 26px !important;
        min-width: 26px !important;
        max-width: 26px !important;
    }
    
    .brand-text {
        font-size: 0.65rem !important;
    }
    
    .navbar-brand {
        font-size: 0.7rem !important;
    }
}

/* Reset completo para móviles */
@media screen and (max-width: 768px) {
    /* Forzar viewport */
    html {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        -webkit-text-size-adjust: 100% !important;
    }
    
    body {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Contenedor principal */
    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Ocultar título duplicado */
    h1.d-none.d-md-block {
        display: none !important;
    }
    
    /* Estadísticas - 2 por fila */
    .row.g-4 {
        margin-left: 0 !important;
        margin-right: 0 !important;
        --bs-gutter-x: 0.5rem !important;
        --bs-gutter-y: 0.75rem !important;
    }
    
    .row.g-4 > [class*="col-"] {
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .col-md-3.col-sm-6 {
        flex: 0 0 calc(50% - 0.5rem) !important;
        max-width: calc(50% - 0.5rem) !important;
        width: calc(50% - 0.5rem) !important;
    }
    
    /* Tarjetas de estadísticas */
    .stat-card {
        padding: 0.75rem 0.5rem !important;
        margin-bottom: 0 !important;
        width: 100% !important;
        min-height: auto !important;
    }
    
    .stat-card h3 {
        font-size: 1.4rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    .stat-card p {
        font-size: 0.7rem !important;
        margin: 0 !important;
    }
    
    .stat-card p i {
        font-size: 0.65rem !important;
    }
    
    /* Cards */
    .card {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 1rem !important;
    }
    
    .card-body {
        padding: 1rem 0.75rem !important;
    }
    
    /* Accesos rápidos */
    .quick-access {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
        width: 100% !important;
    }
    
    .quick-access .btn {
        width: 100% !important;
        min-height: 48px !important;
        padding: 0.875rem 1rem !important;
        font-size: 0.95rem !important;
        margin-bottom: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .quick-access .btn i {
        margin-right: 0.5rem !important;
        font-size: 1.1rem !important;
    }
    
    /* Tablas */
    .table-responsive {
        width: 100% !important;
        overflow-x: visible !important;
    }
    
    .table {
        width: 100% !important;
        display: block !important;
    }
    
    .table thead {
        display: none !important;
    }
    
    .table tbody {
        display: block !important;
        width: 100% !important;
    }
    
    .table tbody tr {
        display: block !important;
        width: 100% !important;
        margin-bottom: 0.75rem !important;
        padding: 0.75rem !important;
        border: 1px solid rgba(0, 0, 0, 0.1) !important;
        border-radius: 0.5rem !important;
        background: #fff !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
    }
    
    .table tbody td {
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
        padding: 0.5rem 0 !important;
        border: none !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
        text-align: left !important;
    }
    
    .table tbody td:last-child {
        border-bottom: none !important;
    }
    
    .table tbody td[data-label]::before {
        content: attr(data-label) ": " !important;
        font-weight: 600 !important;
        color: var(--azul-dominicano) !important;
        margin-right: 0.5rem !important;
        font-size: 0.8rem !important;
        flex-shrink: 0 !important;
    }
    
    .table tbody td .badge {
        margin-left: auto !important;
    }
    
    /* Footer de cards */
    .card-footer {
        padding: 0.75rem !important;
        text-align: center !important;
    }
    
    .card-footer .btn {
        width: 100% !important;
        min-height: 44px !important;
    }
    
    /* Espaciado general */
    .mt-4 {
        margin-top: 1rem !important;
    }
    
    .mb-4 {
        margin-bottom: 1.5rem !important;
    }
    
    .page-section {
        padding: 0.5rem 0 !important;
    }
    
    /* Títulos */
    h2 {
        font-size: 1.1rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .card-title {
        font-size: 1.1rem !important;
    }
}

/* Pantallas muy pequeñas */
@media screen and (max-width: 480px) {
    .container {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    .stat-card {
        padding: 0.6rem 0.4rem !important;
    }
    
    .stat-card h3 {
        font-size: 1.2rem !important;
    }
    
    .stat-card p {
        font-size: 0.65rem !important;
    }
    
    .card-body {
        padding: 0.875rem 0.5rem !important;
    }
}

