/* Approved personnel appearance: screen/light/opt-in only.
   Preserve original components, handlers and geometry. Classic is untouched.
   Fonts are byte-identical to the accepted reference; OFL accompanies them. */
@media screen {
    @font-face {
        font-family: "JafamPersonnel";
        font-style: normal;
        font-weight: 100 900;
        font-display: swap;
        src: url("../fonts/personnel/vazirmatn-arabic.woff2") format("woff2");
        unicode-range: U+0600-06FF,U+0750-077F,U+08A0-08FF,U+200C-200E,U+FB50-FDFF,U+FE70-FEFF;
    }
    @font-face {
        font-family: "JafamPersonnel";
        font-style: normal;
        font-weight: 100 900;
        font-display: swap;
        src: url("../fonts/personnel/vazirmatn-latin.woff2") format("woff2");
        unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
    }
    html[data-ui-design="personnel"]:not([data-theme="dark"]) {
        --jf-primary: #4f39f6;
        --jf-primary-soft: #eef2ff;
        --jf-primary-dark: #432dd7;
        --jf-bg: #f8fafc;
        --jf-bg-deep: #f8fafc;
        --jf-surface: #fff;
        --jf-surface-2: #f6f8fc;
        --jf-surface-strong: #fff;
        --jf-surface-muted: #f8fafc;
        --jf-surface-glass: #fff;
        --jf-surface-float: #fff;
        --jf-text: #17233d;
        --jf-text-soft: #475569;
        --jf-text-muted: #66748d;
        --jf-border: #e5eaf1;
        --jf-border-strong: #cbd5e1;
        --jf-divider: #e5eaf1;
        --jf-radius-sm: 9px;
        --jf-radius-md: 12px;
        --jf-radius-lg: 16px;
        --jf-radius-xl: 16px;
        --jf-shadow-rest: none;
        --jf-shadow-hover: 0 2px 6px rgba(23,35,61,.06);
        --jf-shadow-card: 0 5px 24px rgba(35,53,87,.025);
        --jf-shadow-overlay: 0 20px 60px rgba(22,44,95,.22);
        --mud-palette-primary: #4f39f6;
        --mud-palette-primary-rgb: 79,57,246;
        --mud-palette-primary-darken: #432dd7;
        --mud-palette-primary-lighten: #6c59f7;
        --mud-palette-primary-hover: rgba(79,57,246,.06);
        --mud-palette-text-primary: #17233d;
        --mud-palette-text-secondary: #526079;
        --mud-palette-background: #f8fafc;
        --mud-palette-surface: #fff;
        --mud-palette-lines-default: #e5eaf1;
        --mud-palette-table-lines: #e5eaf1;
        --mud-palette-divider: #e5eaf1;
        scrollbar-color: #94a3b8 #f8fafc;
    }
    html[data-ui-design="personnel"]:not([data-theme="dark"]) body {
        background: var(--jf-bg);
        color: var(--jf-text);
        font-family: "JafamPersonnel", sans-serif !important;
        font-weight: 400;
    }
    /* Avoid a universal font reset: keep icon fonts and explicitly LTR text.
       Sizes, line heights and virtualized row metrics stay component-owned. */
    html[data-ui-design="personnel"]:not([data-theme="dark"]) :is(.dahs-root, .mud-typography, .mud-input, .mud-input-control, .mud-button-root,
        .mud-table, .mud-nav-link, .mud-list-item, .mud-chip, .mud-tab, .mud-menu-item,
        .claim-track-page, .policy-member-page, .jafam-grid-toolbar) {
        font-family: var(--jf-font-fa) !important;
    }
    html[data-ui-design="personnel"]:not([data-theme="dark"]) :is(button, input, select, textarea) { font-family: var(--jf-font-fa) !important; }
    html[data-ui-design="personnel"]:not([data-theme="dark"]) :is(.mud-typography-body1, .mud-typography-body2) { font-weight: 500; }
    html[data-ui-design="personnel"]:not([data-theme="dark"]) :is(.mud-input-label, .mud-button-root, .mud-nav-link-text) { font-weight: 600; }
    html[data-ui-design="personnel"]:not([data-theme="dark"]) :is(.mud-typography-h4, .mud-typography-h5, .mud-typography-h6) { font-weight: 750; }
    html[data-ui-design="personnel"]:not([data-theme="dark"]) ::selection { background: #dbe4ff; color: #17233d; }
    html[data-ui-design="personnel"]:not([data-theme="dark"]) :where(a, button, input, select, textarea, [tabindex]):focus-visible {
        outline: 2px solid #5266cb;
        outline-offset: 3px;
    }
    /* A Mud field already marks focus on its own border; a native ring on the
       inner input would draw a second frame inside it. */
    html[data-ui-design="personnel"]:not([data-theme="dark"]) .mud-input :is(input, textarea, select, [tabindex]):focus-visible { outline: none; }
    html[data-ui-design="personnel"]:not([data-theme="dark"]) :is(input, textarea) { caret-color: #4f39f6; }
    html[data-ui-design="personnel"]:not([data-theme="dark"]) .dahs-root {
        --d-blue: #4f39f6;
        --d-blue-dark: #432dd7;
        --d-ink: #17233d;
        --d-muted: #66748d;
        --d-line: #e5eaf1;
        --d-bg: #f8fafc;
    }
    html[data-ui-design="personnel"]:not([data-theme="dark"]) :is(.dahs-topbar, .app-shell__appbar) {
        background: #fff !important;
        border-color: #e5eaf1;
        box-shadow: none !important;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    /* Decoration only, never interactive controls. */
    html[data-ui-design="personnel"]:not([data-theme="dark"]) :is(.app-shell__aurora, .app-shell__grid) { visibility: hidden; }
    html[data-ui-design="personnel"]:not([data-theme="dark"]) :is(.mud-card, .dahs-panel, .dahs-kpi-card, .fin-card, .fin-kpi, .fin-panel,
        .claim-track-panel, .policy-member-table-card) {
        border-radius: 16px !important;
        border-color: #e5eaf1;
        background-image: none !important;
        box-shadow: var(--jf-shadow-card) !important;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    html[data-ui-design="personnel"]:not([data-theme="dark"]) :is(.mud-card:not([class*="mud-theme-"]), .dahs-panel,
        .policy-member-table-card) { background-color: #fff; }
    /* Preserve every filter, label, clear action and dependent control. */
    html[data-ui-design="personnel"]:not([data-theme="dark"]) :is(.claim-track-filter-bar, .physician-confirm-filter-bar,
        .wait-confirm-filter-bar, .financial-queue-filter-bar, .expense-filter-shell,
        .policy-member-filter-card, .center-filter-panel, .provider-filter-panel,
        .outpay-filter-bar, .lightstyle-filter-bar, .jafam-grid-toolbar, .jafam-grid-filter-panel) {
        background: #fff !important;
        border-color: #e5eaf1;
        border-radius: 12px;
        box-shadow: none !important;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        color: #17233d;
    }
    html[data-ui-design="personnel"]:not([data-theme="dark"]) :is(.fin-panel__head, .dahs-search, .jafam-grid-search, .jafam-grid-date) {
        background: #f8fafc;
        border-color: #e5eaf1;
        box-shadow: none;
    }
    html[data-ui-design="personnel"]:not([data-theme="dark"]) .mud-button-root { box-shadow: none !important; text-transform: none; }
    html[data-ui-design="personnel"]:not([data-theme="dark"]) :is(.mud-button, .claim-track-btn, .policy-member-action, .jafam-grid-toolbar-button) {
        border-radius: 12px !important;
    }
    html[data-ui-design="personnel"]:not([data-theme="dark"]) :is(.mud-input-slot, .mud-select-input, .mud-input-root, .mud-input-outlined-border) {
        border-radius: 9px !important;
    }
    html[data-ui-design="personnel"]:not([data-theme="dark"]) .mud-input-error .mud-input-outlined-border { border-color: var(--mud-palette-error) !important; }
    html[data-ui-design="personnel"]:not([data-theme="dark"]) .mud-input-control:not(.mud-input-error):focus-within .mud-input-outlined-border {
        border-color: #5266cb !important;
    }
    html[data-ui-design="personnel"]:not([data-theme="dark"]) :is(.mud-input-control input, .jafam-grid-search input)::placeholder {
        color: #66748d;
        opacity: 1;
    }
    html[data-ui-design="personnel"]:not([data-theme="dark"]) .mud-popover {
        border-radius: 12px;
        box-shadow: 0 12px 32px rgba(23,35,61,.16);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    html[data-ui-design="personnel"]:not([data-theme="dark"]) .jafam-messagebox .jafam-messagebox__body { min-width: 0; overflow-wrap: anywhere; }
    /* Dropdown lists: compact rows at field text size, a quiet selection tint and
       a thin scrollbar. Placement, width and max-height stay Mud-owned. */
    html[data-ui-design="personnel"]:not([data-theme="dark"]) :is(.mud-popover, .mud-popover *) { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
    html[data-ui-design="personnel"]:not([data-theme="dark"]) .mud-popover .mud-list-item.mud-list-item-clickable {
        min-height: 36px;
        padding: 7px 12px;
        color: #17233d;
    }
    html[data-ui-design="personnel"]:not([data-theme="dark"]) .mud-popover .mud-list-item :is(.mud-typography-body1, .mud-typography-body2) {
        font-size: .8125rem;
        line-height: 1.45;
    }
    html[data-ui-design="personnel"]:not([data-theme="dark"]) .mud-popover .mud-list-item-clickable:not(.mud-selected-item):hover { background-color: #f5f7fb; }
    html[data-ui-design="personnel"]:not([data-theme="dark"]) .mud-popover .mud-list-item.mud-selected-item {
        background-color: #eef2ff !important;
        color: #3730a3 !important;
    }
    html[data-ui-design="personnel"]:not([data-theme="dark"]) .mud-popover .mud-list-item.mud-selected-item .mud-typography { font-weight: 600; }
    /* site.css paints every filled or required outlined label in the primary
       blue. Like the reference, only focus is blue; validation, disabled and
       page-specific label colors (higher specificity) keep their own. */
    html[data-ui-design="personnel"]:not([data-theme="dark"]) :where(.mud-input-control:not(.mud-input-error)) :where(.mud-input-outlined:not(.mud-input-error, .mud-disabled)) ~ .mud-input-label:where(:not(.mud-input-error, .mud-disabled)) {
        color: #66748d !important;
    }
    html[data-ui-design="personnel"]:not([data-theme="dark"]) :where(.mud-input-control:not(.mud-input-error)) :where(.mud-input-outlined:not(.mud-input-error, .mud-disabled):focus-within) ~ .mud-input-label:where(:not(.mud-input-error, .mud-disabled)) {
        color: #5266cb !important;
    }
}
/* Touch targets only in toolbars, never virtualized rows or inline editors. */
@media screen and (max-width: 600px) {
    html[data-ui-design="personnel"]:not([data-theme="dark"]) :is(.claim-track-filter-actions, .physician-confirm-filter-bar, .wait-confirm-filter-bar,
        .financial-queue-filter-bar, .expense-filter-shell, .policy-member-filter-card,
        .center-filter-panel, .provider-filter-panel, .outpay-filter-bar,
        .lightstyle-filter-bar, .jafam-grid-toolbar, .jafam-grid-filter-panel) :is(.mud-button, .mud-icon-button) {
        min-height: 44px;
        min-width: 44px;
    }
    html[data-ui-design="personnel"]:not([data-theme="dark"]) :is(.claim-track-filter-actions, .jafam-grid-toolbar-actions) {
        flex-wrap: wrap;
        white-space: normal;
    }
}
