/* CSS Unificado - Estilo SIS VISION Dark Premium */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

:root {
    --bg-color: #0d1117;
    --card-bg: rgba(22, 27, 34, 0.8);
    --border-color: rgba(255, 255, 255, 0.1);
    --accent-color: #58a6ff;
    --accent-gradient: linear-gradient(135deg, #58a6ff 0%, #3062af 100%);
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --success: #3fb950;
    --sidebar-width: 260px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

html {
    background-color: var(--bg-color);
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar Estilo SIS VISION */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(88, 166, 255, 0.3);
}

.nav-menu {
    margin-top: 30px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    margin-bottom: 8px;
    cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(88, 166, 255, 0.1);
    color: var(--accent-color);
}

/* Main Content */
.main-content {
    flex: 1;
    min-width: 0;
    max-width: calc(100vw - var(--sidebar-width));
    overflow-y: auto;
    overflow-x: hidden;
    padding: 28px 24px;
    background: radial-gradient(circle at top right, rgba(88, 166, 255, 0.05), transparent);
}

/* Header & Stats */
.header {
    margin-bottom: 40px;
}

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

.stat-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(88, 166, 255, 0.3);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
}

/* Table Style */
.table-container {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.06);
    border-radius: 0 0 16px 16px;
}

.table-container::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.45);
    border-radius: 6px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 70, 229, 0.75);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 15px 20px;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #1e3a5f 100%);
    color: #c7d2fe;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    border-bottom: 2px solid rgba(99, 102, 241, 0.4);
    position: relative;
}

th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.3s ease, color 0.2s ease;
}

th.sortable:hover {
    background: linear-gradient(135deg, #312e81 0%, #4338ca 40%, #2563eb 100%);
    color: #e0e7ff;
}

th.sortable:active {
    transform: scale(0.98);
}

.sort-indicator {
    font-size: 0.7rem;
    margin-left: 4px;
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

th.sortable:hover .sort-indicator {
    opacity: 0.8;
}

th.sort-asc .sort-indicator,
th.sort-desc .sort-indicator {
    opacity: 1;
    color: #818cf8;
}

/* Excel-style Column Dropdown Filters */
.th-filter-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-btn {
    background: #4f46e5; /* Solid vibrant indigo */
    border: 1px solid #6366f1;
    color: #ffffff; /* White icon for maximum contrast */
    cursor: pointer;
    font-size: 0.75rem;
    padding: 6px 8px;
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.filter-btn:hover {
    background: #4338ca; /* Slightly darker indigo on hover */
    border-color: #4f46e5;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.5);
    transform: translateY(-1px);
}

.filter-btn.active {
    background: linear-gradient(135deg, #ec4899, #8b5cf6); /* Pink to Purple for active */
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(236, 72, 153, 0.6);
}

.filter-dropdown {
    display: none;
    position: fixed;
    z-index: 9999;
    background: #1e2230;
    border: 1.5px solid rgba(99, 102, 241, 0.45);
    border-radius: 10px;
    min-width: 300px;
    max-width: 450px;
    max-height: 350px;
    overflow-y: auto;
    box-shadow: 0 14px 42px rgba(0, 0, 0, 0.6);
    padding: 0;
}

.filter-dropdown.show {
    display: block;
}

.filter-dropdown .filter-search-wrap {
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    background: rgba(15, 23, 42, 0.55);
}

.filter-dropdown .filter-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 7px 28px 7px 11px;
    border-radius: 7px;
    border: 1.5px solid rgba(129, 140, 248, 0.55);
    background: #0f172a !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #818cf8 !important;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.filter-dropdown .filter-search-input:focus {
    border-color: #818cf8 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
}

.filter-dropdown .filter-search-input::placeholder {
    color: #94a3b8 !important;
    -webkit-text-fill-color: #94a3b8 !important;
    font-weight: 400;
}

.filter-dropdown .filter-search-input::selection {
    background: #6366f1;
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
}

.filter-dropdown .filter-search-clear {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-52%);
    cursor: pointer;
    color: #cbd5e1;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
    user-select: none;
    transition: color 0.15s;
}

.filter-dropdown .filter-search-clear:hover {
    color: #f87171;
}

.filter-dropdown label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 500;
    color: #f1f5f9;
    text-transform: none;
    letter-spacing: 0;
    transition: background 0.15s;
    white-space: nowrap;
}

.filter-dropdown label:hover {
    background: rgba(99, 102, 241, 0.16);
}

.filter-dropdown .filter-item-count {
    color: #cbd5e1;
    background: rgba(148, 163, 184, 0.16);
    padding: 1px 6px;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.filter-dropdown .filter-no-matches {
    color: #94a3b8;
}

.filter-dropdown input[type="checkbox"] {
    accent-color: #818cf8;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.filter-dropdown .filter-actions {
    display: flex;
    gap: 6px;
    padding: 7px 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.45);
    flex-wrap: wrap;
}

.filter-dropdown .filter-actions button {
    flex: 1;
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.73rem;
    font-weight: 700;
    transition: filter 0.15s;
}

.filter-dropdown .filter-actions button:hover {
    filter: brightness(1.1);
}

.filter-dropdown .filter-actions .btn-filter-all {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(59, 130, 246, 0.35);
    color: #93c5fd;
}

.filter-dropdown .filter-actions .btn-filter-none {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.filter-dropdown .filter-actions .btn-filter-sort {
    margin-left: auto;
    background: rgba(148, 163, 184, 0.16);
    border-color: rgba(148, 163, 184, 0.3);
    color: #f1f5f9;
}

/* ── MODO CLARO: Dropdowns de Filtros de Columnas (Estado, UNSPSC, Ubicación, Análisis) ── */
html.light-mode .filter-dropdown:not(.days-visual-dd),
body.light-mode .filter-dropdown:not(.days-visual-dd) {
    background: #ffffff !important;
    border: 1.5px solid #818cf8 !important;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18) !important;
}

html.light-mode .filter-dropdown:not(.days-visual-dd) .filter-search-wrap,
body.light-mode .filter-dropdown:not(.days-visual-dd) .filter-search-wrap {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

html.light-mode .filter-dropdown:not(.days-visual-dd) .filter-search-input,
body.light-mode .filter-dropdown:not(.days-visual-dd) .filter-search-input {
    background: #ffffff !important;
    border: 1.5px solid #6366f1 !important;
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
    caret-color: #4f46e5 !important;
    font-weight: 600 !important;
}

html.light-mode .filter-dropdown:not(.days-visual-dd) .filter-search-input:focus,
body.light-mode .filter-dropdown:not(.days-visual-dd) .filter-search-input:focus {
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18) !important;
}

html.light-mode .filter-dropdown:not(.days-visual-dd) .filter-search-input::placeholder,
body.light-mode .filter-dropdown:not(.days-visual-dd) .filter-search-input::placeholder {
    color: #64748b !important;
    -webkit-text-fill-color: #64748b !important;
}

html.light-mode .filter-dropdown:not(.days-visual-dd) .filter-search-input::selection,
body.light-mode .filter-dropdown:not(.days-visual-dd) .filter-search-input::selection {
    background: #4f46e5;
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
}

html.light-mode .filter-dropdown:not(.days-visual-dd) .filter-search-clear,
body.light-mode .filter-dropdown:not(.days-visual-dd) .filter-search-clear {
    color: #475569 !important;
}

html.light-mode .filter-dropdown:not(.days-visual-dd) .filter-search-clear:hover,
body.light-mode .filter-dropdown:not(.days-visual-dd) .filter-search-clear:hover {
    color: #dc2626 !important;
}

html.light-mode .filter-dropdown:not(.days-visual-dd) label.filter-item-row,
body.light-mode .filter-dropdown:not(.days-visual-dd) label.filter-item-row {
    color: #0f172a !important;
    font-weight: 500;
}

html.light-mode .filter-dropdown:not(.days-visual-dd) label.filter-item-row:hover,
body.light-mode .filter-dropdown:not(.days-visual-dd) label.filter-item-row:hover {
    background: #eef2ff !important;
}

html.light-mode .filter-dropdown:not(.days-visual-dd) input[type="checkbox"],
body.light-mode .filter-dropdown:not(.days-visual-dd) input[type="checkbox"] {
    accent-color: #4f46e5;
}

html.light-mode .filter-dropdown:not(.days-visual-dd) .filter-item-count,
body.light-mode .filter-dropdown:not(.days-visual-dd) .filter-item-count {
    color: #334155 !important;
    background: #e2e8f0 !important;
}

html.light-mode .filter-dropdown:not(.days-visual-dd) .filter-no-matches,
body.light-mode .filter-dropdown:not(.days-visual-dd) .filter-no-matches {
    color: #64748b !important;
}

html.light-mode .filter-dropdown:not(.days-visual-dd) .filter-actions,
body.light-mode .filter-dropdown:not(.days-visual-dd) .filter-actions {
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
}

html.light-mode .filter-dropdown:not(.days-visual-dd) .filter-actions .btn-filter-all,
body.light-mode .filter-dropdown:not(.days-visual-dd) .filter-actions .btn-filter-all {
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
    color: #1d4ed8 !important;
}

html.light-mode .filter-dropdown:not(.days-visual-dd) .filter-actions .btn-filter-none,
body.light-mode .filter-dropdown:not(.days-visual-dd) .filter-actions .btn-filter-none {
    background: #fef2f2 !important;
    border-color: #fecaca !important;
    color: #dc2626 !important;
}

html.light-mode .filter-dropdown:not(.days-visual-dd) .filter-actions .btn-filter-sort,
body.light-mode .filter-dropdown:not(.days-visual-dd) .filter-actions .btn-filter-sort {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
}

td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(63, 185, 80, 0.1);
    color: var(--success);
}

.badge-info {
    background: rgba(88, 166, 255, 0.12);
    color: #58a6ff;
}

.badge-warning {
    background: rgba(210, 153, 34, 0.15);
    color: #d29922;
}

/* Buttons & Links */
.btn-primary {
    background: var(--accent-gradient);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.3s;
}

.btn-primary:hover {
    opacity: 0.9;
}

.link-icon {
    color: var(--accent-color);
    text-decoration: none;
}

.link-icon:hover {
    text-decoration: underline;
}

/* === ESTILOS DE IA (FASE 1) === */

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

/* Botones de IA */
.btn-ai {
    background: var(--accent-gradient);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: opacity 0.3s, transform 0.2s;
    white-space: nowrap;
}

.btn-ai:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-ai-secondary {
    background: rgba(88, 166, 255, 0.1);
    color: var(--accent-color);
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid rgba(88, 166, 255, 0.3);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-ai-secondary:hover {
    background: rgba(88, 166, 255, 0.2);
    border-color: var(--accent-color);
}

/* Botón de Descarga - Pendiente */
.btn-download {
    background: rgba(128, 128, 128, 0.1);
    color: #8b949e;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(128, 128, 128, 0.3);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-download:hover {
    background: rgba(128, 128, 128, 0.2);
    border-color: #8b949e;
    transform: translateY(-2px);
}

/* Botón de Descarga - Completado */
.btn-download-done {
    background: rgba(63, 185, 80, 0.1);
    color: #3fb950;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(63, 185, 80, 0.3);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-download-done:hover {
    background: rgba(63, 185, 80, 0.2);
    border-color: #3fb950;
    transform: translateY(-2px);
}

/* === MODO CLARO === */
html.light-mode,
body.light-mode {
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --border-color: #e1e5eb;
    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
}

html.light-mode body,
body.light-mode {
    background-color: var(--bg-color);
    color: var(--text-primary);
}

html.light-mode .sidebar,
body.light-mode .sidebar {
    background: #ffffff;
    border-right-color: #e1e5eb;
}

html.light-mode .main-content,
body.light-mode .main-content {
    background: #f5f7fa;
}

html.light-mode .stat-card,
body.light-mode .stat-card {
    background: #ffffff;
    border-color: #e1e5eb;
}

html.light-mode .table-container,
body.light-mode .table-container {
    background: #ffffff;
}

html.light-mode th,
body.light-mode th {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 40%, #dbeafe 100%);
    color: #3730a3;
    border-bottom: 2px solid rgba(99, 102, 241, 0.25);
}

html.light-mode th.sortable:hover,
body.light-mode th.sortable:hover {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 40%, #bfdbfe 100%);
    color: #4338ca;
}

html.light-mode th.sort-asc .sort-indicator,
html.light-mode th.sort-desc .sort-indicator,
body.light-mode th.sort-asc .sort-indicator,
body.light-mode th.sort-desc .sort-indicator {
    color: #4338ca;
}

html.light-mode td,
body.light-mode td {
    border-color: #e1e5eb;
}

html.light-mode #theme-toggle,
body.light-mode #theme-toggle {
    background: #e5e7eb;
    border: 2px solid #d1d5db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

html.light-mode .modal-content,
body.light-mode .modal-content {
    background: #ffffff;
    border-color: #e1e5eb;
}

/* ══════════════════════════════════════════════════════════
   ANALYTICS DASHBOARD STYLES (KPIs, Funnel, Charts)
   ══════════════════════════════════════════════════════════ */

/* ── KPI Cards ── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.kpi-card .kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.kpi-card .kpi-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.kpi-card .kpi-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
}

.kpi-card .kpi-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 0 0 16px 16px;
}

.kpi-1 .kpi-icon {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.kpi-1 .kpi-value {
    color: #3b82f6;
}

.kpi-1 .kpi-bar {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.kpi-2 .kpi-icon {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.kpi-2 .kpi-value {
    color: #10b981;
}

.kpi-2 .kpi-bar {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.kpi-3 .kpi-icon {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.kpi-3 .kpi-value {
    color: #a855f7;
}

.kpi-3 .kpi-bar {
    background: linear-gradient(90deg, #a855f7, #c084fc);
}

.kpi-4 .kpi-icon {
    background: rgba(244, 114, 182, 0.15);
    color: #f472b6;
}

.kpi-4 .kpi-value {
    color: #f472b6;
}

.kpi-4 .kpi-bar {
    background: linear-gradient(90deg, #f472b6, #fb7185);
}

.kpi-5 .kpi-icon {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.kpi-5 .kpi-value {
    color: #fbbf24;
}

.kpi-5 .kpi-bar {
    background: linear-gradient(90deg, #fbbf24, #fcd34d);
}

/* ── Pipeline Funnel ── */
.funnel-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.funnel-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.funnel-steps {
    display: flex;
    align-items: center;
    gap: 0;
}

.funnel-step {
    flex: 1;
    text-align: center;
    padding: 16px 8px;
    position: relative;
    transition: all 0.3s;
}

.funnel-step .step-value {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.funnel-step .step-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.funnel-step .step-pct {
    font-size: 0.7rem;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
}

.funnel-arrow {
    color: rgba(255, 255, 255, 0.15);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.fs-1 .step-value {
    color: #3b82f6;
}

.fs-1 .step-pct {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.fs-2 .step-value {
    color: #10b981;
}

.fs-2 .step-pct {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.fs-3 .step-value {
    color: #a855f7;
}

.fs-3 .step-pct {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
}

.fs-4 .step-value {
    color: #f472b6;
}

.fs-4 .step-pct {
    background: rgba(244, 114, 182, 0.15);
    color: #fb7185;
}

/* ── Charts Grid ── */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    min-height: 320px;
}

.chart-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-card h3 i {
    color: #818cf8;
    font-size: 0.85rem;
}

.chart-card canvas {
    width: 100% !important;
    max-height: 280px;
}

.chart-card.full-width {
    grid-column: span 2;
}

/* ── Dashboard Responsive ── */
@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-card.full-width {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .funnel-steps {
        flex-direction: column;
    }

    .funnel-arrow {
        transform: rotate(90deg);
    }
}

/* ── Department Multi-Selector ── */
.dept-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 400;
    color: #c9d1d9;
    text-transform: none;
    letter-spacing: 0;
    transition: background 0.15s;
    border-radius: 6px;
    margin: 1px 4px;
}

.dept-opt:hover {
    background: rgba(99, 102, 241, 0.1);
}

.dept-opt input[type="checkbox"] {
    accent-color: #818cf8;
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.dept-opt input[type="checkbox"]:checked + span,
.dept-opt:has(input:checked) {
    color: #a5b4fc;
    font-weight: 500;
}

#dept-dropdown::-webkit-scrollbar {
    width: 6px;
}

#dept-dropdown::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 3px;
}

#dept-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

/* ═══ AUDITORÍA FORENSE DE ADJUDICACIÓN & GANADOR ═══ */

/* Botón en la tabla */
.btn-adjudicacion-winner {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: #fff;
    border: 1px solid rgba(245, 158, 11, 0.4);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.25);
}

.btn-adjudicacion-winner:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.45);
}

