/* =====================================================================
   WALLY visual language for the Hub
   =====================================================================

   The Hub ships a stock Datta Able theme (`style.css`, ~15k lines, with
   six months of hand edits in it). The tablet app ships its own design
   system in `WALLY_APP/WALLY/lib/screens/shared/wally_design.dart`, and
   as of October 2026 nearly every app screen draws from it. This file
   is the bridge: it re-skins Datta in the app's language without
   touching the vendor stylesheet.

   Why an override layer rather than editing the SCSS: `style.css` is
   committed as compiled output, the matching Bootstrap 5 SCSS sources
   aren't vendored, and several commits ("invoice styling", "fixed
   styling") hand-edited the CSS after the last compile. Recompiling
   would silently drop those. This file is additive and can be deleted
   in one line if we ever do vendor the sources.

   Load order matters: this comes last in `base.html`, so equal-specificity
   rules win. `!important` appears only where the vendor already used it.

   ------------------------------------------------------------------
   Keeping it in sync with the app

   Section 1 is the only place colours and radii are written down. Every
   other rule refers to a token. When `wally_design.dart` changes, change
   section 1 and nothing else.

   Two palettes live here, and both are the app's own -- neither is
   invented for the Hub:

     default            `theme.dart` `lightScheme()`
     [data-theme=dark]  `wally_design.dart`

   The default is the light one. The app itself is dark, so that needs
   saying: nine of the Hub's busiest pages (the four BIM review steps,
   project create/detail/list, robot detail/live) ship bespoke
   stylesheets under `css/pages/` holding ~520 hardcoded colours of
   their own light design -- `project-process.css` alone is 2,779
   lines. Those are not reachable from here, and a dark shell around a
   light-blue BIM wizard is worse than no dark at all. So the dark
   half is written, wired and ready, but it stays opt-in until those
   five stylesheets are converted. Flip it with <html data-theme="dark">.

   The chrome is dark in both, because in the app it always is.
   ===================================================================== */


/* ---------------------------------------------------------------
   0. Type -- Mulish, the app's typeface
   ---------------------------------------------------------------
   Same five weights the app bundles, converted from the very same
   .ttf files in `WALLY_APP/WALLY/fonts/` to woff2. SIL Open Font
   License; the text ships next to the fonts in `OFL.txt`.

   `font-display: swap` so a cold cache shows text in the fallback
   rather than nothing -- the Hub is used over site wifi.
   --------------------------------------------------------------- */
