/* FieldOps design-system entry point. Legacy feature styles are routed here and
   can now be retired one area at a time without growing App.razor. */
@import url("web-polish.css");
@import url("assignment-work-details.css");
@import url("assignment-workflow.css");
@import url("assignment-details-refinements.css");
@import url("assignment-details-polish.css");
@import url("users-specialty.css");
@import url("web-catalog-polish.css");
@import url("users-polish.css");
@import url("header-actions-polish.css");
@import url("phase3-directory.css");

/* Theme (FR-06.1): js/fieldops-theme.js publishes the effective theme as html[data-theme].
   This block is the Light palette and the authoritative token set. Every colour token the Dark block
   overrides is also declared here. Legacy literals use these tokens or light-dark(<Light literal>, <Dark token>). */
:root {
    --fo-navy: #07175e;
    --fo-royal: #243bdb;
    --fo-cyan: #0ea5d9;
    --fo-aqua: #67e8f9;
    --fo-on-brand: #dbeafe;
    --fo-on-brand-muted: #c1d5f5;
    --fo-on-brand-subtle: #b3c9ed;
    --fo-primary-50: #eff6ff;
    --fo-primary-100: #dbeafe;
    --fo-primary-200: #bfdbfe;
    --fo-primary-500: #1768dd;
    --fo-primary-600: #1768dd;
    --fo-primary-700: #1456b8;
    --fo-text: #0f172a;
    --fo-text-secondary: #475569;
    --fo-text-muted: #64748b;
    --fo-text-subtle: #94a3b8;
    --fo-surface: #ffffff;
    --fo-surface-subtle: #f8fafc;
    --fo-canvas: #f5f8fd;
    --fo-border: #dfe8f4;
    --fo-border-strong: #cbd5e1;
    --fo-success-50: #f0fdf4;
    --fo-success-200: #bbf7d0;
    --fo-success-700: #15803d;
    --fo-warning-50: #fffbeb;
    --fo-warning-200: #fde68a;
    --fo-warning-700: #92400e;
    --fo-danger-50: #fef2f2;
    --fo-danger-100: #fee2e2;
    --fo-danger-200: #fecaca;
    --fo-danger-500: #ef4444;
    --fo-danger-600: #dc2626;
    --fo-danger-700: #b91c1c;
    --fo-focus: #1768dd;
    --fo-focus-halo: rgba(23, 104, 221, .16);
    --fo-font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --fo-font-caption: .8125rem;
    --fo-font-small: .875rem;
    --fo-font-body: .9375rem;
    --fo-font-title: 1.125rem;
    --fo-font-heading: clamp(1.55rem, 2vw, 2rem);
    --fo-line-height: 1.5;
    --fo-space-1: 4px;
    --fo-space-2: 8px;
    --fo-space-3: 12px;
    --fo-space-4: 16px;
    --fo-space-5: 24px;
    --fo-space-6: 32px;
    --fo-radius-sm: 8px;
    --fo-radius-md: 12px;
    --fo-radius-lg: 16px;
    --fo-radius-xl: 22px;
    --fo-radius-pill: 999px;
    --fo-shadow-card: 0 6px 24px rgba(7, 23, 94, .06);
    --fo-shadow-overlay: 0 16px 48px rgba(7, 23, 94, .16);
    --fo-transition: 150ms ease;
    --fo-control-height: 44px;
    --fo-brand-gradient: linear-gradient(135deg, var(--fo-navy), var(--fo-royal));
    /* Brand action colours are theme-independent; text on them uses --fo-on-accent, never --fo-surface. */
    --fo-brand-600: #1768dd;
    --fo-brand-700: #1456b8;
    --fo-accent: var(--fo-brand-600);
    --fo-accent-hover: var(--fo-brand-700);
    --fo-on-accent: #ffffff;
    --fo-action-gradient: linear-gradient(135deg, var(--fo-accent), var(--fo-accent-hover));
    --fo-link: var(--fo-primary-600);
    --fo-link-hover: var(--fo-primary-700);
    --fo-surface-elevated: var(--fo-surface);
    --fo-surface-hover: var(--fo-surface-subtle);
    --fo-selected: var(--fo-primary-50);
    --fo-backdrop: rgba(15, 23, 42, .4);
    --fo-info-50: var(--fo-primary-50);
    --fo-info-200: var(--fo-primary-200);
    --fo-info-700: var(--fo-primary-700);
    --fo-input-background: var(--fo-surface);
    --fo-table-header: var(--fo-surface-subtle);
    --fo-disabled-background: var(--fo-surface-subtle);
    --fo-disabled-text: var(--fo-text-muted);
    --fo-date-text: var(--fo-text);
    --fo-date-muted: var(--fo-text-muted);
    --fo-date-hover: var(--fo-primary-50);
    --fo-date-hover-text: #1d4ed8;
    --fo-status-active-text: #5b21b6;
    --fo-status-active-surface: #ede9fe;
    --fo-status-pending-text: #854d0e;
    --fo-status-pending-surface: #fef9c3;
    --fo-status-success-text: #166534;
    --fo-status-success-surface: #dcfce7;
    --fo-provider-ote-text: #075bb4;
    --fo-provider-ote-surface: #f5f9ff;
    --fo-provider-ote-border: #e2edfc;
    --fo-provider-ote-dot: #2387e8;
    --fo-provider-vodafone-text: #b4232f;
    --fo-provider-vodafone-surface: #fff7f8;
    --fo-provider-vodafone-border: #fce7eb;
    --fo-provider-vodafone-dot: #e60014;
    --fo-provider-dei-text: #0f766e;
    --fo-provider-dei-surface: #f3fbf8;
    --fo-provider-dei-border: #d7f2e8;
    --fo-provider-dei-dot: #0f9f8f;
    /* Legacy business-page roles (FR-06.2): Light values equal the literals they replaced. */
    --fo-text-strong: #172033;
    --fo-text-emphasis: #334155;
    --fo-link-strong: #2563eb;
    --fo-link-strong-hover: #1d4ed8;
    --fo-link-deep: #1e40af;
    --fo-action-600: #2563eb;
    --fo-action-700: #1d4ed8;
    --fo-surface-muted: #f1f5f9;
    --fo-surface-tint: #f8fbff;
    --fo-surface-tint-soft: #fbfdff;
    --fo-surface-tint-blue: #f7fbff;
    --fo-border-soft: #e2e8f0;
    --fo-border-faint: #eef2f7;
    --fo-primary-300: #93c5fd;
    --fo-primary-400: #60a5fa;
    --fo-danger-800: #991b1b;
    --fo-danger-strong: #dc2626;
    --fo-warning-100: #fef3c7;
    --fo-orange-50: #fff7ed;
    --fo-orange-100: #ffedd5;
    --fo-orange-200: #fed7aa;
    --fo-orange-800: #9a3412;
}

