/* BIN TAJ Studio V4.5 — CENTRAL LAST-LOAD DESIGN LAYER
   Owner + Worker, Light + Dark; all existing API routes and records untouched. */
html[data-bt-theme="dark"]{
 --v4-bg:#0B1323;--v4-side:#261F42;--v4-top:#17253B;
 --v4-card:#1C2B44;--v4-card2:#253651;--v4-input:#20314B;
 --v4-line:#405372;--v4-text:#F7F9FF;--v4-muted:#C2CDE2;--v4-sub:#A4B5D0;
 --v4-purple:#C4ACFF;--v4-accent:#9BAFFF;--v4-green:#78E2C1;
 --v4-amber:#F9D18E;--v4-bad:#FF9DAC;--v4-pill:#3F3469;
 --v4-chip:#253650;--v4-pale:#152339;--v4-grid:#384C69;
 --v45-field:#20304A;--v45-card-alt:#223450;--v45-row:#253550;
 color-scheme:dark;
}
html[data-bt-theme="light"]{
 --v4-bg:#EEF3FB;--v4-side:#E7E5F7;--v4-top:#FBFCFF;
 --v4-card:#FFFFFF;--v4-card2:#F6F8FF;--v4-input:#F5F7FD;
 --v4-line:#D1DCEC;--v4-text:#17243C;--v4-muted:#526480;--v4-sub:#667996;
 --v4-purple:#7557D4;--v4-accent:#5164DF;--v4-green:#137F62;
 --v4-amber:#9B650B;--v4-bad:#B52E4E;--v4-pill:#DCD9F5;
 --v4-chip:#F0F3FC;--v4-pale:#F5F7FD;--v4-grid:#E0E8F4;
 --v45-field:#F2F5FC;--v45-card-alt:#F7F9FD;--v45-row:#F1F5FB;
 color-scheme:light;
}
body[data-bt-portal] #content{color:var(--v4-text)!important}
/* Keep the actual data surfaces aligned with the theme. Legacy modules hardcode
   white backgrounds in several places; this list covers those modules too. */
