﻿/* ============================================
   REPORTES - CSS ULTRA MODERNO CON CARDS 2025
   ============================================ */

:root {
    --reportes-primary: #4b1ca4;
    --reportes-primary-dark: #3a1580;
    --reportes-primary-light: #6b2dd4;
    --reportes-secondary: #d60739;
    --reportes-accent: #667eea;
    --reportes-gradient-primary: linear-gradient(135deg, #4b1ca4 0%, #6b2dd4 100%);
    --reportes-gradient-success: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    --reportes-gradient-info: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    --reportes-dark: #1a1a2e;
    --reportes-light: #f8f9ff;
    --reportes-white: #ffffff;
    --reportes-bg: #ffffff;
    --reportes-success: #4CAF50;
    --reportes-danger: #ff0000;
    --reportes-info: #17a2b8;
    --reportes-warning: #ffc107;
    --reportes-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --reportes-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --reportes-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    --reportes-shadow-card: 0 4px 20px rgba(75, 28, 164, 0.12);
    --reportes-radius-sm: 8px;
    --reportes-radius-md: 12px;
    --reportes-radius-lg: 16px;
    --reportes-radius-xl: 20px;
    --reportes-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --reportes-total-gradient: linear-gradient(135deg, #f0f4ff 0%, #e8f0ff 100%);
    --reportes-total-border: #4b1ca4;
    --reportes-card-border: #e8e8f0;
}

/* ============================================
   PÁGINA PRINCIPAL
   ============================================ */
#reportes-page {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
    min-height: 100vh;
    padding: 1.5rem;
}

/* ============================================
   NAVBAR MODERNO
   ============================================ */
#reportes-navbar {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
    box-shadow: var(--reportes-shadow-lg);
    border-radius: var(--reportes-radius-lg);
    margin-bottom: 2rem;
    padding: 1rem 1.5rem;
    backdrop-filter: blur(10px);
}

    #reportes-navbar .navbar-brand {
        font-size: 1.6rem;
        font-weight: 700;
        color: #fff !important;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
        transition: var(--reportes-transition);
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

        #reportes-navbar .navbar-brand:hover {
            transform: scale(1.05);
        }

    #reportes-navbar .btn-dark {
        border-radius: 25px;
        padding: 0.6rem 1.25rem;
        margin: 0.25rem;
        font-size: 0.95rem;
        font-weight: 600;
        transition: var(--reportes-transition);
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        color: white;
        backdrop-filter: blur(5px);
    }

        #reportes-navbar .btn-dark:hover {
            background: var(--reportes-gradient-primary);
            border-color: var(--reportes-primary);
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(75, 28, 164, 0.5);
        }

/* ============================================
   CABECERAS ELEGANTES
   ============================================ */
.reportes-header {
    background: var(--reportes-gradient-primary);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: var(--reportes-radius-lg);
    text-align: center;
    box-shadow: var(--reportes-shadow-md);
    margin-bottom: 1.5rem;
    animation: slideInDown 0.4s ease;
}

    .reportes-header h3 {
        margin: 0;
        font-size: 1.75rem;
        font-weight: 700;
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
    }

/* ============================================
   CONTENEDORES BLANCOS LIMPIOS
   ============================================ */
.reportes-container {
    background: var(--reportes-white);
    border-radius: var(--reportes-radius-lg);
    padding: 1.75rem;
    box-shadow: var(--reportes-shadow-sm);
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.4s ease;
    border: 1px solid var(--reportes-card-border);
}

/* ============================================
   BOTONES ULTRA MODERNOS
   ============================================ */
.reportes-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--reportes-gradient-primary);
    color: white;
    border: none;
    padding: 0.875rem 1.75rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--reportes-transition);
    box-shadow: var(--reportes-shadow-sm);
    cursor: pointer;
}

    .reportes-btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: var(--reportes-shadow-md);
    }

.reportes-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--reportes-primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--reportes-transition);
    cursor: pointer;
}

    .reportes-btn-secondary:hover {
        background: var(--reportes-primary-light);
        transform: translateY(-2px);
        box-shadow: var(--reportes-shadow-sm);
    }

/* ============================================
   FORMULARIOS Y SELECTORES
   ============================================ */
.reportes-select-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.reportes-form-group {
    display: flex;
    flex-direction: column;
}

    .reportes-form-group label {
        font-weight: 600;
        color: var(--reportes-primary);
        margin-bottom: 0.5rem;
        font-size: 0.95rem;
    }

    .reportes-form-group .form-control,
    .reportes-form-group .form-select {
        border-radius: var(--reportes-radius-sm);
        border: 2px solid #e0e0e0;
        padding: 0.75rem 1rem;
        transition: var(--reportes-transition);
        background: var(--reportes-white);
        font-size: 0.95rem;
    }

        .reportes-form-group .form-control:focus,
        .reportes-form-group .form-select:focus {
            border-color: var(--reportes-primary);
            box-shadow: 0 0 0 0.2rem rgba(75, 28, 164, 0.15);
            outline: none;
        }

