﻿/* =====================================================================
   BBCRM Theme System  —  light / dark
   ---------------------------------------------------------------------
   Single home for the app's color-mode system. Two layers stay in sync:

     1. Bootstrap 5.3 native color modes via [data-bs-theme="light|dark"]
        on <html>. The attribute is set before first paint by the no-FOUC
        snippet in each standalone master (BaseMaster, FamilyPortal,
        Mobile, Referrals) from the UserSettings "Theme" cookie, falling
        back to the OS prefers-color-scheme on first visit.

     2. DevExpress Office365 / Office365Dark, applied server-side via
        ASPxWebControl.GlobalTheme (Global.asax) from the same cookie.

   ===================================================================== */

/* ---------- Light (default) ---------- */
:root,
[data-bs-theme="light"] {
    --background-color: #edf0f5;
    --box-bg-color: rgba(255, 255, 255, 0.5);
    --box-border-color: #000;
    --text-color: #121212;
    --text-secondary-color: #232D3F;
    --transition-duration: 0.3s;

    /* App top header bar — light chrome (QA 2026-06-05: light and dark must read
       as distinct themes). Ivory→pale-slate gradient; navy text. The dark theme
       keeps its navy/slate slab. */
    --app-header-bg: linear-gradient(to bottom, #f0f4f9 0%, #e2e8f1 100%);
    --app-header-text: #1b2a4a;
    --app-header-muted: #51607a;
    --app-header-border: #c8d3e2;

    /* Brand gold — the third brand colour (2026-08-19). It carries "CRM" in the logo
       and every active/highlight state in the app. Two values, because #e0b54a measures
       1.93:1 on white: light grounds get the deeper one, dark grounds the bright one.
       Pick by the surface behind the element, not by the theme name. */
    --bb-gold: #a87c1b;
    --bb-gold-soft: rgba(168, 124, 27, 0.14);
    --app-accent: #a87c1b;
    --app-accent-soft: rgba(168, 124, 27, 0.14);

    /* Some surfaces are dark in BOTH themes — the login panel, the portal-assistance
       page, the merchant promo card. They always need the bright gold, so they must
       not follow --bb-gold. Same value in both blocks, on purpose. */
    --bb-gold-on-dark: #e0b54a;
    --bb-gold-on-dark-soft: rgba(224, 181, 74, 0.16);

    /* Page title bar */
    --titlebar-bg: linear-gradient(to bottom, #ffffff 0%, #f9fbfd 100%);
    --titlebar-border: #e1e8ed;
    --titlebar-title: #1E293B;
    --titlebar-pill-bg: #f3f4f6;
    --titlebar-pill-border: #dee2e6;

    /* Field caption (value uses default text color). Synced with the dashboard
       card-label color (--bb-kpi-label) so every caption reads the same app-wide. */
    --field-label: #345f8a;

    /* Semantic status palette (accent + soft background), shared app-wide */
    --bb-ok: #1f9d57;       --bb-ok-bg: #e7f6ed;
    /* Warn is orange, not gold: gold now belongs to the brand, and the old #b8860b sat
       1 degree of hue from --bb-gold, so "careful" and "brand" looked identical. */
    --bb-warn: #c2410c;     --bb-warn-bg: #fdf0e7;   --bb-warn-bd: #f6c9a8;
    --bb-danger: #d6453d;   --bb-danger-bg: #fbe7e6;
    --bb-info: #1f6fb2;     --bb-info-bg: #e6f0f8;

    /* Card headline (member/family card name) — the brightest thing on its card. */
    --bb-card-title: #355681;
    /* Quiet glyph text, e.g. a birthday that is this month but not today. */
    --bb-quiet: #94a3b8;
}

/* ---------- Dark ---------- */
[data-bs-theme="dark"] {
    --background-color: #121212;
    --box-bg-color: #282828;
    --box-border-color: rgba(255, 255, 255, 0.2);
    --text-color: #ffffff;
    --text-secondary-color: #03DAC6;

    /* App top header bar — a slate surface a step lighter than the
       #121212 body, so the bar reads as an elevated layer with contrast
       rather than black-on-black. */
    --app-header-bg: linear-gradient(135deg, #2a2f3e 0%, #232d3f 100%);
    --app-header-text: #ffffff;
    --app-header-muted: #aeb7c6;
    --app-header-border: rgba(255, 255, 255, 0.08);

    /* Page title bar */
    --titlebar-bg: linear-gradient(to bottom, #202020 0%, #1a1a1a 100%);
    --titlebar-border: rgba(255, 255, 255, 0.10);
    --titlebar-title: #f1f3f5;
    --titlebar-pill-bg: rgba(255, 255, 255, 0.06);
    --titlebar-pill-border: rgba(255, 255, 255, 0.14);

    /* Field caption — synced with dashboard --bb-kpi-label (near-white blue) */
    --field-label: #cfe0f5;

    /* Brand gold on dark grounds — the bright value, which reads 9.46:1 here.
       --app-accent had no dark definition at all before this, so var(--app-accent)
       was resolving to nothing in dark mode and the rail's gold bar fell back to
       the text colour. */
    --bb-gold: #e0b54a;
    --bb-gold-soft: rgba(224, 181, 74, 0.16);
    --app-accent: #e0b54a;
    --app-accent-soft: rgba(224, 181, 74, 0.16);

    /* Always-dark surfaces — same value as the light block by design. */
    --bb-gold-on-dark: #e0b54a;
    --bb-gold-on-dark-soft: rgba(224, 181, 74, 0.16);

    /* Semantic status palette (dark) */
    --bb-ok: #37d07f;       --bb-ok-bg: rgba(55, 208, 127, 0.12);
    /* Warn is orange here too — it was the SAME hex as the accent above. */
    --bb-warn: #e8883c;     --bb-warn-bg: rgba(232, 136, 60, 0.13);  --bb-warn-bd: rgba(232, 136, 60, 0.42);
    --bb-danger: #ef6a62;   --bb-danger-bg: rgba(239, 106, 98, 0.12);
    --bb-info: #5aa9e6;     --bb-info-bg: rgba(90, 169, 230, 0.12);

    /* Near-white, not pure white — a bold #fff headline glares on the dark card. */
    --bb-card-title: #f1f3f5;
    --bb-quiet: #6b7689;
}

/* Dark-mode icon legibility: most FA SVG icons are baked at neutral #5a5a5a for light
   themes, so neutral glyphs (list-check, upload, refresh, search, print…) nearly vanish
   on dark toolbars/buttons. Brighten icon images in dark mode — brightness() preserves
   hue, so colored icons (trash red, edit green…) stay their color while neutral grays
   become readable. Applies to <img>-rendered icons only; mask / FA <i> icons already
   follow currentColor and are untouched. */
[data-bs-theme="dark"] img[src*="/Images/Icons/"] {
    filter: brightness(1.9);
}

/* The row lock is a state marker, not an action glyph — it must sit below the cell
   text. The brightness boost above blows its neutral fill out to white, so exempt it
   and fade it per theme. Must stay after that rule: equal specificity in dark. */
img[src*="RowLocked"] {
    filter: none;
    opacity: .55;
}

[data-bs-theme="dark"] img[src*="RowLocked"] {
    filter: brightness(1.35);
    opacity: .7;
}

/* Dark-mode grid legibility: DX renders data-cell text pure white, so bold names/titles
   glare against the dark rows. Soften cell text to a calm off-white for a professional,
   easy-to-read grid. Applies to every ASPxGridView (class-suffix-independent); column
   headers keep their DX theme styling, and inline cell colors (status greens, badges)
   win via their own inline style. */
[data-bs-theme="dark"] [class*="dxgvDataCell"] {
    color: #dfe3ea !important;
}

/* Tame heavy bold in grid data cells (member names, class titles, etc.) to a medium
   weight across ALL grids — bold + bright reads as glare. Targets inline font-weight:bold
   / <b> / <strong> inside data cells; normal text, footer/summary, and header cells are
   untouched. */
[class*="dxgvDataCell"] [style*="bold"],
[class*="dxgvDataCell"] b,
[class*="dxgvDataCell"] strong {
    font-weight: 500 !important;
}

/* Headings had no colour rule at all, so they kept the browser default and went near-black
   on the dark theme. Pages that colour their own headings (e.g. .bb-msum__name) still win. */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-color);
}

/* Headings are bold, so pure white glares in dark. Same softening as .bb-total. */
[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5,
[data-bs-theme="dark"] h6 {
    color: #c9d1db;
}

/* Focused/selected grid row: soft theme tint, row icons stay legible.
   [class*=] matches both _Office365 (light) and _Office365Dark (dark) suffixes. */
[class*="dxgvFocusedRow"],
[class*="dxgvFocusedRow"] td,
[class*="dxgvSelectedRow"],
[class*="dxgvSelectedRow"] td,
.bb-row-hl,
.bb-row-hl td {
    background-color: var(--bb-info-bg) !important;
    color: var(--text-color) !important;
}

/* Emphasis/total text: soften in dark so bold isn't pure-white glare (halation). */
[data-bs-theme="dark"] .bb-total,
[data-bs-theme="dark"] .bb-total [class*="dxeBase"],
[data-bs-theme="dark"] .bb-total span { color: #c9d1db !important; }

/* =====================================================================
   App top header bar
   .app-topbar is the full-width bar surface; it adapts per theme
   (navy in light, slate in dark). Layout/box-model of the inner blocks
   (.SchoolInfo / .Darkbox / .DivLogOut) stays with the master that owns
   them — only their theme colors live here.
   ===================================================================== */
.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 20px;
    background: var(--app-header-bg);
    color: var(--app-header-text);
}

/* =====================================================================
   Merge the top bar + left rail into ONE seamless navy "L" chrome:
   de-float both panels (no rounding / margin / shadow) so they hug the
   viewport edges and meet flush at the top-left corner. FIRST CUT — the
   exact rounding source may need a tighter selector after a screenshot.
   ===================================================================== */
.app-topbar-panel {
    background: var(--app-header-bg) !important;   /* kill the white panel box around the navy bar */
    border-radius: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}
.app-topbar-panel * {
    background-color: transparent !important;
}
/* preserve the subtle chips on the navy bar (these beat the * reset above) */
.app-topbar-panel .app-school-badge {
    background-color: rgba(255, 255, 255, 0.10) !important;
}
.app-topbar-panel .bb-theme-toggle:hover {
    background-color: rgba(127, 127, 127, 0.15) !important;
}
.app-topbar-panel .bb-testmode {
    background-color: var(--bb-warn-bg) !important;
}

/* Same override as .bb-testmode above: the DX header panel resets child backgrounds,
   so without !important the support strip renders fully transparent. */
.app-topbar-panel .bb-supportmode {
    background-color: var(--bb-danger-bg) !important;
}
.app-rail,
.app-rail > div {
    border-radius: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
}

/* The DX panel gives the rail its own scroll box. When the nav is a little taller than that
   box it becomes a nested scroller that swallows the first wheel gesture — the pointer is
   usually right there after clicking a nav item, so the page appears frozen and users reach
   for Tab instead (QA, member setup, 2026-07-29). Let the rail size to its content and scroll
   with the PAGE: one scroll region, no gesture goes missing. */
.app-rail .dxpnl-acc,
.app-rail .dxpnl-scc {
    height: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
}

/* --- School identity block --- */
.app-school {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.app-school-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid var(--app-header-border);
    font-size: 22px;
    color: var(--app-header-text);
}

.app-school-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.app-school-name {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--app-header-text);
}

.app-school-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.app-school-line {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--app-header-muted);
}

.app-school-line .dx-label {
    color: var(--app-header-muted);
}

.app-school-line i {
    width: 14px;
    text-align: center;
    opacity: .8;
}

/* --- Action buttons cluster --- */
.app-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.app-actions-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

/* Clock line beneath the action buttons. */
.app-topbar-clock {
    color: var(--app-header-muted);
    font-size: x-small;
}

/* Top-bar block layout (lifted out of App.Master's inline <style>). */
.SchoolInfo,
.Darkbox {
    min-width: 350px;
    padding: 10px 20px;
    border-radius: 15px;
    display: table;
    table-layout: fixed;
}

.SchoolInfo {
    box-shadow: inset 0 0 10px #000;
}

.DivLogOut {
    position: absolute;
    bottom: 10px;
    right: 10px;
}

/* School-info block. Used standalone on SchoolInfo.aspx too, hence its own
   themed background; on the top bar it sits flush with the .app-topbar. */
.Darkbox {
    margin-top: 10px;
    background: var(--app-header-bg);
    color: var(--app-header-text);
}

.Darkbox table {
    width: 100%;
    border-collapse: collapse;
}

.Darkbox .dx-label {
    font-weight: 600;
    font-size: 16px; /* banner-like emphasis */
    color: var(--app-header-text);
}

/* =====================================================================
   Theme toggle — icon-only top-bar control
   currentColor on the button means the FA glyph tints to the header text
   color automatically (theme-ready, no baked fills). Shows the icon for
   the mode you'll switch TO: moon in light mode, sun-bright in dark mode.
   ===================================================================== */
.bb-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 31px; /* match Bootstrap btn-sm height of the neighbouring header buttons */
    padding: 0 8px;
    border: 1px solid var(--app-header-border);
    border-radius: 6px;
    background: transparent;
    color: var(--app-header-text); /* tracks the header text color in both modes */
    cursor: pointer;
    line-height: 1;
    white-space: nowrap;
    transition: background-color var(--transition-duration, .2s) ease, border-color .2s ease, color .2s ease;
}

