/* ========================================================================
   CSS VARIABLES (DESIGN TOKENS)
   ======================================================================== */
:root {
    /* Colores Principales */
    --color-primary: #667eea;
    --color-primary-dark: #764ba2;
    --color-success: #28a745;
    --color-success-light: #2ecc71;
    --color-success-dark: #27ae60;
    --color-danger: #dc3545;
    --color-danger-light: #e74c3c;
    --color-danger-dark: #c0392b;
    --color-warning: #ffc107;
    --color-warning-light: #ffeb3b;
    --color-warning-dark: #ff9800;
    --color-info: #17a2b8;
    --color-info-light: #3498db;
    --color-info-dark: #2980b9;
    
    /* Colores de Texto */
    --text-primary: #333;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --text-light: #495057;
    
    /* Colores de Fondo */
    --bg-primary: #f8f9fa;
    --bg-secondary: #e9ecef;
    --bg-white: #ffffff;
    --bg-light: #f1f3f4;
    
    /* Gradientes Principales */
    --gradient-primary: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    --gradient-success: linear-gradient(135deg, var(--color-success-dark), var(--color-success-light));
    --gradient-danger: linear-gradient(135deg, var(--color-danger-light), var(--color-danger-dark));
    --gradient-info: linear-gradient(135deg, var(--color-info-light), var(--color-info-dark));
    
    /* Espaciados */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 20px;
    --spacing-xl: 30px;
    --spacing-2xl: 40px;
    
    /* Breakpoints */
    --bp-mobile: 360px;
    --bp-small: 480px;
    --bp-tablet: 768px;
    --bp-desktop: 1024px;
    --bp-large: 1200px;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 15px;
    
    /* Sombras */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 4px 15px rgba(102, 126, 234, 0.15);
    
    /* Transiciones */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Tipografía */
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.85rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.1rem;
    --font-size-xl: 1.3rem;
    --font-size-2xl: 1.5rem;
}

/* ========================================================================
   COMPONENTES CSS MODULARES (DESIGN SYSTEM)
   ======================================================================== */

/* SISTEMA DE BOTONES */
.btn {
    /* Base button styles */
    padding: var(--spacing-md) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    text-decoration: none;
    font-family: var(--font-family);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    
    /* Estados base */
    &:focus {
        outline: 2px solid var(--color-primary);
        outline-offset: 2px;
    }
    
    &:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        pointer-events: none;
    }
}

/* Variantes de color */
.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-sm);
    
    &:hover:not(:disabled) {
        transform: translateY(-1px);
        box-shadow: var(--shadow-lg);
    }
    
    &:active {
        transform: translateY(0);
    }
}

.btn-success {
    background: var(--gradient-success);
    color: white;
    
    &:hover:not(:disabled) {
        filter: brightness(1.1);
    }
}

.btn-danger {
    background: var(--gradient-danger);
    color: white;
    
    &:hover:not(:disabled) {
        filter: brightness(1.1);
    }
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--bg-secondary);
    
    &:hover:not(:disabled) {
        background: var(--color-primary);
        color: white;
    }
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    
    &:hover:not(:disabled) {
        background: var(--color-primary);
        color: white;
    }
}

.btn-link {
    background: transparent;
    color: var(--color-primary);
    padding: var(--spacing-xs) var(--spacing-sm);
    text-decoration: underline;
    
    &:hover:not(:disabled) {
        color: var(--color-primary-dark);
        text-decoration: none;
    }
}

/* Tamaños de botón */
.btn-sm {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-sm);
}

.btn-lg {
    padding: var(--spacing-lg) var(--spacing-2xl);
    font-size: var(--font-size-lg);
}

.btn-block {
    width: 100%;
}

/* SISTEMA DE CARDS */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition-normal);
    
    &:hover {
        box-shadow: var(--shadow-lg);
        transform: translateY(-2px);
    }
}

.card-header {
    padding: var(--spacing-lg);
    background: var(--gradient-primary);
    color: white;
    
    h3, h4 {
        margin: 0;
        font-weight: 600;
    }
}

.card-body {
    padding: var(--spacing-lg);
}

.card-footer {
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-light);
    border-top: 1px solid var(--bg-secondary);
}

/* SISTEMA DE TABLAS */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    
    thead {
        background: var(--gradient-primary);
        color: white;
    }
    
    th {
        padding: var(--spacing-md) var(--spacing-lg);
        text-align: left;
        font-weight: 600;
        font-size: var(--font-size-sm);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    td {
        padding: var(--spacing-md) var(--spacing-lg);
        border-bottom: 1px solid var(--bg-secondary);
        
        &:first-child {
            font-weight: 500;
        }
    }
    
    tbody tr {
        transition: var(--transition-fast);
        
        &:hover {
            background: var(--bg-light);
        }
        
        &:nth-child(even) {
            background: rgba(0,0,0,0.02);
        }
    }
}

.table-sm {
    th, td {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: var(--font-size-sm);
    }
}

.table-responsive {
    overflow-x: auto;
    
    @media (max-width: 768px) {
        font-size: var(--font-size-xs);
        
        th, td {
            padding: var(--spacing-xs);
            white-space: nowrap;
        }
    }
}

/* SISTEMA DE FORMULARIOS */
.form-group {
    margin-bottom: var(--spacing-lg);
    
    label {
        display: block;
        margin-bottom: var(--spacing-xs);
        font-weight: 500;
        color: var(--text-primary);
    }
    
    .form-control {
        width: 100%;
        padding: var(--spacing-sm) var(--spacing-md);
        border: 2px solid var(--bg-secondary);
        border-radius: var(--radius-md);
        font-size: var(--font-size-md);
        transition: var(--transition-fast);
        background: var(--bg-white);
        
        &:focus {
            outline: none;
            border-color: var(--color-primary);
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }
        
        &:invalid {
            border-color: var(--color-danger);
        }
    }
}

/* SISTEMA DE ALERTAS/BADGES */
.alert {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    border-left: 4px solid;
    margin: var(--spacing-md) 0;
    
    &.alert-success {
        background: rgba(46, 204, 113, 0.1);
        border-left-color: var(--color-success);
        color: var(--color-success-dark);
    }
    
    &.alert-danger {
        background: rgba(231, 76, 60, 0.1);
        border-left-color: var(--color-danger);
        color: var(--color-danger-dark);
    }
    
    &.alert-info {
        background: rgba(52, 152, 219, 0.1);
        border-left-color: var(--color-info);
        color: var(--color-info-dark);
    }
}

.badge {
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    
    &.badge-primary {
        background: var(--color-primary);
        color: white;
    }
    
    &.badge-success {
        background: var(--color-success);
        color: white;
    }
    
    &.badge-danger {
        background: var(--color-danger);
        color: white;
    }
}

/* SISTEMA DE LAYOUT */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -var(--spacing-sm);
}

.col {
    flex: 1;
    padding: 0 var(--spacing-sm);
}

.col-2 { flex: 0 0 calc(16.666% - var(--spacing-md)); }
.col-3 { flex: 0 0 calc(25% - var(--spacing-md)); }
.col-4 { flex: 0 0 calc(33.333% - var(--spacing-md)); }
.col-6 { flex: 0 0 calc(50% - var(--spacing-md)); }
.col-8 { flex: 0 0 calc(66.666% - var(--spacing-md)); }
.col-12 { flex: 0 0 calc(100% - var(--spacing-md)); }

/* UTILIDADES */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* Reset y Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden; /* Evitar scroll horizontal innecesario */
}

/* ========================================================================
   EVM CHART STYLES
   ======================================================================== */

.evm-chart-container {
    margin: 20px 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 100% !important; /* Aprovechar todo el ancho disponible */
    max-width: none !important; /* Sin restricciones de ancho máximo */
}

/* Estilos para el canvas del gráfico EVM */
#evmChart {
    width: 100% !important;
    height: 500px !important; /* Altura aumentada para mejor aprovechamiento */
    max-width: none !important;
}

.evm-chart-container .chart-container {
    padding: 15px; /* Menos padding para más espacio útil */
    width: 100% !important;
    position: relative;
    height: 550px; /* Altura del contenedor aumentada */
}

.evm-chart-header {
    padding: var(--spacing-lg);
    background: var(--gradient-primary);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.evm-chart-header h3 {
    margin: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.evm-chart-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

/* Estilos para los botones de exportación discretos */
.evm-chart-controls .btn {
    padding: 6px 12px;
    font-size: 0.875rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.evm-chart-controls .btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.evm-chart-controls .btn i {
    margin-right: 6px;
}

.chart-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chart-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.chart-toggle.active {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border-color: #fff;
}

.color-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.pv-color { background-color: rgb(54, 162, 235); }     /* Azul */
.ac-color { background-color: rgb(255, 99, 132); }     /* Rojo */
.ev-color { background-color: rgb(75, 192, 192); }     /* Verde */
.val-color { background-color: rgb(255, 159, 64); }    /* Naranja - Valorizaciones */
.etc-color { background-color: rgb(255, 99, 132); }   /* Rojo - Estimate To Complete (igual que AC) */
.eti-color { background-color: rgb(75, 192, 192); }   /* Verde azulado - Estimate To Income (continúa EV) */

.evm-chart-content {
    padding: var(--spacing-lg);
    height: 550px;  /* Aumentado de 450px a 550px para más altura */
    position: relative;
}

.evm-chart-content canvas {
    transition: opacity 0.3s ease;
}

.evm-chart-legend {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #666;
}

.legend-icon {
    width: 16px;
    height: 3px;
    border-radius: 2px;
}

.pv-icon { background-color: rgb(255, 99, 132); }
.ac-icon { background-color: rgb(255, 159, 64); }
.ev-icon { background-color: rgb(75, 192, 192); }
.cutoff-icon { 
    background: repeating-linear-gradient(
        90deg,
        rgb(153, 102, 255) 0px,
        rgb(153, 102, 255) 4px,
        transparent 4px,
        transparent 8px
    );
}

/* Responsive para dispositivos móviles */
@media (max-width: 768px) {
    .evm-chart-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .evm-chart-controls {
        justify-content: center;
    }
    
    .chart-toggle {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
    
    .evm-chart-content {
        height: 350px;
        padding: 15px;
    }
    
    .evm-chart-legend {
        grid-template-columns: 1fr;
        padding: 10px 15px;
    }
}

/* ========================================================================
   DATE SELECTOR COMPONENT STYLES
   ======================================================================== */

.controls-main-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.controls-secondary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.date-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 10px 15px;
    border-radius: 6px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.date-selector label {
    font-weight: 500;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.date-selector label i {
    color: #007bff;
}

.date-input {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    color: #495057;
    background-color: #fff;
    transition: all 0.2s ease;
    min-width: 150px;
}

.date-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.date-input.success {
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.25);
}

.date-input.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
}

.date-input.warning {
    border-color: #ffc107;
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.25);
}

.date-help {
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
    white-space: nowrap;
}

.date-help.error {
    color: #dc3545;
    font-weight: 500;
}

.date-help.warning {
    color: #856404;
    font-weight: 500;
}

.view-toggle {
    display: flex;
    align-items: center;
}

.toggle-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.toggle-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

.toggle-btn:active {
    transform: translateY(0);
}

.toggle-btn i {
    font-size: 14px;
}

.date-display {
    font-size: 12px;
    color: #6c757d;
    font-weight: normal;
}

.date-display span {
    color: #495057;
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .controls-main-row {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .date-selector {
        justify-content: center;
    }
    
    .view-toggle {
        justify-content: center;
    }
    
    .controls-secondary-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .partidas-stats {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .date-selector {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .date-input {
        min-width: auto;
        width: 100%;
    }
}

/* Pantalla de Login */
.login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
    border-radius: 12px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.login-header h1 {
    color: #4a5568;
    font-size: 2rem;
    margin-bottom: 5px;
}

.login-header h1 i {
    color: var(--color-primary);
    margin-right: var(--spacing-sm);
}

.login-header p {
    color: #718096;
    font-size: 1rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.form-group {
    display: block;
    width: 100%;
    margin-bottom: 20px;
}

.form-group label {
    color: #4a5568;
    font-weight: normal;
    margin-bottom: 8px;
    display: block;
    width: 100%;
    text-align: left;
}

.form-group label i {
    margin-right: 8px;
    color: #a0aec0;
}

.form-group input {
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    width: 100%;
    box-sizing: border-box;
    display: block;
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.login-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: var(--font-size-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    margin-top: 15px;
}

/* Panel Principal */
.main-panel {
    min-height: 100vh;
    background: #f7fafc;
}

/* Header */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left h1 {
    color: #4a5568;
    font-size: 1.5rem;
}

.header-left h1 i {
    color: #667eea;
    margin-right: 10px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    color: #4a5568;
    font-weight: 500;
}

.logout-btn {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logout-btn:hover {
    background: #c53030;
}

/* Navegación */
.main-nav {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 30px;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 0;
}

.nav-item {
    position: relative;
}

.nav-item a {
    text-decoration: none;
    color: #4a5568;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-item a:hover,
.nav-item.active a {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* Contenido Principal */
.main-content {
    padding: 20px;
    max-width: none; /* Permitir ancho completo para tablas */
    margin: 0 auto;
    width: 100%;
    position: relative;
}

/* Permitir ancho extra cuando el módulo de análisis de proyectos está activo */
body.analisis-proyectos-active .main-content {
    max-width: 1900px !important; /* Permitir contenedor más ancho para partidas */
    width: 100% !important;
}

/* Configuración específica para el módulo de análisis de programación */
body.analisis-programacion-active .main-content {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    position: relative;
}

/* Scroll automático hacia arriba cuando Análisis de Programación está activo */
body.analisis-programacion-active {
    scroll-behavior: smooth;
}

body.analisis-programacion-active #analisisProgramacion {
    scroll-margin-top: 0;
}

/* Ocultar otros módulos cuando Análisis de Programación está activo */
body.analisis-programacion-active #controlProyectos,
body.analisis-programacion-active #planningStatus,
body.analisis-programacion-active #uploadObra,
body.analisis-programacion-active #presupuestos,
body.analisis-programacion-active #reportes,
body.analisis-programacion-active #configuracion {
    display: none !important;
}

/* Cuando Upload Obra está activo, ocultar el main-content normal */
body:has(#uploadObra[style*="display: block"]) .main-content {
    visibility: hidden !important;
}

/* Asegurar que uploadObra se centre correctamente cuando está activo */
#uploadObra {
    display: none;
    max-width: 1700px; /* Permitir ancho suficiente para tablas de 1700px */
    margin: 0 auto;
    padding: 20px;
    width: 100%;
    position: relative;
}

/* Cuando uploadObra está visible (sin depender de .active), debe tener centrado completo */
#uploadObra[style*="display: block"] {
    max-width: 1900px !important; /* Permitir ancho suficiente para tablas de 1700px */
    margin: 0 auto !important;
    padding: 20px;
    position: relative;
    width: 100%;
}

/* Estilos específicos para módulos de contenido */
.module-content {
    position: relative;
    width: 100%;
    min-height: 0; /* Asegurar que no hay altura mínima forzada */
}

/* Expandir completamente cuando está en Upload Obra */
/* SOLO cuando está dentro de Upload Obra - SIN afectar otros módulos */
#uploadObra .main-content {
    max-width: 1900px !important; /* Permitir ancho suficiente para tablas de 1700px */
    width: 100% !important;
    margin: 0 auto;
    padding: 20px;
    text-align: left;
}

/* Contenedor específico para tablas anchas */
.wide-table-content {
    width: 100% !important;
    max-width: none !important;
    margin: 0 auto !important; 
    padding: 20px !important;
    box-sizing: border-box;
    overflow-x: auto !important;
    overflow-y: auto !important;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.wide-table-content .data-table {
    width: 1600px !important; /* Reducido de 1700px a 1600px */
    min-width: 1600px !important;
    table-layout: fixed !important;
    margin: 0 auto !important; /* Centrar la tabla */
    display: table !important;
}

/* ESPECÍFICO para Upload Obra - Centrar tabla dentro de validation-results */
#uploadObra .wide-table-content,
.validation-results .wide-table-content {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    overflow-x: auto !important;
    padding: 15px !important;
}

/* Clase para forzar modo pantalla completa */
.full-screen-table {
    position: fixed !important;
    top: 55px !important; /* Altura del navbar actualizada */
    left: 0 !important;
    width: 100vw !important;
    height: calc(100vh - 55px) !important; /* Altura del navbar actualizada */
    z-index: 1000 !important;
    background: white !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

/* Cuando está en modo full screen, ocultar el resto del contenido */
body.table-full-screen .main-content > *:not(.validation-results) {
    display: none !important;
}

.module-content {
    display: none;
}

.module-content.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Forzar específicamente el módulo Upload Obra */
#uploadObra.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    max-width: 1900px !important; /* Permitir ancho suficiente para tablas de 1700px */
    width: 100% !important;
    margin: 0 auto !important;
    text-align: center;
    padding: 20px;
}

/* Expandir el contenedor cuando tiene tablas de validación */
#uploadObra .validation-results,
#uploadObra .data-tables {
    width: 100% !important;
    max-width: none !important;
}

/* Expandir todos los contenedores anidados en Upload Obra */
#uploadObraView,
#upload-obra-content,
#uploadObra .partidas-view {
    width: 100% !important;
    max-width: 1900px !important; /* Permitir ancho suficiente para tablas de 1700px */
    margin: 0 auto !important;
    padding: 20px !important;
}

/* Selección de Proyecto */
.section-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.section-header h2 {
    color: #4a5568;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.back-btn {
    background: #4299e1;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.back-btn:hover {
    background: #3182ce;
}

.proyecto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.proyecto-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.proyecto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.proyecto-card h3 {
    color: #4a5568;
    font-size: 1.2rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.proyecto-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.proyecto-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #718096;
    font-size: 0.9rem;
}

.proyecto-info-item i {
    color: #667eea;
    width: 16px;
}

/* Vista de Partidas */
.partidas-controls {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

/* ================================================
   CONTROLES DE BÚSQUEDA Y EXPORTACIÓN DE PARTIDAS
   ================================================ */

.search-export-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.search-container {
    flex: 1;
    position: relative;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 12px 45px 12px 40px;
    border: 2px solid #ced4da;
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.25), inset 0 2px 4px rgba(0,0,0,0.05);
    background: #fff;
}

.search-input::placeholder {
    color: #6c757d;
    font-style: italic;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 16px;
    pointer-events: none;
}

.clear-search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: none;
}

.clear-search-btn:hover {
    background: #e9ecef;
    color: #495057;
}

/* Mostrar botón de limpiar cuando hay texto */
.search-input:not([value=""]) ~ .clear-search-btn,
.search-input:not(:placeholder-shown) ~ .clear-search-btn {
    display: block;
}

.export-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(40,167,69,0.3);
    white-space: nowrap;
}

.export-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40,167,69,0.4);
}

