/* Hub de Costes V2 — tema "Deep Space" compartido.
   Hoja GLOBAL (no scoped) acotada bajo .costes-hub. Se hace global a propósito:
   el CSS scoped por página (.razor.css) NO alcanza el DOM interno de los
   componentes hijos (CostFilterBar, CostChart) ni de QuickGrid, que son los que
   renderizaban en blanco. Todo con variables de app.css => válido en tema
   oscuro y claro (los tokens se redefinen en :root[data-theme="light"]). */

.costes-hub {
    /* Iconos SVG embebidos (flechas del paginador, indicador de orden de
       QuickGrid, selector de fecha) traen fill negro fijo: se invierten en
       oscuro y se dejan tal cual en claro. */
    --costes-icon-filter: invert(1) brightness(1.5);
    color: var(--text-primary);
}
:root[data-theme="light"] .costes-hub {
    --costes-icon-filter: none;
}

.costes-hub h1,
.costes-hub h2,
.costes-hub h3,
.costes-hub h4 { color: var(--text-primary); }
.costes-hub .text-muted { color: var(--text-secondary) !important; }

/* ---- Tarjetas glass: Bootstrap .card de páginas + CostFilterBar + CostChart ---- */
.costes-hub .card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-radius: 14px;
    -webkit-backdrop-filter: var(--backdrop-blur);
    backdrop-filter: var(--backdrop-blur);
    box-shadow: var(--glass-shadow);
}
.costes-hub .card-body { color: var(--text-primary); }


/* ---- Inputs / selects / labels ---- */
.costes-hub .form-control,
.costes-hub .form-select {
    background-color: var(--input-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}
.costes-hub .form-control:focus,
.costes-hub .form-select:focus {
    background-color: var(--input-bg);
    border-color: var(--primary-color);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.2rem rgba(6, 182, 212, 0.25);
}
.costes-hub .form-control::placeholder { color: var(--text-secondary); opacity: 1; }
.costes-hub .form-label { color: var(--text-secondary); }
/* Menú desplegable del select: algunos navegadores heredan el fondo del sistema. */
.costes-hub .form-select option { background: var(--bg-surface); color: var(--text-primary); }
/* Icono del date-picker (fill negro) visible en oscuro. */
.costes-hub input[type="date"]::-webkit-calendar-picker-indicator {
    filter: var(--costes-icon-filter);
    cursor: pointer;
}

/* ---- Switch + checks (pestaña Ajustes / modal de agentes) ---- */
.costes-hub .form-check-input {
    background-color: var(--input-bg);
    border-color: var(--glass-border);
}
.costes-hub .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
.costes-hub .form-check-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(6, 182, 212, 0.25);
}
.costes-hub .form-check-label { color: var(--text-primary); }
.costes-hub .form-check-label code { color: var(--secondary-color); }