.bb-theme-toggle:hover,
.bb-theme-toggle:focus-visible {
    background: rgba(127, 127, 127, 0.15);
    border-color: var(--app-header-text);
    color: var(--app-header-text);
    outline: none;
}

.bb-theme-toggle .fa-sharp,
.bb-theme-toggle svg {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Surface variant — for the toggle placed on a neutral/light panel (member-portal
   action row) instead of the navy top bar. Tints to the page text color so it stays
   legible in both modes. Must follow the base block to win on equal specificity. */
.bb-theme-toggle--surface {
    color: var(--text-color);
    border-color: var(--box-border-color);
}
.bb-theme-toggle--surface:hover,
.bb-theme-toggle--surface:focus-visible {
    background: rgba(127, 127, 127, 0.15);
    border-color: var(--text-color);
}

/* Support chip — deep cerulean, distinct from the green action chips and
   strong enough on the light header (Bootstrap outline-info cyan is too weak). */
.bb-chip-support {
    --bs-btn-color: #0a6486;
    --bs-btn-border-color: #0a6486;
    --bs-btn-hover-bg: #0a6486;
    --bs-btn-hover-color: #ffffff;
    --bs-btn-hover-border-color: #0a6486;
    --bs-btn-active-bg: #084f6a;
    --bs-btn-active-color: #ffffff;
    --bs-btn-active-border-color: #084f6a;
}
[data-bs-theme="dark"] .bb-chip-support {
    --bs-btn-color: #7cc5ea;
    --bs-btn-border-color: #7cc5ea;
    --bs-btn-hover-bg: rgba(124, 197, 234, 0.15);
    --bs-btn-hover-color: #a5d8f0;
    --bs-btn-hover-border-color: #a5d8f0;
    --bs-btn-active-bg: rgba(124, 197, 234, 0.25);
    --bs-btn-active-color: #c2e4f5;
    --bs-btn-active-border-color: #c2e4f5;
}

/* Mode-aware icon visibility: light shows the moon (go dark),
   dark shows the sun (go light). */
.bb-theme-toggle .bb-icon-dark { display: none; }
[data-bs-theme="dark"] .bb-theme-toggle .bb-icon-light { display: none; }
[data-bs-theme="dark"] .bb-theme-toggle .bb-icon-dark { display: inline-flex; }

/* =====================================================================
   Login card dark adaptation (replaces the old ThemeModel "BoxShadow"
   class swap). The .Box-Shadow card is white in light mode; in dark mode
   it takes the elevated dark surface.
   ===================================================================== */
[data-bs-theme="dark"] .Box-Shadow {
    background-color: #383838;
    color: #fff;
}

/* Social-media input wrapper — match the form's dark input fields (was a lighter
   #383838 surface that looked gray next to the darker form inputs). */
[data-bs-theme="dark"] .bbcrm-social-input {
    background: var(--form-input-bg);
    border-color: var(--form-input-border);
}

/* White form/container surfaces — dark in dark mode (light base in Site.css) */
[data-bs-theme="dark"] .Box-Reg-white {
    background-color: #383838 !important;
    color: var(--text-color);
}

[data-bs-theme="dark"] .filter-toolbar {
    background-color: #383838;
    border-color: var(--box-border-color);
}

/* Page title bar colors (layout in Site.css) */
.PageTopPanel {
    background: var(--titlebar-bg);
    border-bottom: 1px solid var(--titlebar-border);
}

.Page_Title {
    color: var(--titlebar-title);
}

/* Action-toolbar pill on the right side of the bar */
.PageTopPanel .headerMenu,
.PageTopPanel .justify-content-end > .row > .col,
.PageTopPanel .justify-content-end > .row > [class*="col-"] {
    background-color: var(--titlebar-pill-bg);
    border: 1px solid var(--titlebar-pill-border);
}

/* Help "?" icon tints to the title color (currentColor drives the masked SVG) */
.PageTopPanel .headerHelpMenu .dxm-content {
    color: var(--titlebar-title);
}

/* Field captions, muted (value keeps default color so links stay linked).
   .TableHeader = legacy alias, retire as pages move to .bb-field-label. */
.bb-field-label,
.bb-field-label span,
.TableHeader,
.TableHeader span,
.TableHeader a {
    color: var(--field-label) !important;
    font-weight: 500 !important;
}

/* DX ASPxFormLayout captions (e.g. MemberDetail summary) — muted, theme-suffix-independent */
[class*="dxflCaption"] {
    color: var(--field-label) !important;
    font-weight: 500 !important;
}

/* Birthday-month marker (grid header + row) */
.bb-cake-icon {
    font-size: 16px;
    color: var(--app-accent);
}

/* Birthday marker in a grid row. Today is a filled badge you can spot while scrolling;
   the rest of the month is deliberately quiet so it never competes with it. The day
   number is printed rather than hidden in a tooltip — these grids run on iPads, where
   hover never fires. Shared by the attendance roster and the member list. */
.bb-bday {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: .8rem;
    line-height: 1;
    white-space: nowrap;
}

.bb-bday__day {
    font-size: .75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.bb-bday--today {
    background: var(--bb-warn-bg);
    color: var(--bb-warn);
    box-shadow: inset 0 0 0 1px var(--bb-warn-bd);
}

.bb-bday--month {
    color: var(--bb-quiet);
}

/* DX ASPxPageControl renders as display:table and shrink-to-fits to its widest tab, so one
   wide grid stretched the whole page — the page grew past the window and its vertical
   scrollbar went out of reach. table-layout:fixed makes the tab honour its column width
   instead; the content then scrolls inside the tab. Applies to every tabbed screen. */
.dxtc-pc,
.dxtc-pc .dxtc-content > div {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
}

.dxtc-pc .dxtc-content {
    width: 100%;
    max-width: 100%;
}

/* Wide grid inside a narrow screen: the grid stays inside the viewport and its own content
   scrolls sideways. Needs an ancestor with a real width — see the tab clamp above. */
.bb-grid-scroll {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

/* Email preview before sending. The letter renders in its own iframe so its styles
   cannot reach the app around it. */
.bb-mailprev__meta {
    padding: 0 0 12px 0;
    border-bottom: 1px solid var(--box-border-color);
    margin-bottom: 12px;
}

.bb-mailprev__frame {
    height: 46vh;
    min-height: 280px;
    border: 1px solid var(--box-border-color);
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
}

.bb-mailprev__frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.bb-mailprev__actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    /* Clear of the letter — Send sat hard against the last line of the document. */
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--box-border-color);
}

/* Grid boolean pair. State is carried by SHAPE as well as colour — a green-vs-grey
   dot alone fails for colourblind users, and rendering nothing for false makes an
   empty cell read as missing data. */
.bb-yes-icon {
    font-size: 16px;
    color: #28a745;
}

.bb-no-icon {
    font-size: 16px;
    color: #adb5bd;
}

/* Third grid state: a failure. Uses the theme danger token so it tracks light/dark. */
.bb-danger-icon {
    font-size: 16px;
    color: var(--bb-danger);
}

[data-bs-theme="dark"] .bb-no-icon {
    color: #6b7689;
}

/* =====================================================================
   App left rail (ASPxNavBar) — branded dark surface + gold active accent.
   FIRST CUT: selectors combine our CssClasses (app-rail / app-nav /
   appnav-item) with DevExpress's confirmed dxnb-* classes; expect a
   screenshot pass to refine the exact DX selectors. FA icons = Phase 2.
   ===================================================================== */
.app-rail,
.app-nav {
    background: var(--app-header-bg) !important;
    border: 0 !important;
}

/* Clear every inner background (incl. the DX expanded-group content panel) so the
   dark rail shows through. Active/hover rules below are more specific and override this. */
.app-rail *,
.app-nav * {
    background-color: transparent !important;
}

/* Group headers — muted uppercase Sora */
.app-nav .dxnb-header,
.app-nav .dxnb-headerCollapsed {
    background: transparent !important;
    color: var(--app-header-muted) !important;
    font-family: 'Sora', 'Hanken Grotesk', sans-serif !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.72rem !important;
    font-weight: 600;
    border-color: var(--app-header-border) !important;
    padding-top: 9px !important;
    padding-bottom: 9px !important;
    margin-top: 4px;
}

/* Items — light Hanken labels on the dark rail, sitting in a slightly darker
   "well" so an expanded group's items visibly recede below its header.
   The well goes on the ROW only; the inner <a> stays transparent so it doesn't
   double-darken. (URL items have an <a>, postback items like Cashier don't —
   applying the well to both made them render as different tones.) */
.app-nav .appnav-item,
.app-nav .dxnb-item {
    background-color: rgba(0, 0, 0, 0.28) !important;
    color: var(--app-header-text) !important;
    font-family: 'Hanken Grotesk', sans-serif !important;
    border-color: var(--app-header-border) !important;
}
.app-nav .dxnb-item a,
.app-nav .appnav-item a {
    background-color: transparent !important;
    color: var(--app-header-text) !important;
    font-family: 'Hanken Grotesk', sans-serif !important;
}

.app-nav .dxnb-item a:hover,
.app-nav .appnav-item:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

/* Disabled items (ClientEnabled=false) — read as clearly inert: dimmed, no hover
   highlight, not-allowed cursor. [class*="isabled"] matches DX's disabled class
   across theme suffixes (dxnb-disabled / dxnbItemDisabled_Office365…) and never
   matches "Enabled". */
.app-nav [class*="isabled"],
.app-nav [class*="isabled"] a,
.app-nav [class*="isabled"] img {
    opacity: .38 !important;
    cursor: not-allowed !important;
}
.app-nav [class*="isabled"]:hover,
.app-nav [class*="isabled"] a:hover {
    background: transparent !important;
}

/* ~40px finger tap target; .dxnb-link covers url + postback items */
.app-nav .dxnb-item.dxnb-link,
.app-nav .dxnb-item .dxnb-link {
    padding-top: 11px !important;
    padding-bottom: 11px !important;
}

/* Active item — crisp WHITE label, subtle raised background, gold left accent bar
   (gold as accent, not the text color — legible + refined). */
.app-nav .appnav-item-active,
.app-nav .appnav-item-active a,
.app-nav .dxnb-selected,
.app-nav .dxnb-selected a {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--app-header-text) !important;
    border-left: 3px solid var(--app-accent) !important;
    font-weight: 600 !important;
}

