/* Adaptação de estrutura do Gateway. Tokens, botões e temas vêm do SmartNFe. */
html.sf-pilot-modern #form_login .md-inputfield { display:flex; flex-direction:column-reverse; text-align:left; margin:0; }
html.sf-pilot-modern #form_login .md-inputfield label { position:static !important; transform:none !important; margin:0 0 8px; color:var(--sf-text) !important; font-size:14px !important; font-weight:600; }
html.sf-pilot-modern #form_login .md-inputfield input { width:100%; min-height:46px; padding:10px 12px; box-sizing:border-box; font-size:16px; }
html.sf-pilot-modern body.login-body .sf-xml-login-description { margin:0 0 22px !important; }
html.sf-pilot-modern #form_login { width:100%; }
html.sf-pilot-modern #form_login .sf-pilot-login-submit { background:var(--sf-action-bg) !important; color:#fff !important; }
html.sf-pilot-modern #form_login .sf-pilot-login-register { background:transparent !important; color:var(--sf-accent) !important; border:1px solid var(--sf-accent); }
html.sf-pilot-modern body.login-body .login-panel > .ui-g ~ .ui-panelgrid { margin:18px 0; width:100%; }
html.sf-pilot-modern .landing-wrapper #pricing { background:transparent !important; }
html.sf-pilot-modern .landing-wrapper #pricing .pricing-box .card { padding:22px; }
html.sf-pilot-modern .landing-wrapper #pricing .pricing-header { background:var(--sf-soft) !important; border-radius:8px; color:var(--sf-text) !important; }
html.sf-pilot-modern .landing-wrapper #pricing .pricing-header .name { color:var(--sf-text) !important; }
html.sf-pilot-modern body .ui-fieldset { border-radius:10px; border-color:var(--sf-border); }

