/* ═══════════════════════════════════════════════════════════════════════════
   simulador-adjudicacion.css — [SIMULADOR OCT 2026] pestaña «🎲 Simulador» del Modo Preventa
   Mismo lenguaje visual que modo-preventa.css (variables --mp-*, tarjetas blancas sobre fondo gris, pill tabs)
   ═══════════════════════════════════════════════════════════════════════════ */
.sim { display: flex; flex-direction: column; gap: 14px; font-family: var(--mp-font, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif); color: var(--mp-text, #1D1D1F); }
.sim .sim-card { padding: 18px 20px; }
.sim-cargando, .sim-error { font-size: 13px; color: var(--mp-text-secondary, #86868B); }
.sim-error { color: var(--mp-red, #FF3B30); }

/* cabecera */
.sim-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.sim-head-main { flex: 1; min-width: 260px; }
.sim-title { font-size: 18px; font-weight: 700; letter-spacing: -0.2px; }
.sim-sub { font-size: 12px; color: var(--mp-text-secondary, #86868B); margin-top: 2px; }
.sim-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sim-chip { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: var(--mp-bg-light, #F2F2F7); color: var(--mp-text, #1D1D1F); }
.sim-chip-ia { background: rgba(94, 92, 230, 0.12); color: #4B49C9; }
.sim-chip-ok { background: rgba(52, 199, 89, 0.14); color: #1f8f3f; }
.sim-chip-warn { background: rgba(255, 149, 0, 0.16); color: #b35f00; }
.sim-chip-ko { background: rgba(255, 59, 48, 0.14); color: #c62d24; }
.sim-head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* botones */
.sim-btn { border: none; border-radius: 10px; padding: 8px 14px; font-size: 12px; font-weight: 600; cursor: pointer; background: var(--mp-bg-light, #F2F2F7); color: var(--mp-text, #1D1D1F); font-family: inherit; transition: transform .12s, box-shadow .12s, background .12s; }
.sim-btn:hover { background: #E5E5EA; }
.sim-btn:disabled { opacity: .45; cursor: default; }
.sim-btn-primary { background: var(--mp-gradient, linear-gradient(135deg, #5E5CE6, #BF5AF2)); color: #fff; }
.sim-btn-primary:hover { background: var(--mp-gradient, linear-gradient(135deg, #5E5CE6, #BF5AF2)); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(94, 92, 230, 0.35); }
.sim-btn-ghost { background: transparent; border: 1px dashed #C7C7CC; color: var(--mp-text-secondary, #86868B); }
.sim-btn-ghost:hover { background: var(--mp-bg-light, #F2F2F7); }
.sim-btn-xs { padding: 5px 9px; font-size: 11px; border-radius: 8px; }
.sim-btn-danger { color: var(--mp-red, #FF3B30); }
.sim-x { border: none; background: transparent; color: #AEAEB2; cursor: pointer; font-size: 12px; padding: 2px 4px; border-radius: 6px; }
.sim-x:hover { background: rgba(255, 59, 48, 0.12); color: var(--mp-red, #FF3B30); }

/* avisos */
.sim-avisos:empty { display: none; }
.sim-avisos { display: flex; flex-direction: column; gap: 6px; }
.sim-aviso { font-size: 12.5px; padding: 8px 12px; border-radius: 10px; }
.sim-aviso-ko { background: rgba(255, 59, 48, 0.1); color: #a62820; }
.sim-aviso-warn { background: rgba(255, 149, 0, 0.12); color: #8a4b00; }
.sim-aviso-info { background: rgba(94, 92, 230, 0.08); color: #3f3dab; }

/* tabla de licitadores */
.sim-tabla-card { padding: 10px 12px 14px; }
.sim-tabla-wrap { overflow-x: auto; }
.sim-tabla { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 640px; font-size: 12.5px; }
.sim-tabla th, .sim-tabla td { padding: 8px 10px; vertical-align: top; border-bottom: 1px solid #ECECF1; }
.sim-tabla thead th { position: sticky; top: 0; background: #fff; z-index: 1; }
.sim-rowhead { text-align: left; min-width: 220px; max-width: 320px; }
.sim-rowhead-sub { padding-left: 26px !important; }
.sim-rowsub { font-size: 11px; color: var(--mp-text-secondary, #86868B); margin-top: 2px; }
.sim-tipo { font-size: 11px; color: var(--mp-text-secondary, #86868B); }
.sim-peso { font-size: 11px; font-weight: 700; color: #4B49C9; margin-left: 4px; }
.sim-info { margin-left: 4px; cursor: help; font-size: 11px; }
.sim-fila-grupo td { background: #FAFAFC; }
.sim-col { min-width: 170px; }
.sim-col-nos, .sim-cell-nos { background: rgba(94, 92, 230, 0.05); }
.sim-col-gana .sim-lic-nombre { color: #1f8f3f; }
.sim-col-off { opacity: .5; }
.sim-col-add { min-width: 110px; }
.sim-col-add .sim-btn { display: block; margin-bottom: 6px; }
.sim-lic-head { display: flex; align-items: center; gap: 6px; }
.sim-lic-nombre { flex: 1; min-width: 0; border: none; border-bottom: 1px solid transparent; background: transparent; font: inherit; font-weight: 700; font-size: 13px; padding: 2px 0; color: inherit; }
.sim-lic-nombre:focus { outline: none; border-bottom-color: #5E5CE6; }
.sim-lic-im { font-size: 10.5px; color: var(--mp-text-secondary, #86868B); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.sim-excluir { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 400; color: var(--mp-text-secondary, #86868B); margin-top: 4px; cursor: pointer; }
.sim-tag { display: inline-block; font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--mp-bg-light, #F2F2F7); color: var(--mp-text-secondary, #86868B); }
.sim-tag-nos { background: rgba(94, 92, 230, 0.14); color: #4B49C9; }
.sim-tag-ok { background: rgba(52, 199, 89, 0.14); color: #1f8f3f; }
.sim-tag-warn { background: rgba(255, 149, 0, 0.16); color: #b35f00; }
.sim-tag-ko { background: rgba(255, 59, 48, 0.14); color: #c62d24; }
.sim-cell { text-align: left; }
.sim-in { width: 100%; box-sizing: border-box; border: 1px solid #D9D9DE; border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 12.5px; background: #fff; color: inherit; }
.sim-in:focus { outline: none; border-color: #5E5CE6; box-shadow: 0 0 0 3px rgba(94, 92, 230, 0.15); }
.sim-in-precio { font-weight: 700; }
.sim-in-sel { padding: 5px 6px; }
.sim-usa-precio { font-size: 11px; color: var(--mp-text-secondary, #86868B); padding: 6px 0; }
.sim-baja { font-size: 11px; color: var(--mp-text-secondary, #86868B); margin-top: 3px; min-height: 13px; }
.sim-res { margin-top: 3px; font-size: 11.5px; min-height: 14px; }
.sim-res-pt { font-weight: 700; color: #4B49C9; }
.sim-res-falta { color: #b35f00; }
.sim-fila-total td { border-top: 2px solid #E5E5EA; background: #FAFAFC; }
.sim-total { font-size: 18px; font-weight: 800; letter-spacing: -0.3px; }
.sim-pos { font-size: 11.5px; color: var(--mp-text-secondary, #86868B); margin-top: 2px; }
.sim-pos-1 { color: #1f8f3f; font-weight: 700; }
.sim-anormal { margin-top: 4px; }
.sim-ko { color: var(--mp-red, #FF3B30); }
.sim-corner { min-width: 220px; }
.sim-estado-calc { font-size: 12px; color: var(--mp-text-secondary, #86868B); }
.sim-leyenda { font-size: 11.5px; color: var(--mp-text-secondary, #86868B); padding: 10px 6px 0; line-height: 1.5; }

/* análisis */
.sim-section-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.sim-section-sub { font-size: 13px; font-weight: 700; margin: 14px 0 6px; }
.sim-analisis-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.sim-kpi { border-radius: 14px; padding: 12px 14px; background: var(--mp-bg-light, #F2F2F7); border-left: 4px solid #C7C7CC; }
.sim-kpi-ok { border-left-color: var(--mp-green, #34C759); }
.sim-kpi-warn { border-left-color: var(--mp-orange, #FF9500); }
.sim-kpi-ko { border-left-color: var(--mp-red, #FF3B30); }
.sim-kpi-info { border-left-color: #5E5CE6; }
.sim-kpi-label { font-size: 11px; font-weight: 600; color: var(--mp-text-secondary, #86868B); text-transform: uppercase; letter-spacing: .3px; }
.sim-kpi-value { font-size: 20px; font-weight: 800; letter-spacing: -0.4px; margin: 4px 0 2px; }
.sim-kpi-sub { font-size: 11.5px; color: var(--mp-text-secondary, #86868B); line-height: 1.45; }
.sim-muted { font-size: 12px; color: var(--mp-text-secondary, #86868B); }
.sim-curva-title { font-size: 12px; font-weight: 600; color: var(--mp-text-secondary, #86868B); margin: 14px 0 4px; }
.sim-curva { width: 100%; height: auto; max-height: 260px; }
.sim-curva .sim-ax { stroke: #C7C7CC; stroke-width: 1; }
.sim-curva .sim-grid { stroke: #ECECF1; stroke-width: 1; }
.sim-curva .sim-tick { font-size: 10px; fill: #86868B; font-family: inherit; }
.sim-curva .sim-line-nos { fill: none; stroke: #5E5CE6; stroke-width: 2.5; }
.sim-curva .sim-line-rival { fill: none; stroke: #FF9500; stroke-width: 2; stroke-dasharray: 5 3; }
.sim-curva-leyenda { display: flex; gap: 14px; font-size: 11px; color: var(--mp-text-secondary, #86868B); margin-top: 4px; }
.sim-lg::before { content: ''; display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; background: #C7C7CC; }
.sim-lg-nos::before { background: #5E5CE6; }
.sim-lg-rival::before { background: #FF9500; }
.sim-lg-an::before { background: rgba(255, 59, 48, 0.25); height: 10px; }

/* editor de reglas */
.sim-editor-top { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 12px; }
.sim-f-param { display: inline-flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--mp-text-secondary, #86868B); }
.sim-f-param input, .sim-f-param select { border: 1px solid #D9D9DE; border-radius: 8px; padding: 5px 8px; font: inherit; font-size: 12.5px; color: var(--mp-text, #1D1D1F); background: #fff; min-width: 120px; }
.sim-f-param-wide { flex: 1; min-width: 260px; }
.sim-f-param-wide input { width: 100%; box-sizing: border-box; }
.sim-f-check { flex-direction: row; align-items: center; gap: 6px; font-size: 12px; }
.sim-crits { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.sim-crit { border: 1px solid #ECECF1; border-radius: 12px; padding: 10px 12px; background: #FAFAFC; }
.sim-crit-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sim-crit-row input, .sim-crit-row select { border: 1px solid #D9D9DE; border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 12.5px; background: #fff; color: var(--mp-text, #1D1D1F); }
.sim-crit-nombre { flex: 1; min-width: 180px; font-weight: 600; }
.sim-crit-peso { width: 72px; }
.sim-crit-unidad { width: 90px; }
.sim-crit-params { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.sim-crit-literal { font-size: 11.5px; color: var(--mp-text-secondary, #86868B); margin-top: 6px; line-height: 1.4; }
.sim-crit-nota { font-size: 11.5px; color: #b35f00; margin-top: 4px; }
.sim-subs { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.sim-sub-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-left: 10px; }
.sim-sub-row input, .sim-sub-row select { border: 1px solid #D9D9DE; border-radius: 8px; padding: 5px 7px; font: inherit; font-size: 12px; background: #fff; color: var(--mp-text, #1D1D1F); }
.sim-sub-mark { color: #AEAEB2; }
.sim-anorm { margin-top: 14px; padding-top: 10px; border-top: 1px dashed #E5E5EA; }
.sim-editor-actions { display: flex; gap: 8px; align-items: center; margin-top: 14px; }

/* escenarios */
.sim-esc-list { display: flex; flex-direction: column; gap: 8px; }
.sim-esc { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; border: 1px solid #ECECF1; border-radius: 12px; padding: 10px 12px; background: #FAFAFC; }
.sim-esc-ref { border-color: rgba(255, 149, 0, 0.5); background: rgba(255, 149, 0, 0.06); }
.sim-esc-activo { box-shadow: inset 0 0 0 2px rgba(94, 92, 230, 0.35); }
.sim-esc-nombre { font-weight: 700; font-size: 13px; }
.sim-esc-meta { font-size: 11px; color: var(--mp-text-secondary, #86868B); margin-top: 2px; }
.sim-esc-tot { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.sim-esc-notas { font-size: 12px; margin-top: 4px; }
.sim-esc-actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }

/* vacío */
.sim-vacio { display: flex; gap: 16px; align-items: center; }
.sim-vacio-icon { font-size: 40px; }
.sim-vacio-txt { font-size: 13px; line-height: 1.55; color: var(--mp-text, #1D1D1F); }

/* oscuro (sigue a modo-preventa.css) */
[data-theme="dark"] .sim { color: #F5F5F7; }
[data-theme="dark"] .sim-tabla thead th, [data-theme="dark"] .sim-in, [data-theme="dark"] .sim-crit-row input, [data-theme="dark"] .sim-crit-row select, [data-theme="dark"] .sim-f-param input, [data-theme="dark"] .sim-f-param select, [data-theme="dark"] .sim-sub-row input, [data-theme="dark"] .sim-sub-row select { background: #2C2C2E; color: #F5F5F7; border-color: #3A3A3C; }
[data-theme="dark"] .sim-tabla th, [data-theme="dark"] .sim-tabla td { border-bottom-color: #3A3A3C; }
[data-theme="dark"] .sim-fila-grupo td, [data-theme="dark"] .sim-fila-total td, [data-theme="dark"] .sim-crit, [data-theme="dark"] .sim-esc, [data-theme="dark"] .sim-kpi { background: #2C2C2E; border-color: #3A3A3C; }
[data-theme="dark"] .sim-chip, [data-theme="dark"] .sim-btn { background: #3A3A3C; color: #F5F5F7; }
[data-theme="dark"] .sim-btn-primary { background: var(--mp-gradient, linear-gradient(135deg, #5E5CE6, #BF5AF2)); }