/* FA Sharp Regular item icons — set via NavBarItem.Image.Url in code-behind (baked white). */
.app-nav .dxnb-item img {
    width: 18px !important;
    height: 18px !important;
    margin-right: 0.55rem;
    vertical-align: middle;
    opacity: 0.9;
}
.app-nav .appnav-item-active img,
.app-nav .dxnb-selected img {
    opacity: 1;
}

/* Group-header icons (set via NavBarGroup.Image.Url) — smaller + muted, so the
   section headers read as quiet dividers while the white item icons pop.
   :not([class*="dxnb-btn"]) excludes the DX expand/collapse chevron sprite — sizing
   that one was squishing it into a stray "'" mark. */
.app-nav .dxnb-header img:not([class*="dxnb-btn"]),
.app-nav .dxnb-headerCollapsed img:not([class*="dxnb-btn"]) {
    width: 16px !important;
    height: 16px !important;
    margin-right: 0.5rem;
    vertical-align: middle;
    opacity: 0.55;
}

/* ---------- Light-mode chrome (QA: light & dark must be DISTINCT themes) ----------
   Header + rail share one pale-slate surface (seamless L union, like dark's navy L).
   White item wells, navy text; active item = white card + gold left bar (same accent
   language as dark). Baked-white nav icon SVGs are darkened via invert. */