/* Os indicadores do Gateway mantêm sua família de cor com a paleta suave do SmartNFe. */
html.sf-pilot-modern body .card:is(.shadow-box, .box) {
    --sf-xml-card-bg:var(--sf-card-light-bg, var(--sf-surface));
    --sf-xml-card-ink:var(--sf-card-light-ink, var(--sf-text));
    background:var(--sf-xml-card-bg) !important; color:var(--sf-xml-card-ink) !important;
    border-left:4px solid var(--sf-card-mark, var(--sf-border)); box-shadow:var(--sf-shadow);
}
html.sf-pilot-modern.sf-pilot-dark body .card:is(.shadow-box, .box) {
    --sf-xml-card-bg:var(--sf-card-dark-bg, var(--sf-surface));
    --sf-xml-card-ink:var(--sf-card-dark-ink, var(--sf-text));
}
html.sf-pilot-modern body .card.shadow-box .ui-outputlabel,
html.sf-pilot-modern body .card.box :is(.box-name, .box-count, .box-count2, .box-count3, .box-count4, .box-badge) {
    color:var(--sf-xml-card-ink) !important; opacity:1;
}
html.sf-pilot-modern body .card.box .box-badge { background:var(--sf-soft); }
html.sf-pilot-modern body .card.box > img { opacity:.20; }
/* Filtros e células tinham cor preta fixa no CSS legado. */
html.sf-pilot-modern body .ui-datatable-resizable :is(thead th, tbody td, tfoot td),
html.sf-pilot-modern body .ui-datatable thead th:is(.ui-state-active, .ui-state-highlight) .ui-inputfield,
html.sf-pilot-modern body .ui-selectcheckboxmenu-panel .ui-selectcheckboxmenu-filter-container .ui-inputfield {
    color:var(--sf-text) !important;
}
html.sf-pilot-modern body .font_blue_smartxml { color:var(--sf-accent) !important; }
html.sf-pilot-modern body .card:is(.green_smartxml, .box-verde, [style*="background-color: green"]) { --sf-card-light-bg:#e5f4e8; --sf-card-light-ink:#245c32; --sf-card-dark-bg:#203c2c; --sf-card-dark-ink:#b5e4c0; --sf-card-mark:#4caf50; }
html.sf-pilot-modern body .card:is(.blue_smartxml, .box-azul) { --sf-card-light-bg:#e0f2fc; --sf-card-light-ink:#145778; --sf-card-dark-bg:#19394b; --sf-card-dark-ink:#b3e1f7; --sf-card-mark:#03a9f4; }
html.sf-pilot-modern body .card:is(.purple_smartxml) { --sf-card-light-bg:#eee7fa; --sf-card-light-ink:#56328a; --sf-card-dark-bg:#342745; --sf-card-dark-ink:#ddc5fa; --sf-card-mark:#8862c6; }
html.sf-pilot-modern body .card:is(.yellow_smartxml, .box-laranja, [style*="background-color: orange"], [style*="background-color: yellow"]) { --sf-card-light-bg:#fff0db; --sf-card-light-ink:#855019; --sf-card-dark-bg:#493721; --sf-card-dark-ink:#f5d39f; --sf-card-mark:#e49a35; }
html.sf-pilot-modern body .card:is(.box-vermelho, [style*="background-color: red"]) { --sf-card-light-bg:#fde7e7; --sf-card-light-ink:#8b3036; --sf-card-dark-bg:#47282f; --sf-card-dark-ink:#fac0c4; --sf-card-mark:#dc5963; }
html.sf-pilot-modern body .card:is([style*="background-color: #5c5c5c"], [style*="background-color: #777d81"]) { --sf-card-light-bg:#e7eff0; --sf-card-light-ink:#3d5b61; --sf-card-dark-bg:#293a40; --sf-card-dark-ink:#c4dce0; --sf-card-mark:#648288; }

/* Cabeçalhos personalizados: as tabelas internas herdam a superfície do th.
   A regra fica restrita ao thead; conteúdo, dados e filtros continuam no JSF. */
html.sf-pilot-modern body .ui-datatable thead th .ui-panelgrid {
    width:100%; max-width:100%; margin:0; box-sizing:border-box;
}
html.sf-pilot-modern body .ui-datatable thead th .ui-panelgrid,
html.sf-pilot-modern body .ui-datatable thead th .ui-panelgrid :is(.ui-panelgrid-content, .ui-panelgrid-cell, tr, td) {
    background:transparent !important; color:inherit !important;
    border:0 !important; box-shadow:none;
}
html.sf-pilot-modern body .ui-datatable thead th .ui-panelgrid .ui-panelgrid-cell {
    padding:4px 3px; min-width:0; box-sizing:border-box;
}
html.sf-pilot-modern body .ui-datatable thead th .ui-panelgrid :is(.ui-outputlabel, .ui-outputtext) { color:inherit !important; }
html.sf-pilot-modern body .ui-datatable thead th .ui-panelgrid .ui-inputfield {
    width:100%; max-width:100%; box-sizing:border-box;
}
html.sf-pilot-modern body .ui-datatable thead th .ui-panelgrid .ui-inputnumber {
    display:block; width:100%; min-width:0;
}
html.sf-pilot-modern body .ui-datatable thead th .ui-panelgrid .ui-calendar {
    display:flex; align-items:stretch; width:100%; min-width:0;
}
html.sf-pilot-modern body .ui-datatable thead th .ui-panelgrid .ui-calendar > .ui-inputfield {
    flex:1 1 auto; width:1%; min-width:0 !important;
}
/* O ícone absoluto precisa ter o próprio botão como referência de posição. */
html.sf-pilot-modern body .ui-datatable thead th .ui-panelgrid .ui-calendar > .ui-datepicker-trigger {
    position:relative; top:auto; right:auto; bottom:auto; left:auto;
    flex:0 0 28px; width:28px; margin:0; padding:0; height:26px; min-height:26px;
    align-self:center;
}
html.sf-pilot-modern body .ui-datatable thead th .ui-panelgrid .ui-calendar > .ui-datepicker-trigger .ui-icon {
    position:absolute; top:50%; left:50%; margin:0;
    transform:translate(-50%, -50%);
}
/* O texto acompanha o fundo do campo, independentemente da cor do topo. */
html.sf-pilot-modern body .layout-wrapper .topbar .topbar-right .topbar-items .search-item input.inputTextChavePesquisaRapida {
    color:var(--sf-text) !important; caret-color:var(--sf-text);
    background-color:var(--sf-field-bg) !important; top:0;
}
html.sf-pilot-modern body .topbar input.inputTextChavePesquisaRapida::placeholder {
    color:var(--sf-muted) !important; opacity:1;
}
html.sf-pilot-modern body .topbar input.inputTextChavePesquisaRapida::-webkit-input-placeholder {
    color:var(--sf-muted) !important; opacity:1;
}

/* Início: atalhos em grade, com hierarquia e listas alinhadas. */
.sf-xml-home-heading, .sf-xml-home-icon { display:none; }
html.sf-pilot-modern body .sf-xml-home #pricing {
    width:100%; max-width:1400px; margin:0 auto; padding:24px 16px 32px;
    box-sizing:border-box; text-align:left;
}
html.sf-pilot-modern body .sf-xml-home .sf-xml-home-heading { display:block; margin:0 0 24px; }
html.sf-pilot-modern body .sf-xml-home-heading h1 { margin:0 0 6px; font-size:28px; line-height:1.25; font-weight:700; color:var(--sf-text); }
html.sf-pilot-modern body .sf-xml-home #pricing .sf-xml-home-heading p { margin:0; color:var(--sf-muted); font-size:14px; line-height:1.5; }
html.sf-pilot-modern body .sf-xml-home #pricing .sf-xml-home-grid {
    display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; align-items:stretch;
}
html.sf-pilot-modern body .sf-xml-home-grid::before,
html.sf-pilot-modern body .sf-xml-home-grid::after { display:none; content:none; }
html.sf-pilot-modern body .sf-xml-home #pricing .sf-xml-home-item {
    float:none; width:auto; min-width:0; margin:0; padding:0; display:flex;
}
html.sf-pilot-modern body .sf-xml-home #pricing .sf-xml-home-card {
    position:relative; width:100%; height:auto; min-height:238px; margin:0;
    box-sizing:border-box; padding:20px; text-align:left;
    border:1px solid var(--sf-border); border-radius:12px; box-shadow:var(--sf-shadow);
}
html.sf-pilot-modern body .sf-xml-home #pricing .sf-xml-home-card-header {
    display:flex; align-items:center; gap:12px; min-height:38px;
    padding:0; margin:0 0 14px; border-radius:0; background:transparent !important;
}
html.sf-pilot-modern body .sf-xml-home #pricing .sf-xml-home-icon {
    display:flex; align-items:center; justify-content:center; flex:0 0 38px;
    width:38px; height:38px; border-radius:10px; font-size:19px;
    color:var(--sf-accent) !important; background:var(--sf-selected);
}
html.sf-pilot-modern body .sf-xml-home #pricing .sf-xml-home-card-header .name {
    display:block; font-size:17px; line-height:1.35; font-weight:650;
    color:var(--sf-text) !important; overflow-wrap:anywhere;
}
html.sf-pilot-modern body .sf-xml-home #pricing .sf-xml-home-description {
    margin:0 0 14px; color:var(--sf-muted); font-size:13px; line-height:1.6;
}
html.sf-pilot-modern body .sf-xml-home #pricing .sf-xml-home-features {
    display:grid; gap:5px; margin:0; padding:0; list-style:none;
    color:var(--sf-text); font-size:13px; line-height:1.5;
}
html.sf-pilot-modern body .sf-xml-home #pricing .sf-xml-home-features li {
    position:relative; margin:0; padding:0 0 0 12px; overflow-wrap:anywhere;
}
html.sf-pilot-modern body .sf-xml-home #pricing .sf-xml-home-features li::before {
    content:''; position:absolute; top:.55em; left:0; width:4px; height:4px;
    border-radius:50%; background:var(--sf-muted);
}
html.sf-pilot-modern body .sf-xml-home #pricing .sf-xml-home-features-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
/* O próprio atalho existente cobre o cartão; não há outro botão ou handler. */
html.sf-pilot-modern body .sf-xml-home .sf-xml-home-link::after { content:''; position:absolute; inset:0; border-radius:12px; }
html.sf-pilot-modern body .sf-xml-home #pricing .sf-xml-home-card:has(.sf-xml-home-link):is(:hover,:focus-within) {
    border-color:var(--sf-accent); box-shadow:0 0 0 1px var(--sf-accent), var(--sf-shadow);
}
html.sf-pilot-modern body .sf-xml-home .sf-xml-home-link:focus-visible { outline:none; }
@media(max-width:1100px) {
    html.sf-pilot-modern body .sf-xml-home #pricing .sf-xml-home-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media(max-width:820px) {
    html.sf-pilot-modern body .sf-xml-home #pricing .sf-xml-home-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:540px) {
    html.sf-pilot-modern body .sf-xml-home #pricing { padding:20px 0; }
    html.sf-pilot-modern body .sf-xml-home #pricing .sf-xml-home-grid { grid-template-columns:minmax(0,1fr); gap:12px; }
    html.sf-pilot-modern body .sf-xml-home #pricing .sf-xml-home-card { min-height:0; }
    html.sf-pilot-modern body .sf-xml-home-heading h1 { font-size:24px; }
}