/* ---- Botones ---- */
.costes-hub .btn-outline-secondary,
.costes-hub .btn-outline-light {
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    background: var(--input-bg);
}
.costes-hub .btn-outline-secondary:hover,
.costes-hub .btn-outline-light:hover,
.costes-hub .btn-outline-secondary:focus-visible,
.costes-hub .btn-outline-light:focus-visible {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--glass-highlight);
}
.costes-hub .btn-outline-secondary:disabled,
.costes-hub .btn-outline-light:disabled { opacity: .45; }
.costes-hub .btn-primary {
    background: var(--primary-gradient);
    border: none;
    color: #fff;
}
.costes-hub .btn-primary:hover:not(:disabled) { filter: brightness(1.08); color: #fff; }
.costes-hub .btn-primary:disabled { opacity: .6; }
/* Presets de fecha como grupo pill. */
.costes-hub .btn-group > .btn:first-child { border-top-left-radius: .5rem; border-bottom-left-radius: .5rem; }
.costes-hub .btn-group > .btn:last-child { border-top-right-radius: .5rem; border-bottom-right-radius: .5rem; }

/* ---- Barra de filtros (CostFilterBar): dimensiones uniformes ----
   Todos los controles (inputs, select, botones y presets) comparten altura,
   tipografía y estructura label+control, para que la barra quede alineada
   en una sola línea base en vez de con tamaños dispares. */
.costes-hub .filter-bar .filter-field {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.costes-hub .filter-bar .filter-label {
    margin: 0;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-secondary);
}
/* Altura idéntica para inputs, selects y botones de la barra. */
.costes-hub .filter-bar .form-control-sm,
.costes-hub .filter-bar .form-select-sm,
.costes-hub .filter-bar .btn-sm {
    height: 34px;
    font-size: .82rem;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
}
.costes-hub .filter-bar .btn-sm { padding-top: 0; padding-bottom: 0; justify-content: center; }
.costes-hub .filter-bar .form-control-sm { min-width: 8.5rem; }
.costes-hub .filter-bar .form-select-sm { min-width: 8rem; }
/* Los tres presets se reparten homogéneos y no parten el texto. */
.costes-hub .filter-bar .btn-group .btn-sm { flex: 1 1 0; white-space: nowrap; }

/* ---- Tablas: Bootstrap .table (Index / Conversaciones) + QuickGrid ---- */
.costes-hub .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    --bs-table-border-color: var(--glass-border);
    --bs-table-hover-color: var(--text-primary);
    --bs-table-hover-bg: var(--glass-highlight);
    color: var(--text-primary);
    margin-bottom: 0;
}
.costes-hub .table > :not(caption) > * > * {
    background-color: transparent;
    color: var(--text-primary);
    border-bottom-color: var(--glass-border);
}
.costes-hub .table thead th,
.costes-hub .quickgrid thead th {
    color: var(--text-secondary);
    border-bottom: 1px solid var(--glass-border);
    font-weight: 600;
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .04em;
}
.costes-hub .table-hover > tbody > tr:hover > * {
    background-color: var(--glass-highlight) !important;
    color: var(--text-primary) !important;
}
/* Enlaces de tabla (sesión / top-10) en cian del tema. */
.costes-hub .table a,
.costes-hub .quickgrid a { color: var(--primary-color); text-decoration: none; }
.costes-hub .table a:hover,
.costes-hub .quickgrid a:hover { text-decoration: underline; }

/* ---- QuickGrid: cabecera con botón de orden + indicador ---- */
.costes-hub .quickgrid .col-title { color: var(--text-secondary); }
.costes-hub .quickgrid button.col-title:hover,
.costes-hub .quickgrid .col-options-button:hover { background-color: var(--glass-highlight); }
.costes-hub .quickgrid button.col-title:active,
.costes-hub .quickgrid .col-options-button:active { background-color: var(--glass-border); }
.costes-hub .quickgrid .sort-indicator { filter: var(--costes-icon-filter); }
/* Popup de opciones de columna (por si se añaden ColumnOptions). */
.costes-hub .quickgrid .col-options {
    background: var(--bg-surface);
    border-color: var(--glass-border);
    color: var(--text-primary);
    box-shadow: var(--glass-shadow);
}

/* ---- Paginator de QuickGrid ---- */
.costes-hub .paginator {
    border-top: 1px solid var(--glass-border);
    color: var(--text-secondary);
}
.costes-hub .paginator nav button { filter: var(--costes-icon-filter); }
.costes-hub .paginator nav button:not([disabled]):hover { background-color: var(--glass-highlight); }

/* ---- Costes de Astro Evalúa: superficie nativa del admin ---- */
.costes-hub .evaluation-costs {
    --evaluation-accent-text: var(--primary-color);
    --evaluation-focus-color: var(--primary-color);
}

:root[data-theme="light"] .costes-hub .evaluation-costs {
    --evaluation-accent-text: var(--text-primary);
    --evaluation-focus-color: var(--text-primary);
}

.costes-hub .evaluation-cost-shell {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    min-width: 0;
}

