/**
 * Tema global — variáveis e modo escuro (html[data-theme="dark"]).
 * Carregar depois de site.css.
 */

:root {
    --header-bg: #1a2332;
    --header-border: #242d3d;
    --theme-switch-active: #ffffff;
}

/* ——— Modo escuro: paleta base (sobrescreve :root de site.css) ——— */
html[data-theme="dark"] {
    color-scheme: dark;
    --primary-color: #58a6ff;
    --secondary-color: #8b949e;
    --accent-color: #58a6ff;
    --success-color: #3fb950;
    --danger-color: #f85149;
    --background: #0d1117;
    --surface: #161b22;
    --border: #30363d;
    --border-light: #21262d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --sim-color: #3fb950;
    --nao-color: #58a6ff;
    --nao-bg: rgba(88, 166, 255, 0.08);
    --nao-bg-strong: rgba(88, 166, 255, 0.14);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.55);
    --header-bg: #0d1117;
    --header-border: #21262d;
    --theme-switch-active: #f0f6fc;
    /* KYC (kyc.css usa :root — html[data-theme] tem precedência) */
    --kyc-surface: #161b22;
    --kyc-bg: #0d1117;
    --kyc-border: #30363d;
    --kyc-text: #e6edf3;
    --kyc-muted: #8b949e;
    --kyc-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
    --kyc-shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.22);
}

html[data-theme="dark"] .btn-primary:hover {
    background: #79b8ff;
    color: #0d1117;
}

html[data-theme="dark"] .btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

html[data-theme="dark"] .btn-secondary:hover {
    background: #21262d;
}

/* Dropdown utilizador */
html[data-theme="dark"] .user-dropdown-menu {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: var(--shadow-lg);
}

html[data-theme="dark"] .user-menu-card {
    background: #21262d;
    border-color: var(--border);
    color: var(--text-primary);
}

html[data-theme="dark"] .user-menu-card:hover {
    background: #30363d;
    border-color: #484f58;
}

html[data-theme="dark"] .user-menu-card-icon {
    color: var(--text-secondary);
}

html[data-theme="dark"] .user-menu-card:hover .user-menu-card-icon {
    color: var(--text-primary);
}

html[data-theme="dark"] .user-menu-card-logout:hover {
    border-color: rgba(248, 81, 73, 0.45);
    background: rgba(248, 81, 73, 0.12);
}

html[data-theme="dark"] .user-dropdown-item {
    color: var(--text-primary);
}

html[data-theme="dark"] .user-dropdown-item:hover {
    background: #21262d;
    color: var(--text-primary);
}

html[data-theme="dark"] .user-dropdown-divider {
    background: var(--border);
}

html[data-theme="dark"] .user-dropdown-logout:hover {
    background: rgba(248, 81, 73, 0.12);
    color: #f85149;
}

/* Tooltip gamificação */
html[data-theme="dark"] .nav-badge-tooltip {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .nav-badge-tooltip::before {
    background: var(--surface);
    border-left-color: var(--border);
    border-top-color: var(--border);
}

html[data-theme="dark"] .nbt-header {
    background: #21262d;
    border-bottom-color: var(--border);
}

html[data-theme="dark"] .nbt-pts-val {
    color: var(--text-primary);
}

html[data-theme="dark"] .nbt-pts-label {
    color: var(--text-muted);
}

html[data-theme="dark"] .nbt-benefit {
    border-bottom-color: var(--border);
}

html[data-theme="dark"] .nbt-benefit-label {
    color: var(--text-secondary);
}

html[data-theme="dark"] .nbt-benefit-value {
    color: var(--text-primary);
}

html[data-theme="dark"] .nbt-next {
    background: #21262d;
    border-color: var(--border);
}

html[data-theme="dark"] .nbt-next-label {
    color: var(--text-secondary);
}

html[data-theme="dark"] .nbt-next-label strong {
    color: var(--text-primary);
}

html[data-theme="dark"] .nbt-link {
    background: #21262d;
    border-top-color: var(--border);
    color: var(--text-secondary);
}

html[data-theme="dark"] .nbt-link:hover {
    background: #30363d;
    color: var(--text-primary);
}

/* Admin breadcrumb */
html[data-theme="dark"] .admin-breadcrumb {
    color: var(--text-secondary);
}

html[data-theme="dark"] .admin-breadcrumb-current {
    color: var(--text-primary);
}

html[data-theme="dark"] .admin-breadcrumb-link {
    color: var(--accent-color);
}

/* Cards evento — fundos fixos em claro */
html[data-theme="dark"] .event-card-early-access {
    background: var(--surface);
    border-color: #d29922;
    box-shadow: 0 4px 20px rgba(210, 153, 34, 0.15);
}

html[data-theme="dark"] .event-card .event-stats .btn-follow-event,
html[data-theme="dark"] .event-card .event-stats .btn-share-card,
html[data-theme="dark"] .detail-meta-buttons .btn-follow-event,
html[data-theme="dark"] .detail-meta-buttons .btn-share-detail {
    border-color: var(--border);
}

html[data-theme="dark"] .event-card .event-stats .btn-follow-event .icon-follow svg,
html[data-theme="dark"] .detail-meta-buttons .btn-follow-event .icon-follow svg {
    stroke: var(--text-muted);
}

/* Modais / loading */
html[data-theme="dark"] .loading-detalhes-overlay {
    background: rgba(13, 17, 23, 0.85);
}

html[data-theme="dark"] .loading-detalhes-box {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

html[data-theme="dark"] .loading-detalhes-text {
    color: var(--text-secondary);
}

/* Footer — mantém leitura; ligeiro ajuste de contraste */
html[data-theme="dark"] .site-footer {
    background: #010409;
    border-top-color: var(--border);
}

html[data-theme="dark"] .footer-tagline {
    color: var(--text-secondary);
}

/* Tabelas genéricas (admin, listagens) */
html[data-theme="dark"] table.dataTable tbody tr,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .admin-table-wrap {
    color: var(--text-primary);
}

/* Inputs em páginas com fundo escuro */
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
    color: var(--text-primary);
    background: var(--surface);
    border-color: var(--border);
}

html[data-theme="dark"] select option {
    background: var(--surface);
    color: var(--text-primary);
}

/* ——— Alternador sol/lua (barra escura) ——— */
.theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 2px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.theme-switch-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: rgba(255, 255, 255, 0.42);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, background 0.15s ease;
    padding: 0;
}

.theme-switch-btn:hover {
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.08);
}

.theme-switch-btn--active {
    background: rgba(255, 255, 255, 0.16);
    color: var(--theme-switch-active);
}

.theme-switch-btn svg {
    width: 15px;
    height: 15px;
    display: block;
}

.theme-switch-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.45);
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .theme-switch {
        order: -1;
    }
}

/* ——— Admin — painel inicial (Index): cartões no tema escuro (estilo terminal / trading) ——— */
html[data-theme="dark"] .admin-panel h1 {
    color: #e6edf3;
}

html[data-theme="dark"] .admin-panel .subtitle {
    color: #8b949e;
}

html[data-theme="dark"] .admin-section-title {
    color: #8b949e;
}