.btn-adjudicacion-pending {
    background: rgba(139, 92, 246, 0.12);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.35);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.btn-adjudicacion-pending:hover {
    background: rgba(139, 92, 246, 0.22);
    border-color: #8b5cf6;
    color: #c4b5fd;
}

.btn-adjudicacion-desierto {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.btn-adjudicacion-desierto:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    color: #fca5a5;
    transform: translateY(-1px);
}

.badge-adjudicacion-open {
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(100, 116, 139, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(100, 116, 139, 0.2);
}

/* Modal Overlay & Panel */
.adj-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(7, 10, 19, 0.82);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.adj-modal-panel {
    background: #0f172a;
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 16px;
    width: 100%;
    max-width: 1050px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 40px rgba(245, 158, 11, 0.12);
    overflow: hidden;
    color: #e2e8f0;
}

.adj-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 28px;
    background: #131d36;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.adj-header-title-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
}

.adj-trophy-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.1));
    border: 1px solid rgba(245, 158, 11, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #f59e0b;
}

.adj-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 0;
}

.adj-subtitle {
    font-size: 0.85rem;
    color: #94a3b8;
    margin: 3px 0 0 0;
}

.adj-modal-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.adj-modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.adj-modal-body {
    padding: 24px 28px;
    overflow-y: auto;
    flex: 1;
}

/* KPIs */
.adj-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

.adj-kpi-card {
    background: #17223b;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.adj-kpi-card.winner-card {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(180, 83, 9, 0.08));
    border-color: rgba(245, 158, 11, 0.3);
}

.adj-kpi-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.winner-card .adj-kpi-label {
    color: #f59e0b;
}

.adj-kpi-val {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adj-kpi-val.highlight {
    color: #fbbf24;
}

.adj-kpi-sub {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 4px;
}

/* Verdict Box */
.adj-verdict-box {
    background: linear-gradient(135deg, rgba(88, 28, 135, 0.15), rgba(30, 27, 75, 0.35));
    border: 1px solid rgba(168, 85, 247, 0.28);
    border-radius: 14px;
    padding: 20px 22px;
    margin-bottom: 24px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.adj-verdict-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.adj-verdict-title {
    font-size: 1rem;
    font-weight: 700;
    color: #c084fc;
    display: flex;
    align-items: center;
    gap: 8px;
}

.adj-badge-ia {
    background: rgba(168, 85, 247, 0.2);
    color: #d8b4fe;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.adj-verdict-body {
    font-size: 0.92rem;
    line-height: 1.65;
    color: #e2e8f0;
}

/* Tabs */
.adj-tabs-nav {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 20px;
    padding-bottom: 8px;
}

.adj-tab-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
}

.adj-tab-btn:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.05);
}

