/*
  Tablero de ventas: el mismo lenguaje que el dashboard de ventas de HitOcean.
  Cada widget es una card gris; adentro, la tabla va en una hoja blanca con
  sombra leve; los números van en chips (verdes o rojos contra el objetivo).
  Sin bordes marcados: se separa con fondos.

  Todo cuelga de .ho-sales. El resumen, además, usa .ho-sales-summary para
  poner el pipeline al lado de los objetivos en pantallas anchas.
*/
.ho-sales {
    --ho-sales-card: #f3f4f8;
    --ho-sales-sheet: #ffffff;
    --ho-sales-chip: #f3f4f8;
    --ho-sales-ink: #01032d;
    --ho-sales-ink-2: #5e6180;
    --ho-sales-line: rgba(1, 3, 45, 0.1);
    --ho-sales-shadow: 0 22px 44px -24px rgba(1, 3, 45, 0.4);
    --ho-sales-ok-bg: rgba(34, 176, 125, 0.14);
    --ho-sales-ok-ink: #12805c;
    --ho-sales-bad-bg: #ffe9e3;
    --ho-sales-bad-ink: #c2412d;
}

.dark .ho-sales {
    --ho-sales-card: rgba(255, 255, 255, 0.04);
    --ho-sales-sheet: #131418;
    --ho-sales-chip: rgba(255, 255, 255, 0.06);
    --ho-sales-ink: #f7f8f8;
    --ho-sales-ink-2: #8a8f98;
    --ho-sales-line: rgba(255, 255, 255, 0.08);
    --ho-sales-shadow: 0 22px 44px -24px rgba(0, 0, 0, 0.8);
    --ho-sales-ok-bg: rgba(34, 176, 125, 0.18);
    --ho-sales-ok-ink: #5fd3a6;
    --ho-sales-bad-bg: rgba(194, 65, 45, 0.2);
    --ho-sales-bad-ink: #ff9b85;
}

/* ── Card del widget ─────────────────────────────────────────────────────── */
.ho-sales .fi-wi-table .fi-ta-ctn {
    background: var(--ho-sales-card);
    border-radius: 26px;
    padding: 1.5rem;
    box-shadow: none;
    --tw-ring-shadow: 0 0 #0000;
    overflow: visible;
}

.ho-sales .fi-wi-table .fi-ta-header {
    padding: 0 0 1rem;
    border: 0;
    background: transparent;
}

.ho-sales .fi-wi-table .fi-ta-header-heading {
    font-size: 1.35rem;
    font-weight: 500;
    letter-spacing: -0.035em;
    line-height: 1.1;
    color: var(--ho-sales-ink);
}

.ho-sales .fi-wi-table .fi-ta-header-description {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: var(--ho-sales-ink-2);
    max-width: 75ch;
}

/* ── Hoja blanca con la tabla ────────────────────────────────────────────── */
.ho-sales .fi-wi-table .fi-ta-main {
    background: transparent;
    border: 0;
}

.ho-sales .fi-wi-table .fi-ta-header-ctn {
    border: 0;
}

.ho-sales .fi-wi-table .fi-ta-content-ctn {
    background: var(--ho-sales-sheet);
    border: 0;
    border-radius: 16px;
    box-shadow: var(--ho-sales-shadow);
    padding: 0.5rem;
}

.ho-sales .fi-wi-table .fi-ta-table {
    border-collapse: separate;
    border-spacing: 0;
}

/* Líneas finas entre filas, como en el dashboard. Con border-collapse
   separate el borde del <tr> no se dibuja: va en cada celda. */
.ho-sales .fi-wi-table .fi-ta-table > :not(:last-child),
.ho-sales .fi-wi-table .fi-ta-table > tbody > :not(:last-child) {
    border-width: 0;
}

.ho-sales .fi-wi-table .fi-ta-row > .fi-ta-cell {
    border-top: 1px solid var(--ho-sales-line);
}

.ho-sales .fi-wi-table .fi-ta-header-cell {
    color: var(--ho-sales-ink-2);
    font-size: 0.75rem;
    white-space: nowrap;
}

.ho-sales .fi-wi-table .fi-ta-row:hover {
    background: transparent;
}

.ho-sales .fi-wi-table .fi-ta-text:not(.fi-inline) {
    padding-block: 0.65rem;
}

/* El nombre del deal no se aprieta: la tabla scrollea antes. */
.ho-sales .fi-wi-table .fi-ta-cell-deal {
    min-width: 16rem;
}

.ho-sales .fi-ta-cell-deal .fi-ta-col-has-column-url {
    color: inherit;
}