@font-face {
  font-family: "Mulish";
  src: url("../fonts/mulish/Mulish-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Mulish";
  src: url("../fonts/mulish/Mulish-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Mulish";
  src: url("../fonts/mulish/Mulish-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Mulish";
  src: url("../fonts/mulish/Mulish-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Mulish";
  src: url("../fonts/mulish/Mulish-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}


/* ---------------------------------------------------------------
   1. Tokens
   --------------------------------------------------------------- */
:root {
  /* -- Surfaces: theme.dart surface / containerLowest / container -- */
  --wally-bg: #FCF8F8;
  --wally-surface: #FFFFFF;
  --wally-surface-high: #F1EDEC;

  /* The rail and top bar stay charcoal whichever palette is on: the
     app's own bars are dark, and a charcoal rail against a warm page
     is the clearest single piece of shared identity. These two are
     WallyDesign.bg and .surface. */
  --wally-chrome: #1F2122;
  --wally-chrome-raised: #36393B;

  /* Ink for the chrome. Because the rail and the bars stay charcoal in
     both palettes, their text cannot follow `--wally-text` the way the
     page's does -- it would turn near-black on charcoal in the light
     one. These two are therefore the only tokens here deliberately
     *not* redefined under [data-theme=dark]: 12.3:1 and 7.4:1 on
     `--wally-chrome` whichever palette is on. */
  --wally-on-chrome: rgba(255, 255, 255, 0.86);
  --wally-on-chrome-muted: rgba(255, 255, 255, 0.64);

  /* -- Text: onSurface / onSurfaceVariant / outline --------------- */
  --wally-text: #1C1B1B;
  --wally-text-secondary: #4E444A;
  --wally-text-muted: #70646B;      /* `outline` #80747B darkened: the
                                       Material value is a border role
                                       and reaches only 4.47:1 on white.
                                       This is 5.64:1, 4.85:1 on the alt
                                       surface. */
  --wally-text-faint: #A99BA3;      /* decorative only -- never text */

  /* -- Lines and fills: outlineVariant / surfaceContainerLow ------ */
  --wally-line: #D1C2CB;
  --wally-line-strong: #80747B;
  --wally-field-fill: #F6F3F2;

  /* -- Accent ------------------------------------------------------
     Yellow on white fails contrast at text sizes, so on light
     surfaces the accent is the light scheme's own primary. Yellow
     keeps its job on the dark chrome -- exactly the split the app
     makes between `theme.dart` and `wally_design.dart`. */
  --wally-accent: #A7348B;          /* primaryContainer */
  --wally-accent-strong: #891771;   /* primary -- the hover/pressed step */
  --wally-on-accent: #FFFFFF;       /* onPrimary */
  --wally-accent-soft: #FFD8ED;     /* primaryFixed */

  /* The yellow itself, for the places that are always on charcoal. */
  --wally-yellow: #E8E11E;          /* WallyDesign.accent */
  --wally-yellow-bright: #F4EE45;   /* WallyDesign.accentBright */
  --wally-yellow-soft: rgba(232, 225, 30, 0.14);
  --wally-on-yellow: #1F2122;

  /* -- Status -------------------------------------------------------
     Each status is a fill and an ink. The app gets away with one value
     for both because it paints on charcoal; on white its orange and
     green are far too light to read as text -- WallyDesign.warn is
     2.35:1 on white, which is a large part of why Datta's status text
     has always been hard to read here. So the fill stays the app's
     colour, and the ink is that colour taken down until it clears
     4.5:1 both on white and on its own 15% tint.

     `error` is theme.dart's and already passes as both. `info` has no
     app counterpart -- it is Datta's cyan, kept so informational chips
     stay distinct from "connected". */
  --wally-danger: #BA1A1A;          /* error */
  --wally-danger-ink: #BA1A1A;      /* 6.46:1 */
  --wally-warn: #FF8A3D;            /* WallyDesign.warn */
  --wally-warn-ink: #A34A0C;        /* 5.93:1 */
  --wally-success: #13A06F;
  --wally-success-ink: #0E7C55;     /* 5.21:1 */
  --wally-info: #2DCEE3;
  --wally-info-ink: #0D6F7B;        /* 5.87:1 */

  /* What to print on each solid fill. */
  --wally-on-danger: #FFFFFF;
  --wally-on-warn: #1F2122;         /* 6.89:1; white would be 2.35:1 */
  --wally-on-success: #FFFFFF;

  /* -- Tints and hairlines ------------------------------------------
     The washes behind chips, callouts and selected rows. Written as
     rgba of the status colour rather than as a mixed-down opaque
     value, so one declaration reads correctly on white *and* on
     charcoal -- a pale green on one, a deep green wash on the other.
     That is what lets the per-page sheets under `css/pages/` follow
     the palette without a dark block of their own. */
  --wally-accent-tint: rgba(167, 52, 139, 0.12);
  --wally-accent-line: rgba(167, 52, 139, 0.30);
  --wally-success-tint: rgba(19, 160, 111, 0.14);
  --wally-success-line: rgba(19, 160, 111, 0.32);
  --wally-danger-tint: rgba(186, 26, 26, 0.12);
  --wally-danger-line: rgba(186, 26, 26, 0.30);
  --wally-warn-tint: rgba(255, 138, 61, 0.16);
  --wally-warn-line: rgba(255, 138, 61, 0.38);
  --wally-info-tint: rgba(45, 206, 227, 0.14);
  --wally-info-line: rgba(45, 206, 227, 0.32);

  /* The yellow keeps its own set: it is the one colour that stays put
     across both palettes, so chips drawn in it need an ink that
     changes instead. */
  --wally-yellow-ink: #655F11;      /* 7.40:1 on white */
  --wally-yellow-tint: rgba(232, 225, 30, 0.18);
  --wally-yellow-line: rgba(232, 225, 30, 0.50);

  /* The inverted pair, for the chips and buttons that deliberately
     run opposite to the page. theme.dart's inverseSurface. Without a
     name of its own, those were written as "the text colour as a
     background", which collapses to white-on-white the moment the
     text colour becomes white. */
  --wally-inverse: #313030;
  --wally-on-inverse: #FCF8F8;

  /* Shadow/overlay washes, for the same reason. */
  --wally-overlay-weak: rgba(23, 25, 27, 0.06);
  --wally-overlay: rgba(23, 25, 27, 0.12);
  --wally-overlay-strong: rgba(23, 25, 27, 0.20);

  /* -- Brand magenta ------------------------------------------------
     The WALLY mark. Same value as the accent here, but named
     separately: the wordmark must not follow a palette switch. */
  --wally-brand: #A7348B;
  --wally-brand-deep: #891771;
  --wally-brand-ink: #A7348B;       /* the wordmark, as text */

  /* -- Shape: the radii WallyDesign actually uses --------------------
     8 / 14 / 20 are its three commonest; 28 is
     WallyDesign.sheetCornerRadius and its button shape. */
  --wally-radius-sm: 8px;
  --wally-radius: 14px;
  --wally-radius-lg: 20px;
  --wally-radius-pill: 28px;

  /* -- Depth -- the app is near-flat (elevation 0 on most) --------- */
  --wally-shadow: 0 1px 2px rgba(28, 27, 27, 0.08);
  --wally-shadow-lg: 0 10px 30px rgba(28, 27, 27, 0.12);

  /* Bootstrap reads these for links, borders and body colour. */
  --bs-link-color: var(--wally-accent);
  --bs-link-hover-color: var(--wally-accent-strong);
  --bs-border-color: var(--wally-line);
  --bs-body-bg: var(--wally-bg);
  --bs-body-color: var(--wally-text-secondary);
  --bs-heading-color: var(--wally-text);
}

/* `wally_design.dart` verbatim -- the app as it actually looks today.
   Not on by default; see the header for what still blocks it. */
:root[data-theme="dark"] {
  --wally-bg: #1F2122;              /* WallyDesign.bg */
  --wally-surface: #36393B;         /* .surface */
  --wally-surface-high: #42464A;    /* .surfaceHigh */

  --wally-text: #FFFFFF;                          /* .textPrimary */
  --wally-text-secondary: rgba(255, 255, 255, 0.70); /* .textSecondary */
  --wally-text-muted: rgba(255, 255, 255, 0.50);     /* .textMuted */
  --wally-text-faint: rgba(255, 255, 255, 0.32);     /* .textFaint */

  --wally-line: rgba(255, 255, 255, 0.09);        /* .line */
  --wally-line-strong: rgba(255, 255, 255, 0.16);
  --wally-field-fill: rgba(255, 255, 255, 0.05);  /* .fieldFill */

  --wally-accent: #E8E11E;          /* .accent */
  --wally-accent-strong: #F4EE45;   /* .accentBright */
  --wally-on-accent: #1F2122;
  --wally-accent-soft: rgba(232, 225, 30, 0.14);

  /* On charcoal the app's values read directly, so fill and ink agree
     again -- which is why `wally_design.dart` needs only one each. */
  /* A solid danger button is charcoal-on-red here, and on
     WallyDesign.danger exactly that lands at 4.37:1 -- just under AA.
     The *fill* therefore takes one step up (5.01:1) while the ink, which
     is the value the app actually uses for text, stays untouched. */
  --wally-danger: #F4596F;          /* .danger, lightened for fills */
  /* As *text*, WallyDesign.danger only clears AA on the app's darkest
     surface -- 4.37:1 on the page but 3.15:1 on a raised card, which
     is where the Hub shows most of its messages. So the ink is that
     colour lightened to 4.81:1 on the card. */
  --wally-danger-ink: #F78494;
  --wally-warn: #FF8A3D;            /* .warn */
  --wally-warn-ink: #FF8A3D;
  --wally-success: #34D399;         /* .success */
  --wally-success-ink: #34D399;
  --wally-info-ink: #2DCEE3;
  --wally-on-danger: #1F2122;       /* 4.37:1; white would be 3.70:1 */
  --wally-on-warn: #1F2122;         /* 6.89:1 */
  --wally-on-success: #1F2122;      /* 8.41:1 */

  /* The tints track the dark palette's own status colours. */
  --wally-accent-tint: rgba(232, 225, 30, 0.14);
  --wally-accent-line: rgba(232, 225, 30, 0.34);
  --wally-success-tint: rgba(52, 211, 153, 0.15);
  --wally-success-line: rgba(52, 211, 153, 0.34);
  --wally-danger-tint: rgba(242, 65, 90, 0.16);
  --wally-danger-line: rgba(242, 65, 90, 0.38);
  --wally-warn-tint: rgba(255, 138, 61, 0.16);
  --wally-warn-line: rgba(255, 138, 61, 0.38);
  --wally-info-tint: rgba(45, 206, 227, 0.14);
  --wally-info-line: rgba(45, 206, 227, 0.32);

  --wally-yellow-ink: #E8E11E;      /* 11.72:1 on the charcoal */
  --wally-yellow-tint: rgba(232, 225, 30, 0.14);
  --wally-yellow-line: rgba(232, 225, 30, 0.40);

  --wally-inverse: #E5E2E1;         /* inverseSurface */
  --wally-on-inverse: #1C1B1B;

  /* The mark keeps its magenta, but #A7348B as *text* is 1.94:1 on
     charcoal. theme.dart's own dark-scheme primary is the lighter
     pink, which is exactly this case. */
  --wally-brand-ink: #FFADE1;       /* darkScheme primary */

  /* Overlays have to lighten rather than darken here. */
  --wally-overlay-weak: rgba(255, 255, 255, 0.05);
  --wally-overlay: rgba(255, 255, 255, 0.09);
  --wally-overlay-strong: rgba(255, 255, 255, 0.16);

  --wally-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
  --wally-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.38);
}


/* ---------------------------------------------------------------
   2. Typography
   ---------------------------------------------------------------
   The app sets 17px body on a tablet held at arm's length. The Hub
   is a desktop tool with dense tables, so it keeps Datta's 14px --
   Mulish has a taller x-height than Roboto and already reads a
   touch larger at the same size.

   The negative tracking on headings is the app's: WallyDesign.display
   is -3%, .sheetTitle -2%.
   --------------------------------------------------------------- */
body,
.pcoded-navbar,
.pcoded-header,
input, select, textarea, button,
.btn, .form-control, .custom-select,
.swal-modal, .swal-text, .swal-title, .swal-button {
  font-family: "Mulish", "Roboto", -apple-system, "Segoe UI", sans-serif;
}

body {
  background: var(--wally-bg);
  color: var(--wally-text-secondary);
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  color: var(--wally-text);
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1, .h1, h2, .h2 {
  letter-spacing: -0.03em;
}

a {
  color: var(--wally-accent);
}

a:hover,
a:focus {
  color: var(--wally-accent-strong);
}

/* WallyDesign.eyebrow -- uppercase, heavily tracked, accent
   coloured. The app uses it above headings; here it fits the
   sidebar's section captions and the stat cards' labels. */
.wally-eyebrow,
.pcoded-navbar .pcoded-inner-navbar > li.pcoded-menu-caption > label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--wally-yellow);
}


/* ---------------------------------------------------------------
   3. Chrome -- the sidebar rail and the top bar
   ---------------------------------------------------------------
   Datta already ships the rail at #36393B, which happens to be
   WallyDesign.surface exactly. What changes here is the accent: the
   active item was brand magenta, and in the app the "you are here /
   act on this" colour is yellow. That one swap does most of the work
   of making the two feel like one product.
   --------------------------------------------------------------- */
.pcoded-navbar {
  background: var(--wally-chrome-raised);
  color: var(--wally-on-chrome-muted);
}

/* Datta paints the rail's links `#b5bdca` -- a cool blue-grey literal
   doing the chrome-ink job, next to a rail whose own ink is a token.
   Same role, so same token: the rail and the bar now read as one
   surface, and neither follows the page palette. */
.pcoded-navbar a {
  color: var(--wally-on-chrome-muted);
}

.pcoded-navbar .pcoded-inner-navbar li.active > a,
.pcoded-navbar .pcoded-inner-navbar li:focus > a,
.pcoded-navbar .pcoded-inner-navbar li:hover > a {
  color: var(--wally-yellow);
}

.pcoded-navbar .pcoded-inner-navbar li .pcoded-submenu > li.active > a:before,
.pcoded-navbar .pcoded-inner-navbar li .pcoded-submenu > li:focus > a:before,
.pcoded-navbar .pcoded-inner-navbar li .pcoded-submenu > li:hover > a:before {
  background-color: var(--wally-yellow);
}

/* The 3px rail marking the open section. */
.pcoded-navbar .pcoded-inner-navbar > li.active:after,
.pcoded-navbar .pcoded-inner-navbar > li.pcoded-trigger:after {
  background-color: var(--wally-yellow);
}

.pcoded-navbar .pcoded-inner-navbar > li.active > a,
.pcoded-navbar .pcoded-inner-navbar > li.pcoded-trigger > a {
  background: var(--wally-yellow-soft);
  color: var(--wally-yellow);
}

/* Icons are accent coloured when live and faint when not -- the rule
   WallyField and the app's tab bars follow. */
.pcoded-navbar .pcoded-inner-navbar > li.active > a .pcoded-micon,
.pcoded-navbar .pcoded-inner-navbar > li.pcoded-trigger > a .pcoded-micon,
.pcoded-navbar .pcoded-inner-navbar > li:hover > a .pcoded-micon {
  color: var(--wally-yellow);
}

.pcoded-navbar .pcoded-inner-navbar > li > a .pcoded-micon {
  color: var(--wally-text-faint);
  transition: color 0.2s ease;
}

.pcoded-header {
  background: var(--wally-chrome);
  color: var(--wally-on-chrome-muted);
  box-shadow: inset 0 -1px 0 0 var(--wally-line);
}

.pcoded-header a,
.pcoded-header .dropdown-toggle,
.pcoded-header .main-search .input-group .form-control {
  color: var(--wally-on-chrome-muted);
}

/* `.show` is Bootstrap's own class on the toggle while its menu is up
   (it sets `aria-expanded="true"` at the same time). Without a rule for
   it the control dropped back to resting grey the instant the pointer
   left, with its own panel still open underneath -- so open and shut
   looked identical, and only the hover told you which one you had hit.
   Open is the same "live" as hover, which is what the sidebar's active
   item does too. */
.pcoded-header a:hover,
.pcoded-header .dropdown-toggle:hover,
.pcoded-header .dropdown-toggle.show {
  color: var(--wally-yellow);
}

/* Below the lg breakpoint the header's nav collapses into a panel
   that Datta paints white -- against a charcoal bar that reads as a
   rendering fault. Matching its own three-class selector, because
   `.pcoded-header .navbar-collapse` loses to it on specificity. */
.pcoded-header .container > .collapse:not(.show),
.pcoded-header > .collapse:not(.show),
.pcoded-header .navbar-collapse {
  background: var(--wally-chrome);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* The search field lives on the bar, so it follows the chrome rather
   than the page's field styling. */
.pcoded-header .main-search .input-group .form-control,
.pcoded-header .main-search.open .input-group {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.pcoded-header .main-search .input-group .form-control::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

/* ---------------------------------------------------------------
   Avatars
   ---------------------------------------------------------------
   The theme shipped a stock photo (`images/user/avatar-1.jpg`) as the
   profile picture in the navbar and on the client and supplier pages.
   There is no upload behind it, so it was the same stranger's face for
   everyone. Initials instead: real data, no fiction.

   Sized from the font, so one class covers the 40px navbar circle and
   the 100px one on a detail page -- the caller sets `font-size`.
   --------------------------------------------------------------- */
.wally-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5em;
  height: 2.5em;
  border-radius: 50%;
  background: var(--wally-accent-tint);
  /* The strong accent, not the plain one: the navbar circle is 16px,
     and bold only counts as large text from 18.66px, so it needs the
     full 4.5:1. The plain accent on its own tint is 4.34:1. */
  color: var(--wally-accent-strong);
  border: 1px solid var(--wally-accent-line);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
  user-select: none;
  flex: none;
}

/* The profile dropdown styles `.pro-head span` four classes deep -- it
   was written for the name next to the picture, and the avatar is a
   span too. Left alone it forces `display: block`, which drops the
   letters out of the centre of the circle, and the 10px gap that used
   to come from `.pro-head img` never applies.

   Layout only. The colour stays with the base rule: this dropdown
   hangs off the charcoal bar but opens over the page, so it follows
   the palette like any other panel -- an avatar painted the chrome's
   yellow here is unreadable in the light one. */
.pcoded-header .dropdown .profile-notification .pro-head .wally-avatar {
  display: inline-flex;
  margin-right: 10px;
}

/* The same avatar again, this time as the thing you click to open that
   menu -- it replaced a settings gear, which promised a screen that was
   never behind it.

   The colour is the one place it departs from the base rule. This
   instance sits *on* the charcoal bar rather than in the panel the menu
   opens over, and the light palette's accent there is the magenta:
   #891771 on #1F2122 is 2.0:1. On the bar the live colour is the
   yellow, as it is for every other control up there, and the bar is
   charcoal in both palettes so this needs no dark half of its own. */
.pcoded-header .drp-user .dropdown-toggle {
  display: inline-flex;
  align-items: center;
  /* Datta lays these toggles out as inline boxes on a 64px line and
     leaves the icon on its baseline. A circle is taller than a glyph,
     so left on that baseline it hung below the line and stretched the
     bar to 64.5px. Taking the full line height and centring in it puts
     the circle in the middle of the bar instead. */
  height: 64px;
  vertical-align: top;
}

.pcoded-header .drp-user .dropdown-toggle .wally-avatar {
  font-size: 13px;                 /* a 32px circle on the 64px bar */
  background: var(--wally-yellow-tint);
  border-color: var(--wally-yellow-line);
  color: var(--wally-yellow);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* Datta pins the caret `position: absolute; top: 0; left: 12px` against
   the dropdown, which put it across the top of the circle. It belongs
   after it, where the bell's own caret sits. */
.pcoded-header .drp-user .dropdown-toggle:after {
  position: static;
  margin-left: 6px;
}

/* Open reads as hover does: the circle fills. Keeping the two the same
   is what stops the "already open" toggle from looking like a third
   state when the pointer comes back to it. */
.pcoded-header .drp-user .dropdown-toggle:hover .wally-avatar,
.pcoded-header .drp-user .dropdown-toggle:focus-visible .wally-avatar,
.pcoded-header .drp-user .dropdown-toggle.show .wally-avatar {
  background: var(--wally-yellow);
  border-color: var(--wally-yellow);
  color: var(--wally-on-yellow);   /* 11.72:1 -- the bar's own pairing */
}

/* The banner behind the avatar on the client and supplier cards. It
   was `images/user/cover.jpg`, a stock landscape -- there is nothing
   to upload a cover from, so it was decoration posing as content. */
.wally-cover {
  height: 120px;
  border-radius: var(--wally-radius) var(--wally-radius) 0 0;
  background:
    radial-gradient(circle at 18% 120%, var(--wally-yellow-tint), transparent 55%),
    radial-gradient(circle at 82% -20%, var(--wally-accent-tint), transparent 55%),
    var(--wally-surface-high);
}

/* Nothing to make initials from -- a client with no name yet. Shown
   at full strength: dimming it put the glyph at 2.2:1, and a record
   with no name on it is worth seeing rather than hiding. */
.wally-avatar:empty::after {
  content: "?";
}

/* The two header dropdowns -- notifications and the profile menu --
   are the densest patch of hardcoded colour Datta ships: a magenta
   gradient header, a #eff3f6 footer, #222 names and #686c71 links.
   None of it followed the palette, so on charcoal the panel came up
   with a bright bar on top and a white slab underneath.

   The coloured header bar goes. The app's own sheets (`wally_sheet`,
   `dialogTheme`) put the title straight on the panel with a hairline
   under it, and that reads better here too -- the dropdown is already
   a raised surface, it does not need a second one on top. */
.pcoded-header .dropdown .notification .noti-head,
.pcoded-header .dropdown .profile-notification .pro-head {
  background: var(--wally-surface-high);
  border-bottom: 1px solid var(--wally-line);
}

.pcoded-header .dropdown .notification .noti-head h6,
.pcoded-header .dropdown .profile-notification .pro-head span:not(.wally-avatar),
.pcoded-header .dropdown .profile-notification .pro-head .h6,
.pcoded-header .dropdown .notification .noti-body li p strong {
  color: var(--wally-text);
}

.pcoded-header .dropdown .notification .noti-head a,
.pcoded-header .dropdown .profile-notification .pro-head .dud-logout,
.pcoded-header .dropdown .notification .noti-footer a {
  color: var(--wally-accent);
}

.pcoded-header .dropdown .notification .noti-body li p,
.pcoded-header .dropdown .notification .noti-body li .n-time,
.pcoded-header .dropdown .profile-notification .pro-body li a {
  color: var(--wally-text-secondary);
}

.pcoded-header .dropdown .notification .noti-footer {
  background: transparent;
  border-top: 1px solid var(--wally-line);
}

.pcoded-header .dropdown .notification .noti-body li.notification:hover,
.pcoded-header .dropdown .profile-notification .pro-body li.active,
.pcoded-header .dropdown .profile-notification .pro-body li:active,
.pcoded-header .dropdown .profile-notification .pro-body li:focus,
.pcoded-header .dropdown .profile-notification .pro-body li:hover {
  background: var(--wally-accent-tint);
}

.pcoded-header .dropdown .notification .noti-body li,
.pcoded-header .dropdown .profile-notification .pro-body li {
  border-color: var(--wally-line);
}

/* Datta hangs an unread dot off the bell in brand magenta; on the bar
   it should be the same yellow everything else live there is. */
.pcoded-header .badge.bg-primary,
.pcoded-header .notification-badge {
  background: var(--wally-yellow) !important;
  color: var(--wally-on-yellow) !important;
}


/* ---------------------------------------------------------------
   3b. The narrow-screen header
   ---------------------------------------------------------------
   Below Datta's lg breakpoint the header stacks into two rows: a 64px
   bar, and under it the nav in a panel with 22px of padding. That came
   to 172px -- a quarter of a laptop viewport -- and three things in it
   were already wrong before any of this:

     - `logo.svg` carries a viewBox and no width/height, so as a flex
       item with no size of its own it collapses to 0x0. The sidebar
       gives it an explicit height (`sidebar-overrides.css`); the
       header never did, so the brand was simply invisible here.
     - the hamburger is pinned `right: 20px`, putting it on the
       opposite side from the logo it belongs to.
     - the bell and the gear ended up orphaned in the second row, with
       a stray chevron from `.mob-toggler::after` above them.

   So the two rows become one 64px bar: hamburger, logo, then the
   actions pushed right. That is the app's own AppBar -- `elevation: 0`
   over the charcoal, nothing else in it.

   Bootstrap's `.show` is matched alongside `:not(.show)` because the
   toggler can still add it; without that the panel springs back to the
   stacked layout on a click. */
@media (max-width: 991.98px) {
  .pcoded-header {
    flex-wrap: nowrap;
    min-height: 64px;
    align-items: center;
  }

  /* Datta gives this `width: 100%`, which alone forces the wrap. */
  .pcoded-header .m-header {
    width: auto;
    flex: 1 1 auto;
    height: 64px;
    padding-left: 52px;        /* clears the absolutely-placed burger */
    overflow: hidden;
  }

  .pcoded-header .m-header .mobile-menu {
    left: 10px;
    right: auto;
  }

  .pcoded-header .m-header .b-brand {
    margin-left: 0;
  }

  /* The size the SVG does not carry itself. */
  .pcoded-header .m-header .b-brand .logo {
    height: 26px;
    width: auto;
    display: block;
  }

  /* Datta washes the mark to flat white here. It is yellow and
     magenta, both of which read perfectly well on charcoal. */
  .pcoded-header .m-header .b-brand img {
    filter: none;
  }

  /* The second row folds into the first. */
  .pcoded-header .container > .collapse:not(.show),
  .pcoded-header > .collapse:not(.show),
  .pcoded-header > .navbar-collapse.show {
    display: flex;
    position: static;
    width: auto;
    flex: 0 0 auto;
    height: 64px;
    align-items: center;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  /* Datta hides these outright on small screens. The bell is how
     anyone finds out a project needs them, so it stays.

     `inline-block` rather than `flex`, and that matters: Datta lays
     this list out as inline-block items, which masks the
     `flex-direction: column` Bootstrap puts on `.navbar-nav`. Setting
     `display: flex` here to un-hide it woke that column back up and
     stacked the bell above the gear, dropping the gear out of the
     64px bar into the page. Restoring Datta's own display keeps the
     items in a row and needs no further layout of its own. */
  .pcoded-header .container > .collapse:not(.show) .ms-auto,
  .pcoded-header > .collapse:not(.show) .ms-auto,
  .pcoded-header > .navbar-collapse .ms-auto {
    display: inline-block;
    margin-right: 8px !important;
  }

  /* The chevron that used to sit above the stacked panel. */
  .pcoded-header .mob-toggler,
  .pcoded-header .container > .collapse:not(.show) .mob-toggler:after,
  .pcoded-header > .collapse:not(.show) .mob-toggler:after {
    display: none;
  }

  /* Datta repaints the whole bar as a magenta gradient below this
     breakpoint. The bar is charcoal at every width now. */
  .pcoded-header {
    background: var(--wally-chrome);
    color: var(--wally-on-chrome-muted);
  }

  .pcoded-header .input-group-text,
  .pcoded-header a,
  .pcoded-header .dropdown-toggle {
    color: var(--wally-on-chrome-muted);
  }

  .pcoded-header a:hover,
  .pcoded-header .dropdown-toggle:hover,
  .pcoded-header .dropdown-toggle.show {
    color: var(--wally-yellow);
  }
}


/* ---------------------------------------------------------------
   4. Surfaces -- cards, dropdowns, modals, offcanvas
   ---------------------------------------------------------------
   Datta's card is a 2px-radius box with a flat 1px ring. The app's
   panels are 14px with a hairline, near-flat (elevation 0 on most of
   its surfaces), so that is what they become.
   --------------------------------------------------------------- */
.card {
  background: var(--wally-surface);
  border-radius: var(--wally-radius);
  box-shadow: 0 0 0 1px var(--wally-line), var(--wally-shadow);
  --bs-body-color: var(--wally-text-secondary);
  /* Bootstrap's .card-body paints itself with --bs-card-color, which
     Datta pins to its own #686c71. Setting only the colour above left
     every card body on that grey -- 2.20:1 once the card is charcoal. */
  --bs-card-color: var(--wally-text-secondary);
  color: var(--wally-text-secondary);
}

.card .card-body {
  color: var(--wally-text-secondary);
}

.card .card-header {
  border-bottom: 1px solid var(--wally-line);
}

.card .card-header h5,
.card .card-header h6 {
  color: var(--wally-text);
}

.card .card-footer {
  background: transparent;
  border-top: 1px solid var(--wally-line);
}

/* Datta gives the tab body a flat white and a hairline ring. */
.tab-content {
  background: var(--wally-surface);
  box-shadow: 0 0 0 1px var(--wally-line);
  border-radius: var(--wally-radius);
  color: var(--wally-text-secondary);
}

.dropdown-menu,
.modal-content,
.offcanvas,
.popover,
.toast {
  background: var(--wally-surface-high);
  border: 1px solid var(--wally-line);
  border-radius: var(--wally-radius);
  box-shadow: var(--wally-shadow-lg);
  color: var(--wally-text-secondary);
}

.dropdown-menu > li > a,
.dropdown-item {
  color: var(--wally-text-secondary);
  border-radius: var(--wally-radius-sm);
}

.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
  background: var(--wally-field-fill);
  color: var(--wally-accent);
}

/* The selected item keeps Bootstrap's own #0d6efd -- the language
   picker in the profile menu marked "English" in a blue from no
   palette in this product.

   The ink is the *strong* accent, not the plain one: this is 14px at
   weight 400, so it needs the full 4.5:1, and the plain accent on its
   own tint is 4.34:1. */
.dropdown-item.active,
.dropdown-item:active,
.dropdown-menu > li > a.active {
  background: var(--wally-accent-tint);
  color: var(--wally-accent-strong);
}

/* Bootstrap's default inline-code pink (#d63384) is from no palette
   here, and lands at 2.58:1 on a dark card. */
code, kbd, samp {
  color: var(--wally-accent-strong);
  background: var(--wally-overlay-weak);
  border-radius: var(--wally-radius-sm);
  padding: 0.1em 0.35em;
}

pre, pre code {
  color: var(--wally-text-secondary);
  background: var(--wally-overlay-weak);
}

pre code {
  padding: 0;
}

.dropdown-divider,
hr {
  border-color: var(--wally-line);
  opacity: 1;
}

.modal-header,
.modal-footer {
  border-color: var(--wally-line);
}

/* The sheet-style popup. The app rounds only the top corners of a
   bottom sheet at WallyDesign.sheetCornerRadius; a centred web modal
   gets it on all four. */
.modal-content {
  border-radius: var(--wally-radius-lg);
}

/* Datta's own modal-window-effects plugin renders outside .modal. */
.md-modal .md-content {
  background: var(--wally-surface-high);
  border-radius: var(--wally-radius);
  color: var(--wally-text-secondary);
}

.md-modal .md-content > h3 {
  border-radius: var(--wally-radius) var(--wally-radius) 0 0;
}


/* ---------------------------------------------------------------
   5. Controls -- buttons and form fields
   ---------------------------------------------------------------
   WallyDesign.primaryButton is a filled pill; .ghostButton is an
   outline pill. WallyField is a filled 14px-radius box whose border
   goes accent, 1.5px, on focus. All three come across directly.
   --------------------------------------------------------------- */
.btn {
  border-radius: var(--wally-radius-pill);
  font-weight: 600;
}

/* Datta leaves Bootstrap's default blue focus ring on every brand
   button (`--bs-btn-focus-shadow-rgb: 49,132,253`), so tabbing
   through the Hub flashes a colour from no palette at all. */
.btn,
.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger,
.btn-warning,
.btn-info {
  --bs-btn-focus-shadow-rgb: 167, 52, 139;
}

:root[data-theme="dark"] .btn,
:root[data-theme="dark"] .btn-primary,
:root[data-theme="dark"] .btn-secondary,
:root[data-theme="dark"] .btn-success,
:root[data-theme="dark"] .btn-danger,
:root[data-theme="dark"] .btn-warning,
:root[data-theme="dark"] .btn-info {
  --bs-btn-focus-shadow-rgb: 232, 225, 30;
}

/* The call to action. In the app this is yellow on charcoal; it
   keeps that job here, and in light mode the token resolves to the
   light scheme's magenta primary instead. */
.btn-primary {
  --bs-btn-color: var(--wally-on-accent);
  --bs-btn-bg: var(--wally-accent);
  --bs-btn-border-color: var(--wally-accent);
  --bs-btn-hover-color: var(--wally-on-accent);
  --bs-btn-hover-bg: var(--wally-accent-strong);
  --bs-btn-hover-border-color: var(--wally-accent-strong);
  --bs-btn-active-color: var(--wally-on-accent);
  --bs-btn-active-bg: var(--wally-accent-strong);
  --bs-btn-active-border-color: var(--wally-accent-strong);
  --bs-btn-disabled-color: var(--wally-on-accent);
  --bs-btn-disabled-bg: var(--wally-accent-soft);
  --bs-btn-disabled-border-color: transparent;
  color: var(--wally-on-accent);
  background: var(--wally-accent);
  border-color: var(--wally-accent);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  color: var(--wally-on-accent);
  background: var(--wally-accent-strong);
  border-color: var(--wally-accent-strong);
}

/* The status buttons. A solid fill needs an ink that reads on it, and
   which ink that is flips between the palettes: on the light scheme
   white reads on danger (6.46:1) and on the success ink (5.21:1) but
   not on the app's orange (2.35:1), while on charcoal every one of
   these fills wants dark text instead. So the ink is a token, and the
   hover state is a Material state layer -- the same fill with 10% of
   its own ink laid over it -- rather than a second colour. Swapping
   the fill on hover is what breaks this: light success hovering to
   #13A06F would put white at 3.34:1.

   Datta's own btn-danger was white on #FF425C at 3.39:1. */
.btn-danger {
  --bs-btn-color: var(--wally-on-danger);
  --bs-btn-bg: var(--wally-danger);
  --bs-btn-border-color: var(--wally-danger);
  --bs-btn-hover-color: var(--wally-on-danger);
  --bs-btn-hover-bg: var(--wally-danger);
  --bs-btn-hover-border-color: var(--wally-danger);
  --bs-btn-active-color: var(--wally-on-danger);
  --bs-btn-active-bg: var(--wally-danger);
  --bs-btn-active-border-color: var(--wally-danger);
  color: var(--wally-on-danger);
  background: var(--wally-danger);
  border-color: var(--wally-danger);
}

.btn-success {
  --bs-btn-color: var(--wally-on-success);
  --bs-btn-bg: var(--wally-success-ink);
  --bs-btn-border-color: var(--wally-success-ink);
  --bs-btn-hover-color: var(--wally-on-success);
  --bs-btn-hover-bg: var(--wally-success-ink);
  --bs-btn-hover-border-color: var(--wally-success-ink);
  --bs-btn-active-color: var(--wally-on-success);
  --bs-btn-active-bg: var(--wally-success-ink);
  --bs-btn-active-border-color: var(--wally-success-ink);
  color: var(--wally-on-success);
  background: var(--wally-success-ink);
  border-color: var(--wally-success-ink);
}

.btn-warning {
  --bs-btn-color: var(--wally-on-warn);
  --bs-btn-bg: var(--wally-warn);
  --bs-btn-border-color: var(--wally-warn);
  --bs-btn-hover-color: var(--wally-on-warn);
  --bs-btn-hover-bg: var(--wally-warn);
  --bs-btn-hover-border-color: var(--wally-warn);
  --bs-btn-active-color: var(--wally-on-warn);
  --bs-btn-active-bg: var(--wally-warn);
  --bs-btn-active-border-color: var(--wally-warn);
  color: var(--wally-on-warn);
  background: var(--wally-warn);
  border-color: var(--wally-warn);
}

/* The state layer. `inset ... 999px` floods the button with the
   overlay without needing a pseudo-element. */
.btn-danger:hover,
.btn-success:hover,
.btn-warning:hover {
  box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0.10);
}

.btn-danger:active,
.btn-success:active,
.btn-warning:active {
  box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0.18);
}

/* On charcoal the inks are dark, so the layer has to lighten. */
:root[data-theme="dark"] .btn-danger:hover,
:root[data-theme="dark"] .btn-success:hover,
:root[data-theme="dark"] .btn-warning:hover {
  box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.12);
}

:root[data-theme="dark"] .btn-danger:active,
:root[data-theme="dark"] .btn-success:active,
:root[data-theme="dark"] .btn-warning:active {
  box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.20);
}

/* WallyDesign.ghostButton -- the quiet outline pill. Datta's
   btn-outline-* and btn-light both land in this role. */
.btn-light,
.btn-outline-primary,
.btn-outline-secondary {
  --bs-btn-color: var(--wally-text);
  --bs-btn-bg: transparent;
  --bs-btn-border-color: var(--wally-line-strong);
  --bs-btn-hover-color: var(--wally-accent);
  --bs-btn-hover-bg: var(--wally-field-fill);
  --bs-btn-hover-border-color: var(--wally-accent);
  --bs-btn-active-color: var(--wally-accent);
  --bs-btn-active-bg: var(--wally-field-fill);
  --bs-btn-active-border-color: var(--wally-accent);
  /* Declared outright, not only as Bootstrap variables, because the
     login page carries `btn-primary btn-outline-primary` on one
     element and the filled rule above sets these directly. Without
     these the ghost button renders as a second filled magenta pill
     with 3.15:1 text on it. */
  color: var(--wally-text);
  background: transparent;
  border-color: var(--wally-line-strong);
}

/* The auth pages colour every link `#111` with a two-class selector,
   which also lands on "Create Profile" -- a ghost button rendered as
   an <a>. 1.62:1 on charcoal. */
.auth-wrapper a {
  color: var(--wally-text-secondary);
}

.auth-wrapper a.btn-outline-primary,
.auth-wrapper a.btn-light {
  color: var(--wally-text);
}

.auth-wrapper a.btn-primary:not(.btn-outline-primary) {
  color: var(--wally-on-accent);
}

.btn-light:hover,
.btn-light:focus,
.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  color: var(--wally-accent);
  background: var(--wally-field-fill);
  border-color: var(--wally-accent);
}

/* WallyField: filled, hairline, 14px, accent on focus. */
.form-control,
.custom-select,
.form-select {
  background-color: var(--wally-field-fill);
  border: 1px solid var(--wally-line);
  border-width: 1px;
  border-radius: var(--wally-radius);
  box-shadow: none;
  color: var(--wally-text);
}

.form-control:focus,
.custom-select:focus,
.form-select:focus,
.form-control:active {
  background-color: var(--wally-field-fill);
  border-color: var(--wally-accent);
  border-width: 1px;
  box-shadow: 0 0 0 1px var(--wally-accent);
  color: var(--wally-text);
}

.form-control::placeholder,
.form-control::-moz-placeholder,
.form-control::-webkit-input-placeholder {
  color: var(--wally-text-faint);
  opacity: 1;
}

.form-control:disabled,
.form-control[readonly] {
  background-color: var(--wally-field-fill);
  color: var(--wally-text-muted);
}

.form-label,
label {
  color: var(--wally-text-secondary);
  font-weight: 500;
}

.input-group-text {
  background: var(--wally-field-fill);
  border: 1px solid var(--wally-line);
  color: var(--wally-text-muted);
}

/* Bootstrap lets an input group wrap so that `.invalid-feedback` can
   drop to its own line. Every group in the Hub is a field with a unit
   or a button welded to it, and the tighter table headers below leave
   some columns narrow enough that the unit was wrapping under the
   field. Those shrink instead; the feedback keeps its own line. */
.input-group {
  flex-wrap: nowrap;
  /* Datta paints the wrapper itself #eff3f6 and lets the field sit on
     top. The field's own fill is a 5% white in the dark palette, so
     without this the wrapper showed straight through it and every
     search box came out a light slab on charcoal. */
  background: transparent;
}

.input-group > .invalid-feedback,
.input-group > .valid-feedback,
.input-group > .invalid-tooltip,
.input-group > .valid-tooltip {
  flex-basis: 100%;
}

/* With wrapping off, a narrow table column would otherwise shrink the
   field until the number itself is clipped -- the robot settings page
   had "500.0" rendering in 34px. The unit chip gives up its generous
   padding first, and the field refuses to go below a readable width. */
.input-group > .form-control,
.input-group > .custom-select,
.input-group > .form-select {
  min-width: 5.5rem;
}

.input-group > .input-group-text {
  padding-left: 10px;
  padding-right: 10px;
  white-space: nowrap;
}

/* A radius on every .form-control would round the welded edges too, so
   the inner corners are squared back off. */
.input-group > :not(:last-child):not(.dropdown-menu):not(.valid-feedback):not(.invalid-feedback) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group > :not(:first-child):not(.dropdown-menu):not(.valid-feedback):not(.invalid-feedback) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.input-group > :first-child {
  border-top-left-radius: var(--wally-radius);
  border-bottom-left-radius: var(--wally-radius);
}

.input-group > :last-child:not(.dropdown-menu):not(.valid-feedback):not(.invalid-feedback) {
  border-top-right-radius: var(--wally-radius);
  border-bottom-right-radius: var(--wally-radius);
}

.form-check-input {
  background-color: var(--wally-field-fill);
  border-color: var(--wally-line-strong);
}

.form-check-input:checked {
  background-color: var(--wally-accent);
  border-color: var(--wally-accent);
}

.form-check-input:focus {
  border-color: var(--wally-accent);
  box-shadow: 0 0 0 2px var(--wally-accent-soft);
}

/* The tick has to be drawn in whatever contrasts with the filled
   accent: white on the light scheme's magenta, charcoal on the
   dark scheme's yellow. */
.form-check-input:checked[type="checkbox"] {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}

.form-check-input:checked[type="radio"] {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23ffffff'/%3e%3c/svg%3e");
}

:root[data-theme="dark"] .form-check-input:checked[type="checkbox"] {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%231F2122' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}

:root[data-theme="dark"] .form-check-input:checked[type="radio"] {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%231F2122'/%3e%3c/svg%3e");
}


/* ---------------------------------------------------------------
   6. Data -- tables, badges, pagination, tabs
   --------------------------------------------------------------- */
.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--wally-text-secondary);
  /* Datta pins `--bs-table-color-state` to #111, and Bootstrap reads
     that in preference to --bs-table-color, so every cell stayed near
     black -- 1.62:1 on a charcoal card. */
  --bs-table-color-state: var(--wally-text-secondary);
  --bs-table-border-color: var(--wally-line);
  --bs-table-hover-bg: var(--wally-field-fill);
  --bs-table-hover-color: var(--wally-text);
  --bs-emphasis-color: var(--wally-text);
  --bs-table-striped-bg: var(--wally-field-fill);
  --bs-table-striped-color: var(--wally-text-secondary);
  color: var(--wally-text-secondary);
}