.adj-tab-btn.active {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.adj-tab-content {
    display: none;
    animation: fadeIn 0.2s ease;
}

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

/* Table Competidores */
.adj-table-wrap {
    background: #131d36;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.adj-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.adj-table th {
    background: #17223b;
    color: #94a3b8;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.adj-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
}

.adj-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.adj-status-tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.adj-status-tag.ok {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.adj-status-tag.fail {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Causales & Criterios */
.adj-cards-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.adj-causal-item {
    background: #17223b;
    border-left: 4px solid #ef4444;
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 0.88rem;
    color: #e2e8f0;
    line-height: 1.5;
}

.adj-criterios-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.adj-criterio-card {
    background: #17223b;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.adj-criterio-name {
    font-weight: 600;
    color: #f1f5f9;
}

.adj-criterio-score {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
}

/* Documentos */
.adj-docs-intro {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.adj-docs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.adj-doc-item {
    background: #17223b;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.adj-doc-info {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.adj-doc-icon {
    font-size: 1.5rem;
    color: #f87171;
}

.adj-doc-name {
    font-size: 0.86rem;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

.adj-doc-size {
    font-size: 0.75rem;
    color: #64748b;
}

.btn-adj-download {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.35);
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-adj-download:hover {
    background: #2563eb;
    color: #fff;
}

/* ══════════════════════════════════════════════════════════
   PREMIUM+++ FILTERS & INPUTS (Modo Oscuro y Modo Claro)
   ══════════════════════════════════════════════════════════ */
.premium-filter-panel {
    position: relative;
    z-index: 500;
    overflow: visible !important;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-left: 5px solid #4f46e5 !important;
    border-radius: 16px;
    padding: 24px 28px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.premium-filter-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.premium-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 7px;
}

.premium-label i {
    color: #4f46e5;
    font-size: 0.85rem;
}

html.light-mode .premium-label,
body.light-mode .premium-label {
    color: #334155;
}

.premium-input,
.premium-select,
.premium-trigger {
    width: 100%;
    background: rgba(15, 23, 42, 0.75);
    border: 1.5px solid rgba(148, 163, 184, 0.28);
    padding: 11px 14px;
    border-radius: 10px;
    color: #f8fafc;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
    min-height: 44px;
}

.premium-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.premium-input:hover,
.premium-select:hover,
.premium-trigger:hover {
    border-color: rgba(99, 102, 241, 0.55);
}

.premium-input:focus,
.premium-select:focus,
.premium-trigger.active {
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 3.5px rgba(79, 70, 229, 0.18) !important;
}

/* Light Mode Overrides for Premium Inputs */
html.light-mode .premium-input,
body.light-mode .premium-input,
html.light-mode .premium-select,
body.light-mode .premium-select,
html.light-mode .premium-trigger,
body.light-mode .premium-trigger {
    background: #ffffff !important;
    border: 1.5px solid #94a3b8 !important;
    color: #0f172a !important;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

html.light-mode .premium-input:hover,
body.light-mode .premium-input:hover,
html.light-mode .premium-select:hover,
body.light-mode .premium-select:hover,
html.light-mode .premium-trigger:hover,
body.light-mode .premium-trigger:hover {
    background: #ffffff !important;
    border-color: #4f46e5 !important;
}

html.light-mode .premium-input:focus,
body.light-mode .premium-input:focus,
html.light-mode .premium-select:focus,
body.light-mode .premium-select:focus {
    background: #ffffff !important;
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 3.5px rgba(79, 70, 229, 0.18) !important;
}

html.light-mode .premium-input::placeholder,
body.light-mode .premium-input::placeholder {
    color: #64748b !important;
    font-weight: 400;
}

html.light-mode .premium-select option,
body.light-mode .premium-select option {
    background: #ffffff;
    color: #0f172a;
}

/* Dropdowns (UNSPSC & Departamentos) */
.premium-dropdown-panel {
    z-index: 9999 !important;
    background: #0f172a !important;
    border: 1.5px solid rgba(99, 102, 241, 0.45);
    border-radius: 12px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.55);
}

.dept-sticky-bar {
    background: #0f172a !important;
}

html.light-mode .premium-dropdown-panel,
body.light-mode .premium-dropdown-panel {
    background: #ffffff !important;
    border: 1.5px solid #94a3b8 !important;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18) !important;
    color: #0f172a !important;
}

html.light-mode .dept-sticky-bar,
body.light-mode .dept-sticky-bar {
    background: #ffffff !important;
}

.stats-grid,
.stats-grid .stat-card {
    position: relative;
    z-index: 1;
}

html.light-mode #dept-dropdown .dept-opt,
body.light-mode #dept-dropdown .dept-opt {
    color: #1e293b !important;
    font-weight: 500;
}

html.light-mode #dept-dropdown .dept-opt:hover,
body.light-mode #dept-dropdown .dept-opt:hover {
    background: #eef2ff !important;
}

/* Chips UNSPSC en Modo Claro */
html.light-mode .unspsc-chip-item,
body.light-mode .unspsc-chip-item {
    background: linear-gradient(135deg, #eef2ff, #e0e7ff) !important;
    border: 1px solid #818cf8 !important;
    color: #312e81 !important;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.12);
}

/* Buscador de tabla (Filtrar entidad...) */
html.light-mode #search-box,
body.light-mode #search-box {
    background: #ffffff !important;
    border: 1.5px solid #94a3b8 !important;
    color: #0f172a !important;
    font-weight: 500;
}

html.light-mode #search-box::placeholder,
body.light-mode #search-box::placeholder {
    color: #64748b !important;
}

/* ══════════════════════════════════════════════════════════
   TABLA AUTO-AJUSTABLE INDEPENDIENTE AL ZOOM (EXTRACCIÓN & ANÁLISIS)
   ══════════════════════════════════════════════════════════ */
#opportunities-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

#opportunities-table th {
    padding: 10px 7px;
    font-size: 0.72rem;
    letter-spacing: 0.3px;
    line-height: 1.2;
    vertical-align: middle;
}

#opportunities-table td {
    padding: 9px 7px;
    font-size: 0.78rem;
    line-height: 1.3;
    vertical-align: middle;
}

#opportunities-table .filter-btn {
    padding: 3px 5px;
    font-size: 0.65rem;
    margin-left: 3px;
    border-radius: 5px;
    flex-shrink: 0;
}

#opportunities-table .th-filter-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3px;
}

/* Ajustes ultra-compactos específicos para Análisis IA (15 columnas visibles) */
.table-analisis-compact th {
    padding: 8px 5px !important;
    font-size: 0.68rem !important;
    letter-spacing: 0.2px !important;
}

.table-analisis-compact td {
    padding: 8px 5px !important;
    font-size: 0.74rem !important;
}

.table-analisis-compact .badge {
    padding: 3px 6px;
    font-size: 0.68rem;
    white-space: nowrap;
}

.table-analisis-compact .btn-ai,
.table-analisis-compact .btn-adjudicacion-winner,
.table-analisis-compact .btn-adjudicacion-pending,
.table-analisis-compact .btn-adjudicacion-desierto,
.table-analisis-compact .badge-adjudicacion-open,
.table-analisis-compact .cell-download button,
.table-analisis-compact .cell-cotizador button {
    padding: 5px 8px !important;
    font-size: 0.7rem !important;
    border-radius: 5px !important;
}

.filter-dropdown::-webkit-scrollbar {
    width: 6px;
}

.filter-dropdown::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.3);
    border-radius: 4px;
}

.filter-dropdown::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.55);
    border-radius: 4px;
}

/* ══════════════════════════════════════════════════════════
   BRÚJULA FINANCIERA RUP & COLUMNA SUGERENCIA A PRIORI (PRE-PDF / PRE-IA)
   ══════════════════════════════════════════════════════════ */
.rup-apriori-banner {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.92));
    border: 1.5px solid rgba(99, 102, 241, 0.38);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 14px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.22);
}

.rup-apriori-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.rup-apriori-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.88rem;
    font-weight: 800;
    color: #f8fafc;
}

.rup-apriori-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 9px;
    border-radius: 99px;
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid rgba(245, 158, 11, 0.45);
    color: #fbbf24;
}

.rup-apriori-disclaimer {
    font-size: 0.72rem;
    color: #cbd5e1;
    font-weight: 500;
}

