/*!
 * DAMSY design tokens - the single source of truth for colour.
 *
 * Loaded FIRST on every layout, before any other stylesheet, so our own sheets
 * and the vendor overrides at the bottom of this file can both use var().
 *
 * Rules (Phase 3):
 *   --accent       highlights and large headings only, never body text
 *                  (3.32:1 on white - passes 3:1 for >=24px text and UI, fails 4.5:1)
 *   --muted-light  placeholders* and disabled states, never content
 *   --border       card and table dividers (decorative)
 *   --border-control  the boundary of an interactive control
 *                  (3.48:1 on card, 3.18:1 on surface)
 *
 *   * Placeholder text is still text: --muted-light is 2.56:1, so placeholder
 *     TEXT uses --muted (5.34:1). --muted-light stays for disabled states and
 *     decorative marks. See docs/phase3-contrast.md.
 *
 *   Status: the bright --success/--warning/--error are for glyphs, bars and
 *   chart marks. Text, and any badge with white text on it, uses the -text
 *   token (white on --success is 2.54:1; white on --success-text is 5.48:1).
 *   Every status chip carries a text label, so no state is colour-only.
 *
 * Every colour also has an -rgb triplet so translucency is expressed as
 * rgba(var(--primary-rgb), .12) instead of a hard-coded rgba(37, 99, 235, .12).
 *
 * No IE11 fallbacks: the shell already depends on custom properties
 * (--erp-sidebar-width drives the sidebar/content layout), so anything that
 * renders the app at all supports var().
 */
:root {
    /* ---- brand ---- */
    --navy: #0C1C3C;
    --navy-rgb: 12, 28, 60;
    /* --primary, --success and --warning share their names with Bootstrap 4's
       :root variables (bootstrap.min.css, loaded by the Registration layout).
       The value lives under a --damsy- name that nothing else defines, and
       damsy-overrides.css re-points the public name at it after every vendor
       sheet has loaded. */
    --damsy-primary: #1E5AA8;
    --primary: var(--damsy-primary);
    --primary-rgb: 30, 90, 168;
    --primary-dark: #174A8A;
    --primary-dark-rgb: 23, 74, 138;
    --accent: #5B8FD4;
    --accent-rgb: 91, 143, 212;

    /* ---- neutrals ---- */
    --surface: #F1F5F9;
    --surface-rgb: 241, 245, 249;
    --card: #FFFFFF;
    --card-rgb: 255, 255, 255;
    --border: #E2E8F0;
    --border-rgb: 226, 232, 240;
    --border-control: #808A9C;
    --border-control-rgb: 128, 138, 156;
    --muted: #5E6C80;
    --muted-rgb: 94, 108, 128;
    --muted-light: #94A3B8;
    --muted-light-rgb: 148, 163, 184;

    /* ---- status ---- */
    --damsy-success: #10B981;
    --success: var(--damsy-success);
    --success-rgb: 16, 185, 129;
    --success-text: #047857;
    --success-text-rgb: 4, 120, 87;
    --success-bg: #ECFDF5;
    --damsy-warning: #F59E0B;
    --warning: var(--damsy-warning);
    --warning-rgb: 245, 158, 11;
    --warning-text: #B45309;
    --warning-text-rgb: 180, 83, 9;
    --warning-bg: #FEF3C7;
    --error: #EF4444;
    --error-rgb: 239, 68, 68;
    --error-text: #B91C1C;
    --error-text-rgb: 185, 28, 28;
    --error-bg: #FEF2F2;
    /* pressed/hover end of a dark status fill (white text: 7.68 / 7.09 / 8.31) */
    --success-strong: #065F46;
    --warning-strong: #92400E;
    --error-strong: #991B1B;

    /* ---- derived: no new blues are invented below this line ---- */
    --primary-hover: var(--primary-dark);
    --primary-active: #123B70;
    --primary-active-rgb: 18, 59, 112;
    --primary-tint: rgba(var(--primary-rgb), .08);
    --primary-tint-strong: rgba(var(--primary-rgb), .16);
    --primary-soft: #EAF1FA;
    --primary-soft-strong: #D7E1EF;         /* primary at 18% on white: selected rows */
    --primary-border-soft: #C5D8F0;
    --focus-ring: 0 0 0 3px rgba(var(--primary-rgb), .35);
    --disabled-bg: var(--surface);
    --disabled-fg: var(--muted);
    --disabled-border: var(--border-control);

    /* Gradients: a second stop that is only a shade away reads as flat, so the
       brand gradient runs primary -> primary-dark, and the "lift" variant uses
       accent -> primary for a visible but on-brand transition. */
    --grad-primary: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    --grad-primary-lift: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    --grad-navy: linear-gradient(135deg, var(--primary-dark) 0%, var(--navy) 100%);

    /* ---- type ---- */
    --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;

    /* ---- chart series: ordered, primary first ---- */
    /* straight to the private name: a page that loads Bootstrap 4 but not
       damsy-overrides.css would otherwise draw series 1 in #007bff */
    --chart-1: var(--damsy-primary);
    --chart-2: var(--accent);
    --chart-3: var(--success-text);
    --chart-4: var(--warning-text);
    --chart-5: #7C3AED;
    --chart-6: var(--error-text);
    --chart-7: var(--navy);
    /* only for charts with more than six series (Sales lead-source pie) */
    --chart-8: #0E7490;
}