.ho-sales .fi-ta-cell-deal .fi-ta-col-has-column-url:hover .fi-ta-text-item {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ho-sales .fi-wi-table .fi-ta-text-description {
    font-size: 0.7rem;
    color: var(--ho-sales-ink-2);
}

.ho-sales .fi-wi-table .fi-ta-ctn .fi-ta-footer,
.ho-sales .fi-wi-table .fi-ta-ctn .fi-pagination {
    border-color: var(--ho-sales-line);
}

/* ── Chips: los números centrados de las tablas ──────────────────────────── */
.ho-sales .fi-ta-text.fi-align-center {
    align-items: center;
}

.ho-sales .fi-ta-text.fi-align-center.fi-ta-text-item,
.ho-sales .fi-ta-text.fi-align-center > .fi-ta-text-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin-inline: auto;
    min-width: 2.25rem;
    height: 2rem;
    padding: 0 0.45rem;
    border-radius: 10px;
    background: var(--ho-sales-chip);
    color: var(--ho-sales-ink);
    font-size: 0.875rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.ho-sales .fi-ta-text.fi-align-center > .fi-ta-text-item + .fi-ta-text-description {
    margin-top: 0.2rem;
}

.ho-sales .fi-ta-text.fi-align-center .fi-color-success,
.ho-sales .fi-ta-text.fi-align-center.fi-color-success {
    background: var(--ho-sales-ok-bg);
    color: var(--ho-sales-ok-ink);
}

.ho-sales .fi-ta-text.fi-align-center .fi-color-danger,
.ho-sales .fi-ta-text.fi-align-center.fi-color-danger {
    background: var(--ho-sales-bad-bg);
    color: var(--ho-sales-bad-ink);
}

/* ── Filtros del tablero: también sobre fondo gris, sin borde ────────────── */
.ho-sales .fi-page-header-widgets .fi-section,
.ho-sales > .fi-page-header-main-ctn .fi-page-main .fi-sc > .fi-section:first-child {
    background: var(--ho-sales-card);
    box-shadow: none;
    border-radius: 20px;
}

/* ── Scorecard: matriz de métricas por semana (vista propia) ─────────────── */
.ho-sales {
    --ho-sales-frame: #eef1fb;
}

.dark .ho-sales {
    --ho-sales-frame: rgba(255, 255, 255, 0.08);
}

.ho-sales .ho-sm-card {
    background: var(--ho-sales-card);
    border-radius: 26px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.ho-sales .ho-sm-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
}

.ho-sales .ho-sm-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 500;
    letter-spacing: -0.035em;
    line-height: 1.1;
    color: var(--ho-sales-ink);
}

.ho-sales .ho-sm-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    margin: 0;
    font-size: 0.75rem;
    color: var(--ho-sales-ink-2);
}

.ho-sales .ho-sm-sw {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: -1px;
}

.ho-sales .ho-sm-sw--ok { background: var(--ho-sales-ok-bg); border: 1px solid var(--ho-sales-ok-ink); }
.ho-sales .ho-sm-sw--bad { background: var(--ho-sales-bad-bg); border: 1px solid var(--ho-sales-bad-ink); }
.ho-sales .ho-sm-sw--open { border: 1px dashed var(--ho-sales-ink-2); }
.ho-sales .ho-sm-sw--none { background: var(--ho-sales-chip); border: 1px solid var(--ho-sales-line); }

.ho-sales .ho-sm-box {
    overflow-x: auto;
    background: var(--ho-sales-sheet);
    border-radius: 16px;
    box-shadow: var(--ho-sales-shadow);
    padding: 0.5rem;
}

.ho-sales .ho-sm {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-variant-numeric: tabular-nums;
}

.ho-sales .ho-sm-th {
    padding: 0.65rem 0.4rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ho-sales-ink-2);
    text-align: center;
    white-space: nowrap;
    vertical-align: bottom;
}

.ho-sales .ho-sm-td {
    padding: 0.4rem 0.2rem;
    text-align: center;
    border-top: 1px solid var(--ho-sales-line);
}

.ho-sales .ho-sm-name {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--ho-sales-sheet);
    text-align: left;
    padding-inline: 0.65rem 0.9rem;
    white-space: nowrap;
    font-weight: 500;
}

.ho-sales .ho-sm-label {
    display: block;
    font-size: 0.875rem;
    color: var(--ho-sales-ink);
}

.ho-sales .ho-sm-sub {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--ho-sales-ink-2);
}

.ho-sales .ho-sm-mes {
    border-left: 1px solid var(--ho-sales-line);
    padding-bottom: 0.25rem;
}

.ho-sales .ho-sm-sep {
    border-left: 1px solid var(--ho-sales-line);
}

.ho-sales .ho-sm-now {
    background: var(--ho-sales-frame);
}

.ho-sales .ho-sm-th.ho-sm-now {
    border-radius: 12px 12px 0 0;
    color: var(--ho-sales-ink);
}

.ho-sales .ho-sm-last .ho-sm-now {
    border-radius: 0 0 12px 12px;
}

.ho-sales .ho-sm-tot {
    background: var(--ho-sales-card);
}

.ho-sales .ho-sm-th.ho-sm-tot {
    color: var(--ho-sales-ink);
    border-radius: 12px 12px 0 0;
}

