/* Shared screen tokens. Original leaves every existing style in control. */
html[data-finman-theme] #workspace{background:var(--theme-bg);color:var(--theme-text)}
html[data-finman-theme] #workspace,html[data-finman-theme] #workspace :is(input,select,textarea,button,table,label,p,small,span),html[data-finman-theme] dialog{font-family:var(--theme-font)!important}
html[data-finman-theme] #workspace :is(input,select,textarea,button,table,p),html[data-finman-theme] dialog :is(input,select,textarea,button,table){font-size:var(--theme-size)!important}
html[data-finman-theme] #workspace :is(h1,h2,h3,h4){font-family:var(--theme-font)!important;color:var(--theme-text)!important}
html[data-finman-theme] #workspace :is(h1,h2){font-size:var(--theme-heading)!important}
html[data-finman-theme] #workspace .sidebar{background:var(--theme-sidebar)!important}
html[data-finman-theme] #workspace .sidebar :is(button,a,summary,.nav-caption){color:#e3edf7!important}
html[data-finman-theme] #workspace .sidebar :is(button.active,button:hover,summary:hover){background:#ffffff19!important}
html[data-finman-theme] #workspace :is(.workspace-header,.workspace-footer){background:var(--theme-surface)!important;border-color:var(--theme-border)!important;color:var(--theme-muted)!important}
html[data-finman-theme] #workspace .dashboard{max-width:var(--theme-width)!important;padding:var(--theme-panel)!important}
html[data-finman-theme] #workspace .dash-cards article{background:var(--theme-surface)!important;border-color:var(--theme-border)!important;padding:var(--theme-panel)!important}
html[data-finman-theme] #workspace .dash-cards :is(strong,span,small){color:var(--theme-text)!important}
html[data-finman-theme] #workspace .erp-screen :is(strong,b){color:var(--theme-text)!important}
html[data-finman-theme] #workspace :is(.voucher-total,.voucher-totals,.pi-totals,.si-totals,.pri-totals,.sri-totals){color:var(--theme-text)!important;background:var(--theme-soft)!important}
html[data-finman-theme] #workspace .erp-screen :is(.ledger-summary,.trial-summary,.journal-totals,.cb-summary,.cf-summary,.bs-summary,.pl-summary,.posting-summary){background:var(--theme-soft)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}
html[data-finman-theme] #workspace .erp-screen :is(.ledger-summary,.trial-summary,.journal-totals,.cb-summary,.cf-summary,.bs-summary,.pl-summary,.posting-summary)>div{background:var(--theme-surface)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}
html[data-finman-theme] #workspace .erp-screen :is(.ledger-summary,.trial-summary,.journal-totals,.cb-summary,.cf-summary,.bs-summary,.pl-summary,.posting-summary) span{color:var(--theme-muted)!important}
html[data-finman-theme] #workspace .erp-screen :is(.unbalanced,.dash-loss){color:#b63829!important}
html[data-finman-theme=midnight] #workspace .erp-screen :is(.unbalanced,.dash-loss){color:#ffb4a5!important}
html[data-finman-theme] #workspace :is(.pill,.avatar,#today){background:var(--theme-soft)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}
html[data-finman-theme] #workspace input::placeholder{color:var(--theme-muted)!important;opacity:1}
html[data-finman-theme] #workspace :is(.voucher-panel,.erp-screen>form:not(.erp-flat-form),.cards article,.sl-totals>div,.welcome-banner){background:var(--theme-surface)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important;padding:var(--theme-panel)!important;margin-bottom:var(--theme-gap)!important}
html[data-finman-theme] #workspace :is(.erp-field-grid,.voucher-fields,.igp-fields,.ogp-fields,.pi-fields,.si-fields,.pri-fields,.sri-fields){grid-template-columns:repeat(auto-fit,minmax(min(100%,var(--theme-field)),1fr))!important;gap:var(--theme-gap)!important;margin-bottom:var(--theme-gap)!important}
html[data-finman-theme] #workspace label,html[data-finman-theme] dialog label{font-size:var(--theme-label)!important;color:var(--theme-text)!important;margin-bottom:5px!important}
html[data-finman-theme] #workspace :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select),html[data-finman-theme] dialog :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select){height:var(--theme-control)!important;min-height:var(--theme-control)!important;padding:0 8px!important;background:var(--theme-surface)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}
html[data-finman-theme] #workspace textarea,html[data-finman-theme] dialog textarea{min-height:calc(var(--theme-control)*1.8)!important;background:var(--theme-surface)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important;padding:8px!important}
html[data-finman-theme] #workspace :is(input,select,textarea):disabled,html[data-finman-theme] #workspace input[readonly]{background:var(--theme-soft)!important;color:var(--theme-muted)!important}
html[data-finman-theme] #workspace button:not(.nav-item),html[data-finman-theme] dialog button{min-height:var(--theme-control)!important;height:auto!important;padding:var(--theme-row) 10px!important;background:var(--theme-surface);color:var(--theme-text);border-color:var(--theme-border)!important}
html[data-finman-theme] #workspace :is(button.primary,button.erp-primary),html[data-finman-theme] dialog button.primary{background:var(--theme-accent)!important;color:var(--theme-surface)!important}
html[data-finman-theme] #workspace button:disabled{opacity:.55}
html[data-finman-theme] #workspace :is(th,tfoot,.sl-opening){background:var(--theme-soft)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}
html[data-finman-theme] #workspace td{color:var(--theme-text);border-color:var(--theme-border)!important}
html[data-finman-theme] #workspace :is(th,td),html[data-finman-theme] dialog :is(th,td){padding:var(--theme-row) 8px!important}
html[data-finman-theme] #workspace :is(.muted,.company-workspace-detail,.profile b,.profile small,.workspace-footer){color:var(--theme-muted)!important}
html[data-finman-theme] #workspace .erp-screen :is(.table-wrap,.voucher-grid-wrap,.user-table-wrap,.picker-grid-wrap){max-height:var(--theme-height);overflow:auto!important}
html[data-finman-theme] #workspace .erp-screen :is(.erp-screen-header,.erp-actions,.voucher-toolbar){gap:var(--theme-gap)!important;margin-bottom:var(--theme-gap)!important;border-color:var(--theme-border)!important}
html[data-finman-theme] dialog{background:var(--theme-surface)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}
html[data-finman-theme] :is(input,select,textarea,button):focus-visible{outline:2px solid var(--theme-accent)!important;outline-offset:2px}
.theme-presets{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px;margin:20px 0}
#workspace .theme-presets button{display:flex;flex-direction:column;align-items:flex-start;text-align:left;white-space:normal;gap:8px;padding:16px;min-height:100px;border:1px solid #c5d4cb;background:#fff;color:#173f31;border-radius:8px}
#workspace .theme-presets button span{font-size:12px;line-height:1.5;font-weight:400}
#workspace .theme-presets button[aria-pressed=true]{outline:3px solid var(--theme-accent,#246344);outline-offset:2px}
#workspace .theme-sample{max-width:700px}#workspace .theme-sample input{max-width:290px;margin:8px 0 16px}#workspace .theme-sample table{width:100%}
@media(max-width:650px){html[data-finman-theme] #workspace .erp-field-grid{grid-template-columns:minmax(0,1fr)!important}html[data-finman-theme] #workspace .dashboard{padding:12px!important}.theme-presets{grid-template-columns:1fr}}
/* Report page sizes, columns, signatures and saved content remain owned by each report. */
@media screen{
 html[data-finman-theme] .finman-themed-report,html[data-finman-theme] .finman-themed-report :is(main,.voucher-sheet){background:var(--theme-surface)!important;color:var(--theme-text)!important}
 html[data-finman-theme] .finman-themed-report :is(h1,h2,h3,p,td,th,span,label,button){font-family:var(--theme-font)!important;color:var(--theme-text)!important}
 html[data-finman-theme] .finman-themed-report :is(table,p,td,th){font-size:var(--theme-size)!important}
 html[data-finman-theme] .finman-themed-report :is(td,th){padding:var(--theme-row) 8px!important;border-color:var(--theme-border)!important}
 html[data-finman-theme] .finman-themed-report :is(th,tfoot){background:var(--theme-soft)!important}
}
@media print{
 html[data-finman-theme] .finman-themed-report{font-family:var(--theme-font)!important;color:#000!important;background:#fff!important}
 html[data-finman-theme] .finman-themed-report :is(p,td,th){font-family:var(--theme-font)!important;font-size:var(--theme-size)!important}
 html[data-finman-theme] .finman-themed-report :is(td,th){padding:var(--theme-row) 5px!important}
}