/* Dark palette: navy/slate surfaces that keep the FieldOps blue identity (seeded from the former
   report-only dark palette). Brand colours (navy, royal, cyan, brand-600/700) are not overridden. */
:root[data-theme="dark"] {
    --fo-primary-50: #172d4d;
    --fo-primary-100: #1c3b67;
    --fo-primary-200: #31598d;
    --fo-primary-500: #5b9bff;
    --fo-primary-600: #6ea8ff;
    --fo-primary-700: #9bc6ff;
    --fo-text: #eef4ff;
    --fo-text-secondary: #c7d4e8;
    --fo-text-muted: #a8b8cf;
    --fo-text-subtle: #8fa1bb;
    --fo-surface: #142237;
    --fo-surface-subtle: #192a40;
    --fo-canvas: #0e192a;
    --fo-border: #2c405b;
    --fo-border-strong: #46617f;
    --fo-success-50: #143a32;
    --fo-success-200: #235748;
    --fo-success-700: #79d8ad;
    --fo-warning-50: #392f1d;
    --fo-warning-200: #5f4b22;
    --fo-warning-700: #f3c678;
    --fo-danger-50: #452833;
    --fo-danger-100: #55303d;
    --fo-danger-200: #6f3a48;
    --fo-danger-500: #f97282;
    --fo-danger-700: #f9a7b1;
    --fo-focus: #82b5ff;
    --fo-focus-halo: rgb(130 181 255 / .25);
    --fo-shadow-card: 0 6px 24px rgb(0 0 0 / .16);
    --fo-shadow-overlay: 0 18px 50px rgb(0 0 0 / .45);
    --fo-link: #8dbbff;
    --fo-link-hover: #b9d5ff;
    --fo-surface-elevated: #1a2c46;
    --fo-surface-hover: #1f3350;
    --fo-backdrop: rgb(2 6 23 / .62);
    --fo-input-background: #101d30;
    --fo-date-hover-text: var(--fo-primary-700);
    --fo-status-active-text: #cdbdff;
    --fo-status-active-surface: #2e2552;
    --fo-status-pending-text: #f3d37a;
    --fo-status-pending-surface: #3a321a;
    --fo-status-success-text: #8ee2b0;
    --fo-status-success-surface: #173a2a;
    --fo-provider-ote-text: #8cc4ff;
    --fo-provider-ote-surface: #13263f;
    --fo-provider-ote-border: #24446c;
    --fo-provider-ote-dot: #4aa3f5;
    --fo-provider-vodafone-text: #ffa3ab;
    --fo-provider-vodafone-surface: #33202a;
    --fo-provider-vodafone-border: #5a2c39;
    --fo-provider-vodafone-dot: #ff5a68;
    --fo-provider-dei-text: #74dccb;
    --fo-provider-dei-surface: #11302d;
    --fo-provider-dei-border: #1f4f49;
    --fo-provider-dei-dot: #2cc4b0;
    --fo-text-strong: #eef4ff;
    --fo-text-emphasis: #dbe5f3;
    --fo-link-strong: #8dbbff;
    --fo-link-strong-hover: #b9d5ff;
    --fo-link-deep: #c3dbff;
    --fo-surface-muted: #1c2d45;
    --fo-surface-tint: #17263c;
    --fo-surface-tint-soft: #162438;
    --fo-surface-tint-blue: #172840;
    --fo-border-soft: #2a3d57;
    --fo-border-faint: #24364f;
    --fo-primary-300: #4a78b8;
    --fo-primary-400: #6ea8ff;
    --fo-danger-800: #fbb4bc;
    --fo-danger-strong: #f97282;
    --fo-warning-100: #4a3b17;
    --fo-orange-50: #3a2418;
    --fo-orange-100: #4a2c19;
    --fo-orange-200: #6b3f22;
    --fo-orange-800: #fdba8c;
}