.rup-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(190px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

@media (max-width: 1200px) {
    .rup-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 680px) {
    .rup-cards-grid {
        grid-template-columns: 1fr;
    }
}

.rup-mini-card {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 10px;
    padding: 9px 12px;
}

.rup-mini-label {
    font-size: 0.67rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.rup-mini-val {
    font-size: 1.02rem;
    font-weight: 800;
    color: #f8fafc;
    line-height: 1.2;
}

.rup-mini-sub {
    font-size: 0.69rem;
    color: #cbd5e1;
    margin-top: 3px;
    line-height: 1.3;
}

.rup-presets-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 9px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.rup-preset-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(30, 41, 59, 0.8);
    color: #e2e8f0;
    transition: all 0.15s ease;
}

.rup-preset-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

.rup-preset-btn.active {
    box-shadow: 0 0 0 2px #6366f1, 0 4px 12px rgba(99, 102, 241, 0.28);
}

.rup-preset-btn.p-oro { background: rgba(16, 185, 129, 0.16); border-color: rgba(16, 185, 129, 0.45); color: #34d399; }
.rup-preset-btn.p-mega { background: rgba(245, 158, 11, 0.16); border-color: rgba(245, 158, 11, 0.45); color: #fbbf24; }
.rup-preset-btn.p-peq { background: rgba(56, 189, 248, 0.16); border-color: rgba(56, 189, 248, 0.45); color: #38bdf8; }
.rup-preset-btn.p-etapa3 { background: rgba(99, 102, 241, 0.2); border-color: rgba(129, 140, 248, 0.55); color: #a5b4fc; }
.rup-preset-btn.p-reg { background: rgba(168, 85, 247, 0.16); border-color: rgba(168, 85, 247, 0.45); color: #c084fc; }
.rup-preset-btn.p-all { background: rgba(148, 163, 184, 0.14); border-color: rgba(148, 163, 184, 0.35); color: #cbd5e1; }

/* Celda en la tabla */
.apriori-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    line-height: 1.18;
}

.apriori-range {
    font-size: 0.64rem;
    font-weight: 700;
    color: #cbd5e1;
    white-space: nowrap;
}

.filter-apriori-sub {
    display: block;
    font-size: 0.67rem;
    font-weight: 600;
    color: #94a3b8;
    margin-top: 1px;
}

.objeto-hover-popover {
    display: none;
    position: fixed;
    z-index: 99999;
    max-width: 420px;
    padding: 10px 13px;
    border-radius: 10px;
    background: #0f172a;
    border: 1px solid #475569;
    color: #f1f5f9;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.45;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    pointer-events: none;
    white-space: normal;
}

html.light-mode .objeto-hover-popover,
body.light-mode .objeto-hover-popover {
    background: #ffffff;
    border: 1.5px solid #6366f1;
    color: #1e293b;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.apriori-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 7px;
    border-radius: 6px;
    font-size: 0.67rem;
    font-weight: 800;
    white-space: nowrap;
    border: 1px solid transparent;
}

.apriori-math {
    font-size: 0.62rem;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
}

.apriori-pill.ap-oro { background: rgba(16, 185, 129, 0.18); border-color: rgba(16, 185, 129, 0.45); color: #34d399; }
.apriori-pill.ap-mega { background: rgba(245, 158, 11, 0.18); border-color: rgba(245, 158, 11, 0.45); color: #fbbf24; }
.apriori-pill.ap-peq { background: rgba(56, 189, 248, 0.16); border-color: rgba(56, 189, 248, 0.42); color: #38bdf8; }
.apriori-pill.ap-reg { background: rgba(168, 85, 247, 0.16); border-color: rgba(168, 85, 247, 0.42); color: #c084fc; }
.apriori-pill.ap-urg { background: rgba(249, 115, 22, 0.18); border-color: rgba(249, 115, 22, 0.45); color: #fb923c; }
.apriori-pill.ap-sin { background: rgba(148, 163, 184, 0.16); border-color: rgba(148, 163, 184, 0.35); color: #cbd5e1; }
.apriori-pill.ap-na  { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.28); color: #fca5a5; }

/* ── MODO CLARO: Brújula Financiera RUP & Columna Sugerencia A Priori ── */
html.light-mode .rup-apriori-banner,
body.light-mode .rup-apriori-banner {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 60%, #eef2ff 100%) !important;
    border: 1.5px solid #a5b4fc !important;
    box-shadow: 0 6px 22px rgba(79, 70, 229, 0.08) !important;
}

html.light-mode .rup-apriori-title,
body.light-mode .rup-apriori-title {
    color: #1e1b4b !important;
}

html.light-mode .rup-apriori-tag,
body.light-mode .rup-apriori-tag {
    background: #fef3c7 !important;
    border-color: #f59e0b !important;
    color: #b45309 !important;
}

html.light-mode .rup-apriori-disclaimer,
body.light-mode .rup-apriori-disclaimer {
    color: #475569 !important;
}

html.light-mode .rup-mini-card,
body.light-mode .rup-mini-card {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

html.light-mode .rup-mini-label,
body.light-mode .rup-mini-label {
    color: #475569 !important;
}

html.light-mode .rup-mini-val,
body.light-mode .rup-mini-val {
    color: #0f172a !important;
}

html.light-mode .rup-mini-sub,
body.light-mode .rup-mini-sub {
    color: #334155 !important;
}

html.light-mode .rup-presets-bar,
body.light-mode .rup-presets-bar {
    border-top-color: #e2e8f0 !important;
}

html.light-mode .rup-preset-btn.p-oro,
body.light-mode .rup-preset-btn.p-oro { background: #ecfdf5 !important; border-color: #10b981 !important; color: #047857 !important; }
html.light-mode .rup-preset-btn.p-mega,
body.light-mode .rup-preset-btn.p-mega { background: #fffbeb !important; border-color: #f59e0b !important; color: #b45309 !important; }
html.light-mode .rup-preset-btn.p-peq,
body.light-mode .rup-preset-btn.p-peq { background: #f0f9ff !important; border-color: #0ea5e9 !important; color: #0369a1 !important; }
html.light-mode .rup-preset-btn.p-etapa3,
body.light-mode .rup-preset-btn.p-etapa3 { background: #eef2ff !important; border-color: #6366f1 !important; color: #3730a3 !important; }
html.light-mode .rup-preset-btn.p-reg,
body.light-mode .rup-preset-btn.p-reg { background: #faf5ff !important; border-color: #a855f7 !important; color: #6b21a8 !important; }
html.light-mode .rup-preset-btn.p-all,
body.light-mode .rup-preset-btn.p-all { background: #f1f5f9 !important; border-color: #94a3b8 !important; color: #334155 !important; }

html.light-mode .apriori-range,
body.light-mode .apriori-range {
    color: #1e293b !important;
}

html.light-mode .filter-apriori-sub,
body.light-mode .filter-apriori-sub {
    color: #475569 !important;
}

html.light-mode .apriori-math,
body.light-mode .apriori-math {
    color: #475569 !important;
}

html.light-mode .apriori-pill.ap-oro,
body.light-mode .apriori-pill.ap-oro { background: #dcfce7 !important; border-color: #16a34a !important; color: #15803d !important; }
html.light-mode .apriori-pill.ap-mega,
body.light-mode .apriori-pill.ap-mega { background: #fef3c7 !important; border-color: #d97706 !important; color: #b45309 !important; }
html.light-mode .apriori-pill.ap-peq,
body.light-mode .apriori-pill.ap-peq { background: #e0f2fe !important; border-color: #0284c7 !important; color: #0369a1 !important; }
html.light-mode .apriori-pill.ap-reg,
body.light-mode .apriori-pill.ap-reg { background: #f3e8ff !important; border-color: #9333ea !important; color: #6b21a8 !important; }
html.light-mode .apriori-pill.ap-urg,
body.light-mode .apriori-pill.ap-urg { background: #ffedd5 !important; border-color: #ea580c !important; color: #c2410c !important; }
html.light-mode .apriori-pill.ap-sin,
body.light-mode .apriori-pill.ap-sin { background: #f1f5f9 !important; border-color: #94a3b8 !important; color: #475569 !important; }
html.light-mode .apriori-pill.ap-na,
body.light-mode .apriori-pill.ap-na  { background: #fee2e2 !important; border-color: #fca5a5 !important; color: #b91c1c !important; }



/* ═══════════════════════════════════════════════════════════════════════════
   💎 ANÁLISIS PREMIUM +++ VIP CON IA (COLUMNA + MODAL A–G · LOCAL VIP :8586)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── BOTÓN SIN ANALIZAR (PREMIUM +++ SATIN LUXURY CTA) ── */
.btn-vip-analyze {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: linear-gradient(135deg, #4338ca 0%, #6d28d9 52%, #a21caf 100%);
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.28);
    padding: 7px 13px;
    border-radius: 11px;
    font-size: 0.74rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(109, 40, 217, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform 0.16s cubic-bezier(.2,.8,.2,1), box-shadow 0.16s ease, filter 0.16s ease;
    position: relative;
    overflow: hidden;
}
.btn-vip-analyze:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(124, 58, 237, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    filter: brightness(1.07);
}
.btn-vip-gem {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 0.82rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}
.btn-vip-txt {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.12;
}
.btn-vip-main {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.15px;
    color: #fff;
}
.btn-vip-tag {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.45px;
    text-transform: uppercase;
    color: rgba(233, 213, 255, 0.92);
}

/* ── TARJETA ANALIZADA EN COLUMNA `ANÁLISIS` (PREMIUM +++ WIDGET EJECUTIVO) ── */
.vip-cell-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 206px;
    max-width: 232px;
    padding: 8px 10px 7px 11px;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(139, 92, 246, 0.28);
    border-left: 4px solid #6366f1;
    box-shadow: 0 4px 14px rgba(2, 6, 23, 0.28);
    cursor: pointer;
    transition: transform 0.16s cubic-bezier(.2,.8,.2,1), box-shadow 0.16s ease, border-color 0.16s ease;
}
.vip-cell-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.24);
    border-color: rgba(139, 92, 246, 0.65);
}
.vip-cell-card.v-solo { border-left-color: #10b981; }
.vip-cell-card.v-ut   { border-left-color: #f59e0b; }
.vip-cell-card.v-adj  { border-left-color: #6366f1; }
.vip-cell-card.v-no   { border-left-color: #ef4444; }

.vip-cell-top {
    display: flex;
    align-items: center;
    gap: 8px;
}
.vip-ring-wrap {
    position: relative;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.vip-ring-svg {
    width: 36px;
    height: 36px;
    transform: rotate(-90deg);
}
.vip-ring-bg {
    fill: none;
    stroke: rgba(148, 163, 184, 0.2);
    stroke-width: 3.3;
}
.vip-ring-fg {
    fill: none;
    stroke-width: 3.3;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.4s ease;
}
.vip-ring-num {
    position: absolute;
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: -0.3px;
    font-variant-numeric: tabular-nums;
}
.vip-cell-mid {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.vip-cell-verdict-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}
.vip-score-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.67rem;
    font-weight: 800;
    border: 1px solid transparent;
    white-space: nowrap;
}
.vip-score-pill.v-solo { background: rgba(16, 185, 129, 0.18); border-color: rgba(16, 185, 129, 0.55); color: #34d399; }
.vip-score-pill.v-ut   { background: rgba(245, 158, 11, 0.18); border-color: rgba(245, 158, 11, 0.55); color: #fbbf24; }
.vip-score-pill.v-adj  { background: rgba(99, 102, 241, 0.18); border-color: rgba(129, 140, 248, 0.55); color: #a5b4fc; }
.vip-score-pill.v-no   { background: rgba(239, 68, 68, 0.16); border-color: rgba(239, 68, 68, 0.55); color: #f87171; }

.vip-cell-meta-chip {
    font-size: 0.62rem;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.vip-cell-meta-chip strong { color: #e2e8f0; font-weight: 800; }

/* Micro-Sparkbar de los 7 bloques A..G dentro de la celda */
.vip-cell-spark {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 4px;
    width: 100%;
    border-radius: 99px;
    overflow: hidden;
}
.vip-seg-dot {
    height: 100%;
    border-radius: 2px;
    min-width: 4px;
    opacity: 0.92;
}

.vip-cell-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.vip-cell-sub {
    font-size: 0.66rem;
    font-weight: 600;
    color: #cbd5e1;
    max-width: 158px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}
.vip-cell-open-hint {
    font-size: 0.6rem;
    font-weight: 800;
    color: #a78bfa;
    white-space: nowrap;
    opacity: 0.85;
}
.vip-cell-card:hover .vip-cell-open-hint {
    opacity: 1;
    text-decoration: underline;
}
.btn-vip-re {
    background: rgba(148, 163, 184, 0.14);
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: #cbd5e1;
    border-radius: 6px;
    width: 20px;
    height: 20px;
    padding: 0;
    font-size: 0.74rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
}
.btn-vip-re:hover {
    background: #7c3aed;
    color: #ffffff;
    border-color: #8b5cf6;
    transform: rotate(90deg);
}

/* Light Mode — Celda VIP PREMIUM +++ */
html.light-mode .vip-cell-card,
body.light-mode .vip-cell-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 60%, #f5f3ff 100%) !important;
    border-color: #ddd6fe !important;
    box-shadow: 0 3px 12px rgba(79, 70, 229, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}
html.light-mode .vip-cell-card:hover,
body.light-mode .vip-cell-card:hover {
    border-color: #8b5cf6 !important;
    box-shadow: 0 8px 22px rgba(99, 102, 241, 0.16) !important;
}
html.light-mode .vip-cell-card.v-solo,
body.light-mode .vip-cell-card.v-solo { border-left-color: #10b981 !important; }
html.light-mode .vip-cell-card.v-ut,
body.light-mode .vip-cell-card.v-ut   { border-left-color: #f59e0b !important; }
html.light-mode .vip-cell-card.v-adj,
body.light-mode .vip-cell-card.v-adj  { border-left-color: #6366f1 !important; }
html.light-mode .vip-cell-card.v-no,
body.light-mode .vip-cell-card.v-no   { border-left-color: #ef4444 !important; }

html.light-mode .vip-ring-bg,
body.light-mode .vip-ring-bg { stroke: #e2e8f0 !important; }
html.light-mode .vip-score-pill.v-solo,
body.light-mode .vip-score-pill.v-solo { background: #dcfce7 !important; border-color: #16a34a !important; color: #15803d !important; }
html.light-mode .vip-score-pill.v-ut,
body.light-mode .vip-score-pill.v-ut   { background: #fef3c7 !important; border-color: #d97706 !important; color: #92400e !important; }
html.light-mode .vip-score-pill.v-adj,
body.light-mode .vip-score-pill.v-adj  { background: #e0e7ff !important; border-color: #6366f1 !important; color: #3730a3 !important; }
html.light-mode .vip-score-pill.v-no,
body.light-mode .vip-score-pill.v-no   { background: #fee2e2 !important; border-color: #ef4444 !important; color: #b91c1c !important; }
html.light-mode .vip-cell-meta-chip,
body.light-mode .vip-cell-meta-chip { color: #64748b !important; }
html.light-mode .vip-cell-meta-chip strong,
body.light-mode .vip-cell-meta-chip strong { color: #0f172a !important; }
html.light-mode .vip-cell-sub,
body.light-mode .vip-cell-sub { color: #1e293b !important; }
html.light-mode .vip-cell-open-hint,
body.light-mode .vip-cell-open-hint { color: #6d28d9 !important; }
html.light-mode .btn-vip-re,
body.light-mode .btn-vip-re { background: #f1f5f9 !important; border-color: #cbd5e1 !important; color: #475569 !important; }
html.light-mode .btn-vip-re:hover,
body.light-mode .btn-vip-re:hover { background: #7c3aed !important; border-color: #7c3aed !important; color: #fff !important; }

/* ── MODAL EJECUTIVO VIP ── */
.vip-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.vip-modal-panel {
    width: 96vw;
    max-width: 1380px;
    max-height: 94vh;
    background: #0f172a;
    color: #e2e8f0;
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: 20px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.65);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.vip-modal-header {
    padding: 16px 24px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.22), rgba(147, 51, 234, 0.14), rgba(15, 23, 42, 0.95));
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.vip-hdr-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}
.vip-id-chip {
    background: linear-gradient(135deg, #4f46e5, #9333ea);
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    font-weight: 800;
    padding: 7px 13px;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}
.vip-hdr-titles h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: #f8fafc;
    line-height: 1.25;
}
.vip-hdr-sub {
    font-size: 0.78rem;
    color: #94a3b8;
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.vip-private-tag {
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
}
.vip-hdr-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.vip-btn-action {
    background: rgba(124, 58, 237, 0.18);
    border: 1px solid rgba(139, 92, 246, 0.45);
    color: #e9d5ff;
    padding: 8px 14px;
    border-radius: 9px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.vip-btn-action:hover {
    background: rgba(124, 58, 237, 0.35);
}
.vip-btn-close {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.vip-btn-close:hover { background: #ef4444; color: #fff; }

.vip-modal-body {
    padding: 22px 26px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Loading Steps */
.vip-loading-box {
    max-width: 720px;
    margin: 32px auto;
    background: rgba(30, 41, 59, 0.65);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    padding: 28px 32px;
}
.vip-step-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: 0.86rem;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.12);
    color: #94a3b8;
    transition: all 0.25s ease;
}
.vip-step-row.active {
    border-color: #8b5cf6;
    background: rgba(124, 58, 237, 0.14);
    color: #f8fafc;
    font-weight: 700;
}
.vip-step-row.done {
    border-color: rgba(16, 185, 129, 0.4);
    color: #34d399;
}

/* ── ROJO PREMIUM +++: BRECHA FALTANTE Y SUGERENCIA IA POR DESGLOSE (A..G) ── */
.vip-red-miss-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 900;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.2), rgba(190, 18, 60, 0.14));
    border: 1px solid rgba(248, 113, 113, 0.65);
    color: #fca5a5;
    box-shadow: 0 2px 10px rgba(220, 38, 38, 0.18);
    white-space: nowrap;
}
.vip-red-miss-mini {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    background: rgba(239, 68, 68, 0.16);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    white-space: nowrap;
}
.vip-full-ok-pill,
.vip-full-ok-mini {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.45);
    color: #34d399;
    white-space: nowrap;
}
.vip-gap-red-card {
    margin-top: 14px;
    margin-bottom: 0;
    padding: 12px 15px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.34) 0%, rgba(69, 10, 10, 0.26) 55%, rgba(30, 41, 59, 0.65) 100%);
    border: 1px solid rgba(248, 113, 113, 0.42);
    border-left: 4px solid #ef4444;
    box-shadow: 0 6px 18px rgba(220, 38, 38, 0.12);
}
.vip-gap-red-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 7px;
}
.vip-gap-red-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.35px;
    background: linear-gradient(135deg, #dc2626, #be123c);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(220, 38, 38, 0.32);
}
.vip-gap-red-sub {
    font-size: 0.7rem;
    font-weight: 700;
    color: #fca5a5;
    opacity: 0.9;
}
.vip-gap-red-line {
    font-size: 0.82rem;
    line-height: 1.46;
    color: #fee2e2;
    margin-bottom: 6px;
}
.vip-gap-red-line strong {
    color: #fca5a5;
}
.vip-gap-red-sug {
    font-size: 0.81rem;
    line-height: 1.46;
    color: #ffe4e6;
    padding-top: 6px;
    border-top: 1px dashed rgba(248, 113, 113, 0.32);
}
.vip-gap-red-sug strong {
    color: #fda4af;
}
.vip-zero-gap-bar {
    font-size: 0.79rem;
    margin-top: 12px;
    margin-bottom: 0;
    padding: 8px 13px;
    border-radius: 9px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

/* Light Mode — Rojo Premium +++ (Elegante, nítido, rubí ejecutivo) */
html.light-mode .vip-red-miss-pill,
body.light-mode .vip-red-miss-pill {
    background: linear-gradient(135deg, #fef2f2, #ffe4e6) !important;
    border-color: #f87171 !important;
    color: #b91c1c !important;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.1) !important;
}
html.light-mode .vip-red-miss-mini,
body.light-mode .vip-red-miss-mini {
    background: #fef2f2 !important;
    border-color: #fca5a5 !important;
    color: #b91c1c !important;
}
html.light-mode .vip-full-ok-pill,
body.light-mode .vip-full-ok-pill,
html.light-mode .vip-full-ok-mini,
body.light-mode .vip-full-ok-mini {
    background: #ecfdf5 !important;
    border-color: #6ee7b7 !important;
    color: #047857 !important;
}
html.light-mode .vip-gap-red-card,
body.light-mode .vip-gap-red-card {
    background: linear-gradient(135deg, #fff1f2 0%, #fef2f2 55%, #ffffff 100%) !important;
    border: 1px solid #fecaca !important;
    border-left: 4px solid #dc2626 !important;
    box-shadow: 0 5px 16px rgba(220, 38, 38, 0.08) !important;
}
html.light-mode .vip-gap-red-sub,
body.light-mode .vip-gap-red-sub {
    color: #9f1239 !important;
}
html.light-mode .vip-gap-red-line,
body.light-mode .vip-gap-red-line {
    color: #450a0a !important;
}
html.light-mode .vip-gap-red-line strong,
body.light-mode .vip-gap-red-line strong {
    color: #b91c1c !important;
}
html.light-mode .vip-gap-red-sug,
body.light-mode .vip-gap-red-sug {
    color: #4c0519 !important;
    border-top-color: #fecdd3 !important;
}
html.light-mode .vip-gap-red-sug strong,
body.light-mode .vip-gap-red-sug strong {
    color: #be123c !important;
}
html.light-mode .vip-zero-gap-bar,
body.light-mode .vip-zero-gap-bar {
    background: #ecfdf5 !important;
    border-color: #a7f3d0 !important;
    color: #065f46 !important;
}

/* Sticky Quick-Jump Bar & Hero SVG Gauge */
.vip-quick-nav {
    position: sticky;
    top: -12px;
    z-index: 25;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 9px 12px;
    margin-bottom: -4px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 92, 246, 0.32);
    box-shadow: 0 6px 18px rgba(2, 6, 23, 0.35);
}
.vip-jump-pill {
    background: rgba(99, 102, 241, 0.14);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #e2e8f0;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.14s ease;
    white-space: nowrap;
}
.vip-jump-pill:hover {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border-color: transparent;
    transform: translateY(-1px);
}
.vip-jump-special {
    background: rgba(139, 92, 246, 0.22);
    border-color: rgba(167, 139, 250, 0.45);
}

.vip-hero-gauge-wrap {
    position: relative;
    width: 108px;
    height: 108px;
    margin: 2px auto 6px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
.vip-hero-gauge-svg {
    width: 108px;
    height: 108px;
    transform: rotate(-90deg);
}
.vip-hero-gauge-bg {
    fill: none;
    stroke: rgba(148, 163, 184, 0.18);
    stroke-width: 8;
}
.vip-hero-gauge-fg {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.28));
    transition: stroke-dashoffset 0.5s ease;
}
.vip-hero-gauge-center {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vip-weight-row:hover {
    border-color: rgba(139, 92, 246, 0.55) !important;
    transform: translateX(3px);
}

html.light-mode .vip-quick-nav,
body.light-mode .vip-quick-nav {
    background: rgba(255, 255, 255, 0.92) !important;
    border-color: #c4b5fd !important;
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.1) !important;
}
html.light-mode .vip-jump-pill,
body.light-mode .vip-jump-pill {
    background: #f5f3ff !important;
    border-color: #ddd6fe !important;
    color: #4c1d95 !important;
}
html.light-mode .vip-jump-pill:hover,
body.light-mode .vip-jump-pill:hover {
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    color: #ffffff !important;
}
html.light-mode .vip-hero-gauge-bg,
body.light-mode .vip-hero-gauge-bg {
    stroke: #e2e8f0 !important;
}

/* Hero Verdict Card */
.vip-hero-banner {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 20px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.96));
    border: 1px solid rgba(139, 92, 246, 0.32);
    border-radius: 16px;
    padding: 20px 22px;
    align-items: center;
}
@media (max-width: 860px) {
    .vip-hero-banner { grid-template-columns: 1fr; }
}
.vip-score-circle-box {
    text-align: center;
    padding: 14px 12px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.16);
}
.vip-big-pct {
    font-size: 2.9rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -1px;
}
.vip-pct-breakdown {
    margin-top: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #94a3b8;
    line-height: 1.4;
}
.vip-verdict-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 900;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
}
.vip-hero-headline {
    font-size: 1.15rem;
    font-weight: 800;
    color: #f8fafc;
    margin: 0 0 10px 0;
    line-height: 1.35;
}
.vip-kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.vip-kpi-mini {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 10px;
    padding: 9px 12px;
}
.vip-kpi-mini-lbl {
    font-size: 0.68rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #94a3b8;
    margin-bottom: 3px;
}
.vip-kpi-mini-val {
    font-size: 0.82rem;
    font-weight: 700;
    color: #e2e8f0;
    line-height: 1.3;
}

/* Section Cards */
.vip-sec-card {
    background: rgba(30, 41, 59, 0.52);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 15px;
    padding: 18px 20px;
}
.vip-sec-title {
    font-size: 0.96rem;
    font-weight: 800;
    color: #f8fafc;
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

/* RUP Table */
.vip-table-wrap { overflow-x: auto; }
.vip-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.vip-table th {
    text-align: left;
    padding: 9px 12px;
    background: rgba(15, 23, 42, 0.7);
    color: #94a3b8;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}
.vip-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    color: #e2e8f0;
    vertical-align: top;
}

/* Candados Grid */
.vip-locks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 12px;
}
.vip-lock-item {
    background: rgba(15, 23, 42, 0.62);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-left: 4px solid #6366f1;
    border-radius: 11px;
    padding: 13px 15px;
}
.vip-lock-item.st-ok { border-left-color: #10b981; }
.vip-lock-item.st-ut { border-left-color: #f59e0b; }
.vip-lock-item.st-ver { border-left-color: #38bdf8; }
.vip-lock-item.st-bad { border-left-color: #ef4444; }

/* Weighted Rubric */
.vip-weight-row {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.12);
    margin-bottom: 8px;
}
.vip-weight-bar-bg {
    height: 7px;
    background: rgba(148, 163, 184, 0.16);
    border-radius: 99px;
    overflow: hidden;
    margin: 6px 0;
}
.vip-weight-bar-fill {
    height: 100%;
    border-radius: 99px;
}

/* Executive Conclusion 3-Boxes */
.vip-conclusion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 14px;
}
.vip-conc-box {
    border-radius: 12px;
    padding: 15px 16px;
    font-size: 0.85rem;
    line-height: 1.58;
}
.vip-conc-box h4 {
    margin: 0 0 8px 0;
    font-size: 0.86rem;
    font-weight: 800;
}

/* Light Mode — Modal Ejecutivo VIP Completo */
html.light-mode .vip-modal-panel,
body.light-mode .vip-modal-panel {
    background: #f8fafc !important;
    color: #0f172a !important;
    border-color: #c4b5fd !important;
}
html.light-mode .vip-modal-header,
body.light-mode .vip-modal-header {
    background: linear-gradient(135deg, #eef2ff, #f5f3ff, #ffffff) !important;
    border-bottom-color: #e2e8f0 !important;
}
html.light-mode .vip-hdr-titles h2,
body.light-mode .vip-hdr-titles h2,
html.light-mode .vip-hero-headline,
body.light-mode .vip-hero-headline,
html.light-mode .vip-sec-title,
body.light-mode .vip-sec-title {
    color: #0f172a !important;
}
html.light-mode .vip-hdr-sub,
body.light-mode .vip-hdr-sub,
html.light-mode .vip-pct-breakdown,
body.light-mode .vip-pct-breakdown,
html.light-mode .vip-kpi-mini-lbl,
body.light-mode .vip-kpi-mini-lbl {
    color: #475569 !important;
}
html.light-mode .vip-private-tag,
body.light-mode .vip-private-tag {
    background: #dcfce7 !important;
    border-color: #16a34a !important;
    color: #15803d !important;
}
html.light-mode .vip-btn-action,
body.light-mode .vip-btn-action {
    background: #ede9fe !important;
    border-color: #8b5cf6 !important;
    color: #5b21b6 !important;
}
html.light-mode .vip-hero-banner,
body.light-mode .vip-hero-banner {
    background: linear-gradient(135deg, #ffffff, #f5f3ff) !important;
    border-color: #c4b5fd !important;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.08);
}
html.light-mode .vip-score-circle-box,
body.light-mode .vip-score-circle-box,
html.light-mode .vip-kpi-mini,
body.light-mode .vip-kpi-mini,
html.light-mode .vip-sec-card,
body.light-mode .vip-sec-card,
html.light-mode .vip-lock-item,
body.light-mode .vip-lock-item,
html.light-mode .vip-weight-row,
body.light-mode .vip-weight-row,
html.light-mode .vip-loading-box,
body.light-mode .vip-loading-box {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #1e293b !important;
}
html.light-mode .vip-kpi-mini-val,
body.light-mode .vip-kpi-mini-val,
html.light-mode .vip-table td,
body.light-mode .vip-table td {
    color: #0f172a !important;
}
html.light-mode .vip-table th,
body.light-mode .vip-table th {
    background: #f1f5f9 !important;
    color: #334155 !important;
    border-bottom-color: #cbd5e1 !important;
}
html.light-mode .vip-step-row,
body.light-mode .vip-step-row {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #475569 !important;
}
html.light-mode .vip-step-row.active,
body.light-mode .vip-step-row.active {
    background: #ede9fe !important;
    border-color: #7c3aed !important;
    color: #3b0764 !important;
}
html.light-mode .vip-step-row.done,
body.light-mode .vip-step-row.done {
    background: #ecfdf5 !important;
    border-color: #10b981 !important;
    color: #047857 !important;
}


/* ═══════════════════════════════════════════════════════════════════════════
   📐 AJUSTE INTEGRAL DE ANCHO DE LAS 17 COLUMNAS + MOTOR MASIVO VIP +++
   ═══════════════════════════════════════════════════════════════════════════ */

body.page-analisis-vip {
    --sidebar-width: 218px;
}
body.page-analisis-vip .sidebar {
    padding: 16px 12px;
}
body.page-analisis-vip .sidebar .nav-item {
    padding: 9px 11px;
    font-size: 0.84rem;
    gap: 9px;
}
body.page-analisis-vip .main-content {
    padding: 18px 12px 26px 12px;
    max-width: calc(100vw - var(--sidebar-width));
}

/* Barra superior sincronizada de scroll horizontal */
.table-top-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    height: 11px;
    margin-bottom: 4px;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.08);
}
.table-top-scroll::-webkit-scrollbar {
    height: 8px;
}
.table-top-scroll::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.52);
    border-radius: 6px;
}

/* Balance exacto de las 17 columnas visibles en Análisis IA */
body.page-analisis-vip #opportunities-table.table-analisis-compact {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}
body.page-analisis-vip #opportunities-table.table-analisis-compact th {
    padding: 7px 4px !important;
    font-size: 0.62rem !important;
    letter-spacing: 0.05px !important;
    line-height: 1.15 !important;
    white-space: nowrap;
}
body.page-analisis-vip #opportunities-table.table-analisis-compact td {
    padding: 6px 4px !important;
    font-size: 0.69rem !important;
    line-height: 1.2 !important;
    vertical-align: middle;
}
body.page-analisis-vip #opportunities-table .filter-btn {
    padding: 2px 4px !important;
    font-size: 0.58rem !important;
    margin-left: 2px !important;
}
body.page-analisis-vip #opportunities-table .sort-indicator {
    font-size: 0.6rem;
    opacity: 0.7;
}

/* Compactación inteligente de columna Sugerencia A Priori (ahorra ~120px sin perder ningún dato) */
body.page-analisis-vip .apriori-wrap {
    max-width: 138px;
    gap: 1.5px;
}
body.page-analisis-vip .apriori-pill {
    font-size: 0.61rem !important;
    padding: 2px 6px !important;
}
body.page-analisis-vip .apriori-range,
body.page-analisis-vip .apriori-math {
    font-size: 0.58rem !important;
    white-space: normal !important;
    line-height: 1.15 !important;
}

/* Compactación elegante del widget VIP en celda (mantiene anillo SVG + píldora + sparkline A-G) */
body.page-analisis-vip .vip-cell-card {
    min-width: 152px !important;
    max-width: 172px !important;
    padding: 5px 7px 5px 8px !important;
    gap: 4px !important;
    border-radius: 10px !important;
}
body.page-analisis-vip .vip-cell-top {
    gap: 6px !important;
}
body.page-analisis-vip .vip-ring-wrap,
body.page-analisis-vip .vip-ring-svg {
    width: 30px !important;
    height: 30px !important;
}
body.page-analisis-vip .vip-ring-num {
    font-size: 0.58rem !important;
}
body.page-analisis-vip .vip-score-pill {
    font-size: 0.61rem !important;
    padding: 1.5px 6px !important;
}
body.page-analisis-vip .vip-cell-meta-chip {
    font-size: 0.57rem !important;
}
body.page-analisis-vip .vip-cell-sub {
    font-size: 0.6rem !important;
    max-width: 116px !important;
}
body.page-analisis-vip .btn-vip-re {
    width: 18px !important;
    height: 18px !important;
    font-size: 0.66rem !important;
}
body.page-analisis-vip .btn-vip-analyze {
    padding: 5px 9px !important;
    gap: 6px !important;
    border-radius: 9px !important;
}
body.page-analisis-vip .btn-vip-gem {
    width: 20px !important;
    height: 20px !important;
    font-size: 0.72rem !important;
}
body.page-analisis-vip .btn-vip-main {
    font-size: 0.68rem !important;
}
body.page-analisis-vip .btn-vip-tag {
    font-size: 0.54rem !important;
}
body.page-analisis-vip .table-analisis-compact .cell-download button,
body.page-analisis-vip .table-analisis-compact .cell-cotizador button,
body.page-analisis-vip .table-analisis-compact .btn-adjudicacion-winner,
body.page-analisis-vip .table-analisis-compact .btn-adjudicacion-pending,
body.page-analisis-vip .table-analisis-compact .btn-adjudicacion-desierto,
body.page-analisis-vip .table-analisis-compact .badge-adjudicacion-open {
    padding: 4px 6px !important;
    font-size: 0.64rem !important;
    border-radius: 6px !important;
}

/* ── TOOLBAR EJECUTIVA + BOTÓN MASIVO PREMIUM +++ ── */
.vip-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.vip-toolbar-left,
.vip-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.vip-toolbar-count-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}
.btn-vip-masivo-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #c026d3 100%);
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}
.btn-vip-masivo-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(124, 58, 237, 0.52);
    filter: brightness(1.06);
}
.btn-vip-masivo-cta.is-running {
    background: linear-gradient(135deg, #059669 0%, #0284c7 52%, #6d28d9 100%);
    animation: pulseGlow 2s infinite;
}
.btn-masivo-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}
.btn-masivo-texts {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
}
.btn-masivo-title {
    font-size: 0.8rem;
    font-weight: 800;
    color: #ffffff;
}
.btn-masivo-sub {
    font-size: 0.62rem;
    font-weight: 600;
    color: rgba(243, 232, 255, 0.92);
}
.btn-masivo-badge {
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.35);
    font-size: 0.74rem;
    font-weight: 900;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
}

/* ── MODAL DE CONFIRMACIÓN PREVIA (SÍ / NO) ── */
.vip-masivo-confirm-card {
    width: min(650px, 94vw);
    border-radius: 20px;
    background: linear-gradient(155deg, #0f172a 0%, #1e1b4b 100%);
    border: 1.5px solid rgba(139, 92, 246, 0.45);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.65);
    overflow: hidden;
    color: #f8fafc;
}
.vip-mc-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(192, 38, 211, 0.12));
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}
.vip-mc-icon-ring {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.4);
}
.vip-mc-titles {
    flex: 1;
}
.vip-mc-eyebrow {
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #c4b5fd;
    text-transform: uppercase;
}
.vip-mc-titles h2 {
    margin: 3px 0 0;
    font-size: 1.12rem;
    font-weight: 800;
    color: #ffffff;
}
.vip-mc-body {
    padding: 20px 22px 22px;
}
.vip-mc-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}
.vip-mc-stat {
    padding: 11px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.22);
    text-align: center;
}
.vip-mc-stat-num {
    font-size: 1.45rem;
    font-weight: 900;
    line-height: 1.1;
}
.vip-mc-stat-lbl {
    font-size: 0.68rem;
    font-weight: 700;
    color: #94a3b8;
    margin-top: 3px;
}
.vip-mc-filter-box {
    padding: 11px 14px;
    border-radius: 11px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.32);
    font-size: 0.78rem;
    line-height: 1.45;
    margin-bottom: 12px;
}
.vip-mc-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 13px;
    border-radius: 11px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
}
.vip-mc-persist-note {
    padding: 9px 13px;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
    font-size: 0.75rem;
    line-height: 1.4;
    margin-bottom: 18px;
}
.vip-mc-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.vip-mc-btn-no {
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid rgba(239, 68, 68, 0.45);
    background: rgba(239, 68, 68, 0.14);
    color: #fca5a5;
    font-size: 0.84rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s ease;
}
.vip-mc-btn-no:hover {
    background: #ef4444;
    color: #ffffff;
}
.vip-mc-btn-yes {
    padding: 10px 22px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    font-size: 0.86rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.38);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.vip-mc-btn-yes:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(16, 185, 129, 0.5);
}

/* ── CENTRO DE COMANDO EN VIVO: MASIVO DUAL-TRACK DOCK ── */
.vip-masivo-dock {
    margin-bottom: 14px;
    border-radius: 16px;
    padding: 14px 16px;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(30, 27, 75, 0.94));
    border: 1.5px solid rgba(139, 92, 246, 0.48);
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.35);
    color: #f8fafc;
}
.vip-md-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.vip-md-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.vip-md-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.vip-md-live-pill.st-running { background: rgba(16, 185, 129, 0.2); border: 1px solid #10b981; color: #34d399; }
.vip-md-live-pill.st-paused  { background: rgba(245, 158, 11, 0.2); border: 1px solid #f59e0b; color: #fbbf24; }
.vip-md-live-pill.st-done    { background: rgba(99, 102, 241, 0.22); border: 1px solid #818cf8; color: #c7d2fe; }
.vip-md-live-pill.st-stopped { background: rgba(239, 68, 68, 0.18); border: 1px solid #ef4444; color: #fca5a5; }

.vip-md-controls {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}
.vip-md-btn {
    padding: 5px 11px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: rgba(30, 41, 59, 0.85);
    color: #e2e8f0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
}
.vip-md-btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.vip-md-btn.b-pause  { border-color: rgba(245, 158, 11, 0.55); color: #fbbf24; background: rgba(245, 158, 11, 0.14); }
.vip-md-btn.b-resume { border-color: rgba(16, 185, 129, 0.55); color: #34d399; background: rgba(16, 185, 129, 0.16); }
.vip-md-btn.b-stop   { border-color: rgba(239, 68, 68, 0.55); color: #fca5a5; background: rgba(239, 68, 68, 0.14); }

.vip-md-global-bar {
    height: 9px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
    overflow: hidden;
    margin: 11px 0 12px;
}
.vip-md-global-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 50%, #10b981 100%);
    transition: width 0.45s ease;
}
.vip-md-tracks-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 12px;
}
@media (max-width: 900px) {
    .vip-md-tracks-grid { grid-template-columns: 1fr; }
    .vip-mc-stats-grid { grid-template-columns: 1fr; }
}
.vip-md-track-card {
    padding: 11px 13px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.66);
    border: 1px solid rgba(148, 163, 184, 0.22);
}
.vip-md-track-card.t-pdf.is-active { border-color: rgba(59, 130, 246, 0.65); box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2); }
.vip-md-track-card.t-ai.is-active  { border-color: rgba(168, 85, 247, 0.65); box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.2); }

.vip-md-logs {
    margin-top: 10px;
    max-height: 112px;
    overflow-y: auto;
    padding: 8px 11px;
    border-radius: 10px;
    background: rgba(2, 6, 23, 0.52);
    border: 1px solid rgba(148, 163, 184, 0.16);
    font-size: 0.72rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Resaltado vivo en las filas de la tabla mientras el Masivo trabaja */
tr.masivo-active-pdf {
    background: rgba(59, 130, 246, 0.09) !important;
    box-shadow: inset 3px 0 0 #3b82f6;
}
tr.masivo-active-ai {
    background: rgba(139, 92, 246, 0.11) !important;
    box-shadow: inset 3px 0 0 #8b5cf6;
}

/* ── MODO CLARO (LIGHT MODE) PARA TOOLBAR, MODAL SÍ/NO Y DOCK MASIVO ── */
html.light-mode .vip-toolbar-count-pill,
body.light-mode .vip-toolbar-count-pill {
    background: #eef2ff !important;
    border-color: #a5b4fc !important;
    color: #3730a3 !important;
}
html.light-mode .vip-masivo-confirm-card,
body.light-mode .vip-masivo-confirm-card {
    background: #ffffff !important;
    border-color: #8b5cf6 !important;
    color: #0f172a !important;
    box-shadow: 0 25px 65px rgba(15, 23, 42, 0.24) !important;
}
html.light-mode .vip-mc-header,
body.light-mode .vip-mc-header {
    background: linear-gradient(135deg, #f5f3ff, #eef2ff) !important;
    border-bottom-color: #ddd6fe !important;
}
html.light-mode .vip-mc-eyebrow,
body.light-mode .vip-mc-eyebrow { color: #6d28d9 !important; }
html.light-mode .vip-mc-titles h2,
body.light-mode .vip-mc-titles h2 { color: #1e1b4b !important; }
html.light-mode .vip-mc-stat,
body.light-mode .vip-mc-stat {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}
html.light-mode .vip-mc-stat-lbl,
body.light-mode .vip-mc-stat-lbl { color: #475569 !important; }
html.light-mode .vip-mc-filter-box,
body.light-mode .vip-mc-filter-box {
    background: #eff6ff !important;
    border-color: #93c5fd !important;
    color: #1e3a8a !important;
}
html.light-mode .vip-mc-toggle-row,
body.light-mode .vip-mc-toggle-row {
    background: #f5f3ff !important;
    border-color: #c4b5fd !important;
    color: #3b0764 !important;
}
html.light-mode .vip-mc-persist-note,
body.light-mode .vip-mc-persist-note {
    background: #ecfdf5 !important;
    border-color: #6ee7b7 !important;
    color: #065f46 !important;
}
html.light-mode .vip-mc-btn-no,
body.light-mode .vip-mc-btn-no {
    background: #fef2f2 !important;
    border-color: #fca5a5 !important;
    color: #b91c1c !important;
}
html.light-mode .vip-mc-btn-no:hover,
body.light-mode .vip-mc-btn-no:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
}

html.light-mode .vip-masivo-dock,
body.light-mode .vip-masivo-dock {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 55%, #f5f3ff 100%) !important;
    border-color: #a78bfa !important;
    color: #0f172a !important;
    box-shadow: 0 10px 28px rgba(99, 102, 241, 0.14) !important;
}
html.light-mode .vip-md-live-pill.st-running,
body.light-mode .vip-md-live-pill.st-running { background: #dcfce7 !important; border-color: #16a34a !important; color: #15803d !important; }
html.light-mode .vip-md-live-pill.st-paused,
body.light-mode .vip-md-live-pill.st-paused  { background: #fef3c7 !important; border-color: #d97706 !important; color: #b45309 !important; }
html.light-mode .vip-md-live-pill.st-done,
body.light-mode .vip-md-live-pill.st-done    { background: #e0e7ff !important; border-color: #6366f1 !important; color: #3730a3 !important; }
html.light-mode .vip-md-live-pill.st-stopped,
body.light-mode .vip-md-live-pill.st-stopped { background: #fee2e2 !important; border-color: #ef4444 !important; color: #b91c1c !important; }
html.light-mode .vip-md-btn,
body.light-mode .vip-md-btn {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
}
html.light-mode .vip-md-btn.b-pause,
body.light-mode .vip-md-btn.b-pause  { background: #fffbeb !important; border-color: #f59e0b !important; color: #b45309 !important; }
html.light-mode .vip-md-btn.b-resume,
body.light-mode .vip-md-btn.b-resume { background: #ecfdf5 !important; border-color: #10b981 !important; color: #047857 !important; }
html.light-mode .vip-md-btn.b-stop,
body.light-mode .vip-md-btn.b-stop   { background: #fef2f2 !important; border-color: #ef4444 !important; color: #b91c1c !important; }
html.light-mode .vip-md-track-card,
body.light-mode .vip-md-track-card {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}
html.light-mode .vip-md-logs,
body.light-mode .vip-md-logs {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #334155 !important;
}

/* ═══ 🏆 BOTÓN, MODAL Y DOCK MASIVO DE ADJUDICACIÓN (CHAMPIONSHIP GOLD) ═══ */
.btn-adj-masivo-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    border-radius: 12px;
    border: 1px solid rgba(254, 240, 138, 0.35);
    background: linear-gradient(135deg, #b45309 0%, #d97706 48%, #ea580c 100%);
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(217, 119, 6, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.28);
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}
.btn-adj-masivo-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(245, 158, 11, 0.52);
    filter: brightness(1.06);
}
.btn-adj-masivo-cta.is-running {
    background: linear-gradient(135deg, #059669 0%, #d97706 55%, #b45309 100%);
    animation: pulseGlow 2s infinite;
}
.btn-adj-masivo-cta .btn-masivo-sub {
    color: rgba(254, 243, 199, 0.94);
}

.adj-masivo-confirm-card {
    border-color: rgba(245, 158, 11, 0.52) !important;
    background: linear-gradient(155deg, #0f172a 0%, #271a0c 100%);
}
.adj-masivo-confirm-card .vip-mc-header {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(234, 88, 12, 0.14));
}
.adj-masivo-confirm-card .vip-mc-icon-ring {
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.42);
}
.adj-masivo-confirm-card .vip-mc-eyebrow {
    color: #fcd34d;
}

.adj-masivo-dock {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(41, 26, 10, 0.94));
    border-color: rgba(245, 158, 11, 0.52);
}
.adj-masivo-dock .vip-md-global-fill {
    background: linear-gradient(90deg, #f59e0b 0%, #ea580c 52%, #10b981 100%);
}
.vip-md-track-card.t-adj-prep.is-active {
    border-color: rgba(245, 158, 11, 0.7);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.22);
}
.vip-md-track-card.t-adj-ai.is-active {
    border-color: rgba(16, 185, 129, 0.7);
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.22);
}

tr.masivo-active-adj {
    background: rgba(245, 158, 11, 0.11) !important;
    box-shadow: inset 3px 0 0 #f59e0b;
}

html.light-mode .adj-masivo-confirm-card,
body.light-mode .adj-masivo-confirm-card {
    background: #ffffff !important;
    border-color: #f59e0b !important;
    color: #0f172a !important;
}
html.light-mode .adj-masivo-confirm-card .vip-mc-header,
body.light-mode .adj-masivo-confirm-card .vip-mc-header {
    background: linear-gradient(135deg, #fffbeb, #ffedd5) !important;
    border-bottom-color: #fde68a !important;
}
html.light-mode .adj-masivo-confirm-card .vip-mc-eyebrow,
body.light-mode .adj-masivo-confirm-card .vip-mc-eyebrow {
    color: #b45309 !important;
}
html.light-mode .adj-masivo-dock,
body.light-mode .adj-masivo-dock {
    background: linear-gradient(145deg, #ffffff 0%, #fffbeb 60%, #ffedd5 100%) !important;
    border-color: #f59e0b !important;
    color: #0f172a !important;
    box-shadow: 0 10px 28px rgba(245, 158, 11, 0.16) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   🏆 CENTRO DE INTELIGENCIA GRÁFICA DE ADJUDICACIONES (3 GRÁFICAS FORENSES)
   ═══════════════════════════════════════════════════════════════════════════ */
.adj-intel-panel {
    grid-column: 1 / -1;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.88), rgba(30, 27, 18, 0.82));
    border: 1px solid rgba(245, 158, 11, 0.38);
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(251, 191, 36, 0.14);
}
.adj-intel-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.adj-intel-title {
    font-size: 1.06rem;
    font-weight: 800;
    color: #fef3c7;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.adj-intel-badge {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
}
.adj-intel-sub {
    font-size: 0.8rem;
    color: #cbd5e1;
    margin-top: 4px;
}
.adj-intel-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.adj-intel-kpi {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.adj-intel-kpi:hover {
    transform: translateY(-2px);
    border-color: rgba(245, 158, 11, 0.55);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.14);
}
.adj-intel-kpi-lbl {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}
.adj-intel-kpi-val {
    font-size: 1.24rem;
    font-weight: 900;
    color: #fbbf24;
    margin: 3px 0 2px;
}
.adj-intel-kpi-sub {
    font-size: 0.73rem;
    color: #cbd5e1;
}
.adj-intel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.adj-intel-card {
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 15px 16px;
    display: flex;
    flex-direction: column;
}
.adj-intel-card.span-2 {
    grid-column: 1 / -1;
}
.adj-card-hdr {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.adj-card-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 7px;
}
.adj-card-desc {
    font-size: 0.74rem;
    color: #94a3b8;
    margin-top: 2px;
}
.adj-mode-tabs {
    display: inline-flex;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
    flex-wrap: wrap;
}
.adj-mode-btn {
    border: none;
    background: transparent;
    color: #cbd5e1;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 5px 9px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.adj-mode-btn.active {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}
.adj-legend-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.72rem;
    color: #cbd5e1;
    margin-bottom: 8px;
}
.adj-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
    margin-right: 4px;
}
@media (max-width: 1180px) {
    .adj-intel-grid {
        grid-template-columns: 1fr;
    }
}

html.light-mode .adj-intel-panel,
body.light-mode .adj-intel-panel {
    background: linear-gradient(145deg, #fffbeb 0%, #ffffff 55%, #fef3c7 100%);
    border-color: #f59e0b;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.12);
}
html.light-mode .adj-intel-title,
body.light-mode .adj-intel-title {
    color: #78350f;
}
html.light-mode .adj-intel-sub,
body.light-mode .adj-intel-sub {
    color: #475569;
}
html.light-mode .adj-intel-kpi,
body.light-mode .adj-intel-kpi,
html.light-mode .adj-intel-card,
body.light-mode .adj-intel-card {
    background: #ffffff;
    border-color: #fde68a;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
html.light-mode .adj-intel-kpi-lbl,
body.light-mode .adj-intel-kpi-lbl,
html.light-mode .adj-card-desc,
body.light-mode .adj-card-desc {
    color: #64748b;
}
html.light-mode .adj-intel-kpi-val,
body.light-mode .adj-intel-kpi-val {
    color: #b45309;
}
html.light-mode .adj-intel-kpi-sub,
body.light-mode .adj-intel-kpi-sub,
html.light-mode .adj-legend-inline,
body.light-mode .adj-legend-inline {
    color: #334155;
}
html.light-mode .adj-card-title,
body.light-mode .adj-card-title {
    color: #0f172a;
}
html.light-mode .adj-mode-tabs,
body.light-mode .adj-mode-tabs {
    background: #fef3c7;
    border-color: #fcd34d;
}
html.light-mode .adj-mode-btn,
body.light-mode .adj-mode-btn {
    color: #78350f;
}
html.light-mode .adj-mode-btn.active,
body.light-mode .adj-mode-btn.active {
    color: #ffffff;
}