.export-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(40,167,69,0.3);
}

.export-btn i {
    margin-right: 8px;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .search-export-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-container {
        max-width: 100%;
    }
    
    .export-btn {
        width: 100%;
        text-align: center;
    }
}

/* Control de Fecha de Corte EVM - Versión Mejorada */
.fecha-corte-evm-container {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px solid #667eea;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
    overflow: hidden;
}

.fecha-corte-header {
    background: var(--gradient-primary);
    color: white;
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 2px solid #5a67d8;
}

.fecha-corte-header h3 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.fecha-corte-header p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 400;
}

.fecha-corte-control {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.fecha-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 250px;
}

.fecha-input-group label {
    font-weight: 600;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    white-space: nowrap;
}

.fecha-input-group input[type="date"] {
    padding: 10px 15px;
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    font-size: 1rem;
    color: #2d3748;
    background: white;
    transition: all 0.3s ease;
    min-width: 160px;
}

.fecha-input-group input[type="date"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.fecha-info-group {
    display: flex;
    align-items: center;
    color: #718096;
    font-size: 0.9rem;
    flex: 1;
    justify-content: center;
}

.fecha-actual {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
}

.fecha-actual strong {
    color: #2d3748;
}

.btn-aplicar-fecha {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.3);
    min-width: 160px;
    justify-content: center;
}

.btn-aplicar-fecha:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.4);
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
}

.btn-aplicar-fecha:active {
    transform: translateY(0);
}

/* Responsive para el control de fecha de corte */
@media (max-width: 768px) {
    .fecha-corte-control {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .fecha-input-group,
    .fecha-info-group {
        flex: none;
        justify-content: flex-start;
    }
    
    .fecha-info-group {
        justify-content: center;
    }
    
    .btn-aplicar-fecha {
        width: 100%;
    }
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
}

.partidas-stats {
    display: flex;
    gap: 30px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.stat-value {
    color: #4a5568;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Tabla de Partidas - Solución simple para sticky header */
.partidas-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-height: 70vh;
    overflow: auto;
    position: relative;
}

#partidasTable {
    width: 100%;
    min-width: 1200px;
    border-collapse: collapse;
    background: white;
}

#partidasTable thead th {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    background: #6366f1;
    color: white;
    z-index: 10;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.partidas-table th {
    padding: var(--spacing-md) var(--spacing-lg);
    text-align: left;
    font-weight: 600;
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #4f46e5; /* Mismo color sólido para las celdas th */
    border-bottom: 2px solid rgba(255, 255, 255, 0.2); /* Separador sutil */
}

/* Efecto de sombra cuando se hace scroll - se activa dinámicamente */
.partidas-table-container.scrolled #partidasTable thead {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    transition: box-shadow 0.3s ease;
}

/* Reglas adicionales para sobreescribir cualquier CSS que pueda interferir */
table#partidasTable thead {
    position: sticky !important;
    top: 0 !important;
    background: #4f46e5 !important;
    z-index: 1000 !important;
}

table#partidasTable thead tr {
    position: sticky !important;
    top: 0 !important;
    background: #4f46e5 !important;
    z-index: 1000 !important;
}

table#partidasTable thead tr th {
    position: sticky !important;
    top: 0 !important;
    background: #4f46e5 !important;
    color: white !important;
    z-index: 1000 !important;
}

/* Configuración de las celdas th generales para compatibilidad */
.partidas-table th {
    padding: var(--spacing-md) var(--spacing-lg);
    text-align: left;
    font-weight: 600;
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #4f46e5; /* Mismo color sólido para las celdas th */
    color: white;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2); /* Separador sutil */
    border-right: 1px solid rgba(255, 255, 255, 0.1); /* Separador entre columnas */
}

/* Mejorar la apariencia del scroll en el contenedor */
.partidas-table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.partidas-table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.partidas-table-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.partidas-table-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Indicador visual para mostrar que hay scroll disponible */
.partidas-table-container::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 30px;
    background: linear-gradient(to bottom, transparent 0%, #007bff 50%, transparent 100%);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.partidas-table-container:hover::after {
    opacity: 0.6;
}

.partidas-table td {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--bg-secondary);
}

.partidas-table td:first-child {
    font-weight: 500;
}

.partidas-table tbody tr {
    transition: var(--transition-fast);
}

.partidas-table tbody tr:hover {
    background: var(--bg-light);
}

.partidas-table tbody tr:nth-child(even) {
    background: rgba(0,0,0,0.02);
}

/* Especializaciones para partidas */
.partidas-table .currency {
    text-align: right;
    font-weight: 600;
    color: var(--color-success-dark);
}

.partidas-table .percentage {
    text-align: center;
    font-weight: 500;
}

.partidas-table .percentage.positive {
    color: var(--color-success);
}

.partidas-table .percentage.negative {
    color: var(--color-danger);
}

/* Filas clickeables */
.partidas-table tbody tr.partida-clickeable {
    cursor: pointer;
    position: relative;
    transition: var(--transition-fast);
}

.partidas-table tbody tr.partida-clickeable:hover {
    background: var(--bg-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.partidas-table tbody tr.partida-clickeable:active,
.partidas-table tbody tr.partida-clickeable.clicking {
    background-color: var(--color-primary) !important;
    color: white;
}

.partidas-table tbody tr.partida-clickeable.clicking td {
    color: white !important;
}

.partidas-table tbody tr.partida-clickeable::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--color-primary);
    opacity: 0;
    transition: var(--transition-fast);
}

.partidas-table tbody tr.partida-clickeable:hover::before {
    opacity: 1;
}

/* ========================================================================
   TOOLTIP PARA PARTIDAS
   ======================================================================== */
.partidas-table tbody tr.partida-clickeable.clicking {
    background-color: var(--color-primary) !important;
    color: white;
}

.partidas-table tbody tr.partida-clickeable.clicking td {
    color: white !important;
}

/* Tooltip para partidas */
.partidas-table tbody tr.partida-clickeable {
    position: relative;
}

.partidas-table tbody tr.partida-clickeable[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: fadeInTooltip 0.3s ease;
}

@keyframes fadeInTooltip {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Responsivo para dispositivos móviles */
@media (max-width: 768px) {
    .partidas-table tbody tr.partida-clickeable::before {
        display: none;
    }
    
    .partidas-table tbody tr.partida-clickeable:hover {
        transform: none;
    }
    
    .partidas-table tbody tr.partida-clickeable[title]:hover::after {
        display: none;
    }
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.spinner i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 15px;
}

.spinner p {
    color: #4a5568;
    font-weight: 500;
}

/* Estilos para mensajes de estado */
.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
    font-size: 1.1rem;
}

.no-data i {
    font-size: 4rem;
    color: #e2e8f0;
    margin-bottom: 20px;
    display: block;
}

.no-data p {
    margin: 0;
    font-weight: 500;
}

/* Botón de exportar */
.export-btn {
    background: #38a169;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.export-btn:hover {
    background: #2f855a;
}

/* Indicadores de conexión */
.connection-status {
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 5px;
}

.connection-status.online {
    background: #38a169;
    color: white;
}

.connection-status.offline {
    background: #e53e3e;
    color: white;
}

.connection-status.demo {
    background: #d69e2e;
    color: white;
}

/* Mejoras en la tabla */
.partidas-table tbody tr.highlight {
    background-color: #e6fffa !important;
    border-left: 4px solid #38a169;
}

.partidas-table .codigo {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #4a5568;
}

.partidas-table .tipo {
    font-weight: 500;
    color: #667eea;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
    }
    
    .main-nav {
        padding: 0 20px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .proyecto-grid {
        grid-template-columns: 1fr;
    }
    
    .partidas-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .partidas-stats {
        justify-content: space-around;
    }
    
    .partidas-table-container {
        overflow-x: auto;
    }
    
    .partidas-table {
        min-width: 800px;
    }
    
    .connection-status {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 10px;
    }
}

/* Estilos para el selector de proyectos */
.proyecto-selection-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.proyecto-select {
    width: 100%;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    background: white;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.3s ease;
}

.proyecto-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.proyecto-select option {
    padding: 10px;
}

.proyecto-info {
    margin-top: 20px;
}

.info-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.info-card h3 {
    color: #2d3748;
    font-size: 1.5rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.info-card h3 i {
    color: #667eea;
    margin-right: 10px;
}

.info-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-item .label {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item .value {
    color: #2d3748;
    font-size: 1rem;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-light);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-primary);
}

#verPartidas {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: var(--font-size-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#verPartidas:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

#verPartidas:active {
    transform: translateY(0);
}

/* Responsive para selector de proyectos */
@media (max-width: 768px) {
    .proyecto-selection-container {
        padding: 15px;
    }
    
    .info-details {
        grid-template-columns: 1fr;
    }
    
    .info-card {
        padding: 20px;
    }
}

/* === BARRA DE MENÚ SUPERIOR COMPACTA === */
.main-navbar {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    color: white;
    padding: 0 15px; /* Reducido de 20px a 15px */
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 55px; /* Reducido de 70px a 55px */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.navbar-logo {
    width: 32px; /* Reducido de 40px a 32px */
    height: 32px; /* Reducido de 40px a 32px */
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.navbar-brand i {
    margin-right: 10px;
    color: #667eea;
}

.navbar-menu {
    display: flex;
    gap: 5px;
    flex: 1;
    justify-content: center;
}

.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px; /* Reducido de 15px a 12px por no tener texto */
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-width: 50px; /* Mucho más compacto: de 120px a 50px */
    text-align: center;
}

/* Ocultar texto por defecto en desktop (solo iconos) */
.menu-item span,
.menu-item small {
    display: none;
}

.menu-item i {
    font-size: 1.3rem; /* Iconos ligeramente más grandes al ser protagonistas */
    margin-bottom: 0; /* Sin margen al no tener texto */
}

.menu-item:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.menu-item.active {
    background: rgba(102, 126, 234, 0.3);
    border: 2px solid #667eea;
}

.menu-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === TOOLTIP ELEGANTE AL HOVER (SOLO DESKTOP) === */
@media (hover: hover) and (min-width: 769px) {
    .menu-item::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: -35px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.9);
        color: white;
        padding: 6px 12px;
        border-radius: 6px;
        font-size: 0.8rem;
        font-weight: 500;
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1001;
        pointer-events: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    .menu-item::before {
        content: '';
        position: absolute;
        bottom: -8px;
        left: 50%;
        transform: translateX(-50%);
        width: 0;
        height: 0;
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-bottom: 6px solid rgba(0, 0, 0, 0.9);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1001;
    }
    
    .menu-item:hover::after,
    .menu-item:hover::before {
        opacity: 1;
        visibility: visible;
    }
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.user-info i {
    font-size: 1.5rem;
    color: #667eea;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* === CONTENIDO DEL MÓDULO === */
.module-content {
    padding: 0;
    background: white;
    min-height: calc(100vh - 70px);
}

.module-header {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 15px 30px;
    border-bottom: 1px solid #e2e8f0;
}

.module-header h2 {
    color: #2d3748;
    font-size: 1.5rem;
    margin-bottom: 3px;
}

.module-header h2 i {
    color: #667eea;
    margin-right: 8px;
    font-size: 1.3rem;
}

.module-header p {
    color: #4a5568;
    font-size: 0.9rem;
}

/* === RESPONSIVE NAVBAR - OPTIMIZACIÓN COMPACTA === */

/* Mobile phones (hasta 480px) - MOSTRAR TEXTO (no hay hover) */
@media (max-width: 480px) {
    .main-navbar {
        height: 45px; /* Súper compacto en móvil */
        padding: 0 8px; /* Padding mínimo */
    }
    
    .navbar-logo {
        width: 24px; /* Logo muy pequeño */
        height: 24px;
    }
    
    .navbar-menu {
        gap: 2px; /* Espaciado mínimo */
    }
    
    .menu-item {
        min-width: 65px; /* Mucho más compacto */
        padding: 4px 6px; /* Padding mínimo */
    }
    
    /* MOSTRAR texto en móvil */
    .menu-item span {
        display: block !important;
        font-size: 0.65rem; /* Texto muy pequeño */
        line-height: 1.1;
    }
    
    .menu-item i {
        font-size: 0.9rem; /* Iconos más pequeños */
        margin-bottom: 1px;
    }
    
    .menu-item small {
        display: none; /* Ocultar subtextos */
    }
    
    .navbar-user {
        font-size: 0.7rem;
    }
    
    /* Ajustar contenido para nueva altura */
    .full-screen-table {
        top: 45px !important;
        height: calc(100vh - 45px) !important;
    }
}

/* Tablets (481px - 768px) - MOSTRAR TEXTO (hover limitado) */
@media (min-width: 481px) and (max-width: 768px) {
    .main-navbar {
        height: 50px; /* Compacto en tablet */
        padding: 0 10px;
    }
    
    .navbar-logo {
        width: 28px;
        height: 28px;
    }
    
    .navbar-menu {
        gap: 3px;
    }
    
    .menu-item {
        min-width: 90px; /* Más compacto que desktop */
        padding: 6px 10px;
    }
    
    /* MOSTRAR texto en tablet */
    .menu-item span {
        display: block !important;
        font-size: 0.75rem; /* Texto mediano */
    }
    
    .menu-item i {
        font-size: 1rem;
        margin-bottom: 2px;
    }
    
    .menu-item small {
        font-size: 0.6rem; /* Subtexto muy pequeño */
        display: block !important;
    }
    
    /* Ajustar contenido para nueva altura */
    .full-screen-table {
        top: 50px !important;
        height: calc(100vh - 50px) !important;
    }
}

/* Desktop responsive original (768px+) - mantener actual pero mejorado */
@media (max-width: 768px) {
    .module-content {
        min-height: calc(100vh - 120px); /* Ajustado para nueva altura */
    }
}

/* === OPTIMIZACIÓN NAVBAR ULTRA-SMALL === */

/* Optimización para pantallas muy pequeñas (menos de 360px) */
@media (max-width: 360px) {
    .menu-item {
        min-width: 55px;
        padding: 3px 4px;
    }
    
    .menu-item span {
        font-size: 0.6rem !important;
    }
    
    .navbar-menu {
        gap: 1px;
    }
    
    .main-navbar {
        padding: 0 5px;
    }
}

/* === ESTILOS PARA TÍTULOS DE PARTIDAS === */
.partida-titulo {
    background-color: #f8f9fa !important;
    border-left: 4px solid #667eea;
    font-weight: bold !important;
}

.partida-titulo:hover {
    background-color: #e9ecef !important;
}

.partida-titulo td {
    font-weight: bold !important;
    color: #2d3748 !important;
    background-color: #f8f9fa !important;
}

.partida-titulo .descripcion {
    color: #667eea !important;
    font-weight: 700 !important;
}

/* === COLORES DISCRETOS PARA % AVANCE === */
.avance-excedido {
    background-color: #ffebee !important;
    color: #c62828 !important;
    font-weight: 600 !important;
    border-left: 3px solid #c62828;
}

.avance-alto {
    background-color: #e8f5e8 !important;
    color: #2e7d32 !important;
    font-weight: 600 !important;
    border-left: 3px solid #2e7d32;
}

.avance-medio {
    background-color: #fff3e0 !important;
    color: #ef6c00 !important;
    font-weight: 600 !important;
    border-left: 3px solid #ef6c00;
}

/* === COLORES DISCRETOS PARA % COSTO === */
.costo-excedido {
    background-color: #ffebee !important;
    color: #c62828 !important;
    font-weight: 600 !important;
    border-left: 3px solid #c62828;
}

.costo-normal {
    background-color: #e8f5e8 !important;
    color: #2e7d32 !important;
    font-weight: 600 !important;
    border-left: 3px solid #2e7d32;
}

/* === COLORES DISCRETOS PARA % RETRASO === */
.retraso-bien {
    background-color: #e8f5e8 !important;
    color: #2e7d32 !important;
    font-weight: 600 !important;
    border-left: 3px solid #2e7d32;
}

.retraso-atrasado {
    background-color: #fff3e0 !important;
    color: #ef6c00 !important;
    font-weight: 600 !important;
    border-left: 3px solid #ef6c00;
}

.retraso-no-iniciado {
    background-color: #ffebee !important;
    color: #c62828 !important;
    font-weight: 600 !important;
    border-left: 3px solid #c62828;
}

/* === COLORES DISCRETOS PARA VAC === */
.vac-positivo {
    background-color: #d1fae5 !important;
    color: #065f46 !important;
    font-weight: 600 !important;
    text-align: center !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    border-left: 3px solid #065f46;
}

.vac-negativo {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
    font-weight: 600 !important;
    text-align: center !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    border-left: 3px solid #991b1b;
}

.vac-neutro {
    background-color: #f3f4f6 !important;
    color: #374151 !important;
    font-weight: 500 !important;
    text-align: center !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    border-left: 3px solid #9ca3af;
}

/* === ESTILOS PARA COLUMNA DE DOCUMENTOS === */
.documentos {
    text-align: center !important;
    color: #4f46e5 !important;
    font-weight: 600 !important;
}

.documentos i.fa-file-alt {
    color: #4f46e5 !important;
    margin-right: 4px !important;
    font-size: 1.1em !important;
}

.documentos:empty {
    background-color: transparent !important;
}

/* Hover effect para indicadores de documentos */
.documentos:not(:empty):hover {
    background-color: #f0f0ff !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease !important;
}

/* === ESTILOS PARA MÓDULO DE ANÁLISIS DE PROGRAMACIÓN === */
#analisisProyectoSelector {
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 25px;
    margin: 20px auto;
    max-width: 800px;
    width: 100%;
}

#analisisProyectoSelector .form-group label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    display: block;
}

