/* =====================================================================
   STG DARK MODE  — loaded LAST (site_head + panel_head in includes/layout.php)
   Active only when <html data-theme="dark">. (The prefix html:not(#dm1):not(#dm2)[data-theme=dark] is used on purpose: it out-ranks the older !important rules.) Light mode is untouched.
   Goal: every letter readable (text vs background contrast >= 4.5:1).
   To remove dark mode: delete the dark-mode.css / dark-mode.js lines in layout.php.
   ===================================================================== */

/* ---------- toggle button (both modes) ---------- */
html body header .theme-toggle{border-radius:50% !important;width:38px !important;height:38px !important;min-width:38px !important;padding:0 !important;margin:0 6px !important;display:inline-flex !important;align-items:center !important;justify-content:center !important;border:1px solid rgba(100,116,139,.45) !important;background:#fff !important;color:#1e293b !important;box-shadow:none !important}
html body header .theme-toggle svg{width:18px !important;height:18px !important;color:inherit !important;stroke:currentColor !important;fill:none !important}
html body header .theme-toggle .tt-sun{display:none !important}

.theme-toggle{display:inline-flex;align-items:center;justify-content:center;flex:none;width:38px;height:38px;padding:0;margin:0 6px;border-radius:50%;border:1px solid rgba(100,116,139,.45);background:#fff;color:#1e293b;cursor:pointer;line-height:1;transition:background .2s,color .2s,border-color .2s,transform .2s}
.theme-toggle:hover{transform:scale(1.08);border-color:#b98216}
.theme-toggle:focus-visible{outline:3px solid #b98216;outline-offset:2px}
.theme-toggle svg{width:18px;height:18px;display:block}
.theme-toggle .tt-sun{display:none}
html:not(#dm1):not(#dm2)[data-theme="dark"] .theme-toggle .tt-sun{display:block}
html:not(#dm1):not(#dm2)[data-theme="dark"] .theme-toggle .tt-moon{display:none}
nav#nav .theme-toggle{align-self:center}

/* ---------- core palette ---------- */
html:not(#dm1):not(#dm2)[data-theme="dark"]{
  color-scheme:dark;
  --dm-bg:#0b1220;--dm-bg2:#0f1829;--dm-card:#142038;--dm-card2:#1a2a47;--dm-line:#31456a;
  --dm-text:#f4f7fc;--dm-text2:#d5deec;--dm-link:#8fb8ff;--dm-gold:#f2cf6b;
  --bg:#0b1220;--soft:#142038;--ink:#f4f7fc;--mut:#d5deec;--line:#31456a;
  --navy:#8fb8ff;--gold:#f2cf6b;--goldl:#f2cf6b;
  --stg-blue:#8fb8ff;--stg-blue2:#6ea1f5;--stg-deep:#0b1220;--stg-surface:rgba(20,32,56,.96);
  --admin-purple:#f2cf6b;--admin-purple-dark:#f2cf6b;--admin-ink:#f4f7fc;--admin-muted:#d5deec;--admin-bg:#0b1220;--admin-line:#31456a;
  --ref-canvas:#0b1220;--ref-surface:#142038;--ref-search:#1a2a47;--ref-border:#31456a;
  --ref-text:#f4f7fc;--ref-muted:#d5deec;--ref-subtle:#b6c4da;--ref-teal-soft:#0e3b3a;--ref-navy:#0b1220;--ref-indigo:#8fb8ff;
  --panel-bg:#0b1220;--sidebar-bg:#0f1829;--ink-navy:#f4f7fc;
  --glass-ink:#f4f7fc;--glass-muted:#d5deec;--glass-line:rgba(143,184,255,.25);--glass-white:rgba(20,32,56,.88);
}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody{
  --t-bg:#0b1220;--t-side:#0f1829;--t-card:#142038;--t-line:#31456a;--t-text:#f4f7fc;--t-mut:#d5deec;
  --t-teal-soft:#0e3b3a;--t-ind-soft:#1f2a5c;--t-amber-soft:#40310a;--t-green-soft:#0d3a26;--t-red-soft:#451722;
  --t-shadow:0 2px 12px rgba(0,0,0,.45);--t-shadow-h:0 10px 26px rgba(0,0,0,.55);
  --navy:#8fb8ff;--gold:#2dd4bf;--goldl:#2dd4bf;--soft:#142038;--ink:#f4f7fc;--mut:#d5deec;--line:#31456a;--bg:#0b1220;
  --stg-blue:#8fb8ff;--stg-blue2:#2dd4bf;--stg-deep:#f4f7fc;
  --admin-purple:#2dd4bf;--admin-purple-dark:#2dd4bf;--admin-ink:#f4f7fc;--admin-muted:#d5deec;--admin-bg:#0b1220;--admin-line:#31456a;
}

/* ---------- page canvas ---------- */
html:not(#dm1):not(#dm2)[data-theme="dark"],
html:not(#dm1):not(#dm2)[data-theme="dark"] body,
html:not(#dm1):not(#dm2)[data-theme="dark"] body:not(.auth-page):not(.pbody),
html:not(#dm1):not(#dm2)[data-theme="dark"] body.home-page,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .content,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody main.content,
html:not(#dm1):not(#dm2)[data-theme="dark"]:has(body.pbody){background:#0b1220 !important;background-image:none !important;color:#f4f7fc !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] main{background:transparent !important;color:#f4f7fc}

/* ---------- text: everything readable ---------- */
html:not(#dm1):not(#dm2)[data-theme="dark"] body :where(h1,h2,h3,h4,h5,h6,p,li,span,small,strong,b,em,label,legend,dt,dd,th,td,div,figcaption,summary,address,blockquote){-webkit-text-fill-color:currentColor}
html:not(#dm1):not(#dm2)[data-theme="dark"] main :where(h1,h2,h3,h4,h5,h6){color:#f4f7fc !important;background-image:none}
html:not(#dm1):not(#dm2)[data-theme="dark"] main :where(p,li,dt,dd,label,legend,figcaption,address,blockquote,small){color:#e3eaf5 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] main :where(.muted,.hint,.sub,.meta,.lbl,small,.mut,.ftag){color:#c9d5e8 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] main a:not(.btn):not(.home-btn):not([class*="btn"]):not(.on){color:#8fb8ff}
html:not(#dm1):not(#dm2)[data-theme="dark"] main a:not(.btn):not(.home-btn):not([class*="btn"]):hover{color:#c4dbff}
html:not(#dm1):not(#dm2)[data-theme="dark"] ::placeholder{color:#a9b8cf !important;opacity:1 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] ::selection{background:#f2cf6b;color:#0b1220}
html:not(#dm1):not(#dm2)[data-theme="dark"] hr{border-color:#31456a}

/* ---------- public site: header / nav ---------- */
html:not(#dm1):not(#dm2)[data-theme="dark"] header:not(.ptop){background:#0f1829 !important;background-image:none !important;border-bottom-color:#f2cf6b !important;box-shadow:0 6px 22px rgba(0,0,0,.5) !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] header:not(.ptop) .bar,
html:not(#dm1):not(#dm2)[data-theme="dark"] header:not(.ptop) nav{background:transparent !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] header:not(.ptop) nav a,
html:not(#dm1):not(#dm2)[data-theme="dark"] header:not(.ptop) nav a span,
html:not(#dm1):not(#dm2)[data-theme="dark"] header:not(.ptop) .dd-b,
html:not(#dm1):not(#dm2)[data-theme="dark"] header:not(.ptop) .dd-b span,
html:not(#dm1):not(#dm2)[data-theme="dark"] header:not(.ptop) .burger{color:#eaf0fb !important;-webkit-text-fill-color:#eaf0fb !important;background-color:transparent}
html:not(#dm1):not(#dm2)[data-theme="dark"] header:not(.ptop) nav a svg,
html:not(#dm1):not(#dm2)[data-theme="dark"] header:not(.ptop) .dd-b svg,
html:not(#dm1):not(#dm2)[data-theme="dark"] header:not(.ptop) .burger svg{color:#f2cf6b !important;stroke:currentColor}
html:not(#dm1):not(#dm2)[data-theme="dark"] header:not(.ptop) nav a:hover,
html:not(#dm1):not(#dm2)[data-theme="dark"] header:not(.ptop) .dd-b:hover{background:#1a2a47 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] header:not(.ptop) nav a.on,
html:not(#dm1):not(#dm2)[data-theme="dark"] header:not(.ptop) .dd-b.on{background:#f2cf6b !important;color:#0b1220 !important;-webkit-text-fill-color:#0b1220 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] header:not(.ptop) nav a.on span,
html:not(#dm1):not(#dm2)[data-theme="dark"] header:not(.ptop) .dd-b.on span,
html:not(#dm1):not(#dm2)[data-theme="dark"] header:not(.ptop) nav a.on svg,
html:not(#dm1):not(#dm2)[data-theme="dark"] header:not(.ptop) .dd-b.on svg{color:#0b1220 !important;-webkit-text-fill-color:#0b1220 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] .dd-m{background:#142038 !important;border-color:#f2cf6b !important;box-shadow:0 14px 34px rgba(0,0,0,.6) !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] .dd-m a,
html:not(#dm1):not(#dm2)[data-theme="dark"] .dd-m a span{color:#eaf0fb !important;-webkit-text-fill-color:#eaf0fb !important;background:transparent !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] .dd-m a:hover{background:#1f3358 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] .dd-m a.on{background:#f2cf6b !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] .dd-m a.on,
html:not(#dm1):not(#dm2)[data-theme="dark"] .dd-m a.on span,
html:not(#dm1):not(#dm2)[data-theme="dark"] .dd-m a.on svg{color:#0b1220 !important;-webkit-text-fill-color:#0b1220 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] .logo img{background:#fff;border-radius:8px;padding:2px 6px}

/* language switch (site + panel) */
html:not(#dm1):not(#dm2)[data-theme="dark"] .lang{background:#142038 !important;border:1px solid #31456a !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] .lang a{background:transparent !important;color:#eaf0fb !important;-webkit-text-fill-color:#eaf0fb !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] .lang a.on{background:#f2cf6b !important;color:#0b1220 !important;-webkit-text-fill-color:#0b1220 !important}

/* theme button */
html:not(#dm1):not(#dm2)[data-theme="dark"] .theme-toggle{background:#142038;color:#f2cf6b;border-color:#4a6291}

/* mobile nav drawer */
@media (max-width:980px){
  html:not(#dm1):not(#dm2)[data-theme="dark"] header:not(.ptop) nav#nav{background:#0f1829 !important;border-color:#31456a !important}
}

/* ---------- cards, boxes, panels ---------- */
html:not(#dm1):not(#dm2)[data-theme="dark"] :where(.card,.box,.paybox,.chart-card,.chart-panel,.chart-card-in,.home-value-strip,.mis-card,.mis-empty,.stat,.kpi,.ki,.kpis>div,.crm-panel,.crm-kpi,.profile-info-card,.reg-summary-card,.reg-info-section,.stg-tp-card,.settings-group,.comm-stat,.detail,.doc,.enquiry-full,.fee-full,.tp-top,.cjob-meta-item,.flist li,.pbox,.sbox,.table-wrap,.panel,.pcard,.welcome,.dash-anim,.tile,.item,.row2 > div){
  background:#142038 !important;background-image:none !important;border-color:#31456a !important;color:#f4f7fc !important;box-shadow:0 8px 24px rgba(0,0,0,.35) !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] :where(.card,.box,.paybox,.kpi,.stat,.ki,.crm-panel,.profile-info-card,.settings-group,.stg-tp-card) :where(h1,h2,h3,h4,h5,h6,strong,b,.amount,.tp-title){color:#f4f7fc !important;-webkit-text-fill-color:#f4f7fc !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] :where(.card,.box,.paybox,.kpi,.stat,.ki,.crm-panel,.profile-info-card,.settings-group,.stg-tp-card) :where(p,span,small,li,div,label,.hint,.muted,.sub,.meta){color:#d5deec !important;-webkit-text-fill-color:#d5deec !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] :where(.card,.box,.paybox,.kpi,.stat,.ki,.crm-panel,.profile-info-card,.settings-group,.stg-tp-card) a:not(.btn):not([class*="btn"]){color:#8fb8ff !important;-webkit-text-fill-color:#8fb8ff !important}

/* ---------- tables ---------- */
html:not(#dm1):not(#dm2)[data-theme="dark"] table{background:transparent !important;color:#f4f7fc !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] table th{background:#1f3358 !important;background-image:none !important;color:#ffffff !important;-webkit-text-fill-color:#ffffff !important;border-color:#3a5380 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] table td{background:#142038 !important;color:#eef3fb !important;-webkit-text-fill-color:#eef3fb !important;border-color:#2a3b5c !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] table tr:nth-child(even) td{background:#182744 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] table tr:hover td,
html:not(#dm1):not(#dm2)[data-theme="dark"] table tr:hover th{background:#223a63 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] table td a:not(.btn):not([class*="btn"]){color:#8fb8ff !important;-webkit-text-fill-color:#8fb8ff !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] table td :where(span,small,b,strong,div,p){color:inherit}

/* ---------- forms ---------- */
html:not(#dm1):not(#dm2)[data-theme="dark"] :where(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=submit]):not([type=button]){
  background:#0f1829 !important;background-image:none;color:#f4f7fc !important;-webkit-text-fill-color:#f4f7fc !important;border-color:#4a6291 !important;caret-color:#f2cf6b}
html:not(#dm1):not(#dm2)[data-theme="dark"] :where(input,select,textarea):focus{border-color:#f2cf6b !important;box-shadow:0 0 0 4px rgba(242,207,107,.22) !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] :where(input,select,textarea):disabled,
html:not(#dm1):not(#dm2)[data-theme="dark"] :where(input,select,textarea)[readonly]{background:#1a2438 !important;color:#c9d5e8 !important;-webkit-text-fill-color:#c9d5e8 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] select option,
html:not(#dm1):not(#dm2)[data-theme="dark"] select optgroup{background:#0f1829;color:#f4f7fc}
html:not(#dm1):not(#dm2)[data-theme="dark"] input[type=file]{color:#e3eaf5 !important;background:#0f1829 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px #0f1829 inset !important;-webkit-text-fill-color:#f4f7fc !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] label{color:#e3eaf5}
html:not(#dm1):not(#dm2)[data-theme="dark"] .err,
html:not(#dm1):not(#dm2)[data-theme="dark"] .error{color:#ffb4b4 !important}

/* ---------- alerts / flash / badges ---------- */
html:not(#dm1):not(#dm2)[data-theme="dark"] .flash{background:#1a2a47 !important;background-image:none !important;color:#f4f7fc !important;border-color:#31456a !important;border-left-color:#f2cf6b !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] .flash.err{background:#451722 !important;color:#ffe1e1 !important;border-left-color:#ff7b7b !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] .flash *{color:inherit !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] .badge,
html:not(#dm1):not(#dm2)[data-theme="dark"] .tag{background:#1f3358 !important;color:#eaf0fb !important;-webkit-text-fill-color:#eaf0fb !important;border:1px solid #4a6291 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] .badge.ok,html:not(#dm1):not(#dm2)[data-theme="dark"] .badge.green,html:not(#dm1):not(#dm2)[data-theme="dark"] .badge.success,html:not(#dm1):not(#dm2)[data-theme="dark"] .badge.paid,html:not(#dm1):not(#dm2)[data-theme="dark"] .badge.active,html:not(#dm1):not(#dm2)[data-theme="dark"] .badge.approved{background:#0d3a26 !important;color:#9df0c1 !important;-webkit-text-fill-color:#9df0c1 !important;border-color:#1f7a4d !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] .badge.warn,html:not(#dm1):not(#dm2)[data-theme="dark"] .badge.amber,html:not(#dm1):not(#dm2)[data-theme="dark"] .badge.pending,html:not(#dm1):not(#dm2)[data-theme="dark"] .badge.new{background:#40310a !important;color:#ffd978 !important;-webkit-text-fill-color:#ffd978 !important;border-color:#8a6a14 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] .badge.bad,html:not(#dm1):not(#dm2)[data-theme="dark"] .badge.red,html:not(#dm1):not(#dm2)[data-theme="dark"] .badge.danger,html:not(#dm1):not(#dm2)[data-theme="dark"] .badge.rejected,html:not(#dm1):not(#dm2)[data-theme="dark"] .badge.failed,html:not(#dm1):not(#dm2)[data-theme="dark"] .badge.inactive{background:#451722 !important;color:#ffb4c0 !important;-webkit-text-fill-color:#ffb4c0 !important;border-color:#9a2b44 !important}

/* ---------- buttons ---------- */
html:not(#dm1):not(#dm2)[data-theme="dark"] .btn,
html:not(#dm1):not(#dm2)[data-theme="dark"] button.btn,
html:not(#dm1):not(#dm2)[data-theme="dark"] a.btn{background:#f2cf6b !important;background-image:none !important;color:#0b1220 !important;-webkit-text-fill-color:#0b1220 !important;border-color:#f2cf6b !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] .btn *{color:#0b1220 !important;-webkit-text-fill-color:#0b1220 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] .btn:hover{background:#ffe08a !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] .btn.alt,
html:not(#dm1):not(#dm2)[data-theme="dark"] .btn.secondary,
html:not(#dm1):not(#dm2)[data-theme="dark"] .btn.sm.alt{background:transparent !important;color:#f4f7fc !important;-webkit-text-fill-color:#f4f7fc !important;border:2px solid #8fb8ff !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] .btn.alt *,
html:not(#dm1):not(#dm2)[data-theme="dark"] .btn.secondary *{color:#f4f7fc !important;-webkit-text-fill-color:#f4f7fc !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] .btn.alt:hover,
html:not(#dm1):not(#dm2)[data-theme="dark"] .btn.secondary:hover{background:#1f3358 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] .btn.danger,
html:not(#dm1):not(#dm2)[data-theme="dark"] .btn.del{background:#ff6b81 !important;border-color:#ff6b81 !important;color:#2a0510 !important;-webkit-text-fill-color:#2a0510 !important}

/* ---------- footer ---------- */
html:not(#dm1):not(#dm2)[data-theme="dark"] footer{background:#070d19 !important;background-image:none !important;color:#e3eaf5 !important;border-top:3px solid #f2cf6b}
html:not(#dm1):not(#dm2)[data-theme="dark"] footer :where(p,li,span,div,address,b,strong){color:#e3eaf5 !important;-webkit-text-fill-color:#e3eaf5 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] footer h3{color:#f2cf6b !important;-webkit-text-fill-color:#f2cf6b !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] footer a,
html:not(#dm1):not(#dm2)[data-theme="dark"] footer a span{color:#e3eaf5 !important;-webkit-text-fill-color:#e3eaf5 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] footer a:hover,
html:not(#dm1):not(#dm2)[data-theme="dark"] footer a:hover span{color:#f2cf6b !important;-webkit-text-fill-color:#f2cf6b !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] footer svg{color:#f2cf6b !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] .fbar{background:#04080f !important;color:#c9d5e8 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] .flogo{background:#fff;border-radius:10px;padding:6px}

/* ---------- modal / popup ---------- */
html:not(#dm1):not(#dm2)[data-theme="dark"] .pbox{background:#142038 !important;color:#f4f7fc !important;border:1px solid #31456a}
html:not(#dm1):not(#dm2)[data-theme="dark"] .pbox :where(h1,h2,h3,p,li,span,div,b,strong){color:#f4f7fc !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] .totop{background:#f2cf6b !important;color:#0b1220 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] .totop svg{color:#0b1220 !important}

/* ---------- panel (admin / candidate / employee / franchise / company) ---------- */
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .ptop,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody header.ptop{background:#0f1829 !important;background-image:none !important;border-bottom:1px solid #31456a !important;box-shadow:0 2px 14px rgba(0,0,0,.5) !important;color:#f4f7fc !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .ptop .prole{background:#0e3b3a !important;color:#7ff0e1 !important;-webkit-text-fill-color:#7ff0e1 !important;border:1px solid #1b8a82 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .ptop .prole *{color:inherit !important;-webkit-text-fill-color:inherit !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .ptop .pweb,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .ptop .pout,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .ptop .sbtn{background:#142038 !important;border:1px solid #4a6291 !important;color:#eaf0fb !important;-webkit-text-fill-color:#eaf0fb !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .ptop .pweb *,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .ptop .pout *,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .ptop .sbtn *{color:#eaf0fb !important;-webkit-text-fill-color:#eaf0fb !important;stroke:#eaf0fb !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .ptop .pweb:hover,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .ptop .pout:hover{background:#1f3358 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .ptop .pname,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .ptop .puser{color:#f4f7fc !important;-webkit-text-fill-color:#f4f7fc !important;background:transparent !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .ptop .av{background:#f2cf6b !important;color:#0b1220 !important;-webkit-text-fill-color:#0b1220 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .plogo img{background:#fff;border-radius:8px;padding:2px 6px}

html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody aside.side,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side nav{background:#0f1829 !important;background-image:none !important;border-right:1px solid #31456a !important;color:#eaf0fb !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side .sg,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side .sg span,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side .sg-toggle{color:#f2cf6b !important;-webkit-text-fill-color:#f2cf6b !important;background:transparent !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side .sg svg{color:#f2cf6b !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side .sl,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side a.sl,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side .sg-items a.sl,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side .sl span,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side .sl i,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side .sl svg{color:#e3eaf5 !important;-webkit-text-fill-color:#e3eaf5 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side .sl,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side a.sl,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side .sg-items a.sl:not(.on){background:#16233d !important;background-image:none !important;border-color:#2a3b5c !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side .sl:hover{background:#1a2a47 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side .sl.on,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side .sl.on span,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side .sl.on i,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side .sl.on svg{background-color:transparent;color:#0b1220 !important;-webkit-text-fill-color:#0b1220 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side .sl.on{background:#2dd4bf !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side .snum-badge{background:#ff6b81 !important;color:#2a0510 !important;-webkit-text-fill-color:#2a0510 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .overlay{background:rgba(0,0,0,.7)}

html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .adm-notif-pop,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .adm-notif-list,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .adm-notif-summary,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .adm-notif-foot{background:#142038 !important;color:#f4f7fc !important;border-color:#31456a !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .adm-notif-pop *{color:#e3eaf5 !important;-webkit-text-fill-color:#e3eaf5 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .adm-notif-btn{background:#142038 !important;color:#f2cf6b !important;border-color:#4a6291 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .adm-live-banner{background:#40310a !important;color:#ffe08a !important;border-color:#8a6a14 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .adm-live-banner *{color:#ffe08a !important;-webkit-text-fill-color:#ffe08a !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .adm-live-banner a{border-color:#ffe08a !important}

html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .phead,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .crm-panel-head,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .settings-group-head{background:transparent !important;background-image:none !important;border-color:#31456a !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .content :where(h1,h2,h3,h4,h5,h6,.section-title,.phead *){color:#f4f7fc !important;-webkit-text-fill-color:#f4f7fc !important;background-image:none !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .content :where(.section-kicker,.kpi small,.stat small,.ki small,.mis-k){color:#f2cf6b !important;-webkit-text-fill-color:#f2cf6b !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .work-clock{color:#7ff0e1 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .work-btn.in{background:#2dd4bf !important;color:#06201d !important;-webkit-text-fill-color:#06201d !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .work-btn.out{background:#ff6b81 !important;color:#2a0510 !important;-webkit-text-fill-color:#2a0510 !important}

/* tinted icon bubbles / progress */
html:not(#dm1):not(#dm2)[data-theme="dark"] :where(.profile-card-icon,.tp-ico,.strip-icon,.crm-kpi-icon,.reg-summary-icon,.settings-group-icon,.ic,.ci,.ti){background:#1f3358 !important;color:#f2cf6b !important;-webkit-text-fill-color:#f2cf6b !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] :where(.profile-card-icon,.tp-ico,.strip-icon,.crm-kpi-icon,.reg-summary-icon,.settings-group-icon,.ic,.ci,.ti) svg{color:#f2cf6b !important;stroke:currentColor}
html:not(#dm1):not(#dm2)[data-theme="dark"] .bar > i,
html:not(#dm1):not(#dm2)[data-theme="dark"] .progress{background-color:#31456a}

/* charts: keep SVG axis / labels visible */
html:not(#dm1):not(#dm2)[data-theme="dark"] svg text{fill:#e3eaf5}
html:not(#dm1):not(#dm2)[data-theme="dark"] .mis-axis,
html:not(#dm1):not(#dm2)[data-theme="dark"] .mis-axis *{color:#d5deec !important;fill:#d5deec}
html:not(#dm1):not(#dm2)[data-theme="dark"] canvas{filter:none}

/* chatbot widget */
html:not(#dm1):not(#dm2)[data-theme="dark"] :where(.cb,.chatbot,.cb-box,.cb-panel,#cbPanel,#cb){background:#142038 !important;color:#f4f7fc !important;border-color:#31456a !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] :where(.cb,.chatbot,.cb-box,.cb-panel,#cbPanel,#cb) :where(p,span,div,li,b,strong){color:#f4f7fc !important}

/* scrollbars */
html:not(#dm1):not(#dm2)[data-theme="dark"] *{scrollbar-color:#4a6291 #0f1829}
html:not(#dm1):not(#dm2)[data-theme="dark"] ::-webkit-scrollbar{background:#0f1829}
html:not(#dm1):not(#dm2)[data-theme="dark"] ::-webkit-scrollbar-thumb{background:#4a6291;border-radius:8px}

/* never darken: logo art, seals, signatures, QR, photos, printable documents */
html:not(#dm1):not(#dm2)[data-theme="dark"] :where(img,video,.seal,.qr,#qr,canvas.qr){filter:none}
html:not(#dm1):not(#dm2)[data-theme="dark"] :where(.cert,.certificate,.letter,.slip,.idcard,.receipt-doc,.print-doc,.paper){background:#fff !important;color:#111 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] :where(.cert,.certificate,.letter,.slip,.idcard,.receipt-doc,.print-doc,.paper) *{color:inherit}
@media print{
  html:not(#dm1):not(#dm2)[data-theme="dark"],html:not(#dm1):not(#dm2)[data-theme="dark"] body{background:#fff !important;color:#000 !important}
  .theme-toggle{display:none !important}
}

/* ---------- extra public-site surfaces (specificity beats site-core.css) ---------- */
html:not(#dm1):not(#dm2)[data-theme="dark"] body:not(.pbody) main > section,
html:not(#dm1):not(#dm2)[data-theme="dark"] body:not(.pbody) main section.hero,
html:not(#dm1):not(#dm2)[data-theme="dark"] body:not(.pbody) main .hero,
html:not(#dm1):not(#dm2)[data-theme="dark"] body:not(.pbody) main .scroll,
html:not(#dm1):not(#dm2)[data-theme="dark"] body:not(.pbody) main .table-wrap{background:#101a2e !important;background-image:none !important;border-color:#31456a !important;box-shadow:0 10px 30px rgba(0,0,0,.4) !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body:not(.pbody) main > section :where(h1,h2,h3,h4){color:#f4f7fc !important;-webkit-text-fill-color:#f4f7fc !important;background-image:none !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body:not(.pbody) main table th{background:#1f3358 !important;background-image:none !important;color:#fff !important;-webkit-text-fill-color:#fff !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body:not(.pbody) main table td{background:#142038 !important;color:#eef3fb !important;-webkit-text-fill-color:#eef3fb !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body:not(.pbody) main table tr:nth-child(even) td{background:#182744 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body:not(.pbody) > header,
html:not(#dm1):not(#dm2)[data-theme="dark"] body:not(.pbody) > header.scrolled{background:#0f1829 !important;background-image:none !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body:not(.pbody) > header nav a,
html:not(#dm1):not(#dm2)[data-theme="dark"] body:not(.pbody) > header nav a span{color:#eaf0fb !important;-webkit-text-fill-color:#eaf0fb !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body:not(.pbody) > header nav a.on,
html:not(#dm1):not(#dm2)[data-theme="dark"] body:not(.pbody) > header nav a.on span{color:#0b1220 !important;-webkit-text-fill-color:#0b1220 !important}

/* ---------- safety net: attributes written by dark-mode.js ---------- */
html:not(#dm1):not(#dm2):not(#dm3)[data-theme="dark"] [data-dm-bg="1"]{background-color:#142038 !important;background-image:none !important}
html:not(#dm1):not(#dm2):not(#dm3)[data-theme="dark"] [data-dm-bg="2"]{background-color:#1a2a47 !important;background-image:none !important}
html:not(#dm1):not(#dm2):not(#dm3)[data-theme="dark"] [data-dm-fg="l"]{color:#f4f7fc !important;-webkit-text-fill-color:#f4f7fc !important}
html:not(#dm1):not(#dm2):not(#dm3)[data-theme="dark"] [data-dm-fg="d"]{color:#0b1220 !important;-webkit-text-fill-color:#0b1220 !important}

/* sidebar states (must come after the block above) */
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side a.sl:not(.on):hover,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side .sg-items a.sl:not(.on):hover{background:#1f3358 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side a.sl.on,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side .sg-items a.sl.on{background:#2dd4bf !important;background-image:none !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side a.sl.on,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side a.sl.on span,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side a.sl.on i,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side a.sl.on svg{color:#06201d !important;-webkit-text-fill-color:#06201d !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .side a.sl .snum-badge{background:#ff6b81 !important;color:#2a0510 !important;-webkit-text-fill-color:#2a0510 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] header:not(.ptop) nav .dd-b.on *,
html:not(#dm1):not(#dm2)[data-theme="dark"] header:not(.ptop) nav a.on *{color:#0b1220 !important;-webkit-text-fill-color:#0b1220 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] html.dm-no-trans *,
html.dm-no-trans *{transition:none !important;animation-duration:0s !important}

/* ---------- text drawn by CSS pseudo-elements ---------- */
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .ptop .prole::before,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.pbody .ptop .prole:before,
html:not(#dm1):not(#dm2)[data-theme="dark"] body.admin-panel .ptop .prole:before{color:#ffd978 !important;-webkit-text-fill-color:#ffd978 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] .course-details summary:after{background:#1f3358 !important;color:#f2cf6b !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] .course-details[open] summary:after{background:#2a4271 !important}
/* dark-mode toggle button (header, both site and panel) */
html:not(#dm1):not(#dm2)[data-theme="dark"] body header .theme-toggle{background:#142038 !important;color:#f2cf6b !important;border-color:#4a6291 !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body header .theme-toggle svg{color:#f2cf6b !important;stroke:#f2cf6b !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body header .theme-toggle .tt-sun{display:block !important}
html:not(#dm1):not(#dm2)[data-theme="dark"] body header .theme-toggle .tt-moon{display:none !important}

html:not(#dm1):not(#dm2):not(#dm3)[data-theme="dark"] svg [data-dm-sk="l"]{stroke:#f4f7fc !important}
html:not(#dm1):not(#dm2):not(#dm3)[data-theme="dark"] svg [data-dm-sk="d"]{stroke:#0b1220 !important}
html:not(#dm1):not(#dm2):not(#dm3)[data-theme="dark"] svg [data-dm-fl="l"]{fill:#f4f7fc !important}
html:not(#dm1):not(#dm2):not(#dm3)[data-theme="dark"] svg [data-dm-fl="d"]{fill:#0b1220 !important}

/* =====================================================================
   v98 READABILITY FIXES (found by automated contrast audit in both themes)
   ===================================================================== */
/* Home: "Send an enquiry" block kept a light background in dark mode -> white text was invisible */
html:not(#dm1):not(#dm2):not(#dm3)[data-theme="dark"] .home-enquiry{background:linear-gradient(135deg,#0f1829,#142038) !important;border-color:#31456a !important}
html:not(#dm1):not(#dm2):not(#dm3)[data-theme="dark"] .home-enquiry .enquiry-intro h2{color:#f4f7fc !important}
html:not(#dm1):not(#dm2):not(#dm3)[data-theme="dark"] .home-enquiry .enquiry-intro>p,
html:not(#dm1):not(#dm2):not(#dm3)[data-theme="dark"] .home-enquiry .enquiry-points span{color:#d5deec !important}
html:not(#dm1):not(#dm2):not(#dm3)[data-theme="dark"] .home-enquiry .section-kicker{color:#f2cf6b !important}
/* Admin charts: donut centre was white with near-white text in dark mode */
html:not(#dm1):not(#dm2):not(#dm3)[data-theme="dark"] .donut::before{background:#142038 !important;box-shadow:inset 0 2px 10px rgba(0,0,0,.35) !important}
html:not(#dm1):not(#dm2):not(#dm3)[data-theme="dark"] .donut b{color:#f4f7fc !important}
html:not(#dm1):not(#dm2):not(#dm3)[data-theme="dark"] .donut small{color:#cbd5e1 !important}
/* Credential codes */
html:not(#dm1):not(#dm2):not(#dm3)[data-theme="dark"] .dcred-row code{color:#e8f0ff !important}

/* ---------- Light mode: small low-contrast texts ---------- */
html:not([data-theme="dark"]) .section-kicker,html:not([data-theme="dark"]) .tag{color:#8a5a00}
html:not([data-theme="dark"]) #login-forgot-link{color:#7a5200 !important}
html:not([data-theme="dark"]) .floating-note small{color:#475569}
html:not([data-theme="dark"]) .pitem-arrow{color:#0f172a}
html:not([data-theme="dark"]) .btn.alt svg{color:currentColor;stroke:currentColor}
html:not([data-theme="dark"]) body.pbody .ptop .prole{color:#0a6b5c !important}

/* v99: ID & Password table banner — keep text white in light mode (dark mode untouched) */
html:not([data-theme="dark"]) body .cred-hero,
html:not([data-theme="dark"]) body .cred-hero *{-webkit-text-fill-color:currentColor}
html:not([data-theme="dark"]) body .cred-hero{color:#fff !important}
html:not([data-theme="dark"]) body .cred-hero h1{color:#fff !important}
html:not([data-theme="dark"]) body .cred-hero p{color:#e8f0ff !important}
html:not([data-theme="dark"]) body .cred-hero .cred-kicker{color:#fde047 !important}
html:not([data-theme="dark"]) body .cred-hero .cstat span{color:#fde68a !important}
html:not([data-theme="dark"]) body .cred-hero .cstat strong{color:#fff !important}
html:not([data-theme="dark"]) body .cred-tabs .ctab.on{color:#fff !important;background:#0d2b6b !important}

/* ==========================================================================
   STG v142 — TRANSPARENT BACKGROUND FOR FOOTER OPTIONS IN DARK MODE
   ========================================================================== */
html:not(#dm1):not(#dm2)[data-theme="dark"] footer .flist,
html:not(#dm1):not(#dm2)[data-theme="dark"] footer .flist li,
html:not(#dm1):not(#dm2)[data-theme="dark"] footer .flist li > a,
html:not(#dm1):not(#dm2)[data-theme="dark"] footer .flist li.faddr,
html:not(#dm1):not(#dm2)[data-theme="dark"] footer .fcol {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

html:not(#dm1):not(#dm2)[data-theme="dark"] footer .flist li > a:hover,
html:not(#dm1):not(#dm2)[data-theme="dark"] footer .flist li > a:focus-visible {
  background: rgba(255, 255, 255, 0.06) !important;
  background-color: rgba(255, 255, 255, 0.06) !important;
}