.costes-hub .evaluation-cost-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.costes-hub .evaluation-cost-header__titles { min-width: 0; }
.costes-hub .evaluation-cost-eyebrow,
.costes-hub .evaluation-data-panel__eyebrow {
    display: block;
    color: var(--evaluation-accent-text);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.costes-hub .evaluation-cost-title {
    margin: .25rem 0;
    font-size: clamp(1.55rem, 2vw, 2rem);
    line-height: 1.2;
}

.costes-hub .evaluation-cost-subtitle,
.costes-hub .evaluation-cost-section-heading p,
.costes-hub .evaluation-filter-card__header p,
.costes-hub .evaluation-data-panel__header p {
    margin: 0;
    color: var(--text-secondary);
}

.costes-hub .evaluation-cost-context {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    flex: 0 0 auto;
    padding: .45rem .7rem;
    border: 1px solid var(--glass-border);
    border-radius: .65rem;
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: .82rem;
    font-weight: 600;
    white-space: nowrap;
}

.costes-hub .evaluation-cost-tabs {
    display: flex;
    gap: .375rem;
    max-width: 100%;
    margin-bottom: 1rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
}

.costes-hub .evaluation-cost-tab,
.costes-hub .evaluation-filter-action,
.costes-hub .evaluation-pagination-link,
.costes-hub .evaluation-row-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.costes-hub .evaluation-cost-tab {
    gap: .45rem;
    flex: 0 0 auto;
    padding: .55rem .8rem;
    border: 1px solid transparent;
    border-radius: .6rem;
    color: var(--text-secondary);
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.costes-hub .evaluation-cost-tab:hover {
    border-color: var(--glass-border);
    background: var(--glass-highlight);
    color: var(--text-primary);
}

.costes-hub .evaluation-cost-tab.active {
    border-color: var(--primary-color);
    background: var(--glass-highlight);
    color: var(--evaluation-accent-text);
}

.costes-hub .evaluation-cost-content,
.costes-hub .evaluation-cost-section-heading { min-width: 0; }
.costes-hub .evaluation-cost-section-heading { margin-bottom: 1rem; }
.costes-hub .evaluation-cost-section-heading h2 {
    margin: 0 0 .2rem;
    font-size: 1.2rem;
}

.costes-hub .evaluation-filter-card {
    margin-bottom: 1rem;
    overflow: hidden;
}

.costes-hub .evaluation-filter-card__header,
.costes-hub .evaluation-data-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.costes-hub .evaluation-filter-card__header h3,
.costes-hub .evaluation-data-panel__header h3 {
    margin: 0 0 .15rem;
    font-size: 1rem;
}

.costes-hub .evaluation-filter-bar {
    display: grid;
    gap: .85rem;
    padding: 1rem;
}

.costes-hub .evaluation-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
}

.costes-hub .evaluation-filter-grid > div {
    display: grid;
    min-width: 0;
    gap: .3rem;
}

.costes-hub .evaluation-filter-grid label {
    color: var(--text-secondary);
    font-size: .75rem;
    font-weight: 600;
}

.costes-hub .evaluation-filter-grid input,
.costes-hub .evaluation-filter-grid select {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: .55rem .7rem;
    border: 1px solid var(--glass-border);
    border-radius: .55rem;
    background: var(--input-bg);
    color: var(--text-primary);
}

.costes-hub .evaluation-filter-grid select option {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.costes-hub .evaluation-advanced-filters {
    padding: 0 .75rem .75rem;
    border: 1px solid var(--glass-border);
    border-radius: .65rem;
    background: var(--input-bg);
}

.costes-hub .evaluation-advanced-filters > summary {
    display: list-item;
    min-width: 44px;
    min-height: 44px;
    padding-block: .7rem;
    color: var(--text-secondary);
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
}

.costes-hub .evaluation-advanced-filters[open] > summary {
    margin-bottom: .75rem;
    color: var(--text-primary);
}

.costes-hub .evaluation-filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
}

.costes-hub .evaluation-filter-action { width: auto; }

.costes-hub .evaluation-feedback {
    display: grid;
    gap: .75rem;
    min-height: 8rem;
    align-content: center;
    justify-items: start;
    padding: 1rem;
}

.costes-hub .evaluation-feedback p,
.costes-hub .evaluation-feedback__message {
    margin: 0;
    color: var(--text-secondary);
}

.costes-hub .evaluation-skeleton {
    display: grid;
    width: min(100%, 34rem);
    gap: .45rem;
}

.costes-hub .evaluation-skeleton > span {
    display: block;
    width: 100%;
    height: .65rem;
    border-radius: 999px;
    background: var(--glass-highlight);
}

.costes-hub .evaluation-skeleton > span:nth-child(2) { width: 82%; }
.costes-hub .evaluation-skeleton > span:nth-child(3) { width: 64%; }

.costes-hub .evaluation-feedback__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.costes-hub .evaluation-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.costes-hub .evaluation-data-panel > .evaluation-summary-grid { padding: 1rem; }

.costes-hub .evaluation-summary-card { min-width: 0; }
.costes-hub .evaluation-summary-card .card-body { padding: 1rem; }
.costes-hub .evaluation-summary-card__heading {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: .75rem;
}

.costes-hub .evaluation-summary-card__heading > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 2rem;
    border: 1px solid var(--glass-border);
    border-radius: .55rem;
    background: var(--glass-highlight);
    color: var(--evaluation-accent-text);
    font-size: .75rem;
    font-weight: 700;
}

