/* Estilo visual do operador (EstilosDoApp, <html data-estilo="...">) — EXPERIMENTO.
   O tema da DevExpress troca botões, campos e grades; aqui recolorimos a moldura do Solo, que tem cores fixas:
   cabeçalho, menu lateral, fundo, botões próprios e títulos dos grupos. O miolo de cada tela continua como está.
   "padrao" não tem regra nenhuma: fica exatamente como hoje. */

html[data-estilo="grafite"] {
    --est-escuro: #1f2937;
    --est-medio: #475569;
    --est-vivo: #64748b;
    --est-claro: #e7eaee;
    --est-fundo: #f1f3f5;
}

html[data-estilo="claro"] {
    --est-escuro: #1f2937;
    --est-medio: #2563eb;
    --est-vivo: #3b82f6;
    --est-claro: #f3f4f6;
    --est-fundo: #ffffff;
}

html[data-estilo="azul"] {
    --est-escuro: #0b3d6b;
    --est-medio: #0f6cbd;
    --est-vivo: #3a8fd9;
    --est-claro: #e3eefa;
    --est-fundo: #edf2f8;
}

html[data-estilo="terra"] {
    --est-escuro: #5c3d1e;
    --est-medio: #8a6a3f;
    --est-vivo: #b08650;
    --est-claro: #f3eadc;
    --est-fundo: #f5f0e8;
}

/* As variáveis do Solo passam a seguir o estilo (as telas que já usam var(--fp-*) acompanham) */
html[data-estilo]:not([data-estilo="padrao"]) {
    --fp-verde: var(--est-medio);
    --fp-verde-claro: var(--est-claro);
    --fp-fundo: var(--est-fundo);
    --dxbl-grid-focus-frame-color: var(--est-medio);
}

/* ── Fundo ─────────────────────────────────────────────────────────────── */
html[data-estilo]:not([data-estilo="padrao"]),
html[data-estilo]:not([data-estilo="padrao"]) body,
html[data-estilo]:not([data-estilo="padrao"]) .app-shell,
html[data-estilo]:not([data-estilo="padrao"]) .app-content {
    background: var(--est-fundo) !important;
    background-color: var(--est-fundo) !important;
}