.confirm-delete-button {
    min-height: 40px;
    padding: 0 16px;
    color: var(--fo-on-accent);
    background: var(--fo-danger-600);
    border: 0;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
}

.confirm-delete-button:is(:hover, :active):not(:disabled) {
    background: #b91c1c;
}

/* Keep the red fill distinct from Dark dialog surfaces without changing button dimensions. */
:root[data-theme="dark"] .confirm-delete-button:not(:disabled) {
    box-shadow: inset 0 0 0 1px var(--fo-danger-500);
}

.confirm-delete-button:disabled {
    color: var(--fo-disabled-text);
    background: var(--fo-disabled-background);
    cursor: not-allowed;
}

/* Fluent UI v5 publishes its tokens on html (adopted stylesheet); in Dark mode its neutral surfaces
   follow the FieldOps palette. */
:root[data-theme="dark"] {
    --colorNeutralBackground1: var(--fo-surface-elevated);
    --colorNeutralBackground1Hover: var(--fo-surface-hover);
    --colorNeutralBackground1Pressed: var(--fo-surface-subtle);
    --colorNeutralBackground1Selected: var(--fo-selected);
    --colorNeutralForeground1: var(--fo-text);
    --colorNeutralForeground2: var(--fo-text-secondary);
    --colorNeutralForeground3: var(--fo-text-muted);
    --colorNeutralStroke1: var(--fo-border-strong);
    --colorNeutralStroke2: var(--fo-border);
}

/* Fluent UI v5 styles buttons on the host rather than a control shadow part. */
:is(.catalog-filter-actions, .dialog-actions, .heading-actions, .ui-state-actions) fluent-button {
    min-height: var(--fo-control-height);
}

fluent-button {
    border-radius: var(--fo-radius-sm);
    font-family: var(--fo-font-family);
    font-size: var(--fo-font-small);
    font-weight: 650;
    transition: background var(--fo-transition), border-color var(--fo-transition), box-shadow var(--fo-transition);
}