/* ============================================
   TABLAS RESPONSIVAS (MODO DESKTOP)
   ============================================ */
.reportes-table-container {
    overflow-x: auto;
    border-radius: var(--reportes-radius-md);
    box-shadow: var(--reportes-shadow-sm);
    margin-top: 1rem;
    -webkit-overflow-scrolling: touch;
}

.reportes-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0;
    font-size: 0.9rem;
}

    .reportes-table thead tr {
        background: var(--reportes-gradient-primary);
        color: white;
    }

    .reportes-table thead th {
        padding: 0.875rem 1rem;
        text-align: left;
        font-weight: 600;
        border: none;
        white-space: nowrap;
        font-size: 0.875rem;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }

        .reportes-table thead th:first-child {
            border-top-left-radius: var(--reportes-radius-md);
        }

        .reportes-table thead th:last-child {
            border-top-right-radius: var(--reportes-radius-md);
        }

    .reportes-table tbody tr {
        transition: var(--reportes-transition);
        border-bottom: 1px solid #f0f0f0;
        background: white;
    }

        .reportes-table tbody tr:hover {
            background: var(--reportes-light);
            transform: translateX(2px);
        }

    .reportes-table tbody td {
        padding: 0.875rem 1rem;
        color: #333;
    }

/* ============================================
   TOTALES MODERNOS - ELIMINAMOS .table-dark
   ============================================ */
.reportes-total-row {
    background: var(--reportes-total-gradient) !important;
    border-top: 3px solid var(--reportes-total-border) !important;
    border-bottom: 3px solid var(--reportes-total-border) !important;
    font-weight: 700 !important;
}

    .reportes-total-row td {
        padding: 1rem !important;
        color: var(--reportes-primary-dark) !important;
        font-size: 1rem !important;
        vertical-align: middle;
    }

    .reportes-total-row:hover {
        background: #e0ebff !important;
        box-shadow: 0 2px 8px rgba(75, 28, 164, 0.2);
    }

/* ============================================
   ?? CARDS MODERNAS PARA MÓVIL
   ============================================ */
.reportes-cards-mobile {
    display: none;
}

.reportes-card {
    background: white;
    border-radius: var(--reportes-radius-lg);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--reportes-shadow-card);
    border: 1px solid var(--reportes-card-border);
    transition: var(--reportes-transition);
    animation: fadeInUp 0.3s ease;
}

    .reportes-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--reportes-shadow-lg);
    }

.reportes-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--reportes-primary);
    margin-bottom: 1rem;
}

.reportes-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--reportes-primary);
    margin: 0;
}

.reportes-card-badge {
    background: var(--reportes-gradient-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.reportes-card-body {
    display: grid;
    gap: 0.75rem;
}

.reportes-card-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

    .reportes-card-field:last-child {
        border-bottom: none;
    }

.reportes-card-label {
    font-weight: 600;
    color: #666;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reportes-card-value {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
    text-align: right;
}

    .reportes-card-value.highlight {
        color: var(--reportes-primary);
        font-size: 1.1rem;
    }

/* Card Total Especial */
.reportes-card-total {
    background: var(--reportes-total-gradient);
    border: 3px solid var(--reportes-total-border);
    padding: 1.5rem;
    margin-top: 1rem;
}

    .reportes-card-total .reportes-card-title {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    .reportes-card-total .reportes-card-value {
        font-size: 1.3rem;
        color: var(--reportes-primary-dark);
    }

/* ============================================
   RADIO BUTTONS MODERNOS
   ============================================ */
.reportes-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.reportes-radio-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: var(--reportes-light);
    border-radius: var(--reportes-radius-md);
    transition: var(--reportes-transition);
    cursor: pointer;
    border: 2px solid transparent;
}

    .reportes-radio-item:hover {
        background: rgba(102, 126, 234, 0.15);
        border-color: var(--reportes-accent);
    }

    .reportes-radio-item input[type="radio"] {
        width: 20px;
        height: 20px;
        margin-right: 0.75rem;
        cursor: pointer;
        accent-color: var(--reportes-primary);
    }

    .reportes-radio-item label {
        font-weight: 500;
        color: #333;
        cursor: pointer;
        margin: 0;
        font-size: 0.95rem;
    }

/* ============================================
   ESTADOS DE CARGA
   ============================================ */
.reportes-loading {
    text-align: center;
    padding: 2rem;
}

    .reportes-loading img {
        width: 50px;
        opacity: 0.7;
    }

/* ============================================
   SEPARADORES
   ============================================ */
.reportes-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--reportes-primary), transparent);
    margin: 2rem 0;
    border: none;
}

