
/* Remove spin buttons from number inputs */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}
        /* Diseño Sobrio tipo Wikipedia / Institucional */
        body { 
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Lato, Helvetica, Arial, sans-serif; 
            margin: 0; 
            padding: 0; 
            background: #f6f6f6; 
            color: #202122; 
        }
        header { 
            background: #ffffff; 
            padding: 15px 30px; 
            border-bottom: 1px solid #a2a9b1; 
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: sticky;
            top: 0;
            z-index: 1000;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
        }
        h1 { 
            font-family: 'Linux Libertine', 'Georgia', 'Times', serif; 
            margin: 0; 
            font-weight: normal; 
            font-size: 14px;
        }
        nav button {
            background: none;
            border: none;
            font-size: 14px;
            color: #3366cc;
            cursor: pointer;
            margin-left: 20px;
            font-family: inherit;
        }
        nav button:hover { text-decoration: underline; }
        nav button.active { color: #202122; font-weight: bold; text-decoration: none; cursor: default; }
        
        .container { 
            display: flex; 
            max-width: 100%; 
            margin: 0 auto; 
            background: #ffffff; 
            min-height: 100vh; 
            border-left: 1px solid #a2a9b1; 
            border-right: 1px solid #a2a9b1; 
        }
        .sidebar { 
            width: 250px; 
            padding: 20px; 
            border-right: 1px solid #a2a9b1; 
            background: #f8f9fa; 
        }
        .content { 
            flex-grow: 1; 
            padding: 30px; 
            min-width: 0;
            box-sizing: border-box;
        }
        select, input, button.btn-action { 
            width: 100%; 
            padding: 8px; 
            margin-bottom: 15px; 
            border: 1px solid #a2a9b1; 
            box-sizing: border-box;
            font-family: inherit;
            border-radius: 4px;
        }
        button.btn-action {
            background: #f8f9fa;
            cursor: pointer;
            font-weight: bold;
            transition: all 0.2s ease;
        }
        button.btn-action:hover { background: #eaecf0; transform: translateY(-1px); box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
        
        table { 
            width: 100%; 
            border-collapse: collapse; 
            margin-top: 20px; 
            font-size: 14px;
        }
        th, td { 
            border: 1px solid #a2a9b1; 
            padding: 8px 12px; 
            text-align: right; 
        }
        th { 
            background: #eaecf0; 
            text-align: center; 
            font-weight: bold;
        }
        td.left { text-align: left; }
        
        .rules-list {
            background: #f8f9fa;
            border: 1px solid #a2a9b1;
            padding: 15px 30px;
            margin-bottom: 20px;
            border-radius: 6px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.04);
        }
        
        /* Ocultar secciones */
        .view-section { display: none; }
        .view-section.active { display: block; }
        .view-section.active.container { display: flex; }

        /* Estilo Wikipedia para el Perfil Fundamental */
        .wiki-panel {
            background: #f8f9fa;
            border: 1px solid #a2a9b1;
            padding: 20px;
            margin-bottom: 30px;
            display: none;
        }
        .wiki-panel h3 {
            margin-top: 0;
            margin-bottom: 18px;
            font-family: 'Inter', sans-serif;
            font-size: 18px;
            font-weight: 700;
            color: #0f172a;
            border-bottom: 2px solid #eaecf0;
            padding-bottom: 10px;
            padding-left: 14px;
            position: relative;
        }
        .wiki-panel h3::before {
            content: '';
            position: absolute;
            left: 0;
            top: 2px;
            width: 4px;
            height: calc(100% - 12px);
            background: linear-gradient(180deg, #3b82f6, #1e40af);
            border-radius: 2px;
        }
        .wiki-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
            gap: 18px;
            font-size: 13px;
        }
        .wiki-box {
            background: #fff;
            border: 1px solid #e2e8f0;
            padding: 18px;
            border-radius: 10px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.03);
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }
        .wiki-box:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 16px rgba(0,0,0,0.08);
        }
        .wiki-box h4 {
            margin-top: 0;
            color: #0f172a;
            border-bottom: 2px solid #f1f5f9;
            padding-bottom: 8px;
            margin-bottom: 12px;
            font-family: 'Inter', sans-serif;
            font-size: 14px;
            font-weight: 700;
        }
        .wiki-row {
            display: flex;
            justify-content: space-between;
            padding: 5px 0;
            border-bottom: 1px solid #f1f5f9;
            align-items: baseline;
        }
        .wiki-row:last-child { border-bottom: none; }
        .wiki-row span:first-child { color: #64748b; font-size: 13px; }
        .wiki-row span:last-child { font-weight: 600; color: #1e293b; text-align: right; max-width: 60%; word-break: break-word; font-variant-numeric: tabular-nums; }
        
        /* Pestañas — Premium */
        .tabs {
            border-bottom: 2px solid #e2e8f0;
            margin-bottom: 24px;
            display: flex;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            flex-wrap: nowrap;
            gap: 2px;
        }
        .tabs .tab {
            flex: 1 0 auto;
            text-align: center;
        }
        .tab {
            padding: 11px 20px;
            cursor: pointer;
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-bottom: none;
            border-radius: 8px 8px 0 0;
            font-weight: 600;
            font-size: 13px;
            color: #64748b;
            font-family: 'Inter', sans-serif;
            transition: all 0.2s ease;
            position: relative;
        }
        .tab:hover {
            background: #fff;
            color: #3b82f6;
        }
        .tab.active {
            background: #fff;
            color: #1e40af;
            margin-bottom: -2px;
            border-bottom: 2px solid #fff;
            border-top: 2px solid #3b82f6;
            font-weight: 700;
        }
        .tab-content {
            display: block;
            margin-bottom: 40px !important;
            padding-bottom: 20px;
            border-bottom: 1px solid #eaecf0;
        }
        .tab-content:last-child {
            border-bottom: none;
        }
        /* Sección Evolución Histórica — Premium */
        .hist-section {
            margin-top: 30px;
            padding-top: 24px;
            border-top: 2px solid #eaecf0;
        }
        .hist-section > h3 {
            margin: 0 0 20px 0;
            color: #0f172a;
            font-family: 'Inter', sans-serif;
            font-size: 18px;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .hist-section > h3::before {
            content: '';
            display: inline-block;
            width: 4px;
            height: 22px;
            background: linear-gradient(180deg, #3b82f6, #1e40af);
            border-radius: 2px;
        }
        .hist-table-wrapper {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            border-radius: 8px;
        }
        .hist-table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
            margin-top: 0;
            font-size: 13px;
            min-width: 100%;
        }
        .hist-table thead th {
            background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
            color: #374151;
            font-weight: 700;
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            padding: 10px 14px;
            border: none;
            border-bottom: 2px solid #c8ccd1;
            text-align: right;
            white-space: nowrap;
        }
        .hist-table thead th:first-child {
            text-align: left;
            text-transform: none;
            font-size: 13px;
            letter-spacing: normal;
            border-radius: 8px 0 0 0;
        }
        .hist-table thead th:last-child {
            border-radius: 0 8px 0 0;
        }
        .hist-table tbody td {
            padding: 9px 14px;
            border: none;
            border-bottom: 1px solid #f1f5f9;
            text-align: right;
            color: #1e293b;
            font-weight: 600;
            font-variant-numeric: tabular-nums;
            transition: background 0.15s ease;
        }
        .hist-table tbody td.left,
        .hist-table tbody td:first-child {
            text-align: left;
            font-weight: 700;
            color: #374151;
        }
        .hist-table tbody tr:hover td {
            background: #f0f7ff;
        }
        .hist-table tbody tr:last-child td {
            border-bottom: none;
        }
        .hist-table tbody tr:last-child td:first-child {
            border-radius: 0 0 0 8px;
        }
        .hist-table tbody tr:last-child td:last-child {
            border-radius: 0 0 8px 0;
        }
        .tab-content.active {
            display: block;
        }
        /* Utility classes for responsive layouts */
        .portfolio-info-row {
            display: flex;
            gap: 20px;
            margin-bottom: 20px;
        }
        .portfolio-info-row > div {
            flex: 1;
        }
        .portfolio-info-row > div:first-child {
            flex: 2;
        }
        .portfolio-perf-table {
            margin-top: 5px;
            font-size: 13px;
            width: 100%;
            border-collapse: collapse;
            table-layout: fixed;
        }
        .portfolio-perf-table td {
            border: none;
            padding: 2px;
            vertical-align: middle;
            white-space: normal !important;
            word-wrap: break-word;
        }
        .portfolio-perf-table td.label-l {
            width: 38%;
            text-align: left;
        }
        .portfolio-perf-table td.val-l {
            width: 12%;
            font-weight: bold;
            text-align: right;
            font-size: 14px;
        }
        .portfolio-perf-table td.label-r {
            width: 38%;
            padding-left: 12px;
            text-align: left;
        }
        .portfolio-perf-table td.val-r {
            width: 12%;
            font-weight: bold;
            text-align: right;
            font-size: 14px;
        }
        
                        
        .radar-metrics-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;
            margin-top: 10px;
            font-size: 13px;
            line-height: 1.5;
        }
        .table-scroll-wrapper {
            width: 100%;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }

        /* Diseño Responsive (Móvil) */
        @media (max-width: 768px) {
            * { box-sizing: border-box; }
            body { overflow-x: clip; width: 100%; }
            header {
                flex-direction: column;
                align-items: flex-start;
                padding: 10px 15px;
            }
            header h1 { font-size: 14px; }
            th, td {
                padding: 6px 4px !important;
                font-size: 11px !important;
                word-wrap: break-word;
            }
            /* ===== NAVEGACIÓN: Vertical full-width al abrir menú ===== */
            @media (max-width: 768px) {
                nav {
                    margin-top: 10px;
                    display: flex !important;
                    flex-direction: column !important;
                    gap: 6px;
                    width: 100%;
                }
            }
            nav button {
                margin-left: 0;
                padding: 12px 10px;
                background: #f8f9fa;
                border: 1px solid #c8ccd1;
                border-radius: 6px;
                font-size: 13px;
                width: 100%;
                text-align: center;
            }
            nav button.active {
                background: #eaecf0;
                font-weight: bold;
            }
            select, input, button.btn-action {
                font-size: 14px;
                padding: 12px;
            }
            /* Forzar columnas en todos los containers */
            .container, .view-section.active.container {
                flex-direction: column !important;
                padding: 10px !important;
            }
            .sidebar {
                width: 100% !important;
                box-sizing: border-box;
                border-right: none;
                border-bottom: 1px solid #a2a9b1;
                padding: 15px;
            }
            .content {
                padding: 10px !important;
                box-sizing: border-box;
                width: 100% !important;
            }
            /* ===== TABLAS: scroll horizontal en móvil, sin romper la página ===== */
            table {
                font-size: 12px;
                display: block;
                overflow-x: auto;
                white-space: nowrap;
                -webkit-overflow-scrolling: touch;
                width: 100%;
                border-collapse: collapse;
            }
            th, td {
                padding: 6px 8px;
            }
            /* Portfolio navigation grid: 1 columna en móvil */
            #portfolioNavGrid {
                grid-template-columns: 1fr !important;
                gap: 10px !important;
            }
            /* Los 3 bloques (Reglas + Backtest + Riesgo): apilar */
            .portfolio-info-row {
                flex-direction: column !important;
                gap: 12px !important;
            }
            .portfolio-info-row > div {
                flex: none !important;
                width: 100% !important;
            }
            /* Wiki grids: una columna */
            .wiki-grid {
                grid-template-columns: 1fr !important;
            }
            /* Radar metrics grid: una columna en móvil */
            .radar-metrics-grid {
                grid-template-columns: 1fr !important;
            }
            /* Tabs: scroll horizontal en lugar de romper layout */
            .tabs {
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                flex-wrap: nowrap;
                gap: 3px;
                padding-bottom: 2px;
            }
            .tab {
                padding: 8px 12px;
                font-size: 12px;
                white-space: nowrap;
                flex-shrink: 0;
            }
            /* Wiki boxes más compactos */
            .wiki-box {
                padding: 10px;
            }
            .wiki-box h4 {
                font-size: 14px;
            }
            /* Tipografía */
            h1 { font-size: 14px; }
            h2 { font-size: 14px; }
            h3 { font-size: 15px; }
            /* Inline grids fallback */
            @media (max-width: 768px) {
                div[style*="grid-template-columns: 1fr 1fr"] {
                    grid-template-columns: 1fr !important;
                }
                div[style*="grid-template-columns: repeat(4"] {
                    grid-template-columns: 1fr 1fr !important;
                }
                div[style*="grid-template-columns: 1fr 1fr 1fr"] {
                    grid-template-columns: 1fr !important;
                }
            }
            /* Select2 fix */
            .select2-container { width: 100% !important; }
            /* Rules list compact */
            .rules-list {
                padding: 12px 15px;
            }
            /* ===== SKEW: buscador full width ===== */
            #skewSearchInput {
                width: 100% !important;
            }
            /* ===== OPCIONES: fecha de vencimiento apilada ===== */
            #tab-opciones > div:first-child {
                display: flex !important;
                flex-direction: column !important;
                gap: 8px;
            }
            #opt_expSelect {
                margin-left: 0 !important;
                width: 100% !important;
            }
            #opt_summary {
                margin-left: 0 !important;
                display: block;
            }
            /* Opciones: tablas CALLS y PUTS scroll vertical limitado */
            .wiki-box > div[style*="max-height"] {
                max-height: 300px !important;
            }
            /* ===== PORTFOLIO: tabla de activos ===== */
            #portBody {
                font-size: 12px;
            }
            /* Wiki rows en móvil: texto más pequeño */
            .wiki-row {
                font-size: 12px;
            }
            .wiki-row span:last-child {
                max-width: 55%;
            }
            .lang-selector {
                margin-left: auto !important;
                border-left: none !important;
                padding-left: 0 !important;
                width: auto !important;
                display: inline-block !important;
                margin-top: 0 !important;
            }
        }


    
        .metric-cell {
            width: 50%;
            text-align: left;
            white-space: normal !important;
            padding: 2px 4px;
            vertical-align: top;
            font-size: 13px;
        }
        .metric-cell .val {
            font-weight: bold;
        }
        @media (max-width: 480px) {
            .portfolio-perf-table tr {
                display: flex !important;
                flex-direction: column !important;
            }
            .metric-cell {
                width: 100% !important;
                display: block !important;
                box-sizing: border-box !important;
                padding: 4px 0 !important;
                border-bottom: 1px dashed #e2e8f0;
                font-size: 11px !important;
                word-wrap: break-word;
            }
            .portfolio-perf-table tr:last-child .metric-cell:last-child {
                border-bottom: none !important;
            }
        }
    
        
        /* FAQ Accordion Styles */
        .faq-accordion-container {
            width: 100%;
            margin: 30px auto;
            background: #ffffff;
            border-top: 1px solid #eaecf0;
            padding-top: 20px;
            padding-bottom: 30px;
        }
        .faq-accordion-content {
            max-width: 800px;
            margin: 0 auto;
            padding: 0 20px;
        }
        .faq-category-title {
            font-family: 'Linux Libertine', Georgia, serif;
            font-size: 14px;
            color: #1e293b;
            margin-top: 30px;
            margin-bottom: 15px;
            padding-bottom: 10px;
            border-bottom: 2px solid #e2e8f0;
            display: flex;
            align-items: center;
        }
        details.faq-accordion {
            margin-bottom: 16px;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            background: #ffffff;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 2px 4px rgba(15, 23, 42, 0.04);
            overflow: hidden;
        }
        details.faq-accordion:hover {
            box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
            border-color: #cbd5e1;
        }
        details.faq-accordion[open] {
            border-color: #3b82f6;
            box-shadow: 0 8px 16px rgba(59, 130, 246, 0.08);
        }
        details.faq-accordion summary {
            padding: 12px 16px;
            cursor: pointer;
            font-weight: 600;
            font-size: 14px;
            color: #1e293b;
            list-style: none;
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: #f8fafc;
            transition: background 0.3s ease;
        }
        details.faq-accordion[open] summary {
            background: #ffffff;
            border-bottom: 1px solid #f1f5f9;
        }
        details.faq-accordion summary::-webkit-details-marker {
            display: none;
        }
        details.faq-accordion summary::after {
            content: '';
            display: inline-block;
            width: 16px;
            height: 16px;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
            background-size: contain;
            background-repeat: no-repeat;
            transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }
        details.faq-accordion[open] summary::after {
            transform: rotate(180deg);
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%233b82f6'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
        }
        details.faq-accordion p {
            padding: 16px;
            margin: 0;
            color: #475569;
            line-height: 1.7;
            font-size: 14px;
            border-left: 4px solid #3b82f6;
            background: #ffffff;
        }
        details.faq-accordion p strong {
            color: #0f172a;
        }

        /* Wiki / Wikipedia style Dropdown Nav Menu */
        .dropdown {
            position: relative;
            display: inline-block;
        }
        .dropdown-content {
            display: none;
            position: absolute;
            background-color: #ffffff;
            min-width: 180px;
            box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1);
            z-index: 1100;
            border: 1px solid #a2a9b1;
            border-radius: 4px;
            top: 100%;
            margin-top: 0;
            padding: 5px 0;
        }
        .dropdown-content button {
            color: #3366cc;
            padding: 10px 16px;
            text-decoration: none;
            display: block;
            width: 100%;
            text-align: left;
            margin: 0 !important;
            border: none;
            background: none;
            font-size: 13.5px;
            border-bottom: 1px solid #eaecf0;
            border-radius: 0;
            cursor: pointer;
        }
        .dropdown-content button:last-child {
            border-bottom: none;
        }
        .dropdown-content button:hover {
            background-color: #f8f9fa;
            text-decoration: underline;
        }
        .dropdown:hover .dropdown-content {
            display: block;
        }
        .dropdown-content button.active {
            font-weight: bold;
            color: #202122;
            background-color: #eaecf0;
        }

        /* Responsive Hamburger Menu */
        #hamburger-menu-btn {
            display: none;
            background: transparent;
            border: 1px solid #c8ccd1;
            color: #3366cc;
            font-size: 18px;
            font-weight: bold;
            padding: 5px 10px;
            min-width: 35px;
            cursor: pointer;
            margin-right: 10px;
            border-radius: 4px;
        }

        @media (max-width: 768px) {
            #hamburger-menu-btn {
                display: inline-block;
                background: #fff;
            }
            #main-nav-buttons.hide-mobile {
                display: none !important;
            }
            /* Apilar dropdowns en móvil */
            .dropdown {
                width: 100%;
                height: 100%;
            }
            .dropdown > button {
                width: 100% !important;
                height: 100% !important;
                box-sizing: border-box;
            }
            .dropdown:hover .dropdown-content {
                display: none; /* Previene hover pegajoso en móvil */
            }
            .dropdown.open .dropdown-content {
                display: block !important;
            }
        }

    
        @media (max-width: 767px) {
            .mobile-interleave-wrapper {
                display: flex !important;
                flex-direction: column !important;
            }
            .m-title { order: 1; }
            .m-stats { order: 2; }
            .m-p1 { order: 3; margin-bottom: 20px !important; }
            .m-card1 { order: 4; margin-bottom: 25px !important; }
            .m-p2 { order: 5; margin-bottom: 20px !important; }
            .m-card2 { order: 6; margin-bottom: 25px !important; }
            .m-p3 { order: 7; margin-bottom: 20px !important; }
            .m-card3 { order: 8; margin-bottom: 25px !important; }
            .m-p4 { order: 9; margin-bottom: 20px !important; }
            .m-cta { order: 10; }
            .m-cards-container { display: contents !important; }
        }

        /* WHY QUANTITATIVE TABLE RESPONSIVE MOBILE FIX */
        @media (max-width: 767px) {
            html, body {
                max-width: 100vw !important;
                overflow-x: clip !important;
            }
            .table-scroll-wrapper {
                overflow-x: auto !important;
                -webkit-overflow-scrolling: touch !important;
                max-width: 100% !important;
                margin: 10px 0 !important;
                padding: 0 !important;
                box-sizing: border-box !important;
            }
            .why-quant-table {
                width: 100% !important;
                table-layout: fixed !important;
                font-size: 10.5px !important;
                box-sizing: border-box !important;
            }
            .why-quant-table th {
                padding: 5px 2px !important;
                font-size: 10.5px !important;
                box-sizing: border-box !important;
            }
            .why-quant-table td {
                padding: 5px 2px !important;
                font-size: 10px !important;
                line-height: 1.25 !important;
                word-wrap: break-word !important;
                overflow-wrap: break-word !important;
                hyphens: auto !important;
                box-sizing: border-box !important;
            }
            .why-quant-table th:nth-child(1), .why-quant-table td:nth-child(1) {
                width: 25% !important;
            }
            .why-quant-table th:nth-child(2), .why-quant-table td:nth-child(2) {
                width: 37.5% !important;
            }
            .why-quant-table th:nth-child(3), .why-quant-table td:nth-child(3) {
                width: 37.5% !important;
        }




        /* Responsive adjustments for Portfolios (Isolated to avoid CSS nesting bugs) */
        @media (max-width: 768px) {
            /* Portfolio navigation grid: 1 columna en móvil */
            #portfolioNavGrid {
                grid-template-columns: 1fr !important;
                gap: 10px !important;
            }
            #view-myportfolio {
                padding: 10px !important;
            }
            #view-myportfolio > div {
                padding: 15px !important; 
            }
            /* Summary Cards */
            #view-myportfolio > div > div:nth-of-type(1) {
                flex-direction: column !important;
                gap: 12px !important;
            }
            #view-myportfolio > div > div:nth-of-type(1) > div {
                padding: 15px !important;
            }
            /* Add Asset Form */
            #view-myportfolio > div > div:nth-of-type(2) {
                flex-direction: column !important;
                align-items: stretch !important;
                padding: 12px !important;
            }
            #view-myportfolio > div > div:nth-of-type(2) > div,
            #view-myportfolio > div > div:nth-of-type(2) > button {
                width: 100% !important;
                min-width: 100% !important;
                margin-bottom: 5px;
            }
            /* Asset Table scrolling */
            #view-myportfolio table {
                display: block;
                overflow-x: auto;
                white-space: nowrap;
            }
        }


        /* Estilos Select2 para la barra superior (estilo Claro) */
        header .select2-container--default .select2-selection--single { background-color: #f8f9fa !important; border: 1px solid #a2a9b1 !important; border-radius: 6px !important; height: 36px !important; display: flex !important; align-items: center !important; }
        header .select2-container--default .select2-selection--single .select2-selection__rendered { color: #54595d !important; padding-left: 36px !important; line-height: 34px !important; font-size: 14px !important; }
        header .select2-container--default .select2-selection--single .select2-selection__arrow { display: none !important; }
        header .select2-container--default.select2-container--disabled .select2-selection--single { background-color: #eaecf0 !important; cursor: not-allowed !important; }
        header .select2-selection__placeholder { color: #54595d !important; }

        /* Magia para que parezca 1 sola barra: Superponemos el buscador del dropdown sobre la barra principal */
        .select2-container--default .select2-dropdown {
            margin-top: -36px !important; /* Sube exactamente la altura de la barra para taparla */
            border: 1px solid #3366cc !important; /* Borde azul de "focus" */
            border-radius: 6px !important;
            box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
            overflow: hidden;
        }
        .select2-container--default .select2-search--dropdown {
            padding: 0 !important;
        }
        .select2-container--default .select2-search--dropdown .select2-search__field {
            height: 36px !important;
            border: none !important;
            border-bottom: 1px solid #eaecf0 !important;
            border-radius: 6px 6px 0 0 !important;
            padding-left: 36px !important;
            background-color: #ffffff !important;
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%233366cc" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>');
            background-position: 12px center;
            background-repeat: no-repeat;
            outline: none !important;
            font-size: 14px !important;
            color: #202122 !important;
        }
        /* Fix focus para Select2 */
        .select2-search__field:focus { box-shadow: none !important; }
        
        /* Ajuste de buscador para moviles */
        @media (max-width: 768px) {
            .header-top-row { flex-wrap: wrap !important; }
            .header-search-col { order: 3; width: 100% !important; margin: 10px 0 0 0 !important; }
        }
    