.table th {
  border-top: 1px solid var(--wally-line);
}

/* Datta already uppercases table headers; giving them the eyebrow's
   tracking and dropping them to the muted tone makes the data the
   loudest thing in the row, which is how the app's lists read. */
.table thead th {
  background: transparent;
  color: var(--wally-text-muted);
  border-bottom: 1px solid var(--wally-line);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.table td {
  border-color: var(--wally-line);
}

.table tbody tr:hover > * {
  background: var(--wally-field-fill);
}

.badge {
  border-radius: var(--wally-radius-pill);
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Datta's badge-light-* are tinted chips: a 15% wash of the status
   colour with the solid colour as text. Repointing them at the
   tokens is all that is needed for them to follow the palette. */
.badge-light-primary { background: var(--wally-accent-soft); color: var(--wally-accent); }
.badge-light-primary:focus, .badge-light-primary:hover { color: var(--wally-accent); }
.badge-light-secondary { background: rgba(232, 225, 30, 0.15); color: var(--wally-accent); }
.badge-light-secondary:focus, .badge-light-secondary:hover { color: var(--wally-accent); }
.badge-light-success { background: rgba(52, 211, 153, 0.15); color: var(--wally-success-ink); }
.badge-light-success:focus, .badge-light-success:hover { color: var(--wally-success-ink); }
.badge-light-info { background: rgba(45, 206, 227, 0.15); color: var(--wally-info-ink); }
.badge-light-info:focus, .badge-light-info:hover { color: var(--wally-info-ink); }
.badge-light-warning { background: rgba(255, 138, 61, 0.15); color: var(--wally-warn-ink); }
.badge-light-warning:focus, .badge-light-warning:hover { color: var(--wally-warn-ink); }
.badge-light-danger { background: rgba(242, 65, 90, 0.15); color: var(--wally-danger-ink); }
.badge-light-danger:focus, .badge-light-danger:hover { color: var(--wally-danger-ink); }

.nav-tabs,
.nav-pills {
  background: transparent;
  border-bottom-color: var(--wally-line);
}

.nav-tabs .nav-link,
.nav-pills .nav-link {
  color: var(--wally-text-muted);
  border-radius: var(--wally-radius-sm);
  font-weight: 600;
}

.nav-tabs .nav-link.active,
.nav-pills .nav-link.active {
  color: var(--wally-accent);
  background: var(--wally-accent-soft);
  border-color: transparent;
}

.page-link {
  background: transparent;
  border-color: var(--wally-line);
  border-radius: var(--wally-radius-sm);
  color: var(--wally-text-secondary);
}

.pagination {
  gap: 4px;
}

.page-item.active .page-link {
  background: var(--wally-accent);
  border-color: var(--wally-accent);
  color: var(--wally-on-accent);
}

.breadcrumb-item a,
.breadcrumb-item,
.breadcrumb-item + .breadcrumb-item::before {
  color: var(--wally-text-muted);
}

.breadcrumb-item a:hover {
  color: var(--wally-accent);
}

/* Datta paints breadcrumb links brand magenta from
   `.page-header .page-header-title + .breadcrumb > .breadcrumb-item a`,
   four classes deep, which beats anything shorter and lands at 2.70:1
   once the content area goes charcoal. Matched here rather than
   reached for with !important. */
.page-header .page-header-title + .breadcrumb > .breadcrumb-item:last-child a,
.page-header .page-header-title + .breadcrumb > .breadcrumb-item a,
.page-header .page-header-title + .breadcrumb > .breadcrumb-item,
.page-header .breadcrumb-item a,
.breadcrumb .breadcrumb-item a,
.breadcrumb > .breadcrumb-item {
  color: var(--wally-text-muted);
}

.page-header .page-header-title + .breadcrumb > .breadcrumb-item a:hover,
.page-header .breadcrumb-item a:hover,
.breadcrumb .breadcrumb-item a:hover {
  color: var(--wally-accent);
}

/* Datta sets a flat #111 on headings and on `.font-color`, which is
   invisible on charcoal. */
.card h1, .card h2, .card h3, .card h4, .card h5, .card h6,
.table h1, .table h2, .table h3, .table h4, .table h5, .table h6,
.font-color {
  color: var(--wally-text);
  --bs-body-color: var(--wally-text);
}

/* Pagination's disabled arrows carry Bootstrap's own near-black.
   They take the muted tone rather than the faint one: an inactive
   control is exempt from the contrast rules, but `faint` lands at
   2.66:1 and is simply hard to see. The missing border and hover are
   what say "disabled". */
/* Datta puts the grey on the <li> as well as the link, so colouring
   only `.page-link` left Bootstrap's #6c757d showing through. */
.page-item.disabled,
.page-link.disabled,
.page-item.disabled .page-link {
  background: transparent;
  color: var(--wally-text-muted);
  border-color: var(--wally-line);
  opacity: 0.65;
}

.page-header,
.page-header .page-block {
  background: transparent;
}


/* ---------------------------------------------------------------
   7. Status -- alerts and the solid status fills
   ---------------------------------------------------------------
   The four status colours move onto the app's exact values. Three of
   them barely shift (Datta's danger #FF425C vs the app's #F2415A);
   success is the real change, from a teal green to the app's
   emerald, so "connected" reads the same on both screens.
   --------------------------------------------------------------- */
/* Solid fills take the app's colour and whichever ink reads on it. */
.bg-success, .badge.bg-success { background-color: var(--wally-success) !important; color: var(--wally-on-success) !important; }
.bg-warning, .badge.bg-warning { background-color: var(--wally-warn) !important;    color: var(--wally-on-warn) !important; }
.bg-danger,  .badge.bg-danger  { background-color: var(--wally-danger) !important;  color: var(--wally-on-danger) !important; }
.bg-primary, .badge.bg-primary { background-color: var(--wally-accent) !important;  color: var(--wally-on-accent) !important; }

/* Datta's bordered table is a flat #e2e5e8 lattice. The calendar is
   built on one, so this is what was still drawing a light grid over
   the month after FullCalendar's own rules were handled. */
.table-bordered,
.table-bordered td,
.table-bordered th {
  border-color: var(--wally-line);
}

/* FullCalendar paints its own grid: #ddd rules on every cell, a white
   popover, and a near-white "today" wash. On a charcoal page that is
   a bright lattice over the whole month. The plugin predates CSS
   variables, so this is the only place to reach it. */
.fc-unthemed .fc-content,
.fc-unthemed .fc-divider,
.fc-unthemed .fc-list-heading td,
.fc-unthemed .fc-list-view,
.fc-unthemed .fc-popover,
.fc-unthemed .fc-row,
.fc-unthemed tbody,
.fc-unthemed td,
.fc-unthemed th,
.fc-unthemed thead {
  border-color: var(--wally-line);
}

.fc-unthemed .fc-popover,
.fc-unthemed .fc-list-view {
  background: var(--wally-surface-high);
  color: var(--wally-text-secondary);
}

.fc-unthemed .fc-divider,
.fc-unthemed .fc-list-heading td,
.fc-unthemed .fc-popover .fc-header {
  background: var(--wally-field-fill);
  color: var(--wally-text);
}

/* "Today" is a wash of the accent rather than FullCalendar's cream. */
.fc-unthemed td.fc-today {
  background: var(--wally-accent-tint);
}

.fc .fc-day-header,
.fc .fc-day-number,
.fc .fc-week-number,
.fc .fc-toolbar h2 {
  color: var(--wally-text);
}

.fc-unthemed .fc-disabled-day {
  background: var(--wally-overlay-weak);
  opacity: 1;
}

/* The toolbar buttons are Bootstrap buttons, so they already follow
   the palette -- but FullCalendar marks the active view with its own
   pressed state. */
.fc button.fc-state-active,
.fc button.fc-state-down {
  background: var(--wally-accent);
  border-color: var(--wally-accent);
  color: var(--wally-on-accent);
}

/* Bootstrap's neutral background utilities. `.bg-light` is a flat
   #f8f9fa with near-black text, which on a charcoal card is a white
   chip; `.bg-dark` is the mirror problem in the light palette. Both
   become the alt surface, which is light or dark as the palette says. */
.bg-light, .badge.bg-light {
  background-color: var(--wally-surface-high) !important;
  color: var(--wally-text-secondary) !important;
  border-color: var(--wally-line) !important;
}

.bg-dark, .badge.bg-dark {
  background-color: var(--wally-inverse) !important;
  color: var(--wally-on-inverse) !important;
}

.bg-secondary, .badge.bg-secondary {
  background-color: var(--wally-surface-high) !important;
  color: var(--wally-text-secondary) !important;
}

.text-dark { color: var(--wally-text) !important; }
.text-light { color: var(--wally-text-muted) !important; }
.text-secondary { color: var(--wally-text-secondary) !important; }
.text-body { color: var(--wally-text-secondary) !important; }
.border, .border-top, .border-bottom, .border-start, .border-end {
  border-color: var(--wally-line) !important;
}

/* PerfectScrollbar paints its own thumb a fixed blue-grey. */
.ps__thumb-y, .ps__thumb-x {
  background-color: var(--wally-line-strong) !important;
}

.ps__rail-y:hover .ps__thumb-y,
.ps__rail-y:focus .ps__thumb-y,
.ps__rail-y.ps--clicking .ps__thumb-y {
  background-color: var(--wally-text-muted) !important;
}

/* Status *text* takes the ink, never the fill. */
.text-success { color: var(--wally-success-ink) !important; }
.text-warning { color: var(--wally-warn-ink) !important; }
.text-danger  { color: var(--wally-danger-ink) !important; }
.text-info    { color: var(--wally-info-ink) !important; }
.text-muted   { color: var(--wally-text-muted) !important; }

/* `.text-c-blue` is the login page's name for the brand magenta in
   "WALLY Automation". It is the wordmark, not an accent. */
.text-c-blue { color: var(--wally-brand-ink) !important; }

.alert {
  border-radius: var(--wally-radius);
  border-width: 1px;
}

.alert-success { background: rgba(52, 211, 153, 0.12);  border-color: rgba(52, 211, 153, 0.35);  color: var(--wally-success-ink); }
.alert-warning { background: rgba(255, 138, 61, 0.12);  border-color: rgba(255, 138, 61, 0.35);  color: var(--wally-warn-ink); }
.alert-danger,
.alert-error   { background: rgba(242, 65, 90, 0.12);   border-color: rgba(242, 65, 90, 0.35);   color: var(--wally-danger); }
.alert-info    { background: rgba(45, 206, 227, 0.12);  border-color: rgba(45, 206, 227, 0.35);  color: var(--wally-info-ink); }
.alert-primary { background: var(--wally-accent-soft);  border-color: var(--wally-accent);       color: var(--wally-accent); }

.progress {
  background: var(--wally-field-fill);
  border-radius: var(--wally-radius-pill);
}

.progress-bar {
  background-color: var(--wally-accent);
}
