/* ED Nexus 4.7 neutral theme: brand colour is reserved for interaction. */
[data-theme="dark"]{
  --bg:#0B0F14;
  --surface:#131922;
  --surface2:#18202B;
  --surface3:#202A37;
  --border:#2A3543;
  --border2:#3A4758;
  --sb:#0E141C;
  --sb2:#161E28;
  --sb-text:#AAB4C2;
  --sb-active:#F4F7FA;
  --sb-hover:rgba(146,148,255,.08);
  --sb-sel:rgba(146,148,255,.14);
  --sb-line:#27313E;
  --text:#F2F5F8;
  --text2:#CBD3DD;
  --text3:#AAB4C2;
  --text4:#8793A3;
  --primary:#6F71E8;
  --primary-h:#8385F2;
  --accent:#9294FF;
  --accent-h:#A5A7FF;
  --accent-l:rgba(146,148,255,.10);
  --accent-l2:rgba(146,148,255,.18);
  --input-bg:#101720;
  --tree-dash:#2A3543;
  --purple:#A7A9FF;
  --purple-l:rgba(167,169,255,.10);
  --shadow-sm:0 2px 8px rgba(0,0,0,.24);
  --shadow:0 8px 24px rgba(0,0,0,.28);
  --shadow-md:0 14px 34px rgba(0,0,0,.32);
  --shadow-lg:0 28px 70px rgba(0,0,0,.42);
  --glow-accent:none;
}

[data-theme="light"]{
  --bg:#E5E9EF;
  --surface:#F3F5F7;
  --surface2:#EAEDF1;
  --surface3:#DEE3E9;
  --border:#C9D0D9;
  --border2:#AAB4C1;
  --sb:#EDF0F4;
  --sb2:#E4E8ED;
  --sb-text:#4B5563;
  --sb-active:#111827;
  --sb-hover:rgba(81,83,199,.06);
  --sb-sel:rgba(81,83,199,.10);
  --sb-line:#C9D0D9;
  --text:#111827;
  --text2:#344054;
  --text3:#4B5563;
  --text4:#667085;
  --primary:#5153C7;
  --primary-h:#4143B2;
  --accent:#5557C8;
  --accent-h:#4446B5;
  --accent-l:rgba(81,83,199,.08);
  --accent-l2:rgba(81,83,199,.14);
  --input-bg:#F7F8F9;
  --tree-dash:#C9D0D9;
  --purple:#6941C6;
  --purple-l:rgba(105,65,198,.08);
  --shadow-sm:0 2px 8px rgba(16,24,40,.06);
  --shadow:0 8px 24px rgba(16,24,40,.08);
  --shadow-md:0 14px 34px rgba(16,24,40,.10);
  --shadow-lg:0 28px 70px rgba(16,24,40,.16);
  --glow-accent:none;
}

/* Soft-light surfaces avoid large areas of pure white while retaining AA contrast. */
[data-theme="light"] .stat-card.gb,
[data-theme="light"] .card,
[data-theme="light"] .admin-stat-card,
[data-theme="light"] .client-card,
[data-theme="light"] .item-card,
[data-theme="light"] .folder-card{background-color:var(--surface)!important;background-image:none!important}
[data-theme="light"] .modal-bg{background:rgba(48,58,72,.28)!important}

/* Neutral canvases; no decorative violet wash behind the application. */
[data-theme] body::before,[data-theme] body::after{display:none!important}
.sidebar,.topbar,.modal,.dropdown{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
.topbar{background:var(--surface)!important;border-bottom-color:var(--border)!important}
.sidebar{background:var(--sb)!important;border-right-color:var(--sb-line)!important}
.content{background:var(--bg)!important}

/* Brand colour is used for explicit interaction, never as a generic surface. */
.btn-primary,.tb-btn.primary,.premium-client-open{background:var(--primary)!important;background-image:none!important;color:#fff!important;border-color:var(--primary)!important}
.btn-primary:hover,.tb-btn.primary:hover,.premium-client-open:hover{background:var(--primary-h)!important;border-color:var(--primary-h)!important}
.nav-item.active{background:var(--sb-sel)!important;color:var(--sb-active)!important}
.nav-item:not(.active),.sb-nav-group>summary{color:var(--sb-text)!important}
.sb-nav-group[open]>summary{color:var(--sb-active)!important}

/* Inputs and floating surfaces keep strong text/border separation in both themes. */
.form-input,.ticket-filter select,input,select,textarea{background-color:var(--input-bg)!important;color:var(--text)!important;border-color:var(--border2)!important}
.form-input::placeholder,input::placeholder,textarea::placeholder{color:var(--text4)!important;opacity:1}
select option,.ticket-filter select option{background:var(--surface)!important;color:var(--text)!important}
.form-input:focus,.ticket-filter select:focus,input:focus,select:focus,textarea:focus{border-color:var(--accent)!important;box-shadow:0 0 0 3px var(--accent-l2)!important;outline:0}
.badge.b-gray{background:var(--surface3)!important;color:var(--text2)!important;border-color:var(--border)!important}
.tbl-wrap,.modal,.dropdown,.set-section,.asset-group{background:var(--surface)!important;border-color:var(--border)!important}

/* State colours remain semantic. */
.b-green,.wpb-status-ok{color:var(--green)!important}.b-yellow{color:var(--yellow)!important}.b-red{color:var(--red)!important}
h1,h2,h3,.card-title{text-wrap:balance}.page-header p,.ops-panel-head p,.card p{text-wrap:pretty}
.stat-num,.ops-kpi strong,.ops-snapshot-item strong,.client-card-stat-pill strong{font-variant-numeric:tabular-nums}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}
}

@media(prefers-contrast:more){
  [data-theme="dark"]{--border:#465568;--border2:#617086;--text3:#C2CAD4;--text4:#AAB4C2}
  [data-theme="light"]{--border:#B8C0CB;--border2:#7D8898;--text3:#344054;--text4:#475467}
}