/* ── Cabeçalho ─────────────────────────────────────────────────────────── */
html[data-estilo]:not([data-estilo="padrao"]) .tb-menu-toggle,
html[data-estilo]:not([data-estilo="padrao"]) .tb-brand strong,
html[data-estilo]:not([data-estilo="padrao"]) .tb-security-chip { color: var(--est-escuro) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .tb-security-chip i { color: var(--est-medio) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .tb-security-chip:hover,
html[data-estilo]:not([data-estilo="padrao"]) .tb-user-popover__status { background: var(--est-claro) !important; color: var(--est-escuro) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .tb-producer-chip { background: var(--est-escuro) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .tb-producer-body { background: var(--est-medio) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .tb-producer-wrap:hover .tb-producer-body { background: var(--est-vivo) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .tb-producer-caret { color: var(--est-claro) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .tb-avatar { background: var(--est-medio) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .tb-avatar--button:hover,
html[data-estilo]:not([data-estilo="padrao"]) .tb-avatar--button:focus-visible { background: var(--est-escuro) !important; outline-color: var(--est-claro) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .tp-card { background: linear-gradient(160deg, var(--est-escuro) 0%, var(--est-medio) 55%, var(--est-escuro) 100%) !important; }

/* ── Menu lateral ──────────────────────────────────────────────────────── */
html[data-estilo]:not([data-estilo="padrao"]) .app-sidebar__brand,
html[data-estilo]:not([data-estilo="padrao"]) .app-sidebar__brand-main,
html[data-estilo]:not([data-estilo="padrao"]) .app-sidebar__brand-lite,
html[data-estilo]:not([data-estilo="padrao"]) .app-sidebar__fa-icon,
html[data-estilo]:not([data-estilo="padrao"]) .app-sidebar__item-chevron { color: var(--est-medio) !important; }
html[data-estilo]:not([data-estilo="padrao"]) a.app-sidebar__item.active {
    background: var(--est-claro) !important;
    color: var(--est-medio) !important;
    border-left-color: var(--est-medio) !important;
}
html[data-estilo]:not([data-estilo="padrao"]) .app-sidebar__subitem.active {
    color: var(--est-medio) !important;
    border-left-color: var(--est-medio) !important;
}
html[data-estilo]:not([data-estilo="padrao"]) .app-sidebar__subitem.active .app-sidebar__subdot { background: var(--est-medio) !important; }
html[data-estilo]:not([data-estilo="padrao"]) nav.app-sidebar.app-sidebar--collapsed a.app-sidebar__item.active { border-left-color: var(--est-medio) !important; }
html[data-estilo]:not([data-estilo="padrao"]) a.app-sidebar__item--conciliacao .app-sidebar__item-badge { background: linear-gradient(135deg, var(--est-escuro), var(--est-vivo)) !important; }

/* ── Botões e títulos do próprio Solo ─────────────────────────────────── */
html[data-estilo]:not([data-estilo="padrao"]) .btn-primary,
html[data-estilo]:not([data-estilo="padrao"]) .btn-success,
html[data-estilo]:not([data-estilo="padrao"]) .botao-verde,
html[data-estilo]:not([data-estilo="padrao"]) .botao-texto-maior,
html[data-estilo]:not([data-estilo="padrao"]) .app-permission-panel button,
html[data-estilo]:not([data-estilo="padrao"]) .app-subscription-panel__actions button {
    background-color: var(--est-medio) !important;
    border-color: var(--est-medio) !important;
    color: #fff !important;
}
html[data-estilo]:not([data-estilo="padrao"]) .btn-primary:hover,
html[data-estilo]:not([data-estilo="padrao"]) .btn-success:hover,
html[data-estilo]:not([data-estilo="padrao"]) .botao-verde:hover { background-color: var(--est-escuro) !important; border-color: var(--est-escuro) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .btn-outline-primary,
html[data-estilo]:not([data-estilo="padrao"]) .btn-outline-success { color: var(--est-medio) !important; border-color: var(--est-medio) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .agr-back-button.dxbl-btn,
html[data-estilo]:not([data-estilo="padrao"]) .agr-back-button { border-left-color: var(--est-medio) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .agr-back-button .dxbl-image,
html[data-estilo]:not([data-estilo="padrao"]) .agr-back-button i,
html[data-estilo]:not([data-estilo="padrao"]) .my-icon-add { color: var(--est-medio) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .mentor-fab { background: linear-gradient(145deg, var(--est-medio), var(--est-escuro)) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .app-subscription-panel { border-left-color: var(--est-medio) !important; }

/* Títulos dos grupos das telas (DxFormLayoutGroup) ganham a cor e uma faixa clara */
html[data-estilo]:not([data-estilo="padrao"]) .fonte-group-caption { color: var(--est-escuro) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .dxbl-fl-group > .dxbl-fl-group-header,
html[data-estilo]:not([data-estilo="padrao"]) .dxbl-group > .dxbl-group-header {
    background: var(--est-claro) !important;
    border-bottom: 2px solid var(--est-medio) !important;
}

/* Cabeçalho das grades */
html[data-estilo]:not([data-estilo="padrao"]) .dxbl-grid-header-row > th,
html[data-estilo]:not([data-estilo="padrao"]) .dxbl-grid .dxbl-grid-header {
    background-color: var(--est-claro) !important;
    color: var(--est-escuro) !important;
}


/* ══ Componentes com verde fixo da marca (auditoria de 21/11/2026) ══════════════════════════════════════════════
   Só o verde que é "cor do Solo". O verde que quer dizer positivo (valores, receitas, saldo positivo, "Realizado",
   concluídas, WhatsApp) fica como está em qualquer aparência. */
html[data-estilo]:not([data-estilo="padrao"]) {
    --est-borda-suave: color-mix(in srgb, var(--est-medio) 30%, #fff);
    --est-fundo-suave: color-mix(in srgb, var(--est-claro) 60%, #fff);
}

/* ── Em várias telas ── */
html[data-estilo]:not([data-estilo="padrao"]) .tb-security-chip { border-color: var(--est-borda-suave) !important; background: var(--est-fundo-suave) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .spinner-border.text-success { color: var(--est-medio) !important; }
html[data-estilo]:not([data-estilo="padrao"]) :is(.sdica-icone, .pivot-intro-icon) { color: var(--est-medio) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .avatar-op--iniciais { background: var(--est-medio) !important; }

/* Apresentações "Como funciona" (motor.css): as variáveis do verde passam a ser as do estilo */
html[data-estilo]:not([data-estilo="padrao"]) .tap {
    --campo-900: color-mix(in srgb, var(--est-escuro) 70%, #000);
    --campo-800: var(--est-escuro);
    --campo-700: color-mix(in srgb, var(--est-escuro) 60%, var(--est-medio));
    --verde: var(--est-medio);
    --verde-vivo: var(--est-vivo);
    --verde-claro: var(--est-claro);
}

/* Cabeçalho dos módulos Agrícola e Pecuária e os chips "Manual" */
html[data-estilo]:not([data-estilo="padrao"]) :is(.agr-hero, .pec-hero) {
    background: linear-gradient(135deg, var(--est-escuro), var(--est-medio)) !important;
    border-color: var(--est-borda-suave) !important;
}
html[data-estilo]:not([data-estilo="padrao"]) :is(.agr-eyebrow, .pec-eyebrow) { color: var(--est-claro) !important; }
html[data-estilo]:not([data-estilo="padrao"]) :is(.agr-manual-chip, .pec-manual-chip, .tar-manual-chip) { color: var(--est-escuro) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .tar-manual-chip { border-color: var(--est-borda-suave) !important; background: var(--est-fundo-suave) !important; }
html[data-estilo]:not([data-estilo="padrao"]) :is(.agr-manual-chip, .pec-manual-chip, .tar-manual-chip):hover { background: var(--est-claro) !important; border-color: var(--est-borda-suave) !important; color: var(--est-escuro) !important; }

/* ── Painel ── */
html[data-estilo]:not([data-estilo="padrao"]) .bn-lembrete { border-color: var(--est-borda-suave) !important; background: var(--est-fundo-suave) !important; color: var(--est-escuro) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .bn-lembrete a { background: var(--est-medio) !important; }
html[data-estilo]:not([data-estilo="padrao"]) :is(.dm2-kicker, .dm2-analysis-btn) { color: var(--est-medio) !important; }

/* ── Compras e vendas ── */
html[data-estilo]:not([data-estilo="padrao"]) .oes-import-cta {
    border-color: var(--est-medio) !important;
    border-bottom-color: var(--est-escuro) !important;
    background: var(--est-fundo-suave) !important;
    color: var(--est-escuro) !important;
    box-shadow: 0 8px 18px color-mix(in srgb, var(--est-medio) 14%, transparent) !important;
}
html[data-estilo]:not([data-estilo="padrao"]) .oes-import-cta:hover { background: var(--est-claro) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .oes-import-cta-icon { background: var(--est-medio) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .oes-import-cta-text :is(strong, small) { color: var(--est-escuro) !important; }
/* Carta de correção na nota */
html[data-estilo]:not([data-estilo="padrao"]) .cce-icone { background: var(--est-claro) !important; color: var(--est-medio) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .cce-botao--principal { background: var(--est-medio) !important; border-color: var(--est-medio) !important; }

/* ── Caixa Expresso: escolha da fazenda ── */
html[data-estilo]:not([data-estilo="padrao"]) .cx-farm-picker__eyebrow { color: var(--est-medio) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .cx-farm-picker__stats div { border-color: var(--est-borda-suave) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .cx-farm-picker__stats strong { color: var(--est-escuro) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .cx-farm-card__action { background: var(--est-claro) !important; color: var(--est-medio) !important; }

/* ── Fluxo de caixa, saldos e extrato ── */
html[data-estilo]:not([data-estilo="padrao"]) .fc-btn--ativo { background: var(--est-medio) !important; border-color: var(--est-medio) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .sb-seg button[aria-pressed="true"] { background: var(--est-claro) !important; color: var(--est-medio) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .conciliacao-dropzone { border-color: var(--est-vivo) !important; background: var(--est-fundo-suave) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .conciliacao-dropzone :is(i, strong) { color: var(--est-medio) !important; }

/* ── NF-e destinadas (parte das cores está no próprio elemento) ── */
html[data-estilo]:not([data-estilo="padrao"]) :is(.nfed-empty-title, h5[style*="1E4D35"], i[style*="1E4D35"]) { color: var(--est-escuro) !important; }
html[data-estilo]:not([data-estilo="padrao"]) :is(.nfed-result-banner, .badge[style*="1E4D35"]) { background: var(--est-escuro) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .nfed-btn-xml { background: var(--est-medio) !important; }

/* ── Tarefas ── */
html[data-estilo]:not([data-estilo="padrao"]) .tar-eyebrow { color: var(--est-medio) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .tar-btn-primary { background: var(--est-medio) !important; border-color: var(--est-medio) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .tar-barra > div { background: var(--est-medio) !important; }

/* ── Agrícola e LCDPR ── */
html[data-estilo]:not([data-estilo="padrao"]) :is(.agr-lavoura-bar-open, a[style*="1b6d35"]) { color: var(--est-medio) !important; }
html[data-estilo]:not([data-estilo="padrao"]) :is(.painel-contexto-title, .cnt-btn, .cnt-val) { color: var(--est-medio) !important; }

/* Botão de voltar dos módulos (site.css: .agr-back-button, usado no Agrícola, na Pecuária e no MDF-e) */
html[data-estilo]:not([data-estilo="padrao"]) :is(.agr-back-button.dxbl-btn, .agr-back-button) {
    border-color: var(--est-borda-suave) !important;
    border-left-color: var(--est-medio) !important;
    background: var(--est-fundo-suave) !important;
    color: var(--est-escuro) !important;
    box-shadow: 0 6px 14px color-mix(in srgb, var(--est-medio) 12%, transparent) !important;
}
html[data-estilo]:not([data-estilo="padrao"]) :is(.agr-back-button.dxbl-btn, .agr-back-button):hover {
    border-color: var(--est-medio) !important;
    background: var(--est-claro) !important;
    color: var(--est-escuro) !important;
}
html[data-estilo]:not([data-estilo="padrao"]) .agr-back-button .dxbl-btn-caption { color: var(--est-escuro) !important; }

/* Conversa com o Broto (AiChatContextual.razor): cabeçalho verde e detalhes em azul fixos passam a seguir o estilo */
html[data-estilo]:not([data-estilo="padrao"]) :is(.aic-header, .aic-header-broto) { background: linear-gradient(135deg, var(--est-escuro), var(--est-medio)) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .aic-fab:not(.aic-fab-aberto) { background: linear-gradient(135deg, var(--est-medio), var(--est-escuro)) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .aic-msg-avatar { background: var(--est-medio) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .aic-msg-bot .aic-msg-balao strong { color: var(--est-escuro) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .aic-msg-user .aic-msg-balao { background: linear-gradient(135deg, var(--est-medio), var(--est-escuro)) !important; color: #fff !important; }
html[data-estilo]:not([data-estilo="padrao"]) .aic-digitando span { background: var(--est-medio) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .aic-acoes-titulo i { color: var(--est-medio) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .aic-acao:hover { background: var(--est-fundo-suave) !important; border-color: var(--est-borda-suave) !important; color: var(--est-escuro) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .aic-sugestoes { background: var(--est-fundo-suave) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .aic-sugestao { background: #fff !important; border-color: var(--est-borda-suave) !important; color: var(--est-escuro) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .aic-sugestao:hover { background: var(--est-claro) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .aic-input:focus { border-color: var(--est-medio) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--est-medio) 12%, transparent) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .aic-enviar { background: linear-gradient(135deg, var(--est-medio), var(--est-escuro)) !important; }
html[data-estilo]:not([data-estilo="padrao"]) .aic-acao-contextual { background: var(--est-fundo-suave) !important; border-color: var(--est-borda-suave) !important; color: var(--est-escuro) !important; }

/* ══ Claro: branco e leve, no padrão das páginas da DevExpress ═══════════════════════════════════════════════════
   As regras gerais acima já usam as variáveis; aqui só o que deixa a página mais lisa: faixas e cabeçalhos em cinza
   neutro com linha fina (sem a borda colorida), menu ativo em cinza com texto escuro e cabeçalho dos módulos claro.
   O seletor repete o :not() das regras gerais para ter a mesma força e, vindo depois, valer sobre elas. */
html[data-estilo="claro"]:not([data-estilo="padrao"]) .dxbl-fl-group > .dxbl-fl-group-header,
html[data-estilo="claro"]:not([data-estilo="padrao"]) .dxbl-group > .dxbl-group-header {
    background: #fafafa !important;
    border-bottom: 1px solid #e5e7eb !important;
}
html[data-estilo="claro"]:not([data-estilo="padrao"]) .fonte-group-caption { color: #111827 !important; }
html[data-estilo="claro"]:not([data-estilo="padrao"]) .dxbl-grid-header-row > th,
html[data-estilo="claro"]:not([data-estilo="padrao"]) .dxbl-grid .dxbl-grid-header {
    background-color: #fafafa !important;
    color: #111827 !important;
}
html[data-estilo="claro"]:not([data-estilo="padrao"]) a.app-sidebar__item.active {
    background: #f0f0f0 !important;
    color: #111827 !important;
    border-left-color: var(--est-medio) !important;
}
html[data-estilo="claro"]:not([data-estilo="padrao"]) :is(.app-sidebar__fa-icon, .app-sidebar__item-chevron) { color: #4b5563 !important; }
html[data-estilo="claro"]:not([data-estilo="padrao"]) .app-sidebar__subitem.active { color: #111827 !important; background: #f0f0f0 !important; }
html[data-estilo="claro"]:not([data-estilo="padrao"]) .tb-producer-chip { background: #1f2937 !important; }

/* Cabeçalho dos módulos (Agrícola, Pecuária): claro, texto escuro, chips e caixa da fazenda brancos com borda fina */
html[data-estilo="claro"]:not([data-estilo="padrao"]) :is(.agr-hero, .pec-hero) {
    background: #f8fafc !important;
    color: #111827 !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: none !important;
}
html[data-estilo="claro"]:not([data-estilo="padrao"]) :is(.agr-hero, .pec-hero)::after { display: none !important; }
html[data-estilo="claro"]:not([data-estilo="padrao"]) :is(.agr-hero, .pec-hero) :is(h1, p, label, small, strong, span, i, .agr-eyebrow, .pec-eyebrow, .agr-hero-sub) { color: #111827 !important; }
html[data-estilo="claro"]:not([data-estilo="padrao"]) :is(.agr-hero, .pec-hero) :is(.agr-eyebrow, .pec-eyebrow, .agr-eyebrow i, .pec-eyebrow i) { color: var(--est-medio) !important; }
html[data-estilo="claro"]:not([data-estilo="padrao"]) :is(.agr-chip, .pec-chip, .agr-manual-chip, .pec-manual-chip, .agr-farm-work, .pec-work-card) {
    background: #fff !important;
    border-color: #d1d5db !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

/* ══ Caixinha marcada na linha em foco das grades do operador (Caixa Expresso, listas V2) ═════════════════════════
   O tema Fluent desenha a caixinha da linha em foco para um fundo escuro (fundo transparente, borda clara). Nessas grades a
   linha em foco é azul-clara (farmplus-ui.css), e a caixinha sumia: volta a ter o fundo da cor do estilo e o ✓ branco. */
html[data-estilo]:not([data-estilo="padrao"]) .go-grid .dxbl-grid-table .dxbl-grid-focused-row .dxbl-checkbox-checked .dxbl-checkbox-check-element,
html[data-estilo]:not([data-estilo="padrao"]) .cx-lab-grid .dxbl-grid-table .dxbl-grid-focused-row .dxbl-checkbox-checked .dxbl-checkbox-check-element {
    --dxbl-checkbox-check-element-bg: var(--dxds-color-surface-primary-default-rest) !important;
    --dxbl-checkbox-hover-check-element-bg: var(--dxds-color-surface-primary-default-hovered, var(--dxds-color-surface-primary-default-rest)) !important;
    --dxbl-checkbox-check-element-border: var(--dxds-color-surface-primary-default-rest) !important;
    --dxbl-checkbox-hover-check-element-border: var(--dxds-color-surface-primary-default-hovered, var(--dxds-color-surface-primary-default-rest)) !important;
    --dxbl-checkbox-check-element-check-icon-primary-color: #fff !important;
}
