:root {
    /* Nueva Paleta Nexus Solutions */
    --primary-deep: #061532;
    --accent-amber: #FDA412;
    --primary-dark: #14223D;
    --bg-light: #EDEDED;
    --accent-orange: #FE5802;
    --near-black: #090A1C;
    --coral: #F8682D;
    --dark-panel: #11151D;
    --text-muted: #8892b0;
    --white: #ffffff;
    
    --sidebar-width: 260px;
    --radius-sharp: 0px; /* Bordes afilados según instrucción */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--near-black);
    overflow-x: hidden;
}

/* Sidebar Styling - Estilo Oscuro Profundo */
#sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    background: var(--near-black);
    color: var(--white);
    transition: all 0.3s;
    z-index: 1000;
    border-right: 2px solid var(--primary-deep);
}

#sidebar .sidebar-header {
    background: var(--primary-deep);
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

#sidebar .nav-link {
    color: var(--text-muted);
    padding: 14px 25px;
    border-radius: var(--radius-sharp);
    margin: 0;
    transition: 0.3s;
    font-size: 0.9rem;
    border-left: 4px solid transparent;
}

#sidebar .nav-link:hover, #sidebar .nav-link.active {
    background: var(--primary-dark);
    color: var(--accent-amber);
    border-left: 4px solid var(--accent-orange);
}

#sidebar .nav-link i {
    margin-right: 12px;
    font-size: 1.1rem;
}

#sidebar .nav-link[data-bs-toggle="collapse"]::after {
    content: '\F282'; /* bi-chevron-down */
    font-family: 'bootstrap-icons';
    float: right;
    transition: transform 0.3s;
    font-size: 0.8rem;
}

#sidebar .nav-link[data-bs-toggle="collapse"][aria-expanded="true"]::after {
    transform: rotate(180deg);
}

#sidebar .active-parent {
    color: var(--accent-amber) !important;
    background: var(--primary-dark);
    border-left: 4px solid var(--accent-orange);
}

#sidebar .collapse .nav-link {
    border-left: none !important;
    padding-left: 40px;
}

#sidebar .collapse .nav-link:hover, #sidebar .collapse .nav-link.active {
    background: rgba(255,255,255,0.05);
}

/* Main Content Area */
#content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#top-navbar {
    position: sticky;
    top: 0;
    z-index: 999;
    background: var(--white);
    border-bottom: 1px solid rgba(0,0,0,0.05) !important;
}

.main-body {
    padding: 30px;
    flex: 1;
}

/* Cards & Panels - Bordes Afilados */
.card {
    border: none;
    border-radius: var(--radius-sharp) !important;
    background: var(--white);
    box-shadow: 10px 10px 0px rgba(6, 21, 50, 0.05); /* Sombra rígida */
    border: 1px solid #dee2e6;
}

.card-header {
    background: var(--white);
    border-bottom: 2px solid var(--bg-light);
    border-radius: 0 !important;
    padding: 15px 20px;
}

/* KPI Cards */
.card-kpi {
    border-left: 5px solid var(--primary-deep) !important;
}

