/* ==========================================================================
   Data CFC — Componentes canônicos
   Use .ds-btn / .ds-tab / .ds-pill / .ds-card.
   Classes antigas (hl-btn, hub-tab, hub-pos-pill…) são aliases.
   ========================================================================== */

/* ---------- Botão ------------------------------------------------------- */
.ds-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ds-space-2);
    min-height: var(--ds-btn-height);
    padding: 0 var(--ds-btn-pad-x);
    border-radius: var(--ds-btn-radius);
    border: 1px solid transparent;
    background: transparent;
    color: var(--ds-ink);
    font-family: var(--ds-font-sans);
    font-size: var(--ds-btn-font);
    font-weight: var(--ds-btn-weight);
    letter-spacing: var(--ds-btn-tracking);
    text-transform: uppercase;
    text-decoration: none;
    line-height: 1;
    cursor: pointer;
    transition: background var(--ds-duration) ease, border-color var(--ds-duration) ease,
        color var(--ds-duration) ease, box-shadow var(--ds-duration) ease,
        transform var(--ds-duration-fast) ease;
}

.ds-btn:hover {
    transform: translateY(-1px);
    color: inherit;
    text-decoration: none;
}

.ds-btn:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring);
}

.ds-btn:disabled,
.ds-btn.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
}

.ds-btn-sm {
    min-height: var(--ds-btn-height-sm);
    padding: 0 var(--ds-btn-pad-x-sm);
    font-size: var(--ds-text-xs);
}

.ds-btn-lg {
    min-height: var(--ds-btn-height-lg);
    padding: 0 var(--ds-btn-pad-x-lg);
}

.ds-btn-primary {
    background: var(--ds-brand-primary);
    border-color: var(--ds-brand-primary);
    color: #fff;
    box-shadow: 0 8px 22px rgba(255, 102, 0, 0.28);
}

.ds-btn-primary:hover {
    background: var(--ds-brand-hover);
    border-color: var(--ds-brand-hover);
    color: #fff;
}

.ds-btn-ghost {
    background: transparent;
    border-color: var(--ds-border);
    color: var(--ds-ink);
}

.ds-btn-ghost:hover {
    border-color: var(--ds-brand-primary);
    color: var(--ds-ink);
}

.ds-btn-midnight {
    background: var(--ds-brand-midnight);
    border-color: var(--ds-brand-midnight);
    color: #fff;
}

.ds-btn-midnight:hover {
    background: var(--ds-brand-midnight-light);
    border-color: var(--ds-brand-midnight-light);
    color: #fff;
}

html[data-theme="dark"] .ds-btn-midnight {
    background: #e2e8f0;
    border-color: #e2e8f0;
    color: #0f172a;
}

html[data-theme="dark"] .ds-btn-midnight:hover {
    background: #f8fafc;
    border-color: #f8fafc;
    color: #0f172a;
}

.ds-btn-danger {
    background: transparent;
    border-color: var(--ds-border);
    color: var(--ds-ink);
}

.ds-btn-danger:hover {
    border-color: var(--ds-danger);
    color: var(--ds-danger-text);
    background: rgba(238, 46, 49, 0.08);
}

/* ---------- Tabs / pills (mesmo ritmo visual) --------------------------- */
.ds-tabs,
.ds-pills {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ds-pill-gap);
}

.ds-tab,
.ds-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--ds-pill-height);
    padding: 0 var(--ds-pill-pad-x);
    border-radius: var(--ds-pill-radius);
    border: 1px solid var(--ds-border);
    background: var(--ds-bg-inset);
    color: var(--ds-ink-muted);
    font-family: var(--ds-font-sans);
    font-size: var(--ds-pill-font);
    font-weight: var(--ds-weight-heavy);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    line-height: 1;
    cursor: pointer;
    transition: background var(--ds-duration) ease, border-color var(--ds-duration) ease,
        color var(--ds-duration) ease, box-shadow var(--ds-duration) ease;
}

.ds-tab {
    min-height: var(--ds-tab-height);
    padding: 0 var(--ds-tab-pad-x);
}

.ds-tab:hover,
.ds-pill:hover {
    border-color: var(--ds-brand-primary);
    color: var(--ds-ink);
    text-decoration: none;
}

.ds-tab:focus-visible,
.ds-pill:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring);
}

