/* Suite-wide theme adapters: preserve native application structure.
   Style 1: original Admin colours; 2: Main mint/teal; 3: Engineering navy/blue.
   This file is loaded AFTER existing application CSS and is inert until the
   authorised Admin Portal writes one of the three selected style values.
   Personal light/dark preference remains independent of the suite style. */
:root[data-pb-suite-style="1"] {
  --pb-suite-bg:#0b1422;--pb-suite-panel:#172437;--pb-suite-soft:#20344b;
  --pb-suite-header:#142638;--pb-suite-header-text:#edf5ff;
  --pb-suite-text:#edf5ff;--pb-suite-muted:#a8bdd2;
  --pb-suite-line:#314962;--pb-suite-accent:#84c1fb;
  --pb-suite-sidebar:#101e2f;--pb-suite-radius:13px;
  color-scheme:dark;
}
:root[data-pb-suite-style="2"] {
  --pb-suite-bg:#f5f8f9;--pb-suite-panel:#fff;--pb-suite-soft:#edf5f5;
  --pb-suite-header:#fff;--pb-suite-header-text:#14262e;
  --pb-suite-text:#14262e;--pb-suite-muted:#6f8188;
  --pb-suite-line:#dce8e8;--pb-suite-accent:#078b76;
  --pb-suite-sidebar:#173037;--pb-suite-radius:11px;
  color-scheme:light;
}
:root[data-pb-suite-style="3"] {
  --pb-suite-bg:#eff3f8;--pb-suite-panel:#fff;--pb-suite-soft:#f2f6fb;
  --pb-suite-header:#132a46;--pb-suite-header-text:#f4f8fd;
  --pb-suite-text:#243247;--pb-suite-muted:#647890;
  --pb-suite-line:#dce3ed;--pb-suite-accent:#0b9d84;
  --pb-suite-sidebar:#1c344e;--pb-suite-radius:7px;
  color-scheme:light;
}
/* Keep all three identities usable when the application's own mode is dark. */
:root[data-pb-suite-style="2"][data-theme="dark"],
:root[data-pb-suite-style="3"][data-theme="dark"] {
  --pb-suite-bg:#101a26;--pb-suite-panel:#182738;--pb-suite-soft:#26384b;
  --pb-suite-header:#0b1725;--pb-suite-header-text:#edf5ff;
  --pb-suite-text:#eff5fb;--pb-suite-muted:#b1c3d4;
  --pb-suite-line:#394e60;--pb-suite-sidebar:#112235;
  color-scheme:dark;
}
:root[data-pb-suite-style="1"][data-theme="light"] {
  --pb-suite-bg:#edf2f8;--pb-suite-panel:#fff;--pb-suite-soft:#e6edf6;
  --pb-suite-header:#fff;--pb-suite-header-text:#192f47;
  --pb-suite-text:#192f47;--pb-suite-muted:#587087;
  --pb-suite-line:#d4e0eb;--pb-suite-accent:#1267b8;
  --pb-suite-sidebar:#233b56;color-scheme:light;
}
/* Admin desktop: map theme tokens into the ORIGINAL DSM-like window system. */
html[data-pb-suite-style] .desktop-shell {
  --bg:var(--pb-suite-bg);--surface:var(--pb-suite-panel);
  --surface-strong:var(--pb-suite-soft);--panel:var(--pb-suite-soft);
  --border:var(--pb-suite-line);--text:var(--pb-suite-text);
  --muted:var(--pb-suite-muted);--accent:var(--pb-suite-accent);
}
html[data-pb-suite-style] .desktop {
  background:var(--pb-suite-bg);
}
html[data-pb-suite-style] .desktop-window,
html[data-pb-suite-style] .desktop-widget,
html[data-pb-suite-style] .desktop-attention {
  border-radius:var(--pb-suite-radius);
}
html[data-pb-suite-style] .system-bar {
  background:var(--pb-suite-header);color:var(--pb-suite-header-text);
}
html[data-pb-suite-style] .system-bar .wordmark-secondary,
html[data-pb-suite-style] .system-bar .desktop-version{color:var(--pb-suite-header-text)}
/* Main app: retain the explorer, registers, maps and action placement. */
html[data-pb-suite-style] body:has(.pb-explorer) {
  --ink:var(--pb-suite-text);--dark:var(--pb-suite-sidebar);
  --dark2:var(--pb-suite-sidebar);--mint:var(--pb-suite-accent);
  --teal:var(--pb-suite-accent);--muted:var(--pb-suite-muted);
  --line:var(--pb-suite-line);--bg:var(--pb-suite-bg);
  --white:var(--pb-suite-panel);
}
html[data-pb-suite-style] .pb-explorer .topbar,
html[data-pb-suite-style] .pb-explorer .sidebar{border-color:var(--pb-suite-line)}
html[data-pb-suite-style] .pb-explorer .topbar{background:var(--pb-suite-header);color:var(--pb-suite-header-text)}
html[data-pb-suite-style] .pb-explorer .topbar-title{color:var(--pb-suite-header-text)}
html[data-pb-suite-style] .pb-explorer .metric,
html[data-pb-suite-style] .pb-explorer .project-list,
html[data-pb-suite-style] .pb-explorer .editor-card,
html[data-pb-suite-style] .pb-explorer .panel{
  background:var(--pb-suite-panel);border-color:var(--pb-suite-line);
  color:var(--pb-suite-text);border-radius:var(--pb-suite-radius);
}
html[data-pb-suite-style] .pb-explorer .pb-module-tab{
  background:var(--pb-suite-soft);border-color:var(--pb-suite-line);
  color:var(--pb-suite-text);
}
html[data-pb-suite-style] .pb-explorer .pb-module-tab.active,
html[data-pb-suite-style] .pb-explorer .btn.primary{background:var(--pb-suite-accent);color:#fff}
/* Engineering shell, and the same-origin embedded ribbon/canvas in gateway. */
html[data-pb-suite-style] body:has(.pb-engineering-topbar){background:var(--pb-suite-bg);color:var(--pb-suite-text)}
html[data-pb-suite-style] .pb-engineering-topbar{
  background:var(--pb-suite-header);color:var(--pb-suite-header-text);
  border-color:var(--pb-suite-line);
}
html[data-pb-suite-style] .pb-engineering-title{color:var(--pb-suite-header-text)}
html[data-pb-suite-style] .pb-engineering-app{background:var(--pb-suite-bg)}
/* Adopt the same visual language for new holding page cards. */
html[data-pb-suite-style] body.pb-suite-holding{background:var(--pb-suite-bg);color:var(--pb-suite-text)}
html[data-pb-suite-style] body.pb-suite-holding .pb-suite-holding-header{
 background:var(--pb-suite-header);color:var(--pb-suite-header-text);border-color:var(--pb-suite-line)}
html[data-pb-suite-style] body.pb-suite-holding article{
 background:var(--pb-suite-panel);color:var(--pb-suite-text);border-color:var(--pb-suite-line);
 border-radius:var(--pb-suite-radius)}
html[data-pb-suite-style] body.pb-suite-holding p{color:var(--pb-suite-muted)}

/* Main document/register surfaces need complete readable contrast when an
   administrator chooses Admin's dark style. Do not recolour map/CAD geometry. */
html[data-pb-suite-style] .pb-explorer .pb-workspace,
html[data-pb-suite-style] .pb-explorer .pb-register-search,
html[data-pb-suite-style] .pb-explorer .pb-actionbar,
html[data-pb-suite-style] .pb-explorer .pb-location,
html[data-pb-suite-style] .pb-explorer .pb-tab-row,
html[data-pb-suite-style] .pb-explorer .pb-table-scroll,
html[data-pb-suite-style] .pb-explorer .pb-grid td,
html[data-pb-suite-style] .pb-explorer .pb-grid tbody tr {
 color:var(--pb-suite-text);border-color:var(--pb-suite-line);
}
html[data-pb-suite-style] .pb-explorer .pb-workspace,
html[data-pb-suite-style] .pb-explorer .pb-table-scroll{background:var(--pb-suite-panel)}
html[data-pb-suite-style] .pb-explorer .pb-location,
html[data-pb-suite-style] .pb-explorer .pb-register-search,
html[data-pb-suite-style] .pb-explorer .pb-actionbar,
html[data-pb-suite-style] .pb-explorer .pb-tab-row{background:var(--pb-suite-soft)}
html[data-pb-suite-style] .pb-explorer .pb-grid tbody tr:nth-child(odd){background:color-mix(in srgb,var(--pb-suite-panel) 87%,var(--pb-suite-soft))}
html[data-pb-suite-style] .pb-explorer .pb-grid tbody tr:nth-child(even){background:var(--pb-suite-panel)}
html[data-pb-suite-style] .pb-explorer .pb-grid tbody tr:hover{background:var(--pb-suite-soft)}
html[data-pb-suite-style] .pb-explorer .pb-grid td{background:transparent}
html[data-pb-suite-style] .pb-explorer .pb-grid thead{background:var(--pb-suite-sidebar)}
html[data-pb-suite-style] .pb-explorer .pb-location a,
html[data-pb-suite-style] .pb-explorer .pb-location strong,
html[data-pb-suite-style] .pb-explorer .pb-grid-name,
html[data-pb-suite-style] .pb-explorer .pb-register-search label,
html[data-pb-suite-style] .pb-explorer .pb-view-caption,
html[data-pb-suite-style] .pb-explorer .pb-tabs a,
html[data-pb-suite-style] .pb-explorer .pb-workspace-head h1,
html[data-pb-suite-style] .pb-explorer .pb-workspace-head p,
html[data-pb-suite-style] .pb-explorer .pb-overline,
html[data-pb-suite-style] .pb-explorer .pb-action{color:var(--pb-suite-text)}
html[data-pb-suite-style] .pb-explorer .pb-action:hover,
html[data-pb-suite-style] .pb-explorer .pb-tabs a.active{background:var(--pb-suite-soft);color:var(--pb-suite-accent)}
html[data-pb-suite-style="1"]:not([data-theme="light"]) .pb-explorer .sidebar{
 background:var(--pb-suite-sidebar);color:var(--pb-suite-text);border-color:var(--pb-suite-line)
}
html[data-pb-suite-style="1"]:not([data-theme="light"]) .pb-explorer .side-label,
html[data-pb-suite-style="1"]:not([data-theme="light"]) .pb-explorer .tree-link,
html[data-pb-suite-style="1"]:not([data-theme="light"]) .pb-explorer .tree-folder>summary,
html[data-pb-suite-style="1"]:not([data-theme="light"]) .pb-explorer .workspace-dev>summary,
html[data-pb-suite-style="1"]:not([data-theme="light"]) .pb-explorer .pb-plots-summary{
 color:var(--pb-suite-text)
}
html[data-pb-suite-style="1"]:not([data-theme="light"]) .pb-explorer .workspace-org>summary,
html[data-pb-suite-style="1"]:not([data-theme="light"]) .pb-explorer .tree-heading{
 background:var(--pb-suite-soft);color:var(--pb-suite-text)
}
html[data-pb-suite-style="1"]:not([data-theme="light"]) .pb-explorer .tree-link:hover,
html[data-pb-suite-style="1"]:not([data-theme="light"]) .pb-explorer .tree-folder>summary:hover,
html[data-pb-suite-style="1"]:not([data-theme="light"]) .pb-explorer .tree-link.is-current,
html[data-pb-suite-style="1"]:not([data-theme="light"]) .pb-explorer .tree-folder>summary.is-current{
 background:var(--pb-suite-soft);color:var(--pb-suite-text)
}
html[data-pb-suite-style="1"]:not([data-theme="light"]) .pb-explorer .pb-workspace .pb-listing-title strong,
html[data-pb-suite-style="1"]:not([data-theme="light"]) .pb-explorer .pb-workspace a{color:var(--pb-suite-accent)}