html[data-theme="dark"] .admin-card {
    background: #1c2230;
    border-color: #2d3748;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .admin-card:hover {
    background: #212838;
    border-color: rgba(74, 158, 255, 0.45);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .admin-card-icon {
    color: #8b949e;
}

html[data-theme="dark"] .admin-card:hover .admin-card-icon {
    color: #58a6ff;
}

html[data-theme="dark"] .admin-card-label {
    color: #e6edf3;
}

html[data-theme="dark"] .admin-card-badge-dot {
    box-shadow: 0 0 0 2px #1c2230;
}

html[data-theme="dark"] .funil-card {
    background: #1c2230;
    border-color: #2d3748;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] a.funil-card:hover {
    background: #212838;
    border-color: rgba(74, 158, 255, 0.4);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .funil-card-label {
    color: #8b949e;
}

html[data-theme="dark"] .funil-card-value {
    color: #e6edf3;
}

html[data-theme="dark"] .funil-card-value.funil-green {
    color: #3fb950;
}

html[data-theme="dark"] .funil-card-value.funil-amber {
    color: #d29922;
}

html[data-theme="dark"] .funil-card-value.funil-red {
    color: #f85149;
}

html[data-theme="dark"] .funil-card-value.funil-blue {
    color: #58a6ff;
}

html[data-theme="dark"] .funil-card-sub {
    color: #6e7681;
}

/* Link "Ver detalhes" usa estilo inline no markup */
html[data-theme="dark"] .funil-card .funil-card-sub[style] {
    color: #58a6ff !important;
}

html[data-theme="dark"] .funil-divider {
    border-top-color: #2d3748;
}

/* ——— Admin — Usuários (lista + filtros + tabela) ——— */
html[data-theme="dark"] .usuarios-header h1 {
    color: #e6edf3;
}

html[data-theme="dark"] .usuarios-header .subtitle {
    color: #8b949e;
}

html[data-theme="dark"] .usuarios-search input {
    background: #161b22;
    border-color: #2d3748;
    color: #e6edf3;
}

html[data-theme="dark"] .usuarios-search input:focus {
    border-color: #58a6ff;
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

html[data-theme="dark"] .usuarios-stat {
    color: #8b949e;
}

html[data-theme="dark"] .usuarios-stat strong {
    color: #e6edf3;
}

html[data-theme="dark"] .usuarios-table-wrap {
    background: #1c2230;
    border-color: #2d3748;
}

html[data-theme="dark"] .usuarios-table th {
    background: #161b22;
    color: #8b949e;
    border-bottom-color: #2d3748;
}

html[data-theme="dark"] .usuarios-table td {
    color: #e6edf3;
    border-bottom-color: #21262d;
}

html[data-theme="dark"] .usuarios-table tbody tr:hover td {
    background: #212838;
}

html[data-theme="dark"] .badge-kyc-ok {
    background: rgba(63, 185, 80, 0.15);
    color: #3fb950;
}

html[data-theme="dark"] .badge-kyc-no {
    background: #21262d;
    color: #8b949e;
}

html[data-theme="dark"] .usuarios-empty {
    color: #8b949e;
}

html[data-theme="dark"] .btn-eye {
    border-color: #2d3748;
    color: #8b949e;
    background: #161b22;
}

html[data-theme="dark"] .btn-eye:hover {
    background: #21262d;
    color: #e6edf3;
}

html[data-theme="dark"] .col-email .masked,
html[data-theme="dark"] .col-saldo .masked {
    color: #484f58;
}

html[data-theme="dark"] .u-filtros {
    background: #161b22;
    border-color: #2d3748;
}

html[data-theme="dark"] .u-filtros-label {
    color: #8b949e;
}

html[data-theme="dark"] .u-filter-chip {
    background: #1c2230;
    border-color: #2d3748;
    color: #c9d1d9;
}

html[data-theme="dark"] .u-filter-chip:hover {
    background: #21262d;
    border-color: #484f58;
    color: #e6edf3;
}

html[data-theme="dark"] .u-filter-chip.is-active {
    background: #58a6ff;
    color: #0d1117;
    border-color: #58a6ff;
}

html[data-theme="dark"] .u-filter-chip.is-active:hover {
    background: #79b8ff;
    border-color: #79b8ff;
    color: #0d1117;
}

html[data-theme="dark"] .u-filtros-hint {
    color: #6e7681;
}

html[data-theme="dark"] .u-alert--ok {
    background: rgba(63, 185, 80, 0.12);
    color: #3fb950;
    border-color: rgba(63, 185, 80, 0.35);
}

html[data-theme="dark"] .u-alert--err {
    background: rgba(248, 81, 73, 0.12);
    color: #f85149;
    border-color: rgba(248, 81, 73, 0.35);
}

html[data-theme="dark"] .btn-lembrete-hist {
    background: #1c2230;
    border-color: #2d3748;
    color: #c9d1d9;
}

html[data-theme="dark"] .btn-lembrete-hist:hover {
    background: #21262d;
    border-color: #484f58;
    color: #e6edf3;
}

html[data-theme="dark"] .btn-lembrete--optout:disabled {
    border-color: #2d3748;
    color: #6e7681;
}

/* ——— Admin — Dashboard (KPIs, gráficos, faixa de período) ——— */
html[data-theme="dark"] .dash-section-title {
    color: #8b949e;
}

html[data-theme="dark"] .dash-kpi:not(.dash-kpi--dark) {
    background: #1c2230;
    border-color: #2d3748;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .dash-kpi:not(.dash-kpi--dark):hover {
    border-color: rgba(88, 166, 255, 0.35);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .dash-kpi-label {
    color: #8b949e;
}

html[data-theme="dark"] .dash-kpi:not(.dash-kpi--dark) .dash-kpi-value {
    color: #e6edf3;
}

html[data-theme="dark"] .dash-kpi:not(.dash-kpi--dark) .dash-kpi-sub {
    color: #8b949e;
}

html[data-theme="dark"] .dash-chart-card {
    background: #1c2230;
    border-color: #2d3748;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .dash-chart-card h2 {
    color: #c9d1d9;
}

html[data-theme="dark"] .dash-chart-card .dash-chart-sub {
    color: #8b949e;
}

html[data-theme="dark"] .dash-period-banner {
    background: rgba(88, 166, 255, 0.08);
    border-color: rgba(88, 166, 255, 0.25);
    color: #c9d1d9;
}

html[data-theme="dark"] .dash-period-banner strong {
    color: #e6edf3;
}

html[data-theme="dark"] .dash-footnote {
    color: #8b949e;
    border-top-color: #2d3748;
}

/* ——— Admin — grids / tabelas reutilizados em várias telas ——— */
html[data-theme="dark"] .ranking-table-wrap,
html[data-theme="dark"] .gr-table-wrap,
html[data-theme="dark"] .lembrete-hist-table-wrap,
html[data-theme="dark"] .perfis-table-wrap,
html[data-theme="dark"] .historico-table-wrap,
html[data-theme="dark"] .val-merc-table-wrap {
    background: #1c2230 !important;
    border-color: #2d3748 !important;
}

html[data-theme="dark"] .ranking-table thead th,
html[data-theme="dark"] .gr-table thead th,
html[data-theme="dark"] .lembrete-hist-table thead th,
html[data-theme="dark"] .perfis-table thead th {
    background: #161b22;
    color: #8b949e;
    border-bottom-color: #2d3748;
}

html[data-theme="dark"] .ranking-table tbody tr,
html[data-theme="dark"] .gr-table tbody tr,
html[data-theme="dark"] .lembrete-hist-table tbody tr,
html[data-theme="dark"] .perfis-table tbody tr {
    border-bottom-color: #21262d;
}

html[data-theme="dark"] .ranking-table tbody tr:hover,
html[data-theme="dark"] .gr-table tbody tr:hover,
html[data-theme="dark"] .lembrete-hist-table tbody tr:hover,
html[data-theme="dark"] .perfis-table tbody tr:hover {
    background: #212838;
}

html[data-theme="dark"] .ranking-table td,
html[data-theme="dark"] .gr-table td,
html[data-theme="dark"] .lembrete-hist-table td,
html[data-theme="dark"] .perfis-table td {
    color: #e6edf3;
}

html[data-theme="dark"] .ranking-empty {
    background: #161b22;
    color: #8b949e;
}

html[data-theme="dark"] .ranking-tab-label {
    background: #161b22;
    color: #8b949e;
}

html[data-theme="dark"] .ranking-tab-label:hover {
    color: #e6edf3;
    background: #21262d;
}

html[data-theme="dark"] #tab-participacoes:checked ~ .ranking-tab-labels label[for="tab-participacoes"],
html[data-theme="dark"] #tab-ganhos:checked ~ .ranking-tab-labels label[for="tab-ganhos"] {
    color: #e6edf3;
    background: #1c2230;
    border-bottom-color: #1c2230;
}

html[data-theme="dark"] .ranking-pos {
    color: #8b949e;
}

html[data-theme="dark"] .ranking-email {
    color: #8b949e;
}

/* Admin /Ranking — valor “ganho” nos cartões (mobile) */
html[data-theme="dark"] .ranking-card-stat-value-ganho {
    color: #3fb950 !important;
}

/* admin-container: títulos de página em fundo escuro */
html[data-theme="dark"] .admin-container .page-header h1,
html[data-theme="dark"] main .admin-container h1 {
    color: #e6edf3;
}

html[data-theme="dark"] .admin-container .subtitle,
html[data-theme="dark"] main .admin-container .subtitle {
    color: #8b949e;
}

/* ——— Admin — Gamificação / ranking (cards de stats, pills, modal) ——— */
html[data-theme="dark"] .gr-stat {
    background: #1c2230 !important;
    border-color: #2d3748 !important;
}

html[data-theme="dark"] .gr-stat-label {
    color: #8b949e;
}

html[data-theme="dark"] .gr-stat-value {
    color: #e6edf3;
}

html[data-theme="dark"] .gr-stat-sub {
    color: #8b949e;
}

html[data-theme="dark"] .gr-nome {
    color: #e6edf3;
}

html[data-theme="dark"] .gr-email {
    color: #8b949e;
}

html[data-theme="dark"] .gr-pontos {
    color: #e6edf3;
}

html[data-theme="dark"] .gr-pos {
    background: #21262d;
    color: #8b949e;
}

html[data-theme="dark"] .gr-pos.top1 {
    background: rgba(210, 153, 34, 0.2);
    color: #d29922;
}

html[data-theme="dark"] .gr-pos.top2 {
    background: #21262d;
    color: #c9d1d9;
}

html[data-theme="dark"] .gr-pos.top3 {
    background: rgba(210, 153, 34, 0.15);
    color: #d29922;
}

html[data-theme="dark"] .gr-lvl-pill {
    background: #1c2230;
    border-color: #2d3748;
}

html[data-theme="dark"] .gr-lvl-pill strong {
    color: #e6edf3;
}

html[data-theme="dark"] .gr-empty {
    color: #8b949e;
}

html[data-theme="dark"] .gr-btn-detalhes {
    background: #161b22;
    border-color: #2d3748;
    color: #c9d1d9;
}

html[data-theme="dark"] .gr-btn-detalhes:hover {
    background: #21262d;
    border-color: #484f58;
}

html[data-theme="dark"] .gr-card {
    background: #1c2230;
    border-color: #2d3748;
}

html[data-theme="dark"] .gr-card-metric {
    background: #161b22;
}

html[data-theme="dark"] .gr-card-metric-label {
    color: #8b949e;
}

html[data-theme="dark"] .gr-card-metric-val {
    color: #e6edf3;
}

html[data-theme="dark"] .gr-card-metric-val.gr-ind {
    color: #e6edf3;
}

html[data-theme="dark"] .gr-modal {
    background: #1c2230;
    border: 1px solid #2d3748;
}

html[data-theme="dark"] .gr-modal-head {
    border-bottom-color: #2d3748;
}

html[data-theme="dark"] .gr-modal-head h2 {
    color: #e6edf3;
}

html[data-theme="dark"] .gr-modal-body {
    color: #c9d1d9;
}

html[data-theme="dark"] .gr-detalhes-resumo {
    background: #161b22;
    border-color: #2d3748;
    color: #c9d1d9;
}

html[data-theme="dark"] .gr-detalhes-resumo strong {
    color: #e6edf3;
}

html[data-theme="dark"] .gr-detalhes-tbl th {
    background: #161b22;
    color: #8b949e;
    border-bottom-color: #2d3748;
}

html[data-theme="dark"] .gr-detalhes-tbl td {
    border-color: #21262d;
    color: #e6edf3;
}

/* ——— Admin — Perfis (painéis e alertas) ——— */
html[data-theme="dark"] .perfis-alert-success {
    background: rgba(63, 185, 80, 0.12);
    color: #3fb950;
}

html[data-theme="dark"] .perfis-alert-erro {
    background: rgba(248, 81, 73, 0.12);
    color: #f85149;
}

html[data-theme="dark"] .perfis-add-section {
    background: rgba(88, 166, 255, 0.08);
    border-color: rgba(88, 166, 255, 0.25);
}

html[data-theme="dark"] .perfis-add-title {
    color: #58a6ff;
}

html[data-theme="dark"] .perfis-add-desc {
    color: #8b949e;
}

html[data-theme="dark"] .perfis-empty {
    background: #161b22;
    color: #8b949e;
}

html[data-theme="dark"] .perfis-user-email {
    color: #8b949e;
}

html[data-theme="dark"] .perfis-table tbody td {
    border-bottom-color: #21262d;
}

/* ——— Admin — Histórico lembretes + Aprovar cadastros (tabelas) ——— */
html[data-theme="dark"] .lembrete-hist-header h1 {
    color: #e6edf3;
}

html[data-theme="dark"] .lembrete-hist-header .subtitle {
    color: #8b949e;
}

html[data-theme="dark"] .lembrete-hist-card {
    background: #1c2230;
    border-color: #2d3748;
}

html[data-theme="dark"] .lembrete-hist-card h2 {
    color: #8b949e;
}

html[data-theme="dark"] .lembrete-hist-optout-ok {
    background: rgba(63, 185, 80, 0.12);
    color: #3fb950;
    border-color: rgba(63, 185, 80, 0.35);
}

html[data-theme="dark"] .lembrete-hist-optout-no {
    color: #8b949e;
}

html[data-theme="dark"] .lembrete-hist-table td {
    color: #c9d1d9;
    border-bottom-color: #21262d;
}

html[data-theme="dark"] .lembrete-hist-table .col-data,
html[data-theme="dark"] .lembrete-hist-table .col-tit {
    color: #e6edf3;
}

html[data-theme="dark"] .lembrete-hist-empty {
    color: #8b949e;
}

html[data-theme="dark"] .lembrete-hist-hint {
    color: #6e7681;
}

html[data-theme="dark"] .historico-table-wrap {
    background: #1c2230;
    border-color: #2d3748;
}

html[data-theme="dark"] .table-historico thead th {
    background: #161b22;
    color: #8b949e;
    border-bottom-color: #2d3748;
}

html[data-theme="dark"] .table-historico tbody tr {
    border-bottom-color: #21262d;
}

html[data-theme="dark"] .table-historico tbody tr:hover {
    background: #212838;
}

html[data-theme="dark"] .table-historico tbody td {
    color: #c9d1d9;
}

html[data-theme="dark"] .table-historico .historico-nome {
    color: #e6edf3;
}

html[data-theme="dark"] .table-historico .historico-email {
    color: #8b949e;
}

/* Alerta SMTP inline na lista de usuários */
html[data-theme="dark"] .u-alert[style*="fffbeb"],
html[data-theme="dark"] .u-alert[style*="#fffbeb"] {
    background: rgba(210, 153, 34, 0.12) !important;
    color: #d29922 !important;
    border-color: rgba(210, 153, 34, 0.35) !important;
}

/* ——— Admin — Validação de mercado (tabelas, cards, painéis) ——— */
html[data-theme="dark"] .val-merc-table th {
    background: #161b22;
    color: #c9d1d9;
    border-bottom-color: #2d3748;
}

html[data-theme="dark"] .val-merc-table td {
    color: #e6edf3;
    border-bottom-color: #21262d;
}

html[data-theme="dark"] .val-merc-table .ok {
    color: #3fb950;
}

html[data-theme="dark"] .val-merc-table .warn {
    color: #d29922;
}

html[data-theme="dark"] .val-merc-table .bad {
    color: #f85149;
}

html[data-theme="dark"] .val-merc-h2 {
    color: #e6edf3;
}

html[data-theme="dark"] .val-merc-meta {
    color: #8b949e;
}

html[data-theme="dark"] .val-merc-como-ler {
    background: #161b22;
    border-color: #2d3748;
}

html[data-theme="dark"] .val-merc-como-ler[open] > summary {
    background: #21262d;
    border-bottom-color: #2d3748;
}

html[data-theme="dark"] .val-merc-como-ler > summary {
    color: #c9d1d9;
}

html[data-theme="dark"] .val-merc-info {
    color: #8b949e;
}

html[data-theme="dark"] .val-merc-info strong {
    color: #e6edf3;
}

html[data-theme="dark"] .val-merc-card {
    background: #1c2230;
    border-color: #2d3748;
}

html[data-theme="dark"] .val-merc-card:hover {
    border-color: #484f58;
}

html[data-theme="dark"] .val-merc-card-eid {
    color: #e6edf3;
}

html[data-theme="dark"] .val-merc-card-pergunta {
    color: #c9d1d9;
}

html[data-theme="dark"] .val-merc-card-arrecadado {
    background: #161b22;
}

html[data-theme="dark"] .val-merc-resumo {
    background: #161b22;
    border-color: #2d3748;
}

html[data-theme="dark"] .val-merc-resumo h3 {
    color: #e6edf3;
}

html[data-theme="dark"] .val-merc-resumo-grid {
    color: #c9d1d9;
}

html[data-theme="dark"] .val-merc-resumo-row {
    border-bottom-color: #2d3748;
}

html[data-theme="dark"] .val-merc-resumo-destaque {
    background: #1c2230;
    border-color: #2d3748;
}

html[data-theme="dark"] .val-merc-badge {
    background: #1c2230;
    border-color: #2d3748;
    color: #c9d1d9;
}

html[data-theme="dark"] .val-merc-badge:hover {
    border-color: #484f58;
    color: #e6edf3;
}

html[data-theme="dark"] .val-merc-form label {
    color: #8b949e;
}

html[data-theme="dark"] .val-merc-form select {
    background: #161b22;
    border-color: #2d3748;
    color: #e6edf3;
}

/* ——— Admin: páginas com estilos inline / fundos claros ——— */

/* Hover em células (views definem tr:hover td com fundo claro — ganha do tr:hover genérico) */
html[data-theme="dark"] .gr-table tbody tr:hover td,
html[data-theme="dark"] .ranking-table tbody tr:hover td,
html[data-theme="dark"] .sol-table tr:hover td {
    background: #212838 !important;
    color: #e6edf3 !important;
}

/* Categorias */
html[data-theme="dark"] .admin-categorias-wrap h1,
html[data-theme="dark"] .admin-cat-nome {
    color: #e6edf3 !important;
}
html[data-theme="dark"] .admin-categorias-wrap .subtitle,
html[data-theme="dark"] .admin-cat-hint {
    color: #8b949e !important;
}
html[data-theme="dark"] .admin-cat-table {
    background: #1c2230 !important;
    border-color: #2d3748 !important;
}
html[data-theme="dark"] .admin-cat-table th {
    background: #161b22 !important;
    color: #8b949e !important;
    border-bottom-color: #21262d !important;
}
html[data-theme="dark"] .admin-cat-table td {
    border-bottom-color: #21262d !important;
    color: #e6edf3 !important;
}
html[data-theme="dark"] .admin-cat-ic-preview {
    background: #21262d !important;
    color: #c9d1d9 !important;
}
html[data-theme="dark"] .admin-cat-icon-tile {
    border-color: #30363d !important;
    background: #161b22 !important;
    color: #c9d1d9 !important;
}
html[data-theme="dark"] .admin-cat-icon-tile:hover {
    border-color: #484f58 !important;
    background: #21262d !important;
}
html[data-theme="dark"] .admin-cat-icon-tile:has(input:checked) {
    border-color: #3b82f6 !important;
    background: #1a2332 !important;
    color: #79b8ff !important;
}

/* Contatos — chips: hover não pode sobrepor .is-active (count ilegível) */
html[data-theme="dark"] .contato-list-chip:not(.is-active) {
    background: #21262d !important;
    border-color: #30363d !important;
    color: #c9d1d9 !important;
}
html[data-theme="dark"] .contato-list-chip:not(.is-active):hover {
    background: #30363d !important;
    border-color: #484f58 !important;
    color: #e6edf3 !important;
}
html[data-theme="dark"] .contato-list-chip.is-active:hover {
    background: #0f172a !important;
    border-color: #0f172a !important;
    color: #fff !important;
}
html[data-theme="dark"] .contato-list-chip.is-active:hover .contato-list-chip-count {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
}
html[data-theme="dark"] .contato-list-chip-count {
    background: #30363d !important;
    color: #c9d1d9 !important;
}
html[data-theme="dark"] .contato-list-empty {
    background: #161b22 !important;
    border-color: #30363d !important;
    color: #8b949e !important;
}
html[data-theme="dark"] .contato-list-table thead th {
    background: #161b22 !important;
    color: #8b949e !important;
}
html[data-theme="dark"] .contato-list-table tbody tr:hover,
html[data-theme="dark"] .contato-list-table tbody tr:hover td {
    background: #212838 !important;
}
html[data-theme="dark"] .contato-list-table td {
    color: #e6edf3 !important;
}
html[data-theme="dark"] .contato-list-card {
    background: #1c2230 !important;
    border-color: #2d3748 !important;
}
html[data-theme="dark"] .contato-list-card-nome {
    color: #e6edf3 !important;
}
html[data-theme="dark"] .contato-list-preview-val {
    color: #c9d1d9 !important;
}

/* Solicitações de melhoria */
html[data-theme="dark"] .sol-chip:not(.sol-chip--active) {
    background: #21262d !important;
    border-color: #30363d !important;
    color: #c9d1d9 !important;
}
html[data-theme="dark"] .sol-chip:not(.sol-chip--active):hover {
    background: #30363d !important;
    border-color: #484f58 !important;
    color: #e6edf3 !important;
}
html[data-theme="dark"] .sol-table-wrap {
    background: #1c2230 !important;
    border-color: #2d3748 !important;
}
html[data-theme="dark"] .sol-table th {
    background: #161b22 !important;
    color: #8b949e !important;
    border-bottom-color: #2d3748 !important;
}
html[data-theme="dark"] .sol-table td {
    border-bottom-color: #21262d !important;
    color: #e6edf3 !important;
}

/* KYC admin (kyc.css) */
html[data-theme="dark"] .kyc-admin-page {
    color: #e6edf3;
}
html[data-theme="dark"] .kyc-admin-header {
    border-bottom-color: #2d3748;
}
html[data-theme="dark"] .kyc-admin-title,
html[data-theme="dark"] .kyc-admin-metric-value,
html[data-theme="dark"] .kyc-admin-panel-title,
html[data-theme="dark"] .kyc-admin-dl dd {
    color: #e6edf3 !important;
}
html[data-theme="dark"] .kyc-admin-subtitle,
html[data-theme="dark"] .kyc-admin-metric-label,
html[data-theme="dark"] .kyc-admin-filter-label,
html[data-theme="dark"] .kyc-admin-hint,
html[data-theme="dark"] .kyc-admin-empty,
html[data-theme="dark"] .kyc-admin-lgpd-hint,
html[data-theme="dark"] .kyc-admin-card-meta {
    color: #8b949e !important;
}
html[data-theme="dark"] .kyc-admin-metric {
    background: #1c2230 !important;
    border-color: #2d3748 !important;
}
html[data-theme="dark"] .kyc-admin-tabs {
    background: #161b22;
    border-color: #2d3748;
}
html[data-theme="dark"] .kyc-admin-tab {
    background: #161b22 !important;
    border-color: #2d3748 !important;
    color: #c9d1d9 !important;
}
html[data-theme="dark"] .kyc-admin-tab:hover {
    background: #21262d !important;
    color: #e6edf3 !important;
}
html[data-theme="dark"] .kyc-admin-tab.is-active {
    background: #1c2230 !important;
    color: #e6edf3 !important;
}
html[data-theme="dark"] .kyc-admin-input,
html[data-theme="dark"] .kyc-admin-select,
html[data-theme="dark"] .kyc-admin-textarea {
    background: #0d1117 !important;
    border-color: #30363d !important;
    color: #e6edf3 !important;
}
html[data-theme="dark"] .kyc-admin-filters {
    background: #161b22;
    border-color: #2d3748;
}
html[data-theme="dark"] .kyc-admin-card {
    background: #1c2230 !important;
    border-color: #2d3748 !important;
}
html[data-theme="dark"] .kyc-admin-panel--cadastro {
    background: #161b22 !important;
    border: 1px solid #2d3748 !important;
}
html[data-theme="dark"] .kyc-admin-panel--docs {
    background: #161b22 !important;
    border: 1px solid #2d3748 !important;
}
html[data-theme="dark"] .kyc-admin-panel-note,
html[data-theme="dark"] .kyc-admin-docs-meta {
    color: #8b949e !important;
}
html[data-theme="dark"] .kyc-admin-actions {
    border-top-color: #2d3748 !important;
}
html[data-theme="dark"] .kyc-admin-dl dt {
    color: #8b949e !important;
}

/* Eventos encerrados (lista) */
html[data-theme="dark"] .ee-row {
    background: #1c2230 !important;
    border-color: #2d3748 !important;
}
html[data-theme="dark"] .ee-row:hover {
    background: #212838 !important;
    border-color: #484f58 !important;
}
html[data-theme="dark"] .ee-perg,
html[data-theme="dark"] .ee-val {
    color: #e6edf3 !important;
}
html[data-theme="dark"] .ee-id,
html[data-theme="dark"] .ee-row-meta {
    color: #8b949e !important;
}

/* Evento encerrado — detalhe (inline em .ee-kpi e tabela) */
html[data-theme="dark"] .ee-kpi {
    background: #1c2230 !important;
    border-color: #2d3748 !important;
}
html[data-theme="dark"] .ee-kpi div[style*="64748B"],
html[data-theme="dark"] .ee-kpi div[style*="94A3B8"] {
    color: #8b949e !important;
}
html[data-theme="dark"] .ee-kpi div[style*="0F172A"],
html[data-theme="dark"] .ee-kpi div[style*="0f172a"] {
    color: #e6edf3 !important;
}
html[data-theme="dark"] .admin-container div:has(> table.ee-user-table) {
    background: #1c2230 !important;
    border-color: #2d3748 !important;
}
html[data-theme="dark"] table.ee-user-table thead tr th {
    background: #161b22 !important;
    color: #8b949e !important;
}
html[data-theme="dark"] table.ee-user-table tbody tr td {
    color: #e6edf3 !important;
    border-color: #21262d !important;
}
html[data-theme="dark"] table.ee-user-table tbody tr {
    border-color: #21262d !important;
}

/* Próximos encerramentos */
html[data-theme="dark"] .proximos-enc-chip:not(.proximos-enc-chip-active) {
    background: #21262d !important;
    border-color: #30363d !important;
    color: #c9d1d9 !important;
}
html[data-theme="dark"] .proximos-enc-chip:not(.proximos-enc-chip-active):hover {
    background: #30363d !important;
    color: #e6edf3 !important;
}
html[data-theme="dark"] .proximos-enc-card {
    background: #1c2230 !important;
    border-color: #2d3748 !important;
}
html[data-theme="dark"] .proximos-enc-pergunta {
    color: #e6edf3 !important;
}
html[data-theme="dark"] .proximos-enc-meta,
html[data-theme="dark"] .proximos-enc-restante {
    color: #8b949e !important;
}
html[data-theme="dark"] .proximos-enc-lembrete-card,
html[data-theme="dark"] .proximos-enc-modal-panel {
    background: #1c2230 !important;
    border-color: #2d3748 !important;
}
html[data-theme="dark"] .proximos-enc-lembrete-title,
html[data-theme="dark"] .proximos-enc-h3 {
    color: #e6edf3 !important;
}
html[data-theme="dark"] .proximos-enc-lembrete-desc,
html[data-theme="dark"] .proximos-enc-hint {
    color: #8b949e !important;
}
html[data-theme="dark"] .proximos-enc-input-num,
html[data-theme="dark"] .proximos-enc-input-email,
html[data-theme="dark"] .proximos-enc-btn-sm {
    background: #0d1117 !important;
    border-color: #30363d !important;
    color: #e6edf3 !important;
}
html[data-theme="dark"] .proximos-enc-email-item {
    background: #161b22 !important;
    border-color: #2d3748 !important;
}
html[data-theme="dark"] .proximos-enc-hint code {
    background: #21262d !important;
    color: #c9d1d9 !important;
}
html[data-theme="dark"] .proximos-enc-modal-backdrop {
    background: rgba(0, 0, 0, 0.65) !important;
}

/* Encerrar eventos */
html[data-theme="dark"] .encerrar-evento-card {
    background: #1c2230 !important;
    border-color: #2d3748 !important;
}
html[data-theme="dark"] .encerrar-evento-pergunta {
    color: #e6edf3 !important;
}
html[data-theme="dark"] .encerrar-evento-meta {
    color: #8b949e !important;
}
html[data-theme="dark"] .encerrar-evento-cat {
    background: #30363d !important;
    color: #c9d1d9 !important;
}

/* Participações */
html[data-theme="dark"] .partic-resumo-card {
    background: #1c2230 !important;
    border-color: #2d3748 !important;
}
html[data-theme="dark"] .partic-contrato-card {
    background: #1c2230 !important;
    border-color: #2d3748 !important;
}
html[data-theme="dark"] .partic-contrato-summary:hover {
    background: #212838 !important;
}
html[data-theme="dark"] .partic-contrato-pergunta {
    color: #e6edf3 !important;
}
html[data-theme="dark"] .partic-contrato-meta {
    color: #8b949e !important;
}
html[data-theme="dark"] .partic-contrato-body {
    background: #161b22 !important;
    border-top-color: #2d3748 !important;
}

html[data-theme="dark"] .partic-aposta-card {
    background: #1c2230 !important;
    border-color: #2d3748 !important;
}

html[data-theme="dark"] .partic-aposta-metric {
    background: #161b22 !important;
}

html[data-theme="dark"] .partic-aposta-inline-label,
html[data-theme="dark"] .partic-aposta-metric-label {
    color: #8b949e !important;
}

html[data-theme="dark"] .partic-aposta-metric-val {
    color: #e6edf3 !important;
}

html[data-theme="dark"] .partic-table thead th {
    background: #161b22 !important;
    color: #8b949e !important;
    border-bottom-color: #2d3748 !important;
}
html[data-theme="dark"] .partic-table tbody tr {
    border-bottom-color: #21262d !important;
}
html[data-theme="dark"] .partic-table tbody tr:hover,
html[data-theme="dark"] .partic-table tbody tr:hover td {
    background: #212838 !important;
}
html[data-theme="dark"] .partic-table td {
    color: #e6edf3 !important;
}
html[data-theme="dark"] .partic-opcao-nome,
html[data-theme="dark"] .partic-num,
html[data-theme="dark"] .partic-data {
    color: #8b949e !important;
}

/* Gamificação — pirâmide */
html[data-theme="dark"] .gp-stat {
    background: #1c2230 !important;
    border-color: #2d3748 !important;
}
html[data-theme="dark"] .gp-stat-value,
html[data-theme="dark"] .gp-section h2,
html[data-theme="dark"] .gp-node-nome {
    color: #e6edf3 !important;
}
html[data-theme="dark"] .gp-section-desc,
html[data-theme="dark"] .gp-node-meta,
html[data-theme="dark"] .gp-stat-label {
    color: #8b949e !important;
}
html[data-theme="dark"] .gp-node {
    background: #161b22 !important;
    border-color: #2d3748 !important;
}
html[data-theme="dark"] .gp-node-meta code {
    background: #21262d !important;
    color: #c9d1d9 !important;
}

html[data-theme="dark"] .gp-tree-children {
    border-left-color: #30363d !important;
}

html[data-theme="dark"] .gp-tree-item:before {
    background: #30363d !important;
}

html[data-theme="dark"] .gp-node-badge {
    background: #1a2332 !important;
    color: #79b8ff !important;
}

html[data-theme="dark"] .gp-warn {
    background: rgba(187, 128, 9, 0.18) !important;
    border-color: #9e6a03 !important;
    color: #e3b341 !important;
}

html[data-theme="dark"] .gp-nav a {
    color: #58a6ff !important;
}

html[data-theme="dark"] .gp-empty {
    color: #8b949e !important;
}

/* Pagamentos */
html[data-theme="dark"] .dashboard-container .dashboard-header h1 {
    color: #e6edf3 !important;
}
html[data-theme="dark"] .dashboard-container .dashboard-header p {
    color: #8b949e !important;
}
html[data-theme="dark"] .dashboard-container .stat-card {
    background: #1c2230 !important;
    border-color: #2d3748 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35) !important;
}
html[data-theme="dark"] .dashboard-container .stat-value {
    color: #e6edf3 !important;
}
html[data-theme="dark"] .dashboard-container .stat-label,
html[data-theme="dark"] .dashboard-container .stat-meta {
    color: #8b949e !important;
}
html[data-theme="dark"] .dashboard-container .transactions-section {
    background: #1c2230 !important;
    border-color: #2d3748 !important;
}
html[data-theme="dark"] .dashboard-container .section-title {
    color: #e6edf3 !important;
}
html[data-theme="dark"] .dashboard-container .section-header {
    border-bottom-color: #2d3748 !important;
}
html[data-theme="dark"] .dashboard-container .filter-tab:not(.active) {
    background: #21262d !important;
    color: #8b949e !important;
}
html[data-theme="dark"] .dashboard-container .filter-tab:not(.active):hover {
    background: #30363d !important;
    color: #e6edf3 !important;
}
html[data-theme="dark"] .dashboard-container .transactions-table thead th {
    color: #8b949e !important;
    border-bottom-color: #2d3748 !important;
}
html[data-theme="dark"] .dashboard-container .transactions-table tbody tr:hover,
html[data-theme="dark"] .dashboard-container .transactions-table tbody tr:hover td {
    background: #212838 !important;
}
html[data-theme="dark"] .dashboard-container .transactions-table tbody td {
    color: #e6edf3 !important;
}
html[data-theme="dark"] .dashboard-container .pagamento-card {
    background: #1c2230 !important;
    border-color: #2d3748 !important;
}
html[data-theme="dark"] .dashboard-container .user-name {
    color: #e6edf3 !important;
}
html[data-theme="dark"] .dashboard-container .pagamento-card-stat-value {
    color: #c9d1d9 !important;
}

/* Cards genéricos só em Admin (views .card + .card-body) — Convites define .card inline depois do tema */
html[data-theme="dark"] .card {
    background: #1c2230 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35) !important;
    color: #e6edf3 !important;
}

html[data-theme="dark"] .card-body {
    color: inherit;
}

html[data-theme="dark"] .admin-header h1,
html[data-theme="dark"] .admin-header p {
    color: #e6edf3 !important;
}

html[data-theme="dark"] .admin-header p[style*="#64748B"],
html[data-theme="dark"] .admin-header p[style*="color:#64748B"] {
    color: #8b949e !important;
}

/* ——— Home: sidebar de categorias (minimalista, modo escuro) ——— */
html[data-theme="dark"] .index-category-sidebar {
    scrollbar-color: #30363d transparent;
}

html[data-theme="dark"] .index-sidebar-inner {
    border-right-color: var(--border);
    padding-top: 4px;
}

html[data-theme="dark"] .index-sidebar-toplinks {
    gap: 6px;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom-color: var(--border);
}

html[data-theme="dark"] .index-sidebar-nav {
    gap: 6px;
    margin-bottom: 8px;
}

html[data-theme="dark"] .index-sidebar-toplink,
html[data-theme="dark"] .index-sidebar-link {
    padding: 10px 12px;
    border-radius: 12px;
    border: none;
    box-shadow: none;
    color: #c9d1d9;
    font-weight: 500;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

html[data-theme="dark"] .index-sidebar-toplink:hover,
html[data-theme="dark"] .index-sidebar-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #f0f6fc;
    border-color: transparent;
    box-shadow: none;
}

html[data-theme="dark"] .index-sidebar-link.active {
    background: rgba(88, 166, 255, 0.12);
    color: #79b8ff;
    border: none;
    box-shadow: none;
    font-weight: 600;
}

html[data-theme="dark"] .index-sidebar-link.active:hover {
    background: rgba(88, 166, 255, 0.16);
    color: #a5d6ff;
}

/* Ícones: flat, sem “rim” claro / vidro */
html[data-theme="dark"] .index-sidebar-icon,
html[data-theme="dark"] .index-sidebar-icon--cat {
    background: rgba(255, 255, 255, 0.055);
    box-shadow: none;
    color: #8b949e;
    border-radius: 10px;
    transition: background 0.18s ease, color 0.18s ease;
}

html[data-theme="dark"] .index-sidebar-toplink:hover .index-sidebar-icon,
html[data-theme="dark"] .index-sidebar-link:hover .index-sidebar-icon {
    background: rgba(255, 255, 255, 0.1);
    color: #79b8ff;
    box-shadow: none;
}

html[data-theme="dark"] .index-sidebar-link.active .index-sidebar-icon {
    background: rgba(88, 166, 255, 0.22);
    color: #79b8ff;
    box-shadow: none;
}

html[data-theme="dark"] .index-sidebar-section-title {
    color: #6e7681;
    margin: 0 0 12px;
    letter-spacing: 0.09em;
    font-weight: 600;
}

html[data-theme="dark"] .index-sidebar-section-title__icon {
    background: rgba(88, 166, 255, 0.12);
    color: #58a6ff;
    box-shadow: none;
    border-radius: 9px;
}

html[data-theme="dark"] .index-sidebar-toplink:focus-visible,
html[data-theme="dark"] .index-sidebar-link:focus-visible {
    outline: 2px solid rgba(88, 166, 255, 0.45);
    outline-offset: 2px;
}

/* ——— Admin: detalhe de mensagem de contato ——— */
html[data-theme="dark"] .contato-detalhe-page .page-header h1 {
    color: #e6edf3 !important;
}

html[data-theme="dark"] .contato-detalhe-page .subtitle {
    color: #8b949e !important;
}

html[data-theme="dark"] .contato-detalhe-sep {
    color: #6e7681 !important;
}

html[data-theme="dark"] .contato-detalhe-alert.ok {
    background: rgba(63, 185, 80, 0.14) !important;
    border-color: rgba(63, 185, 80, 0.35) !important;
    color: #3fb950 !important;
}

html[data-theme="dark"] .contato-detalhe-alert.err {
    background: rgba(248, 81, 73, 0.12) !important;
    border-color: rgba(248, 81, 73, 0.35) !important;
    color: #ff7b72 !important;
}

html[data-theme="dark"] .contato-card {
    background: #1c2230 !important;
    border-color: #2d3748 !important;
}

html[data-theme="dark"] .contato-card-head {
    background: #161b22 !important;
    border-bottom-color: #2d3748 !important;
}

html[data-theme="dark"] .contato-card-head strong {
    color: #e6edf3 !important;
}

html[data-theme="dark"] .contato-meta {
    color: #8b949e !important;
}

html[data-theme="dark"] .contato-meta a {
    color: #58a6ff !important;
}

html[data-theme="dark"] .contato-badge.pend {
    background: rgba(210, 153, 34, 0.2) !important;
    color: #e3b341 !important;
}

html[data-theme="dark"] .contato-badge.ok {
    background: rgba(63, 185, 80, 0.18) !important;
    color: #3fb950 !important;
}

html[data-theme="dark"] .contato-card-body dt {
    color: #8b949e !important;
}

html[data-theme="dark"] .contato-card-body dd {
    color: #c9d1d9 !important;
}

html[data-theme="dark"] .contato-admin-form {
    border-top-color: #2d3748 !important;
}

html[data-theme="dark"] .contato-admin-form label {
    color: #8b949e !important;
}

html[data-theme="dark"] .contato-admin-form textarea {
    background: #0d1117 !important;
    border-color: #30363d !important;
    color: #e6edf3 !important;
}

html[data-theme="dark"] .contato-row-check {
    color: #c9d1d9 !important;
}

html[data-theme="dark"] .contato-save {
    background: #58a6ff !important;
    color: #0d1117 !important;
}

html[data-theme="dark"] .contato-save:hover {
    background: #79b8ff !important;
    opacity: 1 !important;
}

html[data-theme="dark"] .contato-tech {
    color: #6e7681 !important;
}

/* ——— Admin: Atividade recente (lista + KPIs do dia; tema claro/escuro via variáveis) ——— */
.admin-atv {
    padding-bottom: 48px;
}

/* Não é o <header> do site (navbar): site.css aplica fundo escuro a todo `header` */
.admin-atv-head {
    margin-bottom: 24px;
    background: transparent;
    border: none;
    position: static;
    z-index: auto;
    padding: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

.admin-atv-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.admin-atv-sub {
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-secondary);
    margin: 0;
    max-width: 820px;
}

.admin-atv-sub strong {
    color: var(--text-primary);
    font-weight: 600;
}

.admin-atv-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.admin-atv-kpi {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 12px);
    box-shadow: var(--shadow-sm);
}

.admin-atv-kpi-ico {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.admin-atv-kpi-ico--n {
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent-color);
}

.admin-atv-kpi-ico--v {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success-color);
}

.admin-atv-kpi-ico svg {
    width: 26px;
    height: 26px;
}

.admin-atv-kpi-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.admin-atv-kpi-val {
    font-size: 22px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    line-height: 1.15;
}

.admin-atv-kpi-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.admin-atv-list-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 16px;
    margin-bottom: 14px;
}