.ds-tab.is-active,
.ds-tab.ativo,
.ds-tab.active,
.ds-pill.is-active,
.ds-pill.ativo,
.ds-pill.active,
.ds-tab[aria-current="page"],
.ds-pill[aria-current="page"] {
    background: var(--ds-brand-primary);
    border-color: var(--ds-brand-primary);
    color: #fff;
    box-shadow: 0 2px 10px rgba(255, 102, 0, 0.28);
    cursor: default;
}

html[data-theme="dark"] .ds-tab,
html[data-theme="dark"] .ds-pill {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.16);
    color: var(--ds-ink);
}

html[data-theme="dark"] .ds-tab:hover,
html[data-theme="dark"] .ds-pill:hover {
    background: rgba(255, 102, 0, 0.14);
    border-color: var(--ds-brand-primary);
    color: #fff;
}

html[data-theme="dark"] .ds-tab.is-active,
html[data-theme="dark"] .ds-tab.ativo,
html[data-theme="dark"] .ds-tab.active,
html[data-theme="dark"] .ds-pill.is-active,
html[data-theme="dark"] .ds-pill.ativo,
html[data-theme="dark"] .ds-pill.active,
html[data-theme="dark"] .ds-tab[aria-current="page"],
html[data-theme="dark"] .ds-pill[aria-current="page"] {
    background: var(--ds-brand-primary);
    border-color: var(--ds-brand-primary);
    color: #fff;
}

/* ---------- Card -------------------------------------------------------- */
.ds-card {
    padding: var(--ds-card-pad);
    border-radius: var(--ds-card-radius);
    border: var(--ds-card-border);
    background: var(--ds-bg-elevated);
    box-shadow: var(--ds-shadow-md);
}

/* ---------- Aliases (HTML/JS legado não muda) --------------------------- */
.hl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ds-space-2);
    min-height: var(--ds-btn-height-lg);
    padding: 0 var(--ds-btn-pad-x-lg);
    border-radius: var(--ds-btn-radius);
    border: 1px solid transparent;
    font-family: var(--ds-font-sans);
    font-size: var(--ds-btn-font);
    font-weight: var(--ds-btn-weight);
    letter-spacing: var(--ds-btn-tracking);
    text-transform: uppercase;
    text-decoration: none;
    line-height: 1;
    cursor: pointer;
    transition: background var(--ds-duration) ease, border-color var(--ds-duration) ease,
        color var(--ds-duration) ease, box-shadow var(--ds-duration) ease,
        transform var(--ds-duration-fast) ease;
}

.hl-btn:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.hl-btn:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring);
}

.hl-btn-primary {
    background: var(--ds-brand-primary);
    border-color: var(--ds-brand-primary);
    color: #fff;
    box-shadow: 0 8px 22px rgba(255, 102, 0, 0.28);
}

.hl-btn-primary:hover {
    background: var(--ds-brand-hover);
    border-color: var(--ds-brand-hover);
    color: #fff;
}

.hl-btn-ghost {
    background: transparent;
    border-color: var(--ds-border);
    color: var(--ds-ink);
}

.hl-btn-ghost:hover {
    border-color: var(--ds-brand-primary);
    color: var(--ds-ink);
}

/* Gap visual only — display/flex-wrap ficam no CSS da página (dashboard etc.)
   para os @media mobile (menu colapsável, scroll horizontal) não serem anulados
   por este arquivo, que carrega depois de extra_css. */
.hub-tabs,
.hub-pos-filters,
.dash-pills {
    gap: var(--ds-pill-gap);
}

.hub-tab,
.dash-pill,
.hub-pos-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--ds-pill-height);
    padding: 0 var(--ds-pill-pad-x);
    border-radius: var(--ds-pill-radius);
    border: 1px solid var(--ds-border);
    background: var(--ds-bg-inset);
    color: var(--ds-ink-muted);
    font-family: var(--ds-font-sans);
    font-size: var(--ds-pill-font);
    font-weight: var(--ds-weight-heavy);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
    transition: background var(--ds-duration) ease, border-color var(--ds-duration) ease,
        color var(--ds-duration) ease, box-shadow var(--ds-duration) ease;
}

.hub-tab {
    min-height: var(--ds-tab-height);
}

.hub-tab:hover,
.dash-pill:hover,
.hub-pos-pill:hover {
    border-color: var(--ds-brand-primary);
    color: var(--ds-ink);
    text-decoration: none;
}

.hub-tab:focus-visible,
.dash-pill:focus-visible,
.hub-pos-pill:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring);
}