[data-bs-theme="light"] .app-rail,
[data-bs-theme="light"] .app-nav {
    background: #e2e8f1 !important;
    border-right: 1px solid #c8d3e2 !important;
}

[data-bs-theme="light"] .app-nav .appnav-item,
[data-bs-theme="light"] .app-nav .dxnb-item {
    background-color: rgba(255, 255, 255, 0.55) !important;
    color: #24344f !important;
}

[data-bs-theme="light"] .app-nav .dxnb-item a,
[data-bs-theme="light"] .app-nav .appnav-item a {
    color: #24344f !important;
}

[data-bs-theme="light"] .app-nav .dxnb-header,
[data-bs-theme="light"] .app-nav .dxnb-headerCollapsed {
    color: #44567a !important;
    border-color: #c8d3e2 !important;
}

[data-bs-theme="light"] .app-nav .dxnb-item a:hover,
[data-bs-theme="light"] .app-nav .appnav-item:hover {
    background: rgba(255, 255, 255, 0.92) !important;
}

[data-bs-theme="light"] .app-nav .appnav-item-active,
[data-bs-theme="light"] .app-nav .appnav-item-active a,
[data-bs-theme="light"] .app-nav .dxnb-selected,
[data-bs-theme="light"] .app-nav .dxnb-selected a {
    background: #ffffff !important;
    color: #1b2a4a !important;
    border-left: 3px solid var(--app-accent) !important;
    box-shadow: 0 1px 5px rgba(16, 24, 40, 0.16);
    font-weight: 600 !important;
}

