/* TSC × JOGO: accessible dual-theme palette for all four portals.
   Missing alias variables caused white cards over light text in dark mode. */
:root{
 --card:var(--paper);--text:var(--ink);--input:var(--paper);
 --surface:var(--paper);--border:var(--line);
}
[data-theme="light"],[data-theme="dark"]{
 --card:var(--paper);--text:var(--ink);--input:var(--paper);
 --surface:var(--paper);--border:var(--line);
}
[data-theme="dark"]{
 color-scheme:dark;
 --theme-subpanel:#12392b;
 --theme-hover:#174b37;
 --theme-outline:#416e57;
 --theme-warn-bg:#39301e;
 --theme-warn-text:#f5d89a;
}
[data-theme="light"]{
 color-scheme:light;
 --theme-subpanel:#ecf7f0;
 --theme-hover:#e5f3eb;
 --theme-outline:#c5dfd0;
 --theme-warn-bg:#fff7df;
 --theme-warn-text:#71521b;
}
/* Authenticated financial panels: align backgrounds, text, inputs and tables. */
[data-theme="dark"] .tsc-daily .panel,
[data-theme="dark"] .tsc-daily .stat{
 background:var(--paper)!important;
 color:var(--ink)!important;
 border-color:var(--line)!important;
}
[data-theme="dark"] .tsc-daily .stat strong,
[data-theme="dark"] .tsc-daily .panel h2,
[data-theme="dark"] .tsc-daily td,
[data-theme="dark"] .tsc-daily .conditions{
 color:var(--ink)!important;
}
[data-theme="dark"] .tsc-daily th{
 background:#17402f!important;
 color:#e5f6eb!important;
 border-bottom-color:var(--line)!important;
}
[data-theme="dark"] .tsc-daily td{
 border-bottom-color:var(--line)!important;
}
[data-theme="dark"] .tsc-daily .small,
[data-theme="dark"] .tsc-daily .stat small,
[data-theme="dark"] .tsc-daily .filters label{
 color:var(--muted)!important;
}
[data-theme="dark"] .tsc-daily .tag{
 background:#164e36;
 color:#b7f2d1;
}
[data-theme="dark"] .tsc-daily .tag.warn{
 background:#563e25;
 color:#ffe1a4;
}
[data-theme="dark"] .tsc-daily .notice{
 background:var(--theme-warn-bg)!important;
 border-color:#80683d!important;
 color:var(--theme-warn-text)!important;
}
[data-theme="dark"] .tsc-daily select,
[data-theme="dark"] .tsc-daily input:not([type="checkbox"]),
[data-theme="dark"] .tsc-contract-card select,
[data-theme="dark"] .tsc-contract-card input:not([type="checkbox"]),
[data-theme="dark"] .tsc-contract-card textarea{
 background:#102c22!important;
 color:#eaf6ef!important;
 border-color:var(--theme-outline)!important;
}
[data-theme="dark"] .tsc-daily select option,
[data-theme="dark"] .tsc-contract-card select option{
 background:#102c22;
 color:#eaf6ef;
}
[data-theme="dark"] .tsc-daily [data-tsc-expense-summary] .tsc-expense-total,
[data-theme="dark"] .tsc-daily .tsc-expense-total{
 background:#133f2c!important;
 color:#e5faeb!important;
 border-color:#438a64!important;
}
[data-theme="dark"] .tsc-daily [data-tsc-expense-summary] .tsc-expense-total *,
[data-theme="dark"] .tsc-daily .tsc-expense-total strong{
 color:inherit;
}
/* Secondary contract cards and status chips, including inline render updates. */
[data-theme="dark"] .tsc-contract-card,
[data-theme="dark"] .tsc-contract-section,
[data-theme="dark"] .tsc-contract-grid>div{
 background:var(--paper);
 color:var(--ink);
 border-color:var(--line);
}
[data-theme="dark"] .tsc-contract-steps span{
 background:#1b4b36;
 color:#d2f0df;
}
[data-theme="dark"] .tsc-contract-steps span[style]{
 background:#155138!important;
 color:#b9ffdc!important;
}
[data-theme="dark"] .tsc-contract-warning,
[data-theme="dark"] .tsc-contract-priority{
 background:#3b301a;
 color:#ffe0a0;
 border-color:#97713e;
}
/* Payment calendar popover should match the selected palette. */
[data-theme="dark"] .tsc-range-pop{
 background:#112c22!important;
 color:#f0f8f2!important;
 border-color:#3e6853!important;
}
[data-theme="dark"] .tsc-range-pop :is(button,select){
 color:inherit;
}
[data-theme="dark"] .tsc-range-pop :is(button,select):hover{
 background:var(--theme-hover);
}
/* General cards and panels created by authenticated modules. */
[data-theme="dark"] #content .tsc-fin-total{
 background:#17422f;
 color:#edf9f0;
}
[data-theme="dark"] #content :is(.tsc-overview-card,.tsc-creation-status){
 background:#133328;
 color:#edf8f0;
 border-color:var(--line);
}
[data-theme="dark"] #content .tsc-overview-card strong,
[data-theme="dark"] #content .tsc-overview-card h3,
[data-theme="dark"] #content .tsc-overview-row b{
 color:#e3f6e8;
}
[data-theme="dark"] #content .tsc-overview-card small{
 color:#adcab9;
}
[data-theme="dark"] #content .tsc-overview-row{
 border-color:var(--line);
}
[data-theme="dark"] #content .tsc-overview-warning{
 background:#44371f;
 color:#f5dcad;
 border-color:#80683f;
}
[data-theme="dark"] .tsc-daily [data-tsc-expense-summary] .v45-range-trigger{
 background:#11382a;
 color:#f2f9f4;
 border-color:#41a582;
}
[data-theme="dark"] .tsc-daily .filters select,
[data-theme="dark"] .tsc-daily .filters input{
 color:var(--ink);
}
[data-theme="dark"] #content a:not(.btn):focus-visible,
[data-theme="dark"] #content button:focus-visible,
[data-theme="light"] #content button:focus-visible{
 outline:2px solid var(--green);
 outline-offset:3px;
}
