/* =============================================================
   Design tokens — single source of truth for the WorkTrack360 UI.
   Every color, radius, type step, elevation and motion value used
   in application CSS resolves to a token defined here.

   Legacy aliases are kept at the bottom so existing selectors keep
   working; prefer the scale names for new code.
   ============================================================= */

:root {
    /* ---- Typography ------------------------------------------------ */
    /* Legacy 14px root: rem-based Bootstrap sizing is calibrated to it. */
    --root-font-size: 14px;
    /* Multiplier for every --text-* step; the member "Larger text" setting raises it (member-display.css). */
    --text-scale: 1;

    --font-sans: Inter, "Segoe UI", system-ui, -apple-system, Arial, sans-serif;

    --text-2xs: calc(11px * var(--text-scale));
    --text-xs: calc(12px * var(--text-scale));
    --text-sm: calc(13px * var(--text-scale));
    --text-base: calc(14px * var(--text-scale));
    --text-md: calc(15px * var(--text-scale));
    --text-lg: calc(16px * var(--text-scale));
    --text-xl: calc(18px * var(--text-scale));
    --text-2xl: calc(20px * var(--text-scale));
    --text-3xl: calc(22px * var(--text-scale));
    --text-4xl: calc(24px * var(--text-scale));
    --text-5xl: calc(26px * var(--text-scale));
    --text-6xl: calc(30px * var(--text-scale));
    --text-7xl: calc(34px * var(--text-scale));
    --text-8xl: calc(42px * var(--text-scale));

    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;

    /* ---- Neutrals -------------------------------------------------- */
    --grey-25: #fcfcfd;
    --grey-50: #f9fafb;
    --grey-100: #f2f4f7;
    --grey-200: #eaecf0;
    --grey-300: #d0d5dd;
    --grey-400: #98a2b3;
    --grey-500: #667085;
    --grey-600: #475467;
    --grey-700: #344054;
    --grey-800: #1d2939;
    --grey-900: #101828;

    /* Cool neutrals used by the app shell (sidebar, canvas, rules) */
    --slate-50: #f7f9fb;
    --slate-100: #eef1f5;
    --slate-200: #e4e7ec;
    --slate-300: #cbd5e1;
    --slate-400: #8492a6;
    --slate-500: #5f697a;
    --slate-600: #4b5563;
    --slate-900: #111827;

    /* ---- Brand blue ------------------------------------------------ */
    --blue-25: #f5faff;
    --blue-50: #eff8ff;
    --blue-100: #d1e9ff;
    --blue-200: #b2ddff;
    --blue-300: #84c5ff;
    --blue-400: #2290ff;
    --blue-500: #1686e8;
    --blue-600: #0875df;
    --blue-700: #0668c6;
    --blue-800: #0b5cad;
    --blue-900: #0c4364;

    /* ---- Success --------------------------------------------------- */
    --green-50: #ecfdf3;
    --green-100: #dcfae6;
    --green-200: #abefc6;
    --green-400: #12b76a;
    --green-500: #067647;
    --green-600: #087f3e;
    --green-700: #08723a;

    /* ---- Danger ---------------------------------------------------- */
    --red-50: #fef3f2;
    --red-100: #fee4e2;
    --red-200: #fecdca;
    --red-300: #fda29b;
    --red-400: #f04438;
    --red-500: #d92d20;
    --red-600: #b42318;
    --red-700: #912018;

    /* ---- Warning --------------------------------------------------- */
    --amber-50: #fffaeb;
    --amber-100: #fef0c7;
    --amber-200: #fedf89;
    --amber-400: #fdb022;
    --amber-500: #f79009;
    --amber-600: #b54708;
    --amber-700: #93370d;

    /* ---- Semantic surfaces & text ---------------------------------- */
    --canvas: var(--slate-100);
    --surface: #fff;
    --surface-sunken: var(--grey-50);
    --surface-raised: #fff;
    --line: var(--slate-200);
    --line-strong: var(--grey-300);
    --line-input: var(--grey-500); /* field boundaries need 3:1 (WCAG 1.4.11) */

    --ink: var(--slate-900);
    --ink-strong: var(--grey-900);
    --ink-muted: var(--grey-500);
    --ink-subtle: var(--slate-500);
    --ink-inverse: #fff;

    --accent: var(--blue-600);
    --accent-hover: var(--blue-700);
    --accent-soft: var(--blue-50);
    --amber: var(--amber-600);
    --blue-soft: var(--blue-50);
    --green-soft: var(--green-50);
    --red-soft: var(--red-50);
    --amber-soft: var(--amber-50);
    --danger: var(--red-500);
    --success: var(--green-500);
    --warning: var(--amber-500);

    /* ---- Radius ---------------------------------------------------- */
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-pill: 999px;
    --radius-circle: 50%;

    /* ---- Elevation ------------------------------------------------- */
    --shadow-xs: 0 1px 2px rgba(16, 24, 40, .04);
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, .06);
    --shadow-md: 0 4px 12px rgba(16, 24, 40, .08);
    --shadow-lg: 0 8px 24px rgba(16, 24, 40, .12);
    --shadow-xl: 0 12px 28px rgba(16, 24, 40, .16);
    --shadow-2xl: 0 24px 60px rgba(16, 24, 40, .22);
    --shadow-drawer: 12px 0 30px rgba(16, 24, 40, .16);
    --shadow-drawer-left: -16px 0 38px rgba(16, 24, 40, .16);
    --ring-accent: 0 0 0 2px var(--accent); /* solid so focus meets 3:1 (WCAG 2.4.7 / 1.4.11) */
    --ring-danger: 0 0 0 2px var(--red-500);
    --ring-success: 0 0 0 2px var(--green-500);
    --ring-warning: 0 0 0 2px var(--amber-600);

    /* ---- Motion ---------------------------------------------------- */
    --ease: cubic-bezier(.4, 0, .2, 1);
    --duration-fast: .15s;
    --duration-base: .2s;
    --duration-slow: .3s;

    /* ---- Layout ---------------------------------------------------- */
    --sidebar: 240px;
    --categories: 390px;
    --topbar: 58px;
    --pagebar: 78px;

    /* ---- Legacy aliases (do not use in new code) -------------------- */
    --color-white: #fff;
    --color-black: #000;
    --white: #fff;
    --text-color: var(--ink);
    --body-bg: var(--canvas);
    --border-color: var(--line);
    --desc-color: var(--ink-muted);
    --light-grey-bg: var(--grey-100);
    --dark-grey: var(--ink-muted);
    --color-blue: var(--accent);
    --color-red: var(--red-600);
    --error-color: var(--red-600);
    --focus-color: var(--accent);
    --muted: var(--ink-subtle);
    --subtle: var(--ink-subtle);
    --soft: var(--slate-50);
    --blue: var(--accent);
    --blue-dark: var(--accent-hover);
    --green: var(--green-600);
    --red: var(--danger);
    --navy: var(--slate-900);
    --secondary: var(--slate-900);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