.costes-hub .evaluation-summary-card__heading h2 {
    margin: 0;
    font-size: 1rem;
}

.costes-hub .evaluation-summary-card p {
    color: var(--text-secondary);
    font-size: .85rem;
}

.costes-hub .evaluation-cost-values {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: .5rem 1rem;
    margin: 0;
    font-size: .85rem;
}

.costes-hub .evaluation-cost-values dt,
.costes-hub .evaluation-cost-values dd {
    margin: 0;
    overflow-wrap: anywhere;
}
.costes-hub .evaluation-cost-values dt { color: var(--text-secondary); }
.costes-hub .evaluation-cost-values dd { text-align: right; }

.costes-hub .evaluation-quality-badge,
.costes-hub .evaluation-status-badge,
.costes-hub .evaluation-estimate-label,
.costes-hub .evaluation-data-panel__count {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: .25rem .5rem;
    border: 1px solid var(--glass-border);
    border-radius: .45rem;
    background: var(--glass-highlight);
    color: var(--text-secondary);
    font-size: .72rem;
    font-weight: 600;
}

.costes-hub .evaluation-data-panel {
    min-width: 0;
    overflow: hidden;
}

.costes-hub .evaluation-data-panel .table-responsive {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.costes-hub .evaluation-data-panel .table {
    min-width: 760px;
    font-size: .82rem;
}

.costes-hub .evaluation-data-panel .table.evaluation-run-table { min-width: 1800px; }

.costes-hub .evaluation-data-panel .evaluation-run-table > tbody > tr.evaluation-run-row > td {
    padding-block: .25rem;
    white-space: nowrap;
}

.costes-hub .evaluation-data-panel .evaluation-run-table .evaluation-run-cell-group {
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
}

.costes-hub .evaluation-run-costs {
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    align-items: center;
    gap: .5rem;
    white-space: nowrap;
}

.costes-hub .evaluation-run-cost-reference + .evaluation-run-cost-reference {
    padding-inline-start: .5rem;
    border-inline-start: 1px solid var(--glass-border);
}

.costes-hub .evaluation-data-panel .table > :not(caption) > * > * {
    padding: .55rem .65rem;
    vertical-align: middle;
}

.costes-hub .evaluation-data-panel .table a,
.costes-hub .evaluation-data-panel .table button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    color: var(--evaluation-accent-text);
}

.costes-hub .evaluation-data-panel .table thead button,
.costes-hub .evaluation-row-action {
    border: 0;
    background: transparent;
    color: var(--evaluation-accent-text);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.costes-hub .evaluation-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .75rem;
    padding: .75rem 1rem;
    border-top: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: .82rem;
}

.costes-hub .evaluation-pagination-link {
    padding-inline: .75rem;
    border: 1px solid var(--glass-border);
    border-radius: .55rem;
    color: var(--text-primary);
    text-decoration: none;
}

.costes-hub .evaluation-cost-tab:focus-visible,
.costes-hub .evaluation-filter-action:focus-visible,
.costes-hub .evaluation-filter-grid input:focus-visible,
.costes-hub .evaluation-filter-grid select:focus-visible,
.costes-hub .evaluation-advanced-filters > summary:focus-visible,
.costes-hub .evaluation-data-panel a:focus-visible,
.costes-hub .evaluation-data-panel button:focus-visible,
.costes-hub .evaluation-pagination-link:focus-visible {
    outline: 2px solid var(--evaluation-focus-color);
    outline-offset: 2px;
}

.costes-hub .evaluation-feedback__action:focus-visible {
    outline: 2px solid var(--evaluation-focus-color);
    outline-offset: 2px;
}