.hub-tab.ativo,
.hub-tab.active,
.hub-tab.is-active,
.dash-pill.ativo,
.dash-pill.active,
.hub-pos-pill.ativo,
.hub-pos-pill.active {
    background: var(--ds-brand-primary);
    border-color: var(--ds-brand-primary);
    color: #fff;
    box-shadow: 0 2px 10px rgba(255, 102, 0, 0.28);
}

html[data-theme="dark"] .hub-tab,
html[data-theme="dark"] .dash-pill,
html[data-theme="dark"] .hub-pos-pill {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.16);
    color: var(--ds-ink);
}

html[data-theme="dark"] .hub-tab:hover,
html[data-theme="dark"] .dash-pill:hover,
html[data-theme="dark"] .hub-pos-pill:hover {
    background: rgba(255, 102, 0, 0.14);
    border-color: var(--ds-brand-primary);
    color: #fff;
}

/* Underline tabs — inspetor Radar (não confundir com pills) */
.inspector-tabs .tab-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: auto;
    padding: 12px 0;
    border: none;
    border-radius: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--ds-ink-muted);
    font-family: var(--ds-font-sans);
    font-size: var(--ds-text-2xs);
    font-weight: var(--ds-weight-heavy);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
    transition: color var(--ds-duration) ease, background var(--ds-duration) ease,
        border-color var(--ds-duration) ease;
}

.inspector-tabs .tab-btn:hover {
    color: var(--ds-ink);
    background: var(--ds-bg-inset);
}

.inspector-tabs .tab-btn:focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring);
}

.inspector-tabs .tab-btn.active,
.inspector-tabs .tab-btn.ativo,
.inspector-tabs .tab-btn.is-active {
    color: var(--ds-brand-primary);
    border-bottom-color: var(--ds-brand-primary);
    background: var(--ds-bg-elevated);
    box-shadow: none;
}

html[data-theme="dark"] .inspector-tabs .tab-btn {
    color: var(--ds-ink-muted);
    background: transparent;
    border-color: transparent;
}

html[data-theme="dark"] .inspector-tabs .tab-btn:hover {
    color: var(--ds-ink);
    background: var(--ds-hover-surface);
}

html[data-theme="dark"] .inspector-tabs .tab-btn.active,
html[data-theme="dark"] .inspector-tabs .tab-btn.ativo,
html[data-theme="dark"] .inspector-tabs .tab-btn.is-active {
    color: var(--ds-brand-primary);
    border-bottom-color: var(--ds-brand-primary);
    background: var(--ds-bg-elevated);
}

html[data-theme="dark"] .hl-tools .hub-tab,
html[data-theme="dark"] .hl-tools .dash-pill,
html[data-theme="dark"] .hl-tools .hub-pos-pill {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.16);
    color: var(--ds-ink);
}

html[data-theme="dark"] .hl-tools .hub-tab:hover,
html[data-theme="dark"] .hl-tools .dash-pill:hover,
html[data-theme="dark"] .hl-tools .hub-pos-pill:hover {
    background: rgba(255, 102, 0, 0.14);
    border-color: var(--ds-brand-primary);
    color: #fff;
}

html[data-theme="dark"] .hl-tools .hub-tab.ativo,
html[data-theme="dark"] .hl-tools .hub-tab.active,
html[data-theme="dark"] .hl-tools .dash-pill.ativo,
html[data-theme="dark"] .hl-tools .hub-pos-pill.ativo {
    background: var(--ds-brand-primary);
    border-color: var(--ds-brand-primary);
    color: #fff;
    box-shadow: 0 2px 10px rgba(255, 102, 0, 0.28);
}

.app-btn-accent {
    background: var(--ds-brand-primary);
    border-color: var(--ds-brand-primary);
    color: #fff;
}

.app-btn-accent:hover {
    background: var(--ds-brand-hover);
    border-color: var(--ds-brand-hover);
    color: #fff;
}

.app-btn-midnight {
    background: var(--ds-brand-midnight);
    border-color: var(--ds-brand-midnight);
    color: #fff;
}

html[data-theme="dark"] .app-btn-midnight {
    background: #e2e8f0;
    border-color: #e2e8f0;
    color: #0f172a;
}

.app-btn-sair {
    background: transparent;
    border: 1.5px solid var(--ds-border);
    color: var(--ds-ink);
}