#analisisProyectoSelector .proyecto-select {
    border: 2px solid #ced4da;
    border-radius: 6px;
    padding: 12px 15px;
    font-size: 16px;
    width: 100%;
    transition: all 0.3s ease;
}

#analisisProyectoSelector .proyecto-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

#analisisProyectoSelector .section-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    margin-bottom: 0;
    margin: -25px -25px 25px -25px;
}

#analisisProyectoSelector .section-header h2 {
    color: white;
    margin-bottom: 0;
    font-size: 1.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.analisis-vista {
    padding: 20px;
}

.analisis-content {
    margin-top: 30px;
}

/* Contenedor del gráfico de análisis de programación */
.chart-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    overflow: hidden;
}

.chart-header {
    padding: 20px;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.chart-header h3 {
    margin: 0;
    color: #495057;
    font-size: 1.2rem;
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.chart-toggles {
    display: flex;
    gap: 8px;
}

.chart-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    color: #6c757d;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-toggle:hover {
    border-color: #adb5bd;
}

.chart-toggle.active {
    background: #f8f9fa;
    border-color: #6c757d;
    color: #495057;
}

.color-indicator {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    display: inline-block;
}

/* CONTENEDOR DEL GRÁFICO - DIMENSIONES REALES GRANDES */
.chart-wrapper {
    padding: 30px;
    height: 660px !important;    /* ALTURA REDUCIDA 34% */
    min-height: 660px !important;
    width: 100% !important;
    max-width: none !important;
    position: relative;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: visible;
}

/* CANVAS DEL GRÁFICO - OCUPAR TODO EL ESPACIO */
#analisisProgramacionChart {
    height: 620px !important;     /* CANVAS ALTURA REDUCIDA 34% */
    width: 100% !important;
    display: block !important;
}

/* CONTENEDOR PADRE TAMBIÉN GRANDE */
.chart-container {
    height: auto !important;
    min-height: 660px !important;
}

/* Botones de toggle de unidades */
#togglePersonalUnit, #toggleEquiposUnit {
    margin-right: 10px;
    transition: all 0.3s ease;
}

#togglePersonalUnit:hover, #toggleEquiposUnit:hover {
    transform: scale(1.05);
}

#togglePersonalUnit .fas, #toggleEquiposUnit .fas {
    margin-right: 5px;
}

/* Indicadores de programación */
.analisis-indicators {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.indicator-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: center;
}

.indicator-card h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 1rem;
    font-weight: 600;
}

.indicator-value {
    font-size: 2rem;
    font-weight: bold;
    margin: 10px 0;
    color: #3498db;
}

.indicator-value.status {
    font-size: 1.2rem;
    padding: 8px 16px;
    border-radius: 4px;
    display: inline-block;
}

.indicator-value.status.on-time {
    background: #d4edda;
    color: #155724;
}

.indicator-value.status.delayed {
    background: #f8d7da;
    color: #721c24;
}

.indicator-value.status.ahead {
    background: #d1ecf1;
    color: #0c5460;
}

.indicator-desc {
    margin: 0;
    color: #6c757d;
    font-size: 0.875rem;
}