@media (max-width: 767.98px) {
    .costes-hub .evaluation-cost-header {
        flex-direction: column;
        gap: .75rem;
    }

    .costes-hub .evaluation-filter-grid,
    .costes-hub .evaluation-summary-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .costes-hub .evaluation-cost-tab {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .costes-hub .evaluation-data-panel__header {
        flex-direction: column;
        gap: .65rem;
    }
}

@media (max-width: 575.98px) {
    .costes-hub .evaluation-cost-shell { padding-inline: 0; }
    .costes-hub .evaluation-filter-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .costes-hub .evaluation-filter-action { width: 100%; }
    .costes-hub .evaluation-cost-values { grid-template-columns: minmax(0, 1fr); }
    .costes-hub .evaluation-cost-values dd { text-align: left; }
    .costes-hub .evaluation-pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ---- Costes de enriquecimientos: trazabilidad tipada y compacta ---- */
.costes-hub .enrichment-costs {
    --enrichment-accent: var(--primary-color);
    --enrichment-focus: var(--primary-color);
    width: 100%;
    max-width: 1500px;
    min-width: 0;
    margin: 0 auto;
    font-family: 'Manrope', sans-serif;
}

:root[data-theme="light"] .costes-hub .enrichment-costs {
    --enrichment-accent: var(--text-primary);
    --enrichment-focus: var(--text-primary);
}

.costes-hub .enrichment-costs h1,
.costes-hub .enrichment-costs h2,
.costes-hub .enrichment-costs h3,
.costes-hub .enrichment-costs h4 {
    font-family: 'Outfit', sans-serif;
}

.costes-hub .enrichment-cost-header {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: .85rem;
    padding-inline-start: .9rem;
}

.costes-hub .enrichment-cost-header::before {
    position: absolute;
    inset-block: .15rem;
    inset-inline-start: 0;
    width: 3px;
    border-radius: 999px;
    background: var(--enrichment-accent);
    content: "";
}

.costes-hub .enrichment-cost-header__titles,
.costes-hub .enrichment-cost-content,
.costes-hub .enrichment-cost-section-heading { min-width: 0; }

.costes-hub .enrichment-cost-eyebrow,
.costes-hub .enrichment-data-panel__eyebrow {
    display: block;
    color: var(--enrichment-accent);
    font-family: 'Outfit', sans-serif;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.costes-hub .enrichment-cost-title {
    margin: .18rem 0;
    font-size: clamp(1.45rem, 2vw, 1.85rem);
    line-height: 1.2;
}

.costes-hub .enrichment-cost-subtitle,
.costes-hub .enrichment-cost-section-heading p,
.costes-hub .enrichment-filter-card__header p,
.costes-hub .enrichment-data-panel__header p,
.costes-hub .enrichment-breakdowns__header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: .84rem;
}

.costes-hub .enrichment-cost-context {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    flex: 0 0 auto;
    padding: .4rem .65rem;
    border: 1px solid var(--glass-border);
    border-radius: .6rem;
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
}

.costes-hub .enrichment-cost-tabs {
    display: flex;
    gap: .375rem;
    max-width: 100%;
    margin-bottom: .85rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
}

.costes-hub .enrichment-cost-tab,
.costes-hub .enrichment-filter-action,
.costes-hub .enrichment-feedback__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.costes-hub .enrichment-cost-tab {
    gap: .4rem;
    flex: 0 0 auto;
    padding: .5rem .75rem;
    border: 1px solid transparent;
    border-radius: .6rem;
    color: var(--text-secondary);
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.costes-hub .enrichment-cost-tab:hover {
    border-color: var(--glass-border);
    background: var(--glass-highlight);
    color: var(--text-primary);
}

.costes-hub .enrichment-cost-tab.active {
    border-color: var(--primary-color);
    background: var(--glass-highlight);
    color: var(--enrichment-accent);
}

.costes-hub .enrichment-cost-section-heading { margin-bottom: .75rem; }
.costes-hub .enrichment-cost-section-heading h2 {
    margin: 0 0 .15rem;
    font-size: 1.1rem;
}

.costes-hub .enrichment-filter-card {
    margin-bottom: .85rem;
    overflow: hidden;
}

.costes-hub .enrichment-filter-card__header,
.costes-hub .enrichment-data-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem .9rem;
    border-bottom: 1px solid var(--glass-border);
}

.costes-hub .enrichment-filter-card__header h3,
.costes-hub .enrichment-data-panel__header h3 {
    margin: 0 0 .1rem;
    font-size: .95rem;
}

.costes-hub .enrichment-filter-bar {
    display: grid;
    gap: .7rem;
    padding: .85rem;
}

.costes-hub .enrichment-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .65rem;
}

.costes-hub .enrichment-filter-grid--primary {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.costes-hub .enrichment-filter-grid > div {
    display: grid;
    min-width: 0;
    gap: .25rem;
}

.costes-hub .enrichment-filter-grid label {
    color: var(--text-secondary);
    font-size: .72rem;
    font-weight: 600;
}

.costes-hub .enrichment-filter-grid input,
.costes-hub .enrichment-filter-grid select {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: .5rem .65rem;
    border: 1px solid var(--glass-border);
    border-radius: .55rem;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: .82rem;
}

.costes-hub .enrichment-filter-grid select option {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.costes-hub .enrichment-advanced-filters {
    padding: 0 .7rem .7rem;
    border: 1px solid var(--glass-border);
    border-radius: .6rem;
    background: var(--input-bg);
}

.costes-hub .enrichment-advanced-filters > summary {
    min-width: 44px;
    min-height: 44px;
    padding-block: .65rem;
    color: var(--text-secondary);
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
}

.costes-hub .enrichment-advanced-filters[open] > summary {
    margin-bottom: .65rem;
    color: var(--text-primary);
}

.costes-hub .enrichment-filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: .65rem;
}

.costes-hub .enrichment-filter-action { width: auto; }

.costes-hub .enrichment-data-panel {
    min-width: 0;
    overflow: hidden;
}

.costes-hub .enrichment-feedback {
    display: grid;
    min-height: 7.5rem;
    align-content: center;
    justify-items: start;
    gap: .65rem;
    padding: .9rem;
}

.costes-hub .enrichment-feedback__message {
    margin: 0;
    color: var(--text-secondary);
}

.costes-hub .enrichment-skeleton {
    display: grid;
    width: min(100%, 32rem);
    gap: .4rem;
}

.costes-hub .enrichment-skeleton > span {
    display: block;
    width: 100%;
    height: .6rem;
    border-radius: 999px;
    background: var(--glass-highlight);
}

.costes-hub .enrichment-skeleton > span:nth-child(2) { width: 78%; }
.costes-hub .enrichment-skeleton > span:nth-child(3) { width: 58%; }

.costes-hub .enrichment-metric-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .65rem;
    padding: .85rem;
}

.costes-hub .enrichment-metric-card {
    display: grid;
    min-width: 0;
    min-height: 7.25rem;
    align-content: space-between;
    gap: .25rem;
    padding: .75rem;
    border: 1px solid var(--glass-border);
    border-radius: .65rem;
    background: var(--card-bg);
}

.costes-hub .enrichment-metric-card--cost {
    border-inline-start: 3px solid var(--enrichment-accent);
}

.costes-hub .enrichment-metric-label {
    color: var(--text-secondary);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.costes-hub .enrichment-metric-value {
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    line-height: 1.1;
}

.costes-hub .enrichment-metric-card small {
    color: var(--text-secondary);
    font-size: .7rem;
    overflow-wrap: anywhere;
}

.costes-hub .enrichment-money {
    font-family: 'JetBrains Mono', monospace;
    font-variant-numeric: tabular-nums;
}

.costes-hub .enrichment-breakdowns {
    padding: 0 .85rem .85rem;
}

.costes-hub .enrichment-breakdowns__header {
    margin-bottom: .65rem;
    padding-top: .85rem;
    border-top: 1px solid var(--glass-border);
}

.costes-hub .enrichment-breakdowns__header h3 {
    margin: 0 0 .1rem;
    font-size: .95rem;
}

.costes-hub .enrichment-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
}

.costes-hub .enrichment-breakdown-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    border-radius: .65rem;
    background: var(--card-bg);
}

