:root {
    color-scheme: light;
    --bg: #f8f9fb;
    --surface: #ffffff;
    --surface-soft: #f3f6f9;
    --surface-muted: #eef2f6;
    --border: #d9e1e8;
    --border-soft: #e8edf2;
    --text: #18232f;
    --text-muted: #5f6f7d;
    --text-soft: #7a8793;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #e8f0ff;
    --success: #16a34a;
    --success-soft: #e7f7ee;
    --warning: #f59e0b;
    --warning-soft: #fff4df;
    --danger: #dc2626;
    --danger-soft: #fdecec;
    --neutral: #64748b;
    --neutral-soft: #f1f5f9;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 10px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 18px 38px rgba(15, 23, 42, 0.12);
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --sidebar-bg: #0f172a;
    --sidebar-surface: #172033;
    --sidebar-text: #cbd5e1;
    --sidebar-muted: #8290a7;
    --sidebar-width: 264px;
    --sidebar-collapsed-width: 68px;
    --topbar-height: 58px;
    --content-padding: 18px;
    --control-height: 36px;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
    text-rendering: optimizeLegibility;
}

body {
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.45;
    margin: 0;
}

/* DAYA CORE application shell */
.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
    transition: grid-template-columns 220ms ease;
}

.app-shell.is-sidebar-collapsed {
    grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
}

.app-sidebar {
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    height: 100vh;
    inset: 0 auto 0 0;
    overflow: hidden auto;
    position: sticky;
    top: 0;
    z-index: 300;
}

.sidebar-brand-row {
    align-items: center;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    display: flex;
    height: var(--topbar-height);
    justify-content: space-between;
    padding: 0 12px 0 14px;
}

.sidebar-brand {
    align-items: center;
    color: #fff;
    display: flex;
    font-size: 14px;
    font-weight: 800;
    gap: 10px;
    min-width: 0;
    white-space: nowrap;
}