.kpi-icon {
    width: 45px;
    height: 45px;
    border-radius: var(--radius-sharp);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.bg-blue-soft { background: var(--primary-deep); color: var(--white); }
.bg-orange-soft { background: var(--accent-orange); color: var(--white); }
.bg-primary-deep { background-color: var(--primary-deep) !important; }

/* Buttons - Estilo Recto */
.btn {
    border-radius: var(--radius-sharp) !important;
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 12px 25px;
}

.btn-nexus {
    background: var(--primary-deep);
    color: var(--white);
    border: none;
}

.btn-nexus:hover {
    background: var(--accent-orange);
    color: var(--white);
}

.btn-outline-primary {
    border: 2px solid var(--primary-deep);
    color: var(--primary-deep);
}

.btn-outline-primary:hover {
    background: var(--primary-deep);
    border-color: var(--primary-deep);
}

/* Tables */
.table thead th {
    background: var(--primary-deep);
    color: var(--white);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    padding: 15px;
    border: none;
}

.table tbody td {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

/* Gantt Light Styles - Sharp */
.gantt-bar-bg {
    height: 30px;
    background: #f0f0f0;
    border-radius: 0;
    overflow: hidden;
    position: relative;
    border: 1px solid #ddd;
}

.gantt-bar-fill {
    height: 100%;
    border-radius: 0;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    padding-left: 10px;
}

.bg-primary-blue { background: var(--primary-deep) !important; }
.bg-accent-orange { background: var(--accent-orange) !important; }

/* Modal Sharp */
.modal-content {
    border-radius: 0 !important;
    border: 5px solid var(--primary-deep);
}

/* Inputs Sharp */
.form-control, .form-select {
    border-radius: 0 !important;
    border: 1px solid #ccc;
    padding: 10px 15px;
}

.form-control:focus {
    border-color: var(--accent-orange);
    box-shadow: none;
}

/* Layout Responsivo */
@media (max-width: 992px) {
    :root {
        --sidebar-width: 0px;
    }
    #sidebar {
        left: -260px;
        width: 260px;
    }
    #sidebar.active {
        left: 0;
    }
    #content {
        margin-left: 0;
        width: 100%;
        padding: 15px;
    }
}

/* Tablas Responsivas */
@media (max-width: 768px) {
    .table thead { display: none; }
    .table tbody td { display: block; text-align: right; border-bottom: 1px solid #eee; padding: 10px; }
    .table tbody td::before { content: attr(data-label); float: left; font-weight: bold; text-transform: uppercase; font-size: 0.7rem; color: var(--text-muted); }
    .btn-group { display: flex; width: 100%; }
    .btn-group .btn { flex: 1; }
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-light); }
::-webkit-scrollbar-thumb { background: var(--primary-deep); }
::-webkit-scrollbar-thumb:hover { background: var(--accent-orange); }

/* --- Advanced Price Comparator (Nexus Style) --- */
:root {
    --nexus-blue: #061532;
    --nexus-orange: #FE5802;
    --nexus-dark: #14223D;
}

.bg-nexus-blue { background-color: var(--nexus-blue) !important; }
.text-nexus-orange { color: var(--nexus-orange) !important; }

.table-excel {
    border: 1px solid #dee2e6;
    font-size: 0.85rem;
    background: white;
}

.table-excel thead th {
    background-color: white;
    color: var(--nexus-blue);
    text-align: center;
    border: 1px solid #dee2e6 !important;
    border-bottom: 2px solid var(--nexus-orange) !important;
    padding: 10px;
    font-weight: 700;
}

.table-excel .bg-stats {
    background-color: var(--bg-stats) !important;
    color: white !important;
}

.table-excel .bg-stats-light {
    background-color: #F8F9FA;
    color: var(--nexus-blue);
    border-left: 2px solid var(--nexus-orange) !important;
}

.table-excel .bg-footer-total {
    background-color: #F4ECF7;
}

.form-control-excel {
    border: 1px solid transparent;
    background-color: #ffffff !important;
    width: 100%;
    padding: 8px 12px;
    font-size: 0.85rem;
    transition: all 0.2s;
    color: var(--nexus-blue);
}

.form-control-excel:hover {
    border-color: #ddd;
    background: #fdfdfd;
}

.form-control-excel:focus {
    background-color: #FFF9C4;
    border-color: var(--nexus-orange);
    outline: none;
    box-shadow: none;
}

.table-excel-extra th {
    font-size: 0.75rem;
    vertical-align: middle;
    letter-spacing: 0.5px;
}

.modal-fullscreen .modal-content {
    background-color: #f8f9fa;
}

.text-dark-purple { color: var(--nexus-blue); }
.text-purple-accent { color: var(--nexus-orange); }

/* Sticky Columns for Horizontal Scroll */
.table-excel {
    border-collapse: separate;
    border-spacing: 0;
}