/* Notificações do Gateway: grupos e ações reais do painel lateral. */
html.sf-pilot-modern body .layout-wrapper .layout-rightpanel { background:var(--sf-bg) !important; color:var(--sf-text); }
html.sf-pilot-modern body .layout-wrapper .layout-rightpanel .layout-rightpanel-header {
    display:flex; flex-direction:row-reverse; align-items:center; justify-content:space-between; gap:12px;
    padding:16px; background:var(--sf-surface) !important; background-image:none !important;
    border-bottom:1px solid var(--sf-border);
}
html.sf-pilot-modern body .layout-wrapper .layout-rightpanel .layout-rightpanel-header .weather-day {
    padding:0; left:auto; text-align:left !important; color:var(--sf-text);
    font-size:18px; font-weight:700; line-height:1.4;
}
html.sf-pilot-modern body .layout-wrapper .layout-rightpanel .layout-rightpanel-header .rightpanel-btn {
    display:flex; align-items:center; justify-content:center; flex:0 0 32px;
    width:32px; height:32px; border-radius:8px; color:var(--sf-muted);
}
html.sf-pilot-modern body .layout-wrapper .layout-rightpanel .layout-rightpanel-header .rightpanel-btn .material-icons { color:var(--sf-muted) !important; }
html.sf-pilot-modern body .layout-wrapper .layout-rightpanel .layout-rightpanel-header .rightpanel-btn:is(:hover,:focus-visible) {
    background:var(--sf-selected); outline:2px solid var(--sf-accent); outline-offset:1px;
}
html.sf-pilot-modern body .layout-wrapper .layout-rightpanel .layout-rightpanel-content { padding:18px 14px 100px; background:transparent !important; color:var(--sf-text); }
html.sf-pilot-modern body .layout-wrapper .layout-rightpanel .sf-xml-notification-group {
    padding:0; margin:0 0 22px; border:0 !important; background:transparent !important; box-shadow:none;
}
html.sf-pilot-modern body .layout-wrapper .layout-rightpanel .sf-xml-notification-group > .ui-fieldset-legend {
    box-sizing:border-box; max-width:100%; padding:0 0 10px; border:0 !important;
    background:transparent !important; color:var(--sf-muted) !important;
    font-size:12px; font-weight:700; line-height:1.5; letter-spacing:.03em;
    white-space:normal; overflow-wrap:anywhere;
}
html.sf-pilot-modern body .layout-wrapper .layout-rightpanel .sf-xml-notification-group > .ui-fieldset-content { padding:0; }
html.sf-pilot-modern body .layout-rightpanel .sf-xml-notification-list { display:grid; gap:10px; }
html.sf-pilot-modern body .layout-rightpanel .sf-xml-notification-list > br { display:none; }
html.sf-pilot-modern body .layout-wrapper .layout-rightpanel .sf-xml-notification.ui-button {
    --sf-notification-bg:var(--sf-alert-info-bg); --sf-notification-ink:var(--sf-alert-info-ink); --sf-notification-edge:var(--sf-alert-info-edge);
    display:block; width:100%; box-sizing:border-box; margin:0; text-align:left;
    background:var(--sf-notification-bg) !important; color:var(--sf-notification-ink) !important;
    border:1px solid var(--sf-notification-edge) !important; border-left-width:4px !important;
    border-radius:10px; box-shadow:none !important; overflow:visible;
}
html.sf-pilot-modern body .layout-wrapper .layout-rightpanel .sf-xml-notification.red-btn {
    --sf-notification-bg:var(--sf-alert-error-bg); --sf-notification-ink:var(--sf-alert-error-ink); --sf-notification-edge:var(--sf-alert-error-edge);
}
html.sf-pilot-modern body .layout-wrapper .layout-rightpanel .sf-xml-notification.orange-btn {
    --sf-notification-bg:var(--sf-alert-warn-bg); --sf-notification-ink:var(--sf-alert-warn-ink); --sf-notification-edge:var(--sf-alert-warn-edge);
}
html.sf-pilot-modern body .layout-wrapper .layout-rightpanel .sf-xml-notification .ui-button-text {
    padding:12px 10px; color:inherit !important; white-space:normal; overflow-wrap:anywhere;
    font-size:13px; font-weight:500; line-height:1.5; text-align:left;
}
html.sf-pilot-modern body .layout-wrapper .layout-rightpanel .sf-xml-notification.ui-button:is(:hover,:focus-visible) {
    box-shadow:0 0 0 1px var(--sf-notification-edge) !important; outline:2px solid var(--sf-notification-edge); outline-offset:2px;
}

/* Recuperação de senha deve participar da altura do cartão, mesmo com a grade flutuante. */
html.sf-pilot-modern body.login-body .login-panel > .sf-pilot-login-recovery { display:flow-root; clear:both; width:100%; margin:0; }
html.sf-pilot-modern body.login-body .login-panel .sf-pilot-login-recovery > .ui-g-12,
html.sf-pilot-modern body.login-body .login-panel .sf-pilot-login-recovery > .ui-g-12 > .ui-g-12 { float:none; width:100%; box-sizing:border-box; }
html.sf-pilot-modern body.login-body .login-panel .sf-pilot-login-recovery > .ui-g-12 a { display:inline-flex; align-items:center; justify-content:center; min-height:40px; max-width:100%; color:var(--sf-accent) !important; font-size:14px; font-weight:600; line-height:1.4; text-decoration:none; }
html.sf-pilot-modern body.login-body .login-panel .sf-pilot-login-recovery > .ui-g-12 a:hover { text-decoration:underline; }
html.sf-pilot-modern body.login-body .login-panel .sf-pilot-login-recovery > .ui-g-12 a:focus-visible { outline:2px solid var(--sf-accent); outline-offset:3px; border-radius:4px; }
