/**
 * assets/css/insurance-list.css
 * * Estilos exclusivos para el armador y listado de seguros (VEM Torneos).
 * Diseño moderno, limpio, completamente adaptativo y aislado bajo el contenedor principal.
 */

/* 1. Contenedor Principal */
.vem-insurance-list-wrapper {
    max-width: 1280px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #2c3e50;
    background-color: #fcfcfc;
    box-sizing: border-box;
}

.vem-insurance-list-wrapper *,
.vem-insurance-list-wrapper *::before,
.vem-insurance-list-wrapper *::after {
    box-sizing: inherit;
}

/* 2. Cabecera (Header) */
.vem-insurance-list-wrapper .vem-insurance-header {
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #eaeaea;
}

.vem-insurance-list-wrapper .vem-insurance-title {
    font-size: 1.85rem;
    font-weight: 700;
    color: #1e1e1e;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.vem-insurance-list-wrapper .vem-insurance-subtitle {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

/* 3. Tarjeta de Filtros (Card) */
.vem-insurance-list-wrapper .vem-insurance-filter-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    margin-bottom: 2rem;
}

/* 4. Grid de Filtros (Responsive Dinámico) */
.vem-insurance-list-wrapper .vem-insurance-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    gap: 1.25rem;
    align-items: start;
}

/* 5. Grupos de Control y Elementos de Entrada */
.vem-insurance-list-wrapper .vem-insurance-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.vem-insurance-list-wrapper .vem-insurance-filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.vem-insurance-list-wrapper .vem-insurance-filter-control {
    width: 100% !important;
    min-height: 44px;
    height: 44px;
    padding: 0 0.75rem !important;
    font-size: 0.95rem !important;
    line-height: 1.5;
    color: #334155 !important;
    background-color: #ffffff !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 16px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.vem-insurance-list-wrapper .vem-insurance-filter-control:focus {
    border-color: #2271b1 !important;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.15) !important;
}

.vem-insurance-list-wrapper .vem-insurance-hidden {
    display: none !important;
}

.vem-insurance-list-wrapper .vem-insurance-field-help {
    display: block;
    font-size: 0.75rem;
    line-height: 1.35;
    color: #64748b;
    margin-top: 2px;
}

.vem-insurance-list-wrapper #vem-insurance-discipline {
    min-height: 150px !important;
    height: 150px !important;
    padding: 0.5rem 0.75rem !important;
    background-image: none !important;
}

.vem-insurance-list-wrapper #vem-insurance-discipline option {
    padding: 0.45rem 0.5rem;
}

.vem-insurance-list-wrapper .vem-insurance-filter-group:has(#vem-insurance-discipline) {
    grid-column: span 2;
}

/* 6. Acciones y Botón Principal */
.vem-insurance-list-wrapper .vem-insurance-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
    grid-column: 1 / -1;
}

.vem-insurance-list-wrapper .vem-insurance-main-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 2rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff !important;
    background-color: #2271b1 !important;
    border: none !important;
    border-radius: 10px !important;
    cursor: pointer;
    text-decoration: none !important;
    transition: background-color 0.15s ease, transform 0.1s ease;
    box-shadow: 0 2px 4px rgba(34, 113, 177, 0.15);
}

.vem-insurance-list-wrapper .vem-insurance-main-btn:hover {
    background-color: #135e96 !important;
}

.vem-insurance-list-wrapper .vem-insurance-main-btn:active {
    transform: translateY(1px);
}

.vem-insurance-list-wrapper .vem-insurance-main-btn:disabled,
.vem-insurance-list-wrapper .vem-insurance-main-btn[disabled] {
    background-color: #cbd5e1 !important;
    color: #94a3b8 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
}

/* 7. Alertas y Estados de Mensajes */
.vem-insurance-list-wrapper .vem-insurance-alert {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.4;
    background-color: #f0fdf4;
    border-left: 4px solid #16a34a;
    color: #166534;
}

.vem-insurance-list-wrapper .vem-insurance-alert-error {
    background-color: #fef2f2;
    border-left-color: #dc2626;
    color: #991b1b;
}

