/*
 * theme-tokens.css — SINGLE SOURCE OF TRUTH for the whole app + master admin.
 * Imported at the top of app.css, which BOTH the main app (layout.php) and the
 * master pages load — so one file themes everything. Change colours here only.
 *
 * Palette: brand green primary (kept from the saved brand), neutral slate grays,
 * muted semantic colours. Light + dark (dark stays clean monochrome as approved,
 * softened from pure black to modern near-black tones).
 */

:root{
    /* ── Brand / primary (actions & links only — NOT headings/backgrounds) ── */
    --primary:#059669;
    --primary-hover:#047d54;
    --primary-active:#03693f;
    --primary-soft:#e6f5ee;
    --primary-contrast:#ffffff;
    --primary-ring:rgba(5,150,105,.20);

    /* ── Neutral surfaces & text ── */
    --bg:#f4f6f8;
    --surface:#ffffff;
    --surface-2:#f8fafb;
    --surface-3:#eef1f4;
    --border:#e4e8ed;
    --border-strong:#d2d8e0;
    --text:#0f1729;
    --text-2:#485267;
    --muted:#7a8496;

    /* ── Semantic (muted, professional — not neon) ── */
    --success:#16a34a; --success-soft:#e7f6ec; --success-text:#15803d;
    --warning:#c2740a; --warning-soft:#fbf1e0; --warning-text:#8a5208;
    --danger:#dc2626;  --danger-soft:#fbe9e9;  --danger-text:#b42318;
    --info:#475569;    --info-soft:#eef1f5;    --info-text:#334155;   /* neutral, not blue */

    /* ── Radius ── */
    --r-xs:6px; --r-sm:8px; --r:10px; --r-lg:14px; --r-xl:18px; --r-pill:999px;

    /* ── Shadows (subtle) ── */
    --shadow-xs:0 1px 2px rgba(16,24,40,.04);
    --shadow-sm:0 1px 3px rgba(16,24,40,.06);
    --shadow:0 4px 14px rgba(16,24,40,.06);
    --shadow-lg:0 12px 28px rgba(16,24,40,.10);

    /* ── Z-index scale (design-system-plan §3.7) — every fixed/absolute
       element must use one of these, never an arbitrary number. Prevents
       the sidebar/dropdown/modal stacking conflicts found in earlier audits. ── */
    --z-sidebar:50;
    --z-sticky-header:80;
    --z-mobile-nav:160;
    --z-dropdown:200;
    --z-modal-backdrop:1000;
    --z-modal:1001;
    --z-toast:9999;

    /* ── Typography ── */
    --fs-h1:26px; --fs-h2:19px; --fs-h3:16px; --fs-body:14px; --fs-sm:12.5px; --fs-xs:11px;
    --fw-normal:400; --fw-medium:500; --fw-semibold:600; --fw-bold:700; --fw-heavy:800;
    --lh-tight:1.2; --lh:1.5; --lh-relaxed:1.65;

    /* ── Spacing scale ── */
    --s1:4px; --s2:8px; --s3:12px; --s4:16px; --s5:20px; --s6:24px; --s8:32px; --s10:40px;

    /* ══ Legacy variable families remapped to the tokens above ══
       (so every existing proto- / ui- / master- var() consumer inherits
        the new system with no per-file edits.) NOTE: never write "asterisk
        slash" sequences inside this comment — it ends the comment early and
        the parser then EATS the next declaration (this exact bug silently
        killed --proto-primary until 2026-07-21). */
    --proto-primary:var(--primary); --proto-primary-dark:var(--primary-hover); --proto-primary-soft:var(--primary-soft);
    --proto-bg:var(--bg); --proto-surface:var(--surface); --proto-surface-2:var(--surface-2);
    --proto-text:var(--text); --proto-text-2:var(--text-2); --proto-muted:var(--muted); --proto-border:var(--border);

    --ui-bg:var(--bg); --ui-surface:var(--surface); --ui-surface-2:var(--surface-2); --ui-surface-3:var(--surface-3);
    --ui-text:var(--text); --ui-text-2:var(--text-2); --ui-muted:var(--muted);
    --ui-border:var(--border); --ui-border-soft:var(--surface-3);
    --ui-blue:var(--primary); --ui-blue-hover:var(--primary-hover); --ui-blue-soft:var(--primary-soft);
    --ui-green:var(--success); --ui-green-soft:var(--success-soft);
    --ui-amber:var(--warning); --ui-amber-soft:var(--warning-soft);
    --ui-red:var(--danger); --ui-red-soft:var(--danger-soft);
    --ui-shadow:var(--shadow); --ui-shadow-soft:var(--shadow-sm);

    --apple-bg:var(--bg); --apple-surface:var(--surface); --apple-surface-2:var(--surface-2);
    --apple-text:var(--text); --apple-text-2:var(--text-2); --apple-muted:var(--muted);
    --apple-border:var(--border); --apple-border-strong:var(--border-strong);
    --apple-blue:var(--primary); --apple-blue-hover:var(--primary-hover);

    --master-primary:var(--primary); --master-primary-dark:var(--primary-hover); --master-primary-darker:var(--primary-active);
    --master-primary-light:var(--primary-soft); --master-primary-soft:var(--primary-soft);
    --master-nav-bg:#0f1116;                        /* neutral near-black nav (was navy #0f172a) */
    --master-bg:var(--bg); --master-surface:var(--surface); --master-surface-alt:var(--surface-2); --master-surface-muted:var(--surface-2);
    --master-text:var(--text); --master-text-secondary:var(--text-2); --master-text-muted:var(--muted); --master-text-faint:var(--muted);
    --master-border:var(--border); --master-border-light:var(--surface-3); --master-border-faint:var(--surface-2);
    --master-shadow:var(--shadow-sm);
    --master-accent-gold:var(--warning); --master-accent-gold-bg:var(--warning-soft);

    --surface-alt:var(--surface-2); --border-color:var(--border);
    --primary-dark:var(--primary-hover); /* legacy alias (a:hover, .btn:hover, landing) */

    /* ── Dark band / product-mockup surfaces (marketing pages) ── */
    --dark-bg:#0b1628; --dark-bg-2:#13233c; --dark-text:#ffffff; --dark-link:#9ec5ff;
    --dark-accent:#6ee7b7; /* light accent text on dark hero */
    --google-blue:#1a73e8; --google-blue-hover:#1557b0; /* Google-brand connect buttons */
    --pink-soft:#fce7f3; --pink-text:#9d174d; /* transactional-intent badge */
    /* CRM lead pipeline stages */
    --stage-assigned:#2563eb; --stage-assigned-soft:#f0f6ff;
    --stage-working:#7c3aed;  --stage-working-soft:#f3e8ff;
    --stage-high:#f97316;     --stage-high-soft:#ffedd5;
    /* Categorical chip palette (trend types, schema types, GBP statuses…) */
    --cat-blue:#1e40af;   --cat-blue-soft:#dbeafe;
    --cat-sky:#075985;    --cat-sky-soft:#e0f2fe;
    --cat-cyan:#0e7490;   --cat-cyan-soft:#cffafe;
    --cat-indigo:#3730a3; --cat-indigo-soft:#e0e7ff;
    --primary-glow:rgba(5,150,105,.30); --primary-glow-strong:rgba(5,150,105,.40); /* static defaults; runtime theme recomputes */
}
