/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Formulario */
.form-container {
    padding: 40px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 1.1rem;
}

.form-group select,
.form-group input[type="date"] {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group select:focus,
.form-group input[type="date"]:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
    transform: translateY(-2px);
}

.btn-consultar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-consultar:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.btn-consultar:active {
    transform: translateY(-1px);
}

/* Contenedor de resultados */
.results-container {
    padding: 40px;
}

.results-container h2 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 2rem;
    font-weight: 300;
}

.results-container p {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 30px;
    border-left: 4px solid #2196f3;
}

/* Tarjetas de resumen de totales */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-5px);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.card-value {
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Tabla */
.table-container {
    overflow-x: auto;
    margin-bottom: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.9rem;
}

.results-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.results-table th {
    padding: 20px 15px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8rem;
}

.results-table td {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.results-table tbody tr:hover {
    background-color: #f8f9fa;
}

.results-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.results-table tbody tr:nth-child(even):hover {
    background-color: #f0f0f0;
}

/* Fila de totales */
.totals-row {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
    color: white !important;
    font-weight: bold;
}

.totals-row td {
    border-bottom: none !important;
    padding: 20px 15px !important;
}

/* Resumen */
.summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.summary-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s ease;
}

.summary-item:hover {
    transform: translateY(-5px);
}

.summary-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.summary-value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
}

/* Mensajes de error y sin resultados */
.no-results,
.error {
    text-align: center;
    padding: 60px 40px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 15px;
    margin: 40px;
}

.error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.no-results h3,
.error h3 {
    color: #856404;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.error h3 {
    color: #721c24;
}

.no-results p,
.error p {
    color: #856404;
    font-size: 1.1rem;
}

.error p {
    color: #721c24;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .form-container,
    .results-container {
        padding: 20px;
    }
    
    .results-table {
        font-size: 0.8rem;
    }
    
    .results-table th,
    .results-table td {
        padding: 10px 8px;
    }
    
    .summary {
        grid-template-columns: 1fr;
    }
    
    .summary-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .results-table th,
    .results-table td {
        padding: 8px 5px;
        font-size: 0.7rem;
    }
    
    .btn-consultar {
        width: 100%;
        padding: 15px;
    }
}