@media (forced-colors: none) {
    fluent-button[appearance="primary"]:where(:not([disabled]):not([disabled-focusable])) {
        background: var(--fo-accent);
        border-color: var(--fo-accent);
        color: var(--fo-on-accent);
    }

    fluent-button[appearance="primary"]:where(:not([disabled]):not([disabled-focusable])):hover {
        background: var(--fo-accent-hover);
        border-color: var(--fo-accent-hover);
    }

    fluent-button[disabled] {
        opacity: .6;
        box-shadow: none;
    }

    fluent-button:focus-visible {
        outline: 2px solid var(--fo-focus);
        outline-offset: 3px;
    }
}

fluent-text-input::part(root),
fluent-textarea::part(root) {
    border-radius: var(--fo-radius-sm);
}

/* The v5 dropdown does not export its control; its shadow DOM consumes tokens. */
fluent-dropdown {
    --borderRadiusMedium: var(--fo-radius-sm);
}

@media (forced-colors: none) {
    fluent-text-input::part(root),
    fluent-textarea::part(root) { border-color: var(--fo-border-strong); }

    fluent-dropdown { --colorNeutralStroke1: var(--fo-border-strong); }

    fluent-text-input:focus-within::part(root),
    fluent-textarea:focus-within::part(root) {
        border-color: var(--fo-primary-600);
        box-shadow: 0 0 0 3px var(--fo-focus-halo);
    }

    fluent-dropdown:focus-within {
        --colorNeutralStroke1: var(--fo-primary-600);
        outline: 2px solid var(--fo-focus);
        outline-offset: 2px;
        border-radius: var(--fo-radius-sm);
    }
}

/* Match the specificity of Fluent's appearance rules. */
.fluent-card:not([appearance]),
.fluent-card[appearance="default"],
fluent-dialog::part(dialog) {
    background: var(--fo-surface);
    border: 1px solid var(--fo-border);
    border-radius: var(--fo-radius-lg);
    box-shadow: var(--fo-shadow-card);
}

fluent-dialog::part(dialog) { box-shadow: var(--fo-shadow-overlay); }

.responsive-table { color: var(--fo-text); font-size: var(--fo-font-small); }
.responsive-table th { background: var(--fo-table-header); color: var(--fo-text-secondary); }