body[data-bt-portal] #content :is(
 .panel,.card,.member-card,.bt1212-card,.bt1212-provider,.bt1212-stack-card,
 .bt1213-panel,.bt1213-card,.bt12-kpi,.bt12-card,.bt1340-owner-kpi,
 .bt1340-owner-live,.bt1340-owner-summary .bt1340-owner-kpi,
 .bt128-drive-live>div,.bt127-safe-state,.bt128-drive-actions,
 .bt129-ai-box,.bt11-ai-side,.bt11-ai-main,.bt11-ai-composebox,
 .bt132-list,.bt132-chat,.chat-card,.v4-card,.bt139-att-card,
 .bt12-att-card,.bt1340-owner-table,.bt1340-owner-toolbar,.bt1212-rule,
 .bt1212-free-bar,.bt1212-free-list,.bt129-ai-panel
 ){
  background:var(--v4-card)!important;
  color:var(--v4-text)!important;
  border-color:var(--v4-line)!important;
}
/* Data cards within other cards should be slightly raised. */
body[data-bt-portal] #content :is(.bt1340-owner-kpi,.bt128-drive-live>div,.bt1212-stack-card,.bt1212-free-bar,.bt127-safe-state,.bt1212-rule,.bt1340-owner-toolbar,.bt1212-modal-note){
 background:var(--v45-card-alt)!important;color:var(--v4-text)!important;
 border:1px solid var(--v4-line)!important;border-radius:12px!important;
}
body[data-bt-portal] #content :is(h1,h2,h3,h4,h5,h6,.member-card-top b,.bt1340-owner-kpi b,.bt128-drive-live b,.bt1212-stack-card b,.bt1212-provider b,.bt1340-owner-live b){
 color:var(--v4-text)!important;opacity:1!important;
}
body[data-bt-portal] #content :is(.subtext,.muted,.bt1340-owner-kpi span,.bt128-drive-live span,.bt1340-owner-live span,.bt1212-card p,.bt1212-stack-card p,.bt1212-provider p,.bt1212-head p,.bt127-safe-state small,.bt1340-owner-sub){
 color:var(--v4-muted)!important;opacity:1!important;
}
/* Tables consistently preserve readable headings, data, and grid boundaries. */
body[data-bt-portal] #content :is(.table,.bt1340-owner-table,.bt1340-owner-table table,.table-wrap,table){
 color:var(--v4-text)!important;border-color:var(--v4-line)!important;
}
body[data-bt-portal] #content :is(th,thead td){
 background:var(--v4-card2)!important;color:var(--v4-muted)!important;
 border-color:var(--v4-line)!important;font-weight:730!important;
}
body[data-bt-portal] #content :is(td,tbody tr){
 background:var(--v4-card)!important;border-color:var(--v4-line)!important;
 color:var(--v4-text)!important;
}
body[data-bt-portal] #content :is(td b,td strong,td small){color:var(--v4-text)!important}
body[data-bt-portal] #content :is(tr:hover td){background:var(--v4-card2)!important}
/* Forms/filters: dark-mode native month, time, date inputs must not be white. */
body[data-bt-portal] #content :is(input,select,textarea){
 color:var(--v4-text)!important;background:var(--v45-field)!important;
 border:1px solid var(--v4-line)!important;
 border-radius:11px!important;
}
body[data-bt-portal] #content :is(input,select,textarea)::placeholder{color:var(--v4-sub)!important;opacity:1!important}
body[data-bt-portal] #content :is(.field>label,.field label,.bt1340-owner-toolbar label,.bt11-ai-side label){
 color:var(--v4-muted)!important;opacity:1!important;
}
body[data-bt-portal] #content :is(.pill,.badge,[class*="-status"],.bt1212-chip){border-color:var(--v4-line)!important}
/* Preserve semantic meanings while ensuring a legible dark-mode warning/success. */
html[data-bt-theme="dark"] body[data-bt-portal] #content :is(.pill.green,.pill.good,.bt127-safe-state.good,.status.good,.bt1212-status.good){
 color:#98F3D6!important;background:#20483E!important;
}
html[data-bt-theme="dark"] body[data-bt-portal] #content :is(.pill.warn,.bt127-safe-state.warn,.status.warn){
 color:#FFE2A7!important;background:#453822!important;
}
html[data-bt-theme="dark"] body[data-bt-portal] #content :is(.pill.red,.pill.danger,.status.bad){
 color:#FFC0C9!important;background:#512B37!important;
}
/* Attendance: all KPI values, including Off/Leave, show against their own card.
   The existing system otherwise leaves some zeroes WHITE on WHITE in dark mode. */
html[data-bt-theme="dark"] body[data-bt-portal="owner"] #content .bt1340-owner-kpi,
html[data-bt-theme="dark"] body[data-bt-portal="owner"] #content .bt1340-owner-live .bt1340-owner-kpi{
 background:var(--v4-card)!important;border-color:var(--v4-line)!important;
}
html[data-bt-theme="dark"] body[data-bt-portal="owner"] #content .bt1340-owner-kpi :is(b,strong,small,span){
 color:var(--v4-text)!important;opacity:1!important;
}
html[data-bt-theme="dark"] body[data-bt-portal="owner"] #content .bt1340-owner-kpi span{color:var(--v4-muted)!important}
/* Backup protected rows — natural height, single border (no doubled outlines). */
body[data-bt-portal="owner"] #content:has(#bt128SafeStatus) :is(.bt127-safe-state,.bt128-drive-live>div){
 background:var(--v45-card-alt)!important;color:var(--v4-text)!important;
 border:1px solid var(--v4-line)!important;box-shadow:none!important;
 min-width:0!important;max-width:100%!important;
}
body[data-bt-portal="owner"] #content:has(#bt128SafeStatus) .bt127-safe-state :is(span,b,small){
 color:var(--v4-muted)!important;opacity:1!important;
}
body[data-bt-portal="owner"] #content:has(#bt128SafeStatus) :is(.bt127-safe-grid,.bt127p-grid,.bt128-drive-grid){min-width:0!important;max-width:100%!important;}
body[data-bt-portal="owner"] #content:has(#bt128SafeStatus) :is(.bt127-safe-state,.bt128-drive-live){overflow:hidden!important;}
body[data-bt-portal="owner"] #content:has(#bt128SafeStatus) .bt127-safe-state{line-height:1.5!important}
/* The 13.x Backup button blue style is bundled in the original HTML. Override by
   brand violet, and mark destructive restore as warning instead of bright blue. */
