/* Clinic colour themes (Clinic settings → Look & feel). Soft, light themes that are easy on the eyes all day.
   The theme is a class on <html>: theme-sage, theme-ocean, theme-lavender, theme-peach. "classic" = the original
   HEJJE dark-green look, which needs no rules here. All button/text colours meet WCAG AA contrast (4.5:1). */

html.theme-sage     { --t-bg:#f4f6f1; --t-surface:#ffffff; --t-head1:#e3ede4; --t-head2:#f2f6ef; --t-head-ink:#2c5040;
                      --t-primary:#4a7861; --t-primary-h:#3d6752; --t-deep:#2c5040; --t-accent:#c9a96a; --t-soft:#e6efe8;
                      --t-line:#dde6df; --t-ink:#2c3a33; --t-muted:#66756d; --t-shadow:rgba(44,80,64,.08); }
html.theme-ocean    { --t-bg:#f1f7f8; --t-surface:#ffffff; --t-head1:#d9eef2; --t-head2:#eef7f8; --t-head-ink:#1d5562;
                      --t-primary:#2c7686; --t-primary-h:#236473; --t-deep:#1d5562; --t-accent:#f0b27a; --t-soft:#e0f0f3;
                      --t-line:#d5e6ea; --t-ink:#223a42; --t-muted:#5a727a; --t-shadow:rgba(29,85,98,.08); }
html.theme-lavender { --t-bg:#f6f4fa; --t-surface:#ffffff; --t-head1:#e9e3f5; --t-head2:#f6f3fb; --t-head-ink:#463c6e;
                      --t-primary:#6a5a9c; --t-primary-h:#5a4b8a; --t-deep:#463c6e; --t-accent:#e3b3c6; --t-soft:#ede8f7;
                      --t-line:#e2ddec; --t-ink:#332f45; --t-muted:#6f6a84; --t-shadow:rgba(70,60,110,.08); }
html.theme-peach    { --t-bg:#fcf6f1; --t-surface:#ffffff; --t-head1:#fbe3d3; --t-head2:#fdf2ea; --t-head-ink:#83401f;
                      --t-primary:#ad5530; --t-primary-h:#964826; --t-deep:#83401f; --t-accent:#6fa58c; --t-soft:#fbeadf;
                      --t-line:#f0e0d4; --t-ink:#3f322b; --t-muted:#7a6a60; --t-shadow:rgba(131,64,31,.08); }

/* ---------- clinic pages (base.html) ---------- */
html[class*="theme-"]:not(.theme-classic) {
  --green:var(--t-primary); --green2:var(--t-primary); --cream:var(--t-bg); --ink:var(--t-ink); --muted:var(--t-muted); --line:var(--t-line);
}
html[class*="theme-"]:not(.theme-classic) body { background:var(--t-bg); color:var(--t-ink); }
html[class*="theme-"]:not(.theme-classic) body > header {
  background:linear-gradient(100deg,var(--t-head1) 0%,var(--t-head2) 70%); color:var(--t-head-ink);
  border-bottom:1px solid var(--t-line);
}
html[class*="theme-"]:not(.theme-classic) .brand img,
html[class*="theme-"]:not(.theme-classic) #site-name img { filter:drop-shadow(0 1px 1px rgba(0,0,0,.45)) drop-shadow(0 0 6px rgba(0,0,0,.08)); }
html[class*="theme-"]:not(.theme-classic) .brand,
html[class*="theme-"]:not(.theme-classic) .brand-text { color:var(--t-deep); }
html[class*="theme-"]:not(.theme-classic) .brand small,
html[class*="theme-"]:not(.theme-classic) .brand-text small { color:var(--t-muted); }
html[class*="theme-"]:not(.theme-classic) .brand small i { color:var(--t-primary); }
html[class*="theme-"]:not(.theme-classic) h1,
html[class*="theme-"]:not(.theme-classic) h2,
html[class*="theme-"]:not(.theme-classic) h3 { color:var(--t-deep); }
html[class*="theme-"]:not(.theme-classic) .card { background:var(--t-surface); border-color:var(--t-line); box-shadow:0 2px 10px var(--t-shadow); }
/* buttons use var(--green), which each theme redefines above */
html[class*="theme-"]:not(.theme-classic) .badge,
html[class*="theme-"]:not(.theme-classic) .tag.green { background:var(--t-soft); color:var(--t-deep); }
html[class*="theme-"]:not(.theme-classic) .trial-bar a { color:var(--t-deep); }
html[class*="theme-"]:not(.theme-classic) footer { color:var(--t-muted); }
/* top menu */
html[class*="theme-"]:not(.theme-classic) .hj-mainnav { background:var(--t-surface); border-bottom-color:var(--t-line); }
html[class*="theme-"]:not(.theme-classic) .hj-menu > li > a { color:var(--t-deep); }
html[class*="theme-"]:not(.theme-classic) .hj-menu > li > a .caret { color:var(--t-muted); }
html[class*="theme-"]:not(.theme-classic) .hj-menu > li:hover > a,
html[class*="theme-"]:not(.theme-classic) .hj-menu > li:focus-within > a { background:var(--t-soft); }
html[class*="theme-"]:not(.theme-classic) .hj-menu > li.active > a { border-bottom-color:var(--t-accent); color:var(--t-deep); }
html[class*="theme-"]:not(.theme-classic) .hj-sub { border-color:var(--t-line); box-shadow:0 10px 24px var(--t-shadow); }
html[class*="theme-"]:not(.theme-classic) .hj-sub a:hover { background:var(--t-soft); color:var(--t-deep); }
html[class*="theme-"]:not(.theme-classic) .hj-sub a.active { color:var(--t-deep); background:var(--t-soft); box-shadow:inset 3px 0 0 var(--t-accent); }
/* profile button & menu */
html[class*="theme-"]:not(.theme-classic) .hj-avatar { background:var(--t-primary); color:#fff; }
html[class*="theme-"]:not(.theme-classic) .hj-avatar-sm { border-color:var(--t-surface)!important; box-shadow:0 0 0 2px var(--t-primary); }
html[class*="theme-"]:not(.theme-classic) .hj-avatar-lg { border-color:var(--t-primary); }
html[class*="theme-"]:not(.theme-classic) .hj-cam { background:var(--t-primary); }
html[class*="theme-"]:not(.theme-classic) .hj-who { color:var(--t-deep); }
html[class*="theme-"]:not(.theme-classic) .hj-pbtn { background:var(--t-primary)!important; border-color:var(--t-primary)!important; }
html[class*="theme-"]:not(.theme-classic) .hj-pbtn:hover { background:var(--t-primary-h)!important; }
html[class*="theme-"]:not(.theme-classic) .hj-pbtn-outline { background:#fff!important; color:var(--t-deep)!important; }
html[class*="theme-"]:not(.theme-classic) .hj-pbtn-outline:hover { background:var(--t-soft)!important; }
/* banners and buttons with built-in green */
html[class*="theme-"]:not(.theme-classic) .hc-custom { background:linear-gradient(120deg,var(--t-head1),var(--t-head2)); color:var(--t-ink); border:1px solid var(--t-line); }
html[class*="theme-"]:not(.theme-classic) .hc-custom h2 { color:var(--t-deep); }
html[class*="theme-"]:not(.theme-classic) .hc-custom a { color:var(--t-primary); }
html[class*="theme-"]:not(.theme-classic) .hc-side a.on { background:var(--t-soft); box-shadow:inset 3px 0 0 var(--t-accent); }
html[class*="theme-"]:not(.theme-classic) .hc-steps li:before { background:var(--t-primary); }
html[class*="theme-"]:not(.theme-classic) .hj-train { background:var(--t-primary); }
html[class*="theme-"]:not(.theme-classic) .hj-train .p { background:#fff; color:var(--t-primary); }
html[class*="theme-"]:not(.theme-classic) .hj-train small { color:rgba(255,255,255,.85); }
html[class*="theme-"]:not(.theme-classic) .tabs a.on { background:var(--t-primary); border-color:var(--t-primary); }
/* inline colours written as the classic green in individual pages */
html[class*="theme-"]:not(.theme-classic) [style*="color:#173f35"],
html[class*="theme-"]:not(.theme-classic) [style*="color: #173f35"],
html[class*="theme-"]:not(.theme-classic) [style*="color:#245849"] { color:var(--t-deep)!important; }
html[class*="theme-"]:not(.theme-classic) [style*="background:#173f35"],
html[class*="theme-"]:not(.theme-classic) [style*="background: #173f35"],
html[class*="theme-"]:not(.theme-classic) [style*="background:#245849"],
html[class*="theme-"]:not(.theme-classic) [style*="background:var(--green)"] { background:var(--t-primary)!important; }
html[class*="theme-"]:not(.theme-classic) [style*="border-left:4px solid #245849"] { border-left-color:var(--t-primary)!important; }
html[class*="theme-"]:not(.theme-classic) .msg-popup-icon { background:var(--t-soft); color:var(--t-deep); }

/* ---------- Management pages (Django admin) ---------- */
html[class*="theme-"]:not(.theme-classic) {
  --primary:var(--t-primary); --secondary:var(--t-deep); --header-bg:var(--t-head1); --header-color:var(--t-deep);
  --header-branding-color:var(--t-deep); --header-link-color:var(--t-deep); --breadcrumbs-bg:var(--t-soft); --breadcrumbs-fg:var(--t-deep);
  --breadcrumbs-link-fg:var(--t-primary); --link-fg:var(--t-primary); --link-hover-color:var(--t-deep); --link-selected-fg:var(--t-deep);
  --button-bg:var(--t-primary); --button-hover-bg:var(--t-primary-h); --default-button-bg:var(--t-deep); --default-button-hover-bg:var(--t-primary-h);
  --selected-row:var(--t-soft); --body-quiet-color:var(--t-muted);
}
html[class*="theme-"]:not(.theme-classic) #header { background:linear-gradient(100deg,var(--t-head1) 0%,var(--t-head2) 70%); color:var(--t-deep); border-bottom:1px solid var(--t-line); }
html[class*="theme-"]:not(.theme-classic) #header a, html[class*="theme-"]:not(.theme-classic) #site-name .hejje-admin-title { color:var(--t-deep); }
html[class*="theme-"]:not(.theme-classic) div.breadcrumbs { background:var(--t-soft); color:var(--t-deep); }
html[class*="theme-"]:not(.theme-classic) div.breadcrumbs a { color:var(--t-primary); }
html[class*="theme-"]:not(.theme-classic) #content h1 { color:var(--t-deep); }
html[class*="theme-"]:not(.theme-classic) .module h2, html[class*="theme-"]:not(.theme-classic) .module caption,
html[class*="theme-"]:not(.theme-classic) .inline-group h2, html[class*="theme-"]:not(.theme-classic) #changelist-filter h2 { background:var(--t-primary); color:#fff; }
html[class*="theme-"]:not(.theme-classic) .hj-topnav a { color:var(--t-deep); }
html[class*="theme-"]:not(.theme-classic) .hj-topnav a.active { background:var(--t-primary); color:#fff; }
html[class*="theme-"]:not(.theme-classic) .object-tools a { background:var(--t-primary); }
html[class*="theme-"]:not(.theme-classic) .submit-row input, html[class*="theme-"]:not(.theme-classic) .button { background:var(--t-primary); }
html[class*="theme-"]:not(.theme-classic) .submit-row input.default { background:var(--t-deep); }
html[class*="theme-"]:not(.theme-classic) #site-name .hejje-admin-title { color:var(--t-deep)!important; }
html[class*="theme-"]:not(.theme-classic) #site-name .hejje-admin-title + .hejje-admin-title { color:var(--t-muted)!important; }
html[class*="theme-"]:not(.theme-classic) .hj-tile { border-color:var(--t-line); }
html[class*="theme-"]:not(.theme-classic) .hj-tile b { color:var(--t-deep); }
html[class*="theme-"]:not(.theme-classic) .hj-pbar span { background:var(--t-primary); }