.ho-sales .ho-sm-last .ho-sm-tot {
    border-radius: 0 0 12px 12px;
}

.ho-sales .ho-sm-tot .ho-sm-chip {
    font-weight: 700;
}

.ho-sales .ho-sm-target {
    font-size: 0.8rem;
    color: var(--ho-sales-ink-2);
}

.ho-sales .ho-sm-meta {
    font-weight: 400;
    opacity: 0.75;
}

.ho-sales .ho-sm-chip {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.1rem;
    padding-inline: 0.4rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    background: var(--ho-sales-chip);
    color: var(--ho-sales-ink);
}

/* El total sin objetivo va sin chip: el número en negrita sobre la columna. */
.ho-sales .ho-sm-tot .ho-sm-chip:not(.ho-sm-chip--ok, .ho-sm-chip--bad, .ho-sm-chip--open) {
    background: transparent;
}

.ho-sales .ho-sm-chip--ok { background: var(--ho-sales-ok-bg); color: var(--ho-sales-ok-ink); }
.ho-sales .ho-sm-chip--bad { background: var(--ho-sales-bad-bg); color: var(--ho-sales-bad-ink); }
.ho-sales .ho-sm-chip--bad::after { content: "\2193"; font-size: 10px; margin-left: 3px; }
.ho-sales .ho-sm-chip--open {
    background: transparent;
    color: var(--ho-sales-ink-2);
    border: 1px dashed var(--ho-sales-ink-2);
}

.ho-sales .ho-sm-note {
    margin: 0;
    font-size: 0.8rem;
    color: var(--ho-sales-ink-2);
    max-width: 90ch;
}

.ho-sales .ho-seo-notes {
    margin-top: 0.9rem;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.35rem;
}

.ho-sales .ho-seo-warn {
    margin: 0 0 0.75rem;
    color: var(--ho-sales-bad-ink);
    font-size: 0.8rem;
}

/* ── Celdas que abren el detalle ─────────────────────────────────────────── */
.ho-sales .ho-cell-btn {
    appearance: none;
    border: 0;
    font: inherit;
    margin: 0;
    cursor: pointer;
    transition: box-shadow 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ho-sales a.ho-cell-link {
    text-decoration: none;
}

/* Un número con link toma el color del texto, salvo que esté en verde o rojo contra su objetivo. */
.ho-sales a.ho-cell-link:not(.ho-sm-chip--ok, .ho-sm-chip--bad) {
    color: inherit;
}

.ho-sales .ho-sm-chip--open.ho-cell-btn {
    border: 1px dashed var(--ho-sales-ink-2);
}

.ho-sales .ho-cell-btn:hover {
    box-shadow: 0 0 0 2px rgba(29, 41, 140, 0.25);
}

.ho-sales .ho-cell-btn:focus-visible {
    outline: 3px solid rgba(29, 41, 140, 0.12);
    outline-offset: 2px;
}

.ho-sales .ho-cell-btn.ho-cell-on {
    box-shadow: 0 0 0 2px #1d298c;
}

.dark .ho-sales .ho-cell-btn.ho-cell-on {
    box-shadow: 0 0 0 2px #c3c8ff;
}

/* ── Detalle: los deals de la celda tocada ───────────────────────────────── */
.ho-sales .ho-det {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: var(--ho-sales-sheet);
    border-radius: 16px;
    padding: 1rem;
    min-width: 0;
}

.ho-sales .ho-det-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.ho-sales .ho-det-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--ho-sales-ink);
}

.ho-sales .ho-det-close {
    appearance: none;
    border: 0;
    background: var(--ho-sales-chip);
    color: var(--ho-sales-ink);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    cursor: pointer;
}

.ho-sales .ho-det-box {
    overflow: auto;
    max-height: 380px;
    border-radius: 12px;
}

/* En el panel lateral la lista usa todo el alto. */
.ho-sales .ho-det-panel .ho-det-box {
    max-height: none;
}

.ho-sales .ho-det-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.ho-sales .ho-det-table th {
    position: sticky;
    top: 0;
    background: var(--ho-sales-card);
    text-align: left;
    font-weight: 500;
    color: var(--ho-sales-ink-2);
    padding: 0.6rem 0.85rem;
    white-space: nowrap;
}

.ho-sales .ho-det-table td {
    padding: 0.6rem 0.85rem;
    border-top: 1px solid var(--ho-sales-line);
    vertical-align: top;
    color: var(--ho-sales-ink);
}

.ho-sales .ho-det-table .ho-det-num {
    text-align: right;
    white-space: nowrap;
}

.ho-sales .ho-det-deal {
    min-width: 14rem;
}

.ho-sales .ho-det-link {
    color: #1d298c;
    text-decoration: underline;
    text-decoration-color: rgba(29, 41, 140, 0.3);
    text-underline-offset: 3px;
}

.dark .ho-sales .ho-det-link {
    color: #c3c8ff;
}

