#sub-ventas-base-listados {
    --bl-border: var(--pv-card-border, rgba(148, 163, 184, 0.18));
    --bl-surface: var(--pv-card-surface, rgba(15, 23, 42, 0.78));
    --bl-solid: var(--pv-card-surface-solid, #111827);
    --bl-text: var(--pv-text-primary, #f8fafc);
    --bl-muted: var(--pv-text-secondary, #94a3b8);
    --bl-subtle: var(--pv-text-muted, #64748b);
}

#sub-ventas-base-listados [hidden] {
    display: none !important;
}

.bl-page {
    width: min(100%, var(--pv-page-max, 1800px));
    margin: 0 auto;
    color: var(--bl-text);
    font-family: var(--pv-font-ui, Inter, sans-serif);
}

.bl-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 14px;
    padding: 24px 26px;
    border: 1px solid color-mix(in srgb, var(--pv-accent-cyan, #38bdf8) 22%, transparent);
    border-radius: var(--pv-card-radius, 14px);
    background:
        radial-gradient(circle at 8% 0, rgba(56, 189, 248, 0.1), transparent 38%),
        var(--bl-surface);
    box-shadow: var(--pv-glow-cyan, 0 14px 35px rgba(0, 0, 0, 0.16));
    backdrop-filter: var(--pv-glass-blur, blur(16px));
}

.bl-eyebrow {
    display: block;
    margin-bottom: 7px;
    color: var(--pv-accent-cyan, #67e8f9);
    font-family: var(--pv-font-mono, monospace);
    font-size: var(--pv-text-xs, 0.72rem);
    font-weight: 750;
    letter-spacing: 0.14em;
}

.bl-hero h2,
.bl-data-head h3 {
    margin: 0;
    color: var(--bl-text);
}

.bl-hero h2 {
    font-size: clamp(1.55rem, 2.2vw, 2.1rem);
    letter-spacing: -0.025em;
}

.bl-hero > div:first-child > p {
    max-width: 760px;
    margin: 8px 0 0;
    color: var(--bl-muted);
    line-height: 1.6;
}

.bl-mode {
    display: flex;
    min-width: 290px;
    gap: 11px;
    padding: 13px 15px;
    border: 1px solid rgba(52, 211, 153, 0.3);
    border-radius: var(--pv-input-radius, 9px);
    background: rgba(16, 185, 129, 0.08);
}

.bl-mode > .material-symbols-outlined {
    color: var(--pv-green-text, #6ee7b7);
    font-size: 1.35rem;
}

.bl-mode div {
    display: grid;
    gap: 3px;
}

.bl-mode strong {
    color: var(--pv-green-text, #6ee7b7);
    font-size: 0.84rem;
}

.bl-mode span,
.bl-data-head p {
    color: var(--bl-muted);
    font-size: 0.75rem;
    line-height: 1.45;
}

.bl-filters {
    display: grid;
    grid-template-columns: repeat(5, minmax(128px, 0.7fr)) minmax(220px, 1.35fr) auto;
    align-items: end;
    gap: 12px;
    margin-bottom: 12px;
    padding: 17px 18px;
    border: 1px solid var(--bl-border);
    border-radius: var(--pv-card-radius, 14px);
    background: var(--bl-surface);
}

.bl-filters label,
.bl-data-actions label {
    display: grid;
    min-width: 0;
    gap: 6px;
}

.bl-filters label > span:first-child,
.bl-data-actions label > span:first-child {
    color: var(--bl-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.bl-filters input,
.bl-filters select,
.bl-data-actions select {
    width: 100%;
    min-width: 0;
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--bl-border);
    border-radius: var(--pv-input-radius, 9px);
    outline: 0;
    background: color-mix(in srgb, var(--pv-bg-base, #020617) 75%, transparent);
    color: var(--bl-text);
    font: inherit;
    font-size: 0.8rem;
}

.bl-filters input:focus,
.bl-filters select:focus,
.bl-data-actions select:focus {
    border-color: var(--pv-accent, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}

.bl-search-control {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    border: 1px solid var(--bl-border);
    border-radius: var(--pv-input-radius, 9px);
    background: color-mix(in srgb, var(--pv-bg-base, #020617) 75%, transparent);
}

.bl-search-control:focus-within {
    border-color: var(--pv-accent, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}

.bl-search-control .material-symbols-outlined {
    margin-left: 10px;
    color: var(--bl-subtle);
    font-size: 1.1rem;
}

.bl-search-control input {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.bl-filter-actions,
.bl-data-actions,
.bl-pagination,
.bl-pagination > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bl-button,
.bl-icon-button {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--bl-border);
    border-radius: var(--pv-input-radius, 9px);
    background: rgba(148, 163, 184, 0.08);
    color: var(--bl-text);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.bl-button-primary {
    border-color: transparent;
    background: var(--pv-accent, #6366f1);
}

.bl-button:hover:not(:disabled),
.bl-icon-button:hover:not(:disabled) {
    filter: brightness(1.12);
}

.bl-button:focus-visible,
.bl-icon-button:focus-visible,
.bl-table summary:focus-visible {
    outline: 2px solid var(--pv-accent-cyan, #38bdf8);
    outline-offset: 2px;
}

.bl-button:disabled,
.bl-icon-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.bl-icon-button {
    display: grid;
    width: 40px;
    padding: 0;
    place-items: center;
}

.bl-query-note {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    padding: 12px 15px;
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: var(--pv-input-radius, 9px);
    background: rgba(56, 189, 248, 0.06);
    color: var(--bl-muted);
}

.bl-query-note .material-symbols-outlined {
    color: var(--pv-accent-cyan, #38bdf8);
    font-size: 1.15rem;
}

.bl-query-note p {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.5;
}

.bl-data-card {
    overflow: hidden;
    border: 1px solid var(--bl-border);
    border-radius: var(--pv-card-radius, 14px);
    background: var(--bl-surface);
    box-shadow: var(--pv-elevation, 0 16px 40px rgba(0, 0, 0, 0.14));
}

.bl-data-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 17px 18px;
    border-bottom: 1px solid var(--bl-border);
}

.bl-data-head h3 {
    font-size: 1rem;
}

.bl-data-head p {
    margin: 4px 0 0;
}

.bl-data-actions label {
    grid-template-columns: auto 72px;
    align-items: center;
}

.bl-alert {
    margin: 14px 18px 0;
    padding: 11px 13px;
    border: 1px solid rgba(248, 113, 113, 0.35);
    border-radius: var(--pv-input-radius, 9px);
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    font-size: 0.8rem;
}

.bl-loading,
.bl-empty {
    min-height: 190px;
    align-items: center;
    justify-content: center;
    color: var(--bl-muted);
}

.bl-loading {
    display: flex;
    gap: 10px;
    font-size: 0.82rem;
}

.bl-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(148, 163, 184, 0.25);
    border-top-color: var(--pv-accent-cyan, #38bdf8);
    border-radius: 50%;
    animation: bl-spin 0.75s linear infinite;
}

@keyframes bl-spin {
    to { transform: rotate(360deg); }
}

.bl-empty {
    display: flex;
    flex-direction: column;
    gap: 7px;
    text-align: center;
}

.bl-empty .material-symbols-outlined {
    color: var(--bl-subtle);
    font-size: 2rem;
}

.bl-empty strong {
    color: var(--bl-text);
}

.bl-empty p {
    margin: 0;
    font-size: 0.78rem;
}

.bl-table-shell {
    max-height: calc(100vh - 330px);
    min-height: 240px;
    overflow: auto;
    transition: opacity 0.15s ease;
}

.bl-table-shell.is-loading {
    opacity: 0.45;
}

.bl-table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.75rem;
}

.bl-table th,
.bl-table td {
    max-width: 240px;
    padding: 10px 11px;
    border-right: 1px solid rgba(148, 163, 184, 0.08);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

.bl-table th {
    position: sticky;
    z-index: 2;
    top: 0;
    background: var(--bl-solid);
    color: var(--bl-muted);
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.bl-table tbody tr:hover td {
    background: rgba(99, 102, 241, 0.045);
}

.bl-title-cell {
    overflow: hidden;
    min-width: 190px;
    text-overflow: ellipsis;
}

.bl-number {
    color: var(--bl-text);
    font-family: var(--pv-font-mono, monospace);
}

.bl-table small {
    color: var(--bl-subtle);
    font-size: 0.66rem;
}

.bl-missing {
    color: var(--bl-subtle);
}

.bl-badge {
    display: inline-flex;
    padding: 3px 7px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.08);
    color: var(--bl-muted);
    font-size: 0.68rem;
}

.bl-badge-quality.is-observed,
.bl-badge-capture.is-direct,
.bl-badge-status.is-active {
    border-color: rgba(52, 211, 153, 0.28);
    background: rgba(16, 185, 129, 0.09);
    color: #6ee7b7;
}

.bl-badge-capture.is-initial {
    border-color: rgba(96, 165, 250, 0.3);
    background: rgba(59, 130, 246, 0.1);
    color: #93c5fd;
}

.bl-badge-capture.is-legacy,
.bl-badge-quality.is-legacy_sku_fanout,
.bl-badge-quality.is-legacy_sku_single_listing {
    border-color: rgba(251, 191, 36, 0.28);
    background: rgba(245, 158, 11, 0.09);
    color: #fcd34d;
}

.bl-badge-quality.is-partial_observed,
.bl-badge-quality.is-legacy_observed_sku_level,
.bl-badge-quality.is-legacy_sku_aggregate {
    border-color: rgba(251, 191, 36, 0.28);
    background: rgba(245, 158, 11, 0.09);
    color: #fcd34d;
}

.bl-source {
    display: grid;
    max-width: 220px;
    gap: 3px;
    white-space: normal;
}

.bl-visits {
    display: grid;
    min-width: 135px;
    max-width: 210px;
    gap: 2px;
    white-space: normal;
}

.bl-visits.is-known strong {
    color: #a7f3d0;
}

.bl-visits.is-lower-bound strong,
.bl-visits.is-lower-bound small:first-of-type {
    color: #fbbf24;
}

.bl-visits.is-unknown small {
    color: #fbbf24;
}

.bl-details summary {
    color: var(--pv-accent-cyan, #67e8f9);
    cursor: pointer;
}

.bl-details pre {
    max-width: 420px;
    max-height: 260px;
    margin: 8px 0 0;
    padding: 10px;
    overflow: auto;
    border: 1px solid var(--bl-border);
    border-radius: 7px;
    background: var(--pv-bg-base, #020617);
    color: var(--bl-muted);
    font: 0.68rem/1.5 var(--pv-font-mono, monospace);
    white-space: pre-wrap;
}

.bl-variable-list {
    display: grid;
    min-width: 320px;
    max-width: 520px;
    gap: 8px;
    margin-top: 8px;
}

.bl-variable {
    min-width: 0;
}

.bl-variable code {
    display: block;
    color: #a5b4fc;
    font: 0.66rem/1.4 var(--pv-font-mono, monospace);
    overflow-wrap: anywhere;
    white-space: normal;
}

.bl-variable pre {
    margin-top: 4px;
}

.bl-pagination {
    justify-content: space-between;
    min-height: 60px;
    padding: 10px 18px;
    border-top: 1px solid var(--bl-border);
    color: var(--bl-muted);
    font-size: 0.75rem;
}

@media (max-width: 1350px) {
    .bl-filters {
        grid-template-columns: repeat(3, minmax(140px, 1fr));
    }

    .bl-search-label {
        grid-column: span 2;
    }
}

@media (max-width: 760px) {
    .bl-hero,
    .bl-data-head,
    .bl-pagination {
        flex-direction: column;
    }

    .bl-mode {
        min-width: 0;
    }

    .bl-filters {
        grid-template-columns: 1fr;
    }

    .bl-search-label {
        grid-column: auto;
    }

    .bl-filter-actions {
        justify-content: stretch;
    }

    .bl-filter-actions .bl-button {
        flex: 1;
    }

    .bl-table-shell {
        max-height: 65vh;
    }
}
