/* rev. 42 — bloque <style> de SmartProfit/SmartProfitMain.razor (Mono web), verbatim. */
    /* ── Variables en scope del componente (no :root) ──────── */
    .renta-page {
        --vt-primary: #0D3B6E;
        --vt-primary-light: #1A5EA8;
        --vt-accent: #00C9A7;
        --vt-accent-2: #F4A623;
        --vt-danger: #E63946;
        --vt-surface: #F7F9FC;
        --vt-surface-2: #EEF2F7;
        --vt-border: #DDE3EE;
        --vt-text: #1C2B45;
        --vt-text-muted: #6B7A99;
        background: var(--vt-surface);
        min-height: 100vh;
        font-family: 'Segoe UI', system-ui, sans-serif;
        color: var(--vt-text);
    }

    /* ── Topbar ─────────────────────────────────────────────── */
    .renta-topbar {
        background: #0D3B6E;
        padding: 14px 28px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        box-shadow: 0 4px 20px rgba(13,59,110,.18);
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .renta-brand {
        font-size: 17px;
        font-weight: 700;
        color: #fff;
        letter-spacing: .02em;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .renta-brand-icon {
        width: 34px;
        height: 34px;
        background: #00C9A7;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 17px;
        color: #0D3B6E;
        flex-shrink: 0;
    }

    .renta-brand-sub {
        font-size: 11px;
        font-weight: 400;
        opacity: .65;
        display: block;
    }

    .topbar-actions {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .btn-topbar {
        background: rgba(255,255,255,.1);
        color: #fff;
        border: 1px solid rgba(255,255,255,.2);
        border-radius: 8px;
        padding: 6px 14px;
        font-size: 12px;
        font-weight: 500;
        cursor: pointer;
        transition: background .2s;
        display: flex;
        align-items: center;
        gap: 6px;
    }

        .btn-topbar:hover {
            background: rgba(255,255,255,.2);
        }

        .btn-topbar:disabled {
            opacity: .5;
            cursor: not-allowed;
        }

    .btn-topbar-accent {
        background: #00C9A7;
        color: #0D3B6E;
        border-color: #00C9A7;
    }

        .btn-topbar-accent:hover {
            background: #00a98d;
        }

    /* ── Spinner ─────────────────────────────────────────────── */
    .spinner-vt {
        width: 16px;
        height: 16px;
        border-radius: 50%;
        display: inline-block;
        border: 2.5px solid rgba(255,255,255,.3);
        border-top-color: #fff;
        animation: vtSpin .7s linear infinite;
        flex-shrink: 0;
    }

    @keyframes vtSpin {
        to {
            transform: rotate(360deg);
        }
    }

    /* ── Filtros ─────────────────────────────────────────────── */
    .filter-bar {
        background: #fff;
        border-bottom: 1px solid #DDE3EE;
        padding: 12px 28px;
        display: flex;
        align-items: center;
        gap: 14px;
        flex-wrap: wrap;
    }

        .filter-bar label {
            font-size: 11px;
            font-weight: 600;
            color: #6B7A99;
            text-transform: uppercase;
            letter-spacing: .06em;
            margin-bottom: 0;
            white-space: nowrap;
        }

        .filter-bar .form-select,
        .filter-bar .form-control {
            font-size: 13px;
            padding: 6px 10px;
            border-radius: 8px;
            border: 1px solid #DDE3EE;
            background: #F7F9FC;
            color: #1C2B45;
        }

            .filter-bar .form-select:focus,
            .filter-bar .form-control:focus {
                border-color: #1A5EA8;
                box-shadow: 0 0 0 3px rgba(26,94,168,.12);
                outline: none;
            }

    .filter-sep {
        width: 1px;
        height: 28px;
        background: #DDE3EE;
        margin: 0 4px;
    }

    .btn-recalc {
        background: #0D3B6E;
        color: #fff;
        border: none;
        border-radius: 8px;
        padding: 8px 20px;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        transition: background .2s;
        display: flex;
        align-items: center;
        gap: 7px;
    }

        .btn-recalc:hover {
            background: #1A5EA8;
        }

        .btn-recalc:disabled {
            background: #9aabbb;
            cursor: not-allowed;
        }

    /* ── Mode pills ──────────────────────────────────────────── */
    .mode-pills {
        display: flex;
        gap: 6px;
        margin-left: auto;
    }

    .mode-pill {
        padding: 5px 14px;
        border-radius: 20px;
        font-size: 11px;
        font-weight: 600;
        cursor: pointer;
        border: 1.5px solid #DDE3EE;
        transition: all .2s;
        background: #EEF2F7;
        color: #6B7A99;
        user-select: none;
    }

        .mode-pill.active-real {
            background: #E8F8F3;
            color: #0A6E4E;
            border-color: #00C9A7;
        }

        .mode-pill.active-mixto {
            background: #FEF5E4;
            color: #8A5500;
            border-color: #F4A623;
        }

        .mode-pill.active-com {
            background: #E8F0FE;
            color: #1A56C8;
            border-color: #1A56C8;
        }

    .mode-dot {
        display: inline-block;
        width: 7px;
        height: 7px;
        border-radius: 50%;
        margin-right: 5px;
        vertical-align: middle;
    }

    .dot-real {
        background: #00C9A7;
    }

    .dot-mixto {
        background: #F4A623;
    }

    .dot-com {
        background: #1A56C8;
    }

    /* ── Cuerpo ──────────────────────────────────────────────── */
    .renta-body {
        padding: 24px 28px;
    }

    /* ── Score de calidad ────────────────────────────────────── */
    .data-score-bar {
        background: #fff;
        border: 1px solid #DDE3EE;
        border-radius: 12px;
        padding: 12px 20px;
        display: flex;
        align-items: center;
        gap: 16px;
        margin-bottom: 20px;
        box-shadow: 0 2px 8px rgba(13,59,110,.08);
        flex-wrap: wrap;
    }

    .ds-icon {
        width: 36px;
        height: 36px;
        background: #EEF2F7;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        color: #0D3B6E;
        flex-shrink: 0;
    }

    .ds-label {
        font-size: 12px;
        font-weight: 600;
        color: #6B7A99;
        text-transform: uppercase;
        letter-spacing: .05em;
    }

    .ds-hint {
        font-size: 11px;
        color: #6B7A99;
    }

    .ds-track {
        flex: 1;
        min-width: 100px;
        height: 8px;
        background: #EEF2F7;
        border-radius: 4px;
        overflow: hidden;
    }

    .ds-fill {
        height: 100%;
        border-radius: 4px;
        background: linear-gradient(90deg, #00C9A7, #1A5EA8);
        transition: width .6s ease;
    }

    .ds-pct {
        font-size: 15px;
        font-weight: 700;
        color: #0D3B6E;
        min-width: 42px;
        text-align: right;
    }

    /* ── KPI cards ───────────────────────────────────────────── */
    .kpi-card {
        background: #fff;
        border: 1px solid #DDE3EE;
        border-radius: 12px;
        padding: 18px 20px;
        position: relative;
        overflow: hidden;
        height: 100%;
        box-shadow: 0 2px 8px rgba(13,59,110,.08);
        transition: box-shadow .2s, transform .2s;
    }

        .kpi-card:hover {
            box-shadow: 0 4px 20px rgba(13,59,110,.12);
            transform: translateY(-1px);
        }

        .kpi-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
        }

        .kpi-card.kv::before {
            background: linear-gradient(90deg, #0D3B6E, #1A5EA8);
        }

        .kpi-card.kc::before {
            background: linear-gradient(90deg, #E63946, #ff7070);
        }

        .kpi-card.ku::before {
            background: linear-gradient(90deg, #00C9A7, #00E5C6);
        }

        .kpi-card.km::before {
            background: linear-gradient(90deg, #F4A623, #ffc55a);
        }

    .kpi-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 19px;
        margin-bottom: 12px;
    }

        .kpi-icon.kv {
            background: rgba(13,59,110,.08);
            color: #0D3B6E;
        }

        .kpi-icon.kc {
            background: rgba(230,57,70,.08);
            color: #E63946;
        }

        .kpi-icon.ku {
            background: rgba(0,201,167,.1);
            color: #00A88C;
        }

        .kpi-icon.km {
            background: rgba(244,166,35,.1);
            color: #C47B00;
        }

    .kpi-lbl {
        font-size: 11px;
        font-weight: 700;
        color: #6B7A99;
        text-transform: uppercase;
        letter-spacing: .07em;
        margin-bottom: 4px;
    }

    .kpi-val {
        font-size: 26px;
        font-weight: 800;
        letter-spacing: -.02em;
        line-height: 1.1;
    }

        .kpi-val.kv {
            color: #0D3B6E;
        }

        .kpi-val.kc {
            color: #E63946;
        }

        .kpi-val.ku {
            color: #00A88C;
        }

        .kpi-val.km {
            color: #C47B00;
        }

    .kpi-delta {
        font-size: 12px;
        margin-top: 6px;
        display: flex;
        align-items: center;
        gap: 4px;
    }

        .kpi-delta.up {
            color: #00A88C;
        }

        .kpi-delta.down {
            color: #E63946;
        }

        .kpi-delta.neutral {
            color: #6B7A99;
        }

    /* ── Card genérica ───────────────────────────────────────── */
    .main-card {
        background: #fff;
        border: 1px solid #DDE3EE;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(13,59,110,.08);
        overflow: hidden;
    }

    .main-card-header {
        padding: 14px 20px;
        border-bottom: 1px solid #DDE3EE;
        display: flex;
        align-items: center;
        gap: 12px;
        flex-wrap: wrap;
    }

    .main-card-title {
        font-size: 14px;
        font-weight: 700;
        color: #1C2B45;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* ── Alertas ─────────────────────────────────────────────── */
    .alert-item {
        border-radius: 8px;
        padding: 12px 14px;
        display: flex;
        align-items: flex-start;
        gap: 10px;
        border: 1px solid transparent;
        box-shadow: 0 2px 8px rgba(13,59,110,.06);
        transition: box-shadow .2s;
    }

        .alert-item:hover {
            box-shadow: 0 4px 16px rgba(13,59,110,.1);
        }

        .alert-item.danger {
            background: #FFF0F0;
            border-color: #FFCDD0;
        }

        .alert-item.warning {
            background: #FFFBEC;
            border-color: #FFE8A0;
        }

        .alert-item.success {
            background: #EDFAF6;
            border-color: #B2EBD9;
        }

        .alert-item.info {
            background: #EEF4FF;
            border-color: #C0D4FF;
        }

    .alert-ico {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 15px;
        flex-shrink: 0;
    }

    .alert-item.danger .alert-ico {
        background: #FFD6D8;
        color: #E63946;
    }

    .alert-item.warning .alert-ico {
        background: #FFE8A0;
        color: #AA6600;
    }

    .alert-item.success .alert-ico {
        background: #B2EBD9;
        color: #00A88C;
    }

    .alert-item.info .alert-ico {
        background: #C0D4FF;
        color: #1A56C8;
    }

    .alert-ttl {
        font-size: 12px;
        font-weight: 700;
        margin-bottom: 2px;
    }

    .alert-item.danger .alert-ttl {
        color: #9B1A22;
    }

    .alert-item.warning .alert-ttl {
        color: #7A4800;
    }

    .alert-item.success .alert-ttl {
        color: #0A6E4E;
    }

    .alert-item.info .alert-ttl {
        color: #1A3A8A;
    }

    .alert-dsc {
        font-size: 11px;
        color: #6B7A99;
        line-height: 1.45;
    }

    /* ── Gráficos ────────────────────────────────────────────── */
    .chart-card {
        background: #fff;
        border: 1px solid #DDE3EE;
        border-radius: 12px;
        padding: 18px 20px;
        box-shadow: 0 2px 8px rgba(13,59,110,.08);
        height: 100%;
    }

    .chart-card-ttl {
        font-size: 13px;
        font-weight: 700;
        color: #1C2B45;
        margin-bottom: 4px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .chart-card-sub {
        font-size: 11px;
        color: #6B7A99;
        margin-bottom: 14px;
    }

    .chart-wrap {
        position: relative;
        width: 100%;
        height: 200px;
    }

    /* ── IA Header ───────────────────────────────────────────── */
    .ia-section {
        background: #fff;
        border: 1px solid #DDE3EE;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(13,59,110,.08);
    }

    .ia-hdr {
        background: linear-gradient(135deg, #0D3B6E 0%, #1A5EA8 55%, #00C9A7 100%);
        padding: 16px 22px;
        display: flex;
        align-items: center;
        gap: 14px;
    }

    .ia-hdr-ico {
        width: 44px;
        height: 44px;
        background: rgba(255,255,255,.15);
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 22px;
        color: #fff;
        flex-shrink: 0;
    }

    .ia-hdr-txt h5 {
        color: #fff;
        font-size: 15px;
        font-weight: 700;
        margin: 0 0 2px;
    }

    .ia-hdr-txt p {
        color: rgba(255,255,255,.72);
        font-size: 12px;
        margin: 0;
    }

    .ia-badge {
        margin-left: auto;
        background: rgba(255,255,255,.15);
        color: #fff;
        border: 1px solid rgba(255,255,255,.3);
        border-radius: 20px;
        padding: 4px 12px;
        font-size: 11px;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 5px;
        flex-shrink: 0;
    }

    .ia-pulse {
        width: 7px;
        height: 7px;
        background: #00C9A7;
        border-radius: 50%;
        animation: iaPulse 1.8s ease-in-out infinite;
    }

    @keyframes iaPulse {
        0%, 100% {
            opacity: 1;
            transform: scale(1)
        }

        50% {
            opacity: .5;
            transform: scale(.8)
        }
    }

    /* ── IA Tabs ─────────────────────────────────────────────── */
    .ia-tabs {
        border-bottom: 1px solid #DDE3EE;
        display: flex;
    }

    .ia-tab {
        padding: 11px 20px;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
        border-bottom: 2.5px solid transparent;
        color: #6B7A99;
        display: flex;
        align-items: center;
        gap: 7px;
        transition: color .2s, border-color .2s;
        background: none;
        border-top: none;
        border-left: none;
        border-right: none;
    }

        .ia-tab:hover {
            color: #0D3B6E;
        }

        .ia-tab.active {
            color: #0D3B6E;
            border-bottom-color: #0D3B6E;
        }

    .ia-body {
        padding: 20px 22px;
    }

    /* ── IA Loading ──────────────────────────────────────────── */
    .ia-loading {
        text-align: center;
        padding: 32px;
        color: #6B7A99;
    }

    .ia-dots {
        display: flex;
        justify-content: center;
        gap: 6px;
        margin-bottom: 10px;
    }

    .ia-dot {
        width: 8px;
        height: 8px;
        background: #0D3B6E;
        border-radius: 50%;
        animation: dotBounce .9s ease-in-out infinite;
    }

        .ia-dot:nth-child(2) {
            animation-delay: .15s;
        }

        .ia-dot:nth-child(3) {
            animation-delay: .3s;
        }

    @keyframes dotBounce {
        0%, 100% {
            transform: translateY(0);
            opacity: .4
        }

        50% {
            transform: translateY(-6px);
            opacity: 1
        }
    }

    /* ── Diagnóstico ─────────────────────────────────────────── */
    .diag-item {
        display: flex;
        align-items: flex-start;
        gap: 14px;
        padding: 14px 16px;
        border-radius: 8px;
        height: 100%;
        border: 1px solid #DDE3EE;
        background: #F7F9FC;
        transition: box-shadow .2s;
    }

        .diag-item:hover {
            box-shadow: 0 2px 8px rgba(13,59,110,.08);
        }

    .diag-score {
        width: 44px;
        height: 44px;
        border-radius: 10px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        font-weight: 800;
    }

        .diag-score.sc-high {
            background: #EDFAF6;
            color: #00A88C;
        }

        .diag-score.sc-mid {
            background: #FFF8E6;
            color: #C47B00;
        }

        .diag-score.sc-low {
            background: #FFF0F0;
            color: #E63946;
        }

    .diag-ttl {
        font-size: 13px;
        font-weight: 700;
        color: #1C2B45;
        margin-bottom: 3px;
    }

    .diag-txt {
        font-size: 12px;
        color: #6B7A99;
        line-height: 1.5;
    }

    .diag-conf {
        font-size: 10px;
        color: #6B7A99;
        margin-left: auto;
        white-space: nowrap;
    }

    .diag-acts {
        display: flex;
        gap: 6px;
        margin-top: 8px;
        flex-wrap: wrap;
    }

    .diag-btn {
        font-size: 11px;
        font-weight: 600;
        padding: 4px 10px;
        border-radius: 6px;
        border: 1px solid;
        cursor: pointer;
        transition: all .15s;
    }

        .diag-btn.primary {
            background: #0D3B6E;
            color: #fff;
            border-color: #0D3B6E;
        }

            .diag-btn.primary:hover {
                background: #1A5EA8;
            }

        .diag-btn.outline {
            background: transparent;
            color: #0D3B6E;
            border-color: #DDE3EE;
        }

            .diag-btn.outline:hover {
                background: #EEF2F7;
            }

    .ia-footer {
        margin-top: 12px;
        padding: 10px 14px;
        background: #EEF2F7;
        border-radius: 8px;
        font-size: 11px;
        color: #6B7A99;
        display: flex;
        gap: 8px;
        align-items: center;
    }

    /* ── Predicción ──────────────────────────────────────────── */
    .pred-card {
        border: 1px solid #DDE3EE;
        border-radius: 8px;
        overflow: hidden;
        background: #F7F9FC;
        height: 100%;
    }

    .pred-hdr {
        background: #EEF2F7;
        padding: 10px 14px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid #DDE3EE;
    }

    .pred-hdr-ttl {
        font-size: 12px;
        font-weight: 700;
        color: #1C2B45;
        display: flex;
        align-items: center;
        gap: 7px;
    }

    .pred-horizon {
        font-size: 10px;
        background: #E8F0FE;
        color: #1A56C8;
        border-radius: 4px;
        padding: 2px 8px;
        font-weight: 600;
    }

    .pred-body {
        padding: 14px;
    }

    .pred-metrics {
        display: flex;
        gap: 10px;
        margin-bottom: 10px;
    }

    .pred-metric {
        flex: 1;
        text-align: center;
        background: #fff;
        border: 1px solid #DDE3EE;
        border-radius: 8px;
        padding: 10px;
    }

    .pred-metric-lbl {
        font-size: 10px;
        color: #6B7A99;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: .05em;
    }

    .pred-metric-val {
        font-size: 18px;
        font-weight: 800;
        color: #0D3B6E;
        margin: 4px 0 2px;
    }

    .pred-delta {
        font-size: 11px;
    }

        .pred-delta.up {
            color: #00A88C;
        }

        .pred-delta.down {
            color: #E63946;
        }

        .pred-delta.neutral {
            color: #6B7A99;
        }

    .pred-confband {
        font-size: 11px;
        color: #6B7A99;
        padding: 8px 10px;
        background: #fff;
        border-radius: 6px;
        border: 1px solid #DDE3EE;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .pred-bar-track {
        height: 6px;
        background: #EEF2F7;
        border-radius: 3px;
        flex: 1;
        overflow: hidden;
    }

    .pred-bar-fill {
        height: 100%;
        border-radius: 3px;
        background: linear-gradient(90deg, #0D3B6E, #00C9A7);
    }

    .pred-reco {
        margin-top: 8px;
        font-size: 11px;
        color: #6B7A99;
        line-height: 1.5;
        display: flex;
        gap: 6px;
        align-items: flex-start;
    }

    /* ── Anomalías ───────────────────────────────────────────── */
    .anomaly-card {
        border-radius: 8px;
        border: 1px solid;
        padding: 12px 14px 12px 18px;
        margin-bottom: 10px;
        position: relative;
        overflow: hidden;
    }

        .anomaly-card.critical {
            border-color: #FFCDD0;
            background: #FFF5F5;
        }

        .anomaly-card.medium {
            border-color: #FFE0A0;
            background: #FFFBF0;
        }

        .anomaly-card.low {
            border-color: #C0D4FF;
            background: #F0F5FF;
        }

        .anomaly-card::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 4px;
        }

        .anomaly-card.critical::before {
            background: #E63946;
        }

        .anomaly-card.medium::before {
            background: #F4A623;
        }

        .anomaly-card.low::before {
            background: #4A80F5;
        }

    .anomaly-hdr {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 6px;
    }

    .anomaly-badge {
        font-size: 10px;
        font-weight: 700;
        padding: 2px 8px;
        border-radius: 4px;
        text-transform: uppercase;
        letter-spacing: .06em;
    }

    .anomaly-card.critical .anomaly-badge {
        background: #FFCDD0;
        color: #9B1A22;
    }

    .anomaly-card.medium .anomaly-badge {
        background: #FFE0A0;
        color: #8A5000;
    }

    .anomaly-card.low .anomaly-badge {
        background: #C0D4FF;
        color: #1A3A8A;
    }

    .anomaly-prod {
        font-size: 13px;
        font-weight: 700;
        color: #1C2B45;
    }

    .anomaly-dev {
        margin-left: auto;
        font-size: 18px;
        font-weight: 800;
    }

    .anomaly-card.critical .anomaly-dev {
        color: #E63946;
    }

    .anomaly-card.medium .anomaly-dev {
        color: #C47B00;
    }

    .anomaly-card.low .anomaly-dev {
        color: #1A56C8;
    }

    .anomaly-desc {
        font-size: 11px;
        color: #6B7A99;
        line-height: 1.5;
    }

    .anomaly-chips {
        display: flex;
        gap: 8px;
        margin-top: 8px;
        flex-wrap: wrap;
    }

    .anomaly-chip {
        font-size: 10px;
        background: rgba(0,0,0,.05);
        border-radius: 4px;
        padding: 2px 8px;
        color: #6B7A99;
        font-weight: 600;
    }

    .anomaly-toolbar {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 14px;
        flex-wrap: wrap;
    }

    .anomaly-toolbar-title {
        font-size: 13px;
        font-weight: 700;
        color: #1C2B45;
    }

    .anomaly-toolbar-sub {
        font-size: 11px;
        color: #6B7A99;
    }

    /* ── Tabla ───────────────────────────────────────────────── */
    .table-tabs-wrap {
        display: flex;
    }

    .ttab {
        padding: 7px 16px;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
        border: 1px solid #DDE3EE;
        color: #6B7A99;
        transition: all .15s;
        background: #F7F9FC;
        display: flex;
        align-items: center;
        gap: 5px;
    }

        .ttab:first-child {
            border-radius: 8px 0 0 8px;
        }

        .ttab:last-child {
            border-radius: 0 8px 8px 0;
            border-left: none;
        }

        .ttab.active {
            background: #0D3B6E;
            color: #fff;
            border-color: #0D3B6E;
        }

    .renta-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 13px;
    }

        .renta-table thead tr {
            background: #EEF2F7;
        }

        .renta-table th {
            padding: 10px 14px;
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: .06em;
            color: #6B7A99;
            text-align: left;
            border-bottom: 1px solid #DDE3EE;
            white-space: nowrap;
        }

        .renta-table td {
            padding: 11px 14px;
            border-bottom: 1px solid #DDE3EE;
            vertical-align: middle;
        }

        .renta-table tbody tr:last-child td {
            border-bottom: none;
        }

        .renta-table tbody tr:hover td {
            background: #F8FAFF;
        }

    /* ── Badges ──────────────────────────────────────────────── */
    .bclase {
        display: inline-flex;
        align-items: center;
        padding: 3px 10px;
        border-radius: 20px;
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .06em;
    }

        .bclase.estrella {
            background: #FFF8E0;
            color: #8A5500;
        }

        .bclase.rentable {
            background: #EDFAF6;
            color: #0A6E4E;
        }

        .bclase.riesgo {
            background: #FFFBEC;
            color: #8A5500;
        }

        .bclase.critico {
            background: #FFF0F0;
            color: #9B1A22;
        }

        .bclase.premium {
            background: #EEF0FF;
            color: #3A3AA8;
        }

        .bclase.negociador {
            background: #EDFAF6;
            color: #0A6E4E;
        }

        .bclase.peligroso {
            background: #FFF0F0;
            color: #9B1A22;
        }

    .best {
        background: #FEF5E4;
        color: #8A5500;
        font-size: 9px;
        padding: 2px 6px;
        border-radius: 4px;
        font-weight: 600;
    }

    /* ── Barra de margen ─────────────────────────────────────── */
    .mwrap {
        display: flex;
        align-items: center;
        gap: 7px;
    }

    .mbar {
        height: 6px;
        width: 70px;
        background: #EEF2F7;
        border-radius: 3px;
        overflow: hidden;
    }

    .mfill {
        height: 100%;
        border-radius: 3px;
    }

        .mfill.high {
            background: linear-gradient(90deg, #00C9A7, #1D9E75);
        }

        .mfill.mid {
            background: linear-gradient(90deg, #F4A623, #E88800);
        }

        .mfill.low {
            background: linear-gradient(90deg, #E63946, #FF7070);
        }

    .mpct {
        font-size: 12px;
        font-weight: 700;
        min-width: 40px;
    }

        .mpct.high {
            color: #00A88C;
        }

        .mpct.mid {
            color: #C47B00;
        }

        .mpct.low {
            color: #E63946;
        }

    /* ── Drill link ──────────────────────────────────────────── */
    .drill-link {
        font-size: 11px;
        color: #1A5EA8;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        font-weight: 600;
        display: inline-flex;
        align-items: center;
        gap: 3px;
    }

        .drill-link:hover {
            color: #0D3B6E;
            text-decoration: underline;
        }

    /* ── Skeleton ────────────────────────────────────────────── */
    @keyframes shimmer {
        0% {
            background-position: -400px 0
        }

        100% {
            background-position: 400px 0
        }
    }

    .skeleton {
        background: linear-gradient(90deg, #EEF2F7 25%, #DDE3EE 50%, #EEF2F7 75%);
        background-size: 800px 100%;
        animation: shimmer 1.5s infinite;
        border-radius: 8px;
    }

    /* ── Responsive ──────────────────────────────────────────── */
    @media (max-width: 992px) {
        .renta-topbar {
            padding: 12px 16px;
        }

        .filter-bar {
            padding: 10px 16px;
        }

        .renta-body {
            padding: 16px;
        }
    }

    @media (max-width: 576px) {
        .mode-pills {
            display: none;
        }

        .kpi-val {
            font-size: 20px;
        }

        .pred-metrics {
            flex-wrap: wrap;
        }
    }

    /* ════════════════════════════════════════════════════════════
       SMARTPROFIT · BLOQUE NUEVO
       Moneda · tipo de cambio · política de costeo · base de cálculo
       · cascada de contribución. No modifica ninguna regla anterior.
    ════════════════════════════════════════════════════════════ */

    .sp-toolbar {
        background: #FBFCFE;
        border-bottom: 1px solid #DDE3EE;
        padding: 11px 28px;
        display: flex;
        align-items: center;
        gap: 16px;
        flex-wrap: wrap;
    }

    .sp-group {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }

        .sp-group > label {
            font-size: 11px;
            font-weight: 700;
            color: #5D6D8C;
            text-transform: uppercase;
            letter-spacing: .06em;
            white-space: nowrap;
            margin: 0;
        }

    .sp-select, .sp-input {
        font-size: 13px;
        padding: 6px 10px;
        border-radius: 8px;
        border: 1px solid #DDE3EE;
        background: #fff;
        color: #16243C;
    }

        .sp-select:focus, .sp-input:focus {
            border-color: #1A5EA8;
            box-shadow: 0 0 0 3px rgba(26,94,168,.16);
            outline: none;
        }

        .sp-input:disabled, .sp-select:disabled {
            opacity: .5;
            background: #F1F4F9;
            cursor: not-allowed;
        }

    .sp-input.err {
        border-color: #E63946;
        box-shadow: 0 0 0 3px rgba(230,57,70,.12);
    }

    .sp-seg {
        display: inline-flex;
        border: 1px solid #DDE3EE;
        border-radius: 8px;
        overflow: hidden;
        background: #fff;
    }

    .sp-seg-btn {
        padding: 6px 13px;
        font-size: 12px;
        font-weight: 700;
        color: #5D6D8C;
        background: transparent;
        border: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 6px;
        white-space: nowrap;
    }

        .sp-seg-btn + .sp-seg-btn {
            border-left: 1px solid #DDE3EE;
        }

        .sp-seg-btn:hover {
            color: #0D3B6E;
            background: #F5F8FC;
        }

        .sp-seg-btn.on {
            background: #0D3B6E;
            color: #fff;
        }

        .sp-seg-btn.on.sp-usd {
            background: #00806B;
        }

        .sp-seg-btn:disabled {
            opacity: .55;
            cursor: not-allowed;
        }

    .sp-tc-note {
        font-size: 11px;
        color: #5D6D8C;
    }

    .sp-tc-err {
        font-size: 11px;
        font-weight: 600;
        color: #E63946;
    }

    .sp-hint {
        font-size: 11px;
        color: #7A4800;
        background: #FFF8E6;
        border: 1px solid #FFE8A0;
        border-radius: 6px;
        padding: 4px 10px;
    }

    /* ── Modos y simulación ──────────────────────────────────── */
    .modo-desc {
        width: 100%;
        font-size: 11.5px;
        color: #5D6D8C;
        line-height: 1.5;
        padding-top: 2px;
    }

    .mode-pill.mp-Contable.on {
        background: #E6EEFE;
        color: #123E97;
        border-color: #1A5EA8;
    }

    .mode-pill.mp-Simulacion.on {
        background: #FDF1E3;
        color: #8A4409;
        border-color: #B45309;
    }

    .mode-pill.mp-Comercial.on {
        background: #E4F7F1;
        color: #07684A;
        border-color: #00806B;
    }

    .sim-banner {
        background: repeating-linear-gradient(135deg,#FDF1E3,#FDF1E3 12px,#F9E7D2 12px,#F9E7D2 24px);
        border-bottom: 1px solid #E7C9A3;
        color: #8A4409;
        font-size: 12px;
        font-weight: 700;
        padding: 9px 28px;
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
    }

        .sim-banner .tag {
            background: #B45309;
            color: #fff;
            font-size: 10px;
            letter-spacing: .08em;
            padding: 3px 9px;
            border-radius: 4px;
            text-transform: uppercase;
        }

        .sim-banner .n {
            font-weight: 500;
            color: #7A4008;
        }

    .pol-chip {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 12.5px;
        color: #123E97;
        background: #E6EEFE;
        border: 1px solid #BFD3FF;
        border-radius: 8px;
        padding: 5px 12px;
        white-space: nowrap;
    }

    .ico-info {
        width: 22px;
        height: 22px;
        border-radius: 50%;
        border: 1px solid #BFD3FF;
        background: #fff;
        color: #1A5EA8;
        font-weight: 800;
        font-size: 12px;
        cursor: pointer;
        line-height: 1;
        flex-shrink: 0;
        font-family: Georgia, serif;
    }

        .ico-info:hover {
            background: #E6EEFE;
        }

    /* ── Cascada de contribución ─────────────────────────────── */
    .casc {
        background: #fff;
        border: 1px solid #DDE3EE;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(13,59,110,.08);
        margin-bottom: 20px;
        overflow: hidden;
    }

    .casc-head {
        padding: 14px 20px;
        border-bottom: 1px solid #DDE3EE;
        display: flex;
        align-items: center;
        gap: 14px;
        flex-wrap: wrap;
    }

    .casc-ttl {
        font-size: 14px;
        font-weight: 800;
        color: #16243C;
    }

    .casc-sub {
        font-size: 11.5px;
        color: #5D6D8C;
        margin-top: 2px;
    }

    .casc-tasa {
        margin-left: auto;
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 11.5px;
        color: #5D6D8C;
    }

        .casc-tasa input {
            width: 68px;
            font-size: 13px;
            padding: 5px 8px;
            border-radius: 8px;
            border: 1px solid #DDE3EE;
            text-align: right;
        }

    .wf-legend {
        display: flex;
        gap: 16px;
        flex-wrap: wrap;
        padding: 10px 20px 0;
        font-size: 11px;
        color: #5D6D8C;
    }

        .wf-legend i {
            display: inline-block;
            width: 11px;
            height: 11px;
            border-radius: 3px;
            margin-right: 5px;
            vertical-align: -1px;
        }

    .casc-body {
        padding: 8px 20px 16px;
    }

    .wf-row, .wf-head {
        display: grid;
        grid-template-columns: 240px 1fr 140px 78px;
        gap: 12px;
        align-items: center;
        padding: 5px 0;
    }

    .wf-head {
        font-size: 9.5px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: .06em;
        color: #5D6D8C;
        border-bottom: 1px solid #DDE3EE;
        padding-bottom: 6px;
        margin-bottom: 4px;
    }

        .wf-head .wf-val, .wf-head .wf-pct {
            text-align: right;
        }

    .wf-row:hover {
        background: #F7FAFF;
    }

    .wf-lbl {
        font-size: 12.5px;
        color: #16243C;
        line-height: 1.3;
    }

    .wf-src {
        font-size: 10px;
        color: #5D6D8C;
        margin-top: 2px;
        line-height: 1.35;
    }

    .wf-track {
        position: relative;
        height: 20px;
        background: #F2F5FA;
        border-radius: 4px;
        overflow:hidden;
    }

    .wf-off{background-image:repeating-linear-gradient(45deg,transparent 0 5px,rgba(255,255,255,.35) 5px 10px)}

    .wf-bar {
        position: absolute;
        top: 3px;
        height: 14px;
        border-radius: 4px;
        transition: left .35s ease, width .35s ease;
    }

    .wf-tot {
        background: #1A5EA8;
    }

    .wf-ded {
        background: #B45309;
    }

    .wf-fin {
        background: #00806B;
    }

    .wf-neg {
        background: #9B1A22;
    }

    .wf-val {
        text-align: right;
        font-size: 13px;
        font-weight: 700;
        color: #16243C;
        white-space: nowrap;
    }

        .wf-val.neg {
            color: #8A4409;
        }

    .wf-pct {
        text-align: right;
        font-size: 11.5px;
        color: #5D6D8C;
    }

    .wf-strong {
        border-top: 1px solid #E4EAF3;
        border-bottom: 1px solid #E4EAF3;
        background: #FBFCFE;
    }

        .wf-strong .wf-lbl {
            font-weight: 800;
        }

        .wf-strong .wf-val {
            font-size: 14px;
            font-weight: 800;
        }

    @media (max-width: 760px) {
        .wf-row, .wf-head {
            grid-template-columns: 1fr 100px;
        }

        .wf-track, .wf-pct {
            display: none;
        }
    }

    /* ── Panel base de cálculo ───────────────────────────────── */
    .sp-base {
        background: #fff;
        border: 1px solid #DDE3EE;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(13,59,110,.08);
        margin-bottom: 20px;
        overflow: hidden;
    }

    .sp-base-head {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 12px 18px;
        cursor: pointer;
        flex-wrap: wrap;
        width: 100%;
        background: none;
        border: none;
        text-align: left;
        font-family: inherit;
    }

        .sp-base-head:hover {
            background: #FBFCFE;
        }

    .sp-base-ico {
        width: 36px;
        height: 36px;
        background: linear-gradient(135deg,#0D3B6E,#1A5EA8);
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        flex-shrink: 0;
        font-size: 17px;
    }

    .sp-base-title {
        font-size: 13px;
        font-weight: 700;
        color: #16243C;
    }

    .sp-base-sub {
        font-size: 11px;
        color: #5D6D8C;
    }

    .sp-chips {
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
        margin-left: auto;
    }

    .sp-chip {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        font-size: 11px;
        font-weight: 700;
        padding: 4px 10px;
        border-radius: 6px;
        background: #EEF2F7;
        color: #0D3B6E;
        border: 1px solid #DDE3EE;
        white-space: nowrap;
    }

    .sp-chip-money {
        background: #E4F7F1;
        color: #07684A;
        border-color: #A8E7D3;
    }

    .sp-chip-tc {
        background: #E6EEFE;
        color: #1547B4;
        border-color: #BFD3FF;
    }

    .sp-chip-warn {
        background: #FFF8E6;
        color: #7E4D00;
        border-color: #FFE29A;
    }

    .sp-caret {
        color: #5D6D8C;
        transition: transform .2s;
        flex-shrink: 0;
        font-size: 12px;
    }

        .sp-caret.open {
            transform: rotate(180deg);
        }

    .sp-base-body {
        border-top: 1px solid #DDE3EE;
        padding: 18px;
        background: #FBFCFE;
    }

    .sp-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit,minmax(248px,1fr));
        gap: 14px;
    }

    .sp-blk {
        background: #fff;
        border: 1px solid #DDE3EE;
        border-radius: 10px;
        padding: 14px;
    }

    .sp-blk-ttl {
        font-size: 11px;
        font-weight: 800;
        color: #5D6D8C;
        text-transform: uppercase;
        letter-spacing: .07em;
        margin-bottom: 10px;
    }

    .sp-kv {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        font-size: 12px;
        padding: 5px 0;
        border-bottom: 1px dashed #E9EEF6;
    }

        .sp-kv:last-child {
            border-bottom: none;
        }

    .sp-kv-k {
        color: #5D6D8C;
    }

    .sp-kv-v {
        color: #16243C;
        font-weight: 700;
        text-align: right;
    }

    .sp-formula {
        font-family: 'Consolas','SF Mono',monospace;
        font-size: 11px;
        background: #0D3B6E;
        color: #CBE7FF;
        border-radius: 6px;
        padding: 8px 10px;
        margin-bottom: 6px;
        line-height: 1.55;
        overflow-wrap: anywhere;
    }

        .sp-formula b {
            color: #3BF0D3;
        }

    .sp-cov {
        margin-bottom: 10px;
    }

    .sp-cov-top {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 11.5px;
        margin-bottom: 4px;
    }

    .sp-cov-name {
        font-weight: 700;
        color: #16243C;
    }

    .sp-cov-pct {
        margin-left: auto;
        font-weight: 800;
        color: #0D3B6E;
    }

    .sp-cov-track {
        height: 6px;
        background: #EEF2F7;
        border-radius: 3px;
        overflow: hidden;
    }

    .sp-cov-fill {
        height: 100%;
        border-radius: 3px;
        background: linear-gradient(90deg,#1A5EA8,#00C9A7);
        transition: width .4s ease;
    }

        .sp-cov-fill.off {
            background: #CFD8E6;
        }

    .sp-cov-note {
        font-size: 10.5px;
        color: #5D6D8C;
        margin-top: 3px;
    }

    .sp-cov.sel .sp-cov-name {
        color: #0D3B6E;
        text-decoration: underline;
    }

    .sp-src {
        display: flex;
        align-items: center;
        gap: 9px;
        font-size: 12px;
        padding: 7px 0;
        border-bottom: 1px dashed #E9EEF6;
    }

        .sp-src:last-child {
            border-bottom: none;
        }

    .sp-src-ico {
        width: 26px;
        height: 26px;
        border-radius: 6px;
        background: #EEF2F7;
        color: #0D3B6E;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        font-size: 12px;
    }

    .sp-src-n {
        font-weight: 700;
    }

    .sp-src-s {
        font-size: 10.5px;
        color: #5D6D8C;
    }

    .sp-src-c {
        margin-left: auto;
        font-size: 11px;
        font-weight: 800;
        color: #5D6D8C;
        text-align: right;
    }

    .sp-warn {
        margin-top: 14px;
        display: flex;
        gap: 10px;
        background: #FFF8E6;
        border: 1px solid #FFE29A;
        border-radius: 8px;
        padding: 10px 13px;
        font-size: 11.5px;
        color: #7A4800;
        line-height: 1.65;
    }

    /* ── Explicación de métodos ──────────────────────────────── */
    .expl-ttl {
        margin: 18px 0 10px;
        font-size: 11px;
        font-weight: 800;
        color: #5D6D8C;
        text-transform: uppercase;
        letter-spacing: .07em;
    }

    .expl-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit,minmax(255px,1fr));
        gap: 12px;
    }

    .expl-card {
        background: #fff;
        border: 1px solid #DDE3EE;
        border-radius: 10px;
        padding: 13px;
    }

        .expl-card.pol {
            border-color: #A8E7D3;
            background: #FAFFFD;
        }

    .expl-head {
        display: flex;
        align-items: center;
        gap: 7px;
        flex-wrap: wrap;
        margin-bottom: 8px;
    }

    .expl-rol {
        font-size: 9px;
        font-weight: 800;
        letter-spacing: .06em;
        color: #5D6D8C;
        text-transform: uppercase;
    }

    .expl-card.pol .expl-rol {
        color: #07684A;
    }

    .expl-conf {
        margin-left: auto;
        font-size: 10px;
        color: #5D6D8C;
        white-space: nowrap;
    }

    .expl-t {
        font-size: 13px;
        font-weight: 700;
        margin-bottom: 8px;
    }

    .expl-l {
        font-size: 9px;
        font-weight: 800;
        color: #5D6D8C;
        text-transform: uppercase;
        letter-spacing: .06em;
        margin-top: 8px;
    }

    .expl-v {
        font-size: 11.5px;
        color: #16243C;
        line-height: 1.5;
        margin-top: 2px;
    }

        .expl-v.mono {
            font-family: 'Consolas','SF Mono',monospace;
            font-size: 10.5px;
            color: #0f3494;
            background: #f0f4fb;
            border-radius: 5px;
            padding: 5px 7px;
            overflow-wrap: anywhere;
        }

    .expl-ojo {
        margin-top: 10px;
        font-size: 11px;
        line-height: 1.55;
        color: #7A4800;
        background: #FFF8E6;
        border: 1px solid #FFE29A;
        border-radius: 7px;
        padding: 8px 10px;
    }

    .expl-card.pol .expl-ojo {
        color: #07684A;
        background: #E9F9F4;
        border-color: #A8E7D3;
    }

    /* ── Badge de método en la tabla ─────────────────────────── */
    .sp-mbadge {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        font-size: 9.5px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: .05em;
        padding: 3px 8px;
        border-radius: 5px;
        border: 1px solid transparent;
        white-space: nowrap;
    }

        .sp-mbadge.m-pp {
            background: #E4F7F1;
            color: #07684A;
            border-color: #A8E7D3;
        }

        .sp-mbadge.m-uc {
            background: #E6EEFE;
            color: #1547B4;
            border-color: #BFD3FF;
        }

        .sp-mbadge.m-ce {
            background: #ECEEFF;
            color: #33339E;
            border-color: #D2D7FF;
        }

        .sp-mbadge.m-ml {
            background: #FFF3DF;
            color: #7E4D00;
            border-color: #FFDE9B;
        }

        .sp-mbadge.m-na {
            background: #F1F4F9;
            color: #7A879C;
            border-color: #DDE3EE;
        }

    .sp-fallback-ico {
        color: #D18A00;
        font-size: 11px;
        margin-left: 5px;
        cursor: help;
    }

    .sp-cur-orig {
        font-size: 9px;
        font-weight: 800;
        color: #1547B4;
        background: #E6EEFE;
        border-radius: 3px;
        padding: 1px 4px;
        margin-left: 5px;
        vertical-align: middle;
    }

    .delta-mg {
        display: block;
        font-size: 9.5px;
        color: #8A4409;
        font-weight: 700;
        margin-top: 2px;
    }

    @media (max-width: 992px) {
        .sp-toolbar {
            padding: 10px 16px;
        }

        .sim-banner {
            padding: 9px 16px;
        }

        .sp-chips {
            margin-left: 0;
            width: 100%;
        }
    }


    /* ══ AVISO DE VOLUMEN Y NOTAS DE ALCANCE ════════════════════ */
    .sp-aviso-vol {
        display: flex;
        gap: 14px;
        align-items: flex-start;
        background: #fffbeb;
        border: 1px solid #fcd34d;
        border-left: 4px solid #f59e0b;
        border-radius: 10px;
        padding: 14px 16px;
        margin-bottom: 14px;
    }

        .sp-aviso-vol > i {
            font-size: 20px;
            color: #b45309;
            margin-top: 1px;
        }

    .sp-aviso-tit {
        font-size: 14px;
        font-weight: 700;
        color: #78350f;
        margin-bottom: 3px;
    }

    .sp-aviso-txt {
        font-size: 13px;
        color: #92400e;
        line-height: 1.45;
    }

    .sp-aviso-cifras {
        display: flex;
        gap: 18px;
        margin: 9px 0 11px;
        flex-wrap: wrap;
    }

    .sp-aviso-cifra {
        font-size: 12px;
        color: #92400e;
    }

        .sp-aviso-cifra strong {
            display: block;
            font-size: 16px;
            font-weight: 700;
            color: #78350f;
        }

    .sp-aviso-btns {
        display: flex;
        gap: 8px;
    }

    .sp-btn-sigue, .sp-btn-ajusta {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 5px 12px;
        height: 31px;
        font-size: 13px;
        font-weight: 600;
        border: none;
        border-radius: 6px;
        color: #fff;
        cursor: pointer;
    }

    .sp-btn-sigue {
        background: #1a56db;
    }

    .sp-btn-ajusta {
        background: #78716c;
    }

    .sp-notas {
        background: #f0f4fb;
        border: 1px solid #dbe4f5;
        border-radius: 10px;
        padding: 12px 15px;
        margin-bottom: 14px;
    }

    .sp-notas-tit {
        display: flex;
        align-items: center;
        gap: 7px;
        font-size: 12px;
        font-weight: 700;
        letter-spacing: .3px;
        text-transform: uppercase;
        color: #0f3494;
        margin-bottom: 7px;
    }

    .sp-notas ul {
        margin: 0;
        padding-left: 18px;
    }

    .sp-notas li {
        font-size: 13px;
        color: #334155;
        line-height: 1.5;
        margin-bottom: 3px;
    }

        .sp-notas li:last-child {
            margin-bottom: 0;
        }