.ho-sales .ho-det-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: var(--ho-sales-chip);
    font-size: 0.75rem;
    white-space: nowrap;
}

/* Montos en chips: más anchos, alineados como números. */
.ho-sales .ho-sm-chip--wide {
    padding-inline: 0.6rem;
}

.ho-sales .ho-sm-td > .ho-sm-sub {
    margin-top: 0.2rem;
}

/* ── Funnel por cohorte: número, barra contra los leads y conversión ─────── */
.ho-sales .ho-fm-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 2px;
    min-width: 3rem;
    width: 100%;
    background: none;
    border: 0;
    border-radius: 10px;
    color: inherit;
}

.ho-sales .ho-fm-n {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1;
    color: var(--ho-sales-ink);
}

.ho-sales .ho-sm-tot .ho-fm-n {
    font-weight: 700;
}

.ho-sales .ho-fm-bar {
    display: block;
    width: 100%;
    max-width: 52px;
    height: 5px;
    border-radius: 999px;
    background: var(--ho-sales-card);
    overflow: hidden;
}

.ho-sales .ho-sm-tot .ho-fm-bar {
    background: var(--ho-sales-sheet);
}

.ho-sales .ho-fm-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: #3d5bf5;
}

.ho-sales .ho-fm-conv {
    font-size: 0.7rem;
    line-height: 1;
    min-height: 0.7rem;
    color: var(--ho-sales-ink-2);
}

.ho-sales .ho-fm-cell--open .ho-fm-n {
    color: var(--ho-sales-ink-2);
}

.ho-sales .ho-fm-cell--open .ho-fm-fill {
    opacity: 0.45;
}

.ho-sales .ho-sm-sw--bar {
    width: 16px;
    height: 5px;
    border-radius: 999px;
    background: #3d5bf5;
    vertical-align: 2px;
}

/* ── Etiquetas de etapa y canal (también en Deals, fuera del tablero) ────── */
.ho-stage {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 7px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    background: rgba(1, 3, 45, 0.06);
    color: #5e6180;
}

.ho-stage-ic {
    width: 14px;
    height: 14px;
    flex: none;
}