.costes-hub .enrichment-breakdown-card > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .6rem .7rem;
    border-bottom: 1px solid var(--glass-border);
}

.costes-hub .enrichment-breakdown-card > header h4 {
    margin: 0;
    font-size: .84rem;
}

.costes-hub .enrichment-breakdown-card > header span {
    color: var(--text-secondary);
    font-size: .68rem;
    white-space: nowrap;
}

.costes-hub .enrichment-breakdown-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.costes-hub .enrichment-breakdown-table {
    width: 100%;
    min-width: 31rem;
    border-collapse: collapse;
    color: var(--text-primary);
    font-size: .75rem;
}

.costes-hub .enrichment-breakdown-table th,
.costes-hub .enrichment-breakdown-table td {
    padding: .5rem .6rem;
    border-bottom: 1px solid var(--glass-border);
    text-align: right;
    white-space: nowrap;
}

.costes-hub .enrichment-breakdown-table th {
    color: var(--text-secondary);
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.costes-hub .enrichment-breakdown-table th:first-child,
.costes-hub .enrichment-breakdown-table td:first-child {
    width: 100%;
    text-align: left;
}

.costes-hub .enrichment-breakdown-table tbody tr:last-child td { border-bottom: 0; }

.costes-hub .enrichment-breakdown-empty {
    margin: 0;
    padding: .75rem;
    color: var(--text-secondary);
    font-size: .78rem;
}

.costes-hub .enrichment-execution-count {
    flex: 0 0 auto;
    color: var(--text-secondary);
    font-size: .75rem;
    white-space: nowrap;
}

.costes-hub .enrichment-execution-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: .5rem;
    flex: 0 0 auto;
}