/* ============================================
   BOTÓN DE CIERRE
   ============================================ */
.reportes-close-btn {
    background: rgba(255, 0, 0, 0.1) !important;
    border: 2px solid var(--reportes-danger) !important;
    border-radius: 50% !important;
    width: 36px !important;
    height: 36px !important;
    transition: var(--reportes-transition) !important;
    position: absolute;
    top: 1rem;
    right: 1rem;
}

    .reportes-close-btn:hover {
        background: var(--reportes-danger) !important;
        transform: rotate(90deg) scale(1.1);
    }

    /* ============================================
       BADGES Y TOTALES
       ============================================ */
    .reportes-total-badge {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        background: var(--reportes-gradient-success);
        color: white;
        padding: 0.75rem 1.5rem;
        border-radius: var(--reportes-radius-xl);
        font-weight: 700;
        font-size: 1.1rem;
        margin: 0.75rem 0;
        box-shadow: var(--reportes-shadow-sm);
    }

    /* ============================================
       ANIMACIONES
       ============================================ */
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @keyframes slideInDown {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @keyframes pulse {
        0%, 100% {
            transform: scale(1);
        }

        50% {
            transform: scale(1.05);
        }
    }

    /* ============================================
       ?? RESPONSIVE MOBILE - MODO CARDS
       ============================================ */
    @media (max-width: 768px) {
        #reportes-page {
            padding: 1rem 0.5rem;
        }

        #reportes-navbar {
            border-radius: var(--reportes-radius-md);
            padding: 0.75rem 1rem;
        }

            #reportes-navbar .navbar-brand {
                font-size: 1.3rem;
            }

            #reportes-navbar .btn-dark {
                font-size: 0.875rem;
                padding: 0.5rem 1rem;
            }

        .reportes-header h3 {
            font-size: 1.4rem;
        }

        .reportes-container {
            padding: 1.25rem;
            margin-bottom: 1rem;
        }

        .reportes-select-group {
            grid-template-columns: 1fr;
            gap: 1rem;
        }

        /* OCULTAR TABLAS EN MÓVIL */
        .reportes-table-container {
            display: none;
        }

        /* MOSTRAR CARDS EN MÓVIL */
        .reportes-cards-mobile {
            display: block;
        }

        .reportes-btn-primary,
        .reportes-btn-secondary {
            width: 100%;
            margin-bottom: 0.75rem;
        }

        .reportes-radio-group {
            flex-direction: column;
            gap: 0.75rem;
        }

        .reportes-radio-item {
            width: 100%;
        }

        .reportes-total-badge {
            font-size: 1rem;
            padding: 0.6rem 1.25rem;
            width: 100%;
            justify-content: center;
        }

        .reportes-card {
            padding: 1rem;
        }

        .reportes-card-total {
            padding: 1.25rem;
        }
    }

    @media (max-width: 480px) {
        .reportes-header h3 {
            font-size: 1.2rem;
        }

        .reportes-card {
            padding: 0.875rem;
        }

        .reportes-card-title {
            font-size: 1rem;
        }

        .reportes-card-label,
        .reportes-card-value {
            font-size: 0.85rem;
        }

            .reportes-card-value.highlight {
                font-size: 1rem;
            }
    }

    /* ============================================
       ??? DESKTOP - OCULTAR CARDS
       ============================================ */
    @media (min-width: 769px) {
        .reportes-cards-mobile {
            display: none !important;
        }

        .reportes-table-container {
            display: block;
        }
    }

    /* ============================================
       ACCESIBILIDAD
       ============================================ */
    @media (prefers-reduced-motion: reduce) {
        *,
        *::before,
        *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }

    /* ============================================
       UTILIDADES
       ============================================ */
    .text-end {
        text-align: right !important;
    }

    .text-center {
        text-align: center !important;
    }

    .mb-4 {
        margin-bottom: 1.5rem !important;
    }

    .mt-3 {
        margin-top: 1rem !important;
    }

    .mt-5 {
        margin-top: 3rem !important;
    }

    .d-flex {
        display: flex !important;
    }

    .align-items-end {
        align-items: flex-end !important;
    }

    .position-relative {
        position: relative !important;
    }

    /* ============================================
       SCROLL SUAVE
       ============================================ */
    * {
        scroll-behavior: smooth;
    }

    ::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }

    ::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 10px;
    }

    ::-webkit-scrollbar-thumb {
        background: var(--reportes-primary);
        border-radius: 10px;
    }

        ::-webkit-scrollbar-thumb:hover {
            background: var(--reportes-primary-dark);
        }

    /* Pestañas activas */
    #reportes-navbar .btn.active {
        background-color: #6f42c1 !important;
        border-bottom: 3px solid #ffc107;
        font-weight: bold;
    }

    .reportes-tabs-content {
        padding: 2rem 0;
    }
