:root{color-scheme:light}
:root[data-theme="dark"]{color-scheme:dark;--bg:#0d1728;--surface:#142238;--surface-soft:#192a43;--ink:#f3f7f7;--navy:#f3f7f7;--muted:#acbbc4;--line:#344961;--teal:#67c9bd;--orange:#ff9472}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:44px;height:42px;padding:0 13px;border:1px solid #dbe6e2;border-radius:14px;background:#f7faf8;color:#284e4b;font:700 13px/1 inherit;cursor:pointer;transition:.2s ease}
.theme-toggle:hover{border-color:#75bdb4;transform:translateY(-1px)}.theme-toggle span:first-child{font-size:18px}.appearance-panel{padding:28px}.appearance-heading{display:flex;gap:16px;align-items:center;margin-bottom:24px}.appearance-heading h3,.appearance-heading p{margin:0}.appearance-icon{display:grid;place-items:center;width:58px;height:58px;border-radius:18px;background:#e4f4f1;color:#238f84;font-size:26px}.theme-choices{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.theme-choices button{display:grid;grid-template-columns:42px 1fr;grid-template-rows:auto auto;text-align:left;gap:2px 12px;padding:18px;border:1px solid #d8e5e1;border-radius:18px;background:#fafcfa;color:#1b2c42;cursor:pointer}.theme-choices button>span{grid-row:1/3;display:grid;place-items:center;width:42px;height:42px;border-radius:13px;background:#edf4f2;font-size:21px}.theme-choices small{color:#728087}.theme-choices button.active{border-color:#ef7b59;box-shadow:0 0 0 2px rgba(239,123,89,.16);background:#fff8f4}.appearance-note{display:flex;gap:10px;margin-top:18px;padding:15px 17px;border-radius:15px;background:#edf7f4;color:#42615e}.appearance-note span{color:#667b79}

:root[data-theme="dark"] body,:root[data-theme="dark"] .workspace,:root[data-theme="dark"] .content,:root[data-theme="dark"] .page-content{background:#0d1728!important;color:#f3f7f7!important}
:root[data-theme="dark"] .topbar,:root[data-theme="dark"] .top-bar{background:#111d30!important;border-color:#30445c!important}
:root[data-theme="dark"] :where(.panel,.card,.metric-card,.summary-card,.settings-panel,.security-grid article,.modal-card,.modal-content,.popover,.dropdown,.dropdown-menu,.empty-state,.calendar-shell,.agenda-card,.form-card,.table-wrap,.auth-panel,.auth-card,.search-results,.notification-panel){background:#142238!important;border-color:#344961!important;box-shadow:0 18px 44px rgba(0,0,0,.24)!important}
:root[data-theme="dark"] :where(.metrics>article,.privacy-dashboard-card,.appointment-list>button,.dashboard-update-notice,.demo-banner,.demo-entry,.privacy-note,.calendar-connected-head,.calendar-privacy-note,.calendar-settings-form .privacy-choice,.calendar-error,.notebook-boundary,.audit-toolbar label,.help-guides article,.onboarding-list>button,.ops-complete-banner,.release-metrics article,.release-card,.release-policy,.storage-privacy-banner){background:#142238!important;border-color:#344961!important;color:#f3f7f7!important;box-shadow:0 14px 34px rgba(0,0,0,.18)!important}
:root[data-theme="dark"] :where(.metrics>article,.privacy-dashboard-card,.appointment-list>button,.dashboard-update-notice,.demo-banner,.demo-entry,.privacy-note,.calendar-connected-head,.calendar-privacy-note,.calendar-settings-form .privacy-choice,.calendar-error,.notebook-boundary,.audit-toolbar label,.help-guides article,.onboarding-list>button,.ops-complete-banner,.release-metrics article,.release-card,.release-policy,.storage-privacy-banner) :where(h1,h2,h3,h4,strong,b,span,label){color:#f3f7f7!important}
:root[data-theme="dark"] :where(.metrics>article,.privacy-dashboard-card,.appointment-list>button,.dashboard-update-notice,.demo-banner,.demo-entry,.privacy-note,.calendar-connected-head,.calendar-privacy-note,.calendar-settings-form .privacy-choice,.calendar-error,.notebook-boundary,.audit-toolbar label,.help-guides article,.onboarding-list>button,.ops-complete-banner,.release-metrics article,.release-card,.release-policy,.storage-privacy-banner) :where(p,small,time,em){color:#acbbc4!important}
:root[data-theme="dark"] .dashboard-update-notice>span:first-child,:root[data-theme="dark"] .demo-banner>span{background:#d96849!important;color:#fff!important}
:root[data-theme="dark"] .appointment-list>button:hover{background:#1a2d47!important;border-color:#5c7c91!important}
:root[data-theme="dark"] :where(.badge.completed,.badge.confirmed){background:#173f3b!important;color:#a6eee5!important}
:root[data-theme="dark"] .badge.scheduled{background:#49371d!important;color:#ffd79e!important}
:root[data-theme="dark"] :where(.metric-icon.blue,.privacy-dashboard-card>span,.help-guides article>span){background:#20364c!important;color:#a8dbe2!important}
:root[data-theme="dark"] :where(.ops-empty.success,.privacy-dashboard-card a,.privacy-dashboard-card button,.context-help-button){color:#9be7df!important}
:root[data-theme="dark"] :where(.agenda-summary>article,.agenda-filters,.agenda-view-switch,.agenda-period-nav,.day-view){background:#142238!important;border-color:#344961!important;color:#f3f7f7!important;box-shadow:0 14px 34px rgba(0,0,0,.18)!important}
:root[data-theme="dark"] :where(.agenda-summary>article,.agenda-filters,.agenda-view-switch,.agenda-period-nav,.day-view) :where(h1,h2,h3,h4,strong,b,label,span){color:#f3f7f7!important}
:root[data-theme="dark"] :where(.agenda-summary>article,.agenda-filters,.agenda-view-switch,.agenda-period-nav,.day-view) :where(p,small,time){color:#acbbc4!important}
:root[data-theme="dark"] .agenda-event{background:#192a43!important;border-color:#405872!important;color:#f3f7f7!important}
:root[data-theme="dark"] .agenda-event:hover{background:#203650!important;border-color:#6a879c!important}
:root[data-theme="dark"] .agenda-event.status-completed{border-left-color:#6c90b8!important}
:root[data-theme="dark"] .agenda-event.status-confirmed{border-left-color:#67c9bd!important}
:root[data-theme="dark"] .agenda-event.status-scheduled{border-left-color:#ff9472!important}
:root[data-theme="dark"] :where(.agenda-view-switch button,.agenda-period-nav button,.agenda-filters button){color:#dce9e8!important}
:root[data-theme="dark"] :where(.search,.search input){background:#192a43!important;color:#f3f7f7!important;border-color:#405872!important}
:root[data-theme="dark"] :where(.google-meet-choice,.modal .check,.modal .privacy-choice){background:#192a43!important;color:#f3f7f7!important;border-color:#405872!important}
:root[data-theme="dark"] :where(.google-meet-choice,.modal .check,.modal .privacy-choice) :where(strong,span,label){color:#f3f7f7!important}
:root[data-theme="dark"] :where(.google-meet-choice,.modal .check,.modal .privacy-choice) :where(p,small){color:#acbbc4!important}
:root[data-theme="dark"] .profile-permission-note{background:#192a43!important;color:#f3f7f7!important;border-color:#405872!important}
:root[data-theme="dark"] .profile-permission-note :where(strong,span){color:#f3f7f7!important}
:root[data-theme="dark"] .profile-permission-note :where(p,small){color:#acbbc4!important}
:root[data-theme="dark"] .metric-icon.teal{background:#183b3b!important;color:#79d2c6!important}
:root[data-theme="dark"] .metric-icon.coral{background:#4b2c2a!important;color:#ffad91!important}
:root[data-theme="dark"] .metric-icon.gold{background:#403727!important;color:#f2c776!important}
:root[data-theme="dark"] :where(input,select,textarea,[contenteditable="true"]){background:#192a43!important;color:#f5f8f8!important;border-color:#405872!important;caret-color:#ff9472!important}
:root[data-theme="dark"] :where(input,select,textarea)::placeholder{color:#8fa0ad!important;opacity:1}
:root[data-theme="dark"] :where(input,select,textarea):focus{border-color:#ff9472!important;box-shadow:0 0 0 3px rgba(255,148,114,.19)!important;outline:0}
:root[data-theme="dark"] :where(table,thead,tbody,tr,th,td){border-color:#344961!important}:root[data-theme="dark"] thead,:root[data-theme="dark"] th{background:#192a43!important}:root[data-theme="dark"] tbody tr:hover{background:#1a2c46!important}
:root[data-theme="dark"] :where(.secondary,.ghost,.compact.secondary,.theme-toggle,.settings-tabs button){background:#192a43!important;color:#dff5f1!important;border-color:#3c566b!important}
:root[data-theme="dark"] :where(.primary,[class*="primary"],button.primary,a.primary){color:#fff!important}
:root[data-theme="dark"] :where(.settings-tabs,.tabs,.filters,.toolbar,.calendar-toolbar){background:#111e31!important;border-color:#344961!important}
:root[data-theme="dark"] :where(.settings-tabs button.active,.tabs button.active){background:#2d9188!important;color:#fff!important}
:root[data-theme="dark"] :where(.toast,.notice,.banner,.alert){background:#1a2b44!important;color:#f3f7f7!important;border-color:#466078!important}
:root[data-theme="dark"] .modal{background:rgba(3,8,16,.76)!important}:root[data-theme="dark"] .modal-close{background:#1b2b42!important;color:#e7eeee!important;border-color:#40536a!important}
:root[data-theme="dark"] .auth-shell{background:#0d1728!important}:root[data-theme="dark"] .auth-panel{background:#111d30!important}:root[data-theme="dark"] .auth-card{background:transparent!important;box-shadow:none!important}:root[data-theme="dark"] .auth-footer{color:#94a5b2!important}
:root[data-theme="dark"] .theme-choices button{background:#192a43;color:#f3f7f7;border-color:#3a5067}:root[data-theme="dark"] .theme-choices button>span{background:#223650}:root[data-theme="dark"] .theme-choices button.active{background:#263449;border-color:#ff9472}:root[data-theme="dark"] .appearance-icon{background:#203a3d;color:#79d3c8}:root[data-theme="dark"] .appearance-note{background:#1b3438;color:#d9f3ef}:root[data-theme="dark"] .appearance-note span{color:#a9c4c1}
:root[data-theme="dark"] a{color:#83d7ce}:root[data-theme="dark"] hr{border-color:#344961}:root[data-theme="dark"] ::selection{background:#ef7b59;color:#fff}

/* Componentes que mantinham fundo claro e perdiam contraste no modo escuro. */
:root[data-theme="dark"] .quick button{background:#172740!important;border-color:#3a5068!important;color:#f4f7f7!important;box-shadow:0 14px 32px rgba(0,0,0,.18)!important;opacity:1!important}
:root[data-theme="dark"] .quick button:hover{background:#1d304c!important;border-color:#557087!important;transform:translateY(-2px)}
:root[data-theme="dark"] .quick button strong{color:#f5f8f8!important}
:root[data-theme="dark"] .quick button small{color:#acbbc5!important}
:root[data-theme="dark"] .google-calendar-banner{background:linear-gradient(135deg,#172b3b 0%,#202839 100%)!important;border-color:#3b5369!important;color:#f4f7f7!important;box-shadow:0 15px 36px rgba(0,0,0,.17)!important}
:root[data-theme="dark"] .google-calendar-banner :where(strong,b,h2,h3,h4){color:#f5f8f8!important}
:root[data-theme="dark"] .google-calendar-banner :where(p,small,span:not(.badge)){color:#b5c4cc!important}
:root[data-theme="dark"] .resource-line{background:#192a43!important;border-color:#3c536b!important;color:#f4f7f7!important}
:root[data-theme="dark"] .resource-line:hover{background:#203550!important;border-color:#557087!important}
:root[data-theme="dark"] .resource-line :where(strong,b,h3,h4){color:#f5f8f8!important}
:root[data-theme="dark"] .resource-line :where(p,small,span){color:#b7c6ce!important}
:root[data-theme="dark"] .agenda-empty-action{background:#192a43!important;border-color:#3c536b!important;color:#f4f7f7!important}
:root[data-theme="dark"] .agenda-empty-action:hover{background:#203550!important;border-color:#557087!important}
:root[data-theme="dark"] .agenda-empty-action :where(strong,b,h3,h4){color:#f5f8f8!important}
:root[data-theme="dark"] .agenda-empty-action :where(p,small,span){color:#b7c6ce!important}
:root[data-theme="dark"] .recording-safety{background:linear-gradient(135deg,#172b3b 0%,#202839 100%)!important;border-color:#496176!important;color:#f4f7f7!important}
:root[data-theme="dark"] .recording-safety :where(strong,b,h2,h3,h4){color:#f5f8f8!important}
:root[data-theme="dark"] .recording-safety :where(p,small,span:not(.badge)){color:#b8c7ce!important}
:root[data-theme="dark"] .recording-metrics article{background:#172740!important;border-color:#3a5068!important;color:#f4f7f7!important;box-shadow:0 14px 30px rgba(0,0,0,.16)!important}
:root[data-theme="dark"] .recording-metrics article :where(strong,b,h2,h3,h4){color:#f5f8f8!important}
:root[data-theme="dark"] .recording-metrics article :where(p,small,span){color:#b5c4cc!important}
:root[data-theme="dark"] .recording-metrics article.needs-attention{background:#302431!important;border-color:#d77966!important}
:root[data-theme="dark"] .context-help-button{background:#192a43!important;color:#dff5f1!important;border-color:#3c566b!important}
:root[data-theme="dark"] .context-help-button :where(span,strong){color:#dff5f1!important}
:root[data-theme="dark"] :where(.agenda-period-nav,.agenda-filters) button:disabled{background:#213149!important;color:#8496a5!important;border-color:#3a4e64!important;opacity:1!important}
:root[data-theme="dark"] :where(.agenda-period-nav,.agenda-filters) button:not(:disabled){background:#192a43!important;color:#edf4f4!important;border-color:#405872!important}

/* Camada final de contraste: precisa vencer estilos específicos carregados nas telas. */
html[data-theme="dark"] body :is(.quick button,.google-calendar-banner,.resource-line,.agenda-empty-action,.recording-safety,.recording-bia-rule,.recording-metrics article){background:#172740!important;background-image:none!important;border-color:#3a5068!important;color:#f4f7f7!important;opacity:1!important}
html[data-theme="dark"] body .quick button :is(strong,b,h2,h3,h4),
html[data-theme="dark"] body .google-calendar-banner :is(strong,b,h2,h3,h4),
html[data-theme="dark"] body .resource-line :is(strong,b,h2,h3,h4),
html[data-theme="dark"] body .agenda-empty-action :is(strong,b,h2,h3,h4),
html[data-theme="dark"] body .recording-safety :is(strong,b,h2,h3,h4),
html[data-theme="dark"] body .recording-bia-rule :is(strong,b,h2,h3,h4),
html[data-theme="dark"] body .recording-metrics article :is(strong,b,h2,h3,h4){color:#f5f8f8!important;opacity:1!important}
html[data-theme="dark"] body .quick button :is(p,small),
html[data-theme="dark"] body .google-calendar-banner :is(p,small),
html[data-theme="dark"] body .resource-line :is(p,small),
html[data-theme="dark"] body .agenda-empty-action :is(p,small),
html[data-theme="dark"] body .recording-safety :is(p,small),
html[data-theme="dark"] body .recording-bia-rule :is(p,small),
html[data-theme="dark"] body .recording-metrics article :is(p,small){color:#b8c7ce!important;opacity:1!important}
html[data-theme="dark"] body .recording-bia-rule>span{background:#ef7b59!important;color:#fff!important}
html[data-theme="dark"] body .recording-bia-rule>em{background:#3d2a2a!important;color:#ffc0ab!important;border-color:#74483c!important}
html[data-theme="dark"] body .recording-safety>span{color:#fff!important}
html[data-theme="dark"] body .recording-safety .badge{color:#b8f0e8!important;background:#173f3b!important}
html[data-theme="dark"] body .agenda-empty-action>span{color:#ffb095!important}
html[data-theme="dark"] body :is(.agenda-period-nav,.agenda-filters,.agenda-view-switch) button{opacity:1!important}
@media(max-width:760px){.theme-toggle-label{display:none}.theme-toggle{padding:0;width:42px}.theme-choices{grid-template-columns:1fr}.appearance-panel{padding:20px}}
