/* Paleta de ações do piloto: apenas cores, sombra e foco; nenhuma medida.
   Clássico e gatilhos de autocomplete conservam seus estilos. */
html.sf-pilot-modern body :is(.green-btn, .green-split-btn, .ui-button-success, .ui-confirmdialog-yes) {
    --sf-button-bg: #477e59; --sf-button-hover: #407150; --sf-button-active: #3a6749; --sf-button-ink: #ffffff;
}
html.sf-pilot-modern body :is(.red-btn, .red-split-btn, .ui-button-danger, .ui-confirmdialog-no) {
    --sf-button-bg: #b35c64; --sf-button-hover: #a1535a; --sf-button-active: #934b52; --sf-button-ink: #ffffff;
}
html.sf-pilot-modern body :is(.orange-btn, .orange-split-btn) {
    --sf-button-bg: #e0ad78; --sf-button-hover: #ca9c6c; --sf-button-active: #b88e62; --sf-button-ink: #38220e;
}
html.sf-pilot-modern body :is(.amber-btn, .amber-split-btn, .ui-button-warning, .yellow-btn) {
    --sf-button-bg: #d9b65f; --sf-button-hover: #c3a456; --sf-button-active: #b2954e; --sf-button-ink: #36290f;
}
html.sf-pilot-modern body :is(.cyan-btn, .cyan-split-btn, .ui-button-info) {
    --sf-button-bg: #327b8f; --sf-button-hover: #2d6f81; --sf-button-active: #296575; --sf-button-ink: #ffffff;
}
html.sf-pilot-modern body :is(.teal-btn, .teal-split-btn) {
    --sf-button-bg: #397e74; --sf-button-hover: #337168; --sf-button-active: #2f675f; --sf-button-ink: #ffffff;
}
html.sf-pilot-modern body :is(.purple-btn, .purple-split-btn, .ui-button-help) {
    --sf-button-bg: #7c659e; --sf-button-hover: #705b8e; --sf-button-active: #665382; --sf-button-ink: #ffffff;
}
html.sf-pilot-modern body :is(.pink-btn, .pink-split-btn) {
    --sf-button-bg: #ad5c80; --sf-button-hover: #9c5373; --sf-button-active: #8e4b69; --sf-button-ink: #ffffff;
}
html.sf-pilot-modern body :is(.deep-orange-btn, .deep-orange-split-btn) {
    --sf-button-bg: #a55c43; --sf-button-hover: #95533c; --sf-button-active: #874b37; --sf-button-ink: #ffffff;
}
html.sf-pilot-modern body :is(.brown-btn, .brown-split-btn) {
    --sf-button-bg: #866b5c; --sf-button-hover: #796053; --sf-button-active: #6e584b; --sf-button-ink: #ffffff;
}
html.sf-pilot-modern body :is(.blue-grey-btn, .blue-grey-split-btn, .ui-button-secondary) {
    --sf-button-bg: #586e7c; --sf-button-hover: #4f6370; --sf-button-active: #485a66; --sf-button-ink: #ffffff;
}
html.sf-pilot-modern.sf-pilot-dark body :is(.green-btn, .green-split-btn, .ui-button-success, .ui-confirmdialog-yes) {
    --sf-button-bg: #345a43; --sf-button-hover: #2f513c; --sf-button-active: #2b4a37; --sf-button-ink: #d8eedf;
}
html.sf-pilot-modern.sf-pilot-dark body :is(.red-btn, .red-split-btn, .ui-button-danger, .ui-confirmdialog-no) {
    --sf-button-bg: #713e48; --sf-button-hover: #663841; --sf-button-active: #5d333b; --sf-button-ink: #ffe1e5;
}
html.sf-pilot-modern.sf-pilot-dark body :is(.orange-btn, .orange-split-btn) {
    --sf-button-bg: #68472c; --sf-button-hover: #5e4028; --sf-button-active: #553a24; --sf-button-ink: #f8dfbf;
}
html.sf-pilot-modern.sf-pilot-dark body :is(.amber-btn, .amber-split-btn, .ui-button-warning, .yellow-btn) {
    --sf-button-bg: #655329; --sf-button-hover: #5b4b25; --sf-button-active: #534422; --sf-button-ink: #f5e3b5;
}
html.sf-pilot-modern.sf-pilot-dark body :is(.cyan-btn, .cyan-split-btn, .ui-button-info) {
    --sf-button-bg: #2c5362; --sf-button-hover: #284b58; --sf-button-active: #244450; --sf-button-ink: #d3edf4;
}
html.sf-pilot-modern.sf-pilot-dark body :is(.teal-btn, .teal-split-btn) {
    --sf-button-bg: #305851; --sf-button-hover: #2b4f49; --sf-button-active: #274842; --sf-button-ink: #d7efea;
}
html.sf-pilot-modern.sf-pilot-dark body :is(.purple-btn, .purple-split-btn, .ui-button-help) {
    --sf-button-bg: #514361; --sf-button-hover: #493c57; --sf-button-active: #423750; --sf-button-ink: #ebdef8;
}
html.sf-pilot-modern.sf-pilot-dark body :is(.pink-btn, .pink-split-btn) {
    --sf-button-bg: #684258; --sf-button-hover: #5e3b4f; --sf-button-active: #553648; --sf-button-ink: #f8dfec;
}
html.sf-pilot-modern.sf-pilot-dark body :is(.deep-orange-btn, .deep-orange-split-btn) {
    --sf-button-bg: #6c4638; --sf-button-hover: #613f32; --sf-button-active: #59392e; --sf-button-ink: #f7e0d5;
}
html.sf-pilot-modern.sf-pilot-dark body :is(.brown-btn, .brown-split-btn) {
    --sf-button-bg: #55473f; --sf-button-hover: #4c4039; --sf-button-active: #463a34; --sf-button-ink: #eee3dc;
}
html.sf-pilot-modern.sf-pilot-dark body :is(.blue-grey-btn, .blue-grey-split-btn, .ui-button-secondary) {
    --sf-button-bg: #3b4f5e; --sf-button-hover: #354755; --sf-button-active: #30414d; --sf-button-ink: #e0eaf1;
}
html.sf-pilot-modern body .ui-button:where(:not(.ui-selectbooleanbutton, .ui-selectonebutton .ui-button, .ui-selectmanybutton .ui-button, .ui-autocomplete-dropdown)) {
    background: var(--sf-button-bg, var(--sf-action-bg)) !important;
    color: var(--sf-button-ink, var(--sf-action-ink, #ffffff)) !important;
    border-color: var(--sf-button-bg, var(--sf-action-bg)) !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.10);
}
html.sf-pilot-modern body .ui-button:where(:not(.ui-selectbooleanbutton, .ui-selectonebutton .ui-button, .ui-selectmanybutton .ui-button, .ui-autocomplete-dropdown)) :is(.ui-icon, .ui-button-text) { color: inherit !important; }
html.sf-pilot-modern body .ui-button:where(:not(.ui-selectbooleanbutton, .ui-selectonebutton .ui-button, .ui-selectmanybutton .ui-button, .ui-autocomplete-dropdown)):not(.ui-state-disabled, :disabled, .ui-state-disabled *):is(:hover, .ui-state-hover) {
    background: var(--sf-button-hover, var(--sf-action-hover)) !important;
    color: var(--sf-button-hover-ink, var(--sf-button-ink, var(--sf-action-hover-ink, #ffffff))) !important;
}
html.sf-pilot-modern body .ui-button:where(:not(.ui-selectbooleanbutton, .ui-selectonebutton .ui-button, .ui-selectmanybutton .ui-button, .ui-autocomplete-dropdown)):not(.ui-state-disabled, :disabled, .ui-state-disabled *):is(:active, .ui-state-active) {
    background: var(--sf-button-active, var(--sf-action-active)) !important;
    color: var(--sf-button-active-ink, var(--sf-button-ink, var(--sf-action-active-ink, #ffffff))) !important;
}
html.sf-pilot-modern body .ui-button:where(:not(.ui-selectbooleanbutton, .ui-selectonebutton .ui-button, .ui-selectmanybutton .ui-button, .ui-autocomplete-dropdown)):not(.ui-state-disabled, :disabled, .ui-state-disabled *):is(:focus-visible, .ui-state-focus) {
    outline: 2px solid var(--sf-accent) !important; outline-offset: 2px;
}
/* A opacidade do estado desabilitado já é aplicada pelo tema legado ao botão
   ou ao menuitem pai. Não duplicar a opacidade nem transformar foco em ativação. */

/* Seleção mantém estados distintos, com as superfícies suaves do tema. */
html.sf-pilot-modern body :is(.ui-selectbooleanbutton, .ui-selectonebutton > .ui-button, .ui-selectmanybutton > .ui-button) {
    background:var(--sf-soft) !important; color:var(--sf-text) !important;
    border-color:var(--sf-border) !important; box-shadow:none;
}
html.sf-pilot-modern body :is(.ui-selectbooleanbutton, .ui-selectonebutton > .ui-button, .ui-selectmanybutton > .ui-button).ui-state-active {
    background:var(--sf-active-bg) !important; color:var(--sf-success) !important;
    border-color:var(--sf-success) !important;
}
html.sf-pilot-modern body :is(.ui-selectbooleanbutton, .ui-selectonebutton > .ui-button, .ui-selectmanybutton > .ui-button) :is(.ui-icon, .ui-button-text) { color:inherit !important; }
html.sf-pilot-modern body :is(.ui-selectbooleanbutton, .ui-selectonebutton > .ui-button, .ui-selectmanybutton > .ui-button):not(.ui-state-disabled, :disabled):is(:hover, .ui-state-hover) { box-shadow:inset 0 0 0 1px var(--sf-muted); }
html.sf-pilot-modern body :is(.ui-selectbooleanbutton, .ui-selectonebutton > .ui-button, .ui-selectmanybutton > .ui-button):not(.ui-state-disabled, :disabled):is(:focus-visible, .ui-state-focus) { outline:2px solid var(--sf-accent) !important; outline-offset:2px; }

/* Itens de ação em menus usam a mesma paleta dos botões, inclusive em overlays. */
html.sf-pilot-modern body .ui-menu .ui-menuitem-link:is(.sf-action-menuitem, .green-btn, .red-btn, .orange-btn, .amber-btn, .yellow-btn, .cyan-btn, .teal-btn, .purple-btn, .pink-btn, .deep-orange-btn, .brown-btn, .blue-grey-btn) {
    background: var(--sf-button-bg) !important;
    color: var(--sf-button-ink) !important;
    border-radius: 6px;
}
html.sf-pilot-modern body .ui-menu .ui-menuitem-link:is(.sf-action-menuitem, .green-btn, .red-btn, .orange-btn, .amber-btn, .yellow-btn, .cyan-btn, .teal-btn, .purple-btn, .pink-btn, .deep-orange-btn, .brown-btn, .blue-grey-btn) :is(.ui-menuitem-text, .ui-menuitem-icon) {
    color: inherit !important;
}
html.sf-pilot-modern body .ui-menu .ui-menuitem-link:is(.sf-action-menuitem, .green-btn, .red-btn, .orange-btn, .amber-btn, .yellow-btn, .cyan-btn, .teal-btn, .purple-btn, .pink-btn, .deep-orange-btn, .brown-btn, .blue-grey-btn):not(.ui-state-disabled, .ui-state-disabled *):is(:hover, .ui-state-hover) {
    background: var(--sf-button-hover) !important;
}
html.sf-pilot-modern body .ui-menu .ui-menuitem-link:is(.sf-action-menuitem, .green-btn, .red-btn, .orange-btn, .amber-btn, .yellow-btn, .cyan-btn, .teal-btn, .purple-btn, .pink-btn, .deep-orange-btn, .brown-btn, .blue-grey-btn):not(.ui-state-disabled, .ui-state-disabled *):active {
    background: var(--sf-button-active) !important;
}
html.sf-pilot-modern body .ui-menu .ui-menuitem-link:is(.sf-action-menuitem, .green-btn, .red-btn, .orange-btn, .amber-btn, .yellow-btn, .cyan-btn, .teal-btn, .purple-btn, .pink-btn, .deep-orange-btn, .brown-btn, .blue-grey-btn):not(.ui-state-disabled, .ui-state-disabled *):focus-visible {
    outline: 2px solid var(--sf-accent) !important;
    outline-offset: -2px;
}

/* Cores antigas: as famílias saturadas do Ultima, mantendo a estrutura moderna.
   O texto acompanha o contraste em cada estado, inclusive sobre verde/amarelo. */
html.sf-pilot-modern.sf-pilot-legacy-colors body :is(.green-btn, .sf-theme-action-success, .green-split-btn, .ui-button-success, .ui-confirmdialog-yes, .sf-theme-card-palette.cardPagamento.colorbox-1) {
    --sf-button-bg:#4CAF50; --sf-button-hover:#2E7D32; --sf-button-active:#276a2a;
    --sf-button-ink:#000000; --sf-button-hover-ink:#ffffff; --sf-button-active-ink:#ffffff;
}
html.sf-pilot-modern.sf-pilot-legacy-colors body :is(.red-btn, .sf-theme-action-danger, .red-split-btn, .ui-button-danger, .ui-confirmdialog-no) {
    --sf-button-bg:#F44336; --sf-button-hover:#C62828; --sf-button-active:#a82222;
    --sf-button-ink:#000000; --sf-button-hover-ink:#ffffff; --sf-button-active-ink:#ffffff;
}
html.sf-pilot-modern.sf-pilot-legacy-colors body :is(.orange-btn, .orange-split-btn) {
    --sf-button-bg:#FF9800; --sf-button-hover:#EF6C00; --sf-button-active:#cb5b00;
    --sf-button-ink:#000000; --sf-button-hover-ink:#000000; --sf-button-active-ink:#000000;
}
html.sf-pilot-modern.sf-pilot-legacy-colors body :is(.amber-btn, .amber-split-btn, .ui-button-warning, .yellow-btn) {
    --sf-button-bg:#FFC107; --sf-button-hover:#FF8F00; --sf-button-active:#d87900;
    --sf-button-ink:#000000; --sf-button-hover-ink:#000000; --sf-button-active-ink:#000000;
}
html.sf-pilot-modern.sf-pilot-legacy-colors body :is(.cyan-btn, .cyan-split-btn, .ui-button-info) {
    --sf-button-bg:#00BCD4; --sf-button-hover:#00838F; --sf-button-active:#006f79;
    --sf-button-ink:#000000; --sf-button-hover-ink:#000000; --sf-button-active-ink:#ffffff;
}
html.sf-pilot-modern.sf-pilot-legacy-colors body :is(.teal-btn, .teal-split-btn) {
    --sf-button-bg:#009688; --sf-button-hover:#00695C; --sf-button-active:#00594e;
    --sf-button-ink:#000000; --sf-button-hover-ink:#ffffff; --sf-button-active-ink:#ffffff;
}
html.sf-pilot-modern.sf-pilot-legacy-colors body :is(.purple-btn, .purple-split-btn, .ui-button-help) {
    --sf-button-bg:#673AB7; --sf-button-hover:#4527A0; --sf-button-active:#3a2188;
    --sf-button-ink:#ffffff; --sf-button-hover-ink:#ffffff; --sf-button-active-ink:#ffffff;
}
html.sf-pilot-modern.sf-pilot-legacy-colors body :is(.pink-btn, .pink-split-btn) {
    --sf-button-bg:#E91E63; --sf-button-hover:#AD1457; --sf-button-active:#931149;
    --sf-button-ink:#000000; --sf-button-hover-ink:#ffffff; --sf-button-active-ink:#ffffff;
}
html.sf-pilot-modern.sf-pilot-legacy-colors body :is(.deep-orange-btn, .deep-orange-split-btn) {
    --sf-button-bg:#FF5722; --sf-button-hover:#D84315; --sf-button-active:#b73811;
    --sf-button-ink:#000000; --sf-button-hover-ink:#000000; --sf-button-active-ink:#ffffff;
}
html.sf-pilot-modern.sf-pilot-legacy-colors body :is(.brown-btn, .brown-split-btn) {
    --sf-button-bg:#795548; --sf-button-hover:#4E342E; --sf-button-active:#422c27;
    --sf-button-ink:#ffffff; --sf-button-hover-ink:#ffffff; --sf-button-active-ink:#ffffff;
}
html.sf-pilot-modern.sf-pilot-legacy-colors body :is(.blue-grey-btn, .blue-grey-split-btn, .ui-button-secondary) {
    --sf-button-bg:#607D8B; --sf-button-hover:#37474F; --sf-button-active:#2e3c43;
    --sf-button-ink:#000000; --sf-button-hover-ink:#ffffff; --sf-button-active-ink:#ffffff;
}
html.sf-pilot-modern.sf-pilot-legacy-colors body .dashboard .colorbox-1,
html.sf-pilot-modern.sf-pilot-legacy-colors body .dashboard .colorbox[style*="background-color: green"] {
    --sf-card-light-bg:#4CAF50; --sf-card-dark-bg:#4CAF50;
    --sf-card-light-ink:#000000; --sf-card-dark-ink:#000000; --sf-card-mark:#4CAF50;
}
html.sf-pilot-modern.sf-pilot-legacy-colors body .dashboard .colorbox-2 {
    --sf-card-light-bg:#03A9F4; --sf-card-dark-bg:#03A9F4;
    --sf-card-light-ink:#000000; --sf-card-dark-ink:#000000; --sf-card-mark:#03A9F4;
}
html.sf-pilot-modern.sf-pilot-legacy-colors body .dashboard .colorbox-3 {
    --sf-card-light-bg:#673AB7; --sf-card-dark-bg:#673AB7;
    --sf-card-light-ink:#ffffff; --sf-card-dark-ink:#ffffff; --sf-card-mark:#673AB7;
}
html.sf-pilot-modern.sf-pilot-legacy-colors body .dashboard .colorbox-4 {
    --sf-card-light-bg:#009688; --sf-card-dark-bg:#009688;
    --sf-card-light-ink:#000000; --sf-card-dark-ink:#000000; --sf-card-mark:#009688;
}
html.sf-pilot-modern.sf-pilot-legacy-colors body .dashboard .colorbox-5,
html.sf-pilot-modern.sf-pilot-legacy-colors body .dashboard .colorbox[style*="background-color: red"] {
    --sf-card-light-bg:#F44336; --sf-card-dark-bg:#F44336;
    --sf-card-light-ink:#000000; --sf-card-dark-ink:#000000; --sf-card-mark:#F44336;
}
html.sf-pilot-modern.sf-pilot-legacy-colors body .dashboard .colorbox-6 {
    --sf-card-light-bg:#607D8B; --sf-card-dark-bg:#607D8B;
    --sf-card-light-ink:#000000; --sf-card-dark-ink:#000000; --sf-card-mark:#607D8B;
}
html.sf-pilot-modern.sf-pilot-legacy-colors body .dashboard .colorbox-7,
html.sf-pilot-modern.sf-pilot-legacy-colors body .dashboard .colorbox[style*="background-color: orange"] {
    --sf-card-light-bg:#FF9800; --sf-card-dark-bg:#FF9800;
    --sf-card-light-ink:#000000; --sf-card-dark-ink:#000000; --sf-card-mark:#FF9800;
}
html.sf-pilot-modern.sf-pilot-legacy-colors body .dashboard .colorbox-8 {
    --sf-card-light-bg:#E91E63; --sf-card-dark-bg:#E91E63;
    --sf-card-light-ink:#000000; --sf-card-dark-ink:#000000; --sf-card-mark:#E91E63;
}

html.sf-pilot-modern.sf-pilot-legacy-colors body .dashboard .colorbox,
html.sf-pilot-modern.sf-pilot-legacy-colors body .dashboard .colorbox .colorbox-count {
    color: var(--sf-card-ink, var(--sf-text)) !important;
}
html.sf-pilot-modern.sf-pilot-legacy-colors body :is(.ui-selectbooleanbutton, .ui-selectonebutton > .ui-button, .ui-selectmanybutton > .ui-button).ui-state-active {
    background: var(--sf-action-bg) !important; color: var(--sf-action-ink) !important;
    border-color: var(--sf-action-bg) !important;
}