.admin-atv-list-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.admin-atv-list-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.admin-atv-load-wrap {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.admin-atv-load-more:disabled {
    opacity: 0.65;
    cursor: wait;
}

.admin-atv-empty {
    padding: 28px 20px;
    text-align: center;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md, 12px);
}

.admin-atv-table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md, 12px);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.admin-atv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-atv-table thead th {
    text-align: left;
    padding: 12px 14px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--border-light);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

html[data-theme="dark"] .admin-atv-table thead th {
    background: var(--border-light);
}

.admin-atv-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: top;
}

.admin-atv-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-atv-table tbody tr:hover td {
    background: var(--border-light);
}

html[data-theme="dark"] .admin-atv-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.admin-atv-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.admin-atv-td-time {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
}

.admin-atv-part {
    font-weight: 500;
    color: var(--text-primary);
}

.admin-atv-id {
    display: inline-block;
    margin-left: 6px;
    font-size: 12px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.admin-atv-td-contract {
    max-width: 320px;
}

.admin-atv-link-contract {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.admin-atv-link-contract:hover {
    text-decoration: underline;
}

.admin-atv-pos {
    font-weight: 600;
    font-size: 13px;
}

.admin-atv-pos--sim {
    color: var(--sim-color);
}

.admin-atv-pos--nao {
    color: var(--nao-color);
}

.admin-atv-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.admin-atv-pill--ativa {
    background: rgba(16, 185, 129, 0.14);
    color: var(--success-color);
}

.admin-atv-pill--ganha {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.admin-atv-pill--perdida {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger-color);
}

.admin-atv-pill--cancel {
    background: var(--border-light);
    color: var(--text-muted);
}

.admin-atv-pill--vendida {
    background: rgba(37, 99, 235, 0.12);
    color: var(--accent-color);
}

.admin-atv-pill--muted {
    background: var(--border-light);
    color: var(--text-secondary);
}

html[data-theme="dark"] .admin-atv-pill--cancel {
    background: #21262d;
}

html[data-theme="dark"] .admin-atv-pill--muted {
    background: #21262d;
}

/* ——— Detalhe do evento: timeline Abertura / Encerramento / Resolução ——— */
html[data-theme="dark"] .evt-timeline::before {
    background: var(--border);
}

html[data-theme="dark"] .evt-tl-icon {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-muted);
}

html[data-theme="dark"] .evt-tl-body {
    background: var(--surface);
    border-color: var(--border);
}

html[data-theme="dark"] .evt-tl-title {
    color: var(--text-muted);
}

html[data-theme="dark"] .evt-tl-date {
    color: var(--text-primary);
}

html[data-theme="dark"] .evt-tl-time {
    color: var(--text-secondary);
}

html[data-theme="dark"] .evt-tl-pending {
    color: var(--text-muted);
}

html[data-theme="dark"] .evt-tl-badge-done {
    background: rgba(63, 185, 80, 0.18);
    color: var(--success-color);
}

html[data-theme="dark"] .evt-tl-badge-active {
    background: rgba(88, 166, 255, 0.15);
    color: var(--accent-color);
}

html[data-theme="dark"] .evt-tl-item.evt-tl-done .evt-tl-icon {
    background: #238636;
    border-color: #3fb950;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(63, 185, 80, 0.18);
}

html[data-theme="dark"] .evt-tl-item.evt-tl-done .evt-tl-body {
    background: rgba(63, 185, 80, 0.08);
    border-color: rgba(63, 185, 80, 0.35);
}

html[data-theme="dark"] .evt-tl-item.evt-tl-done .evt-tl-title {
    color: #7ee787;
}

html[data-theme="dark"] .evt-tl-item.evt-tl-done .evt-tl-date {
    color: #aff5b4;
}

html[data-theme="dark"] .evt-tl-item.evt-tl-done .evt-tl-time {
    color: #7ee787;
}

html[data-theme="dark"] .evt-tl-item.evt-tl-active .evt-tl-icon {
    background: var(--surface);
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(88, 166, 255, 0.12);
}

html[data-theme="dark"] .evt-tl-item.evt-tl-active .evt-tl-body {
    background: rgba(88, 166, 255, 0.08);
    border-color: rgba(88, 166, 255, 0.35);
}

html[data-theme="dark"] .evt-tl-item.evt-tl-active .evt-tl-title {
    color: var(--accent-color);
}

html[data-theme="dark"] .evt-tl-item.evt-tl-active .evt-tl-date {
    color: #79b8ff;
}

html[data-theme="dark"] .evt-tl-item.evt-tl-active .evt-tl-time {
    color: #a5d6ff;
}

html[data-theme="dark"] .evt-tl-item.evt-tl-done + .evt-tl-item::before {
    background: rgba(63, 185, 80, 0.45);
}

/* ——— Detalhe do evento: Minhas posições ——— */
html[data-theme="dark"] #minhas-posicoes > h2 {
    color: var(--text-muted);
}