[data-bs-theme="light"] .app-nav img {
    filter: invert(0.72);
}

/* Dialogs in light: layered (tinted shell + banded header/footer), not flat white. */
[data-bs-theme="light"] .bbcrm-dialog,
[data-bs-theme="light"] .bbcrm-form-dialog {
    --dlg-surface: #fafbfd;
    --dlg-border: rgba(16, 24, 40, 0.16);
}

[data-bs-theme="light"] .bbcrm-form-dialog__header,
[data-bs-theme="light"] .bbcrm-form-dialog__footer,
[data-bs-theme="light"] .bbcrm-dialog__footer {
    background: #eaf0f7;
}

/* Left rail scrollbar — slim + unobtrusive (the default chunky bar reads as a
   second page scrollbar). */
.app-rail ::-webkit-scrollbar,
.app-rail::-webkit-scrollbar {
    width: 8px;
}

.app-rail ::-webkit-scrollbar-thumb,
.app-rail::-webkit-scrollbar-thumb {
    background: rgba(127, 140, 160, 0.45);
    border-radius: 4px;
}

.app-rail ::-webkit-scrollbar-track,
.app-rail::-webkit-scrollbar-track {
    background: transparent;
}

/* Light grid toolbars: kill DX's per-item boxes (1px #dfdfdf borders) — flat items
   with a soft hover tint, matching the dark theme's flat toolbar look. */