.analisis-placeholder {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.analisis-placeholder h3 {
    color: #495057;
    margin-bottom: 15px;
}

.analisis-placeholder p {
    color: #6c757d;
    margin-bottom: 10px;
}

.analisis-placeholder ul {
    list-style-type: none;
    padding: 0;
}

.analisis-placeholder li {
    color: #6c757d;
    padding: 5px 0;
    position: relative;
    padding-left: 20px;
}

.analisis-placeholder li::before {
    content: "📊";
    position: absolute;
    left: 0;
    top: 5px;
}

/* Estilos consistentes para todas las celdas de la tabla */
.partidas-table td {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    font-size: 0.9rem !important;
    padding: 12px;
    vertical-align: middle;
}

/* Estilos adicionales para las partidas */
.partidas-table tr:not(.partida-titulo):hover {
    background-color: #f1f3f4;
}

.partidas-table td.currency {
    text-align: right;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Misma fuente base */
    font-weight: 500;
    font-size: 0.9rem; /* Mismo tamaño */
}

.partidas-table td.cantidad {
    text-align: right;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Misma fuente base */
    font-weight: 500;
    font-size: 0.9rem; /* Mismo tamaño */
}

/* === FOOTER === */
.app-footer {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    color: white;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid #e2e8f0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    padding: 0 20px;
}

.footer-content p {
    margin: 5px 0;
    font-size: 0.9rem;
}

.footer-app-name {
    color: #a0aec0;
    font-size: 0.8rem !important;
    margin-top: 8px !important;
}

/* Ocultar footer en pantalla de login */
.login-screen ~ .app-footer {
    display: none;
}

/* === ESTILOS PARA ESTADÍSTICAS === */
.partidas-stats .stat-value {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Consistencia en toda la interfaz */
body, input, button, select, textarea {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* === ESTILOS PARA RESUMEN FINANCIERO === */
.resumen-financiero {
    margin-top: 15px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border: 1px solid #dee2e6;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.resumen-header {
    background: var(--gradient-primary);
    color: white;
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 2px solid #5a67d8;
}

.resumen-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.resumen-header i {
    margin-right: 8px;
    font-size: 1rem;
}

.resumen-content {
    padding: 20px;
}

.resumen-grid {
    display: grid;
    gap: 8px;
}

.resumen-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #667eea;
    transition: all 0.2s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.resumen-item:hover {
    background: #e9ecef;
    transform: translateX(2px);
}

.resumen-item label {
    font-weight: 500;
    color: #495057;
    font-size: 0.9rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.resumen-item .valor {
    font-weight: 600;
    color: #28a745;
    font-size: 0.95rem;
    background: white;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #d1ecf1;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.resumen-item.subtotal-line {
    border-left-color: #fd7e14;
    background: #fff3cd;
}

.resumen-item.subtotal-line .valor {
    color: #fd7e14;
    border-color: #ffeaa7;
}

.resumen-item.total-line {
    border-left-color: #dc3545;
    background: #f8d7da;
    margin-top: 8px;
    border: 1px solid #dc3545;
}

.resumen-item.total-line .valor.total {
    color: #dc3545;
    border-color: #f5c6cb;
    font-size: 1.05rem;
    padding: 6px 12px;
    font-weight: 700;
}

/* === ESTILO PARA PARTIDAS TIPO TITULO === */
.partida-title {
    font-weight: bold;
    color: #2c3e50;
    background-color: #ecf0f1 !important;
    font-style: italic;
    text-align: center;
}

/* === ESTILOS PARA NUEVAS COLUMNAS === */
.partidas-table th:nth-child(8),  /* APU Meta */
.partidas-table th:nth-child(9),  /* % Avance */
.partidas-table th:nth-child(10), /* % Costo */
.partidas-table th:nth-child(11), /* Gasto */
.partidas-table th:nth-child(12), /* Estado */
.partidas-table th:nth-child(13)  /* Alerta */
{
    min-width: 90px;
    font-size: 0.85rem;
}

.partidas-table td:nth-child(8),  /* APU Meta */
.partidas-table td:nth-child(11)  /* Gasto */
{
    text-align: right;
    font-weight: 600;
}

.partidas-table td:nth-child(9),  /* % Avance */
.partidas-table td:nth-child(10)  /* % Costo */
{
    text-align: center;
    font-weight: 600;
}

.partidas-table td:nth-child(12)  /* Estado */
{
    text-align: center;
    font-weight: 500;
}

.partidas-table td:nth-child(13)  /* Alerta */
{
    text-align: center;
}

/* Estilos para estados */
.estado-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.estado-pendiente {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.estado-proceso {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.estado-completado {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.estado-retrasado {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Estilos para alertas */
.alerta-icon {
    font-size: 1.2rem;
    cursor: pointer;
}

.alerta-ninguna {
    color: #28a745;
}

.alerta-baja {
    color: #ffc107;
}

.alerta-media {
    color: #fd7e14;
}

.alerta-alta {
    color: #dc3545;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Ajustar ancho de tabla para nuevas columnas */
.partidas-table-container {
    overflow-x: auto;
    max-width: 100%;
}

.partidas-table {
    min-width: 1400px; /* Aumentar ancho mínimo para acomodar nuevas columnas */
}

/* Estilos específicos para columnas de partidas */
.avance-cell {
    text-align: center;
    font-weight: 600;
}

.avance-percentage {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
    min-width: 50px;
}

.avance-percentage:not(.over-limit) {
    background-color: #d4edda;
    color: #155724;
}

.avance-percentage.over-limit {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    animation: warning-pulse 2s infinite;
}

@keyframes warning-pulse {
    0% { background-color: #fff3cd; }
    50% { background-color: #ffeaa7; }
    100% { background-color: #fff3cd; }
}

.costo-percentage {
    padding: 4px 8px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.85em;
    display: inline-block;
    min-width: 50px;
}

.costo-percentage.under-cost {
    background-color: #d4edda;
    color: #155724;
}

.costo-percentage.over-cost {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #dc3545;
    animation: cost-alert 2s infinite;
}

@keyframes cost-alert {
    0% { background-color: #f8d7da; }
    50% { background-color: #f1b0b7; }
    100% { background-color: #f8d7da; }
}

.costo-cell {
    text-align: center;
    font-weight: 600;
    color: #495057;
}

.gasto-cell {
    text-align: right;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    color: #dc3545;
}

.apu-meta-cell {
    text-align: right;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    color: #28a745;
}

.estado-cell .badge {
    font-size: 0.8rem;
    padding: 4px 8px;
}

.alerta-cell .badge {
    font-size: 0.75rem;
    padding: 3px 6px;
    animation: alert-blink 1.5s infinite;
}

@keyframes alert-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* === ESTILOS RESUMEN FINANCIERO - TABLA PROFESIONAL === */
.resumen-table-container {
    margin-top: 20px;
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.resumen-table {
    width: 100%;
    border-collapse: collapse;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif; /* Misma fuente que partidas */
    background: white;
}

.resumen-table thead {
    background: var(--gradient-primary); /* Mismo gradiente que partidas */
    color: white;
}

.resumen-table th {
    padding: 15px 12px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.resumen-table .concepto-header {
    text-align: left !important;
    width: 20%;  /* Reducido de 25% para acomodar VAC */
    background: rgba(0,0,0,0.1);
}

.resumen-table .bac-header {
    color: #fef3c7;
    width: 16%;  /* Reducido de 20% para acomodar VAC */
}

.resumen-table .pv-header {
    color: #e3f2fd;
    width: 16%;  /* Reducido de 20% para acomodar VAC */
}

.resumen-table .ac-header {
    color: #ffebee;
    width: 16%;  /* Reducido de 20% para acomodar VAC */
}

.resumen-table .ev-header {
    color: #e8f5e8;
    width: 16%;  /* Reducido de 20% para acomodar VAC */
}

.resumen-table .vac-header {
    color: #f3e8ff;
    width: 16%;  /* Nueva columna VAC */
}

.resumen-table .subtitle-row th {
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 400;
    text-transform: none;
    font-style: italic;
    opacity: 0.9;
}

.resumen-table .concepto-subtitle {
    background: rgba(0,0,0,0.1);
}

.resumen-table tbody tr {
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #e2e8f0;
}

.resumen-table tbody tr:hover {
    background-color: #f8fafc;
}

.resumen-table td {
    padding: 12px;
    text-align: right;
    font-size: 0.9rem;
}

.resumen-table .concepto-label {
    text-align: left !important;
    font-weight: 600;
    color: #4a5568;
    background-color: #f7fafc;
    border-right: 2px solid #e2e8f0;
}

.resumen-table .valor-bac {
    background-color: #fef3c7;
    color: #d97706;
    font-weight: 600;
}

.resumen-table .valor-pv {
    background-color: #f0f9ff;
    color: #0369a1;
    font-weight: 600;
}

.resumen-table .valor-ac {
    background-color: #fef2f2;
    color: #dc2626;
    font-weight: 600;
}

.resumen-table .valor-ev {
    background-color: #f0fdf4;
    color: #16a34a;
    font-weight: 600;
}

.resumen-table .valor-vac {
    background-color: #faf5ff;
    color: #7c3aed;
    font-weight: 600;
}

.resumen-table .subtotal-row {
    border-top: 2px solid #cbd5e0;
    border-bottom: 2px solid #cbd5e0;
}

.resumen-table .subtotal-row td {
    background-color: #edf2f7 !important;
    font-weight: 700;
}

/* Estilos para las filas de disgregación de costos */
.resumen-table .subitem-row {
    background-color: #f8fafc;
    border-left: 3px solid #64b5f6;
}

.resumen-table .subitem-row td {
    font-size: 0.85rem;
    padding: 8px 12px;
    color: #4a5568;
}

.resumen-table .subitem-label {
    font-style: italic;
    padding-left: 20px !important;
    color: #2d3748 !important;
    font-weight: 500;
}

.resumen-table .subitem-row:hover {
    background-color: #f1f5f9;
}

.resumen-table .total-row {
    border-top: 3px solid #dc2626;
    background: linear-gradient(135deg, #fff5f5, #fef2f2);
}

.resumen-table .total-row td {
    font-weight: 700;
    font-size: 0.9rem; /* Mismo tamaño que el resto de la tabla */
    padding: 15px 12px;
}

.resumen-table .total-label {
    background: linear-gradient(135deg, #fee2e2, #fecaca) !important;
    color: #991b1b !important;
}

.resumen-table .total-value {
    background: linear-gradient(135deg, #fef2f2, #fee2e2) !important;
    color: #dc2626 !important;
}

/* Números con formato monospace para mejor alineación */
.resumen-table span {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    font-variant-numeric: tabular-nums;
}

/* Responsive */
@media (max-width: 768px) {
    .resumen-table-container {
        margin: 10px -15px;
        border-radius: 0;
    }
    
    .resumen-table th,
    .resumen-table td {
        padding: 8px 6px;
        font-size: 0.8rem;
    }
    
    .resumen-table .concepto-label {
        font-size: 0.75rem;
    }
}

/* Indicadores de rendimiento */
.indicadores-rendimiento {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #f1f8ff, #e6f3ff);
    border-radius: 10px;
    border: 1px solid #b3d7ff;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.indicador {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #007bff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.indicador label {
    font-weight: 600;
    color: #495057;
    margin: 0 0 5px 0;
    font-size: 0.9rem;
}

.indicador .formula {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #6c757d;
    background: #f8f9fa;
    padding: 3px 6px;
    border-radius: 3px;
    margin-bottom: 8px;
    border: 1px solid #e9ecef;
}

.indicador .formula-note {
    color: #dc3545;
    font-style: italic;
    font-size: 0.75rem;
}

.indicador .interpretacion {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 5px;
    text-align: center;
    width: 100%;
}

.indicador .interpretacion .positivo {
    color: #28a745;
    font-weight: 500;
}

.indicador .interpretacion .negativo {
    color: #dc3545;
    font-weight: 500;
}

.indicador .valor {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: #007bff;
    font-size: 1.1rem;
    align-self: center;
    margin: 5px 0;
}

.indicador .valor.positive {
    color: #28a745;
    background: #d4edda;
    padding: 3px 8px;
    border-radius: 4px;
}

.indicador .valor.negative {
    color: #dc3545;
    background: #f8d7da;
    padding: 3px 8px;
    border-radius: 4px;
}

.indicador .valor.neutral {
    color: #6c757d;
    background: #e9ecef;
    padding: 3px 8px;
    border-radius: 4px;
}

.indicador .valor .positive {
    color: #28a745;
}

.indicador .valor .negative {
    color: #dc3545;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .resumen-grid-3columnas {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .resumen-header-columna {
        margin-bottom: 10px;
    }
    
    .resumen-grid-3columnas .resumen-item {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 12px;
    }
    
    .indicadores-rendimiento {
        grid-template-columns: 1fr;
    }
}

/* ========================================================================
   PLANNING STATUS MODULE STYLES
   ======================================================================== */

/* Planning Controls */
.planning-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    font-weight: 500;
    color: #495057;
    white-space: nowrap;
}

.fecha-corte-input {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.fecha-corte-input:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.25);
}

/* Planning Status Table Rows */
.titulo-row {
    background-color: #f8f9fa !important;
    border-left: 4px solid #667eea;
    font-weight: bold !important;
}

.titulo-row:hover {
    background-color: #e9ecef !important;
}

.titulo-row td {
    font-weight: bold !important;
    color: #2d3748 !important;
    background-color: #f8f9fa !important;
}

.titulo-row .partida-name.titulo {
    color: #667eea !important;
    font-weight: 700 !important;
}

.planning-status-ok {
    background-color: #d1f2eb !important;
    border-left: 4px solid #28a745;
}

.planning-status-warning {
    background-color: #fff3cd !important;
    border-left: 4px solid #ffc107;
}

.planning-status-error {
    background-color: #f8d7da !important;
    border-left: 4px solid #dc3545;
}

.planning-status-neutral {
    background-color: #f8f9fa !important;
    border-left: 4px solid #6c757d;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge i {
    font-size: 10px;
}

.status-badge.status-ok {
    background-color: #d1f2eb;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-badge.status-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-badge.status-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-badge.status-unknown {
    background-color: #e9ecef;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.status-badge.status-neutral {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

/* Planning Stats Cards */
.planning-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Pestañas elegantes */
.tabs-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin: 20px 0;
}

.nav-tabs {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.nav-item {
    flex: 1;
}

.nav-link {
    display: block;
    width: 100%;
    padding: 15px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #6c757d;
    text-align: center;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-link:hover {
    background: #e9ecef;
    color: #495057;
}

.nav-link.active {
    background: white;
    color: #007bff;
    border-bottom-color: #007bff;
}

.nav-link i {
    margin-right: 8px;
}

.tab-content {
    padding: 0;
}

.tab-pane {
    display: none !important;
    padding: 20px;
}

.tab-pane.show.active {
    display: block !important;
}

.tab-summary {
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 16px;
    color: #495057;
    border-left: 4px solid #007bff;
}

/* Estilos específicos para tablas de egresos e ingresos */
.stat-card.egresos {
    border-left: 5px solid #dc3545 !important;
    background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%) !important;
}

.stat-card.egresos h4 {
    color: #dc3545;
}

.stat-card.ingresos {
    border-left: 5px solid #28a745 !important;
    background: linear-gradient(135deg, #f0fff4 0%, #ffffff 100%) !important;
}

.stat-card.ingresos h4 {
    color: #28a745;
}

.stat-card.balance {
    border-left: 5px solid #17a2b8 !important;
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%) !important;
}

.stat-card.balance h4 {
    color: #17a2b8;
}

.table-section {
    margin: 30px 0;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.table-section h3 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f8f9fa;
    color: #495057;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border-radius: 10px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid;
}

.stat-card.bien-programada {
    border-left-color: #28a745;
}

.stat-card.sobre-programada {
    border-left-color: #ffc107;
}

.stat-card.sub-programada {
    border-left-color: #dc3545;
}

.stat-card.sin-datos {
    border-left-color: #6c757d;
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
}

.stat-card.bien-programada .stat-icon {
    background-color: #d1f2eb;
    color: #28a745;
}

.stat-card.sobre-programada .stat-icon {
    background-color: #fff3cd;
    color: #ffc107;
}

.stat-card.sub-programada .stat-icon {
    background-color: #f8d7da;
    color: #dc3545;
}

.stat-card.sin-datos .stat-icon {
    background-color: #f8f9fa;
    color: #6c757d;
}

.stat-info h4 {
    margin: 0;
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-info span {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: #343a40;
    line-height: 1;
    margin: 5px 0;
}

.stat-info small {
    font-size: 12px;
    color: #6c757d;
    text-transform: lowercase;
}

/* Planning Status Table Specific Styles */
#planningStatusTable .cantidad {
    text-align: right;
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

#planningStatusTable .fecha {
    text-align: center;
    font-size: 12px;
    color: #6c757d;
}

#planningStatusTable .estado-planificacion {
    text-align: center;
}

#planningStatusTable .partida-name {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Responsive Planning Status */
@media (max-width: 768px) {
    .planning-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .control-group {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
        text-align: center;
    }
    
    .fecha-corte-input {
        width: 100%;
    }
    
    .planning-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        text-align: center;
        flex-direction: column;
        gap: 10px;
    }
    
    #planningStatusTable th,
    #planningStatusTable td {
        padding: 8px 4px;
        font-size: 12px;
    }
    
    #planningStatusTable .partida-name {
        max-width: 120px;
    }
}

/* Button Hover Effects for Planning Status */
#actualizarPlanningStatus:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

#exportarPlanningStatus:hover {
    background-color: #218838;
    transform: translateY(-1px);
}

/* ========================================================================
   UPLOAD OBRA MODULE STYLES
   ======================================================================== */

/* Upload Container */
.upload-container {
    max-width: 1800px; /* Aumentado para permitir tablas anchas */
    margin: 20px auto;
    padding: 20px;
    text-align: center;
}

/* Asegurar centrado del header de upload-obra */
.upload-tipo-selector .section-header,
.upload-proyecto-selector .section-header {
    text-align: center;
    margin: 0 auto 30px auto;
    max-width: 800px;
}

/* Drag and Drop Zone */
.upload-dropzone {
    border: 3px dashed #cbd5e0;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: #f8fafc;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-dropzone:hover {
    border-color: #667eea;
    background: #edf2f7;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.upload-dropzone.dragover {
    border-color: #667eea;
    background: linear-gradient(135deg, #e6fffa, #f0fff4);
    border-style: solid;
    animation: dragPulse 1s infinite;
}

@keyframes dragPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 2;
}

.upload-icon {
    font-size: 4rem;
    opacity: 0.6;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.dropzone-content h3 {
    margin: 0;
    color: #4a5568;
    font-size: 1.4rem;
    font-weight: 600;
}

.dropzone-content p {
    margin: 0;
    color: #718096;
    font-size: 1rem;
}

.btn-link {
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #5a67d8;
    text-decoration: underline;
}

/* File Info Display */
.file-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    margin: 15px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.file-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#file-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 1rem;
}

#file-size {
    color: #718096;
    font-size: 0.9rem;
}

.btn-remove {
    background: #fed7d7;
    color: #c53030;
    border: 1px solid #feb2b2;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-remove:hover {
    background: #fc8181;
    color: white;
    transform: scale(1.1);
}

/* Progress Bar */
.progress-container {
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    transition: width 0.5s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255,255,255,0.4) 50%, 
        transparent 100%);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    color: #4a5568;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Validation Results */
.validation-results {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin: 20px auto;
    width: 98%;
    overflow-x: auto;
}

/* ESPECÍFICO para Upload Obra - sin afectar otros validation-results */
#uploadObra .validation-results,
#upload-obra-content .validation-results {
    width: 98%;
    margin: 20px auto;
    overflow-x: auto;
}

.validation-results h4 {
    background: var(--gradient-primary);
    color: white;
    margin: 0;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    font-size: var(--font-size-lg);
    font-weight: 600;
}

#validation-content {
    padding: 20px;
}

/* Validation Summary */
.validation-summary {
    margin-bottom: 20px;
}

.validation-summary h5 {
    margin: 0 0 15px 0;
    color: #2d3748;
    font-size: 1rem;
    font-weight: 600;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.summary-item .label {
    font-weight: 500;
    color: #4a5568;
    font-size: 0.9rem;
}

.summary-item .value {
    font-weight: 700;
    color: #2d3748;
    font-size: 1.1rem;
}

.summary-item.total {
    background: linear-gradient(135deg, #edf2f7, #e2e8f0);
    border-left-color: #2d3748;
}

.summary-item.total .value {
    color: #667eea;
}

/* Validation Messages */
.validation-errors {
    margin-bottom: 20px;
    padding: 15px;
    background: #fed7d7;
    border: 1px solid #feb2b2;
    border-radius: 8px;
    border-left: 4px solid #e53e3e;
}

.validation-errors h5 {
    margin: 0 0 10px 0;
    color: #c53030;
    font-size: 1rem;
}

.validation-errors ul {
    margin: 0;
    padding-left: 20px;
    color: #c53030;
}

.validation-errors li {
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.validation-warnings {
    margin-bottom: 20px;
    padding: 15px;
    background: #fef5e7;
    border: 1px solid #f6d55c;
    border-radius: 8px;
    border-left: 4px solid #d69e2e;
}

.validation-warnings h5 {
    margin: 0 0 10px 0;
    color: #d69e2e;
    font-size: 1rem;
}

.validation-warnings ul {
    margin: 0;
    padding-left: 20px;
    color: #d69e2e;
}

.validation-warnings li {
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.validation-success {
    padding: 15px;
    background: #c6f6d5;
    border: 1px solid #9ae6b4;
    border-radius: 8px;
    border-left: 4px solid #38a169;
    text-align: center;
}

.validation-success h5 {
    margin: 0 0 5px 0;
    color: #2f855a;
    font-size: 1rem;
}

.validation-success p {
    margin: 0;
    color: #2f855a;
    font-size: 0.9rem;
}

.validation-failure {
    padding: 15px;
    background: #fed7d7;
    border: 1px solid #feb2b2;
    border-radius: 8px;
    border-left: 4px solid #e53e3e;
    text-align: center;
}

.validation-failure h5 {
    margin: 0 0 5px 0;
    color: #c53030;
    font-size: 1rem;
}

.validation-failure p {
    margin: 0;
    color: #c53030;
    font-size: 0.9rem;
}

/* Action Buttons */
.validation-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding: 20px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 0 0 12px 12px;
}

/* Notifications */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-error {
    background: #fed7d7;
    border: 1px solid #feb2b2;
    color: #c53030;
}

.notification-success {
    background: #c6f6d5;
    border: 1px solid #9ae6b4;
    color: #2f855a;
}

.notification-info {
    background: #bee3f8;
    border: 1px solid #90cdf4;
    color: #2c5282;
}

.notification-message {
    flex: 1;
    font-weight: 500;
    font-size: 0.9rem;
}

.notification-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.notification-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Dashboard Section Styling */
.dashboard-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.section-subtitle {
    color: #718096;
    font-size: 1rem;
    margin: 5px 0 0 0;
    font-weight: 400;
}

#upload-obra-section .section-header {
    background: var(--gradient-primary);
    color: white;
    padding: var(--spacing-lg) var(--spacing-xl);
    border-bottom: 2px solid #5a67d8;
    text-align: center;
    margin: 0 auto;
    max-width: 1000px;
}

#upload-obra-section .section-header h2 {
    margin: 0 0 5px 0;
    font-size: 1.5rem;
    font-weight: 600;
}

#upload-obra-section .section-header .section-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
}

/* Responsive Upload Obra */
@media (max-width: 768px) {
    .upload-container {
        padding: 15px;
    }
    
    .upload-dropzone {
        padding: 30px 15px;
    }
    
    .dropzone-content h3 {
        font-size: 1.2rem;
    }
    
    .upload-icon {
        font-size: 3rem;
    }
    
    .file-info {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .btn-remove {
        align-self: center;
    }
    
    .validation-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        width: 100%;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .notification {
        min-width: 280px;
        right: 10px;
    }
    
    .notification-container {
        right: 10px;
        left: 10px;
    }
}

/* Dark Mode Adjustments for Upload */
@media (prefers-color-scheme: dark) {
    .upload-dropzone {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .upload-dropzone:hover {
        background: #4a5568;
        border-color: #667eea;
    }
    
    .file-info {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .progress-container,
    .validation-results {
        background: #2d3748;
        border-color: #4a5568;
    }
}

/* ========================================================================
   UPLOAD OBRA MODULE - TABLAS DE DATOS
   ======================================================================== */

/* Contenedor de pestañas */
.data-tabs {
    margin-top: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: visible;
    width: 100%;
    max-width: none;
}

/* Botones de pestañas */
.tab-buttons {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    width: 100%;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    background: none;
    border: none;
    color: #6c757d;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.tab-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.tab-btn.active {
    background: white;
    color: #667eea;
    border-bottom-color: #667eea;
}

/* Contenido de pestañas */
.tab-content {
    display: none;
    padding: 10px;
    max-height: 700px;
    overflow: auto;
    width: 100%;
    box-sizing: border-box;
}

.tab-content.active {
    display: block;
}

/* Contenedor de tabla */
.table-container {
    width: 100%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* Tablas de datos */
.data-table {
    width: 100%;
    min-width: 600px; /* RESTAURAR valores normales */
    border-collapse: collapse;
    margin: 0;
    font-size: 14px;
    background: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    table-layout: auto; /* RESTAURAR layout automático */
}

/* ESPECÍFICO SOLO para Upload Obra - NO afectar otras tablas */
#uploadObra .data-table,
.validation-results .data-table {
    width: 1600px !important; /* Reducido de 1700px a 1600px */
    min-width: 1600px !important;
    table-layout: fixed !important;
    font-size: 13px !important;
    margin: 0 auto !important;
    display: table !important;
    visibility: visible !important;
    border-collapse: collapse !important;
}

/* Asegurar que TODAS las columnas sean visibles */
#uploadObra .data-table th,
#uploadObra .data-table td,
.validation-results .data-table th,
.validation-results .data-table td {
    display: table-cell !important;
    visibility: visible !important;
    border: 1px solid #ddd !important;
    padding: 6px !important; /* Reducido de 8px a 6px */
    text-align: center !important;
    white-space: normal !important; /* Permitir salto de línea */
    word-wrap: break-word !important; /* Romper palabras largas */
    overflow-wrap: break-word !important; /* Compatibilidad */
    vertical-align: top !important; /* Alinear al tope */
    font-size: 12px !important; /* Reducido de 13px a 12px */
    line-height: 1.2 !important; /* Reducido de 1.3 a 1.2 para más compacto */
    max-height: none !important; /* Sin límite de altura */
    height: auto !important; /* Altura automática */
}

/* Específicamente para columnas de texto largo */
#uploadObra .data-table td:nth-child(4), /* Partida */
#uploadObra .data-table td:nth-child(6), /* Recurso */
.validation-results .data-table td:nth-child(4),
.validation-results .data-table td:nth-child(6) {
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    text-align: left !important;
    padding: 8px !important;
    line-height: 1.3 !important;
    min-height: 24px !important;
}

/* Específicamente para las primeras columnas que no se ven */
#uploadObra .data-table th:nth-child(1),
#uploadObra .data-table td:nth-child(1),
#uploadObra .data-table th:nth-child(2),
#uploadObra .data-table td:nth-child(2),
#uploadObra .data-table th:nth-child(3),
#uploadObra .data-table td:nth-child(3) {
    display: table-cell !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: auto !important;
    min-width: 80px !important;
}

/* Asegurar que encabezados y contenido tengan la misma fuente */
/* Reglas específicas para data-table - RESTAURADAS */
.data-table th,
.data-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    font-size: 14px;
}

/* ESPECÍFICO solo para Upload Obra */
#uploadObra .data-table th,
#uploadObra .data-table td,
.validation-results .data-table th,
.validation-results .data-table td {
    font-size: 12px !important; /* Reducido de 14px a 12px */
    padding: 6px 4px !important; /* Reducido padding vertical */
    text-align: center !important;
    white-space: nowrap;
    overflow: visible !important;
    display: table-cell !important; /* Forzar que todas las celdas se muestren */
    visibility: visible !important;
    opacity: 1 !important;
}

/* Forzar que TODAS las columnas de Upload Obra sean visibles */
#uploadObra .data-table th:nth-child(1), #uploadObra .data-table td:nth-child(1), /* ID Partida */
#uploadObra .data-table th:nth-child(2), #uploadObra .data-table td:nth-child(2), /* ID Recurso */
#uploadObra .data-table th:nth-child(3), #uploadObra .data-table td:nth-child(3), /* Recurso */
.validation-results .data-table th:nth-child(1), .validation-results .data-table td:nth-child(1),
.validation-results .data-table th:nth-child(2), .validation-results .data-table td:nth-child(2),
.validation-results .data-table th:nth-child(3), .validation-results .data-table td:nth-child(3) {
    display: table-cell !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: auto !important;
    min-width: 60px !important;
}

.data-table th {
    background: var(--color-primary); /* Color sólido usando variable */
    color: white;
    padding: var(--spacing-xs) 2px; /* Padding muy compacto */
    font-size: 11px !important; /* Encabezados aún más pequeños */
    font-weight: bold;
    text-align: center;
    white-space: normal; /* Permitir salto de línea en encabezados */
    line-height: 1.1 !important; /* Líneas más compactas */
    position: sticky;
    top: 0;
    z-index: 1;
    font-family: var(--font-family);
    min-width: 80px; /* Ancho mínimo para cada columna */
    border: 1px solid #5a6fd8; /* Borde para separar headers */
    overflow: visible !important;
    text-overflow: clip !important;
}

.data-table td {
    padding: 3px 2px; /* Padding muy compacto */
    border-bottom: 1px solid #e9ecef;
    white-space: nowrap;
    overflow: visible !important; /* Cambiar de hidden a visible */
    text-overflow: clip !important; /* Quitar ellipsis */
    color: #495057;
    font-size: 9px; /* Fuente más pequeña */
    vertical-align: top;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-width: 80px; /* Ancho mínimo para cada columna */
    border-right: 1px solid #e9ecef; /* Borde derecho para separar columnas */
}

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

.data-table tbody tr:nth-child(even) {
    background: #fdfdfd;
}

.data-table tbody tr:nth-child(even):hover {
    background: #f1f3f4;
}

/* Números alineados a la derecha */
.data-table .number {
    text-align: right;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 500;
}

/* Anchos específicos para columnas - todas iguales para que quepan */
.data-table th:nth-child(1), .data-table td:nth-child(1) { /* ID Partida */
    width: 120px;
    min-width: 120px;
}

.data-table th:nth-child(2), .data-table td:nth-child(2) { /* ID Recurso */
    width: 120px;
    min-width: 120px;
}

.data-table th:nth-child(3), .data-table td:nth-child(3) { /* Recurso */
    width: 150px;
    min-width: 150px;
}

.data-table th:nth-child(4), .data-table td:nth-child(4) { /* Tipo */
    width: 120px;
    min-width: 120px;
}

.data-table th:nth-child(5), .data-table td:nth-child(5) { /* Unidad */
    width: 80px;
    min-width: 80px;
}

.data-table th:nth-child(6), .data-table td:nth-child(6) { /* Cantidad */
    width: 100px;
    min-width: 100px;
}

.data-table th:nth-child(7), .data-table td:nth-child(7) { /* P.U. */
    width: 120px;
    min-width: 120px;
}

.data-table th:nth-child(8), .data-table td:nth-child(8) { /* Subtotal */
    width: 120px;
    min-width: 120px;
}

.data-table th:nth-child(9), .data-table td:nth-child(9) { /* IGV */
    width: 120px;
    min-width: 120px;
}

.data-table th:nth-child(10), .data-table td:nth-child(10) { /* Total Flujo */
    width: 120px;
    min-width: 120px;
}

.data-table th:nth-child(11), .data-table td:nth-child(11) { /* Fecha */
    width: 100px;
    min-width: 100px;
}

/* Encabezados de sección en tablas */
.data-table .section-header {
    background: #e9ecef !important;
    font-weight: bold;
    color: #495057;
    text-align: center;
}

/* Información de conteo de registros */
.table-info {
    margin-bottom: 15px;
    padding: 10px 15px;
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    border-radius: 4px;
    font-size: 14px;
    color: #1976d2;
    text-align: center; /* Centrar texto de información */
    width: fit-content; /* Ajustar al contenido */
    margin-left: auto;
    margin-right: auto;
}

/* Responsive para tablas */
@media (max-width: 768px) {
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 6px;
    }
    
    .tab-btn {
        padding: 12px 15px;
        font-size: 14px;
    }
}

/* ========================================================================
   UPLOAD OBRA MODULE - NUEVA INTERFAZ DE ARCHIVOS EXCEL
   ======================================================================== */

/* Contenedor principal del área de upload */
.upload-area-container {
    padding: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin: 20px;
    max-width: 98%; /* Usar casi todo el ancho de pantalla */
    width: 100%;
}

.upload-area-container h3 {
    color: #2d3748;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
}

/* Información de validación del proyecto */
.project-validation-info {
    background: #e6f3ff;
    border: 1px solid #b3d7ff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 25px;
}

.project-validation-info p {
    margin: 5px 0;
    color: #2c5282;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Sección de exportar control obra */
.export-control-obra-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #b3d7ff;
}

.export-control-obra-section p {
    margin-bottom: 10px;
    font-weight: 500;
}

.export-control-obra-section .btn {
    font-size: 0.9rem;
    padding: 8px 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Zona de upload de archivos */
.file-upload-zone {
    border: 3px dashed #cbd5e0;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: #f8fafc;
    transition: all 0.3s ease;
    margin-bottom: 25px;
    position: relative;
}

.file-upload-zone:hover {
    border-color: #667eea;
    background: #edf2f7;
}

.file-upload-zone.drag-over {
    border-color: #667eea;
    background: #e6f3ff;
    transform: scale(1.02);
}

/* Placeholder del upload */
.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-icon {
    font-size: 3rem;
    color: #48bb78;
    margin-bottom: 10px;
}

.upload-placeholder h4 {
    color: #2d3748;
    margin: 0;
    font-size: 1.1rem;
}

.upload-placeholder p {
    color: #718096;
    margin: 0;
    font-size: 1rem;
}

/* Información del archivo seleccionado */
.file-info {
    display: none;
    background: #f0fff4;
    border: 2px solid #68d391;
    border-radius: 8px;
    padding: 20px;
    margin: 10px 0;
}

.selected-file {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1rem;
    color: #2d3748;
}

.selected-file i {
    font-size: 1.5rem;
    color: #48bb78;
}

.selected-file span {
    font-weight: 500;
}

/* Área de validación */
.upload-validation {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.upload-validation h4 {
    color: #2d3748;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.validation-step {
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.validation-step:last-child {
    border-bottom: none;
}

.validation-step.success {
    color: #38a169;
}

.validation-step.error {
    color: #e53e3e;
}

.validation-step.warning {
    color: #ed8936;
}

/* Acciones del upload */
.upload-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

/* Responsive design para móviles */
@media (max-width: 768px) {
    .upload-area-container {
        margin: var(--spacing-sm);
        padding: var(--spacing-lg);
    }
    
    .file-upload-zone {
        padding: var(--spacing-xl) var(--spacing-md);
    }
    
    .upload-icon {
        font-size: 2.5rem;
    }
    
    .upload-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .selected-file {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }
}

/* ========================================================================
   ESTILOS PARA TABLA CONSOLIDADA Y CONFIRMACIÓN
   ======================================================================== */

/* Sección de resumen de procesamiento */
.processing-summary {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
}

.processing-summary h4 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.summary-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.summary-card.primary {
    border-left: 4px solid #007bff;
}

.summary-card.success {
    border-left: 4px solid #28a745;
}

.summary-card.warning {
    border-left: 4px solid #ffc107;
}

.summary-card.info {
    border-left: 4px solid #17a2b8;
}

.summary-title {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 5px;
    font-weight: 500;
}

.summary-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #495057;
}

.type-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.summary-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.detail-item {
    font-size: 0.9rem;
    color: #6c757d;
}

.detail-item strong {
    color: #495057;
}

/* ========================================================================
   RESUMEN HORIZONTAL ULTRA-COMPACTO
   ======================================================================== */

.processing-summary-horizontal {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #343a40;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 6px 10px;
    margin: 6px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    font-size: 0.95rem;
}

.summary-header-mini {
    text-align: center;
    font-weight: 600;
    color: #28a745;
    margin-bottom: 4px;
    font-size: 1rem;
}

.summary-header-mini i {
    margin-right: 4px;
    font-size: 1.1rem;
}

.amounts-horizontal {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 4px;
}

.amounts-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 2px 0;
}

.row-label {
    font-weight: 700;
    min-width: 70px;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.egresos-row .row-label {
    color: #c62828;
}

.ingresos-row .row-label {
    color: #2e7d32;
}

.valorizaciones-row .row-label {
    color: #1565c0;
}

.amount-item {
    font-size: 0.9rem;
    font-weight: 500;
    margin-right: 8px;
}

.culminadas-count {
    color: #1565c0;
    font-weight: 600;
}

.total-amount {
    font-weight: 700;
    color: #28a745;
}

.summary-details-mini {
    text-align: center;
    font-size: 0.8rem;
    color: #6c757d;
    border-top: 1px solid #e9ecef;
    padding-top: 3px;
}

.summary-details-compact {
    border-top: 1px solid #dee2e6;
    padding-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    font-size: 0.8rem;
}

.summary-details-compact .detail-item {
    white-space: nowrap;
    color: #6c757d;
}

/* Responsive para resumen compacto */
@media (max-width: 768px) {
    .summary-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .stat-group {
        justify-content: center;
        width: 100%;
    }
    
    .summary-details-compact {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
}

/* Contenedor de tabla consolidada */
.consolidated-table-container {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px auto; /* Más espacio entre contenedores */
    width: 98%; /* Usar casi todo el ancho disponible */
    min-width: 1200px; /* Reducido para permitir mejor scroll horizontal */
    overflow-x: auto; /* Permitir scroll horizontal si es necesario */
}

.consolidated-table-container h4 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Controles de tabla */
.table-controls {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.filter-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-controls select,
.filter-controls input {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
}

.filter-controls select {
    min-width: 150px;
}

.filter-controls input {
    min-width: 200px;
}

.table-info {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.showing-count {
    font-size: 0.9rem;
    color: #6c757d;
}

/* Tabla responsive */
.table-responsive {
    border-radius: 6px;
    overflow-x: auto;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    max-height: 800px; /* Aumentado para mostrar ~40 filas */
}

.table {
    margin-bottom: 0;
    font-size: 0.875rem;
    width: 100%;
    white-space: nowrap; /* Evitar que el texto se corte */
    table-layout: fixed; /* Permitir control de ancho de columnas */
}

.table th {
    background: #495057;
    color: white;
    font-weight: 600;
    border-top: none;
    padding: 12px 8px;
    font-size: 0.8rem;
    white-space: nowrap;
    text-align: center; /* Centrar encabezados */
    position: sticky; /* Mantener encabezados visibles al hacer scroll */
    top: 0;
    z-index: 10;
}

.table td {
    padding: 10px 8px;
    vertical-align: middle;
    border-top: 1px solid #dee2e6;
    text-align: center; /* Centrar contenido por defecto */
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #f8f9fa;
}

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

/* Badges para tipos */
.type-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}

.type-materiales {
    background: #e3f2fd;
    color: #1565c0;
}

.type-mano-de-obra {
    background: #e8f5e8;
    color: #2e7d32;
}

.type-equipo {
    background: #fff3e0;
    color: #ef6c00;
}

.type-sub-contrato {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* Códigos de recursos */
.resource-code {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8rem;
    color: #495057;
}

.resource-name {
    font-weight: 500;
    color: #495057;
    text-align: left !important; /* Alinear nombres de recursos a la izquierda */
    padding-left: 10px !important;
    white-space: normal !important; /* Permitir salto de línea */
    word-wrap: break-word !important; /* Romper palabras largas */
    word-break: break-word !important; /* Compatibilidad adicional */
    max-width: 300px; /* Limitar ancho máximo */
    overflow-wrap: break-word; /* Estándar moderno */
}

/* Columnas específicas */
.table .text-left {
    text-align: left !important;
    white-space: normal !important; /* Permitir salto de línea en columnas de texto */
    word-wrap: break-word !important;
    word-break: break-word !important;
    overflow-wrap: break-word;
}

/* Alineación de texto */
.text-center {
    text-align: center !important;
}

.text-right {
    text-align: right !important;
}

.text-left {
    text-align: left !important;
}

/* Sección de confirmación */
.confirmation-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 30px auto 20px auto; /* Más separación arriba */
    max-width: 95%;
}

.confirmation-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.confirmation-warning i {
    color: #856404;
    margin-top: 2px;
}

.confirmation-warning strong {
    color: #856404;
}

.confirmation-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.confirmation-actions .btn {
    min-width: 200px;
}

/* Sección de éxito de inserción */
.insertion-success-summary {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
}

.insertion-success-summary h4 {
    color: #155724;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.success-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    padding: 15px;
    text-align: center;
}

.stat-title {
    font-size: 0.875rem;
    color: #155724;
    margin-bottom: 5px;
    font-weight: 500;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #155724;
}

.success-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* No data message */
.no-data {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 6px;
}

/* Responsive para tablets y pantallas medianas */
@media (max-width: 1200px) {
    .consolidated-table-container {
        min-width: 800px; /* Reducir min-width en tablets */
    }
    
    .resource-name {
        max-width: 250px; /* Reducir ancho máximo en tablets */
    }
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .consolidated-table-container {
        margin: 10px;
        padding: 15px;
        max-width: 98%;
        min-width: unset; /* Remover min-width en móviles */
    }
    
    .summary-overview {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .type-summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .summary-details {
        grid-template-columns: 1fr;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-controls select,
    .filter-controls input {
        width: 100%;
    }
    
    .confirmation-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .confirmation-actions .btn {
        width: 100%;
        min-width: auto;
    }
    
    .success-stats {
        grid-template-columns: 1fr;
    }
    
    .success-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table-responsive {
        font-size: 0.75rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table th,
    .table td {
        padding: 6px 4px;
        font-size: 0.75rem;
    }
    
    .table th {
        font-size: 0.7rem;
    }
    
    /* Ocultar algunas columnas en móviles para mejor visualización */
    .table th:nth-child(3),
    .table td:nth-child(3),
    .table th:nth-child(4),
    .table td:nth-child(4),
    .table th:nth-child(7),
    .table td:nth-child(7) {
        display: none;
    }
}

/* Estilos adicionales para mejorar la tabla */
.table thead th {
    border-bottom: 2px solid #495057;
    vertical-align: middle;
}

.table tbody tr:last-child td {
    border-bottom: 1px solid #dee2e6;
}

/* Mejor contraste para los badges */
.type-materiales {
    background: #cce5ff;
    color: #004085;
    border: 1px solid #b3d9ff;
}

.type-mano-de-obra {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.type-equipo {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.type-sub-contrato {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ========================================================================
   FIN ESTILOS TABLA CONSOLIDADA Y CONFIRMACIÓN
   ======================================================================== */

/* ========================================================================
   FIN NUEVA INTERFAZ DE ARCHIVOS EXCEL
   ======================================================================== */

/* ========================================================================
   FIN UPLOAD OBRA MODULE STYLES
   ======================================================================== */

/* ========================================================================
   PLANNING STATUS MODULE STYLES
   ======================================================================== */

/* Planning Status con colores consistentes de la aplicación */
#planningStatus .section-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    margin-bottom: 0;
}

#planningStatus .section-header h2 {
    color: white;
    margin-bottom: 8px;
    font-size: 1.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#planningStatus .section-header p {
    color: rgba(255,255,255,0.9);
    font-size: 1rem;
    margin: 0;
}

/* Estilo limpio y elegante para el selector de Planning Status */
#planningProyectoSelector {
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 25px;
    margin: 20px 0;
}

#planningProyectoSelector .form-group label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    display: block;
}

#planningProyectoSelector .proyecto-select {
    border: 2px solid #ced4da;
    border-radius: 6px;
    padding: 12px 15px;
    font-size: 16px;
    width: 100%;
    transition: all 0.3s ease;
}

#planningProyectoSelector .proyecto-select:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    outline: none;
}

/* POSICIONAMIENTO Y VISIBILIDAD PRIORITARIA PLANNING STATUS */
#planningStatus {
    position: relative;
    z-index: 100 !important;
    width: 100%;
    top: 0 !important;
    margin-top: 0 !important;
    padding-top: 20px;
    background: #f8f9fa;
    min-height: 100vh;
}

#planningStatus.module-content {
    display: block !important;
}

/* Scroll automático hacia arriba cuando Planning Status está activo */
body.planning-status-active {
    scroll-behavior: smooth;
}

body.planning-status-active #planningStatus {
    scroll-margin-top: 0;
}

/* Ocultar otros módulos cuando Planning Status está activo */
body.planning-status-active #controlProyectos,
body.planning-status-active #presupuestos,
body.planning-status-active #reportes,
body.planning-status-active #configuracion {
    display: none !important;
}

/* Ocultar otros módulos cuando Análisis de Proyectos está activo */
body.analisis-proyectos-active #planningStatus,
body.analisis-proyectos-active #presupuestos,
body.analisis-proyectos-active #reportes,
body.analisis-proyectos-active #configuracion {
    display: none !important;
}

/* POSICIONAMIENTO ANÁLISIS DE PROYECTOS */
#controlProyectos {
    position: relative;
    z-index: 100 !important;
    width: 100%;
    max-width: 1650px !important; /* Hacer más ancho el contenedor de partidas */
    top: 0 !important;
    margin: 0 auto !important; /* Centrar el contenedor más ancho */
    margin-top: 0 !important;
    padding: 20px 40px !important; /* Mayor padding horizontal */
    background: #f8f9fa;
    min-height: 100vh;
}

body.analisis-proyectos-active #controlProyectos {
    display: block !important;
}

/* ========================================================================
   FIN PLANNING STATUS MODULE STYLES
   ======================================================================== */

/* ========================================================================
   MENSAJES INFORMATIVOS
   ======================================================================== */

.info-message {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #e6f3ff 0%, #cce7ff 100%);
    border-radius: 12px;
    border: 2px solid #b3d7ff;
    margin: 20px;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.1);
}

.info-message i {
    font-size: 3rem;
    color: #007bff;
    margin-bottom: 15px;
    display: block;
}

.info-message p {
    color: #2c5282;
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
    line-height: 1.5;
}

/* ========================================================================
   FIN MENSAJES INFORMATIVOS
   ======================================================================== */

/* ========================================================================
   UPLOAD OBRA MODULE - ESTRUCTURA BASE
   ======================================================================== */

/* Posicionamiento del módulo Upload Obra */
#uploadObra {
    position: relative;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* CUANDO Upload Obra está activo, posicionarlo absolutamente en la parte superior */
#uploadObra[style*="display: block"] {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 100 !important;
    background: #f8f9fa !important;
    min-height: 100vh !important;
    padding: 20px !important;
}

/* Asegurar que el contenido del Upload Obra aparezca en la parte superior */
#uploadObra .upload-tipo-selector {
    margin-top: 0 !important;
    margin-bottom: 20px;
    position: relative;
    top: 0;
}

/* Cuando Upload Obra está oculto, asegurar que otros módulos se vean */
#uploadObra:not([style*="display: block"]) ~ #controlProyectos,
#uploadObra[style*="display: none"] ~ #controlProyectos {
    display: block !important;
    visibility: visible !important;
}

/* Contenedor principal del Upload Obra */
#uploadObra .upload-tipo-selector {
    margin-top: 0 !important; /* Eliminar margen superior */
    margin-bottom: 20px;
}

/* Selector de Tipo - Estilo Menú Compacto */
.upload-tipo-selector {
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 0 20px 40px 20px; /* Sin margen superior */
}

.tipo-menu-container {
    margin-top: 20px;
}

.tipo-label {
    display: block;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1rem;
}

.tipo-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.tipo-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 20px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    font-family: inherit;
    color: #4a5568;
}

.tipo-btn:hover {
    border-color: #667eea;
    background: #f7fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.15);
}

.tipo-btn.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.tipo-btn i {
    font-size: 1.5rem;
}

.tipo-btn span {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Selector de Proyecto */
.upload-proyecto-selector {
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 20px;
}

.back-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s ease;
    font-size: 0.9rem;
}

.back-btn:hover {
    background: #5a6268;
}

/* Módulo Específico Container */
.upload-modulo-especifico {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 20px;
    min-height: 400px;
}

/* Responsive para Upload Obra */
@media (max-width: 768px) {
    .tipo-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .tipo-btn {
        width: 100%;
        max-width: 250px;
    }
    
    .upload-tipo-selector,
    .upload-proyecto-selector,
    .upload-modulo-especifico {
        margin: 10px;
        padding: 15px;
    }
}

/* ========================================================================
   FIN UPLOAD OBRA MODULE - ESTRUCTURA BASE
   ======================================================================== */

/* ========================================================================
   PESTAÑAS PARA EGRESOS/INGRESOS/VALORIZACIONES
   ======================================================================== */

.processing-results-container {
    margin-top: 20px;
}

.executive-summary {
    margin-bottom: 25px;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.summary-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s ease;
}

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

.summary-card .card-header {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: white;
}

.summary-card.egresos .card-header {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.summary-card.ingresos .card-header {
    background: var(--gradient-success);
}

.summary-card.balance .card-header {
    background: var(--gradient-info);
}

.summary-card .card-header h4 {
    margin: 0;
    font-size: 1rem;
}

.summary-card .card-body {
    padding: 20px;
    text-align: center;
}

.summary-card .stat-main {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.summary-card .stat-detail {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.tabs-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.nav-tabs {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.nav-item {
    flex: 1;
}

.nav-link {
    display: block;
    width: 100%;
    padding: 15px 20px;
    background: transparent;
    border: none;
    text-decoration: none;
    color: #6c757d;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.nav-link:hover:not(:disabled) {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.nav-link.active {
    background: white;
    color: #667eea;
    border-bottom-color: #667eea;
}

.nav-link:disabled {
    color: #adb5bd;
    cursor: not-allowed;
    opacity: 0.6;
}

.tab-content {
    min-height: 500px;
}

.tab-pane {
    display: none;
    padding: 25px;
}

.tab-pane.show.active {
    display: block;
}

.table-controls {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.filter-controls select,
.filter-controls input {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
}

.filter-controls select {
    min-width: 150px;
}

.filter-controls input[type="text"] {
    min-width: 200px;
    flex: 1;
}

.filter-results {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
    margin-left: auto;
}

.table-success {
    background-color: #d1e7dd !important;
    color: #0f5132 !important;
}

.coming-soon {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.coming-soon i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #adb5bd;
}

.coming-soon h4 {
    margin-bottom: 10px;
    color: #495057;
}

/* Responsive para pestañas */
@media (max-width: 768px) {
    .nav-tabs {
        flex-direction: column;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-controls input,
    .filter-controls select {
        min-width: auto;
        width: 100%;
    }
    
    .filter-results {
        margin-left: 0;
        text-align: center;
    }
}

/* ====== FORZAR VISIBILIDAD DE TABLAS GENERADAS ====== */
.tab-pane table,
.tab-pane .table,
#egresos-content table,
#ingresos-content table,
.resultado table {
    display: table !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    height: auto !important;
}

.tab-pane table tbody,
.tab-pane table thead,
.tab-pane table tr,
.tab-pane table td,
.tab-pane table th {
    display: table-row-group !important;
    display: table-header-group !important;
    display: table-row !important;
    display: table-cell !important;
    display: table-cell !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Forzar contenido visible */
.tab-pane.show.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    min-height: 100px !important;
}

/* Asegurar que las tablas grandes se muestren CON SCROLL INDEPENDIENTE */
.tab-pane .table-responsive {
    display: block !important;
    overflow-x: auto !important;
    max-height: 800px !important;
    overflow-y: auto !important;
}

/* Override cualquier CSS que oculte contenido */
.tab-pane * {
    visibility: visible !important;
}

/* Específico para tablas de datos - SCROLL INDEPENDIENTE */
.validation-results .table-responsive {
    max-height: 500px !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    border: 1px solid #dee2e6;
}

.validation-results table {
    height: auto !important;
}

/* Específico para el contenido generado */
#resultado * {
    display: inherit !important;
    visibility: visible !important;
}

/* Estilos para encabezados de tablas con fondos de color */
.table-header-egresos {
    background: linear-gradient(135deg, #ffebee 0%, #fce4ec 100%);
    color: #1a1a1a;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 10px;
    border-left: 3px solid #d32f2f;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 1px 3px rgba(183, 28, 28, 0.15);
    font-size: 0.9rem;
}

.table-header-ingresos {
    background: linear-gradient(135deg, #f1f8e9 0%, #e8f5e8 100%);
    color: #1a1a1a;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 10px;
    border-left: 3px solid #388e3c;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 1px 3px rgba(27, 94, 32, 0.15);
    font-size: 0.9rem;
}

.table-header-valorizaciones {
    background: linear-gradient(135deg, #e8f4fd 0%, #e1f1ff 100%);
    color: #1a1a1a;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 10px;
    border-left: 3px solid #1976d2;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 1px 3px rgba(25, 118, 210, 0.15);
    font-size: 0.9rem;
}

.table-header-egresos i,
.table-header-ingresos i,
.table-header-valorizaciones i {
    margin-right: 6px;
}

/* ========================================================================
   BOTONES DE ACCIÓN EN LA PARTE SUPERIOR Y OPTIMIZACIÓN DE ESPACIO
   ======================================================================== */

.upload-actions-top {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    border-top: 1px solid #e9ecef;
    justify-content: center;
    align-items: center;
}

.upload-actions-top .btn {
    font-size: 0.8rem;
    padding: 6px 10px;
    border-radius: 3px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    line-height: 1;
    flex: 1;
    max-width: 140px;
}

.upload-actions-top .btn i {
    font-size: 0.75rem;
    margin-right: 4px;
}

/* Reducir espacio vertical del contenedor de upload */
.file-upload-zone {
    min-height: auto;
    padding: 12px;
}

.upload-placeholder {
    padding: 16px;
    text-align: center;
}

.upload-placeholder h4 {
    margin: 8px 0 4px 0;
    font-size: 1rem;
}

.upload-placeholder p {
    margin: 4px 0 8px 0;
    font-size: 0.85rem;
}

.upload-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.selected-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #e8f5e8;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Botón X más discreto */
.selected-file .btn-danger {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.2);
    color: rgba(220, 53, 69, 0.7);
    font-size: 0.7rem;
    padding: 2px 6px;
    line-height: 1;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.selected-file .btn-danger:hover {
    background: rgba(220, 53, 69, 0.15);
    border-color: rgba(220, 53, 69, 0.3);
    color: rgba(220, 53, 69, 0.9);
}

.file-info {
    padding: 0;
}

/* ========================================================================
   CONTROL DE SCROLL - TABLAS INDEPENDIENTES
   ======================================================================== */

/* Scroll normal de página */
.main-content {
    overflow: visible;
}

.container {
    overflow: visible;
}

/* CADA TABLA TIENE SU PROPIO SCROLL */
.upload-area-container,
.validation-results,
.processing-summary-horizontal {
    overflow: visible;
}

/* Tablas con scroll independiente para grandes volúmenes de datos */
.validation-results .table-responsive {
    max-height: 800px !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    border: 1px solid #dee2e6 !important;
    margin-bottom: 20px;
}

/* Evitar que elementos flotantes causen scroll extra */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* ========================================================================
   MEJORA VISUAL DE SECCIONES APILADAS
   ======================================================================== */

/* Espaciado consistente entre secciones principales */
.validation-results {
    padding: 0;
    background: transparent;
}

/* Primera tabla sin margen superior extra */
.consolidated-table-container:first-of-type {
    margin-top: 10px;
}

/* Separación simple entre las tablas */
.consolidated-table-container + .consolidated-table-container {
    margin-top: 25px;
}

/* Mejor transición hacia la sección de confirmación */
.confirmation-section {
    margin-top: 30px;
}

/* ========================================================================
   BATCH INSERT PROGRESS TRACKING
   ======================================================================== */

.batch-progress-container {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 25px;
    margin: 20px 0;
}

.batch-progress-info h4 {
    color: #495057;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.batch-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.batch-stat {
    background: #f8f9fa;
    padding: 12px 15px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-weight: 500;
    color: #6c757d;
}

.stat-value {
    font-weight: 600;
    color: #495057;
    font-size: 1.1rem;
}

.progress-bar-container {
    margin: 20px 0;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background-color: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #28a745, #20c997);
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        45deg,
        transparent 33%,
        rgba(255,255,255,.3) 33%,
        rgba(255,255,255,.3) 66%,
        transparent 66%
    );
    background-size: 30px 30px;
    animation: progressStripes 1s linear infinite;
}

@keyframes progressStripes {
    0% { background-position: 0 0; }
    100% { background-position: 30px 0; }
}

.progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 0.9rem;
    color: #6c757d;
}

.batch-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #495057;
}

.detail-item i {
    color: #6c757d;
    width: 16px;
}

.batch-actions {
    margin-top: 20px;
    text-align: center;
}

.batch-success-summary,
.batch-error-summary {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 25px;
    margin: 20px 0;
}

.batch-success-summary h4 {
    color: #28a745;
    margin-bottom: 20px;
}

.batch-error-summary h4 {
    color: #dc3545;
    margin-bottom: 20px;
}

.success-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #dee2e6;
}

.stat-title {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 5px;
    font-weight: 500;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 600;
    color: #28a745;
}

.success-actions,
.error-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.error-details {
    margin: 15px 0;
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
}

.error-logs {
    margin: 15px 0;
    padding: 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
}

.error-logs h5 {
    color: #721c24;
    margin-bottom: 10px;
}

.error-logs ul {
    margin: 0;
    padding-left: 20px;
}

.error-logs li {
    color: #721c24;
    margin-bottom: 5px;
}

/* Responsive para batch progress */
@media (max-width: 768px) {
    .batch-stats {
        grid-template-columns: 1fr;
    }
    
    .batch-details {
        grid-template-columns: 1fr;
    }
    
    .success-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .success-actions,
    .error-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .success-actions .btn,
    .error-actions .btn {
        width: 100%;
        max-width: 300px;
    }
}

/* ========================================================================
   BADGES PARA VALORIZACIONES
   ======================================================================== */

.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
}

.badge-success {
    color: #fff;
    background-color: #28a745;
    border: 1px solid #28a745;
}

.badge-success i {
    margin-right: 3px;
}

.badge-secondary {
    color: #fff;
    background-color: #6c757d;
    border: 1px solid #6c757d;
}

.badge-secondary i {
    margin-right: 3px;
}

/* ========================================================================
   MEDIA QUERIES CONSOLIDADAS (RESPONSIVE)
   ======================================================================== */

/* Mobile First - Base styles above are for mobile */

/* Small devices (landscape phones, 481px and up) */
@media (min-width: 481px) {
    /* Navegación mejorada en pantallas pequeñas */
    .nav-container {
        padding: 0 var(--spacing-lg);
    }
    
    /* Controles con más espacio */
    .controls-main-row {
        gap: var(--spacing-lg);
    }
}

/* Tablets (769px and up) */
@media (min-width: 769px) {
    /* Layout de escritorio para componentes principales */
    .evm-chart-header {
        flex-direction: row;
        align-items: center;
    }
    
    .controls-main-row {
        flex-direction: row;
        align-items: center;
    }
    
    /* Tablas con mejor espaciado */
    .partidas-table th,
    .partidas-table td {
        padding: var(--spacing-md) var(--spacing-lg);
    }
    
    /* Formularios en línea */
    .form-group {
        flex-direction: row;
        align-items: center;
        gap: var(--spacing-md);
    }
}

/* Desktop (1024px and up) */
@media (min-width: 1024px) {
    /* Contenedores con máximo ancho */
    .container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 var(--spacing-2xl);
    }
    
    /* Grids para componentes complejos */
    .dashboard-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-2xl);
    }
}

/* Large screens (1200px and up) */
@media (min-width: 1200px) {
    /* Máximo ancho para contenido principal - AMPLIADO PARA PLANIFICACIÓN */
    .main-content {
        max-width: 1600px; /* 🔴 Aumentado de 1400px a 1600px */
        margin: 0 auto;
    }
    
    /* Grids de 3 columnas para pantallas grandes */
    .summary-cards {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-2xl);
    }
}