html[data-theme="dark"] .bet-group,
html[data-theme="dark"] .bet-item:not(.bet-item--nested) {
    background: var(--surface);
    border-color: var(--border);
}

html[data-theme="dark"] .bet-group:hover,
html[data-theme="dark"] .bet-item:not(.bet-item--nested):hover {
    border-color: #484f58;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .bet-group > summary.bet-group-summary {
    background: #161b22;
}

html[data-theme="dark"] #minhas-posicoes .bet-type.bet-sim {
    background: rgba(63, 185, 80, 0.18);
    color: #7ee787;
}

html[data-theme="dark"] #minhas-posicoes .bet-type.bet-nao {
    background: rgba(248, 81, 73, 0.12);
    color: #f85149;
}

html[data-theme="dark"] .bet-group-line1,
html[data-theme="dark"] .bet-group-count,
html[data-theme="dark"] .bet-group-invest {
    color: var(--text-secondary);
}

html[data-theme="dark"] .bet-date {
    color: var(--text-muted);
}

html[data-theme="dark"] .bet-metric dt {
    color: var(--text-muted);
}

html[data-theme="dark"] .bet-metric dd {
    color: var(--text-primary);
}

html[data-theme="dark"] #minhas-posicoes .bet-metrics > .bet-metric:not(.bet-metric--destaque) + .bet-metric--destaque,
html[data-theme="dark"] #minhas-posicoes .bet-metrics--group-totals .bet-metric--destaque + .bet-metric--destaque {
    border-left-color: var(--border);
}