@media (pointer: coarse) {
    fluent-button {
        min-height: var(--fo-control-height);
        min-width: var(--fo-control-height);
    }
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.ui-action-group { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.responsive-table .row-action-cell { text-align: center; vertical-align: middle; justify-items: center; }
.responsive-table.centered-list > :is(thead, tbody) > tr > :is(th, td) {
    text-align: center;
    vertical-align: middle;
    justify-items: center;
}

/* Consistent high-emphasis create actions. */
.ui-create-action {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

a.ui-create-action.new-assignment-link,
a.ui-create-action.new-assignment-action,
a.ui-create-action.fo-hub-action,
button.ui-create-action {
    min-height: 48px;
    padding: 0 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    box-sizing: border-box;
    color: #fff;
    background: var(--fo-action-gradient);
    border: 1px solid var(--fo-accent-hover);
    border-radius: 12px;
    box-shadow: 0 9px 20px rgba(37, 99, 235, .22), inset 0 1px 0 rgba(255, 255, 255, .2);
    font-family: inherit;
    font-size: var(--fo-font-small);
    font-weight: 780;
    letter-spacing: .005em;
    appearance: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}

a.ui-create-action.new-assignment-link:hover,
a.ui-create-action.new-assignment-action:hover,
a.ui-create-action.fo-hub-action:hover,
button.ui-create-action:hover:not(:disabled) {
    color: #fff;
    background: linear-gradient(135deg, var(--fo-accent-hover), var(--fo-navy));
    border-color: var(--fo-navy);
    box-shadow: 0 13px 26px rgba(37, 99, 235, .28), inset 0 1px 0 rgba(255, 255, 255, .16);
    transform: translateY(-2px);
}

a.ui-create-action.new-assignment-link:active,
a.ui-create-action.new-assignment-action:active,
a.ui-create-action.fo-hub-action:active,
button.ui-create-action:active:not(:disabled) {
    box-shadow: 0 5px 12px rgba(37, 99, 235, .2), inset 0 1px 2px rgba(15, 23, 42, .12);
    transform: translateY(0);
}

a.ui-create-action.new-assignment-link:focus-visible,
a.ui-create-action.new-assignment-action:focus-visible,
a.ui-create-action.fo-hub-action:focus-visible,
button.ui-create-action:focus-visible {
    outline: 3px solid var(--fo-focus);
    outline-offset: 3px;
}

button.ui-create-action:disabled {
    opacity: .62;
    box-shadow: none;
    transform: none;
    cursor: not-allowed;
}

.ui-create-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    display: inline-grid;
    place-items: center;
    box-sizing: border-box;
    color: #fff;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 9px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
    line-height: 1;
}

.ui-create-icon svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ui-create-action > span:not(.ui-create-icon) {
    display: inline-flex;
    align-items: center;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    line-height: 1.2;
    text-transform: none;
}

/* Secondary refresh actions with a distinct icon surface and loading feedback. */
button.ui-refresh-action.dashboard-refresh,
button.ui-refresh-action.refresh-button {
    min-height: 44px;
    min-width: 142px;
    padding: 6px 14px 6px 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    box-sizing: border-box;
    color: var(--fo-primary-700);
    background: linear-gradient(180deg, #eff6ff 0%, #e8f1ff 100%);
    border: 1px solid var(--fo-primary-200);
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(37, 99, 235, .07);
    font-family: inherit;
    font-size: .8rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
}

button.ui-refresh-action.dashboard-refresh:hover:not(:disabled),
button.ui-refresh-action.refresh-button:hover:not(:disabled) {
    color: #1e40af;
    background: #dbeafe;
    border-color: #93c5fd;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .12);
    transform: translateY(-1px);
}

button.ui-refresh-action.dashboard-refresh:active:not(:disabled),
button.ui-refresh-action.refresh-button:active:not(:disabled) {
    box-shadow: 0 3px 8px rgba(37, 99, 235, .1);
    transform: translateY(0);
}

button.ui-refresh-action.dashboard-refresh:focus-visible,
button.ui-refresh-action.refresh-button:focus-visible {
    outline: 3px solid var(--fo-focus);
    outline-offset: 3px;
}

button.ui-refresh-action.dashboard-refresh:disabled,
button.ui-refresh-action.refresh-button:disabled {
    opacity: .64;
    box-shadow: none;
    transform: none;
    cursor: wait;
}

button.ui-refresh-action .ui-refresh-symbol {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    color: var(--fo-primary-700);
    background: #fff;
    border: 1px solid var(--fo-primary-100);
    border-radius: 50%;
}

button.ui-refresh-action .ui-refresh-icon {
    width: 21px;
    height: 21px;
    display: block;
    transform-origin: center;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .35s ease;
}

button.ui-refresh-action:not(:disabled):hover .ui-refresh-icon,
button.ui-refresh-action:not(:disabled):focus-visible .ui-refresh-icon {
    transform: rotate(90deg);
}

button.ui-refresh-action[aria-busy="true"] .ui-refresh-icon {
    animation: ui-refresh-spin .85s linear infinite;
}

@keyframes ui-refresh-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    button.ui-refresh-action.dashboard-refresh,
    button.ui-refresh-action.refresh-button {
        transition: none;
    }

    button.ui-refresh-action[aria-busy="true"] .ui-refresh-icon {
        animation: none;
    }

    button.ui-refresh-action .ui-refresh-icon {
        transition: none;
    }

    button.ui-refresh-action:not(:disabled):hover .ui-refresh-icon,
    button.ui-refresh-action:not(:disabled):focus-visible .ui-refresh-icon {
        transform: none;
    }
}

@media (pointer: coarse) {
    a.ui-create-action.new-assignment-link,
    a.ui-create-action.new-assignment-action,
    button.ui-create-action,
    button.ui-refresh-action.dashboard-refresh,
    button.ui-refresh-action.refresh-button {
        min-height: 48px;
    }
}

@media (max-width: 460px) {
    button.ui-refresh-action.dashboard-refresh,
    button.ui-refresh-action.refresh-button {
        min-width: 0;
        padding-inline: 7px;
        gap: 7px;
        font-size: .75rem;
    }
}

/* Navigation hubs (Reports, Catalogs): destination cards and the return link back to a hub. */
.fo-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: var(--fo-space-4);
}

.fo-hub-card {
    min-width: 0;
    padding: var(--fo-space-5);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--fo-space-3);
    box-sizing: border-box;
    background: var(--fo-surface);
    border: 1px solid var(--fo-border);
    border-radius: var(--fo-radius-lg);
    box-shadow: var(--fo-shadow-card);
}