/* Mobile-only adjustments */
@media (max-width: 768px) {
    /* Navegación móvil */
    .nav-container {
        flex-direction: column;
        padding: var(--spacing-sm);
    }
    
    /* Headers compactos */
    .evm-chart-header {
        flex-direction: column;
        align-items: stretch;
        padding: var(--spacing-md);
    }
    
    .evm-chart-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .chart-toggle {
        font-size: var(--font-size-sm);
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    /* Controles verticales en móvil */
    .controls-main-row {
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: stretch;
    }
    
    /* Tablas responsivas */
    .partidas-table {
        font-size: var(--font-size-sm);
    }
    
    .partidas-table th,
    .partidas-table td {
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    /* Formularios apilados */
    .form-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    /* Botones de ancho completo */
    .btn-mobile-full {
        width: 100%;
        margin: var(--spacing-xs) 0;
    }
}

/* Extra small devices (360px and down) */
@media (max-width: 360px) {
    /* Tipografía más pequeña */
    :root {
        --font-size-sm: 0.7rem;
        --font-size-md: 0.85rem;
    }
    
    /* Espaciado reducido */
    .container,
    .main-content {
        padding: var(--spacing-xs);
    }
    
    /* Botones más pequeños */
    .chart-toggle,
    .btn {
        font-size: var(--font-size-xs);
        padding: var(--spacing-xs);
    }
}

/* ========================================================================
   UPLOAD OBRA MODULE - APU VALIDATION STYLES
   ======================================================================== */

/* Estilos específicos para validación de APUs */
.apu-validation-details {
    background: linear-gradient(135deg, #f8f9fb 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: var(--spacing-md);
    margin: var(--spacing-sm) 0;
    font-family: 'Courier New', monospace;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.apu-sheet-info {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e3f2fd;
    border-left: 4px solid var(--color-info);
    border-radius: 6px;
    padding: var(--spacing-sm) var(--spacing-md);
    margin: var(--spacing-xs) 0;
    font-size: 0.9rem;
    line-height: 1.5;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.apu-sheet-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, var(--color-info) 0%, var(--color-info-dark) 100%);
}

.apu-sheet-info strong {
    color: var(--color-info-dark);
    display: inline-block;
    margin-bottom: 6px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Estilo para headers válidos */
.headers-valid {
    color: var(--color-success-dark);
    font-weight: 600;
}

.headers-invalid {
    color: var(--color-danger);
    font-weight: 600;
}

/* Mejora visual de validation steps para APUs */
.validation-step.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #c3e6cb;
    border-left: 5px solid var(--color-success);
    color: #155724;
    padding: var(--spacing-md);
    border-radius: 8px;
    margin: var(--spacing-sm) 0;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.2);
    position: relative;
}

.validation-step.success::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(135deg, var(--color-success) 0%, var(--color-success-dark) 100%);
}

.validation-step.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid #f5c6cb;
    border-left: 5px solid var(--color-danger);
    color: #721c24;
    padding: var(--spacing-md);
    border-radius: 8px;
    margin: var(--spacing-sm) 0;
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.2);
    position: relative;
}