.ho-stage--contacto { background: #dce5ff; color: #1d298c; }
.ho-stage--reunion { background: #e4e0ff; color: #4a3fb5; }
.ho-stage--propuesta { background: #ffe8c7; color: #8a5a00; }
.ho-stage--ganado { background: rgba(34, 176, 125, 0.16); color: #12805c; }
.ho-stage--perdido { background: #fbe1ec; color: #a8325f; }
.ho-stage--trash { background: transparent; border: 1px dashed rgba(1, 3, 45, 0.25); color: #8a8ca3; }

.dark .ho-stage { background: rgba(255, 255, 255, 0.08); color: #c9ccd6; }
.dark .ho-stage--contacto { background: rgba(61, 91, 245, 0.22); color: #c3c8ff; }
.dark .ho-stage--reunion { background: rgba(101, 105, 251, 0.22); color: #d4d0ff; }
.dark .ho-stage--propuesta { background: rgba(255, 176, 32, 0.18); color: #ffd28a; }
.dark .ho-stage--ganado { background: rgba(34, 176, 125, 0.2); color: #5fd3a6; }
.dark .ho-stage--perdido { background: rgba(168, 50, 95, 0.25); color: #f4a6c4; }
.dark .ho-stage--trash { background: transparent; border-color: rgba(255, 255, 255, 0.25); color: #8a8f98; }

.ho-canal {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.ho-canal-ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    flex: none;
    color: #fff;
    background: #8a8ca3;
}

.ho-canal-ic .ho-stage-ic {
    width: 13px;
    height: 13px;
}

.ho-canal--todos .ho-canal-ic { background: #01032d; }
.ho-canal--pago .ho-canal-ic { background: #3d5bf5; }
.ho-canal--organico .ho-canal-ic { background: #22b07d; }
.ho-canal--nearbound .ho-canal-ic { background: #6569fb; }
.ho-canal--renewal .ho-canal-ic { background: #03a4e6; }
.ho-canal--upsell .ho-canal-ic { background: #b7791f; }

/* ── Filtros del tablero: botones de vista y servicio ────────────────────── */
.ho-sales .ho-filters {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.ho-sales .ho-seg {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.ho-sales .ho-seg-btn {
    appearance: none;
    border: 1px solid rgba(1, 3, 45, 0.1);
    background: var(--ho-sales-sheet);
    color: var(--ho-sales-ink);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background 250ms cubic-bezier(0.16, 1, 0.3, 1), color 250ms cubic-bezier(0.16, 1, 0.3, 1), border-color 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ho-sales .ho-seg-btn:hover {
    border-color: #1d298c;
}

.ho-sales .ho-seg-btn:focus-visible {
    outline: 3px solid rgba(29, 41, 140, 0.12);
    outline-offset: 2px;
}

.ho-sales .ho-seg-btn--on {
    background: #1d298c;
    border-color: #1d298c;
    color: #fff;
    box-shadow: 0 10px 24px -12px rgba(29, 41, 140, 0.7);
}

.ho-sales .ho-seg-btn--on .ho-canal-ic {
    background: rgba(255, 255, 255, 0.22);
}

.ho-sales .ho-seg--sm .ho-seg-btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.9rem;
}

.ho-sales .ho-filters-note {
    font-size: 0.75rem;
    color: var(--ho-sales-ink-2);
}

.ho-sales .ho-filters-busy {
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #1d298c;
}

/* Mientras cambia un filtro, los widgets se atenúan hasta que llegan los números nuevos. */
.ho-sales:has(.ho-filters[data-busy]) .fi-wi-widget {
    opacity: 0.45;
    pointer-events: none;
    transition: opacity 150ms ease;
}

.ho-sales .ho-filters[data-busy] .ho-seg-btn {
    cursor: progress;
}

.dark .ho-sales .ho-filters-busy {
    color: #c3c8ff;
}

.dark .ho-sales .ho-seg-btn {
    border-color: rgba(255, 255, 255, 0.1);
}

.dark .ho-sales .ho-seg-btn--on {
    background: #c3c8ff;
    border-color: #c3c8ff;
    color: #01032d;
}

/* ── Perdidos: números de arriba, aviso para recontactar y grilla ────────── */
.ho-sales .ho-kpis {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
}

.ho-sales .ho-kpi {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--ho-sales-sheet);
    border-radius: 20px;
    padding: 1.1rem 1.25rem;
}

.ho-sales .ho-kpi p {
    margin: 0;
}

.ho-sales .ho-kpi-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ho-sales-ink-2);
}

.ho-sales .ho-kpi-num {
    font-size: 2rem;
    font-weight: 500;
    letter-spacing: -0.045em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--ho-sales-ink);
}

.ho-sales .ho-kpi-note {
    font-size: 0.8rem;
    color: var(--ho-sales-ink-2);
}

.ho-sales .ho-kpi-note strong {
    color: var(--ho-sales-ink);
    font-weight: 500;
}

.ho-sales .ho-sm-subtitle {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--ho-sales-ink);
}

.ho-sales .ho-callout {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem 1rem;
    background: linear-gradient(160deg, #fff0db, #ffe8c7);
    border-radius: 16px;
    padding: 0.85rem 1.1rem;
    font-size: 0.875rem;
    color: #01032d;
}

.ho-sales .ho-callout strong {
    font-weight: 700;
}

.ho-sales .ho-pe .ho-fm-cell {
    min-width: 72px;
}

.ho-sales .ho-pe .ho-fm-bar {
    max-width: 96px;
}

.ho-sales .ho-pe .ho-sm-last .ho-fm-n,
.ho-sales .ho-pe .ho-sm-tot .ho-fm-n {
    font-weight: 700;
}

/* ── Resumen: qué objetivos se cumplen y cuáles mejoran ──────────────────── */
.ho-sales .ho-ws {
    max-width: 62rem;
}

/* En pantallas anchas el pipeline compacto ocupa tres quintos, al lado de los
   objetivos. Por debajo de xl Filament los apila y el resumen conserva su ancho. */
@media (min-width: 80rem) {
    .ho-sales-summary .fi-page-content .fi-sc {
        align-items: start;
    }

    .ho-sales-summary .ho-ws {
        max-width: none;
    }
}

.ho-sales .fi-wi-table .ho-pipeline-side .fi-ta-ctn {
    padding: 1rem;
}

.ho-sales .fi-wi-table .ho-pipeline-side .fi-ta-header-heading {
    font-size: 1.05rem;
}

.ho-sales .fi-wi-table .ho-pipeline-side .fi-ta-header-description {
    font-size: 0.75rem;
}

.ho-sales .fi-wi-table .ho-pipeline-side .fi-ta-cell-deal {
    min-width: 0;
}

.ho-sales .fi-wi-table .ho-pipeline-side .fi-ta-text:not(.fi-inline) {
    padding-block: 0.4rem;
}

/* Último contacto y próximo paso en el pipeline abierto. */
.ho-sales .ho-pl-contact {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    white-space: nowrap;
}

.ho-sales .ho-pl-step {
    display: flex;
    flex-direction: column;
    min-width: 0;
    white-space: normal;
    line-height: 1.3;
}

.ho-sales .ho-pl-step small {
    font-size: 0.75rem;
    color: var(--ho-sales-ink-2);
}

.ho-sales .ho-pl-none {
    color: var(--ho-sales-ink-2);
}

.ho-sales .ho-pl-missing {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    background: var(--ho-sales-bad-bg, rgba(239, 68, 68, 0.12));
    color: var(--ho-sales-bad-ink);
}

.ho-sales .ho-ws-score {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr));
}

.ho-sales .ho-ws-stat {
    appearance: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border: 0;
    border-radius: 18px;
    padding: 1rem 1.1rem;
    background: var(--ho-sales-sheet);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: box-shadow 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ho-sales .ho-ws-stat:hover {
    box-shadow: 0 0 0 2px rgba(29, 41, 140, 0.25);
}

.ho-sales .ho-ws-stat:focus-visible {
    outline: 3px solid rgba(29, 41, 140, 0.12);
    outline-offset: 2px;
}

.ho-sales .ho-ws-stat--on {
    box-shadow: 0 0 0 2px #1d298c;
}

.dark .ho-sales .ho-ws-stat--on {
    box-shadow: 0 0 0 2px #c3c8ff;
}

.ho-sales .ho-ws-filter {
    margin: 0;
    font-size: 0.8rem;
    color: var(--ho-sales-ink-2);
}

.ho-sales .ho-ws-filter button {
    appearance: none;
    border: 0;
    background: none;
    padding: 0;
    margin-left: 0.4rem;
    font: inherit;
    color: #1d298c;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.ho-sales .ho-ws-stat-num {
    display: block;
    font-size: 1.9rem;
    font-weight: 500;
    letter-spacing: -0.045em;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
    color: var(--ho-sales-ink);
}

.ho-sales .ho-ws-stat-num span {
    font-size: 1rem;
    letter-spacing: -0.02em;
    color: var(--ho-sales-ink-2);
}

.ho-sales .ho-ws-stat-label {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--ho-sales-ink-2);
}

.ho-sales .ho-ws-stat--ok { background: var(--ho-sales-ok-bg); }
.ho-sales .ho-ws-stat--ok .ho-ws-stat-num { color: var(--ho-sales-ok-ink); }
.ho-sales .ho-ws-stat--up .ho-ws-stat-num { color: var(--ho-sales-ok-ink); }
.ho-sales .ho-ws-stat--down .ho-ws-stat-num { color: var(--ho-sales-bad-ink); }

.ho-sales .ho-ws-sheet {
    overflow-x: auto;
    background: var(--ho-sales-sheet);
    border-radius: 16px;
    box-shadow: var(--ho-sales-shadow);
    padding: 0.25rem 0.75rem;
}

.ho-sales .ho-ws-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.ho-sales .ho-ws-table th,
.ho-sales .ho-ws-table td {
    padding: 0.5rem 0.4rem;
    text-align: center;
    white-space: nowrap;
}

.ho-sales .ho-ws-table thead th {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--ho-sales-ink-2);
    vertical-align: bottom;
}

.ho-sales .ho-ws-th-sub {
    display: block;
    font-weight: 400;
    opacity: 0.8;
}

.ho-sales .ho-ws-table .ho-ws-left {
    text-align: left;
}

.ho-sales .ho-ws-group {
    border-top: 1px solid var(--ho-sales-line);
}

.ho-sales .ho-ws-table .ho-ws-channel {
    padding-top: 0.85rem;
    padding-bottom: 0.15rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ho-sales-ink);
}

.ho-sales .ho-ws-table .ho-ws-metric-cell {
    padding-left: 1.25rem;
    font-weight: 400;
}

.ho-sales .ho-ws-metric {
    display: block;
    font-size: 0.85rem;
    color: var(--ho-sales-ink);
}

.ho-sales .ho-ws-target {
    display: block;
    font-size: 0.72rem;
    color: var(--ho-sales-ink-2);
}

.ho-sales .ho-ws-value {
    display: inline-flex;
    align-items: baseline;
    gap: 0.3rem;
    min-width: 3.6rem;
    justify-content: center;
    padding: 0.3rem 0.6rem;
    border-radius: 9px;
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--ho-sales-chip);
    color: var(--ho-sales-ink);
}

.ho-sales .ho-ws-value small {
    font-size: 0.7rem;
    font-weight: 500;
    opacity: 0.75;
}

.ho-sales .ho-ws-value--ok { background: var(--ho-sales-ok-bg); color: var(--ho-sales-ok-ink); }
.ho-sales .ho-ws-value--bad { background: var(--ho-sales-bad-bg); color: var(--ho-sales-bad-ink); }
.ho-sales .ho-ws-value--none { color: var(--ho-sales-ink-2); }

/* Semana en curso: punteado como en el scorecard, con el borde en un tono suave. */
.ho-sales .ho-ws-value--open {
    background: transparent;
    border: 1px dashed rgba(1, 3, 45, 0.22);
    color: var(--ho-sales-ink-2);
}

.ho-sales .ho-ws-value--open.ho-ws-value--ok {
    border-color: rgba(18, 128, 92, 0.35);
    color: var(--ho-sales-ok-ink);
}

.ho-sales .ho-ws-value--open.ho-ws-value--bad {
    border-color: rgba(194, 65, 45, 0.3);
    color: var(--ho-sales-bad-ink);
}

.dark .ho-sales .ho-ws-value--open {
    border-color: rgba(255, 255, 255, 0.2);
}

.ho-sales .ho-ws-last {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.ho-sales .ho-ws-trend {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ho-sales-ink-2);
}

.ho-sales .ho-ws-trend--up { color: var(--ho-sales-ok-ink); }
.ho-sales .ho-ws-trend--down { color: var(--ho-sales-bad-ink); }

/* ── Recorrido del deal (panel lateral) ──────────────────────────────────────
   Riel doble: las etapas en una línea continua, la actual con el punto lleno;
   adentro de cada etapa, sus interacciones en una línea punteada. Lo más
   reciente arriba en las dos. */
.ho-sales .ho-jr {
    /* Los logos van sobre blanco también en modo oscuro: así se ven sus colores. */
    --ho-jr-logo-bg: #ffffff;
    --ho-jr-chat-ink: #085041;
    --ho-jr-accent: #4f46e5;
    color: var(--ho-sales-ink);
    font-size: 0.875rem;
    line-height: 1.45;
}

.dark .ho-sales .ho-jr {
    --ho-jr-chat-ink: #085041;
    --ho-jr-accent: #818cf8;
}

.ho-sales .ho-jr-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.6rem;
}

/* El feed en su panel lateral: el chat ocupa el alto que queda del panel. */
.ho-sales .ho-jr-feed {
    color: var(--ho-sales-ink);
}

.ho-sales .ho-jr-feed-head {
    padding-bottom: 0;
}

.ho-sales .ho-jr-feed-head .ho-feed-tabs {
    margin: 0.5rem 0 0;
}

.ho-sales .ho-jr-feed .ho-feed-scroll,
.ho-jr-feed .ho-feed-scroll {
    max-height: max(20rem, calc(100dvh - 15rem));
}

.ho-sales .ho-jr-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.9rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--ho-sales-line);
}

.ho-sales .ho-jr-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.ho-sales .ho-jr-sub,
.ho-sales .ho-jr-range,
.ho-sales .ho-jr-item-meta,
.ho-sales .ho-jr-empty,
.ho-sales .ho-jr-days {
    margin: 0;
    font-size: 0.78rem;
    color: var(--ho-sales-ink-2);
}

.ho-sales .ho-jr-sub {
    margin: 0.15rem 0 0.35rem;
}

.ho-sales .ho-jr-stages {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0 0 0 1.5rem;
}

.ho-sales .ho-jr-stages::before {
    content: '';
    position: absolute;
    left: 0.4rem;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 2px;
    background: var(--ho-sales-line);
}

.ho-sales .ho-jr-stage {
    position: relative;
    padding-bottom: 1.25rem;
}

.ho-sales .ho-jr-stage:last-child {
    padding-bottom: 0;
}

.ho-sales .ho-jr-dot {
    position: absolute;
    left: -1.5rem;
    top: 0.3rem;
    width: 0.8rem;
    height: 0.8rem;
    margin-left: 0.05rem;
    border-radius: 50%;
    background: var(--ho-sales-sheet);
    border: 2px solid var(--ho-sales-ink-2);
}

.ho-sales .ho-jr-stage--current .ho-jr-dot {
    width: 0.95rem;
    height: 0.95rem;
    margin-left: -0.025rem;
    top: 0.2rem;
    background: var(--ho-jr-accent);
    border-color: var(--ho-jr-accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--ho-jr-accent) 18%, transparent);
}

.ho-sales .ho-jr-stage-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.ho-sales .ho-jr-days {
    flex: none;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    background: var(--ho-sales-chip);
}

.ho-sales .ho-jr-stage--current .ho-jr-days {
    color: var(--ho-jr-accent);
    font-weight: 600;
}

.ho-sales .ho-jr-range {
    margin-top: 0.2rem;
}

.ho-sales .ho-jr-empty {
    margin-top: 0.5rem;
    font-style: italic;
}

.ho-sales .ho-jr-items {
    list-style: none;
    margin: 0.6rem 0 0 0.15rem;
    padding: 0 0 0 0.9rem;
    border-left: 1px dashed var(--ho-sales-line);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.ho-sales .ho-jr-item {
    display: flex;
    gap: 0.6rem;
    min-width: 0;
}

.ho-sales .ho-jr-logo {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 0.4rem;
    background: var(--ho-jr-logo-bg, #ffffff);
    border: 1px solid var(--ho-sales-line);
}

.ho-sales .ho-jr-logo svg {
    width: 1rem;
    height: 1rem;
}

.ho-sales .ho-jr-logo .ho-jr-logo-fallback {
    width: 1rem;
    height: 1rem;
    color: var(--ho-jr-chat-ink, #085041);
}

.ho-sales .ho-jr-item-body {
    min-width: 0;
}

.ho-sales .ho-jr-item-title {
    overflow-wrap: anywhere;
}

.ho-sales .ho-jr-item-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.15rem;
}

.ho-sales .ho-jr-item-title a {
    color: inherit;
    text-decoration: none;
}

.ho-sales .ho-jr-item-title a:hover {
    text-decoration: underline;
}

/* ── Historial del deal como un chat (ficha del deal) ────────────────────────
   Lo nuestro a la derecha, lo del cliente a la izquierda; las etapas como
   separadores y las reuniones como tarjetas al centro. */
.ho-sales.ho-feed {
    --ho-feed-us: #eef0ff;
    --ho-feed-them: #f3f4f8;
    color: var(--ho-sales-ink);
    font-size: 0.875rem;
    line-height: 1.5;
}

.dark .ho-sales.ho-feed {
    --ho-feed-us: rgba(129, 140, 248, 0.16);
    --ho-feed-them: rgba(255, 255, 255, 0.06);
    --ho-sales-ink: #f3f4f8;
    --ho-sales-ink-2: #a7a9c0;
    --ho-sales-line: rgba(255, 255, 255, 0.1);
}

.ho-sales .ho-feed-tabs {
    margin-bottom: 0.75rem;
}

.ho-sales .ho-feed-scroll {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 48rem;
    overflow-y: auto;
    padding: 0.25rem 0.25rem 0.5rem;
}

/* En escritorio el chat entra entero en la pantalla, al lado de la card del
   deal: lo que queda del alto después del header de la página y de la card. */
@media (min-width: 80rem) {
    .ho-sales .ho-feed-scroll {
        max-height: max(20rem, calc(100dvh - 260px));
    }
}

.ho-sales .ho-feed-empty {
    color: var(--ho-sales-ink-2);
}

.ho-sales .ho-feed-day {
    align-self: center;
    margin-top: 0.4rem;
    font-size: 0.72rem;
    color: var(--ho-sales-ink-2);
    text-transform: capitalize;
}

.ho-sales .ho-feed-stage {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0.6rem 0 0.2rem;
    font-size: 0.75rem;
    color: var(--ho-sales-ink-2);
}

.ho-sales .ho-feed-stage::before,
.ho-sales .ho-feed-stage::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--ho-sales-line);
}

.ho-sales .ho-feed-row {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.ho-sales .ho-feed-row--us {
    flex-direction: row-reverse;
}

.ho-sales .ho-feed-bubble {
    max-width: min(46rem, 78%);
    min-width: 0;
    padding: 0.55rem 0.8rem;
    border-radius: 14px 14px 14px 4px;
    background: var(--ho-feed-them);
}

.ho-sales .ho-feed-row--us .ho-feed-bubble {
    border-radius: 14px 14px 4px 14px;
    background: var(--ho-feed-us);
}

.ho-sales .ho-feed-who {
    margin-bottom: 0.15rem;
    font-size: 0.72rem;
    color: var(--ho-sales-ink-2);
    overflow-wrap: anywhere;
}

.ho-sales .ho-feed-who strong {
    font-weight: 600;
    color: var(--ho-sales-ink);
}

.ho-sales .ho-feed-subject {
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.ho-sales .ho-feed-text {
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.ho-sales .ho-feed-text--clamp {
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ho-sales .ho-feed-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.35rem;
}

.ho-sales .ho-feed-actions:empty {
    display: none;
}

.ho-sales .ho-feed-event {
    align-self: center;
    width: min(100%, 44rem);
    margin: 0.2rem auto;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--ho-sales-line);
    border-radius: 14px;
    background: var(--ho-sales-sheet);
}

.dark .ho-sales .ho-feed-event {
    background: rgba(255, 255, 255, 0.03);
}

.ho-sales .ho-feed-event-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.ho-sales .ho-feed-event-title {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}

.ho-sales .ho-feed-event-title span {
    font-size: 0.72rem;
    color: var(--ho-sales-ink-2);
}

.ho-sales .ho-feed-event-body {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--ho-sales-line);
}

.ho-sales .ho-feed-summary {
    max-width: none;
    font-size: 0.85rem;
}

.ho-sales .ho-feed-summary--clamp {
    max-height: 9rem;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent);
    mask-image: linear-gradient(to bottom, #000 60%, transparent);
}

.ho-sales .ho-feed-todos {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: 0.5rem;
}

.ho-sales .ho-feed-todos li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.ho-sales .ho-feed-todos small {
    color: var(--ho-sales-ink-2);
}

.ho-sales .ho-feed-transcript {
    margin-top: 0.5rem;
}

.ho-sales .ho-feed-transcript summary {
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ho-sales-ink-2);
}

.ho-sales .ho-feed-transcript-lines {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    max-height: 28rem;
    overflow-y: auto;
    margin-top: 0.4rem;
    font-size: 0.82rem;
}

.ho-sales .ho-feed-ts {
    font-family: ui-monospace, monospace;
    font-size: 0.7rem;
    color: var(--ho-sales-ink-2);
    margin-right: 0.35rem;
}

.ho-sales .ho-feed-deal-person {
    color: #4f46e5;
}
