/* ==========================================================================
   ESTILOS GLOBALES - VILLEGAS INGENIERÍA (PLATAFORMA FREEMIUM)
   ========================================================================== */

/* --- 1. BASE Y TIPOGRAFÍA --- */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f7f6;
    margin: 0;
    padding: 0;
    color: #333;
    line-height: 1.6;
}

* {
    box-sizing: border-box;
}

/* --- 2. BARRA DE NAVEGACIÓN (NAVBAR) --- */
.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.navbar-brand {
    font-size: 1.5em;
    font-weight: bold;
    letter-spacing: 1px;
}
.nav-buttons button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1em;
    transition: background-color 0.3s;
}
.nav-buttons button:hover {
    background-color: #2980b9;
}

/* --- 3. CABECERA Y ESTADÍSTICAS --- */
.home-header {
    text-align: center;
    padding: 40px 20px 20px 20px;
}
.home-header h1 {
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 2.5em;
}
.home-header p {
    color: #7f8c8d;
    font-size: 1.1em;
    margin-top: 0;
}
.barra-estadisticas {
    text-align: center;
    background-color: #fff;
    padding: 10px;
    margin: 0 auto 30px auto;
    max-width: 600px;
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    font-weight: bold;
    color: #555;
    border: 1px solid #ecf0f1;
}