.fo-hub-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: var(--fo-primary-700);
    background: var(--fo-primary-50);
    border: 1px solid var(--fo-primary-200);
    border-radius: var(--fo-radius-md);
}

.fo-hub-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.fo-hub-card h2 {
    margin: 0;
    color: var(--fo-text);
    font-size: var(--fo-font-title);
    font-weight: 700;
}

.fo-hub-card p {
    margin: 0;
    flex: 1 1 auto;
    color: var(--fo-text-muted);
    font-size: var(--fo-font-small);
    line-height: var(--fo-line-height);
}

.fo-hub-card .fo-hub-action { margin-top: var(--fo-space-1); }

.fo-return-link {
    width: fit-content;
    min-height: 32px;
    margin-bottom: var(--fo-space-2);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--fo-text-muted);
    text-decoration: none;
    font-size: var(--fo-font-caption);
    font-weight: 650;
    transition: color var(--fo-transition), transform var(--fo-transition);
}

.fo-return-link:hover {
    color: var(--fo-primary-700);
    transform: translateX(-2px);
}

.fo-return-link svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.catalog-filter-card {
    overflow: hidden;
    background: rgba(255, 255, 255, .96);
    border: 1px solid var(--fo-border);
    border-radius: var(--fo-radius-lg);
    box-shadow: var(--fo-shadow-card);
}

.catalog-filter-heading {
    min-height: 64px;
    padding: 12px 18px;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    box-sizing: border-box;
    background: linear-gradient(135deg, #fff, #f8fbff);
    border-bottom: 1px solid var(--fo-border);
}

.catalog-filter-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: var(--fo-primary-700);
    background: var(--fo-primary-50);
    border: 1px solid var(--fo-primary-200);
    border-radius: 10px;
}

.catalog-filter-icon svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.catalog-filter-heading > div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.catalog-filter-heading strong {
    color: var(--fo-text);
    font-size: .8rem;
}

