:root {
    /* Colores Institucionales basados en el escudo (Rojo, Amarillo, Verde) */
    --primary-color: #D32F2F; /* Rojo institucional */
    --secondary-color: #FBC02D; /* Amarillo dorado */
    --accent-color: #388E3C; /* Verde */
    
    /* Colores neutrales */
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    --border-color: #e0e0e0;
    
    --shadow: 0 4px 6px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.1);
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

/* Header */
.main-header {
    background-color: var(--card-bg);
    border-top: 5px solid var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    padding: 1.5rem 0;
    margin-bottom: 2rem;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 0 1.5rem;
}

.logo {
    width: 90px;
    height: auto;
}

.titles h1 {
    font-size: 1.4rem;
    color: var(--primary-color);
    font-weight: 700;
}

.titles h2 {
    font-size: 1.1rem;
    color: var(--text-main);
    font-weight: 600;
}

.titles h3 {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 0.2rem;
}

/* Contenedor Principal */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem 1.5rem;
}

/* Pestañas */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-icon {
    width: 24px;
    height: auto;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn:hover .tab-icon {
    opacity: 1;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-btn.active .tab-icon {
    opacity: 1;
}

/* Módulos (Secciones) */
.module {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.module.active-module {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tarjetas */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Buscador y Formularios */
.search-box, .report-box {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

input[type="text"], select {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus, select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
}

.btn-primary:hover:not(:disabled) {
    background-color: #b71c1c;
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-primary:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #2e7d32;
}

.btn-secondary:active:not(:disabled) {
    transform: scale(0.98);
}

/* Tabla de Datos */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th, .data-table td {
    padding: 0.8rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background-color: #f8f9fa;
    color: var(--text-main);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table tbody tr:hover {
    background-color: rgba(211, 47, 47, 0.04);
}

/* Resultados */
.result-card {
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.data-item {
    display: flex;
    flex-direction: column;
}

.data-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.data-value {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-main);
}

.badge {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    background-color: var(--accent-color);
    color: white;
}

/* Utilidades */
.hidden {
    display: none !important;
}

.error-msg {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #ffebee;
    color: #c62828;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-icon {
    width: 20px;
    height: auto;
}

/* Spinner Loader */
.loader {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsivo */
@media (max-width: 600px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .search-box, .report-box {
        flex-direction: column;
    }
    
    .tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tab-btn {
        justify-content: center;
    }
}