.validation-step.error::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(135deg, var(--color-danger) 0%, var(--color-danger-dark) 100%);
}

/* Iconos de validación */
.validation-step i.fa-check-circle {
    color: var(--color-success);
    margin-right: var(--spacing-sm);
    font-size: 1.2em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    animation: successPulse 2s ease-in-out;
}

.validation-step i.fa-exclamation-triangle {
    color: var(--color-danger);
    margin-right: var(--spacing-sm);
    font-size: 1.2em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    animation: errorShake 0.6s ease-in-out;
}

@keyframes successPulse {
    0% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Header count indicators */
.header-count-valid {
    background: var(--color-success);
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    margin-left: 4px;
}

.header-count-invalid {
    background: var(--color-danger);
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    margin-left: 4px;
}

/* Responsive para validación APU */
@media (max-width: 768px) {
    .apu-validation-details {
        padding: var(--spacing-sm);
        margin: var(--spacing-sm) 0;
    }
    
    .apu-sheet-info {
        padding: var(--spacing-sm);
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .validation-step {
        padding: var(--spacing-sm);
    }
}

/* ========================================================================
   ESTILOS ESPECÍFICOS PARA APU PROCESSING
   ======================================================================== */

.apu-processing-summary {
    background: var(--bg-white);
    border: 1px solid #e3e6f0;
    border-radius: 12px;
    padding: var(--spacing-2xl);
    margin: var(--spacing-lg) 0;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.1);
}

.apu-summary-header {
    border-bottom: 2px solid #e3e6f0;
    padding-bottom: var(--spacing-lg);
    margin-bottom: var(--spacing-2xl);
}

.apu-summary-header h4 {
    color: var(--color-primary);
    font-size: 1.5rem;
    margin: 0 0 var(--spacing-md) 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.apu-project-info {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

.apu-project-info span {
    background: var(--bg-light);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-primary);
    border: 1px solid #d1d3e0;
}

.apu-sheets-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
    margin: var(--spacing-2xl) 0;
}

.apu-sheet-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e3e6f0;
    border-radius: 10px;
    padding: var(--spacing-xl);
    transition: all 0.3s ease;
}