.catalog-filter-heading small {
    overflow: hidden;
    color: var(--fo-text-muted);
    font-size: .67rem;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.catalog-filter-active {
    min-height: 27px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    color: var(--fo-primary-700);
    background: var(--fo-primary-50);
    border: 1px solid var(--fo-primary-200);
    border-radius: 999px;
    font-size: .62rem;
    font-weight: 760;
    white-space: nowrap;
}

.catalog-filter-fields {
    padding: 16px 18px 18px;
    display: grid;
    align-items: end;
    gap: 14px;
}

.catalog-filter-fields.three-fields {
    grid-template-columns: minmax(260px, 1.55fr) minmax(165px, .8fr) minmax(165px, .8fr) auto;
}

.catalog-filter-fields.two-fields {
    grid-template-columns: minmax(300px, 2fr) minmax(190px, .85fr) auto;
}

.catalog-filter-fields.assignment-fields {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.assignment-fields .search-field,
.assignment-fields .catalog-filter-actions {
    grid-column: span 2;
}

.catalog-filter-field {
    min-width: 0;
    display: grid;
    gap: 7px;
}

.catalog-filter-field > span {
    padding-left: 2px;
    color: var(--fo-text-secondary);
    font-size: .7rem;
    font-weight: 750;
}

.catalog-filter-field input,
.catalog-filter-field select {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    box-sizing: border-box;
    color: var(--fo-text);
    background: var(--fo-surface);
    border: 1px solid var(--fo-border-strong);
    border-radius: 10px;
    font: inherit;
    font-size: .8rem;
    transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}

.catalog-filter-field input::placeholder { color: var(--fo-text-subtle); }
.catalog-filter-field input:hover,
.catalog-filter-field select:hover { border-color: var(--fo-text-subtle); background: #fbfdff; }
.catalog-filter-field input:focus,
.catalog-filter-field select:focus { border-color: var(--fo-primary-500); box-shadow: 0 0 0 3px var(--fo-focus-halo); outline: none; }

.catalog-filter-actions {
    min-height: 44px;
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    gap: 8px;
}

.catalog-filter-actions fluent-button { min-width: 108px; }
.catalog-filter-actions fluent-button { min-height: 44px; padding-inline: 15px; border-radius: 10px; font-weight: 720; }

.catalog-filter-message {
    margin: 0 18px 12px;
    padding: 10px 12px;
    border: 1px solid;
    border-radius: 9px;
    font-size: .72rem;
    line-height: 1.45;
}

.catalog-filter-message:last-child { margin-bottom: 18px; }
.catalog-filter-message.error { color: var(--fo-danger-700); background: var(--fo-danger-50); border-color: var(--fo-danger-200); }
.catalog-filter-message.warning { color: var(--fo-warning-700); background: var(--fo-warning-50); border-color: var(--fo-warning-200); }

@media (max-width: 1180px) {
    .catalog-filter-fields.assignment-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1050px) {
    .catalog-filter-fields.three-fields,
    .catalog-filter-fields.two-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .catalog-filter-fields .search-field,
    .catalog-filter-actions { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
    .catalog-filter-heading { grid-template-columns: 36px minmax(0, 1fr); }
    .catalog-filter-heading small { white-space: normal; }
    .catalog-filter-active { grid-column: 2; justify-self: start; }
    .catalog-filter-fields.three-fields,
    .catalog-filter-fields.two-fields,
    .catalog-filter-fields.assignment-fields { padding: 15px; grid-template-columns: 1fr; }
    .catalog-filter-fields .search-field,
    .catalog-filter-actions,
    .assignment-fields .catalog-filter-actions { grid-column: auto; }
    .catalog-filter-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .catalog-filter-actions fluent-button { width: 100%; min-width: 0; }
}

@media (max-width: 420px) {
    .catalog-filter-actions { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .responsive-table.centered-list { display: block; }
    .responsive-table.centered-list > colgroup { display: none; }
    .responsive-table.centered-list > tbody { width: 100%; box-sizing: border-box; }
    .table-scroll:has(.responsive-table) { overflow: visible; }
    .responsive-table { min-width: 0 !important; table-layout: auto !important; }
    .responsive-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .responsive-table tbody { padding: 12px; display: grid; gap: 12px; }
    .responsive-table tbody tr { padding: 14px; display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 18px; background: var(--fo-surface); border: 1px solid var(--fo-border); border-radius: var(--fo-radius-md); box-shadow: 0 4px 16px rgba(15, 23, 42, .04); }
    .responsive-table tbody td { width: auto !important; min-width: 0 !important; padding: 0 !important; display: grid !important; align-content: start; gap: 5px; border: 0 !important; white-space: normal !important; }
    .responsive-table tbody td::before { content: attr(data-label); color: var(--fo-text-muted); font-size: .62rem; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; }
    .responsive-table tbody td[data-priority="primary"],
    .responsive-table tbody td[data-actions] { grid-column: 1 / -1; }
    .responsive-table tbody td[data-actions] { padding-top: 11px !important; border-top: 1px solid var(--fo-border) !important; }
    .responsive-table tbody td[data-actions]::before { content: none; }
    .responsive-table .ui-action-group { justify-content: flex-start; }
}

@media (max-width: 480px) {
    .responsive-table tbody tr { grid-template-columns: 1fr; }
}

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

/* Keep Fluent's native system colors available in high-contrast mode. */
@media (forced-colors: none) {
/* Return-to-surveyor actions require a reason before they become available. */
fluent-button.correction-action {
    background: #c2410c;
    border-color: #c2410c;
    color: #fff;
}
fluent-button.correction-action:not([disabled]):hover {
    background: #9a3412;
    border-color: #9a3412;
}
fluent-button.correction-action:focus-within {
    outline: 2px solid #c2410c;
    outline-offset: 3px;
}
fluent-button.correction-action[disabled] {
    background: var(--fo-orange-100);
    border-color: var(--fo-orange-200);
    color: var(--fo-orange-800);
    opacity: 0.65;
}
}

/* FieldOps calendar styling shared across isolated Razor pages. */
.fo-date-picker-field .fo-date-picker {
    height: var(--fo-date-height, 46px);
    min-width: 0;
    color: var(--fo-date-text, #0f172a);
    font-size: .86rem;
}

.fo-date-picker-field .fluent-calendar {
    --calendar-cell-size: 34px;
    --calendar-gap: 2px;
    font-family: inherit;
    font-size: .84rem;
}

.fo-date-picker-field .fluent-calendar .title {
    color: var(--fo-date-text, #0f172a);
    font-weight: 700;
}

.fo-date-picker-field .fluent-calendar .week-day {
    color: var(--fo-date-muted, #64748b);
    font-size: .75rem;
}

.fo-date-picker-field .fluent-calendar .day {
    border-radius: 9px;
}

.fo-date-picker-field .fluent-calendar .day[selected] {
    color: #fff;
    background: #2563eb;
    border-color: #2563eb;
}

.fo-date-picker-field .fluent-calendar .day:not([disabled]):not([selected]):hover {
    background: var(--fo-date-hover, #eff6ff);
    color: var(--fo-date-hover-text, #1d4ed8);
}

.fo-date-picker-field .fluent-calendar .day[disabled] {
    color: #94a3b8;
}

.fo-date-picker-field .fluent-calendar .day[disabled]::before {
    content: none;
}

/* ---- Dark theme: shared controls whose Light values are literals (FR-06.1). ---- */
:root[data-theme="dark"] .catalog-filter-card { background: color-mix(in srgb, var(--fo-surface) 96%, transparent); }
:root[data-theme="dark"] .catalog-filter-heading { background: linear-gradient(135deg, var(--fo-surface), var(--fo-surface-subtle)); }
:root[data-theme="dark"] :is(.catalog-filter-field input, .catalog-filter-field select) { background: var(--fo-input-background); }
:root[data-theme="dark"] :is(.catalog-filter-field input:hover, .catalog-filter-field select:hover) { background: var(--fo-surface-hover); }

:root[data-theme="dark"] :is(button.ui-refresh-action.dashboard-refresh, button.ui-refresh-action.refresh-button) {
    background: var(--fo-primary-50);
    box-shadow: none;
}

:root[data-theme="dark"] :is(button.ui-refresh-action.dashboard-refresh, button.ui-refresh-action.refresh-button):hover:not(:disabled) {
    color: var(--fo-primary-700);
    background: var(--fo-primary-100);
    border-color: var(--fo-primary-200);
}

:root[data-theme="dark"] button.ui-refresh-action .ui-refresh-symbol {
    background: var(--fo-surface);
    border-color: var(--fo-primary-200);
}

:root[data-theme="dark"] :is(a.ui-create-action, button.ui-create-action) {
    box-shadow: 0 9px 20px rgb(0 0 0 / .3), inset 0 1px 0 rgba(255, 255, 255, .14);
}

/* Date pickers: the Fluent field and its calendar popover follow the FieldOps surfaces. */
:root[data-theme="dark"] .fo-date-picker-field .fo-date-picker fluent-text-input:not([aria-invalid="true"])::part(root) {
    background: var(--fo-input-background);
    border-color: var(--fo-border-strong);
}

:root[data-theme="dark"] .fo-date-picker-field .fo-date-picker fluent-text-input::part(control) { color: var(--fo-text); }
:root[data-theme="dark"] .fo-date-picker-field .fo-date-picker svg { color: var(--fo-primary-700); }
:root[data-theme="dark"] .fo-date-picker-field .fluent-calendar .day[disabled] { color: var(--fo-text-subtle); }

:root[data-theme="dark"] .fo-date-picker-field fluent-popover-b::part(dialog) {
    color: var(--fo-text);
    background: var(--fo-surface-elevated);
    border-color: var(--fo-border-strong);
    box-shadow: var(--fo-shadow-overlay);
}

/* Secondary Fluent buttons on converted surfaces. */
:root[data-theme="dark"] :is(.fo-report-export, .fo-report-filter-actions, .fo-report-table-panel, .catalog-filter-actions, .fo-directory-pagination) fluent-button:not([appearance="primary"]) {
    color: var(--fo-text);
    background: var(--fo-surface-subtle);
    border-color: var(--fo-border-strong);
}

:root[data-theme="dark"] fluent-dialog::part(dialog) { background: var(--fo-surface-elevated); }
