/* Shared visual system. One neutral application shell; accents change emphasis,
   never the meaning of status colors or the structure of a screen. The body is
   the sole token owner so shell-mounted and standalone React surfaces cannot
   drift into different themes. */
/* These hosts belong to the router. App display rules must never expose an
   inactive surface, including while a role stylesheet is being enabled. */
#legacyTopbar[hidden], #legacyAppShell[hidden], #signedOutHero[hidden],
#pageSupervisor[hidden], #pageClientPortal[hidden], #pageClientPending[hidden],
#pageMyTasks[hidden], #pageSettings[hidden], #roleBootStatus[hidden] { display: none !important; }
.roleBootStatus:not([hidden]) { display: block; margin: 24px; padding: 20px; border-radius: 12px; background: #fff; color: #484d52; font: 15px system-ui, sans-serif; }

body,
body[data-accent="graphite"] {
  color-scheme: light;
  --bg: #f3f5f6;
  --card: #ffffff;
  --ink: #25272a;
  --inkSoft: #484d52;
  --muted: #62676d;
  --faint: #686e74;
  --fainter: #686e74;
  --line: #e3e6e8;
  --lineSoft: #f0f2f3;
  --lineInner: #eceff1;
  --ghostLine: #cfd4d7;
  --inputLine: #d7dbde;
  --primary: #363b43;
  --primaryDeep: #25272a;
  --primaryInk: #ffffff;
  --primarySoft: #eceef0;
  --avatarInk: #303235;
  --panel: #f8f9fa;
  --panelLine: #e1e4e6;
  --gridHead: #f7f8f9;
  --track: #e6e9eb;
  --green: #0f704d;
  --greenSoft: #e8f7ef;
  --gold: #ad7100;
  --goldInk: #805200;
  --goldSoft: #fff4d8;
  --danger: #b43f4c;
  --dangerSoft: #ffedf0;
  --neutralPill: #eef0f2;
  --arrow: #9ba2a8;
  --anchor: #f8f9fa;
  --anchorInk: #25272a;
  --anchorMuted: #62676d;
  --border: #e3e6e8;
  --text: #25272a;
  --warn: #ad7100;
  --warnSoft: #fff4d8;
  --neutral: #737980;
  --blue: #383a3d;
  --navy: #383a3d;
  --navy2: #25272a;
  --navy3: #eceef0;
  --serif: "Source Serif 4", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  /* The signed-out page is the lab's front door: graphite for everyone,
     independent of the accent a person chose in Settings (Talha, 2026-09-18).
     Defined on the bare body selector so no accent block overrides them. */
  --authPrimary: #363b43;
  --authPrimaryDeep: #25272a;
  --authPrimaryInk: #ffffff;
  --authPrimarySoft: #eceef0;
  /* Supervisor frame v1 (2026-09-21): the coloured top bar is a Settings
     choice (body[data-frame]); navy is the default. The three section hues
     colour the rail's icon tiles; state colours keep their meaning. */
  --frame: #1c2b3a;
  --frameInk: #eef2f6;
  --frameMuted: #a9b6c3;
  --frameField: rgba(255, 255, 255, 0.11);
  --frameLine: rgba(255, 255, 255, 0.14);
  --hueWork: #0f766e;
  --hueWorkSoft: #e3f3f0;
  --hueRecords: #2d64b8;
  --hueRecordsSoft: #e8effb;
  --hueBusiness: #a86a00;
  --hueBusinessSoft: #fdf1da;
  /* Technician hub v5 (2026-10-01): Certifications is the fourth section hue;
     the *On tints are the idle icon colours on a dark bar. */
  --hueCerts: #6b4fb6;
  --hueCertsSoft: #efeafb;
  --hueWorkOn: #7fd6cb;
  --hueRecordsOn: #a6c6f5;
  --hueBusinessOn: #f0c771;
  --hueCertsOn: #c9b5f2;
  --frameHover: rgba(255, 255, 255, 0.07);
}

body[data-frame="blue"] { --frame: #234a86; --frameMuted: #b7c7e2; }
body[data-frame="teal"] { --frame: #0f5f58; --frameMuted: #a7d3cd; }
body[data-frame="graphite"] { --frame: #2b3036; --frameMuted: #aab2bb; }

body[data-accent="teal"] {
  --primary: #16766d;
  --primaryDeep: #0f615a;
  --primaryInk: #ffffff;
  --primarySoft: #e5f4f0;
  --avatarInk: #125f58;
  --blue: #16766d;
  --navy: #16766d;
  --navy2: #0f615a;
  --navy3: #e5f4f0;
}

body[data-accent="sky"] {
  --primary: #356cca;
  --primaryDeep: #2859ad;
  --primaryInk: #ffffff;
  --primarySoft: #e8effc;
  --avatarInk: #2e5da9;
  --blue: #356cca;
  --navy: #356cca;
  --navy2: #2859ad;
  --navy3: #e8effc;
}

/* The application frame stays quiet and light under every accent. */
body[data-accent] .topbar {
  background: var(--card);
  border-bottom-color: var(--line);
  box-shadow: none;
}

body[data-accent] .topbarLogoName,
body[data-accent] .topbarRoleLabel,
body[data-accent] .hamburgerBtn {
  color: var(--ink);
}

body[data-accent] .topbarLogoSub,
body[data-accent] .profileRow {
  color: var(--muted);
}

body[data-accent] .topbarLogoMark { background: transparent; }
body[data-accent] .topbarPill { background: var(--primarySoft); color: var(--primaryDeep); }
body[data-accent] .topbarAvatar { background: var(--primarySoft); color: var(--avatarInk); }
body[data-accent] .profileDropdown {
  background: var(--card);
  border-color: var(--line);
  color: var(--ink);
}

body[data-accent].topNavMode .topbarNav button { color: var(--muted); }
body[data-accent].topNavMode .topbarNav button:hover {
  background: var(--lineSoft);
  color: var(--ink);
}
body[data-accent].topNavMode .topbarNav button.active {
  background: var(--primarySoft);
  color: var(--primaryDeep);
}

/* Technician hub v5 (2026-10-01): the technician's bar takes the frame
   colour the Supervisor already uses (body[data-frame], navy by default).
   Each section's icon carries its own hue; the active section sits on a
   solid tile; the logo sits on a white tile so its dark wordmark reads. The
   client portal's bar takes the same frame colour (below). */
body[data-accent].techNav .topbar {
  background: var(--frame);
  border-bottom-color: var(--frameLine);
  box-shadow: none;
}
body[data-accent].techNav .topbarLogoMark { background: #fff; }
body[data-accent].techNav .topbarLogoName,
body[data-accent].techNav .topbarRoleLabel { color: var(--frameInk); }
body[data-accent].techNav .topbarLogoSub { color: var(--frameMuted); }
body[data-accent].techNav .topbarAvatar { background: var(--frameField); color: var(--frameInk); }
body[data-accent].techNav .profileButton:hover { background: var(--frameHover); }
body[data-accent].techNav.topNavMode .topbarNav button { color: var(--frameMuted); }
body[data-accent].techNav.topNavMode .topbarNav button:hover { background: var(--frameHover); color: var(--frameInk); }
body[data-accent].techNav.topNavMode .topbarNav button.active { background: var(--frameField); color: var(--frameInk); }
body[data-accent].techNav .topbarNav .navIcon { background: transparent; }
body[data-accent].techNav #navMyTasks .navIcon { color: var(--hueWorkOn); }
body[data-accent].techNav #navSchedule .navIcon { color: var(--hueRecordsOn); }
body[data-accent].techNav #navCertifications .navIcon { color: var(--hueCertsOn); }
body[data-accent].techNav #navSupplies .navIcon { color: var(--hueBusinessOn); }
body[data-accent].techNav #navMyTasks.active .navIcon { background: var(--hueWork); color: #fff; }
body[data-accent].techNav #navSchedule.active .navIcon { background: var(--hueRecords); color: #fff; }
body[data-accent].techNav #navCertifications.active .navIcon { background: var(--hueCerts); color: #fff; }
body[data-accent].techNav #navSupplies.active .navIcon { background: var(--hueBusiness); color: #fff; }
/* On a phone the four sections are a white tab bar under the page (shell.css),
   so the idle icons take the full hues and the labels the neutral ink. */
@media (max-width: 720px) {
  body[data-accent].techNav.topNavMode .topbarNav button { color: var(--muted); }
  body[data-accent].techNav.topNavMode .topbarNav button:hover { background: var(--panel); color: var(--ink); }
  body[data-accent].techNav.topNavMode .topbarNav button.active { background: transparent; color: var(--ink); }
  body[data-accent].techNav #navMyTasks .navIcon { color: var(--hueWork); }
  body[data-accent].techNav #navSchedule .navIcon { color: var(--hueRecords); }
  body[data-accent].techNav #navCertifications .navIcon { color: var(--hueCerts); }
  body[data-accent].techNav #navSupplies .navIcon { color: var(--hueBusiness); }
  body[data-accent].techNav .topbarNav button.active .navIcon { color: #fff; }
}

/* Client portal v4 (2026-10-02): the client's bar takes the frame colour, so
   all three roles share one top bar. The portal places its "Contact the lab"
   control in this bar (ui/client-portal/src/topbar.jsx). */
body[data-accent].isClientPortalMounted { background: var(--bg); }
body[data-accent].isClientPortalMounted .topbar {
  background: var(--frame);
  border-bottom-color: var(--frameLine);
  box-shadow: none;
}
body[data-accent].isClientPortalMounted .topbarLogoMark { background: #fff; }
body[data-accent].isClientPortalMounted .topbarLogoName,
body[data-accent].isClientPortalMounted .topbarRoleLabel { color: var(--frameInk); }
body[data-accent].isClientPortalMounted .topbarLogoSub { color: var(--frameMuted); }
body[data-accent].isClientPortalMounted .topbarAvatar {
  background: var(--frameField);
  color: var(--frameInk);
}
body[data-accent].isClientPortalMounted .profileButton:hover { background: var(--frameHover); }

/* Colour themes (canvas "Menus, core photos, people and colour themes",
   board 4, approved by Talha 2026-10-04): one Settings choice colours the top
   bar, the buttons, the table headings and what is selected. A theme is
   body[data-theme], set by the shell at boot and by the Supervisor's
   Settings, Appearance (ui/shared/palette.mjs). These blocks come after every
   data-accent and data-frame rule above, so a stored theme wins over the old
   accent and top bar; with no theme those keep their look. The status colours
   (green, gold, danger, the section hues) are never part of a theme.
   Charcoal is today's Graphite buttons with the Charcoal bar. */
body[data-theme="charcoal"] {
  --frame: #2b3036;
  --frameMuted: #aab2bb;
  --primary: #363b43;
  --primaryDeep: #25272a;
  --primaryInk: #ffffff;
  --primarySoft: #eceef0;
  --primaryLine: #b3b6ba; /* = the old color-mix(graphite 28%, line) border (verifier F3) */
  --avatarInk: #303235;
  --blue: #383a3d;
  --navy: #383a3d;
  --navy2: #25272a;
  --navy3: #eceef0;
  --bg: #f3f5f6;
}
body[data-theme="navy"] {
  --frame: #1c2b3a;
  --frameMuted: #a9b6c3;
  --primary: #2c5079;
  --primaryDeep: #244263;
  --primaryInk: #ffffff;
  --primarySoft: #eaeef2;
  --primaryLine: #c0cad7;
  --avatarInk: #244263;
  --blue: #2c5079;
  --navy: #2c5079;
  --navy2: #244263;
  --navy3: #eaeef2;
  --bg: #f3f5f6;
}
body[data-theme="slate"] {
  --frame: #33414f;
  --frameMuted: #c2c6ca;
  --primary: #475e74;
  --primaryDeep: #3a4d5f;
  --primaryInk: #ffffff;
  --primarySoft: #edeff1;
  --primaryLine: #c8cfd5;
  --avatarInk: #3a4d5f;
  --blue: #475e74;
  --navy: #475e74;
  --navy2: #3a4d5f;
  --navy3: #edeff1;
  --bg: #f3f5f6;
}
body[data-theme="ocean"] {
  --frame: #17377a;
  --frameMuted: #b9c3d7;
  --primary: #2457d0;
  --primaryDeep: #1e47ab;
  --primaryInk: #ffffff;
  --primarySoft: #e9eefa;
  --primaryLine: #bdcdf1;
  --avatarInk: #1e47ab;
  --blue: #2457d0;
  --navy: #2457d0;
  --navy2: #1e47ab;
  --navy3: #e9eefa;
  --bg: #e9edf4;
}
body[data-theme="sky"] {
  --frame: #0b4b70;
  --frameMuted: #b6c9d4;
  --primary: #0a6fa8;
  --primaryDeep: #085b8a;
  --primaryInk: #ffffff;
  --primarySoft: #e6f1f6;
  --primaryLine: #b6d4e5;
  --avatarInk: #085b8a;
  --blue: #0a6fa8;
  --navy: #0a6fa8;
  --navy2: #085b8a;
  --navy3: #e6f1f6;
  --bg: #e7eef2;
}
body[data-theme="teal"] {
  --frame: #0c524d;
  --frameMuted: #b6cbca;
  --primary: #0f766e;
  --primaryDeep: #0c615a;
  --primaryInk: #ffffff;
  --primarySoft: #e7f1f0;
  --primaryLine: #b7d6d4;
  --avatarInk: #0c615a;
  --blue: #0f766e;
  --navy: #0f766e;
  --navy2: #0c615a;
  --navy3: #e7f1f0;
  --bg: #e8efef;
}
body[data-theme="forest"] {
  --frame: #18452a;
  --frameMuted: #bac7bf;
  --primary: #237440;
  --primaryDeep: #1d5f34;
  --primaryInk: #ffffff;
  --primarySoft: #e9f1ec;
  --primaryLine: #bdd5c6;
  --avatarInk: #1d5f34;
  --blue: #237440;
  --navy: #237440;
  --navy2: #1d5f34;
  --navy3: #e9f1ec;
  --bg: #e9efed;
}
body[data-theme="honey"] {
  --frame: #4f3509;
  --frameMuted: #cac2b5;
  --primary: #935a00;
  --primaryDeep: #794a00;
  --primaryInk: #ffffff;
  --primarySoft: #f4eee6;
  --primaryLine: #dfceb2;
  --avatarInk: #794a00;
  --blue: #935a00;
  --navy: #935a00;
  --navy2: #794a00;
  --navy3: #f4eee6;
  --bg: #eeedea;
}
body[data-theme="coral"] {
  --frame: #6a2816;
  --frameMuted: #d2beb9;
  --primary: #bb4519;
  --primaryDeep: #993914;
  --primaryInk: #ffffff;
  --primarySoft: #f8ece8;
  --primaryLine: #ebc7ba;
  --avatarInk: #993914;
  --blue: #bb4519;
  --navy: #bb4519;
  --navy2: #993914;
  --navy3: #f8ece8;
  --bg: #f0eceb;
}
body[data-theme="berry"] {
  --frame: #5c1a3c;
  --frameMuted: #cebac4;
  --primary: #ad1d5c;
  --primaryDeep: #8e184b;
  --primaryInk: #ffffff;
  --primarySoft: #f7e8ef;
  --primaryLine: #e6bbce;
  --avatarInk: #8e184b;
  --blue: #ad1d5c;
  --navy: #ad1d5c;
  --navy2: #8e184b;
  --navy3: #f7e8ef;
  --bg: #f0eaee;
}
body[data-theme="plum"] {
  --frame: #3d215b;
  --frameMuted: #c5bcce;
  --primary: #6f3fc2;
  --primaryDeep: #5b349f;
  --primaryInk: #ffffff;
  --primarySoft: #f1ecf9;
  --primaryLine: #d4c5ed;
  --avatarInk: #5b349f;
  --blue: #6f3fc2;
  --navy: #6f3fc2;
  --navy2: #5b349f;
  --navy3: #f1ecf9;
  --bg: #ececf3;
}
body[data-theme="indigo"] {
  --frame: #262668;
  --frameMuted: #bebed2;
  --primary: #4842cf;
  --primaryDeep: #3b36aa;
  --primaryInk: #ffffff;
  --primarySoft: #edecfa;
  --primaryLine: #c8c6f1;
  --avatarInk: #3b36aa;
  --blue: #4842cf;
  --navy: #4842cf;
  --navy2: #3b36aa;
  --navy3: #edecfa;
  --bg: #eaecf4;
}

/* The signed-out page is the lab's front door: the same for everyone,
   whatever theme this computer chose. Its button already uses the
   --authPrimary tokens; this keeps the page behind the card the neutral
   ground of the first block above. */
body[data-theme] .signedOutHero { --bg: #f3f5f6; }
