/* --- VARIABLES Y RESET --- */
:root {
    /* Paleta Corporativa Moderna */
    --primary-color: #0f3460;   /* Azul Profundo */
    --accent-color: #e94560;    /* Rojo acento (para acciones) */
    --secondary-color: #16213e; /* Azul Oscuro */
    --bg-color: #f5f6fa;        /* Gris muy claro fondo */
    --card-bg: #ffffff;
    --text-color: #2d3436;
    --text-muted: #636e72;
    --border-color: #dfe6e9;
    
    /* Colores Funcionales */
    --input-bg: #fdfdfd;
    --input-focus: #eef2ff;
    --success-green: #00b894;
    --danger-red: #d63031;
    --highlight-yellow: #fff7d1;

    /* Espaciado y Radios */
    --radius-sm: 6px;
    --radius-md: 10px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    color: var(--text-color);
    line-height: 1.5;
}

/* --- LAYOUT PRINCIPAL --- */
.main-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    background: var(--primary-color);
    color: white;
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow-md);
}

.header-content h1 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
}

.header-content p {
    margin: 5px 0 0;
    opacity: 0.8;
    font-size: 0.9rem;
}

.app-container {
    max-width: 1280px;
    margin: 24px auto 40px; /* Overlay effect */
    padding: 0 20px;
    width: 100%;
}

/* --- NAVEGACIÓN (TABS) --- */
.tabs-nav {
    display: flex;
    overflow-x: auto;
    background: white;
    padding: 10px 10px 0;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    box-shadow: var(--shadow-sm);
    gap: 5px;
}

.tab-link {
    background: transparent;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-link:hover {
    color: var(--primary-color);
    background-color: #f8f9fa;
}

.tab-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--accent-color);
}

.content-body {
    background: white;
    padding: 30px;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-md);
    min-height: 600px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}
.active-content { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* --- COMPONENTES UI --- */
.info-banner {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 25px;
    color: #0d47a1;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.small-banner { padding: 8px 12px; font-size: 0.85rem; margin-bottom: 15px; }

.dashboard-kpi-row {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    flex: 1;
    background: white;
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    border-left: 5px solid var(--accent-color);
}

.kpi-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.kpi-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.card-panel {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    height: 100%;
    box-shadow: var(--shadow-sm);
}

/* --- TABLAS MODERNAS --- */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.shadow-table {
    box-shadow: 0 0 0 1px var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

th {
    background-color: #f1f2f6;
    color: var(--secondary-color);
    font-weight: 600;
    padding: 12px 15px;
    text-align: right;
    border-bottom: 2px solid var(--border-color);
}
th:first-child { text-align: left; }
th.center-text { text-align: center; }

td {
    padding: 0; /* Padding handled by input */
    border-bottom: 1px solid var(--border-color);
}

/* INPUTS */
.input-cell {
    width: 100%;
    border: none;
    padding: 12px 15px;
    font-family: inherit;
    font-size: 1rem;
    text-align: right;
    background-color: var(--input-bg);
    transition: background 0.2s;
}

.input-cell:focus {
    background-color: var(--input-focus);
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

.text-input-clean {
    width: 100%;
    border: none;
    background: transparent;
    padding: 12px 15px;
    font-weight: 500;
    color: var(--secondary-color);
}

.calc-cell {
    padding: 12px 15px;
    text-align: right;
    background-color: #fafafa;
    color: var(--text-muted);
}

.highlight-header { background-color: #dfe6e9; color: var(--primary-color); }
.highlight-cell { background-color: #e8f5e9; color: #2e7d32; font-weight: 700; }
.total-row { background-color: #f8f9fa; font-weight: 700; border-top: 2px solid #bdc3c7; }
.total-row td { padding: 12px 15px; }
.section-header-row td { background-color: #e9ecef; color: var(--secondary-color); font-weight: 700; font-size: 0.85rem; padding: 8px 15px; letter-spacing: 0.5px; }

/* --- CONTROLES Y BOTONES --- */
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}
.table-toolbar h3 { margin: 0; color: var(--secondary-color); font-size: 1.2rem; border: none; }

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}
.btn-primary:hover { background-color: #1a4a8d; }
.btn-primary:disabled { background-color: #b2bec3; cursor: not-allowed; }
.plus-icon { font-size: 1.2rem; line-height: 0; }

.controls-area {
    background: #f1f2f6;
    padding: 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    align-items: center;
}
.small-input { width: 80px; text-align: center; border: 1px solid var(--border-color); border-radius: 4px; padding: 5px; }

/* --- GRID SYSTEM --- */
.grid-row { display: flex; gap: 20px; flex-wrap: wrap; }
.grid-col { flex: 1; min-width: 320px; }

/* --- INDICADORES --- */
.indicators-panel { display: flex; gap: 20px; margin-top: 30px; justify-content: center; }
.indicator-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 25px;
    border-radius: var(--radius-md);
    text-align: center;
    min-width: 200px;
    box-shadow: var(--shadow-md);
}
.indicator-card h4 { margin: 0 0 10px 0; opacity: 0.9; font-weight: 400; }
.big-number { font-size: 2.2rem; font-weight: 700; display: block; margin-bottom: 5px; }

/* --- UTILS --- */
.highlight-row { background-color: #fff3cd; }
.equilibrium-zone { background-color: #d4edda !important; font-weight: bold; }

/* Estilo para botón de eliminar en tablas dinámicas */
.btn-delete {
    background: transparent;
    border: 1px solid #ff7675;
    color: #d63031;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.btn-delete:hover {
    background-color: #d63031;
    color: white;
}

/* Ajuste para botones pequeños en encabezados */
.small-btn {
    padding: 4px 10px;
    font-size: 0.8rem;
    margin-left: 10px;
}
/* --- IDENTIDAD VISUAL SERCOTEC (Header & Footer) --- */

:root {
    /* Variables extraí­das del original */
    --sercotec-blue: #004B8D;
    --sercotec-red: #CB2C30;
    --sercotec-font: 'Roboto', sans-serif;
}

/* 1. Header Styles */
.sercotec-navbar {
    background: linear-gradient(90deg, var(--sercotec-blue), #006fbf);
    color: #ffffff;
    padding: 14px 24px;
    border-bottom: 4px solid var(--sercotec-red);
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
    font-family: var(--sercotec-font);
    position: sticky;
    top: 0;
    z-index: 20;
}

.navbar-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-area {
    display: flex;
    align-items: center;
    gap: 18px;
}

.brand-logo {
    height: 52px;
    width: auto;
    object-fit: contain;
    background-color: #ffffff;
    padding: 4px 6px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}

.brand-text .main-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.brand-text .sub-title {
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.95;
}

/* 2. Footer Styles */
.sercotec-footer {
    background: #001f3f;
    color: #ffffff;
    font-family: var(--sercotec-font);
    padding: 26px 0 22px;
    margin-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.12);
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.sercotec-footer p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 300;
}

.contact-email {
    font-weight: 500;
    color: #ffd666;
    text-decoration: none;
}

.contact-email i {
    margin-right: 6px;
    color: #ffffff;
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}