﻿/* ============================================================================
   ReyPortal color tokens - single source of truth for light/dark theming.
   Every --rp-* custom property here is referenced via var(--rp-*) across
   site.css, site_sidebar.css, checklist*.css, onboarding*.css, and
   view-embedded <style> blocks, instead of hardcoding colors in place.

   RECONSTRUCTED 2026-11-17 after this file was accidentally deleted by a
   working-copy overwrite (a teammate's pre-dark-mode branch was pulled in
   over the top of this one). Rebuilt from the original design-session notes
   (docs-database Sessions 234-241) plus values directly confirmed against
   surviving .cs/.js files that still reference these tokens by name. Faithful
   to the original design intent and confirmed token names/roles, but NOT
   guaranteed byte-identical to the deleted original - in particular the
   handful of per-selector dark-mode overrides found via real screenshots in
   Sessions 237-240 (ReyReview annotation drawer, Manage Skills question rows,
   CheckList drawer buttons, SignaturePad font picker, DataTables frozen
   columns, tree/button connector-line masks) are NOT reproduced here, since
   their exact values were never captured in a form this reconstruction could
   recover - re-find those the same way the originals were (click through the
   app in dark mode) if anything still looks wrong in those specific spots.
   ============================================================================ */

:root {
    /* ---- Pure light/dark endpoints -----------------------------------
	   --rp-white / --rp-white-keyword / --rp-black / --rp-black-keyword
	   are deliberately NOT overridden in dark mode (see the dark block
	   below) - they're used far more often as foreground text sitting on
	   a colored/dark element than as a page background, so flipping them
	   globally would break more than it fixes. Any spot where one of
	   these genuinely IS a background gets its own per-selector dark
	   override instead (see the bottom of this file). */
    --rp-white: #fff;
    --rp-white-keyword: white;
    --rp-gray-900: #000; /* also covers the #000000 spelling in site.css */
    --rp-black: var(--rp-gray-900);
    --rp-black-keyword: black;
    /* ---- Gray scale (background-dominant shades lighten in dark mode,
	   text-dominant shades darken - see the dark block for the actual
	   swap; the light values below are unchanged either way) ---------- */
    --rp-gray-050: #fafafa;
    --rp-gray-075: #f9f9f9;
    --rp-gray-100: #f5f5f5;
    --rp-gray-200: #e5e5e5;
    --rp-gray-300: #ccc; /* also covers the #cccccc spelling in site.css */
    --rp-gray-400: #b0b0b0;
    --rp-gray-575: #707070; /* dual role: AppraisalTeam associate-details section-bar background (white text on top) AND a muted label-text color in ReyReview/LeadersSearch.cshtml - was completely undefined, not just missing a dark value, so these section bars rendered as invisible white-on-white */
    --rp-gray-700: #444;
    --rp-gray-700-text: #374151; /* distinct from --rp-gray-660 below, different source palette */
    --rp-gray-800: #222;
    /* ---- Bootstrap-aliased tokens - these ride on Bootstrap 5.3.3's own
	   CSS variables (falling back to the literal if the alias is ever
	   missing), so they track Bootstrap's own light/dark values for free
	   where Bootstrap actually re-themes them. Checked against the
	   vendored bootstrap.5.3.3.min.css directly: --bs-primary/-success/
	   -warning/-danger/-secondary and the raw --bs-gray-100..800 scale are
	   STATIC across themes (not re-themed by Bootstrap itself) - only
	   --bs-border-color and the -bg-subtle family actually change. So
	   --rp-gray-210 and --rp-danger-subtle-bg get dark mode "for free";
	   every other Bootstrap-aliased token below needs its own explicit
	   dark value (see the dark block), reusing Bootstrap's own dark
	   -text-emphasis colors rather than inventing new ones. */
    --rp-primary: var(--bs-primary, #0d6efd);
    --rp-success: var(--bs-success, #198754);
    --rp-warning: var(--bs-warning, #ffc107);
    --rp-danger: var(--bs-danger, #dc3545);
    --rp-secondary: var(--bs-secondary, #6c757d);
    --rp-gray-120: var(--bs-gray-100, #f8f9fa);
    --rp-gray-210: var(--bs-border-color, #dee2e6);
    --rp-gray-420: var(--bs-gray-400, #ced4da);
    --rp-gray-540: var(--bs-gray-500, #adb5bd);
    --rp-danger-subtle-bg: var(--bs-danger-bg-subtle, #f8d7da);
    /* ---- Keyword aliases - for the literal CSS color-keyword spelling
	   (e.g. `color: gray`) rather than a hex value, so a keyword use can
	   still participate in dark mode without changing what's visually a
	   different shade than its hex-named sibling token. */
    --rp-gray-keyword: gray;
    --rp-lightgray-keyword: lightgray;
    /* ---- Special-purpose / one-off source colors, each with an exact
	   hex match found in specific views - kept as their own named tokens
	   rather than folded into the gray scale, since their dark-mode
	   value doesn't follow the general gray-scale lighten/darken rule. */
    --rp-purple-dark: #3f3a60; /* Forms/Onboarding detailed-section drag/drop border */
    --rp-red: #cc0000; /* bright red used in view danger callouts/links */
    --rp-red-pale-bg: #fff3f3; /* danger-callout background */
    --rp-lavender-gray: #e8e8f0; /* Home dashboard panel item border */
    /* ---- Self-Evaluation stepper redesign palette (Session 177/235) - a
	   dedicated purple/green/red micro-palette used only by the --sa-* local
	   aliases in Views/SelfAppraisal/Index.cshtml, Reminders.cshtml, and
	   ReviewAndSubmit.cshtml's own embedded <style> blocks. Those 3 views
	   survived the working-copy overwrite with their CSS intact, but every
	   token below was completely undefined after theme-colors.css itself
	   was deleted - not just missing a dark value, undefined outright, so
	   the whole stepper color scheme (accent/success/attention/text/surface)
	   collapsed to unstyled browser defaults even in light mode. Values
	   below are a best-effort recreation (same purple-accented intent as
	   the original design), not guaranteed to match the original hexes. */
    --rp-purple: #5c5470; /* accent: current-step marker/border/text - muted slate-purple, not a bright violet */
    --rp-purple-deep: #453f54; /* accent-strong: step-action hover fill, bold labels - darker/richer, still muted */
    --rp-purple-pale-bg-2: #e8e5ee; /* accent-soft: current-step focus-ring background */
    --rp-purple-pale-gray: #e4e0ee; /* border: step connector line, progress chip border */
    --rp-purple-light: #a89bb8; /* border-strong: draft-pane border, default step-marker ring */
    --rp-purple-pale-bg: #faf8fd; /* surface-sunken: step hover bg, progress track, draft title bg */
    --rp-purple-near-black: #2b2438; /* text: step name, draft pane title */
    --rp-purple-muted-dark: #685f78; /* text-muted: header-left text, draft intro text */
    --rp-purple-muted: #9991a3; /* text-faint: stepper heading, step status */
    --rp-green-deep: #1e7d3a; /* success: progress fill, complete marker (matches the existing ReyReview signature-pill green already used elsewhere in the app) */
    --rp-green-pale-bg-2: #e3f7e9; /* success-soft background */
    --rp-red-overdue: #dc2626; /* attention: incomplete-step marker/required badge */
    --rp-red-pale-pink-bg: #fdeaea; /* attention-soft background */
    --rp-red-pure: red; /* vivid warning heading text (e.g. "attachment not uploaded") */
    --rp-blue-hover: #0b5ed7; /* Bootstrap 5's own .btn-primary:hover shade */
    /* ---- site.css color-token pass (2026-11-17, redone after site.css
	   itself reverted along with theme-colors.css) ---------------------- */
    --rp-gray-660: #777; /* muted body/icon text - consolidates #666666/#757575/#7e7e7e/#999 */
    --rp-link-blue: #369; /* legacy .tree nav-link color, predates Bootstrap 5 link styling */
    --rp-shadow-accent: lightblue; /* .flex-item-div-full box-shadow glow accent */
    --rp-info-blue: #31b0d5; /* Bootstrap-3-era "info" border/text (PMG My-List tab remnants) */
    --rp-info-blue-dark: #286090; /* Bootstrap-3-era "primary" active-tab background */
    --rp-info-blue-hover: #337ab7; /* Bootstrap-3-era "primary" hover background */
    --rp-badge-brown: #8a5a2b; /* .bg-onboarding-upcoming badge */
    /* Environment-indicator colors (legacy .test/.testqa/.testqa2/.testsb
	   nav classes) - tokenized for the "zero raw color" bar, but NOT given
	   distinct dark-mode values: each one's whole purpose is to be a fixed,
	   instantly-recognizable color so a leader can't mistake QA for Prod -
	   letting them shift with the theme toggle would undermine that, so
	   their dark value (below) is deliberately identical to light. */
    --rp-env-indicator-green: #0c4010;
    --rp-env-indicator-lightgreen: lightgreen;
    --rp-env-indicator-lightblue: lightblue;
    --rp-env-indicator-red: red;
}

/* ---- Shared component classes (promote repeated inline-style patterns to
   a real class instead of leaving them var()-ified-in-place; see Session
   235's "found and applied these, not just defined" lesson). ---- */
.rp-callout-danger {
    background: var(--rp-red-pale-bg);
    border: 1px solid var(--rp-red);
    border-left: 5px solid var(--rp-red);
    color: var(--rp-red);
    padding: 10px 16px;
    border-radius: 4px;
}

.rp-callout-warning {
    background: var(--bs-warning-bg-subtle, #fff3cd);
    border: 1px solid var(--rp-warning);
    border-left: 5px solid var(--rp-warning);
    color: var(--bs-warning-text-emphasis, #664d03);
    padding: 10px 16px;
    border-radius: 4px;
}

.rp-callout-neutral {
    background: var(--rp-gray-120);
    border: 1px solid var(--rp-gray-210);
    border-left: 5px solid var(--rp-gray-540);
    color: var(--rp-gray-700-text);
    padding: 10px 16px;
    border-radius: 4px;
}

.rp-cell-shaded {
    /* --rp-gray-120 (Bootstrap's gray-100, #f8f9fa) is nearly indistinguishable
	   from white - confirmed too faint against a real screenshot of the
	   AppraisalTeam associate-details popup, where these cells show a clearly
	   visible light gray. --rp-gray-200 matches that shade. */
    background: var(--rp-gray-200);
}

.rp-cell-dark {
    background: var(--rp-gray-700);
    color: var(--rp-white);
}

.rp-cell-dark-bg {
    background: var(--rp-gray-700);
}

.rp-label-link {
    color: var(--rp-primary);
}

/* ============================================================================
   DARK MODE - every token above that has a real role-appropriate dark value
   gets mirrored here. --rp-white/--rp-white-keyword/--rp-black/
   --rp-black-keyword are deliberately absent (see the :root comment above).
   ============================================================================ */
[data-bs-theme="dark"] {
    --rp-gray-050: #1c1c1c;
    --rp-gray-075: #181818;
    --rp-gray-100: #1c1c1c;
    /* #262626 (the original lighten-for-dark value) confirmed too close to
	   Bootstrap's dark body background (#212529) to read as a distinct
	   surface/border across multiple real screenshots (AppraisalTeam's
	   associate-details shaded cells, the Show All/Leader Stats table header
	   row) - dark tones need a much bigger numeric jump than light ones for
	   the same perceived contrast, since sRGB compresses shadow detail.
	   Bumped to match the dedicated value already proven out on
	   .rp-cell-shaded. This is a widely-shared token (borders and
	   backgrounds across many views/CSS files), so fixing it here covers
	   every consumer instead of accumulating one-off per-selector overrides. */
    --rp-gray-200: #3d434a;
    --rp-gray-300: #4a4a4a; /* border-dominant */
    --rp-gray-400: #8a8a8a;
    --rp-gray-575: #8a8a8a; /* kept medium rather than fully lightened - still has to work as a white-text header-bar background, not just as label text */
    --rp-gray-700: #c7c7c7;
    --rp-gray-700-text: #c2c8d0; /* distinct source palette from --rp-gray-700 itself */
    --rp-gray-800: #e0e0e0;
    --rp-gray-900: #f0f0f0;
    /* --rp-gray-210 and --rp-danger-subtle-bg intentionally not overridden -
	   Bootstrap already re-themes --bs-border-color/--bs-danger-bg-subtle
	   itself, so these two get dark mode "for free" via their alias. */

    --rp-primary: #6ea8fe; /* = --bs-primary-text-emphasis (dark) */
    --rp-success: #75b798; /* = --bs-success-text-emphasis (dark) */
    --rp-warning: #ffda6a; /* = --bs-warning-text-emphasis (dark) */
    --rp-danger: #ea868f; /* = --bs-danger-text-emphasis (dark) */
    --rp-secondary: #a7acb1; /* = --bs-secondary-text-emphasis (dark) */
    --rp-gray-120: #1f2225;
    --rp-gray-420: #52585e;
    --rp-gray-540: #9aa1a8;
    --rp-gray-keyword: #a3a3a3;
    --rp-lightgray-keyword: #3a3a3a;
    --rp-purple-dark: #6b6496;
    --rp-red: #ff6b6b;
    --rp-red-pale-bg: #2c1616;
    --rp-lavender-gray: #363842;
    /* Self-Evaluation stepper palette (dark) - text/border tokens lighten,
	   backgrounds deepen, same methodology as the rest of this block. */
    --rp-purple: #a39bb0; /* muted light slate-purple, not a bright violet */
    --rp-purple-deep: #c3b9cf; /* lighter muted purple for "strong"/hover-fill emphasis */
    --rp-purple-pale-bg-2: rgba(140,130,160,0.25);
    --rp-purple-pale-gray: #3a3548;
    --rp-purple-light: #786d8a;
    --rp-purple-pale-bg: #221d2e;
    --rp-purple-near-black: #ece8f2;
    --rp-purple-muted-dark: #b6aec4;
    --rp-purple-muted: #8d84a0;
    --rp-green-deep: #4ade80;
    --rp-green-pale-bg-2: rgba(34,197,94,0.18);
    --rp-red-overdue: #f87171;
    --rp-red-pale-pink-bg: rgba(220,38,38,0.18);
    --rp-red-pure: #ff6b6b;
    --rp-blue-hover: #3d8bfd;
    --rp-gray-660: #9aa1a8;
    --rp-link-blue: #6ca0dc;
    /* --rp-shadow-accent: a plain darkened version of the light "glow" reads
	   as nearly invisible against an already-dark page (darkening a dark
	   background doesn't do much) - a muted but lighter slate glow is needed
	   instead so the card still gets a visible depth cue in dark mode. */
    --rp-shadow-accent: rgba(148,163,184,0.35);
    --rp-info-blue: #5bc8e8;
    --rp-info-blue-dark: #4a7ab0;
    --rp-info-blue-hover: #5a9bd4;
    --rp-badge-brown: #b8824f;
    /* --rp-env-indicator-* intentionally not overridden - see the :root
	   comment above. */
}

    /* ============================================================================
   DARK-MODE-ONLY PER-SELECTOR OVERRIDES

   Each of these exists because the selector's rule uses var(--rp-white) (or
   a similar text-role token) for what is actually a page-surface BACKGROUND,
   not foreground text - so leaving the shared token un-overridden (correct
   for its many other, text-role usages) left these specific elements a
   glaring white box in dark mode. Fixed per-selector rather than by
   changing the shared token's dark value, which other, more common usages
   still depend on.
   ============================================================================ */

    /* Navbar "Impersonate" <select> - site.css's .rp-impersonate-select uses
   var(--rp-white) for its background, correctly for most other --rp-white
   usages (foreground text) but wrong here (it's the field's own background,
   not text sitting on something else) - stayed a glaring white box in the
   dark navbar. */
    [data-bs-theme="dark"] .rp-impersonate-select {
        background-color: var(--rp-gray-075);
    }

    /* Home dashboard panels (.lc-list, Views/Home/Index.cshtml) - same
   var(--rp-white) background issue as .rp-impersonate-select above. */
    [data-bs-theme="dark"] .lc-list {
        background: var(--rp-gray-075);
    }

    /* .flex-item-div/.flex-item-div-full ("Appraisal Period" and similar page
   card containers, used throughout the site) - var(--rp-gray-900) is a
   correct dark-mode "lighten for text" choice everywhere else it's used,
   but here it's a card BORDER, so lightening it the same way as body text
   produced a glowing near-white outline. Overridden just for this rule
   rather than changing the shared token's dark value (which text usages
   elsewhere still depend on). */
    [data-bs-theme="dark"] .flex-item-div,
    [data-bs-theme="dark"] .flex-item-div-full {
        border-color: var(--rp-gray-560, #555);
    }

    /* Settings > General's right-hand content pane (.gs-content, Views/Settings/
   General.cshtml) - same var(--rp-white) background issue as
   .rp-impersonate-select/.lc-list above. */
    [data-bs-theme="dark"] .gs-content {
        background: var(--bs-tertiary-bg, #2b3035);
    }

    /* #SectionHolder - a hidden-until-shown popup, inline-styled identically in
   Views/Forms/_MapFormSections.cshtml and _UpdateFormSections.cshtml with a
   literal background-color: var(--rp-white). Same issue as everything above;
   fixed centrally here since both pages share the one ID/markup shape. */
    [data-bs-theme="dark"] #SectionHolder {
        background-color: var(--bs-tertiary-bg, #2b3035);
    }

    /* #spFontList - SignaturePad's font-style dropdown (Views/Shared/
   _SignaturePad.cshtml) - same var(--rp-white) background issue as
   everything above; found via a real screenshot showing its option rows
   as barely-readable text on a white box inside an otherwise-dark modal. */
    [data-bs-theme="dark"] #spFontList {
        background: var(--bs-tertiary-bg, #2b3035);
    }

    /* DataTables FixedColumns plugin (v4.3.0, CDN-loaded, AppraisalTeam frozen-
   column datatable/treeview) hardcodes background-color: white on its
   frozen/pinned column cells unless an ancestor carries DataTables' own
   html.dark marker class - which this app never sets, since it uses
   Bootstrap's [data-bs-theme] attribute instead. Selectors below match the
   vendored plugin's own CSS exactly (table.dataTable {thead,tfoot,tbody}
   tr > .dtfc-fixed-{left,right}, div.dtfc-{left,right}-top-blocker). */
    [data-bs-theme="dark"] table.dataTable thead tr > .dtfc-fixed-left,
    [data-bs-theme="dark"] table.dataTable thead tr > .dtfc-fixed-right,
    [data-bs-theme="dark"] table.dataTable tfoot tr > .dtfc-fixed-left,
    [data-bs-theme="dark"] table.dataTable tfoot tr > .dtfc-fixed-right,
    [data-bs-theme="dark"] table.dataTable tbody tr > .dtfc-fixed-left,
    [data-bs-theme="dark"] table.dataTable tbody tr > .dtfc-fixed-right,
    [data-bs-theme="dark"] div.dtfc-left-top-blocker,
    [data-bs-theme="dark"] div.dtfc-right-top-blocker {
        background-color: var(--bs-tertiary-bg, #2b3035);
    }

/* .rp-cell-shaded no longer needs its own override - it uses --rp-gray-200,
   which was fixed at the token level above once the same "too close to
   body-bg" problem was confirmed on a second, unrelated consumer
   (.stats-wrapper th). See that token's comment in the :root dark block. */