[data-bs-theme="light"] .dxmtb .dxm-item {
    border-color: transparent !important;
    background: transparent !important;
}

[data-bs-theme="light"] .dxmtb .dxm-item:hover {
    background: rgba(27, 42, 74, 0.07) !important;
    border-radius: 6px;
}

/* Light grids: DX's focused-row tint is too faint — deepen it so the current row
   clearly reads. Selection/hover keep their own DX styling. */
[data-bs-theme="light"] tr[class*="FocusedRow"]:not([class*="SelectedRow"]) > td {
    background-color: #cdd9ec !important;
}

/* Dark grids: DX's Office365Dark alternating-row tint is nearly invisible — darken
   alt rows so banding actually reads. Focused/selected/hot-tracked rows keep their
   DX highlight (excluded from the selector). */
[data-bs-theme="dark"] tr[class*="DataRowAlt"]:not([class*="FocusedRow"]):not([class*="SelectedRow"]):not([class*="RowHover"]) > td:not(.bb-row-danger):not(.bb-row-success):not(.bb-row-warning):not(.bb-row-muted) {
    background-color: rgba(0, 0, 0, 0.24) !important;
}

/* Semantic fill cells band on alt rows too — deepen their tint so the alternation
   reads in the colored (bb-row-*) columns, not just the plain cells above. */
[data-bs-theme="dark"] tr[class*="DataRowAlt"]:not([class*="FocusedRow"]):not([class*="SelectedRow"]):not([class*="RowHover"]) > td.bb-row-danger {
    background-color: rgba(220, 53, 69, 0.30) !important;
}
[data-bs-theme="dark"] tr[class*="DataRowAlt"]:not([class*="FocusedRow"]):not([class*="SelectedRow"]):not([class*="RowHover"]) > td.bb-row-success {
    background-color: rgba(47, 158, 111, 0.28) !important;
}

/* Placeholder text (DX NullText) reads as a hint, not typed input — muted +
   italic everywhere. Scoped to text/combo/memo editors so grid cells are
   unaffected. */
[class*="dxeNullText"] input,
[class*="dxeNullText"] textarea {
    font-style: italic !important;
    opacity: 0.7 !important;
}

/* Required-field labels — ONE universal muted red for the whole app. Reads on
   both light and dark surfaces without glaring/bleeding on the dark theme.
   No asterisk. !important so it beats the .bb-form caption label color and the
   older Site.css full-saturation red. */
.TableHeaderRequired,
.RequiredField {
    color: #cf6f68 !important;
}

/* Invalid-field state — theme-aware (overrides Site.css's fixed pink and DX's default
   invalid pink). The old rules colored only the wrapper element, so DX's inner input
   kept its dark-mode white text → white-on-pink. Tint the surface with the semantic
   danger pair and force the INNER editor text to the danger accent in both themes. */
.validation-error,
.ErrorCss,
[class*="dxeInvalid"] {
    background-color: var(--bb-danger-bg) !important;
    border: 1px solid var(--bb-danger) !important;
    color: var(--bb-danger) !important;
}

