/* Tema compartilhado — Aviva Studio */
:root{color-scheme:light}html.aviva-dark{color-scheme:dark}
html.aviva-dark body{background:#17191e!important;color:#f3eee7!important}
html.aviva-dark :is(main,section,article,aside,nav,footer,.panel,.card,.item,.details,.box,.container,.wrap,.content,.section,.gallery-section,.intro,.events,.contact,.contact-panel,.event-note,.gallery-album,.stat,.tile,.metric,.sidebar,.modal-content,.dialog-content){border-color:#454953;color:inherit}
html.aviva-dark :is(.panel,.card,.item,.details,.contact-panel,.event-note,.gallery-album,.stat,.tile,.metric,.modal-content,.dialog-content){background:#252932!important;color:#f3eee7!important;border-color:#454953!important}
html.aviva-dark :is(main,section,.gallery-section,.intro,.events,.contact){background-color:transparent;color:inherit}
html.aviva-dark :is(h1,h2,h3,h4,h5,h6,p,small,label,legend,td,th,li,.muted,.meta,.name,.hint,.subtitle){color:inherit}
html.aviva-dark :is(input,textarea,select,option){background:#20242c!important;color:#f3eee7!important;border-color:#646b77!important}
html.aviva-dark :is(table,thead,tbody,tr,td,th){border-color:#454953!important}
html.aviva-dark :is(th,thead){background:#303640!important;color:#f3eee7!important}
html.aviva-dark :is(a){color:#ffb7bc}
html.aviva-dark :is(header,nav,.sidebar){border-color:#454953}
html.aviva-dark :is(.status,.notice,.message,.alert,.info){background-color:#303640;color:#f3eee7}
html.aviva-dark :is(button.secondary,.secondary){background-color:#424a56;color:#fff}
#aviva-theme-toggle{position:fixed;right:16px;bottom:16px;z-index:10000;border:1px solid #7e6e69;border-radius:999px;padding:10px 15px;background:#252932;color:white;box-shadow:0 4px 20px #0004;font:600 13px system-ui;cursor:pointer}
#aviva-theme-toggle:focus-visible,.aviva-modal button:focus-visible{outline:3px solid #e76a76;outline-offset:2px}
.aviva-modal{position:fixed;inset:0;z-index:20000;display:grid;place-items:center;background:#0009;padding:20px}
.aviva-modal[hidden]{display:none!important}
.aviva-modal__box{width:min(100%,460px);background:#fffdfa;color:#252323;border-radius:16px;border:1px solid #d9cfc4;padding:24px;box-shadow:0 18px 60px #0006;font:15px/1.5 system-ui}
html.aviva-dark .aviva-modal__box{background:#272c35;color:#f3eee7;border-color:#59606b}
.aviva-modal__title{font-size:19px;font-weight:700;margin:0 0 10px}.aviva-modal__message{white-space:pre-wrap;overflow-wrap:anywhere;margin:0 0 20px}
.aviva-modal__actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}
.aviva-modal__actions button{font:600 14px system-ui;border:0;border-radius:8px;padding:10px 17px;cursor:pointer}
.aviva-modal__cancel{background:#e9e5e0;color:#292929}.aviva-modal__ok{background:#bd1928;color:white}
.aviva-modal__input{width:100%;box-sizing:border-box;padding:11px;margin:0 0 18px;border:1px solid #aaa;border-radius:8px}
@media(prefers-reduced-motion:reduce){.aviva-modal *{scroll-behavior:auto!important}}

/* V8: contraste acessível em componentes com cores fixas das páginas legadas */
html.aviva-dark :is(.gallery-album-body,.gallery-album-body h3,.gallery-album-body p,.gallery-empty,.gallery-empty strong,.section-heading,.section-heading h2,.section-heading p,.sidebar .tip,.sidebar h3,.panel .muted,.tile .muted,.tag,.notice,.status,.gallery-status){color:#f3eee7!important}
html.aviva-dark :is(.gallery-empty,.notice,.tag){background:#252932!important;border-color:#454953!important}
html.aviva-dark :is(.gallery-open,#galleryMore,.btn-red){color:#fff!important}
html.aviva-dark :is(.tile,.gallery-album-body,.gallery-album,.gallery-section){border-color:#454953!important}
html.aviva-dark :is(.eyebrow-dark){color:#ff9aa3!important}

/* V9 — contraste específico do painel da equipe (cores legadas fixas) */
html.aviva-dark .navbtn{color:#f3eee7!important;background:transparent!important}
html.aviva-dark .navbtn.active,html.aviva-dark .navbtn:hover{background:#443039!important;color:#ffd2d5!important}
html.aviva-dark :is(.stat,.stat span,.stat b,.stat strong,.tile,.tile span,.tile b,.item,.item p,.item strong,.content,.content p,.content span,.panel,.panel h1,.panel h2,.panel h3,.panel label,.hint,.muted,.member-shift,.member-shift strong,.member-shift .state){color:#f3eee7!important}
html.aviva-dark :is(.stat,.member-shift,#pastorNotice){background:#252932!important;border-color:#555c69!important}
html.aviva-dark #pastorNotice :is(h3,p,.notice-count){color:#f3eee7!important}
html.aviva-dark :is(.badge,.eyebrow){color:#ffb7bc!important;background:#443039}
html.aviva-dark :is(.error,.success){color:#f3eee7!important;background:#343a45!important}
html.aviva-dark :is(.btn,button:not(.navbtn)){color:#fff}
html.aviva-dark :is(.gallery-filters label,.gallery-filter-info){color:#f3eee7!important}

/* V10 — cores consistentes em todas as abas, inclusive páginas administrativas. */
html.aviva-dark { --cream:#17191e; --paper:#252932; --ink:#f3eee7; --muted:#c4c9d1; --line:#505765; --red:#ff7e8a; --bg:#17191e; --text:#f3eee7; --surface:#252932; }
html.aviva-dark body,html.aviva-dark main {background-color:#17191e!important;color:#f3eee7!important}
html.aviva-dark :is(.panel,.card,.tile,.item,.stat,.box,.content-card,.sidebar,.side,.notice,.tip,.gallery-empty,.gallery-album,.gallery-album-body,.contact-panel,.member-shift,.modal,.dialog,.tablewrap,.navlist,.tools,.notice-card) {background-color:#252932!important;color:#f3eee7!important;border-color:#505765!important}
html.aviva-dark :is(.panel,.card,.tile,.item,.stat,.box,.sidebar,.notice,.gallery-empty,.gallery-album,.gallery-album-body,.member-shift,.content) :is(h1,h2,h3,h4,h5,h6,p,span,small,strong,b,label,legend,li,td,th,.muted,.hint,.meta,.tip,.state) {color:#f3eee7!important}
html.aviva-dark :is(.muted,.hint,.meta,.tip,.subtitle,.gallery-status,.gallery-filter-info) {color:#c4c9d1!important}
html.aviva-dark :is(.navbtn,.side-tab button,.tools button) {color:#f3eee7!important;background:#303640!important;border-color:#646b77!important}
html.aviva-dark :is(.navbtn.active,.side-tab button.active,.navbtn:hover) {color:#fff!important;background:#80313b!important}
html.aviva-dark :is(input,select,textarea,option) {background:#20242c!important;color:#f3eee7!important;border-color:#707786!important}
html.aviva-dark :is(input,textarea)::placeholder {color:#bbc1cc!important;opacity:1}
html.aviva-dark :is(.gallery-section,.gallery-section .section-heading,.gallery-section .section-heading h2,.gallery-section .section-heading p,.gallery-filters label) {color:#f3eee7!important}
html.aviva-dark :is(.gallery-filters button,.gallery-open,.btn,.btn-red,button[type=submit]) {color:#fff!important}
html.aviva-dark :is(.msg.error,.msg.success,.error,.success) {background:#303640!important;color:#f3eee7!important}
html.aviva-dark :is(.badge,.eyebrow) {color:#ffb7bc!important}
html.aviva-dark :is(table,td,th,canvas) {border-color:#505765!important}
html.aviva-dark canvas {background:#fff!important}
/* Botão flutuante e modal não são afetados pelas cores de outros botões. */
html.aviva-dark #aviva-theme-toggle {color:#fff!important;background:#252932!important}
html.aviva-dark .aviva-modal__cancel {background:#424a56!important;color:#fff!important}
html.aviva-dark .aviva-modal__ok {background:#bd1928!important;color:#fff!important}

/* V11 — correção centralizada do tema escuro. Mantém as cores do tema claro. */
html.aviva-dark { color-scheme:dark; --cream:#17191e;--paper:#252932;--ink:#f3eee7;--muted:#c4c9d1;--line:#505765;--bg:#17191e;--surface:#252932;--text:#f3eee7; }
html.aviva-dark body { background:#17191e!important; color:#f3eee7!important; }
/* Faixas claras legadas: cabeçalho, rodapé e navegação. */
html.aviva-dark :is(header,footer,.header,.site-header,.topbar,.top-bar,.navbar,.nav-bar,.footer,.site-footer,.headbar,.toolbar,.tabs,.tab-bar,.tablist) { background-color:#20242c!important;color:#f3eee7!important;border-color:#505765!important; }
html.aviva-dark :is(header,footer,.header,.site-header,.topbar,.top-bar,.navbar,.nav-bar,.footer,.site-footer) :is(a,span,p,small,strong,b,label) { color:#f3eee7!important; }
html.aviva-dark :is(.tabs button,.tab-bar button,.tablist button,.tabs .btn,.nav-tabs button) {background:#303640!important;color:#f3eee7!important;border:1px solid #646b77!important;}
html.aviva-dark :is(.tabs button.active,.tab-bar button.active,.tablist button.active,.tabs button[aria-selected="true"],.nav-tabs button.active) {background:#9c3340!important;color:#fff!important;border-color:#bd5360!important;}
/* Superfícies com fundos claros fixos no CSS das páginas. */
html.aviva-dark :is(.message,.alert,.info,.status,.notification,.toast,.tag,.chip,.pill,.badge,.filter,.filters,.filter-bar,.filter-panel,.search-box,.search-panel,.tab-content,.tab-pane,.form-group,.form-card,.field-group,.list-item,.list-group,.item,.member,.member-card,.shift,.shift-card,.schedule,.schedule-card,.event-card,.album-card,.photo-card,.gallery-card,.media-card,.upload-card,.approval-card,.notice-card,.summary,.summary-card,.metric,.stat,.table-container,.table-wrapper,.tablewrap,.table-responsive) {background-color:#252932!important;color:#f3eee7!important;border-color:#505765!important;}
html.aviva-dark :is(.message,.alert,.info,.status,.notification,.toast,.tag,.chip,.pill,.filter,.filters,.filter-bar,.filter-panel,.search-box,.search-panel,.tab-content,.tab-pane,.form-card,.list-item,.member-card,.shift-card,.schedule-card,.event-card,.album-card,.gallery-card,.media-card,.upload-card,.approval-card,.notice-card,.summary-card,.metric,.stat) :is(h1,h2,h3,h4,p,span,small,strong,b,label,li) {color:#f3eee7!important;}
html.aviva-dark :is(.message.error,.message.success,.message.warning,.alert-danger,.alert-success,.alert-warning) {background:#343a45!important;color:#f3eee7!important;}
html.aviva-dark :is(.message.error,.message.success,.message.warning) * {color:#f3eee7!important;}
/* Ações: não aplicar texto branco a botões cujo fundo permanece branco. */
html.aviva-dark :is(button,.btn,[role="button"]) {border-color:#646b77;}
html.aviva-dark :is(button.secondary,.btn.secondary,button.outline,.btn-outline,button.ghost,.btn-ghost) {background-color:#424a56!important;color:#fff!important;}
html.aviva-dark :is(button:not(.secondary):not(.active):not(.danger),.btn:not(.secondary):not(.active):not(.danger)) {color:#fff;}
html.aviva-dark :is(input,select,textarea) {background-color:#20242c!important;color:#f3eee7!important;border-color:#707786!important;}
html.aviva-dark :is(input[type="checkbox"],input[type="radio"]) {accent-color:#ed7885;}
html.aviva-dark :is(input[type="date"],input[type="datetime-local"]) {color-scheme:dark;}
html.aviva-dark :is(a:not(.btn),.link) {color:#ffb7bc;}
html.aviva-dark :is(hr,.divider) {border-color:#505765!important;}
/* Exceções de componentes que necessitam de fundo próprio. */
html.aviva-dark :is(.aviva-modal,.aviva-modal__overlay) {background-color:#0009!important;}
html.aviva-dark .aviva-modal__box {background-color:#272c35!important;color:#f3eee7!important;}
html.aviva-dark #aviva-theme-toggle {background:#252932!important;color:#fff!important;}
html.aviva-dark .aviva-modal__cancel {background:#424a56!important;color:#fff!important;}
html.aviva-dark .aviva-modal__ok {background:#bd1928!important;color:#fff!important;}

/* V12 — identidade vermelha e profundidade do tema escuro. */
html.aviva-dark{--red:#c41625;--accent:#c41625;--primary:#c41625;--danger:#b91c2b;accent-color:#c41625}
/* Restaurar contraste e separação das seções sem alterar o modo claro. */
html.aviva-dark body{background:#17191e!important}
html.aviva-dark :is(.events,.online){background:#211d1b!important;color:#f8f1e9!important}
html.aviva-dark :is(.intro,.about,.pastor-section,.gallery-section,.contact){background:#292421!important;color:#f8f1e9!important}
html.aviva-dark :is(.hero){background:#24201e!important;color:#fff!important}
html.aviva-dark :is(.contact-panel,.gallery-album,.gallery-empty,.card,.panel,.tile){background:#302d30!important;border-color:#514b4e!important}
html.aviva-dark :is(.intro,.about,.pastor-section,.gallery-section,.contact) :is(h1,h2,h3,p,small,label){color:#f8f1e9!important}
html.aviva-dark :is(.events,.online) :is(h1,h2,h3,p){color:#f8f1e9!important}
/* Cartões de membros eram brancos com letras quase brancas. */
html.aviva-dark .person{background:#2b2f38!important;color:#f8f1e9!important;border-color:#555b67!important}
html.aviva-dark .person :is(.person-name,.person-email,label,.small-note){color:#f8f1e9!important}
html.aviva-dark .person .person-email{color:#cbd0d8!important}
html.aviva-dark .person .tag{background:#1e4837!important;color:#e4fff0!important}
html.aviva-dark .person .tag.off{background:#582b30!important;color:#ffe2e2!important}
html.aviva-dark .person select{background:#20242c!important;color:#fff!important;border-color:#707786!important}
/* Ações principais vermelhas, secundárias cinza. */
html.aviva-dark :is(.btn-red,.permission-link,.nav-cta,button[type="submit"],.person-controls button:not(.secondary),#saveBtn,.aviva-modal__ok){background:#c41625!important;color:#fff!important;border-color:#c41625!important}
html.aviva-dark :is(.btn-red,.permission-link,.nav-cta,button[type="submit"],.person-controls button:not(.secondary),#saveBtn,.aviva-modal__ok):not(:disabled):hover{background:#9f1220!important;border-color:#9f1220!important}
html.aviva-dark :is(button.secondary,.btn.secondary,.person-controls button.secondary,#reloadTeam){background:#424a56!important;color:#fff!important;border-color:#646b77!important}
html.aviva-dark :is(button,.btn):disabled{opacity:.55;cursor:not-allowed}
html.aviva-dark :is(.eyebrow,.eyebrow-dark){background:transparent!important;color:#ff8b92!important}
html.aviva-dark .section-heading{background:transparent!important}
html.aviva-dark .card-icon{background:#4b3032!important;color:#ff8b92!important}
html.aviva-dark .text-link{color:#ff9ca2!important}
html.aviva-dark :is(.aviva-modal__cancel,#aviva-theme-toggle){background:#424a56!important;color:#fff!important}

/* Aviva - harmonização de tema e imagens */
#aviva-theme-toggle{position:fixed!important;right:18px!important;bottom:18px!important;top:auto!important;left:auto!important;z-index:9998!important;max-width:170px!important;white-space:nowrap!important}
html.aviva-dark .card,html.aviva-dark .gallery-album,html.aviva-dark .panel,html.aviva-dark .item{background:#302d30!important;color:#f7f3ef!important;border-color:#51484a!important}
html.aviva-dark .card p,html.aviva-dark .gallery-album p,html.aviva-dark .panel .muted{color:#ddd3d1!important}
html.aviva-dark h1,html.aviva-dark h2,html.aviva-dark h3{color:#fff5f0}
a.text-link,.gallery-album a{color:#c41625}
.gallery-preview,.gallery-album img{aspect-ratio:4/5!important;height:auto!important;object-fit:contain!important;background:#181818}
.gallery-grid{align-items:start}
@media(max-width:650px){#aviva-theme-toggle{right:10px!important;bottom:10px!important}}

/* Outubro 2026: contrastes e controles sem cores fixas conflitantes. */
html:not(.aviva-dark) :is(.panel,.card,.item,.tile,.details,.aviva-notify-entry){color:#272527}
html:not(.aviva-dark) :is(input,select,textarea){color:#272527;background:#fffdfa}
html.aviva-dark :is(.aviva-notify-entry,#avivaNotifyPanel,.card,.panel,.item,.detail,.summary,.gallery-card){background:#252932!important;color:#f5f0e8!important;border-color:#5a6070!important}
html.aviva-dark :is(.aviva-notify-entry a,.aviva-notify-entry small,#avivaNotifyPanel h3){color:#f5f0e8!important}
html.aviva-dark input[type=checkbox]{accent-color:#ee8994}
html:not(.aviva-dark) #aviva-theme-toggle{background:#fffdfa;color:#261f25;border-color:#bdb2a7}
