@font-face {
    font-family: "IBM Plex Sans";
    src: url("/design-system/fonts/IBMPlexSans-Variable.ttf") format("truetype");
    font-style: normal;
    font-weight: 100 700;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Sans Arabic";
    src: url("/design-system/fonts/IBMPlexSansArabic-Regular.ttf") format("truetype");
    font-weight: 400;
    font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

@font-face {
    font-family: "IBM Plex Sans Arabic";
    src: url("/design-system/fonts/IBMPlexSansArabic-Medium.ttf") format("truetype");
    font-weight: 500;
    font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

@font-face {
    font-family: "IBM Plex Sans Arabic";
    src: url("/design-system/fonts/IBMPlexSansArabic-SemiBold.ttf") format("truetype");
    font-weight: 600;
    font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

@font-face {
    font-family: "IBM Plex Sans Arabic";
    src: url("/design-system/fonts/IBMPlexSansArabic-Bold.ttf") format("truetype");
    font-weight: 700;
    font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

:root {
    color-scheme: light;
    --hrx-ux-font: "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, "Segoe UI", Arial, sans-serif;
    --hrx-ux-bg: #f2f5fb;
    --hrx-ux-surface: #fff;
    --hrx-ux-surface-raised: #f7faff;
    --hrx-ux-subtle: #eaf0fb;
    --hrx-ux-text: #152440;
    --hrx-ux-ink: var(--hrx-ux-text);
    --hrx-ux-muted: #52637c;
    --hrx-ux-border: #dce5f2;
    --hrx-ux-line: var(--hrx-ux-border);
    --hrx-ux-field-border: #7b8eab;
    --hrx-ux-primary: #193f68;
    --hrx-ux-on-primary: #fff;
    --hrx-ux-accent: #2458d9;
    --hrx-ux-focus: #2458d9;
    --hrx-ux-focus-on-nav: #98c8ff;
    --hrx-ux-nav: #0f1d38;
    --hrx-ux-on-nav: #f3f7ff;
    --hrx-ux-nav-muted: #b6c5e0;
    --hrx-ux-navy: #132f50;
    --hrx-ux-royal: #2458d9;
    --hrx-ux-sky: #e2f4ff;
    --hrx-ux-lavender: #eee9ff;
    --hrx-ux-mint: #def7ed;
    --hrx-ux-amber: #fff0d9;
    --hrx-ux-rose: #fce9ee;
    --hrx-ux-violet: #6a578d;
    --hrx-ux-violet-tint: var(--hrx-ux-lavender);
    --hrx-ux-mint-tint: var(--hrx-ux-mint);
    --hrx-ux-positive: #236751;
    --hrx-ux-negative: #9d303e;
    --hrx-ux-caution: #7a5422;
    --hrx-ux-chart-1: #2458d9;
    --hrx-ux-chart-2: #1379ab;
    --hrx-ux-chart-3: #187667;
    --hrx-ux-chart-4: #7252aa;
    --hrx-ux-chart-5: #9e651d;
    --hrx-ux-chart-6: #a94b73;
    --hrx-ux-chart-7: #506985;
    --hrx-ux-action: #2458d9;
    --hrx-ux-action-hover: #1948bf;
    --hrx-ux-on-action: #fff;
    --hrx-ux-radius: 16px;
    --hrx-ux-control-radius: .625rem;
    --hrx-ux-shadow: 0 10px 30px #122c4910;
    --hrx-ux-space: 1rem;
    --hrx-ux-touch: 44px;
    --hrx-font-body: var(--hrx-ux-font);
    --hrx-color-focus: var(--hrx-ux-focus);
    --hrx-focus-halo: 0 0 0 2px var(--hrx-ux-surface);
}

:root[data-hrx-theme="dark"] {
    color-scheme: dark;
    --hrx-ux-bg: #101a2d;
    --hrx-ux-surface: #16243b;
    --hrx-ux-surface-raised: #1c2e49;
    --hrx-ux-subtle: #253756;
    --hrx-ux-text: #edf3ff;
    --hrx-ux-muted: #b1c2da;
    --hrx-ux-border: #3b506e;
    --hrx-ux-field-border: #7892b7;
    --hrx-ux-primary: #234c78;
    --hrx-ux-on-primary: #fff;
    --hrx-ux-accent: #a4bcff;
    --hrx-ux-focus: #a3c9ff;
    --hrx-ux-nav: #0c172d;
    --hrx-ux-navy: #12263f;
    --hrx-ux-royal: #abc7ff;
    --hrx-ux-sky: #213e59;
    --hrx-ux-lavender: #352e50;
    --hrx-ux-mint: #1d4039;
    --hrx-ux-amber: #43351f;
    --hrx-ux-rose: #472b40;
    --hrx-ux-violet: #d6c1f5;
    --hrx-ux-positive: #9be3c6;
    --hrx-ux-negative: #ffb6bd;
    --hrx-ux-caution: #f2cd93;
    --hrx-ux-chart-1: #99b5ff;
    --hrx-ux-chart-2: #78cff3;
    --hrx-ux-chart-3: #78d8bb;
    --hrx-ux-chart-4: #c6aefa;
    --hrx-ux-chart-5: #efc178;
    --hrx-ux-chart-6: #f3a4c5;
    --hrx-ux-chart-7: #a6bbd7;
    --hrx-ux-action: #315cc5;
    --hrx-ux-action-hover: #3b68d2;
    --hrx-ux-shadow: 0 10px 30px #0003;
}

html body {
    background-color: var(--hrx-ux-bg);
    color: var(--hrx-ux-text);
    font-family: var(--hrx-ux-font) !important;
    font-size: 1rem;
    line-height: 1.55;
}

html:lang(ar) body { line-height: 1.65; }

html body :is(button, input, select, textarea, option, table) {
    font-family: inherit !important;
}

html :is(input, select, textarea)::placeholder { opacity: 1; }

:where(h1, h2, h3) { font-weight: 600; line-height: 1.35; }
:where(strong, b, th) { font-weight: 600; }
:where(table, [data-hrx-number]) { font-variant-numeric: tabular-nums; }

html body :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid var(--hrx-color-focus) !important;
    outline-offset: 3px !important;
}

.hrx-ux-icon {
    display: inline-block;
    block-size: var(--hrx-ux-icon-size, 1em);
    inline-size: var(--hrx-ux-icon-size, 1em);
    flex: 0 0 auto;
    vertical-align: -.13em;
    pointer-events: none;
}

.hrx-ux-icon[data-hrx-icon-directional]:dir(rtl) { transform: scaleX(-1); }
:where(span, i)[data-hrx-icon] { display: inline-flex; align-items: center; flex: 0 0 auto; }

/* Shared controls opt in by class so existing workflow layouts keep their dimensions. */
.hrx-ux-field {
    min-inline-size: 0;
    min-block-size: var(--hrx-ux-touch);
    padding: .55rem .7rem;
    background: var(--hrx-ux-surface);
    color: var(--hrx-ux-text);
    border: 1px solid var(--hrx-ux-field-border);
    border-radius: var(--hrx-ux-control-radius);
    font-size: 1rem;
    line-height: 1.45;
}

.hrx-ux-field::placeholder { color: var(--hrx-ux-muted); }
.hrx-ux-field[aria-invalid="true"] { border-color: var(--hrx-ux-negative); }
.hrx-ux-field:disabled { color: var(--hrx-ux-muted); background: var(--hrx-ux-subtle); }
.hrx-ux-field[readonly]:not(:disabled) { background: var(--hrx-ux-surface-raised); }
textarea.hrx-ux-field { min-block-size: 6rem; resize: vertical; }
.hrx-ux-check { accent-color: var(--hrx-ux-action); }

.hrx-ux-theme-button, .hrx-ux-button {
    align-items: center;
    background: var(--hrx-ux-surface);
    border: 1px solid var(--hrx-ux-field-border);
    border-radius: var(--hrx-ux-control-radius);
    color: var(--hrx-ux-text);
    cursor: pointer;
    display: inline-flex;
    gap: .45rem;
    justify-content: center;
    font-size: .875rem;
    font-weight: 500;
    line-height: 1.25;
    min-block-size: var(--hrx-ux-touch);
    padding: .5rem .7rem;
    white-space: nowrap;
}

.hrx-ux-theme-button:hover, .hrx-ux-button:hover:not(:disabled) { background: var(--hrx-ux-subtle); }
.hrx-ux-button--primary, .hrx-ux-button--primary:hover:not(:disabled) {
    color: var(--hrx-ux-on-action);
    background: var(--hrx-ux-action);
    border-color: var(--hrx-ux-action);
}
.hrx-ux-button--primary:hover:not(:disabled) { background: var(--hrx-ux-action-hover); }
.hrx-ux-button:disabled { color: var(--hrx-ux-muted); background: var(--hrx-ux-subtle); border-color: var(--hrx-ux-field-border); cursor: default; }
.hrx-ux-theme-symbol { --hrx-ux-icon-size: 1rem; line-height: 1; }

@media (forced-colors: active) {
    :root, :root[data-hrx-theme="dark"] { --hrx-ux-focus: Highlight; --hrx-ux-focus-on-nav: Highlight; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Workspace headings receive programmatic focus to announce a new view. */
html body :is(h1, h2, h3)[tabindex="-1"]:focus-visible { outline: none !important; }