.costes-hub .enrichment-sort-field {
    display: grid;
    gap: .15rem;
}

.costes-hub .enrichment-sort-field label {
    color: var(--text-secondary);
    font-size: .66rem;
    font-weight: 700;
}

.costes-hub .enrichment-sort-field select,
.costes-hub .enrichment-sort-direction {
    min-height: 44px;
    border: 1px solid var(--glass-border);
    border-radius: .55rem;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: .76rem;
}

.costes-hub .enrichment-sort-field select { padding: .45rem .6rem; }

.costes-hub .enrichment-sort-direction {
    display: inline-flex;
    min-width: 44px;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: .45rem .6rem;
}

.costes-hub .enrichment-execution-table-wrap,
.costes-hub .enrichment-call-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

.costes-hub .enrichment-execution-table {
    width: 100%;
    min-width: 76rem;
    border-collapse: collapse;
    color: var(--text-primary);
    font-size: .76rem;
}

.costes-hub .enrichment-execution-table th,
.costes-hub .enrichment-execution-table td {
    padding: .25rem .5rem;
    border-bottom: 1px solid var(--glass-border);
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.costes-hub .enrichment-execution-table th {
    height: 2.4rem;
    color: var(--text-secondary);
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.costes-hub .enrichment-execution-row { height: 52px; }
.costes-hub .enrichment-execution-row small { color: var(--text-secondary); }
.costes-hub .enrichment-execution-row code,
.costes-hub .enrichment-execution-details code {
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: .72rem;
}

.costes-hub .enrichment-execution-toggle,
.costes-hub .enrichment-history-link,
.costes-hub .enrichment-pagination button {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

.costes-hub .enrichment-execution-toggle {
    border: 0;
    border-radius: .5rem;
    background: transparent;
    color: var(--enrichment-accent);
}

.costes-hub .enrichment-status-chip,
.costes-hub .enrichment-quality {
    display: inline-flex;
    align-items: center;
    min-height: 1.5rem;
    padding: .15rem .45rem;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: var(--card-bg);
    font-size: .68rem;
    font-weight: 700;
}

.costes-hub .enrichment-quality--complete { color: var(--success-color, #42c991); }
.costes-hub .enrichment-quality--partial { color: var(--warning-color, #f0b85a); }
.costes-hub .enrichment-quality--unavailable { color: var(--text-secondary); }

.costes-hub .enrichment-execution-detail-row > td {
    padding: 0;
    white-space: normal;
}

.costes-hub .enrichment-execution-details {
    display: grid;
    gap: .75rem;
    padding: .8rem;
    background: var(--input-bg);
    box-shadow: inset 3px 0 0 var(--enrichment-accent);
}

.costes-hub .enrichment-execution-details__header {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.costes-hub .enrichment-execution-details__header > div {
    display: grid;
    min-width: 0;
    gap: .15rem;
}

.costes-hub .enrichment-execution-details__header span,
.costes-hub .enrichment-item-references dt {
    color: var(--text-secondary);
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.costes-hub .enrichment-execution-details__header code,
.costes-hub .enrichment-item-references code {
    overflow-wrap: anywhere;
    white-space: normal;
}

.costes-hub .enrichment-detail-feedback {
    min-height: 4rem;
    padding: 1rem;
    color: var(--text-secondary);
}

.costes-hub .enrichment-detail-feedback--error,
.costes-hub .enrichment-sanitized-error,
.costes-hub .enrichment-call-error td { color: var(--danger-color, #ef6a76); }

.costes-hub .enrichment-execution-items {
    display: grid;
    gap: .65rem;
}

.costes-hub .enrichment-execution-item {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    border-radius: .65rem;
    background: var(--card-bg);
}

.costes-hub .enrichment-execution-item__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .6rem .7rem;
    border-bottom: 1px solid var(--glass-border);
}

.costes-hub .enrichment-execution-item__header > div { display: grid; gap: .1rem; }
.costes-hub .enrichment-item-session { font-weight: 700; }
.costes-hub .enrichment-execution-item__header small { color: var(--text-secondary); }

.costes-hub .enrichment-item-references {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .55rem;
    margin: 0;
    padding: .65rem .7rem;
}

.costes-hub .enrichment-item-references > div { min-width: 0; }
.costes-hub .enrichment-item-references dd {
    margin: .12rem 0 0;
    overflow-wrap: anywhere;
    font-size: .75rem;
}

.costes-hub .enrichment-history-link {
    width: fit-content;
    gap: .35rem;
    margin: 0 .7rem .65rem;
    color: var(--enrichment-accent);
    font-size: .76rem;
    font-weight: 700;
    text-decoration: none;
}

.costes-hub .enrichment-sanitized-error {
    margin: 0 .7rem .65rem;
    padding: .5rem .6rem;
    border-inline-start: 3px solid currentColor;
    background: var(--input-bg);
    font-size: .75rem;
}

.costes-hub .enrichment-call-table {
    width: 100%;
    min-width: 82rem;
    border-collapse: collapse;
    color: var(--text-primary);
    font-size: .72rem;
}

.costes-hub .enrichment-call-table th,
.costes-hub .enrichment-call-table td {
    padding: .45rem .55rem;
    border-top: 1px solid var(--glass-border);
    text-align: right;
    white-space: nowrap;
}

.costes-hub .enrichment-call-table th {
    color: var(--text-secondary);
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.costes-hub .enrichment-call-table th:first-child,
.costes-hub .enrichment-call-table td:first-child { text-align: left; }

.costes-hub .enrichment-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .75rem .85rem;
    border-top: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: .78rem;
}

.costes-hub .enrichment-cost-tab:focus-visible,
.costes-hub .enrichment-filter-action:focus-visible,
.costes-hub .enrichment-feedback__action:focus-visible,
.costes-hub .enrichment-filter-grid input:focus-visible,
.costes-hub .enrichment-filter-grid select:focus-visible,
.costes-hub .enrichment-advanced-filters > summary:focus-visible {
    outline: 2px solid var(--enrichment-focus);
    outline-offset: 2px;
}

.costes-hub .enrichment-execution-toggle:focus-visible,
.costes-hub .enrichment-history-link:focus-visible,
.costes-hub .enrichment-execution-table-wrap:focus-visible,
.costes-hub .enrichment-call-table-wrap:focus-visible,
.costes-hub .enrichment-pagination button:focus-visible {
    outline: 2px solid var(--enrichment-focus);
    outline-offset: 2px;
}

.costes-hub .enrichment-sort-field select:focus-visible,
.costes-hub .enrichment-sort-direction:focus-visible {
    outline: 2px solid var(--enrichment-focus);
    outline-offset: 2px;
}

@media (max-width: 1199.98px) {
    .costes-hub .enrichment-filter-grid--primary,
    .costes-hub .enrichment-metric-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .costes-hub .enrichment-cost-header {
        flex-direction: column;
        gap: .65rem;
    }

    .costes-hub .enrichment-data-panel__header,
    .costes-hub .enrichment-execution-toolbar { flex-wrap: wrap; }

    .costes-hub .enrichment-filter-grid,
    .costes-hub .enrichment-filter-grid--primary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .costes-hub .enrichment-breakdown-grid { grid-template-columns: minmax(0, 1fr); }
    .costes-hub .enrichment-item-references { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 575.98px) {
    .costes-hub .enrichment-filter-grid,
    .costes-hub .enrichment-filter-grid--primary {
        grid-template-columns: minmax(0, 1fr);
    }

    .costes-hub .enrichment-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .costes-hub .enrichment-filter-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .costes-hub .enrichment-filter-action { width: 100%; }
    .costes-hub .enrichment-execution-details__header,
    .costes-hub .enrichment-item-references { grid-template-columns: minmax(0, 1fr); }
    .costes-hub .enrichment-pagination { flex-wrap: wrap; justify-content: center; }
    .costes-hub .enrichment-execution-toolbar { width: 100%; justify-content: flex-start; }
    .costes-hub .enrichment-execution-count { flex-basis: 100%; }
}