/* 8. Contenedor de Resultados y Empty State */
.vem-insurance-list-wrapper .vem-insurance-result {
    margin-top: 2.5rem;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.vem-insurance-list-wrapper .vem-insurance-empty-state {
    padding: 4rem 2rem;
    text-align: center;
    background-color: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
}

.vem-insurance-list-wrapper .vem-insurance-empty-state::before {
    content: "📋";
    display: block;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.vem-insurance-list-wrapper .vem-insurance-empty-state p {
    margin: 0;
    font-size: 1rem;
    color: #64748b;
}

.vem-insurance-list-wrapper .vem-insurance-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.vem-insurance-list-wrapper .vem-insurance-toolbar-label {
    font-weight: 700;
    color: #334155;
    margin-right: 0.25rem;
}

.vem-insurance-list-wrapper .vem-insurance-secondary-btn {
    min-height: 38px;
    padding: 0 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #ffffff;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.vem-insurance-list-wrapper .vem-insurance-secondary-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.vem-insurance-list-wrapper .vem-insurance-printable-area {
    background: #ffffff;
    padding: 1.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.vem-insurance-list-wrapper .vem-insurance-result-title {
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e2e8f0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
}

/* 9. Optimización Estructural para DataTables */
.vem-insurance-list-wrapper .vem-insurance-result table.dataTable,
.vem-insurance-list-wrapper .vem-insurance-result table {
    width: 100% !important;
    margin: 1rem 0 !important;
    border-collapse: collapse !important;
    font-size: 0.9rem !important;
}

.vem-insurance-list-wrapper .vem-insurance-result table thead th {
    background-color: #f1f5f9 !important;
    color: #1e293b !important;
    font-weight: 700 !important;
    padding: 0.85rem 1rem !important;
    text-align: left !important;
    border-bottom: 2px solid #cbd5e1 !important;
}

.vem-insurance-list-wrapper .vem-insurance-result table tbody td {
    padding: 0.85rem 1rem !important;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #334155 !important;
}

.vem-insurance-list-wrapper .vem-insurance-result table tbody tr:nth-child(even) {
    background-color: #f8fafc !important;
}

.vem-insurance-list-wrapper .vem-insurance-result table tbody tr:hover {
    background-color: #f1f5f9 !important;
}

/* Envoltura de seguridad para scroll en tablas de DataTables scopeada */
.vem-insurance-list-wrapper .dataTables_wrapper {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* 10. Reglas de Adaptabilidad (Media Queries) */

/* Pantallas Medianas (Tablets y Escritorios Pequeños) */
@media screen and (max-width: 900px) {
    .vem-insurance-list-wrapper .vem-insurance-filter-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
        gap: 1.5rem 1.25rem;
    }
    
    .vem-insurance-list-wrapper .vem-insurance-actions {
        margin-top: 1rem;
    }
}

/* Pantallas Pequeñas (Dispositivos Móviles) */
@media screen and (max-width: 640px) {
    .vem-insurance-list-wrapper {
        margin: 1rem auto;
        padding: 0 1rem;
    }

    .vem-insurance-list-wrapper .vem-insurance-title {
        font-size: 1.5rem;
    }

    .vem-insurance-list-wrapper .vem-insurance-filter-card {
        padding: 1.25rem;
        border-radius: 12px;
    }

    .vem-insurance-list-wrapper .vem-insurance-filter-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .vem-insurance-list-wrapper .vem-insurance-actions {
        justify-content: center;
        width: 100%;
        margin-top: 0.5rem;
    }

    .vem-insurance-list-wrapper .vem-insurance-main-btn {
        width: 100% !important;
        min-height: 46px;
    }

    .vem-insurance-list-wrapper .vem-insurance-result {
        margin-top: 1.5rem;
        padding: 1rem;
        border-radius: 12px;
    }
    
    .vem-insurance-list-wrapper .vem-insurance-empty-state {
        padding: 2.5rem 1rem;
    }
	
	.vem-insurance-list-wrapper .vem-insurance-filter-group:has(#vem-insurance-discipline) {
    grid-column: auto;
}

.vem-insurance-list-wrapper #vem-insurance-discipline {
    min-height: 180px !important;
    height: 180px !important;
}

.vem-insurance-list-wrapper .vem-insurance-toolbar {
    flex-direction: column;
    align-items: stretch;
}

.vem-insurance-list-wrapper .vem-insurance-secondary-btn {
    width: 100%;
}
}