body[data-bt-portal="owner"] #content:has(#bt128SafeStatus) :is(.bt128-drive-actions,.bt1341-backup-actions) .btn.blue,
body[data-bt-portal="owner"] #content:has(#bt128SafeStatus) :is(.bt128-drive-actions,.bt1341-backup-actions) .btn.primary{
 background:linear-gradient(125deg,#705CDC,#9874ED)!important;border:1px solid transparent!important;
 color:#fff!important;box-shadow:0 7px 17px #5243B522!important;
}
body[data-bt-portal="owner"] #content:has(#bt128SafeStatus) :is(.bt128-drive-actions,.bt1341-backup-actions) .btn:not(.blue):not(.primary){
 color:var(--v4-text)!important;background:var(--v4-card2)!important;
 border:1px solid var(--v4-line)!important;box-shadow:none!important;
}
body[data-bt-portal="owner"] #content:has(#bt128SafeStatus) :is(.bt128-drive-actions,.bt1341-backup-actions) .btn.green{
 color:var(--v4-amber)!important;border-color:var(--v4-amber)!important;
}
body[data-bt-portal] :is(.btn,.button){white-space:normal!important;line-height:1.25!important}
/* Focus + subtle depth, not noisy glass across every panel. */
body[data-bt-portal] #content :is(.panel,.member-card,.v4-card){box-shadow:var(--v4-shadow)!important;}
body[data-bt-portal] #content :is(.panel,.member-card,.v4-card):focus-within{border-color:var(--v4-accent)!important}
@media(max-width:780px){
 body[data-bt-portal] #content :is(.bt1340-owner-table,.table-wrap){overflow-x:auto!important;max-width:100%!important;}
 body[data-bt-portal] #content :is(.bt128-drive-actions,.bt1341-backup-actions){display:flex!important;flex-wrap:wrap!important;gap:8px!important;}
 body[data-bt-portal] #content :is(.bt128-drive-actions,.bt1341-backup-actions) .btn{min-height:42px!important}
}
/* Protected Recovery Point: each actual 13.x .idea row is a two-column status row.
   The earlier selector fixed its wrapper but not the .idea children. */
body[data-bt-portal="owner"] #content:has(#bt128SafeStatus) .idea{
 display:flex!important;align-items:center!important;justify-content:space-between!important;
 gap:12px!important;min-height:44px!important;margin:7px 0!important;
 padding:10px 13px!important;box-sizing:border-box!important;
 background:var(--v45-card-alt)!important;border:1px solid var(--v4-line)!important;
 border-radius:11px!important;box-shadow:none!important;
}
body[data-bt-portal="owner"] #content:has(#bt128SafeStatus) .idea > span:first-child{
 min-width:0!important;flex:1 1 auto!important;color:var(--v4-muted)!important;
 font-size:12px!important;line-height:1.4!important;
}
body[data-bt-portal="owner"] #content:has(#bt128SafeStatus) .idea > .pill{
 flex:0 0 auto!important;display:inline-flex!important;align-items:center!important;
 justify-content:center!important;min-width:36px!important;
 padding:4px 9px!important;line-height:1.1!important;position:static!important;
 background:var(--v4-pill)!important;color:var(--v4-text)!important;
 border:1px solid var(--v4-line)!important;
}