.apu-sheet-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.sheet-header h5 {
    color: var(--color-primary);
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.sheet-status {
    background: var(--gradient-success);
    color: white;
    padding: 4px var(--spacing-md);
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.sheet-stats {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid #f0f0f0;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stat-value {
    color: var(--color-primary);
    font-weight: 600;
    font-size: 1rem;
}

.apu-validation-details {
    background: var(--bg-light);
    border-radius: 8px;
    padding: var(--spacing-xl);
    margin: var(--spacing-xl) 0;
}

.apu-validation-details h6 {
    color: var(--color-primary);
    margin: 0 0 var(--spacing-lg) 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 1rem;
}

.validation-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.validation-checklist li {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) 0;
    font-size: 0.95rem;
}

.validation-checklist li i {
    font-size: 1.1rem;
}

.text-success {
    color: var(--color-success) !important;
}

.text-info {
    color: var(--color-info) !important;
}

.text-error,
.stat-value.error {
    color: var(--color-danger) !important;
}

.text-warning,
.stat-value.warning {
    color: var(--color-warning-dark) !important;
}

.stat-item.error {
    background: rgba(220, 53, 69, 0.1);
    border-radius: 4px;
    padding: var(--spacing-xs) var(--spacing-sm);
}

.stat-item.warning {
    background: rgba(255, 193, 7, 0.1);
    border-radius: 4px;
    padding: var(--spacing-xs) var(--spacing-sm);
}

.apu-next-steps {
    margin-top: var(--spacing-2xl);
}

.apu-next-steps .alert {
    background: rgba(23, 162, 184, 0.1);
    border: 1px solid rgba(23, 162, 184, 0.2);
    border-radius: 8px;
    padding: var(--spacing-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
}

.apu-next-steps .alert i {
    color: var(--color-info);
    font-size: 1.2rem;
    margin-top: 2px;
}

.apu-next-steps .alert strong {
    color: var(--color-info);
}

.upload-actions {
    display: flex;
    gap: var(--spacing-lg);
    justify-content: center;
    margin-top: var(--spacing-2xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid #e3e6f0;
}

.upload-actions .btn-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 600;
}

.upload-actions .btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid #d1d3e0;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.upload-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.upload-actions .btn-secondary:hover {
    background: #d4edda;
    border-color: #c3e6cb;
}

/* Responsive para APU */
@media (max-width: 768px) {
    .apu-processing-summary {
        padding: var(--spacing-lg);
        margin: var(--spacing-md) 0;
    }
    
    .apu-sheets-summary {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .apu-project-info {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .upload-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .upload-actions .btn-primary,
    .upload-actions .btn-secondary {
        justify-content: center;
    }
}

/* ========================================================================
   ESTILOS PARA CARGA APU A BASE DE DATOS
   ======================================================================== */

.apu-load-database-section {
    background: var(--bg-white);
    border: 2px solid var(--color-success);
    border-radius: 12px;
    padding: var(--spacing-xl);
    margin-top: var(--spacing-xl);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.1);
}

.apu-type-selection {
    margin: var(--spacing-xl) 0;
}

.apu-type-selection h6 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.apu-type-options {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.apu-type-options .form-check {
    background: var(--bg-light);
    border: 2px solid transparent;
    border-radius: 10px;
    padding: var(--spacing-lg);
    transition: all 0.3s ease;
    cursor: pointer;
}

.apu-type-options .form-check:hover {
    border-color: var(--color-info-light);
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.1);
}

.apu-type-options .form-check-input:checked + .form-check-label {
    color: var(--color-primary);
}

.apu-type-options .form-check:has(.form-check-input:checked) {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(116, 75, 162, 0.1));
    border-color: var(--color-primary);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.apu-type-options .form-check-label {
    cursor: pointer;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    margin-left: var(--spacing-md);
}

.apu-type-options .form-check-label i {
    margin-right: var(--spacing-sm);
    color: var(--color-info);
}

.apu-type-options .form-check-label strong {
    display: flex;
    align-items: center;
    font-size: 16px;
}

.apu-type-options .form-check-label small {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: var(--spacing-xs);
}

.apu-load-actions {
    text-align: center;
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--bg-secondary);
}

.apu-load-actions .btn {
    padding: var(--spacing-lg) var(--spacing-2xl);
    font-size: 16px;
    font-weight: 600;
    border-radius: 25px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 200px;
    justify-content: center;
}

.apu-load-actions .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.apu-load-actions .btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

.load-help-text {
    margin-top: var(--spacing-md);
    color: var(--text-secondary);
    font-style: italic;
}

.load-help-text .text-success {
    color: var(--color-success) !important;
    font-weight: 600;
}

.apu-load-success {
    animation: slideInUp 0.5s ease;
}

.apu-load-success .alert {
    border-left: 4px solid var(--color-success);
    background: linear-gradient(135deg, 
        rgba(40, 167, 69, 0.1), 
        rgba(46, 204, 113, 0.05)
    );
}

.load-summary {
    background: rgba(255, 255, 255, 0.7);
    padding: var(--spacing-md);
    border-radius: 8px;
    margin-top: var(--spacing-md);
    font-family: 'Courier New', monospace;
}

.success-actions {
    display: flex;
    gap: var(--spacing-lg);
    justify-content: center;
    margin-top: var(--spacing-xl);
}

.success-actions .btn {
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

/* Responsive para carga APU */
@media (max-width: 768px) {
    .apu-load-database-section {
        padding: var(--spacing-lg);
        margin: var(--spacing-lg) 0;
    }
    
    .apu-load-actions .btn {
        min-width: auto;
        padding: var(--spacing-md) var(--spacing-lg);
    }
    
    .success-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .apu-type-options .form-check {
        padding: var(--spacing-md);
    }
}

/* =================================================================== */
/* ANÁLISIS DE PROGRAMACIÓN - GRÁFICO MÁS ALTO */
/* =================================================================== */

/* CONFIGURACIÓN UNIFICADA - GRÁFICO ANÁLISIS GRANDE */
#analisisProgramacionChartContainer {
    height: auto !important;
    min-height: 660px !important;
    width: 100% !important;
    display: block !important;
    overflow: visible !important;
}

#analisisProgramacionChart {
    height: 620px !important;
    width: 100% !important;
    display: block !important;
    max-width: none !important;
    max-height: none !important;
}

/* GRÁFICO DE PERSONAL - COPIANDO CONFIGURACIÓN EVM QUE FUNCIONA */
#analisisPersonalChartContainer {
    height: auto !important;
    min-height: 660px !important;
    width: 100% !important;
    display: block !important;
    overflow: visible !important;
}

#analisisPersonalChart {
    height: 620px !important;
    width: 100% !important;
    display: block !important;
    max-width: none !important;
    max-height: none !important;
}

/* GRÁFICO DE EQUIPOS - MISMA CONFIGURACIÓN QUE PERSONAL */
#analisisEquiposChartContainer {
    height: auto !important;
    min-height: 660px !important;
    width: 100% !important;
    display: block !important;
    overflow: visible !important;
}

#analisisEquiposChart {
    height: 620px !important;
    width: 100% !important;
    display: block !important;
    max-width: none !important;
    max-height: none !important;
}

/* ============================================
   MÓDULO DE EXPORTACIÓN EXCEL - QUINTO CONTENEDOR
   ============================================ */

.excel-export-container {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.excel-export-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.excel-export-header h3 {
    color: #2d3748;
    margin-bottom: 8px;
    font-weight: 600;
}

.excel-export-header h3 i {
    color: #38a169;
    margin-right: 10px;
}

.excel-export-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
}

.excel-export-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.excel-export-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.excel-export-card.coming-soon {
    background: #f7fafc;
    border: 2px dashed #cbd5e0;
}

.excel-export-card .card-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.excel-export-card .card-header h4 {
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 1.1rem;
    font-weight: 600;
}

.excel-export-card .card-header h4 i {
    color: #4299e1;
    margin-right: 8px;
}

.excel-export-card .card-header p {
    color: #718096;
    font-size: 0.9rem;
    margin: 0;
}

.export-options {
    margin-bottom: 20px;
}

.export-options .form-check {
    margin-bottom: 10px;
}

.export-options .form-check-label {
    color: #4a5568;
    font-size: 0.9rem;
    cursor: pointer;
}

.export-options .form-check-input:checked {
    background-color: #38a169;
    border-color: #38a169;
}

.btn-export {
    width: 100%;
    padding: 12px 20px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-export:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-export i {
    margin-right: 8px;
}

.export-description {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid #4299e1;
}

.export-description p {
    margin-bottom: 15px;
    color: #4a5568;
}

.export-preview {
    margin-top: 10px;
}

.export-preview strong {
    display: block;
    margin-bottom: 8px;
    color: #2d3748;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    margin: 2px 4px 2px 0;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
}

.badge-secondary {
    background-color: #6c757d;
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .excel-export-grid {
        grid-template-columns: 1fr;
    }
    
    .excel-export-container {
        padding: 20px 15px;
    }
}

/* ========================================================================
   SHORT TERM PLANNING - ESTILOS MINIMALISTAS Y COMPACTOS
   ======================================================================== */

/* Pestañas de Planning - Versión Ultra Compacta */
.planning-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.planning-tab {
    flex: 1;
    padding: 6px 12px;
    background: white;
    border: 1px solid #dee2e6;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 0.9rem;
    font-weight: 600;
}

.planning-tab i {
    display: none; /* Ocultar iconos */
}

.planning-tab small {
    font-size: 0.7rem;
    color: #adb5bd;
}

.planning-tab:hover:not(.disabled) {
    background: #f8f9fa;
}

.planning-tab.active {
    background: var(--gradient-primary);
    color: white;
    border-color: var(--color-primary);
}

.planning-tab.active small {
    color: white;
}

.planning-tab.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Contenido de Pestañas */
.planning-tab-content {
    display: none;
}

.planning-tab-content.active {
    display: block;
}

/* Coming Soon - Compacto */
.coming-soon {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.coming-soon i {
    color: #dee2e6;
    margin-bottom: 12px;
}

.coming-soon h3 {
    margin-bottom: 6px;
    font-size: 1.1rem;
}

/* Controles de Semana - Compacto y Alineado */
.planning-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 10px 12px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-group label {
    margin: 0;
    display: flex;
    align-items: center;
    height: 32px;
}

.control-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Botones compactos para Planning */
#planningStatusView .btn {
    padding: 6px 12px;
    font-size: 0.85rem;
    height: 32px;
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
}

#planningStatusView .btn i {
    font-size: 0.95rem;
}

.week-input {
    padding: 6px 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.85rem;
    height: 32px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
}

.btn-icon {
    padding: 5px 8px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    margin-right: 4px;
}

.btn-icon i {
    font-size: 0.9rem;
}

.btn-icon:hover {
    background: #f8f9fa;
    border-color: var(--color-primary);
}

/* Botón amarillo de editar */
.btn-icon.btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #000;
}

.btn-icon.btn-warning:hover {
    background-color: #ffca2c;
    border-color: #ffc720;
}

/* Botón verde cuando está en modo guardar */
.btn-icon.btn-success {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

.btn-icon.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

/* Información de Semana - Compacta */
.week-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 12px;
}

.week-date-range {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
}

.week-stats {
    display: flex;
    gap: 20px;
}

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

.stat-label {
    font-size: 0.75rem;
    color: #6c757d;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-primary);
}

/* Tabla de Programación - Compacta */
.short-planning-table-container {
    background: white;
    border-radius: 6px;
    overflow: visible;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 12px;
}

.short-planning-table {
    width: 100%;
    border-collapse: collapse;
    overflow: visible;
}

.short-planning-table tbody {
    overflow: visible;
}

.short-planning-table thead {
    background: var(--gradient-primary);
    color: white;
}

.short-planning-table th {
    padding: 8px 6px;
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    border: 1px solid rgba(255,255,255,0.2);
}

.short-planning-table th.col-partida {
    text-align: left;
    min-width: 180px;
}

.short-planning-table th.col-bloque {
    min-width: 90px;
}

.short-planning-table th.col-restante {
    min-width: 100px;
}

.short-planning-table th.col-retraso {
    min-width: 90px;
}

.short-planning-table th.col-cumplimiento {
    min-width: 110px;
}

.short-planning-table th.dia {
    min-width: 70px;
}

.short-planning-table th.dia small {
    font-size: 0.7rem;
    font-weight: 400;
}

/* Filas de la tabla - Compactas */
.plan-row {
    background: #f8f9fa;
}

.real-row {
    background: white;
    border-bottom: 2px solid #e9ecef;
}

.short-planning-table td {
    padding: 6px 6px;
    text-align: center;
    font-size: 0.85rem;
    border: 1px solid #dee2e6;
}

/* Colores distintivos para filas PLAN y REAL */
.day-cell.plan {
    background-color: #e3f2fd;
    color: #1976d2;
    font-weight: 600;
}

.day-cell.plan.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.day-cell.plan.clickable:hover {
    background-color: #bbdefb;
    border-color: #1976d2;
    box-shadow: 0 2px 4px rgba(25, 118, 210, 0.2);
    transform: translateY(-1px);
}

/* Celda de cantidad programada editable */
.day-cell.plan.editable-plan {
    cursor: pointer;
    transition: all 0.2s ease;
}

.day-cell.plan.editable-plan:hover {
    background-color: #bbdefb;
    border-color: #1976d2;
}

/* Celda bloqueada (semana pasada) */
.day-cell.plan.locked {
    cursor: not-allowed;
    opacity: 0.6;
}

.day-cell.plan.locked:hover {
    background-color: #e3f2fd;
}

/* Modo edición activo en Short Term */
.day-cell.plan.editing-active-short {
    background-color: #fff9e6 !important;
    box-shadow: inset 0 0 0 2px #ffc107;
}

.day-cell.plan.editing-active-short:hover {
    background-color: #fff3cd !important;
}

/* Celda modificada pendiente de guardar */
.day-cell.plan[data-modified="true"] {
    border: 2px solid #007bff !important;
    background-color: #e7f3ff !important;
    position: relative;
}

.day-cell.plan[data-modified="true"]::after {
    content: "●";
    position: absolute;
    top: 2px;
    right: 4px;
    color: #007bff;
    font-size: 0.6rem;
}

.day-cell.real {
    background-color: #e8f5e9;
    color: #2e7d32;
    font-weight: 600;
}

.day-cell.real.sin-plan {
    background-color: #e8f5e9;
    color: #2e7d32;
    font-style: italic;
    cursor: pointer;
}

.day-cell.real.sin-plan:hover {
    background-color: #d4edda;
    border-color: #28a745;
}

.partida-cell {
    text-align: left;
}

.partida-info {
    display: flex;
    flex-direction: column;
}

.partida-info .codigo {
    font-weight: 600;
    color: var(--color-primary);
    font-size: 0.8rem;
}

.partida-info .nombre {
    color: #495057;
    font-size: 0.85rem;
}

.partida-info .tipo-partida {
    color: #6c757d;
    font-size: 0.75rem;
    font-weight: 700;
}

.bloque-cell {
    font-weight: 600;
    color: #6c757d;
}

.restante-cell {
    font-weight: 600;
    color: var(--color-info);
}

.retraso-cell {
    font-weight: 600;
    color: #6c757d;
    font-size: 0.85rem;
    text-align: center;
}

/* Estilos para % Retraso - Colores en texto */
.retraso-cell.retraso-no-iniciado {
    color: #dc3545;
    font-weight: 700;
}

.retraso-cell.retraso-atrasado {
    color: #fd7e14;
    font-weight: 700;
}

.retraso-cell.retraso-bien {
    color: #28a745;
    font-weight: 700;
}

/* Estilos para el selector de partidas con colores de retraso */
.partida-select-retraso option.retraso-no-iniciado {
    color: #dc3545;
    font-weight: 600;
}

.partida-select-retraso option.retraso-atrasado {
    color: #fd7e14;
    font-weight: 600;
}

.partida-select-retraso option.retraso-bien {
    color: #28a745;
    font-weight: 600;
}

/* Estilos para spans dentro de las celdas de retraso en modo edición */
#newRetrasoDisplay .retraso-no-iniciado {
    color: #dc3545;
    font-weight: 700;
}

#newRetrasoDisplay .retraso-atrasado {
    color: #fd7e14;
    font-weight: 700;
}

#newRetrasoDisplay .retraso-bien {
    color: #28a745;
    font-weight: 700;
}

.cumplimiento-cell {
    font-weight: 700;
    font-size: 0.9rem;
}

.cumplimiento-alto {
    background-color: #d4edda;
    color: #155724;
}

.cumplimiento-medio {
    background-color: #fff3cd;
    color: #856404;
}

.cumplimiento-bajo {
    background-color: #f8d7da;
    color: #721c24;
}

.label-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 3px 8px !important;
}

.label-plan {
    font-weight: 700;
    color: var(--color-primary);
    font-size: 0.7rem;
}

.label-real {
    font-weight: 700;
    color: var(--color-success);
    font-size: 0.7rem;
}

.day-cell {
    font-weight: 600;
}

.day-cell.plan {
    color: var(--color-primary);
    background: #e7f3ff;
}

.day-cell.real {
    color: var(--color-success);
    cursor: pointer;
    transition: background 0.2s;
}

.day-cell.real:hover {
    background: #d4edda;
}

.day-cell.real.has-value {
    background: #d4edda;
}

.total-cell {
    font-weight: 700;
    font-size: 0.9rem;
    background: #fff3cd !important;
}

.actions-cell {
    vertical-align: middle;
}

.btn-icon i {
    font-size: 0.9rem;
}

/* Estado Vacío - Compacto */
.empty-state {
    text-align: center;
    padding: 40px 20px !important;
    color: #6c757d;
}

.empty-state i {
    color: #dee2e6;
    margin-bottom: 12px;
}

/* Modal - Compacto */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.modal-content.modal-large {
    max-width: 900px;
}

.modal-content.modal-sm {
    max-width: 500px;
}

.modal-header {
    padding: 12px 16px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gradient-primary);
    color: white;
    border-radius: 8px 8px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(255,255,255,0.2);
}

.modal-body {
    padding: 16px;
}