.sidebar-brand:hover { color: #fff; text-decoration: none; }
.sidebar-brand-logo {
    display: block;
    flex: 0 0 32px;
    height: 32px;
    object-fit: contain;
    width: 32px;
}

.sidebar-collapse-button,
.topbar-icon-button {
    align-items: center;
    background: transparent;
    border: 0;
    color: inherit;
    display: inline-flex;
    height: 32px;
    justify-content: center;
    padding: 0;
    width: 32px;
}

.sidebar-collapse-button:hover { background: rgba(255,255,255,.08); }
.sidebar-collapse-button svg,
.sidebar-link svg,
.sidebar-group summary svg,
.topbar-icon-button svg {
    fill: none;
    height: 18px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    width: 18px;
}

.sidebar-nav {
    align-items: stretch;
    display: flex;
    flex-direction: column;
    gap: 2px;
    justify-content: flex-start;
    padding: 8px 8px 12px;
}
.sidebar-link,
.sidebar-group summary {
    align-items: center;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    cursor: pointer;
    display: flex;
    font-size: 13px;
    font-weight: 650;
    gap: 10px;
    min-height: 44px;
    padding: 9px 10px;
    transition: background 140ms ease, color 140ms ease;
    white-space: nowrap;
}

.sidebar-link:hover,
.sidebar-link:focus,
.sidebar-group summary:hover {
    background: rgba(148, 163, 184, 0.1);
    color: #fff;
    text-decoration: none;
}

.sidebar-link.is-active {
    background: rgba(37, 99, 235, 0.22);
    box-shadow: inset 3px 0 0 #60a5fa;
    color: #fff;
}

.sidebar-group { flex: 0 0 auto; min-width: 0; }
.sidebar-group summary { color: var(--sidebar-muted); list-style: none; text-transform: uppercase; }
.sidebar-group summary::-webkit-details-marker { display: none; }
.sidebar-group summary::after {
    border: solid currentColor;
    border-width: 0 1px 1px 0;
    content: "";
    height: 5px;
    margin-left: auto;
    transform: rotate(45deg);
    transition: transform 140ms ease;
    width: 5px;
}
.sidebar-group[open] summary::after { transform: rotate(225deg); }
.sidebar-submenu { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 4px; }
.sidebar-group:not([open]) > .sidebar-submenu { display: none; }
.sidebar-submenu .sidebar-link { color: #aebacf; min-height: 40px; padding: 8px 10px 8px 42px; }

.app-shell.is-sidebar-collapsed .sidebar-label,
.app-shell.is-sidebar-collapsed .sidebar-group summary::after { display: none; }
.app-shell.is-sidebar-collapsed .sidebar-brand-row { justify-content: center; padding: 0; }
.app-shell.is-sidebar-collapsed .sidebar-brand { display: flex; }
.app-shell.is-sidebar-collapsed .sidebar-brand-logo { height: 28px; width: 28px; }
.app-shell.is-sidebar-collapsed .sidebar-collapse-button svg { transform: rotate(180deg); }
.app-shell.is-sidebar-collapsed .sidebar-link,
.app-shell.is-sidebar-collapsed .sidebar-group summary { justify-content: center; padding: 8px; }
.app-shell.is-sidebar-collapsed .sidebar-submenu .sidebar-link { padding: 8px; }

.app-workspace { min-width: 0; }
.app-topbar {
    align-items: center;
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    height: var(--topbar-height);
    justify-content: space-between;
    padding: 0 var(--space-6);
    position: sticky;
    top: 0;
    z-index: 220;
}
.topbar-title { font-size: 16px; font-weight: 750; }
.topbar-actions { align-items: center; display: flex; gap: 10px; }
.language-switcher select { background:#fff; border:1px solid #cbd5e1; border-radius:6px; color:#334155; font:inherit; padding:6px 28px 6px 8px; }
.topbar-icon-button { border-radius: var(--radius-sm); color: var(--text-muted); }
.topbar-icon-button:hover { background: var(--surface-soft); color: var(--text); }
.profile-menu { position: relative; }
.profile-menu summary { align-items: center; cursor: pointer; display: flex; gap: 9px; list-style: none; }
.profile-menu summary::-webkit-details-marker { display: none; }
.profile-avatar { align-items: center; background: var(--primary-soft); border-radius: 50%; color: var(--primary-dark); display: inline-flex; font-size: 12px; font-weight: 800; height: 32px; justify-content: center; width: 32px; }
.profile-copy { display: grid; line-height: 1.25; }
.profile-copy strong { font-size: 12px; }
.profile-copy small { color: var(--text-muted); font-size: 11px; }
.profile-dropdown { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); display: grid; min-width: 180px; padding: 6px; position: absolute; right: 0; top: calc(100% + 10px); }
.profile-dropdown a,
.profile-dropdown button { background: transparent; border: 0; border-radius: var(--radius-sm); color: var(--text); display: block; font-size: 13px; padding: 8px 10px; text-align: left; width: 100%; }
.profile-dropdown a:hover,
.profile-dropdown button:hover { background: var(--surface-soft); text-decoration: none; }

/* Reusable design-system primitives */
.page {
    margin: 0;
    max-width: none;
    padding: var(--space-6);
    width: 100%;
}
.auth-page { margin: 0 auto; max-width: 720px; }
.page-header { margin-bottom: var(--space-5); }
.page-header h1 { font-size: 24px; line-height: 1.2; margin: 0 0 var(--space-1); }
.page-header p { margin: 0; }
.page-header-row { align-items: flex-start; gap: var(--space-4); }

.ds-card,
.top-card,
.performance-panel,
.form-panel,
.detail-list,
.wide-panel,
.activity-panel,
.request-panel,
.asset-section,
.summary-box,
.info-box {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.ds-card,
.top-card,
.performance-panel,
.form-panel,
.detail-list,
.wide-panel { padding: var(--space-6); }
.ds-card-header { align-items: center; display: flex; gap: var(--space-3); justify-content: space-between; margin-bottom: var(--space-4); }
.ds-card-title { align-items: center; display: flex; gap: var(--space-2); min-width: 0; }
.ds-card-title h2 { font-size: 15px; margin: 0; }
.ds-card-title p { color: var(--text-muted); font-size: 12px; margin: 2px 0 0; }
.ds-card-icon { align-items: center; background: var(--primary-soft); border-radius: var(--radius-sm); color: var(--primary); display: inline-flex; height: 30px; justify-content: center; width: 30px; }
.ds-card-icon svg { fill: none; height: 16px; stroke: currentColor; stroke-width: 1.8; width: 16px; }

.filter-card,
.filter-bar,
.compact-filter-bar,
.asset-filter-bar,
.work-order-filter-bar,
.table-filter-bar,
.dq-filter-bar {
    align-items: end;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    padding: var(--space-3);
}

button,
.button-link,
.primary-button,
.secondary-button,
.danger-button,
.success-button {
    align-items: center;
    border-radius: var(--radius-sm);
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    justify-content: center;
    min-height: 36px;
    padding: 7px 12px;
    transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
button,
.button-link,
.primary-button { background: var(--primary); border: 1px solid var(--primary); color: #fff; }
.secondary-button { background: #fff; border: 1px solid var(--border); color: var(--text); }
.danger-button { background: var(--danger); border: 1px solid var(--danger); color: #fff; }
.success-button { background: var(--success); border: 1px solid var(--success); color: #fff; }
button:hover,
.button-link:hover,
.primary-button:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }
.secondary-button:hover { background: var(--surface-soft); color: var(--text); text-decoration: none; }

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    min-height: 36px;
    padding: 7px 9px;
}
input:focus,
select:focus,
textarea:focus { border-color: #93b4ff; box-shadow: 0 0 0 3px rgba(37,99,235,.12); outline: none; }
label { color: var(--text-muted); font-size: 12px; font-weight: 700; }

.table-wrap,
.claim-scroll,
.claim-table-wrap,
.audit-table-wrap,
.request-table-wrap,
.inbound-table,
.asset-table-wrap,
.work-order-table-wrap,
.team-table-wrap,
.performance-table-wrap {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: auto;
}
.data-table { border-collapse: separate; border-spacing: 0; font-size: 12.5px; width: 100%; }
.data-table thead th { background: #f7f9fc; border-bottom: 1px solid var(--border); color: #475569; font-size: 11px; font-weight: 800; letter-spacing: .02em; padding: 9px 10px; position: sticky; text-transform: uppercase; top: 0; z-index: 4; }
.data-table tbody td { border-bottom: 1px solid var(--border-soft); padding: 8px 10px; vertical-align: middle; }
.data-table tbody tr:nth-child(even) { background: #fbfcfe; }
.data-table tbody tr:hover { background: #f1f6ff; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.row-count { color: var(--text-muted); font-size: 12px; margin: 0 0 var(--space-2); }

.status-pill,
.status-badge,
.badge { border-radius: 999px; font-size: 11px; font-weight: 750; padding: 3px 8px; }
.ds-empty-state { color: var(--text-muted); padding: var(--space-8); text-align: center; }
.ds-empty-state strong { color: var(--text); display: block; margin-bottom: var(--space-1); }
.ds-skeleton { animation: ds-pulse 1.4s ease-in-out infinite; background: var(--surface-muted); border-radius: var(--radius-sm); height: 14px; }
@keyframes ds-pulse { 50% { opacity: .5; } }

.ds-modal { background: rgba(15,23,42,.45); display: grid; inset: 0; padding: var(--space-6); place-items: center; position: fixed; z-index: 500; }
.ds-modal-panel { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); max-width: 520px; padding: var(--space-6); width: 100%; }

@media (max-width: 1100px) {
    .app-shell { grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr); }
    .app-shell .sidebar-label,
    .app-shell .sidebar-group summary::after,
    .app-shell .sidebar-brand { display: none; }
    .app-shell .sidebar-link,
    .app-shell .sidebar-group summary { justify-content: center; padding: 8px; }
    .page { padding: var(--space-4); }
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover,
a:focus {
    color: var(--primary-dark);
    text-decoration: underline;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* Global Header */
.global-header {
    background: #ffffff;
    border-bottom: 1px solid rgba(217, 225, 232, 0.86);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 200;
}

.global-header-inner {
    align-items: center;
    display: flex;
    gap: 24px;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 1640px;
    min-height: 56px;
    padding: 0 20px;
}

.global-brand {
    align-items: center;
    color: var(--text);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 15px;
    font-weight: 800;
    gap: 9px;
    letter-spacing: 0.08em;
    text-decoration: none;
}

.global-brand:hover,
.global-brand:focus {
    color: var(--text);
    text-decoration: none;
}

.global-brand-mark {
    align-items: center;
    background: var(--primary);
    border-radius: 7px;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
    color: #ffffff;
    display: inline-flex;
    font-size: 11px;
    font-weight: 800;
    height: 26px;
    justify-content: center;
    letter-spacing: 0;
    width: 26px;
}

.global-nav {
    align-items: center;
    display: flex;
    gap: 4px;
    justify-content: flex-end;
    overflow: visible;
    padding: 0;
    white-space: nowrap;
}

.global-nav-group {
    position: relative;
}

.global-nav-link,
.global-nav-summary {
    align-items: center;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    gap: 7px;
    line-height: 54px;
    min-height: 54px;
    padding: 0 10px;
    text-decoration: none;
}

.global-nav-summary::after {
    border: solid currentColor;
    border-width: 0 1.5px 1.5px 0;
    content: "";
    display: inline-block;
    height: 5px;
    margin-left: 1px;
    transform: rotate(45deg) translateY(-2px);
    width: 5px;
}

.global-nav-icon {
    color: currentColor;
    flex: 0 0 auto;
    height: 16px;
    stroke-width: 2;
    width: 16px;
}

.global-nav-link:hover,
.global-nav-link:focus,
.global-nav-summary:hover,
.global-nav-summary:focus {
    color: var(--text);
    outline: none;
    text-decoration: none;
}

.global-nav-link.is-active,
.global-nav-group.is-active > .global-nav-summary {
    border-bottom-color: var(--primary);
    color: var(--text);
}

.global-nav-menu {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: block;
    left: 0;
    min-width: 218px;
    opacity: 0;
    padding: 6px;
    pointer-events: none;
    position: absolute;
    top: calc(100% - 1px);
    transform: translateY(-5px);
    transition: opacity 140ms ease, transform 140ms ease, visibility 220ms ease;
    visibility: hidden;
    z-index: 240;
}

.global-nav-group:hover > .global-nav-menu,
.global-nav-group:focus-within > .global-nav-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    visibility: visible;
}

.global-nav-sub-link {
    align-items: center;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    display: flex;
    font-size: 13px;
    font-weight: 700;
    gap: 8px;
    min-height: 34px;
    padding: 8px 10px;
    text-decoration: none;
}

.global-nav-sub-link:hover,
.global-nav-sub-link:focus {
    background: var(--surface-soft);
    color: var(--text);
    outline: none;
    text-decoration: none;
}

.global-nav-sub-link.is-active {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.global-nav-sub-link.is-active::before {
    background: var(--primary);
    border-radius: 999px;
    content: "";
    height: 18px;
    width: 3px;
}

.module-nav {
    align-items: center;
    background: transparent;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    gap: 6px;
    margin: 0 0 16px;
    overflow-x: auto;
    padding: 0 0 9px;
    white-space: nowrap;
}

.module-nav-link {
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    display: inline-flex;
    font-size: 13px;
    font-weight: 760;
    padding: 7px 2px;
    text-decoration: none;
}

.module-nav-link:hover,
.module-nav-link:focus {
    color: var(--text);
    outline: none;
    text-decoration: none;
}

.module-nav-link.is-active {
    border-bottom-color: var(--primary);
    color: var(--text);
}

/* Page Layout */
.page {
    margin: 0 auto;
    padding: 22px 0 48px;
    width: min(1550px, calc(100% - 24px));
}

.page-header {
    margin-bottom: 18px;
}

.page-header-row {
    align-items: flex-start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.page-header h1 {
    color: var(--text);
    font-size: 25px;
    font-weight: 760;
    letter-spacing: 0;
    line-height: 1.2;
    margin: 0;
}

.page-header p,
.help-text,
.muted,
.section-subtitle {
    color: var(--text-muted);
    margin: 4px 0 0;
}

h2 {
    color: var(--text);
    font-size: 17px;
    font-weight: 760;
    margin: 0 0 10px;
}

/* Cards and Panels */
.module-grid,
.attention-grid,
.kpi-grid,
.import-options,
.report-list {
    gap: 12px;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.module-card,
.attention-card,
.kpi-card,
.claim-panel,
.form-panel,
.detail-list,
.wide-panel,
.activity-panel,
.request-panel,
.info-box,
.report-link,
.summary-box {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.module-card {
    align-items: center;
    color: var(--text);
    display: flex;
    font-size: 16px;
    font-weight: 760;
    justify-content: center;
    min-height: 96px;
    padding: 18px;
    text-align: center;
    text-decoration: none;
    transition: box-shadow 140ms ease, transform 140ms ease, border-color 140ms ease;
}

.module-card:hover,
.module-card:focus,
.attention-card:hover,
.attention-card:focus,
.kpi-card:hover,
.kpi-card:focus,
.report-link:hover,
.report-link:focus {
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: var(--shadow-md);
    outline: none;
    text-decoration: none;
    transform: translateY(-1px);
}

.form-panel,
.detail-list,
.wide-panel {
    padding: 18px;
}

.form-panel,
.detail-list {
    max-width: 720px;
}

.wide-panel {
    max-width: none;
}

/* Buttons */
.button-link,
.secondary-button,
.danger-button,
.success-button,
button[type="submit"] {
    align-items: center;
    border-radius: var(--radius);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 13px;
    font-weight: 760;
    gap: 7px;
    justify-content: center;
    line-height: 1;
    min-height: 34px;
    padding: 9px 12px;
    text-decoration: none;
    transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, color 120ms ease, transform 120ms ease;
    white-space: nowrap;
}

.button-link,
button[type="submit"] {
    background: var(--primary);
    border: 1px solid var(--primary);
    color: #ffffff;
}

.button-link:hover,
.button-link:focus,
button[type="submit"]:hover,
button[type="submit"]:focus {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.18);
    color: #ffffff;
    outline: none;
    text-decoration: none;
}

.secondary-button {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}

.secondary-button:hover,
.secondary-button:focus {
    background: var(--surface-soft);
    border-color: #c8d3dd;
    color: var(--text);
    outline: none;
    text-decoration: none;
}

.danger-button {
    background: var(--danger);
    border: 1px solid var(--danger);
    color: #ffffff;
}

.success-button {
    background: var(--success);
    border: 1px solid var(--success);
    color: #ffffff;
}

.action-row,
.header-actions,
.asset-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

/* Forms */
.form-row {
    margin-bottom: 14px;
}

.form-row label,
.detail-list dt,
.filter-panel label,
.audit-controls label {
    color: var(--text-muted);
    display: block;
    font-size: 12px;
    font-weight: 760;
    margin-bottom: 5px;
}

.form-row input[type="text"],
.form-row input[type="date"],
.form-row input[type="number"],
.form-row input[type="email"],
.form-row input[type="password"],
.form-row select,
.form-row textarea,
.filter-panel input,
.filter-panel select,
.audit-controls input,
.audit-controls select,
input[type="text"],
input[type="date"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    min-height: 34px;
    padding: 8px 10px;
    width: 100%;
}

textarea {
    min-height: 76px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(37, 99, 235, 0.65);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: none;
}

input:disabled,
select:disabled,
textarea:disabled {
    background: var(--surface-muted);
    color: var(--text-soft);
    cursor: not-allowed;
}

.dc-autocomplete {
    position: relative;
    width: 100%;
}

.dc-autocomplete-source {
    height: 1px !important;
    left: 0;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 100%;
    width: 1px !important;
}

.dc-searchable-menu {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    contain: layout paint;
    max-height: 240px;
    overflow-y: auto;
    overscroll-behavior: contain;
    position: fixed;
    z-index: 4000;
}

.dc-searchable-option {
    background: var(--surface) !important;
    border: 0 !important;
    border-bottom: 1px solid var(--border-soft) !important;
    border-radius: 0 !important;
    color: var(--text) !important;
    cursor: pointer;
    display: grid !important;
    gap: 2px;
    min-height: 36px;
    padding: 7px 10px !important;
    text-align: left;
    white-space: normal;
    width: 100%;
}

.dc-searchable-option:last-child {
    border-bottom: 0 !important;
}

.dc-searchable-option:hover,
.dc-searchable-option.is-active {
    background: var(--primary-soft) !important;
    color: var(--primary-dark) !important;
}

.dc-searchable-primary {
    color: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
}

.dc-searchable-meta {
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.25;
}

.dc-searchable-option mark {
    background: #dbeafe;
    border-radius: 2px;
    color: inherit;
    padding: 0;
}

.dc-searchable-option.is-create .dc-searchable-primary {
    color: var(--primary-dark);
}

.dc-searchable-status {
    color: var(--text-muted);
    font-size: 12px;
    padding: 10px;
}

.dc-searchable-status.is-loading::before {
    animation: dc-searchable-spin 0.8s linear infinite;
    border: 2px solid var(--border);
    border-radius: 50%;
    border-top-color: var(--primary);
    content: "";
    display: inline-block;
    height: 12px;
    margin-right: 7px;
    vertical-align: -2px;
    width: 12px;
}

.dc-searchable-status.is-error {
    color: var(--danger);
}

@keyframes dc-searchable-spin {
    to { transform: rotate(360deg); }
}

.historical-autocomplete-helper {
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.3;
    margin-top: 4px;
}

.historical-autocomplete-helper[data-kind="warning"],
.historical-autocomplete-helper[data-kind="error"] {
    color: var(--warning);
}

.historical-autocomplete-helper[data-kind="autofill"] {
    color: var(--primary-dark);
}

.historical-review-card {
    margin-top: 12px;
}

.row-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.detail-list div {
    margin-bottom: 12px;
}

.detail-list dd {
    margin: 0;
}

.errorlist,
.form-row ul {
    color: var(--danger);
    font-size: 12px;
    margin: 6px 0 0;
    padding-left: 18px;
}

/* Filters */
.filter-panel,
.audit-controls,
.work-order-filter-panel,
.claim-item-filter-panel {
    align-items: end;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    overflow-x: auto;
    padding: 10px;
    white-space: nowrap;
}

.filter-panel .form-row,
.audit-controls .form-row {
    flex: 0 0 auto;
    margin-bottom: 0;
}

.filter-panel input,
.filter-panel select,
.audit-controls input,
.audit-controls select {
    min-width: 130px;
}

.filter-panel input[type="search"],
.filter-panel input[type="text"] {
    min-width: 190px;
}

.filter-dropdown,
.dropdown-checklist,
.checklist-menu,
.filter-menu {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 280px;
    overflow: auto;
    position: absolute;
    z-index: 180;
}

/* Tables */
.table-wrap,
.claim-scroll,
.claim-table-wrap,
.audit-table-wrap,
.request-table-wrap,
.inbound-table {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: auto;
}

.data-table {
    background: var(--surface);
    border-collapse: separate;
    border-spacing: 0;
    color: var(--text);
    font-size: 13px;
    width: 100%;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid var(--border-soft);
    padding: 9px 11px;
    text-align: left;
    vertical-align: middle;
}

.data-table thead th,
.excel-table th {
    background: #f6f8fb;
    color: #405160;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
    position: sticky;
    text-transform: uppercase;
    top: 0;
    z-index: 2;
}

.data-table tbody tr:nth-child(even) td {
    background: #fbfcfd;
}

.data-table tbody tr:hover td {
    background: #eff6ff;
}

.data-table th:first-child,
.data-table td:first-child {
    left: 0;
    position: sticky;
    z-index: 1;
}

.data-table th:first-child {
    z-index: 3;
}

.data-table td:first-child {
    background: inherit;
}

.number-cell {
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

/* Incentive RMG audit */
.rmg-search {
    align-items: end;
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.rmg-search label {
    font-size: 12px;
    font-weight: 700;
}

.rmg-search input[type="search"] {
    max-width: 390px;
    min-width: 280px;
}

.rmg-result-count {
    color: var(--text-muted);
    font-size: 12px;
    margin-left: auto;
}

.rmg-review-summary {
    background: var(--surface, #fff);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    display: grid;
    grid-template-columns: repeat(5, minmax(110px, 1fr));
    margin-bottom: 10px;
}

.rmg-review-summary span {
    color: var(--text-muted);
    display: grid;
    font-size: 11px;
    gap: 2px;
    padding: 8px 10px;
}

.rmg-review-summary span + span { border-left: 1px solid var(--border-soft); }
.rmg-review-summary strong { color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }

.rmg-review-filters {
    align-items: end;
    display: flex;
    gap: 7px;
    margin-bottom: 6px;
    overflow: visible;
    position: relative;
}

.rmg-review-filters label { display: grid; flex: 0 0 auto; font-size: 11px; font-weight: 700; gap: 3px; }
.rmg-review-filters select { min-width: 108px; }
.rmg-review-filters .rmg-filter-search { flex: 1 1 230px; max-width: 340px; }
.rmg-review-filters .rmg-filter-search input { min-width: 0; width: 100%; }
.rmg-advanced-wrap { margin-left: auto; position: relative; }
.rmg-export-button { flex: 0 0 auto; }
.rmg-advanced-panel {
    background: var(--surface, #fff);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .14);
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    width: min(480px, calc(100vw - 32px));
    z-index: 80;
}
.rmg-advanced-panel[hidden] { display: none; }
.rmg-advanced-panel section { display: grid; align-content: start; gap: 8px; }
.rmg-advanced-panel section:nth-child(3) {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.rmg-advanced-panel section:nth-child(3) h3 { grid-column: 1 / -1; }
.rmg-advanced-panel h3 { font-size: 11px; margin: 0 0 2px; text-transform: uppercase; }
.rmg-advanced-panel label { width: 100%; }
.rmg-advanced-panel input,
.rmg-advanced-panel select { min-width: 0; width: 100%; }
.rmg-multi-filter { display: grid; font-size: 11px; font-weight: 700; gap: 3px; position: relative; }
.rmg-multi-filter details { position: relative; }
.rmg-multi-filter summary {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    list-style: none;
    min-height: 36px;
    overflow: hidden;
    padding: 8px 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rmg-multi-filter summary::-webkit-details-marker { display: none; }
.rmg-multi-filter-menu {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    display: grid;
    left: 0;
    max-height: 230px;
    min-width: 210px;
    overflow-y: auto;
    padding: 7px;
    position: absolute;
    top: calc(100% + 4px);
    width: 100%;
    z-index: 95;
}
.rmg-multi-filter details:not([open]) .rmg-multi-filter-menu { display: none; }
.rmg-multi-filter-menu label {
    align-items: center;
    display: flex;
    font-size: 11px;
    gap: 7px;
    padding: 5px 3px;
}
.rmg-multi-filter-menu input { flex: 0 0 auto; min-height: 0; width: auto; }
.rmg-multi-clear {
    background: var(--surface-soft) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    justify-self: end;
    min-height: 26px;
    padding: 3px 7px !important;
}
.rmg-advanced-panel footer {
    align-items: center;
    border-top: 1px solid var(--border-soft);
    display: flex;
    gap: 7px;
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding-top: 10px;
}
.rmg-filter-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 7px; }
.rmg-filter-chips a {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    text-decoration: none;
}
.rmg-selection-toolbar {
    align-items: center;
    color: var(--text-muted);
    display: flex;
    font-size: 11px;
    gap: 9px;
    margin: 4px 0 6px;
    min-height: 30px;
}
.rmg-selection-toolbar > span > strong { color: var(--text); font-variant-numeric: tabular-nums; }
.rmg-selection-toolbar .rmg-result-count { margin-left: auto; }
.bulk-select-menu { margin: 0; position: relative; width: max-content; }
.bulk-select-menu summary {
    background: var(--surface, #fff);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    list-style: none;
    padding: 6px 9px;
}
.bulk-select-menu summary::-webkit-details-marker { display: none; }
.bulk-select-menu > div {
    background: var(--surface, #fff);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
    display: grid;
    left: 0;
    min-width: 175px;
    padding: 4px;
    position: absolute;
    top: calc(100% + 3px);
    z-index: 60;
}
.bulk-select-menu > div button {
    background: transparent;
    border: 0;
    color: var(--text);
    justify-content: flex-start;
    padding: 7px 8px;
    text-align: left;
}
.bulk-select-menu > div button:hover { background: var(--surface-soft); }
.rmg-review-table td small { color: var(--text-muted); display: block; font-size: 10px; line-height: 1.3; margin-top: 2px; }

.rmg-calculation-trace { border-top: 1px solid var(--border-soft); margin-top: 10px; padding-top: 10px; }
.rmg-calculation-trace dl { display: grid; gap: 8px; grid-template-columns: repeat(5, minmax(110px, 1fr)); margin: 0; }
.rmg-calculation-trace dl div { display: grid; gap: 2px; }
.rmg-calculation-trace dt { color: var(--text-muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.rmg-calculation-trace dd { font-size: 12px; font-weight: 700; margin: 0; }

.rmg-fixed-sequence {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.rmg-fixed-sequence span {
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 8px;
}

.rmg-fixed-sequence b { color: var(--text-muted); }

.rmg-table-wrap {
    max-height: calc(100vh - 250px);
    overflow-x: hidden !important;
}

.rmg-review-table {
    font-size: 12px;
    min-width: 0;
    table-layout: fixed;
    width: 100%;
}

.rmg-review-table th,
.rmg-review-table td {
    padding: 6px 8px;
}

.rmg-review-table th:nth-child(1) { width: 44px; }
.rmg-review-table th:nth-child(2) { width: 11%; }
.rmg-review-table th:nth-child(3),
.rmg-review-table th:nth-child(4) { width: 16%; }
.rmg-review-table th:nth-child(5) { width: 6%; }
.rmg-review-table th:nth-child(6) { width: 10%; }
.rmg-review-table th:nth-child(7) { width: 12%; }
.rmg-review-table th:nth-child(8) { width: 8%; }
.rmg-review-table th:nth-child(9) { width: 9%; }
.rmg-review-table th:nth-child(10) { width: 60px; }

.rmg-summary-row {
    cursor: pointer;
}
.rmg-barcode-cell strong { font-size: 16px; font-weight: 600; white-space: nowrap; }
.rmg-wo-cell a { display: block; font-size: 16px; font-weight: 500; line-height: 1.2; white-space: nowrap; }
.rmg-wo-cell small { font-size: 12px !important; white-space: nowrap; }

.rmg-summary-row:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.rmg-summary-row.is-expanded td {
    background: #eef6ff !important;
}

.rmg-summary-row td small,
.rmg-expanded-row dd small {
    color: var(--text-muted);
    display: block;
    font-size: 10px;
    line-height: 1.2;
    margin-top: 2px;
}

.rmg-barcode,
.rmg-vendor-wo {
    white-space: nowrap;
}

.rmg-repair-cell {
    align-items: start;
    display: grid;
    gap: 5px 9px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.rmg-repair-cell > a { grid-column: 1 / -1; font-weight: 700; }
.rmg-repair-cell > span:not(.rmg-work-badge) { min-width: 0; }
.rmg-repair-cell .rmg-work-badge { align-self: center; }

.rmg-work-badge,
.rmg-review-status {
    border-radius: 999px;
    display: inline-flex;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    padding: 5px 7px;
    white-space: nowrap;
}

.rmg-work-badge.work-warehouse-repair { background: #dbeafe; color: #1d4ed8; }
.rmg-work-badge.work-field-repair { background: #dcfce7; color: #166534; }
.rmg-work-badge.work-pm { background: #ffedd5; color: #9a3412; }
.rmg-work-badge.work-wop,
.rmg-work-badge.work-neutral { background: #e5e7eb; color: #4b5563; }
.rmg-review-status.status-pending { background: #fff7ed; color: #9a3412; }
.rmg-review-status.status-approved { background: #dcfce7; color: #166534; }
.rmg-review-status.status-rejected { background: #f3f4f6; color: #4b5563; }
.rmg-review-status.status-configuration { background: #fef3c7; color: #92400e; }

.rmg-potential {
    color: var(--text-muted);
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}
.rmg-potential.is-positive { color: var(--danger); }

.rmg-repeated-answer { color: var(--text-muted); font-weight: 700; }
.rmg-repeated-answer.is-yes { color: #9a3412; }
.rmg-repeated-indicator {
    align-items: center;
    color: var(--text-muted);
    display: inline-flex;
    font-size: 11px;
    gap: 6px;
}
.rmg-repeated-indicator i {
    background: #9ca3af;
    border-radius: 50%;
    display: inline-block;
    height: 7px;
    width: 7px;
}
.rmg-repeated-indicator.is-yes { color: #166534; font-weight: 700; }
.rmg-repeated-indicator.is-yes i { background: #22c55e; }

.rmg-expand-button {
    align-items: center;
    background: transparent !important;
    border: 0 !important;
    color: var(--text-muted) !important;
    display: inline-flex;
    height: 28px;
    justify-content: center;
    padding: 0 !important;
    width: 28px;
}

.rmg-expand-button span {
    display: block;
    font-size: 14px;
    transform: rotate(-90deg);
    transition: transform 180ms ease;
}

.rmg-summary-row.is-expanded .rmg-expand-button span { transform: rotate(0); }

.rmg-expanded-row > td {
    background: #f8fafc !important;
    padding: 0 !important;
}

.rmg-expanded-row.is-loading > td,
.rmg-expanded-row.has-error > td {
    color: var(--text-muted);
    padding: 16px !important;
}

.rmg-expanded-shell {
    align-items: stretch;
    border-bottom: 1px solid var(--border);
    border-top: 2px solid var(--primary);
    display: grid;
    gap: 16px;
    grid-template-columns: 1.15fr 1.15fr 1.15fr 1.1fr .95fr;
    opacity: 0;
    padding: 16px;
    transform: translateY(-5px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.rmg-expanded-row.is-open .rmg-expanded-shell {
    opacity: 1;
    transform: translateY(0);
}

.rmg-expanded-row.is-closing .rmg-expanded-shell {
    opacity: 0;
    transform: translateY(-5px);
}

.rmg-detail-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    height: 100%;
    min-width: 0;
    padding: 20px;
}
.rmg-detail-card h3 {
    border-bottom: 1px solid var(--border-soft);
    font-size: 14px;
    margin: 0 0 12px;
    padding-bottom: 10px;
}
.rmg-detail-card dl { margin: 0; }
.rmg-detail-card dl div {
    display: grid;
    gap: 6px;
    grid-template-columns: 62px minmax(0, 1fr);
    padding: 5px 0;
}
.rmg-detail-card dt { color: var(--text-muted); font-size: 12px; }
.rmg-detail-card dd { font-size: 14px; margin: 0; overflow-wrap: normal; word-break: normal; }
.rmg-detail-work-order dd a { white-space: nowrap; }
.rmg-detail-summary dl div { grid-template-columns: 72px minmax(0, 1fr); }
.rmg-detail-summary dd { font-size: 12px; }
.rmg-detail-potential { color: var(--danger); font-size: 13px !important; font-weight: 700; white-space: nowrap; }
.rmg-part-group + .rmg-part-group { border-top: 1px solid var(--border-soft); margin-top: 7px; padding-top: 7px; }
.rmg-part-group > strong { display: block; font-size: 10px; margin-bottom: 4px; }

.rmg-evidence-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(240px, 1fr) minmax(240px, 1fr) minmax(260px, .9fr);
    padding: 14px 0;
}

.rmg-evidence-grid section,
.rmg-decision {
    border-right: 1px solid var(--border-soft);
    padding-right: 16px;
}

.rmg-decision { border-right: 0; padding-right: 0; }

.rmg-evidence-grid h3,
.rmg-comparison h3,
.rmg-problem-details h3 {
    font-size: 13px;
    margin: 0 0 9px;
}

.rmg-evidence-grid dl { margin: 0; }
.rmg-evidence-grid dl div { display: grid; gap: 8px; grid-template-columns: 105px 1fr; padding: 4px 0; }
.rmg-evidence-grid dt { color: var(--text-muted); }
.rmg-evidence-grid dd { margin: 0; }

.rmg-potential-box {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 6px;
    display: grid;
    gap: 2px;
    padding: 9px 10px;
}

.rmg-potential-box small { color: #9f1239; }
.rmg-potential-box strong { color: #be123c; font-size: 16px; }
.rmg-decision { border-right: 0; padding-right: 9px; }
.rmg-decision textarea { margin-top: 4px; min-height: 52px; width: 100%; }
.rmg-decision label small { color: var(--text-muted); font-weight: 400; }
.rmg-decision-actions { display: grid; gap: 5px; margin-top: 8px; }
.rmg-decision-actions button,
.rmg-decision-actions a { justify-content: center; min-height: 30px; padding: 5px 8px; width: 100%; }
.rmg-decision-actions .success-button {
    background: #15803d !important;
    border-color: #15803d !important;
    color: white !important;
}
.rmg-decision-actions .danger-button {
    background: white !important;
    border: 1px solid #dc2626 !important;
    color: #b91c1c !important;
}
.rmg-review-error { color: var(--danger); font-size: 11px; margin-top: 5px; }

.rmg-comparison,
.rmg-problem-details {
    border-top: 1px solid var(--border-soft);
    padding-top: 12px;
}

.rmg-problem-details { margin-top: 12px; }
.rmg-comparison-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.rmg-comparison-grid h4,
.rmg-problem-details h4 { font-size: 12px; margin: 0 0 6px; }

.rmg-line-table { border-collapse: collapse; font-size: 11px; width: 100%; }
.rmg-line-table th,
.rmg-line-table td { border-bottom: 1px solid var(--border-soft); padding: 5px 7px; text-align: left; }
.rmg-line-table th { background: #f3f4f6; color: var(--text-muted); }
.rmg-line-table tr.is-repeated td { background: #fff7ed; }
.rmg-line-table td small { color: #9a3412; display: block; font-weight: 700; }
.rmg-detail-parts .rmg-line-table th:last-child,
.rmg-detail-parts .rmg-line-table td:last-child { text-align: center; width: 58px; }
.rmg-detail-parts .rmg-line-table tr.is-repeated td { background: #ecfdf5; }
.rmg-match-check { color: #15803d; font-size: 14px; font-weight: 800; }

.rmg-problem-details > div { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.rmg-problem-details article { background: white; border: 1px solid var(--border-soft); border-radius: 6px; padding: 9px; }
.rmg-problem-details article strong { color: var(--text-muted); display: block; font-size: 10px; text-transform: uppercase; }
.rmg-problem-details article p { margin: 3px 0 9px; }

@media (max-width: 1100px) {
    .rmg-review-table { font-size: 11px; min-width: 0; }
    .rmg-review-table th,
    .rmg-review-table td { padding-left: 5px; padding-right: 5px; }
    .rmg-review-filters { flex-wrap: wrap; }
    .rmg-advanced-wrap { margin-left: 0; }
    .rmg-expanded-shell { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rmg-detail-parts,
    .rmg-decision { grid-column: span 2; }
}

/* Data Quality Center */
.dq-section-counts {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    margin-bottom: 10px;
}

.dq-section-counts a {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    color: var(--text);
    display: flex;
    font-size: 12px;
    gap: 8px;
    justify-content: space-between;
    padding: 9px 10px;
    text-decoration: none;
}

.dq-section-counts a:hover { border-color: var(--primary); }
.dq-scan-meta, .row-count { color: var(--text-muted); font-size: 12px; margin: 8px 0; }
.dq-filter-bar { display: flex; gap: 8px; margin: 12px 0 6px; overflow-x: auto; padding-bottom: 3px; }
.dq-filter-bar input, .dq-filter-bar select { min-width: 125px; width: auto; }
.dq-filter-bar input[type="search"] { min-width: 190px; }
.dq-review-summary { display: grid; gap: 8px; grid-template-columns: repeat(4, 1fr); margin-bottom: 12px; }
.dq-review-summary > div { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 10px 12px; }
.dq-review-summary span { color: var(--text-muted); display: block; font-size: 11px; text-transform: uppercase; }
.dq-review-summary strong { display: block; margin-top: 3px; }
.dq-reasons { margin-bottom: 12px; padding-block: 12px; }
.dq-reasons ul { margin: 6px 0; }
.dq-open-actions, .dq-action-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.dq-comparison-table { margin-bottom: 12px; }
.dq-row-same td { background: #f0fdf4 !important; }
.dq-row-different td { background: #fff7ed !important; }
.dq-row-missing td { background: #fef2f2 !important; }
.dq-actions-panel { margin-top: 12px; }
.dq-decision-form { display: grid; gap: 8px; max-width: 760px; }
.dq-decision-form textarea { width: 100%; }
.dq-decision-form fieldset { border: 1px solid var(--border-soft); border-radius: var(--radius); }
.dq-decision-form ul { display: flex; gap: 16px; list-style: none; margin: 4px 0; padding: 0; }
.dq-reject-form { border-top: 1px solid var(--border-soft); margin-top: 14px; padding-top: 14px; }
.dq-lower-grid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin-top: 12px; }
.dq-relationship-grid { display: flex; flex-wrap: wrap; gap: 16px; }
.dq-relationship-grid div { min-width: 130px; }
.dq-relationship-grid span { color: var(--text-muted); display: block; font-size: 11px; }
.dq-relationship-grid strong { display: block; font-size: 18px; margin-top: 2px; }
.dq-confidence-very-high { background: var(--danger-soft); color: #9f1d1d; }
.dq-confidence-high { background: var(--warning-soft); color: #9a5b00; }
.dq-confidence-medium { background: #eff6ff; color: #1d4ed8; }
.dq-confidence-low { background: #f1f5f9; color: #475569; }

@media (max-width: 1000px) {
    .dq-section-counts { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
    .dq-review-summary { grid-template-columns: repeat(2, 1fr); }
    .dq-lower-grid { grid-template-columns: 1fr; }
}

.auth-shell { display: grid; min-height: 55vh; place-items: center; }
.auth-panel { width: min(420px, 100%); }
.auth-panel h1 { font-size: 24px; margin: 0 0 4px; }
.auth-panel form { display: grid; gap: 14px; margin-top: 18px; }
.auth-panel .field-row { display: grid; gap: 5px; }
.auth-panel input { width: 100%; }
.auth-brand { color: var(--primary); font-size: 13px; font-weight: 800; letter-spacing: 0; margin-bottom: 8px; }
.stacked-form { display: grid; gap: 14px; }
.stacked-form .field-row { display: grid; gap: 5px; }
.stacked-form input:not([type="checkbox"]), .stacked-form select { width: 100%; }
.compact-detail-grid { display: grid; gap: 10px 18px; grid-template-columns: 140px 1fr; margin: 0; }
.compact-detail-grid dt { color: var(--text-muted); font-weight: 650; }
.compact-detail-grid dd { margin: 0; }
.is-hidden { display: none !important; }

.global-account { align-items: center; display: flex; flex: 0 0 auto; gap: 10px; }
.global-account-link { color: var(--text); display: grid; font-size: 12px; line-height: 1.25; text-align: right; }
.global-account-link:hover { text-decoration: none; }
.global-account-link span { color: var(--text-muted); }
.global-logout-button { background: transparent; border: 1px solid var(--border); color: var(--text-muted); min-height: 32px; padding: 5px 10px; }
.global-logout-button:hover { background: var(--surface-soft); color: var(--text); }

/* Status, badges, messages */
.status-pill,
.status-badge,
.priority,
.badge {
    border-radius: 999px;
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    padding: 5px 8px;
    white-space: nowrap;
}

.status-active,
.status-success,
.priority-normal,
.priority-safe {
    background: var(--success-soft);
    color: #116835;
}

.status-inactive,
.status-void,
.priority-overdue {
    background: var(--danger-soft);
    color: #9f1d1d;
}

.status-pending,
.priority-due-soon,
.priority-duesoon,
.warning {
    background: var(--warning-soft);
    color: #9a5b00;
}

.message-list,
.toast-stack {
    bottom: 18px;
    display: grid;
    gap: 8px;
    position: fixed;
    right: 18px;
    width: min(380px, calc(100vw - 36px));
    z-index: 300;
}

.message,
.asset-message,
.allocation-warning,
.warning,
.alert {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    color: var(--text);
    padding: 10px 12px;
}

.message.success,
.asset-message,
.alert-success {
    background: var(--success-soft);
    border-color: rgba(22, 163, 74, 0.22);
    color: #116835;
}

.message.error,
.message.danger,
.alert-error,
.alert-danger {
    background: var(--danger-soft);
    border-color: rgba(220, 38, 38, 0.25);
    color: #9f1d1d;
}

.allocation-warning,
.message.warning,
.alert-warning {
    background: var(--warning-soft);
    border-color: rgba(245, 158, 11, 0.25);
    color: #9a5b00;
}

.status-warning {
    background: var(--warning-soft);
    color: #9a5b00;
    margin-left: 5px;
}

/* Existing operational grid helpers */
.excel-row {
    display: grid;
    gap: 8px;
    grid-template-columns: 160px 130px 130px 130px 180px repeat(3, 120px) 140px 110px 110px 180px 130px;
    min-width: 1800px;
}

.excel-row .form-row {
    margin-bottom: 0;
}

.excel-row .form-row label {
    font-size: 11px;
}

.secondary-text {
    color: var(--text-muted);
}

.back-link {
    color: var(--primary);
    font-weight: 760;
}

.remove-row-button::before {
    content: "";
}

@media (max-width: 1100px) {
    .global-header-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 0;
        padding: 8px 14px 0;
    }

    .global-nav {
        justify-content: flex-start;
        overflow-x: auto;
        width: 100%;
    }

    .global-nav-link,
    .global-nav-summary {
        line-height: 42px;
        min-height: 42px;
    }

    .global-nav-menu {
        position: fixed;
        top: 86px;
    }

    .page {
        padding-top: 16px;
        width: min(100% - 18px, 1550px);
    }

    .page-header-row {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 700px) {
    body {
        font-size: 13px;
    }

    .page-header h1 {
        font-size: 22px;
    }

    .message-list {
        bottom: 10px;
        right: 10px;
        width: calc(100vw - 20px);
    }
}

/* Modernization overrides for legacy inline page styles. */
.claim-panel,
.attention-card,
.kpi-card,
.activity-panel,
.request-panel,
.form-panel,
.detail-list,
.wide-panel,
.info-box,
.summary-box,
.report-link {
    background: var(--surface) !important;
    border: 1px solid var(--border-soft) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-sm) !important;
}

.button-link,
button[type="submit"] {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
}

.secondary-button {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

.data-table th,
.excel-table th {
    background: #f6f8fb !important;
    color: #405160 !important;
}

.data-table th,
.data-table td {
    border-bottom-color: var(--border-soft) !important;
}

.data-table tbody tr:hover td {
    background: #eff6ff !important;
}

.filter-panel,
.audit-controls,
.work-order-filter-panel,
.claim-item-filter-panel {
    background: var(--surface) !important;
    border: 1px solid var(--border-soft) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-sm) !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.rmg-logic-header { align-items: end; }
.rmg-version-strip { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--border-color, #dfe3e8); border-radius: 6px; background: #fff; }
.rmg-version-strip span { display: grid; gap: 2px; min-width: 105px; }
.rmg-version-strip small, .rmg-test-result small { color: #657184; font-size: 11px; }
.rmg-version-strip strong { font-size: 13px; }
.rmg-version-strip .rmg-draft-warning { margin-left: auto; color: #9a5b00; }
.rmg-logic-actions { position: sticky; top: 8px; z-index: 8; display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; padding: 8px 0; background: var(--page-background, #f8f9fb); }
.rmg-logic-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.rmg-config-section { margin-bottom: 10px; padding: 12px; }
.rmg-config-section .ds-card-header { margin-bottom: 8px; }
.rmg-config-section .ds-card-header h2 { font-size: 15px; }
.rmg-config-section .ds-card-header p { margin: 2px 0 0; font-size: 12px; }
.rmg-version-fields, .rmg-inline-add, .rmg-test-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.rmg-version-fields label, .rmg-test-form label { display: grid; gap: 4px; min-width: 160px; font-size: 12px; font-weight: 600; }
.compact-config-table input:not([type="checkbox"]), .compact-config-table select { min-width: 0; width: 100%; padding: 5px 7px; }
.compact-config-table th, .compact-config-table td { padding: 5px 7px; }
.rmg-inline-add { margin-top: 8px; }
.rmg-inline-add > * { flex: 1 1 180px; min-width: 0; }
.rmg-matrix-wrap { max-width: 100%; overflow: hidden; border: 1px solid #e2e6eb; border-radius: 6px; }
.rmg-matrix { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 10px; }
.rmg-matrix th, .rmg-matrix td { padding: 4px 2px; text-align: center; border-right: 1px solid #eef0f3; border-bottom: 1px solid #eef0f3; overflow-wrap: anywhere; }
.rmg-matrix th:first-child { width: 145px; text-align: left; padding-left: 7px; }
.rmg-matrix thead th { background: #f3f5f8; color: #3f4b5c; }
.rmg-matrix tbody th span { display: flex; gap: 3px; margin-top: 3px; }
.rmg-matrix tbody th button { padding: 1px 4px; border: 0; background: transparent; color: #2563a7; font-size: 9px; }
.rmg-matrix td label { display: grid; place-items: center; cursor: pointer; }
.rmg-matrix td input { position: absolute; opacity: 0; pointer-events: none; }
.rmg-matrix td label span[aria-hidden] { width: 22px; height: 22px; border: 1px solid #c9d0d8; border-radius: 4px; background: #f3f4f6; }
.rmg-matrix td input:checked + span { border-color: #258454; background: #e5f5ec; }
.rmg-matrix td input:checked + span::after { content: "\2713"; color: #17643d; font-size: 15px; font-weight: 700; }
.rmg-settings-grid { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(420px, 1.2fr); gap: 10px; }
.rmg-setting-list { display: grid; gap: 1px; }
.rmg-setting-list label { display: grid; grid-template-columns: minmax(180px, 1fr) 110px; gap: 10px; align-items: center; min-height: 31px; padding: 3px 0; border-bottom: 1px solid #eef1f4; font-size: 12px; }
.rmg-setting-list label input[type="checkbox"] { justify-self: end; }
.rmg-setting-list-wide { grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 0 24px; }
.rmg-subheading { margin: 8px 0 4px; font-size: 12px; }
.rmg-date-list { display: grid; gap: 3px; }
.rmg-date-list > div { display: grid; grid-template-columns: minmax(145px, 1fr) minmax(120px, 1fr) 58px 24px; gap: 5px; align-items: center; }
.rmg-date-list input { min-width: 0; padding: 4px 6px; }
.matrix-tools { display: flex; gap: 5px; }
.matrix-bulk-tools { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-bottom: 7px; font-size: 11px; }
.matrix-bulk-tools label { display: flex; align-items: center; gap: 5px; }
.matrix-bulk-tools select { max-width: 150px; padding: 4px 6px; }

.bulk-selection-tools {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 7px 0;
  min-height: 28px;
}
.bulk-selection-tools button {
  border: 0;
  background: transparent;
  color: var(--primary, #2563eb);
  padding: 4px 6px;
  font-size: 11px;
  box-shadow: none;
}
.bulk-selection-tools button:hover { background: #eff6ff; }
.bulk-action-bar {
  position: sticky;
  top: var(--header-height, 58px);
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  margin: 6px 0;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  box-shadow: 0 4px 12px rgb(15 23 42 / 8%);
}
.bulk-action-bar[hidden] { display: none; }
.bulk-action-bar > div { display: flex; gap: 6px; }
.bulk-action-bar button { min-height: 29px; padding: 5px 9px; font-size: 12px; }
.selection-cell { width: 34px; min-width: 34px; text-align: center; }
.selection-cell input { margin: 0; }
.data-table tr.is-bulk-selected > td { background: #eff6ff; }
.bulk-review-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 50px rgb(15 23 42 / 20%);
}
.bulk-review-dialog::backdrop { background: rgb(15 23 42 / 32%); }
.bulk-review-dialog > * { margin-left: 16px; margin-right: 16px; }
.bulk-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 13px 16px;
  border-bottom: 1px solid #e5e7eb;
}
.bulk-dialog-header h2 { margin: 0; font-size: 16px; }
.bulk-dialog-header button { border: 0; background: transparent; color: #64748b; font-size: 22px; padding: 0 4px; }
.bulk-preview-counts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 6px;
  margin: 14px 0 8px;
}
.bulk-preview-counts span { padding: 7px; background: #f8fafc; color: #64748b; font-size: 11px; }
.bulk-preview-counts strong { display: block; margin-top: 2px; color: #0f172a; font-size: 16px; }
.bulk-preview-total { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #e5e7eb; }
.bulk-preview-breakdown { max-height: 180px; overflow: auto; padding: 0; list-style: none; }
.bulk-preview-breakdown li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid #f1f5f9; }
.bulk-review-dialog label { display: block; margin-top: 10px; font-size: 12px; }
.bulk-review-dialog textarea { width: 100%; margin-top: 4px; }
.bulk-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin: 14px 0 0;
  padding: 10px 16px;
  border-top: 1px solid #e5e7eb;
}
@media (max-width: 760px) {
  .bulk-selection-tools { overflow-x: auto; }
  .bulk-selection-tools button { white-space: nowrap; }
  .bulk-action-bar { align-items: flex-start; }
  .bulk-action-bar > div { flex-wrap: wrap; justify-content: flex-end; }
}
.rmg-new-row td { background: #f7f9fb; }
.rmg-test-form input { min-width: 180px; }
.rmg-test-result { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 7px 16px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #e3e7ec; }
.rmg-test-result span { display: grid; gap: 2px; }
.rmg-test-result strong { font-size: 12px; }
.rmg-test-result .rmg-test-reason { grid-column: 1 / -1; }
@media (max-width: 1050px) {
  .rmg-settings-grid { grid-template-columns: 1fr; }
  .rmg-matrix { font-size: 9px; }
  .rmg-matrix th:first-child { width: 110px; }
  .rmg-test-result { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
}
