/* Picker works in the unchanged default theme as well. */
html[data-crm-theme]{--theme-ink:#172334;--theme-primary:#17469c;--theme-hover:#123779;--theme-accent:#f97316;--theme-accent-ink:#172334;--theme-canvas:#f5f6f8;--theme-tint:#eef1f6;--theme-line:#d6dce5}
html[data-crm-theme="red"]{--theme-primary:#b91c1c;--theme-hover:#991b1b;--theme-accent:#172554;--theme-canvas:#f8f5f5;--theme-tint:#fbeaea;--theme-line:#e5d5d5;--theme-accent-ink:#fff}
html[data-crm-theme="emerald"],html[data-crm-theme="solar"],html[data-crm-theme="violet"]{--theme-accent-ink:#fff}
.crm-theme-picker{margin-bottom:24px}.crm-theme-picker h3{margin:0}.crm-theme-picker header p{margin:4px 0 0;font-size:13px;color:#526174}
.crm-theme-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;border:0;padding:0;margin:0 0 18px}.crm-theme-options legend{font-size:13px;font-weight:700;margin-bottom:12px}
.crm-theme-option{position:relative;display:grid;gap:8px;padding:14px;border:2px solid #d9e1eb;border-radius:14px;background:#fff;cursor:pointer;color:#182438}.crm-theme-option:has(input:checked){border-color:#17469c;outline:2px solid #dce7ff}.crm-theme-option:focus-within{outline:3px solid #17469c;outline-offset:2px}.crm-theme-option input{position:absolute;right:12px;top:12px;width:17px;height:17px;accent-color:#17469c}.crm-theme-option strong{font-size:14px}.crm-theme-option small{font-size:12px;line-height:1.5;color:#526174}
.crm-theme-swatch{height:68px;background:var(--swatch-bg);border:1px solid #dce2e8;border-radius:8px;position:relative;display:block;margin-top:16px;overflow:hidden}.crm-theme-swatch span{position:absolute;inset:0 auto 0 0;width:25%;background:var(--swatch-main)}.crm-theme-swatch i{position:absolute;left:36%;top:14px;width:48%;height:9px;background:var(--swatch-main);border-radius:3px}.crm-theme-swatch b{position:absolute;right:16%;bottom:13px;width:26%;height:14px;background:var(--swatch-accent);border-radius:4px}
.crm-theme-picker-footer{display:flex;align-items:center;gap:10px;margin-bottom:12px;flex-wrap:wrap}.crm-theme-picker-footer p{flex:1;min-width:200px;font-size:13px;margin:0;color:#526174}
html[data-crm-theme="emerald"]{--theme-primary:#047857;--theme-hover:#065f46;--theme-accent:#064e3b;--theme-canvas:#f3f7f5;--theme-tint:#e5f3ed;--theme-line:#d0e0d8}
html[data-crm-theme="zuri"]{--theme-primary:#17469c;--theme-hover:#123779;--theme-accent:#f97316;--theme-canvas:#f3f5f9;--theme-tint:#e7eefb;--theme-line:#d4dfef}
html[data-crm-theme="solar"]{--theme-primary:#c2410c;--theme-hover:#9a3412;--theme-accent:#172554;--theme-canvas:#fff7ed;--theme-tint:#ffedd5;--theme-line:#eddbca}
html[data-crm-theme="violet"]{--theme-primary:#6d28d9;--theme-hover:#5b21b6;--theme-accent:#312e81;--theme-canvas:#f6f4fa;--theme-tint:#ede7fb;--theme-line:#ddd5ed}
html[data-crm-theme] body:is(.crm-app,.admin-app,.auth-page){
 --crm-ui-green:var(--theme-primary);--crm-ui-green-dark:var(--theme-hover);--crm-ui-green-soft:var(--theme-tint);--a-brand:var(--theme-primary);--a-brand-text:var(--theme-primary);--a-brand-soft:var(--theme-tint);--a-green:var(--theme-primary);--a-green-deep:var(--theme-hover);--a-panel:#fff;--a-panel-solid:#fff;--a-bg:var(--theme-canvas);--a-line:var(--theme-line);--a-active:var(--theme-primary);--a-active-text:#fff;--a-blur:none;
 --se-green:var(--theme-primary);--se-green-dark:var(--theme-hover);--se-green-soft:var(--theme-tint);--se-canvas:var(--theme-canvas);--se-surface:#fff;--se-ink:#172334;--se-muted:#526174;--adm-accent:var(--theme-primary);--adm-accent-dark:var(--theme-hover);--adm-accent-soft:var(--theme-tint);--adm-bg:var(--theme-canvas);--adm-surface:#fff;--adm-text:#172334;--adm-muted:#526174;--adm-border:var(--theme-line);--tblr-primary:var(--theme-primary);
 background:var(--theme-canvas)!important;color:#172334;color-scheme:light;
}
html[data-crm-theme] :is(.sidebar,.top-header,.admin-sidebar,.admin-topbar,.crm-header,.adm-card,.crm-kpi-card,.admin-main,.login-card){background:#fff!important;backdrop-filter:none!important;border-color:var(--theme-line)!important}
html[data-crm-theme] :is(.admin-sidebar-head,.sidebar-header){background:#fff!important}
html[data-crm-theme] :is(.admin-topbar h1,.admin-topbar-heading h1,.admin-brand-link,.sidebar-header,.admin-sidebar-head){color:#172334!important}
html[data-crm-theme] :is(.sidebar .nav-item,.sidebar .nav-link,.sidebar-menu a,.sidebar-menu-toggle,.admin-nav-item){color:#334155!important}
html[data-crm-theme] .sidebar-menu a.active{background:var(--theme-primary)!important;color:#fff!important;box-shadow:none!important}
html[data-crm-theme] .sidebar-menu a.active :is(svg,span){color:#fff!important}
html[data-crm-theme] .sidebar-menu-toggle.active{color:var(--theme-primary)!important;background:var(--theme-tint)!important}
html[data-crm-theme] :is(.sidebar .nav-item.active,.sidebar .nav-link.active,.sidebar .submenu-item.active,.admin-nav-item.active){background:var(--theme-primary)!important;color:#fff!important;border-color:var(--theme-primary)!important;box-shadow:none!important}
html[data-crm-theme] :is(.sidebar .nav-item.active,.sidebar .nav-link.active,.sidebar .submenu-item.active,.admin-nav-item.active) :is(i,svg,span){color:#fff!important;background:none!important}
html[data-crm-theme] :is(.btn-primary,.btn-save,.crm-btn--primary,.btn-success,.btn-search,.btn-filter,.btn-novo,.btn-new,.login-apple .btn-primary,.adm-v4 button[type="submit"]:not(.btn-danger):not(.btn-secondary)){background:var(--theme-primary)!important;border-color:var(--theme-primary)!important;color:#fff!important;box-shadow:none!important}
html[data-crm-theme] :is(.btn-primary,.btn-save,.crm-btn--primary,.btn-success):hover{background:var(--theme-hover)!important;border-color:var(--theme-hover)!important}
html[data-crm-theme] :is(.btn-secondary,.crm-btn--secondary){background:var(--theme-accent)!important;border-color:var(--theme-accent)!important;color:#fff!important;box-shadow:none!important}
html[data-crm-theme] :is(.btn-danger,.crm-btn--danger){background:#b91c1c!important;border-color:#b91c1c!important;color:#fff!important;box-shadow:none!important}
html[data-crm-theme] :is(.btn-warning,.crm-btn--warn){background:#f59e0b!important;border-color:#f59e0b!important;color:#172334!important;box-shadow:none!important}
html[data-crm-theme] :is(.fin-btn-primary,.fin-btn--primary,.btn-submit-custom,button.bg-emerald-500,a.bg-emerald-500){background:var(--theme-primary)!important;border-color:var(--theme-primary)!important;color:#fff!important;box-shadow:none!important}
html[data-crm-theme] :is(.fin-btn-secondary,.fin-btn--secondary){background:var(--theme-accent)!important;border-color:var(--theme-accent)!important;color:#fff!important;box-shadow:none!important}
html[data-crm-theme] :is(.fin-btn-danger,.fin-btn--danger,.crm-btn--danger-soft){background:#b91c1c!important;border-color:#b91c1c!important;color:#fff!important;box-shadow:none!important}
html[data-crm-theme] :is(.crm-btn--ghost,.btn-cancel-custom){background:#fff!important;border-color:var(--theme-line)!important;color:var(--theme-primary)!important;box-shadow:none!important}
html[data-crm-theme] :is(input,select,textarea){accent-color:var(--theme-primary)}
html[data-crm-theme] :is(input,select,textarea):focus-visible{outline:2px solid var(--theme-primary);outline-offset:2px}
html[data-crm-theme] :is(button,a.btn):disabled{opacity:.55;cursor:not-allowed}
@media(max-width:1100px){.crm-theme-options{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:600px){.crm-theme-options{grid-template-columns:repeat(2,minmax(0,1fr))}.crm-theme-picker-footer p{flex-basis:100%}.crm-theme-picker-footer button{flex:1}}

/* Shared component contract: opaque surfaces, solid actions and semantic danger. */
html[data-crm-theme] body:is(.admin-app,.crm-app,.auth-page){--theme-ink:#172334;--adm-accent-light:var(--theme-primary);--adm-accent-ring:var(--theme-line);--adm-side-accent:var(--theme-primary);--adm-side-bg-hover:var(--theme-tint);--adm-side-text:#526174;--adm-side-text-strong:#172334;--crm-green:var(--theme-primary);--crm-green-soft:var(--theme-tint);--crm-brand:var(--theme-primary);--crm-ui-bg:var(--theme-canvas);--crm-ui-line:var(--theme-line);--a-panel:#fff;--a-panel-solid:#fff}
html[data-crm-theme] body.admin-app :is(.admin-sidebar,.admin-sidebar-head,.admin-sidebar-inner,.admin-main,.admin-topbar,.adm-card,.adm-panel){background:#fff!important;backdrop-filter:none!important;border-color:var(--theme-line)!important}
html[data-crm-theme] body.admin-app .admin-nav-item.active{background:var(--theme-primary)!important;border-color:var(--theme-primary)!important;color:#fff!important}
html[data-crm-theme] body.admin-app .admin-nav-item.active :is(i,svg,span){background:none!important;color:#fff!important}
html[data-crm-theme] body.admin-app :is(.adm-card__icon,.adm-panel__icon,.adm-page-header__icon,.admin-stat-icon){background:var(--theme-primary)!important;color:#fff!important;border:0!important;box-shadow:none!important}
html[data-crm-theme] body.admin-app :is(.adm-card__icon--amber,.adm-card__icon--violet){background:var(--theme-accent)!important;color:var(--theme-accent-ink)!important}
html[data-crm-theme] body :is(.crm-modal,.financing-modal-panel,.agenda-modal__card,.modal-content,.eng-ficha-modal,.pc-modal,.crm-popup){background:#fff!important;color:var(--theme-ink)!important;backdrop-filter:none!important;border-color:var(--theme-line)!important}
html[data-crm-theme] body :is(.crm-modal__header,.financing-modal-panel .modal-header,.agenda-modal__head,.modal-header,.eng-ficha-modal__head){background:#fff!important;color:var(--theme-ink)!important;border-bottom:1px solid var(--theme-line)!important}
html[data-crm-theme] body :is(.crm-modal__title i,.financing-modal-panel .modal-header h2 i){color:var(--theme-primary)!important;background:none!important}
html[data-crm-theme] body :is(.crm-modal__header::before,.financing-modal-panel .modal-header::before){background:var(--theme-accent)!important}
html[data-crm-theme] body :is(.crm-modal__footer,.agenda-modal__foot,.modal-footer){background:#f5f6f8!important;border-color:var(--theme-line)!important}
html[data-crm-theme] body :is(.btn-secondary,.crm-btn--secondary,.fin-btn-secondary,.fin-btn--secondary){background:var(--theme-accent)!important;color:var(--theme-accent-ink)!important;border-color:var(--theme-accent)!important;box-shadow:none!important}
html[data-crm-theme] body :is(.adm-btn-save,.agenda-btn--accent,.btn-primary,.crm-btn--primary,.fin-btn-primary,.fin-btn--primary){background:var(--theme-primary)!important;color:#fff!important;border-color:var(--theme-primary)!important;box-shadow:none!important}
html[data-crm-theme] body :is(.btn-danger,.crm-btn--danger,.crm-btn--danger-soft,.agenda-btn--danger,.fin-btn-danger,.fin-btn--danger){background:#b91c1c!important;color:#fff!important;border-color:#b91c1c!important;box-shadow:none!important}
html[data-crm-theme] body :is(.crm-modal__close,.modal-close,.agenda-modal__close,.eng-ficha-modal__close){background:#edf0f4!important;color:#334155!important;border:1px solid #d6dce5!important;box-shadow:none!important}
html[data-crm-theme] body :is(.crm-modal__close,.modal-close,.agenda-modal__close,.eng-ficha-modal__close):hover{background:#b91c1c!important;color:#fff!important;border-color:#b91c1c!important}
html[data-crm-theme] body input:is([type="checkbox"],[type="radio"]){accent-color:var(--theme-primary)!important}
html[data-crm-theme] body :is(button,a):is(.bg-emerald-500,.bg-emerald-600,.bg-green-500,.bg-green-600){background:var(--theme-primary)!important;color:#fff!important;box-shadow:none!important}
/* Inline legacy highlights in client / financing dialogs. */
html[data-crm-theme] body :is([style*="color:#059669"],[style*="color: #059669"],[style*="color:#047857"],[style*="color: #047857"],[style*="color: rgb(4, 120, 87)"]){color:var(--theme-primary)!important}
html[data-crm-theme] body :is(button,a,input,select,textarea):focus-visible{outline:3px solid var(--theme-primary);outline-offset:3px}
@media(prefers-reduced-motion:reduce){.crm-theme-option{transition:none!important}}
html[data-crm-theme] body:is(.admin-app.adm-v4,.crm-app,.auth-page) :is(.btn.btn-secondary,.crm-btn.crm-btn--secondary,.fin-btn.fin-btn--secondary){background:var(--theme-accent)!important;color:var(--theme-accent-ink)!important;border-color:var(--theme-accent)!important;box-shadow:none!important}
html[data-crm-theme] body:is(.admin-app.adm-v4,.crm-app,.auth-page) :is(.btn.btn-danger,.crm-btn.crm-btn--danger,.fin-btn.fin-btn--danger){background:#b91c1c!important;color:#fff!important;border-color:#b91c1c!important;box-shadow:none!important}
html[data-crm-theme] body .modal-icon{background:var(--theme-primary)!important;color:#fff!important;box-shadow:none!important}
html[data-crm-theme] body .modal-icon :is(i,svg){color:#fff!important}
html[data-crm-theme] body :is(i,span,p,h2,h3,label):is([style*="color:#10b981"],[style*="color: #10b981"],[style*="color:#16a34a"],[style*="color: #16a34a"],[style*="color:#0f766e"],[style*="color: #0f766e"]){color:var(--theme-primary)!important}
html[data-crm-theme] body :is(input,select,textarea)[class*="emerald"]{--tw-ring-color:var(--theme-line)!important}
html[data-crm-theme] body :is(input,select,textarea)[class*="emerald"]:focus{border-color:var(--theme-primary)!important;--tw-ring-color:var(--theme-line)!important}
html[data-crm-theme] body :is(.text-emerald-600,.text-emerald-700):not([role="status"]){color:var(--theme-primary)!important}