.modal-footer {
    padding: 12px 16px;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

/* Formulario Inline para Agregar Actividad */
.planning-form-container {
    background: white;
    border: 2px solid var(--color-primary);
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.planning-form-header {
    background: var(--gradient-primary);
    color: white;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 6px 6px 0 0;
}

.planning-form-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.planning-form-header h4 i {
    margin-right: 8px;
}

.btn-close-form {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-close-form:hover {
    background: rgba(255,255,255,0.2);
}

.planning-form {
    padding: 16px;
}

.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.form-group label {
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    color: #495057;
}

.form-group label i {
    margin-right: 6px;
    color: var(--color-primary);
}

.form-group select,
.form-group input {
    padding: 6px 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.85rem;
    height: 32px;
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.partida-info-inline {
    display: flex;
    gap: 20px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

.partida-info-inline .info-item {
    display: flex;
    gap: 6px;
}

.partida-info-inline strong {
    color: #495057;
}

.form-section-compact {
    margin-bottom: 12px;
}

.form-section-compact h5 {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #333;
}

.form-section-compact h5 i {
    margin-right: 6px;
    color: var(--color-primary);
}

.week-inputs-grid-compact {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.day-input-compact {
    display: flex;
    flex-direction: column;
}

.day-input-compact label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 4px;
    text-align: center;
}

.day-input-compact small {
    font-size: 0.7rem;
    color: #6c757d;
}

.day-input-compact input {
    padding: 4px 6px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.8rem;
    text-align: center;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #e9ecef;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
    
    .week-inputs-grid-compact {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .partida-info-inline {
        flex-direction: column;
        gap: 8px;
    }
}

/* Fila Editable en Tabla */
.edit-row {
    background: #fffbea !important;
    border: 2px solid var(--color-primary);
    position: relative;
    z-index: 100;
}

.edit-row td {
    padding: 8px !important;
    vertical-align: middle;
}

.edit-row td.partida-cell {
    min-width: 250px;
    max-width: 350px;
    overflow: visible;
}

.edit-row .form-control {
    width: 100%;
    padding: 6px 8px;
    font-size: 0.85rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    box-sizing: border-box;
}

.edit-row .form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.edit-row select.form-control {
    height: 32px;
    cursor: pointer;
}

.edit-row .partida-select-container {
    position: relative;
    z-index: 9999;
}

.edit-row .partida-dropdown {
    position: absolute;
    top: 36px;
    left: 0;
    width: 100%;
    min-width: 450px;
    max-width: 600px;
    max-height: 350px;
    overflow-y: auto;
    background: white;
    border: 2px solid var(--color-primary);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 99999;
}

.edit-row .partida-option {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
    line-height: 1.4;
    display: block;
    width: 100%;
}

.edit-row .partida-option:hover {
    background: #f8f9fa;
}

.edit-row .partida-option .codigo {
    font-weight: 600;
    color: var(--color-primary);
    font-size: 0.8rem;
    display: inline;
}

.edit-row .partida-option .tipo {
    color: #6c757d;
    font-size: 0.75rem;
    margin-left: 6px;
    display: inline;
}

.edit-row .partida-option .nombre {
    color: #495057;
    font-size: 0.85rem;
    display: block;
}

/* Colores de retraso en opciones */
.edit-row .partida-option.retraso-critico {
    border-left: 4px solid #dc3545;
}

.edit-row .partida-option.retraso-alto {
    border-left: 4px solid #fd7e14;
}

.edit-row .partida-option.retraso-medio {
    border-left: 4px solid #ffc107;
}

.edit-row .partida-option.retraso-bajo {
    border-left: 4px solid #28a745;
}

.edit-row input[type="text"]#inlinePartidaSearch {
    height: 32px;
    font-size: 0.85rem;
}

.edit-row input[type="number"].form-control {
    text-align: center;
    height: 32px;
}

.edit-row .btn-icon {
    margin: 2px;
}

.edit-row .btn-success {
    background: #28a745;
    color: white;
}

.edit-row .btn-success:hover {
    background: #218838;
}

.edit-row .btn-danger {
    background: #dc3545;
    color: white;
}

.edit-row .btn-danger:hover {
    background: #c82333;
}

.edit-row .restante-cell {
    font-size: 0.8rem;
    color: #666;
}

.edit-row .total-cell {
    font-weight: bold;
    color: var(--color-primary);
}

/* Celdas REAL Editables */
.day-cell.real.editable {
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
}

.day-cell.real.editable:hover {
    background: #c8e6c9 !important;
}

.day-cell.real.editable .click-edit {
    color: #66bb6a;
    font-size: 0.7rem;
    font-style: italic;
}

.day-cell.real.editable:hover .click-edit {
    color: #2e7d32;
    font-weight: 600;
}

.real-inline-input {
    width: 60px !important;
    padding: 4px !important;
    text-align: center !important;
    border: 2px solid var(--color-primary) !important;
    border-radius: 4px !important;
    font-size: 0.85rem !important;
    box-sizing: border-box;
}

.real-inline-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Cambios pendientes de guardar */
.day-cell.pending-change {
    background: #fff3cd !important;
    border: 2px solid #ffc107 !important;
    animation: pulse 1.5s infinite;
}

/* 🔴 TOOLTIP PERSONALIZADO - Solo aparece si HAY data-tooltip */
.day-cell.plan.clickable {
    position: relative;
}

/* Solo aplicar el tooltip si el atributo data-tooltip existe y no está vacío */
.day-cell.plan.clickable[data-tooltip]:not([data-tooltip=""])::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%; /* 🔴 Posicionar arriba de la celda */
    left: 50%;
    transform: translateX(-50%); /* 🔴 Centrar horizontalmente */
    margin-bottom: 8px;
    
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: normal;
    white-space: pre-wrap;
    max-width: 300px;
    min-width: 150px;
    line-height: 1.4;
    text-align: left;
    
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 9999;
    
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Flecha apuntando hacia abajo - Solo si hay data-tooltip */
.day-cell.plan.clickable[data-tooltip]:not([data-tooltip=""])::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 2px;
    
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 10000;
}

.day-cell.plan.clickable[data-tooltip]:not([data-tooltip=""]):hover::after,
.day-cell.plan.clickable[data-tooltip]:not([data-tooltip=""]):hover::before {
    opacity: 1;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.4);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(255, 193, 7, 0);
    }
}

/* Formularios del Modal */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group.col-4 {
    flex: 0 0 33.333%;
}

.form-group.col-6 {
    flex: 0 0 50%;
}

.form-group.col-8 {
    flex: 0 0 66.666%;
}

.form-group label {
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.form-control {
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.partida-info-display {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    gap: 30px;
}

.partida-info-display .info-item {
    display: flex;
    gap: 5px;
    align-items: center;
}

.partida-info-display strong {
    color: #495057;
}

.form-section {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.form-section h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.help-text {
    color: #6c757d;
    font-size: 0.85rem;
    margin-bottom: 15px;
}

/* Grid de Días */
.week-inputs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.day-input label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
    font-size: 0.85rem;
}

.day-input small {
    color: #6c757d;
}

.form-total {
    padding: 15px;
    background: #fff3cd;
    border-radius: 8px;
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 10px;
}

.form-total strong {
    color: #856404;
}

.form-validation {
    padding: 10px 15px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Editar Real Modal */
.edit-real-info,
.edit-comment-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.edit-real-info p,
.edit-comment-info p {
    margin: 5px 0;
    font-size: 0.9rem;
}

.form-text {
    display: block;
    margin-top: 5px;
    font-size: 0.875rem;
    color: #6c757d;
    font-style: italic;
}

/* Indicador de campo requerido */
.required {
    color: #dc3545;
    font-weight: bold;
    margin-left: 2px;
}

/* Estilos para select de categorías */
select.categoria-select {
    cursor: pointer;
    font-size: 1rem;
    padding: 10px 12px;
    height: auto;
    line-height: 1.5;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

select.categoria-select:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

select.categoria-select option {
    padding: 10px;
    font-size: 1rem;
    line-height: 1.6;
}

/* Estilos generales para selects */
select.form-control {
    cursor: pointer;
    font-size: 0.95rem;
}

select.form-control option {
    padding: 8px;
    font-size: 0.95rem;
}

.desviacion-display {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
}

.desviacion-valor {
    color: #6c757d;
}

.desviacion-valor.positiva {
    color: var(--color-success);
}

.desviacion-valor.negativa {
    color: var(--color-danger);
}

.desviacion-porcentaje {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Resumen CCP - Compacto */
.ccp-summary {
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    overflow: hidden;
    margin-top: 8px;
}

.ccp-summary .resumen-header {
    background: var(--gradient-primary);
    padding: 8px 15px;
}

.ccp-summary .resumen-header h4 {
    margin: 0;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
}

.ccp-summary .resumen-content {
    padding: 0;
}

.ccp-summary .ccp-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}

.ccp-summary .stat-card {
    padding: 6px 10px;
    border-right: 1px solid #e9ecef;
}

.ccp-summary .stat-card:last-child {
    border-right: none;
}

.ccp-summary .stat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ccp-summary .stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
}

.ccp-summary .stat-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
}

.ccp-summary .stat-unit {
    font-size: 0.7rem;
    color: #999;
}

.stat-card.ccp-main {
    background: #f8f9fa;
}

/* Colores dinámicos para CCP */
.ccp-percentage.ccp-bajo {
    color: #dc3545 !important;
}

.ccp-percentage.ccp-alto {
    color: #28a745 !important;
}

/* ==========================================
   GRÁFICO DE PARETO - CAUSAS NO CUMPLIMIENTO
   ========================================== */
.pareto-chart-container {
    background: white;
    border-radius: 8px;
    padding: 0;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.pareto-chart-container .resumen-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 8px 15px;
    border-radius: 8px 8px 0 0;
}

.pareto-chart-container .resumen-header h4 {
    color: white;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.pareto-chart-container .resumen-content {
    padding: 15px;
}

/* Layout de 2 columnas: Gráfico + Estadísticas */
.pareto-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    align-items: start;
}

/* Columna del gráfico */
.pareto-chart-column {
    position: relative;
    width: 100%;
    height: 400px;
}

.pareto-chart-column canvas {
    width: 100% !important;
    height: 100% !important;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
    display: block;
}

/* Columna de estadísticas */
.pareto-stats-column {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.pareto-stats-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1.2fr 0.8fr;
    gap: 8px;
    padding: 8px 12px;
    background: #f0f0f0;
    border-radius: 6px 6px 0 0;
    font-weight: 600;
    font-size: 0.85rem;
    color: #555;
    border-bottom: 2px solid #ddd;
}

.pareto-stats {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #f8f9fa;
    border-radius: 0 0 6px 6px;
    overflow: hidden;
}

.pareto-stat-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1.2fr 0.8fr;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e0;
    border-left: 4px solid;
    background: white;
    transition: all 0.2s;
    align-items: center;
}

.pareto-stat-row:last-child {
    border-bottom: none;
}

.pareto-stat-row:hover {
    background: #f9f9f9;
    transform: translateX(2px);
}

.pareto-stat-row .categoria-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
}

.pareto-stat-row .stat-value {
    font-size: 0.9rem;
    color: #555;
    text-align: center;
}

.pareto-stat-row .stat-monto {
    font-size: 0.85rem;
    color: #666;
    text-align: right;
}

.pareto-stat-row .stat-porcentaje {
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    color: #764ba2;
}

/* Colores de categorías */
.pareto-stat-row.categoria-materiales {
    border-color: #2196F3;
}

.pareto-stat-row.categoria-mano-obra {
    border-color: #FF9800;
}

.pareto-stat-row.categoria-equipos {
    border-color: #9C27B0;
}

.pareto-stat-row.categoria-clima {
    border-color: #03A9F4;
}

.pareto-stat-row.categoria-diseno {
    border-color: #4CAF50;
}

.pareto-stat-row.categoria-dependencias {
    border-color: #FFC107;
}

.pareto-stat-row.categoria-presupuesto {
    border-color: #F44336;
}

.pareto-stat-row.categoria-planificacion {
    border-color: #00BCD4;
}

.pareto-stat-row.categoria-otros {
    border-color: #9E9E9E;
}

.pareto-stat-row .categoria-icon {
    margin-right: 6px;
    font-size: 1.1rem;
}

/* Estilos legacy removidos */
.pareto-stat-card.categoria-mano-obra,
.pareto-stat-card.categoria-equipos,
.pareto-stat-card.categoria-clima,
.pareto-stat-card.categoria-diseno,
.pareto-stat-card.categoria-dependencias,
.pareto-stat-card.categoria-presupuesto,
.pareto-stat-card.categoria-planificacion,
.pareto-stat-card.categoria-otros {
    display: none;
}

.pareto-stat-card .categoria-nombre {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pareto-stat-card .categoria-icon {
    font-size: 1.3rem;
}

.pareto-stat-card .estadistica {
    display: flex;
    justify-content: space-between;
    margin: 4px 0;
    font-size: 0.85rem;
}

.pareto-stat-card .estadistica .label {
    color: #666;
}

.pareto-stat-card .estadistica .value {
    font-weight: 600;
    color: #333;
}

.pareto-stat-card .estadistica.destacada {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    padding: 6px 10px;
    border-radius: 4px;
    margin: 8px -5px;
}

.pareto-stat-card .estadistica.destacada .value.monto {
    color: #667eea;
    font-size: 1.05rem;
    font-weight: 700;
}

.pareto-stat-card .porcentaje-principal {
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #dee2e6;
    color: #667eea;
}

/* Responsive */
@media (max-width: 768px) {
    .planning-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-actions {
        flex-direction: column;
    }
    
    .week-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .week-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .short-planning-table {
        font-size: 0.8rem;
    }
    
    .week-inputs-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .ccp-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-card {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }
    
    .stat-card:nth-child(2n) {
        border-right: none;
    }
}

/* ================================================================ */
/* MID TERM PLANNING STYLES */
/* ================================================================ */

/* Tabla Mid Term (4 semanas = 28 columnas) */
.mid-planning-table-container {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.mid-planning-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.7rem; /* Reducido de 0.8rem */
    background: white;
    min-width: 2000px; /* Asegurar scroll horizontal */
}

.mid-planning-table thead {
    background: #764ba2; /* Morado sólido sin degradado */
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mid-planning-table th {
    padding: 6px 4px; /* Reducido de 8px 6px */
    text-align: center;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.2);
    font-size: 0.7rem; /* Añadido */
}

/* Cabecera de semanas */
.mid-planning-table th.semana {
    background: rgba(0,0,0,0.1);
    font-size: 0.75rem; /* Reducido de 0.9rem */
    font-weight: 700;
    border-bottom: 2px solid rgba(255,255,255,0.3);
}

/* Cabecera de días */
.mid-planning-table th.dia {
    font-size: 0.65rem; /* Reducido de 0.75rem */
    font-weight: 500;
    padding: 4px 2px; /* Reducido de 6px 4px */
    min-width: 38px; /* Reducido de 45px */
}

.mid-planning-table th.dia small {
    display: block;
    font-size: 0.6rem; /* Reducido de 0.7rem */
    opacity: 0.8;
    margin-top: 2px;
}

/* Columnas sticky (fijas al hacer scroll) */
.mid-planning-table th.sticky-col,
.mid-planning-table td.sticky-col {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 5;
    border-right: 2px solid #dee2e6;
    min-width: 80px;
    font-weight: 600;
}

.mid-planning-table th.sticky-col-2,
.mid-planning-table td.sticky-col-2 {
    position: sticky;
    left: 80px;
    background: #fff;
    z-index: 5;
    border-right: 2px solid #dee2e6;
    min-width: 200px;
    text-align: left;
}

.mid-planning-table th.sticky-col-3,
.mid-planning-table td.sticky-col-3 {
    position: sticky;
    left: 280px;
    background: #fff;
    z-index: 5;
    border-right: 2px solid #dee2e6;
    min-width: 100px;
}

.mid-planning-table thead th.sticky-col,
.mid-planning-table thead th.sticky-col-2,
.mid-planning-table thead th.sticky-col-3 {
    background: #764ba2; /* Morado sólido */
}

/* Celdas del body */
.mid-planning-table tbody td {
    padding: 6px 4px; /* Reducido de 8px 6px */
    text-align: center;
    border: 1px solid #dee2e6;
    font-size: 0.7rem; /* Reducido de 0.8rem */
}

/* Celdas editables */
.mid-planning-table td.editable-cell {
    background: #ffffff; /* Blanco por defecto */
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 38px; /* Reducido de 45px */
}

.mid-planning-table td.editable-cell:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* Celda con valor (verde) */
.mid-planning-table td.editable-cell.has-value {
    background: #d4edda; /* Verde suave */
    color: #155724;
    font-weight: 600;
}

.mid-planning-table td.editable-cell.has-value:hover {
    background: #c3e6cb;
}

/* Celda con restricciones parciales (naranja) */
.mid-planning-table td.editable-cell.has-partial-restriction {
    background: #fff3cd; /* Naranja suave */
    color: #856404;
    font-weight: 600;
}

.mid-planning-table td.editable-cell.has-partial-restriction:hover {
    background: #ffeaa7;
}

/* Celda con restricciones totales (rojo) */
.mid-planning-table td.editable-cell.has-total-restriction {
    background: #f8d7da; /* Rojo suave */
    color: #721c24;
    font-weight: 600;
}

.mid-planning-table td.editable-cell.has-total-restriction:hover {
    background: #f5c6cb;
}

.mid-planning-table td.editable-cell:empty {
    background: #ffffff; /* Blanco para celdas vacías */
}

.mid-planning-table td.editable-cell:empty:hover {
    background: #f8f9fa;
}

/* Columna Total */
.mid-planning-table td.col-total,
.mid-planning-table th.col-total {
    background: #fff3cd;
    font-weight: 700;
    font-size: 0.85rem;
    border-left: 2px solid #ffc107;
}

/* Modo edición activo por fila */
.mid-planning-table td.editable-cell.editing-active {
    cursor: pointer;
    box-shadow: inset 0 0 0 1px #ffc10733;
    background: #fff9e6 !important;
}

.mid-planning-table td.editable-cell.editing-active:hover {
    background: #fff3cd !important;
    box-shadow: 0 0 0 2px #ffc107;
}

/* Celdas modificadas pendientes de guardar */
.mid-planning-table td.editable-cell[data-modified="true"] {
    border: 2px solid #007bff !important;
    background: #e7f3ff !important;
    position: relative;
}

.mid-planning-table td.editable-cell[data-modified="true"]::after {
    content: "●";
    position: absolute;
    top: 2px;
    right: 4px;
    color: #007bff;
    font-size: 0.6rem;
}

/* Columna Estado Restricciones */
.mid-planning-table td.col-restricciones,
.mid-planning-table th.col-restricciones {
    min-width: 150px;
}

/* Columna Acciones */
.mid-planning-table td.col-acciones,
.mid-planning-table th.col-acciones {
    min-width: 100px;
}

/* Botones en acciones */
.mid-planning-table td.col-acciones .btn {
    padding: 4px 8px;
    font-size: 0.75rem;
}

/* Leyenda de restricciones */
.restrictions-legend {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.restrictions-legend h5 {
    margin: 0 0 10px 0;
    font-size: 1rem;
    color: #495057;
}

.restrictions-legend .badge {
    font-size: 0.85rem;
    padding: 5px 10px;
    margin-right: 5px;
}

/* Display de rango de semanas */
.week-range-display {
    font-weight: 600;
    color: #495057;
    font-size: 1rem;
    padding: 8px 12px;
    background: #e9ecef;
    border-radius: 6px;
}

/* Responsive para Mid Term */
@media (max-width: 1400px) {
    .mid-planning-table {
        font-size: 0.75rem;
    }
    
    .mid-planning-table th.dia {
        min-width: 40px;
        padding: 4px 2px;
    }
    
    .mid-planning-table td.editable-cell {
        min-width: 40px;
        padding: 6px 4px;
    }
}

@media (max-width: 1200px) {
    .mid-planning-table th.sticky-col-2,
    .mid-planning-table td.sticky-col-2 {
        min-width: 150px;
    }
}

/* Fila de edición Mid Term */
.mid-planning-table tr.edit-row {
    background: #fff3cd;
    border: 2px solid #ffc107;
}

.mid-planning-table tr.edit-row td {
    padding: 8px;
    vertical-align: middle;
}

.mid-day-input {
    width: 60px !important;
    padding: 4px 6px !important;
    font-size: 0.85rem !important;
    text-align: center;
}

.mid-total-edit {
    font-weight: 700;
    font-size: 0.95rem;
    background: #ffecb3;
}

.mid-partida-select,
.mid-bloque-input {
    font-size: 0.9rem;
}

.mid-partida-info {
    font-size: 0.85rem;
    line-height: 1.4;
}