.app-btn-sair:hover {
    border-color: var(--ds-danger);
    color: var(--ds-danger-text);
    background: rgba(238, 46, 49, 0.08);
}

.btn-primary {
    background-color: var(--ds-brand-primary) !important;
    border-color: var(--ds-brand-primary) !important;
    color: #fff !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--ds-brand-hover) !important;
    border-color: var(--ds-brand-hover) !important;
    color: #fff !important;
}

.btn-primary:focus-visible {
    box-shadow: var(--ds-focus-ring) !important;
}

/* ---------- Meu Time (CTAs / chips) ------------------------------------ */
.mt-ia-btns {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-top: 6px;
    padding-bottom: 2px;
}

.mt-ia-btns .btn-otimizar-ia,
.mt-ia-btns .btn-escalacao-ia {
    width: 100%;
    min-height: 52px;
    padding: 15px 16px;
    box-sizing: border-box;
}

.btn-otimizar-ia,
.mt-upsell-pro a:not(.is-ghost),
.modal-otimizar-btn-apply {
    background: var(--ds-brand-primary) !important;
    border: 1px solid var(--ds-brand-primary) !important;
    color: #fff !important;
    box-shadow: 0 8px 22px rgba(255, 102, 0, 0.28) !important;
}

.btn-otimizar-ia:hover:not(:disabled),
.mt-upsell-pro a:not(.is-ghost):hover,
.modal-otimizar-btn-apply:hover:not(:disabled) {
    background: var(--ds-brand-hover) !important;
    border-color: var(--ds-brand-hover) !important;
    color: #fff !important;
}

.btn-escalacao-ia,
.mt-upsell-pro a.is-ghost,
.modal-otimizar-btn-cancel {
    background: rgba(255, 255, 255, 0.07) !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    color: var(--ds-ink) !important;
    box-shadow: none !important;
}

.btn-escalacao-ia:hover:not(:disabled),
.mt-upsell-pro a.is-ghost:hover,
.modal-otimizar-btn-cancel:hover {
    border-color: var(--ds-brand-primary) !important;
    color: var(--ds-ink) !important;
    background: rgba(255, 102, 0, 0.1) !important;
}

.mt-btn-enviar {
    background: var(--ds-brand-primary) !important;
    border-color: var(--ds-brand-primary) !important;
    color: #fff !important;
}

.mt-btn-enviar:hover:not(:disabled) {
    background: var(--ds-brand-hover) !important;
    border-color: var(--ds-brand-hover) !important;
}

.mt-btn-enviar.is-auth {
    background: var(--ds-success) !important;
    border-color: var(--ds-success) !important;
}

.mt-btn-sync.is-auth {
    background: var(--ds-brand-midnight) !important;
    border-color: var(--ds-brand-midnight) !important;
    color: #fff !important;
}

html[data-theme="dark"] .mt-btn-sync.is-auth {
    background: #e2e8f0 !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
}

.mt-mercado-hub-btn {
    background: var(--ds-brand-primary) !important;
    border: 1px solid var(--ds-brand-primary) !important;
    color: #fff !important;
    box-shadow: 0 8px 22px rgba(255, 102, 0, 0.28) !important;
}

.mt-mercado-hub-btn:hover {
    background: var(--ds-brand-hover) !important;
    border-color: var(--ds-brand-hover) !important;
    color: #fff !important;
}

.mt-estrategia-chip:hover,
.esc-ia-perfil:hover {
    border-color: var(--ds-brand-primary) !important;
}

.mt-estrategia-chip.is-active,
.esc-ia-perfil.is-active {
    border-color: var(--ds-brand-primary) !important;
    background: rgba(255, 102, 0, 0.14) !important;
    color: var(--ds-ink) !important;
    box-shadow: 0 0 0 1px rgba(255, 102, 0, 0.22) !important;
}

.mt-mercado-chip.active {
    background: rgba(255, 102, 0, 0.16) !important;
    border-color: var(--ds-brand-primary) !important;
    color: var(--ds-ink) !important;
}

/* Sala / hub: reforça menu colapsável e filtros após aliases do design system */
@media (max-width: 700px) {
    .hub-tabs {
        display: none;
        flex-direction: column;
        flex-wrap: nowrap;
    }
    .hub-toolbar-inner.is-nav-open .hub-tabs {
        display: flex;
    }
    .hub-pos-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .hub-pos-filters::-webkit-scrollbar {
        display: none;
    }
    .hub-pos-pill {
        flex-shrink: 0;
    }
}

