/* Uniggel Marketing Hub — temas de interface. Carregar APOS todos os CSS dos modulos. */
:root,html[data-theme="light"]{
 color-scheme:light;--bg:#f6f8f5;--ink:#123320;--deep:#0f321e;--green:#0f321e;--muted:#65766b;--line:#dce5dd;
 --ui-page:#f6f8f5;--ui-panel:#fff;--ui-sidebar:#fff;--ui-topbar:#fff;--ui-input:#fff;--ui-text:#123320;--ui-muted:#637367;
 --ui-border:#dce5dd;--ui-soft:#eff4ef;--ui-hover:#e9f1e9;--ui-feature:#edf4ee;--ui-feature-text:#0f321e;
 --ui-shadow:0 8px 28px rgba(15,50,30,.045);--ui-orange:#ff6900;--ui-focus:#ff6900;
}
html[data-theme="dark"]{
 color-scheme:dark;--bg:#101b16;--ink:#edf6ef;--deep:#0f321e;--green:#0f321e;--muted:#a5b7ab;--line:#33483b;
 --ui-page:#101b16;--ui-panel:#1b2b22;--ui-sidebar:#15241b;--ui-topbar:#19291f;--ui-input:#15251c;--ui-text:#edf6ef;--ui-muted:#b2c3b8;
 --ui-border:#395041;--ui-soft:#25372b;--ui-hover:#2a4233;--ui-feature:#223b2b;--ui-feature-text:#edf6ef;
 --ui-shadow:0 10px 32px rgba(0,0,0,.20);--ui-orange:#ff8a37;--ui-focus:#ff9a4d;
}
html{background:var(--ui-page)}
body{background:var(--ui-page)!important;color:var(--ui-text)!important}
.sidebar{background:var(--ui-sidebar)!important;border-color:var(--ui-border)!important}
.topbar{background:var(--ui-topbar)!important;border-color:var(--ui-border)!important}
.sidebar-footer,.workspace,.toolbar,.module-link,.module-card,.admin-panel,.category-card,.file-card,.form-section,.signature-section{border-color:var(--ui-border)!important}
.breadcrumb,.breadcrumb strong,.nav-item,.workspace,.sidebar-footer,.nav-label,.local-status,.logout-button,.module-card h3,.admin-main h1,.admin-panel h2,.page-heading h1,.library h2,.category-copy strong{color:var(--ui-text)!important}
.page-heading p,.module-card p,.category-copy small,.library-heading p,.empty-state p,.sidebar-footer small,.workspace small,.home-modules p,.admin-panel p,.eyebrow,.bottom-note p,footer{color:var(--ui-muted)!important}
.nav-item:hover,.logout-button:hover,.icon-button:hover{background:var(--ui-hover)!important}
.nav-item.active,[aria-current="page"].nav-item{background:var(--ui-hover)!important;color:var(--ui-text)!important}
.module-card,.category-card,.file-card,.admin-panel,.form-section,.signature-section,.search,.toolbar-actions .filter-button,.secondary,.view-switch button.selected,dialog,.modal-content{background:var(--ui-panel)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important;box-shadow:var(--ui-shadow)}
.module-icon,.category-icon,.empty-icon,.workspace-icon,.avatar,.file-extension,.view-switch,.sidebar-note,.bottom-note,.model-status,.step-badge{background:var(--ui-soft)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important}
.home-welcome{background:var(--ui-feature)!important;color:var(--ui-feature-text)!important;border-color:var(--ui-border)!important}
.home-welcome h1,.home-welcome p,.home-welcome .eyebrow,.home-team{color:var(--ui-feature-text)!important}
input,textarea,select,.search input,.term-form input,.signature-form input,.admin-panel input,.admin-panel textarea,.admin-panel select{background:var(--ui-input)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important}
input::placeholder,textarea::placeholder{color:var(--ui-muted)!important;opacity:.85}
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:3px solid var(--ui-focus)!important;outline-offset:2px}
.button.primary,.button.primary:hover,.admin-action{background:#0f321e!important;color:#fff!important}
html[data-theme="dark"] .button.primary,html[data-theme="dark"] .admin-action{background:#316746!important;color:#fff!important}
html[data-theme="dark"] .file-visual{background:repeating-conic-gradient(#304437 0% 25%,#213427 0% 50%) 50%/18px 18px!important}
html[data-theme="dark"] .brand img{filter:none} /* logo oficial, sem alterar cores */
html[data-theme="dark"] .brand,.brand .hub-label{color:var(--ui-text)!important}
html[data-theme="dark"] img:not(.brand img){opacity:1} /* Nunca altera material institucional ou exportacoes */
.theme-choice{display:flex;flex-wrap:wrap;gap:10px;margin-top:12px}
.theme-choice label{display:flex;align-items:center;gap:8px;cursor:pointer;border:1px solid var(--ui-border);background:var(--ui-panel);color:var(--ui-text);border-radius:10px;padding:13px 16px;min-width:120px}
.theme-choice label:has(input:checked){border-color:var(--ui-focus);box-shadow:0 0 0 2px rgba(255,105,0,.15)}
.theme-choice input{accent-color:#ff6900}
/* Os modelos exportados conservam fundos/brancos e cores oficiais, mesmo no modo escuro. */
@media print{html,html[data-theme="dark"]{color-scheme:light}body{background:#fff!important;color:#111!important}}
@media(prefers-reduced-motion:no-preference){body,.sidebar,.topbar,.module-card,.admin-panel{transition:background-color .18s ease,color .18s ease,border-color .18s ease}}

/* Aprimoramentos do modo escuro */
html[data-theme="dark"] .brand-logo-light{display:none!important}
html[data-theme="dark"] .brand-logo-dark{display:block!important}
html:not([data-theme="dark"]) .brand-logo-dark{display:none!important}
html[data-theme="dark"] .brand{padding-top:4px}
html[data-theme="dark"] .brand .hub-label{color:#9bb4a4!important}
html[data-theme="dark"] .admin-head{background:linear-gradient(135deg,#1b2d23 0%,#21392b 100%)!important;color:var(--ui-feature-text)!important;border-color:var(--ui-border)!important;box-shadow:var(--ui-shadow)}
html[data-theme="dark"] .admin-head .eyebrow,html[data-theme="dark"] .admin-head p,html[data-theme="dark"] .admin-head h1{color:var(--ui-feature-text)!important}
html[data-theme="dark"] .admin-panel label,html[data-theme="dark"] .admin-table th{color:#d9e7dd!important}
html[data-theme="dark"] .admin-help,html[data-theme="dark"] #profile-name,html[data-theme="dark"] #account-message{color:var(--ui-muted)!important}
html[data-theme="dark"] .admin-secondary{background:#24382c!important;color:#edf6ef!important;border-color:#395041!important}
html[data-theme="dark"] .workspace-icon,html[data-theme="dark"] .avatar{background:#24382c!important;color:#edf6ef!important}
html[data-theme="dark"] .workspace-dot{background:#5ab900!important}
html[data-theme="dark"] .sidebar-footer,html[data-theme="dark"] .workspace{border-color:#314539!important}
html[data-theme="dark"] .module-card:hover,html[data-theme="dark"] .file-card:hover{border-color:#4a6857!important;box-shadow:0 12px 28px rgba(0,0,0,.26)!important}

/* Botão compacto para alternar tema, com a mesma animação */
.topbar-right{display:flex;align-items:center;gap:12px}
.theme-toggle{position:relative;flex:0 0 auto;width:56px;height:30px;border:0;padding:0;background:transparent!important;border-radius:999px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;touch-action:manipulation}
.theme-toggle-track{width:56px;height:30px;border-radius:999px;background:#b7b7b7;position:relative;display:block;box-shadow:inset 0 2px 5px rgba(0,0,0,.12);transition:background-color .3s ease}
.theme-toggle-thumb{position:absolute;left:4px;top:4px;width:22px;height:22px;background:#fff;border-radius:50%;box-shadow:0 2px 6px rgba(0,0,0,.16);transform:translateX(0);transition:transform .32s cubic-bezier(.2,1.3,.4,1),box-shadow .3s ease;z-index:2}
.theme-toggle-icon{position:absolute;top:7px;width:16px;height:16px;color:#fff;display:flex;align-items:center;justify-content:center;transition:transform .32s ease,opacity .32s ease}
.theme-toggle-icon svg{width:16px;height:16px}
.theme-toggle-sun{right:8px;opacity:1}.theme-toggle-moon{left:8px;opacity:0;transform:rotate(-45deg)}
html[data-theme="dark"] .theme-toggle-track{background:#303030}
html[data-theme="dark"] .theme-toggle-thumb{transform:translateX(26px)}
html[data-theme="dark"] .theme-toggle-sun{opacity:0;transform:rotate(55deg)}
html[data-theme="dark"] .theme-toggle-moon{opacity:1;transform:rotate(0)}
.theme-toggle:hover .theme-toggle-thumb{box-shadow:0 2px 10px rgba(0,0,0,.27)}
.theme-toggle:focus-visible{outline:3px solid #ff6900!important;outline-offset:3px}
@media(max-width:760px){.theme-toggle,.theme-toggle-track{width:52px;height:28px}.theme-toggle-thumb{width:20px;height:20px;left:4px;top:4px}html[data-theme="dark"] .theme-toggle-thumb{transform:translateX(24px)}.theme-toggle-icon{top:7px;width:14px;height:14px}.theme-toggle-icon svg{width:14px;height:14px}.theme-toggle-sun{right:7px}.theme-toggle-moon{left:7px}.topbar-right{gap:6px}}
@media(prefers-reduced-motion:reduce){.theme-toggle-track,.theme-toggle-thumb,.theme-toggle-icon{transition:none!important}}
