/* bt-client-dark: readable text, links and panels in the client area's dark mode.
   The portal's own dark block only re-colours the page, cards, tables and forms. Its brand colour (--primary)
   stays dark slate, so everything drawn with it (links, outline buttons, headings, "View all", back links)
   and everything with a hard-coded light-mode colour in an inline style disappears on the dark cards. */

/* ---- links and text that use the dark brand colour ---- */
:root[data-theme="dark"] a:not([class]) { color: #e2e8f0; }
:root[data-theme="dark"] .link,
:root[data-theme="dark"] .pn-table a:not(.btn),
:root[data-theme="dark"] .pn-back,
:root[data-theme="dark"] .pn-aff-val,
:root[data-theme="dark"] .svc-tool,
:root[data-theme="dark"] .pn-footer a,
:root[data-theme="dark"] .pn-msg.staff .pn-msg-author,
:root[data-theme="dark"] body .pn-main .btn-outline,
:root[data-theme="dark"] [style*="color:var(--primary)"],
:root[data-theme="dark"] [style*="color: var(--primary)"] { color: #e2e8f0 !important; }
:root[data-theme="dark"] .svc-tool:hover,
:root[data-theme="dark"] .gw-tab:hover { color: #fff !important; }

/* ---- headings, labels and inline greys written for a light page ---- */
:root[data-theme="dark"] .contentarea h1,
:root[data-theme="dark"] .page-header h1,
:root[data-theme="dark"] .pn-main h1 { color: #f1f5f9 !important; }
:root[data-theme="dark"] .form-label,
:root[data-theme="dark"] legend.form-label { color: #cbd5e1 !important; }
:root[data-theme="dark"] [style*="color:#555"],
:root[data-theme="dark"] [style*="color: #555"],
:root[data-theme="dark"] [style*="color:#333"],
:root[data-theme="dark"] [style*="color: #333"],
:root[data-theme="dark"] [style*="color:#666"],
:root[data-theme="dark"] [style*="color: #666"] { color: #cbd5e1 !important; }
:root[data-theme="dark"] .req,
:root[data-theme="dark"] [style*="color:#ef4444"],
:root[data-theme="dark"] [style*="color:#c43c35"] { color: #f87171 !important; }
:root[data-theme="dark"] .text-muted { color: #94a3b8; }

/* ---- the domain pages' hard-coded blue ---- */
:root[data-theme="dark"] [style*="color:#1a4d80"],
:root[data-theme="dark"] [style*="color: #1a4d80"] { color: #93c5fd !important; }
:root[data-theme="dark"] [style*="background:#eff6ff"] { background: rgba(59, 130, 246, .16) !important; color: #93c5fd !important; }
:root[data-theme="dark"] a[style*="background:#06d6a0"] { color: #04261d !important; }

/* ---- chips drawn with the light brand tint ---- */
:root[data-theme="dark"] [style*="var(--primary-light"] { background: rgba(148, 163, 184, .16) !important; color: #cbd5e1 !important; }
:root[data-theme="dark"] .sv-code { background: rgba(148, 163, 184, .16); color: #e2e8f0; }

/* ---- panels and buttons that stayed white or dark-on-dark ---- */
:root[data-theme="dark"] .card { background: #1e293b !important; border-color: #334155 !important; color: #e2e8f0; }
:root[data-theme="dark"] tr[style*="#fffbeb"] { background: rgba(245, 158, 11, .12) !important; }
:root[data-theme="dark"] body .btn-default,
:root[data-theme="dark"] body .btn-secondary { background: #1e293b !important; color: #e2e8f0 !important; border: 1px solid #475569 !important; }
:root[data-theme="dark"] [class~="inline-flex"][class~="px-4"] { background: #1e293b !important; color: #e2e8f0 !important; border-color: #334155 !important; }
:root[data-theme="dark"] .sv-b-solid { background: #f1f5f9 !important; color: #1e293b !important; }
:root[data-theme="dark"] body .btn-accent { color: #022c22 !important; }
:root[data-theme="dark"] body .btn-success { background: #2f855a !important; color: #fff !important; }

/* ---- status chips ---- */
:root[data-theme="dark"] .em-badge.on,
:root[data-theme="dark"] body .sv-toggle { color: #34d399 !important; }
:root[data-theme="dark"] body .db-btn { background: #0369a1 !important; }

/* ---- icons drawn with a presentation attribute, and the primary buttons ---- */
:root[data-theme="dark"] svg[stroke="var(--primary)"] { stroke: #e2e8f0; }
:root[data-theme="dark"] svg[fill="var(--primary)"] { fill: #e2e8f0; }
:root[data-theme="dark"] body .pn-main .btn-primary { background: #f1f5f9 !important; color: #0f172a !important; }
:root[data-theme="dark"] body .pn-main .btn-primary:hover { background: #fff !important; }