.table-excel th:first-child, 
.table-excel td:first-child,
.table-excel tfoot td:first-child {
    position: sticky !important;
    left: 0 !important;
    z-index: 200 !important;
    background-color: #ffffff !important;
    border-right: 2px solid #dee2e6 !important;
    min-width: 350px;
    width: 350px;
}

.table-excel th:nth-child(2), 
.table-excel td:nth-child(2),
.table-excel tfoot td:nth-child(2) {
    position: sticky !important;
    left: 350px !important; /* Ancho de la primera columna */
    z-index: 150 !important;
    background-color: #ffffff !important;
    border-right: 2px solid #dee2e6 !important;
    min-width: 80px;
    width: 80px;
}

.table-excel .bg-stats:nth-last-child(1),
.table-excel .max-price,
.table-excel .bg-stats-footer:nth-last-child(1) {
    position: sticky !important;
    right: 0 !important;
    z-index: 40 !important;
    background-color: var(--nexus-blue) !important;
    color: white !important;
}

.table-excel .bg-stats:nth-last-child(2),
.table-excel .avg-price,
.table-excel .bg-stats-footer:nth-last-child(2) {
    position: sticky !important;
    right: 120px !important;
    z-index: 40 !important;
    background-color: var(--nexus-blue) !important;
    color: white !important;
}

.table-excel .bg-stats:nth-last-child(3),
.table-excel .min-price,
.table-excel .bg-stats-footer:nth-last-child(3) {
    position: sticky !important;
    right: 240px !important;
    z-index: 40 !important;
    background-color: var(--nexus-blue) !important;
    color: white !important;
    border-left: 2px solid var(--nexus-orange) !important;
}

.table-excel td.min-price {
    background-color: #F8F9FA !important;
    color: var(--nexus-orange) !important; /* Resaltar el mejor precio */
    font-weight: 700 !important;
}

.table-excel td.avg-price, 
.table-excel td.max-price,
.table-excel .bg-stats-footer {
    background-color: #F8F9FA !important;
    color: var(--nexus-blue) !important;
    font-weight: 500;
}

.text-dark-blue { color: var(--nexus-blue); }
.text-nexus-orange { color: var(--nexus-orange); }

.provider-col {
    min-width: 250px !important;
    white-space: nowrap;
}

.table-excel .bg-stats, .table-excel .min-price, .table-excel .avg-price, .table-excel .max-price, .table-excel .bg-stats-footer { 
    min-width: 120px; 
    width: 120px; 
}

/* --- Professional Gantt Chart Styles --- */
.gantt-wrapper {
    background-color: #fff;
    font-family: 'Inter', sans-serif;
}

.gantt-table-side {
    box-shadow: 5px 0 15px rgba(0,0,0,0.03);
}

.gantt-scrollable {
    overflow: auto;
    scroll-behavior: smooth;
}

.gantt-scrollable-y {
    overflow-y: auto;
}

.gantt-row {
    transition: background 0.2s;
}

.bg-hover-light:hover {
    background-color: #f8f9fa !important;
}

.gantt-timeline-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.gantt-grid {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    pointer-events: none;
}

.gantt-bars-container {
    z-index: 1;
}

.gantt-bar-row {
    height: 50px;
    border-bottom: 1px solid #f0f0f0;
}

.gantt-bar {
    border: none;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 10;
}

.gantt-bar:hover {
    filter: brightness(1.1);
    transform: scaleY(1.1);
    z-index: 20;
}

.gantt-bar-row:hover {
    background-color: rgba(0,0,0,0.02);
}

.btn-xs {
    padding: 4px 8px;
    font-size: 0.7rem;
}

/* Custom styles for the timeline text */
.text-dark-blue {
    color: var(--primary-deep) !important;
}

.bg-primary-blue {
    background-color: var(--primary-deep) !important;
}

.bg-accent-orange {
    background-color: var(--accent-orange) !important;
}

.border-dashed {
    border: 2px dashed #dee2e6 !important;
}
