/* ============================================
   LISTA INGRESOS POR REGION - ESTILOS MODERNOS
   ============================================ */

/* CONTENEDOR PRINCIPAL */
.rpt-region-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ENCABEZADO MODERNO */
.rpt-region-header {
    background: linear-gradient(135deg, #4b1ca4 0%, #6d28d9 100%);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(75, 28, 164, 0.2);
    color: white;
}

.rpt-region-header-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.rpt-region-header-icon {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rpt-region-header-icon svg {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.rpt-region-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.rpt-region-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin: 5px 0 0 0;
    font-weight: 300;
}

/* TARJETA DE FORMULARIO */
.rpt-region-form-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(75, 28, 164, 0.1);
}

.rpt-region-section {
    margin-bottom: 25px;
}

.rpt-region-section-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #4b1ca4;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rpt-region-section-title svg {
    color: #6d28d9;
}

/* GRID DE FILTROS */
.rpt-region-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.rpt-region-form-group {
    display: flex;
    flex-direction: column;
}

.rpt-region-label {
    font-weight: 600;
    color: #4b1ca4;
    margin-bottom: 8px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rpt-region-label-icon {
    width: 18px;
    height: 18px;
    color: #6d28d9;
}

.rpt-region-select {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #f9fafb;
    color: #1f2937;
}

.rpt-region-select:focus {
    outline: none;
    border-color: #4b1ca4;
    box-shadow: 0 0 0 4px rgba(75, 28, 164, 0.1);
    background-color: white;
}

/* BOTÓN DE BÚSQUEDA */
.rpt-region-form-actions {
    display: flex;
    justify-content: center;
    margin-top: 25px;
}

.rpt-region-btn-search {
    background: linear-gradient(135deg, #4b1ca4 0%, #6d28d9 100%);
    color: white;
    border: none;
    padding: 14px 40px;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(75, 28, 164, 0.3);
}

.rpt-region-btn-search:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(75, 28, 164, 0.4);
}

.rpt-region-btn-search:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* TARJETA DE RESULTADOS */
.rpt-region-results-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(75, 28, 164, 0.1);
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ENCABEZADO DE PERÍODO */
.rpt-region-period-header {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 12px;
    padding: 20px 25px;
    margin-bottom: 25px;
    border-left: 5px solid #4b1ca4;
}

.rpt-region-period-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #4b1ca4;
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.rpt-region-period-text {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.rpt-region-period-separator {
    color: #4b1ca4;
    font-weight: 700;
    margin: 0 10px;
}

/* SECCIÓN DE REGIONES */
.rpt-region-section-wrapper {
    margin-bottom: 40px;
}

.rpt-region-section-header {
    background: linear-gradient(135deg, #4b1ca4 0%, #6d28d9 100%);
    color: white;
    padding: 20px 25px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(75, 28, 164, 0.2);
}

.rpt-region-section-title-main {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.rpt-region-section-total {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rpt-region-section-total svg {
    width: 20px;
    height: 20px;
}

/* TABLA DESKTOP */
.rpt-region-table-wrapper {
    overflow-x: auto;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.rpt-region-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.rpt-region-table thead {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.rpt-region-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: #4b1ca4;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rpt-region-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.2s ease;
}

.rpt-region-table tbody tr:hover {
    background-color: #f9fafb;
}

.rpt-region-table tbody tr:last-child {
    border-bottom: none;
}

.rpt-region-table td {
    padding: 16px;
    color: #374151;
    font-size: 0.95rem;
}

.rpt-region-table .rpt-region-cell-amount {
    font-weight: 700;
    color: #059669;
    font-size: 1.05rem;
}

/* CARDS MOBILE */
.rpt-region-cards-mobile {
    display: none;
}

.rpt-region-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.rpt-region-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.rpt-region-card-header {
    background: linear-gradient(135deg, #4b1ca4 0%, #6d28d9 100%);
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rpt-region-card-region-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.rpt-region-card-total {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
}

.rpt-region-card-body {
    padding: 0;
}

.rpt-region-card-item {
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.rpt-region-card-item:last-child {
    border-bottom: none;
}

.rpt-region-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.rpt-region-card-row:last-child {
    margin-bottom: 0;
}

.rpt-region-card-label {
    font-weight: 600;
    color: #6b7280;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rpt-region-card-value {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.95rem;
}

.rpt-region-card-value.highlight {
    color: #059669;
    font-size: 1.05rem;
}

/* ESTADOS DE CARGA */
.rpt-region-loading {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.rpt-region-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f4f6;
    border-top-color: #4b1ca4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.rpt-region-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.rpt-region-empty svg {
    color: #d1d5db;
    margin-bottom: 20px;
}

.rpt-region-empty p {
    font-size: 1.1rem;
    margin: 0;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .rpt-region-container {
        padding: 15px;
    }

    .rpt-region-header {
        padding: 20px;
        border-radius: 12px;
    }

    .rpt-region-header-content {
        flex-direction: column;
        text-align: center;
    }

    .rpt-region-title {
        font-size: 1.5rem;
    }

    .rpt-region-subtitle {
        font-size: 0.9rem;
    }

    .rpt-region-form-card {
        padding: 20px;
        border-radius: 12px;
    }

    .rpt-region-filter-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .rpt-region-btn-search {
        width: 100%;
        justify-content: center;
        padding: 12px 24px;
    }

    .rpt-region-results-card {
        padding: 20px;
        border-radius: 12px;
    }

    .rpt-region-period-header {
        padding: 15px;
    }

    .rpt-region-period-text {
        font-size: 1rem;
    }

    /* Ocultar tabla en móvil */
    .rpt-region-table-wrapper {
        display: none;
    }

    /* Mostrar cards en móvil */
    .rpt-region-cards-mobile {
        display: block;
    }

    .rpt-region-section-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
        text-align: center;
    }

    .rpt-region-section-title-main {
        font-size: 1.2rem;
    }

    .rpt-region-section-total {
        padding: 8px 16px;
        font-size: 1rem;
    }
}

/* ANIMACIONES */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.rpt-region-fade-in {
    animation: fadeIn 0.4s ease-out;
}

/* SCROLL SUAVE */
html {
    scroll-behavior: smooth;
}