[data-bs-theme="dark"] .validation-error,
[data-bs-theme="dark"] .ErrorCss,
[data-bs-theme="dark"] [class*="dxeInvalid"] {
    border-color: rgba(239, 106, 98, 0.55) !important;
}

.validation-error input,
.validation-error textarea,
.validation-error .dxeEditArea,
.ErrorCss input,
.ErrorCss textarea,
.ErrorCss .dxeEditArea,
[class*="dxeInvalid"] input,
[class*="dxeInvalid"] textarea,
[class*="dxeInvalid"] .dxeEditArea {
    background-color: transparent !important;
    color: var(--bb-danger) !important;
}

.validation-error input::placeholder,
.ErrorCss input::placeholder,
[class*="dxeInvalid"] input::placeholder {
    color: var(--bb-danger) !important;
    opacity: 0.55;
}

/* Editable-cell highlight for grid columns the user is meant to type into
   (replaces baked light-yellow CellStyle BackColors that glare in dark mode). */
td.bb-cell-editable {
    background-color: var(--bb-warn-bg) !important;
}

/* DX loading panels — replace the flat gray DX box with a floating card: surface
   bg, rounded, soft shadow. Suffix-independent ([class*="LoadingPanel_"]) so it
   covers EVERY DX control's panel (dxlp standalone, dxgv grid, dxpc/dxcp callback
   panels...) in Office365 and Office365Dark alike. */
table[class*="LoadingPanel_"] {
    background: #ffffff !important;
    border: 1px solid rgba(16, 24, 40, 0.10) !important;
    border-radius: 12px !important;
    border-collapse: separate !important; /* collapse ignores border-radius → square outline */
    box-shadow: 0 10px 30px rgba(16, 24, 40, 0.22) !important;
}

table[class*="LoadingPanel_"] td.dx {
    background: transparent !important;
    border: none !important;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
}

table[class*="LoadingPanel_"] td.dx:first-child { padding-left: 18px !important; }
table[class*="LoadingPanel_"] td.dx:last-child  { padding-right: 18px !important; }