html[data-theme="dark"] .bet-metric.bet-metric--destaque dd.bet-metric-retorno {
    color: #79b8ff;
}

html[data-theme="dark"] .bet-metric.bet-metric--destaque dd.bet-metric-lucro {
    color: #7ee787;
}

html[data-theme="dark"] .bet-metric.bet-metric--destaque dd.bet-metric-lucro.bet-metric-dd--negativo {
    color: #f85149;
}

html[data-theme="dark"] .bet-group-chevron {
    background: var(--border-light);
    color: var(--text-secondary);
}

html[data-theme="dark"] details[open] > summary .bet-group-chevron,
html[data-theme="dark"] .bet-group[open] > summary .bet-group-chevron {
    background: rgba(88, 166, 255, 0.15);
    color: var(--accent-color);
}

html[data-theme="dark"] .bet-group-body {
    border-top-color: var(--border);
}

html[data-theme="dark"] .bet-item--nested:not(:first-child) {
    border-top-color: var(--border);
}

html[data-theme="dark"] .p2p-open-venda-modal-btn,
html[data-theme="dark"] .p2p-sell-trigger button {
    border-color: var(--border);
    color: var(--text-secondary);
}

html[data-theme="dark"] .p2p-open-venda-modal-btn:hover,
html[data-theme="dark"] .p2p-sell-trigger button:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(88, 166, 255, 0.1);
}