/* --- 4. SISTEMA DE PESTAÑAS (TABS) --- */
.tabs-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    gap: 10px;
    flex-wrap: wrap;
    padding: 0 20px;
}
.tab-btn {
    background-color: #e0e6ed;
    color: #2c3e50;
    border: none;
    padding: 12px 25px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
}
.tab-btn:hover {
    background-color: #bdc3c7;
}
.tab-btn.active {
    background-color: #d35400;
    color: white;
    box-shadow: 0 4px 6px rgba(211, 84, 0, 0.3);
}
.tab-content {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}
.tab-content.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- 5. ESTRUCTURA PRINCIPAL (LAYOUT) Y PUBLICIDAD --- */
.layout-principal {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    gap: 20px;
}
.centro-pagina {
    flex: 1;
    min-width: 0; 
}
.ad-lateral {
    width: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.ad-banner-horizontal, .ad-banner-module {
    width: 100%;
    text-align: center;
    margin: 20px 0;
    background-color: #eaeded;
    border: 1px dashed #bdc3c7;
    padding: 10px;
    min-height: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.ad-placeholder {
    color: #95a5a6;
    font-size: 0.8em;
}

/* --- 6. TARJETAS DE MÓDULOS (GRID) --- */
.categoria-titulo {
    border-bottom: 3px solid;
    padding-bottom: 10px;
    margin-top: 40px;
    margin-bottom: 20px;
}
.grid-modulos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.tarjeta-modulo {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #ecf0f1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.tarjeta-modulo:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}
.tarjeta-modulo h2 {
    margin-top: 0;
    font-size: 1.4em;
    margin-bottom: 10px;
}
.tarjeta-modulo p {
    color: #7f8c8d;
    font-size: 0.95em;
    margin-bottom: 20px;
    flex-grow: 1;
}

/* --- 7. BOTONES MAESTROS --- */
.btn-entrar {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-gratis {
    background-color: #27ae60 !important;
    color: #ffffff !important;
}
.btn-gratis:hover {
    background-color: #2ecc71 !important;
}

.btn-pro {
    background-color: #f39c12 !important;
    color: #ffffff !important;
}
.btn-pro:hover {
    background-color: #f1c40f !important;
}

.btn-disabled {
    background-color: #95a5a6 !important;
    color: #ffffff !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}

.btn-volver {
    background-color: #34495e !important;
    color: #ffffff !important;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 15px;
    transition: 0.3s;
}
.btn-volver:hover {
    background-color: #2c3e50 !important;
    color: #f39c12 !important; 
}

.btn-flotante {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #f39c12;
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 50px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: 0.3s;
    z-index: 999;
}
.btn-flotante:hover {
    background-color: #e67e22;
    transform: scale(1.05);
}

/* --- 8. VENTANAS MODALES --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
}
.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 450px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: modalScale 0.3s;
}
@keyframes modalScale {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: 0.2s;
}
.close:hover {
    color: #c0392b;
}

.form-group {
    margin-bottom: 15px;
    text-align: left;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #2c3e50;
}
.form-group input, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #bdc3c7;
    border-radius: 5px;
    font-size: 1em;
    font-family: inherit;
}
.btn-submit {
    width: 100%;
    padding: 12px;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    transition: 0.3s;
}
.btn-disabled-pago {
    background-color: #95a5a6 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

/* --- 9. DISEÑO INTERNO DE LAS CALCULADORAS --- */
.contenedor {
    max-width: 1200px;
    margin: 30px auto;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.panel-control {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}
.caja-accion {
    flex: 1;
    min-width: 280px;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ecf0f1;
    display: flex;
    flex-direction: column;
}
.caja-accion h3 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 2px solid #bdc3c7;
    padding-bottom: 8px;
}
.btn-accion {
    display: inline-block;
    color: white;
    padding: 12px;
    text-align: center;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    border: none;
    width: 100%;
    margin-top: auto;
    transition: 0.3s;
}
.btn-cargar { background-color: #3498db; }
.btn-cargar:hover { background-color: #2980b9; }
.btn-excel { background-color: #27ae60; font-size: 1.1em; margin-top: 20px; padding: 15px;}
.btn-excel:hover { background-color: #2ecc71; }

.ajustes-caja {
    padding: 15px;
    border-radius: 5px;
    font-size: 0.95em;
    margin-bottom: 10px;
}

/* --- 10. TABLAS DE RESULTADOS --- */
#area-resultados {
    display: none;
    animation: fadeIn 0.5s;
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 0.95em;
    background-color: #fff;
}
th, td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    text-align: left;
}
th {
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9em;
}
tr:nth-child(even) { background-color: #f8f9fa; }
tr:hover { background-color: #f1f4f5; }

.subtotal-desglose td { font-weight: bold; color: #555; }
.subtotal-row td { font-weight: bold; font-size: 1.05em; }
.total-row td { color: white; font-weight: bold; font-size: 1.2em; }
.kpi-row td { background-color: #fdf2e9; color: #d35400; font-weight: bold; font-size: 1.1em; }
.badge-modo {
    display: inline-block;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
    margin-bottom: 15px;
}

/* --- 11. RESPONSIVE (MÓVILES) --- */
@media (max-width: 900px) {
    .layout-principal { flex-direction: column; }
    .ad-lateral { width: 100%; height: auto; min-height: 100px; flex-direction: row; justify-content: center;}
    .ad-lateral ins { width: 320px !important; height: 100px !important; }
}
@media (max-width: 768px) {
    .navbar { flex-direction: column; gap: 10px; text-align: center; }
    .panel-control { flex-direction: column; }
    .home-header h1 { font-size: 2em; }
    th, td { padding: 8px 10px; font-size: 0.85em; }
    .btn-flotante { padding: 12px 15px; font-size: 1em; }
}

/* ==========================================================================
   INYECCIÓN DE AUDITORÍA: ESTÁNDAR VISUAL VILLEGAS INGENIERÍA
   ========================================================================== */
.subtotal-row { 
    background-color: #f2f3f4 !important; 
}
.subtotal-row td { 
    font-weight: bold !important; 
    color: #1a5276 !important; 
}
.total-row { 
    background-color: #d35400 !important; 
}
.total-row td { 
    color: #ffffff !important; 
    font-weight: bold !important; 
    font-size: 1.15em !important; 
}
.kpi-row { 
    background-color: #f9e79f !important; 
}
.kpi-row td { 
    color: #000000 !important; 
    font-weight: bold !important; 
    font-size: 1.1em !important; 
    border-top: 2px solid #f1c40f !important; 
}