table[class*="LoadingPanel_"] span {
    color: #1c2533 !important;
    font-family: 'Hanken Grotesk', 'Lato', sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

[data-bs-theme="dark"] table[class*="LoadingPanel_"] {
    background: #232d3f !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55) !important;
}

[data-bs-theme="dark"] table[class*="LoadingPanel_"] span {
    color: #c9d1db !important;
}

/* Modal backdrop behind the loading pill — paints NO color of its own (a flat
   tint clashes with whatever surface it covers, e.g. black over the navy login
   panel). Instead blur+dim the content underneath using its own colors, so the
   veil always matches the local background. Clicks stay blocked either way. */
div[class*="LoadingDiv_"] {
    background: rgba(0, 0, 0, 0.30) !important; /* fallback when backdrop-filter unsupported */
    opacity: 1 !important;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    div[class*="LoadingDiv_"] {
        background: transparent !important;
        backdrop-filter: blur(9px) brightness(0.55) saturate(0.5);
        -webkit-backdrop-filter: blur(9px) brightness(0.55) saturate(0.5);
    }
}

/* Theme toggle label next to the sun/moon icon (button gap handles spacing).
   Typography matches the neighbouring btn-sm header buttons. */
.bb-theme-toggle .bb-theme-toggle__lbl {
    font-size: 14px;
    font-weight: 400;
}

/* Grid headers read as headers, not data rows */
[class*="dxgvHeader_"] {
    background: #dfe7f2;
    color: #2b3a55;
    font-weight: 600;
}

[data-bs-theme="dark"] [class*="dxgvHeader_"] {
    background: #2a3550;
    color: #c9d1db;
}

/* Keep a gap between the header caption and the filter funnel — right-aligned
   headers otherwise push the title flush against the filter icon. */
[class*="dxgvHeader_"] td.dx-ellipsis {
    padding-right: 8px;
}

/* Grid toolbars sit in a contained bar instead of floating over the page */
[class*="dxctToolbar_"] {
    background: #f4f7fb !important;
    border: 1px solid #e3e9f2 !important;
    border-radius: 8px 8px 0 0;
    padding: 5px 10px !important;
}

[class*="dxctToolbar_"].dxgvCTBottom {
    border-radius: 0 0 8px 8px;
}

/* One row, one height: search boxes and combos in a grid toolbar share the button
   system's 34px touch target instead of 42px (Height="100%") next to a 29px combo. */
[class*="dxctToolbar_"] .dxm-item table.dxeButtonEditSys {
    /* Beats the inline height="100%" the toolbar-search markup still carries. */
    height: 34px !important;
}

[data-bs-theme="dark"] [class*="dxctToolbar_"] {
    background: #232b3d !important;
    border-color: rgba(255, 255, 255, 0.07) !important;
}

/* Toolbar items carrying a deliberate action colour. The light flattening rule above
   forces `background: transparent !important`, which beats an inline BackColor while an
   inline white ForeColor survives — leaving white text on a white toolbar. Must stay
   after that rule: same specificity, so source order decides. */
[data-bs-theme] .dxmtb .dxm-item.bb-tb-action-ok {
    background: var(--bb-ok) !important;
    border-color: var(--bb-ok) !important;
}

[data-bs-theme] .dxmtb .dxm-item.bb-tb-action-danger {
    background: var(--bb-danger) !important;
    border-color: var(--bb-danger) !important;
}

[data-bs-theme] .dxmtb .dxm-item[class*="bb-tb-action-"],
[data-bs-theme] .dxmtb .dxm-item[class*="bb-tb-action-"] .dxm-content,
[data-bs-theme] .dxmtb .dxm-item[class*="bb-tb-action-"] .dxm-contentText {
    color: #fff !important;
}

/* Page content columns: pair with col-12 so grids hold their designed width and only
   shrink when the viewport runs out of room (percentage cols shrank them needlessly). */
.bb-col-md {
    max-width: 850px;
}

.bb-col-lg {
    max-width: 1100px;
}

.bb-col-xl {
    max-width: 1400px;
}

/* Language selector (globe + EN/Español) — appearance only, no positioning, so each host
   anchors it where its own layout wants. signup.css positions it absolute top-right on the
   signup container; login.css right-aligns it in the card's measure. */
.bb-lang {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: .82rem;
}

/* Match BOTH the authored <i> and the <svg> Font Awesome's JS replaces it with — an
   `> i` selector alone stops matching after the swap and the glyph renders near-black. */
.bb-lang > i,
.bb-lang > svg {
    color: var(--field-label);
    fill: currentColor;
    font-size: .9rem;
}

.bb-lang__opt {
    color: var(--field-label);
    text-decoration: none;
    transition: color .15s ease;
}

.bb-lang__opt:hover,
.bb-lang__opt:focus-visible {
    color: var(--text-color);
}

.bb-lang__opt.is-active {
    color: var(--text-color);
    font-weight: 700;
}

.bb-lang__sep {
    color: var(--field-label);
    opacity: .5;
}

/* Non-production environment badge (UserControls/ucTestModeBadge.ascx). Fixed so it never
   reflows a page; pointer-events:none so it can never block a click. z-index sits above
   Bootstrap's fixed layer but well below DevExpress popups (~10000) so it can't cover a dialog. */
.bb-testmode {
    position: fixed;
    bottom: 12px;
    left: 12px;
    z-index: 1080;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border: 1px solid var(--bb-warn);
    border-radius: 999px;
    background: var(--bb-warn-bg);
    color: var(--bb-warn);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .02em;
    line-height: 1.4;
}

.bb-testmode__ver {
    opacity: .75;
    font-weight: 400;
}

/* --- Corp support mode -------------------------------------------------------
   Shown only while a corp employee is working inside a CUSTOMER'S live account.
   Sits inside the fixed header panel so it pins with the header and is never
   scrolled away.

   Uses --bb-danger, not --bb-warn: amber already belongs to the TEST MODE badge,
   and on TEST both render at once — two amber strips read as one message, losing
   the distinction exactly where it is exercised most.

   "Support mode" is the loudest element. The school identity is NOT repeated here:
   the app header sits directly below showing the location name, address and phone
   in larger type, so echoing it wasted the one line that had to carry the thing
   which appears nowhere else on the page. */
.bb-supportmode {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 16px;
    padding: 8px 16px;
    background: var(--bb-danger-bg);
    border-bottom: 3px solid var(--bb-danger);
    color: var(--bb-danger);
}

.bb-supportmode__who {
    display: flex;
    align-items: baseline;
    gap: 12px;
    min-width: 0;
}

.bb-supportmode__label {
    flex: none;
    font-size: 1.05rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .1em;
    white-space: nowrap;
}

.bb-supportmode__label i {
    margin-right: 6px;
}

/* Secondary: which business. Truncates rather than wrapping, so a long name can
   never push the exit control off the strip. */
.bb-supportmode__acct {
    font-size: .85rem;
    font-weight: 600;
    opacity: .9;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bb-supportmode__exit {
    flex: none;
}

/* iPad and narrower: stack, and let the name use the full width before it clips. */
@media (max-width: 820px) {
    .bb-supportmode {
        align-items: flex-start;
        flex-direction: column;
    }

    .bb-supportmode__who {
        max-width: 100%;
    }

    /* Header eats the screen on a tablet: the address/phone lines plus a wrapping button row
       push the content below the fold. Drop the detail, shrink the name and tighten the buttons. */
    .app-school-meta {
        display: none;
    }

    .app-school-name {
        font-size: .95rem;
    }

    .app-school-badge {
        display: none;
    }

    .app-topbar {
        gap: 6px;
        padding: 4px 8px;
    }

    .app-actions-row {
        gap: 4px;
    }

    .app-actions-row .btn {
        padding: 2px 8px;
        font-size: .78rem;
    }

    .app-topbar-clock {
        display: none;
    }
}

/* Pages with the app header: sit just under it, at the top of the nav rail, and push the
   rail down by the badge's height. Both rules key off .bb-testmode existing, so production —
   where the badge never renders — keeps its original spacing. */
/* In the app/corp header the badge sits in flow under the action buttons, so it drops the
   fixed positioning entirely. The fixed rule above is the fallback for hosts with no header
   (Root, member portal, Referrals, master-less pages). */
.app-actions .bb-testmode {
    position: static;
    align-self: flex-end;
    margin-top: 4px;
}

/* iPad and narrower: drop the version, keep icon + label. */
@media (max-width: 820px) {
    .bb-testmode__ver {
        display: none;
    }
}