html[data-theme="dark"] #minhas-posicoes .p2p-chip.p2p-chip--ativo {
    background: rgba(210, 153, 34, 0.2);
    color: #e3b341;
    border-color: rgba(210, 153, 34, 0.45);
}

/* P2P chip (ex.: MinhasPosicoes — .p2p-chip--table herda o base claro #eef2ff) */
html[data-theme="dark"] .p2p-chip {
    background: rgba(99, 102, 241, 0.22);
    color: #c7d2fe;
}

html[data-theme="dark"] .p2p-chip--vendida {
    background: var(--border-light);
    color: var(--text-secondary);
}

html[data-theme="dark"] .p2p-chip--ativo {
    background: rgba(88, 166, 255, 0.18);
    color: var(--accent-color);
}

html[data-theme="dark"] .btn-cancelar-oferta,
html[data-theme="dark"] #minhas-posicoes .p2p-cancel-btn {
    border-color: rgba(248, 81, 73, 0.45) !important;
    color: #f85149 !important;
}

html[data-theme="dark"] .btn-cancelar-oferta:hover,
html[data-theme="dark"] #minhas-posicoes .p2p-cancel-btn:hover {
    background: rgba(248, 81, 73, 0.12) !important;
    border-color: #f85149 !important;
}

@media (max-width: 420px) {
    html[data-theme="dark"] #minhas-posicoes .bet-metrics--group-totals .bet-metric--destaque + .bet-metric--destaque {
        border-top-color: var(--border);
    }
}

html[data-theme="dark"] .bet-group-lucro--neg {
    color: #f85149;
}
