:root {
  --navy-950: #071b2a;
  --navy-900: #0b2638;
  --navy-800: #12394e;
  --teal: #069b94;
  --teal-dark: #07756f;
  --teal-soft: #d9f0ed;
  --amber: #e6a72d;
  --amber-soft: #fff1d5;
  --red: #c9534d;
  --red-soft: #fbe5e3;
  --blue-soft: #e6f0f5;
  --ink: #173143;
  --muted: #6d818d;
  --line: #d8e3e8;
  --surface: #f3f7f8;
  --white: #ffffff;
  --shadow: 0 18px 45px rgba(14, 48, 67, .09);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { background: var(--surface); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.shell { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--navy-950); color: white; display: flex; flex-direction: column; height: 100vh; overflow: hidden; padding: 26px 18px; position: sticky; top: 0; }
.brand { align-items: center; color: white; display: flex; gap: 12px; text-decoration: none; }
.brand-mark { align-items: center; background: var(--teal); display: inline-flex; font-family: Georgia, serif; font-size: 25px; font-weight: 700; height: 42px; justify-content: center; width: 42px; }
.brand b { font-weight: 700; }
.brand small { color: #83a1b1; display: block; font-size: 9px; font-weight: 700; letter-spacing: .2em; margin-top: 4px; }
.sidebar nav { display: grid; gap: 3px; margin-top: 30px; overflow-y: auto; padding-right: 4px; }
.sidebar nav::-webkit-scrollbar { width: 4px; }
.sidebar nav::-webkit-scrollbar-thumb { background: #24495b; }
.nav-group { color: #58798a; font-size: 8px; font-weight: 850; letter-spacing: .16em; margin: 17px 10px 5px; text-transform: uppercase; }
.nav-item { align-items: center; background: transparent; border: 0; color: #a6bac4; display: flex; gap: 11px; padding: 10px 11px; text-align: left; transition: .2s ease; width: 100%; }
.nav-item b { font-size: 11px; font-weight: 600; }
.nav-item span { color: #597686; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.nav-item:hover, .nav-item.active { background: #103248; color: white; }
.nav-item.active { box-shadow: inset 3px 0 var(--teal); }
.nav-item.active span { color: #2cc6bd; }
.sidebar-foot { align-items: center; border-top: 1px solid #1a3b4e; display: flex; flex: 0 0 auto; gap: 11px; margin-top: 12px; padding: 16px 8px 0; }
.sidebar-foot b, .sidebar-foot small { display: block; }
.sidebar-foot b { font-size: 11px; }
.sidebar-foot small { color: #7793a2; font-size: 9px; margin-top: 4px; }
.safe-dot { background: #27c18d; border-radius: 50%; box-shadow: 0 0 0 5px rgba(39, 193, 141, .12); height: 8px; width: 8px; }

.workspace { min-width: 0; }
.topbar { align-items: center; background: rgba(255, 255, 255, .94); border-bottom: 1px solid var(--line); display: flex; height: 72px; justify-content: space-between; padding: 0 36px; position: sticky; top: 0; z-index: 10; }
.product-control { align-items: center; display: flex; gap: 10px; }
.product-control span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.product-control select { border: 0; font-size: 12px; font-weight: 800; min-height: 34px; }
.context-label { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.topbar b { font-size: 13px; }
.topbar-actions { align-items: center; display: flex; gap: 14px; }
.connection { align-items: center; color: var(--muted); display: flex; font-size: 11px; gap: 7px; }
.connection i { background: var(--amber); border-radius: 50%; height: 7px; width: 7px; }
.connection.ok i { background: #29ad7b; }
.connection.fail i { background: var(--red); }
.ghost-button, .text-button { background: transparent; border: 0; color: var(--teal-dark); font-size: 11px; font-weight: 750; }
.ghost-button { border: 1px solid var(--line); padding: 8px 12px; }
.menu-button { background: transparent; border: 0; display: none; font-size: 22px; }
.language-switch { display: flex; gap: 5px; }
.language-switch button { background: transparent; border: 1px solid #c8d6dc; color: var(--muted); font-size: 10px; font-weight: 850; min-width: 34px; padding: 7px; }
.language-switch button.active { background: var(--navy-950); border-color: var(--navy-950); color: white; }
.language-switch.compact button { min-width: 30px; padding: 5px; }
.popover-wrap { position: relative; }
.icon-button { background: white; border: 1px solid var(--line); color: var(--navy-800); font-size: 19px; height: 38px; position: relative; width: 38px; }
.icon-button span { align-items: center; background: var(--red); border-radius: 12px; color: white; display: flex; font-size: 8px; font-weight: 850; height: 17px; justify-content: center; min-width: 17px; padding: 0 4px; position: absolute; right: -7px; top: -7px; }
.user-button { align-items: center; background: transparent; border: 0; display: flex; gap: 9px; text-align: left; }
.user-button > span:first-child { align-items: center; background: var(--teal); border-radius: 50%; color: white; display: flex; font-size: 12px; font-weight: 850; height: 34px; justify-content: center; width: 34px; }
.user-button b, .user-button small { display: block; }
.user-button small { color: var(--muted); font-size: 9px; margin-top: 2px; }
.popover { background: white; border: 1px solid var(--line); box-shadow: 0 20px 55px rgba(5, 30, 45, .18); position: absolute; right: 0; top: 48px; z-index: 25; }
.notification-popover { max-height: 480px; overflow: auto; width: 390px; }
.user-popover { min-width: 190px; padding: 7px; }
.user-popover button { background: transparent; border: 0; color: var(--ink); display: block; font-size: 11px; padding: 11px; text-align: left; width: 100%; }
.user-popover button:hover { background: var(--surface); }
.popover-heading { align-items: center; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; padding: 15px; }
.notification-item { background: white; border: 0; border-bottom: 1px solid #e7eef1; display: grid; gap: 4px; padding: 14px 16px; text-align: left; width: 100%; }
.notification-item.unread { background: #eff8f7; box-shadow: inset 3px 0 var(--teal); }
.notification-item b { font-size: 11px; }
.notification-item span { color: var(--muted); font-size: 10px; line-height: 1.45; }
.notification-item small { color: #8ca0aa; font-size: 8px; }

main { margin: 0 auto; max-width: 1520px; padding: 40px 42px 70px; }
.view { display: none; }
.view.active { display: block; }
.page-heading { align-items: end; display: flex; justify-content: space-between; margin-bottom: 30px; }
.eyebrow { color: var(--teal-dark); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 800; letter-spacing: .13em; margin: 0 0 9px; }
h1, h2, h3, p { margin-top: 0; }
h1 { color: var(--navy-950); font-family: Georgia, serif; font-size: clamp(35px, 4vw, 56px); font-weight: 500; letter-spacing: -.04em; margin-bottom: 0; }
h2 { color: var(--navy-950); font-size: 20px; letter-spacing: -.025em; margin-bottom: 0; }
.page-copy { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 10px 0 0; }
.as-of { text-align: right; }
.as-of span, .as-of b { display: block; }
.as-of span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.as-of b { font-size: 12px; margin-top: 5px; }

.kpi-grid { display: grid; gap: 16px; grid-template-columns: repeat(5, 1fr); margin-bottom: 18px; }
.kpi { background: var(--white); border-top: 3px solid var(--teal); box-shadow: var(--shadow); padding: 21px 22px; }
.kpi span { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.kpi strong { color: var(--navy-950); display: block; font-family: Georgia, serif; font-size: 38px; font-weight: 500; margin-top: 12px; }
.kpi small { color: #83959f; font-size: 10px; }
.kpi.attention { border-top-color: var(--amber); }
.kpi.critical { border-top-color: var(--red); }

.dashboard-overview-grid { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; margin-bottom: 18px; }
.dashboard-focus-panel { min-height: 270px; }
.panel { background: var(--white); box-shadow: var(--shadow); padding: 24px; }
.panel-heading { align-items: flex-start; display: flex; justify-content: space-between; margin-bottom: 24px; }
.panel-heading > span { background: var(--blue-soft); color: #486c80; font-size: 9px; font-weight: 800; padding: 6px 8px; text-transform: uppercase; }
.severity-bars { display: grid; gap: 17px; }
.bar-row { display: grid; gap: 12px; grid-template-columns: 70px 1fr 32px; align-items: center; }
.bar-row label { color: var(--muted); font-size: 10px; font-weight: 750; }
.bar-track { background: #edf2f4; height: 8px; }
.bar-fill { background: var(--teal); height: 100%; min-width: 2px; }
.bar-fill.high, .bar-fill.critical { background: var(--red); }
.bar-fill.medium { background: var(--amber); }
.bar-progress { appearance: none; background: #edf2f4; border: 0; height: 8px; width: 100%; }
.bar-progress::-webkit-progress-bar { background: #edf2f4; }
.bar-progress::-webkit-progress-value { background: var(--teal); }
.bar-progress.high::-webkit-progress-value, .bar-progress.critical::-webkit-progress-value { background: var(--red); }
.bar-progress.medium::-webkit-progress-value { background: var(--amber); }
.bar-progress::-moz-progress-bar { background: var(--teal); }
.bar-progress.high::-moz-progress-bar, .bar-progress.critical::-moz-progress-bar { background: var(--red); }
.bar-progress.medium::-moz-progress-bar { background: var(--amber); }
.bar-row b { font-family: Georgia, serif; font-size: 18px; text-align: right; }
.top-rules { display: grid; gap: 3px; }
.top-rule { align-items: center; border-bottom: 1px solid #e8eef1; display: grid; grid-template-columns: 30px 1fr 40px; padding: 10px 0; }
.top-rule span { color: #8ba0aa; font-family: ui-monospace, monospace; font-size: 9px; }
.top-rule b { font-size: 12px; }
.top-rule strong { color: var(--teal-dark); font-family: Georgia, serif; font-size: 20px; text-align: right; }

.table-panel { padding: 0; }
.table-panel .panel-heading { margin: 0; padding: 22px 24px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; min-width: 850px; width: 100%; }
th { background: #edf3f5; color: #637b88; font-size: 9px; letter-spacing: .06em; padding: 12px 15px; text-align: left; text-transform: uppercase; }
td { border-top: 1px solid #e5edef; color: #314b5a; font-size: 12px; padding: 13px 15px; vertical-align: middle; }
tr:hover td { background: #f8fbfb; }
td code { color: var(--navy-800); font-size: 11px; }
.empty-cell { color: var(--muted); padding: 28px; text-align: center; }
.badge { display: inline-block; font-size: 9px; font-weight: 850; letter-spacing: .04em; padding: 5px 7px; text-transform: uppercase; }
.badge.high, .badge.critical { background: var(--red-soft); color: #9f3b36; }
.badge.medium { background: var(--amber-soft); color: #94610a; }
.badge.low { background: var(--teal-soft); color: var(--teal-dark); }
.badge.new { background: #e8f0f8; color: #3b6686; }
.badge.not_started, .badge.pending { background: #e8f0f8; color: #3b6686; }
.badge.initiated { background: #e4f5f3; color: #087f79; }
.badge.in_review { background: var(--amber-soft); color: #8b5d0b; }
.badge.escalated { background: var(--red-soft); color: #9e3c37; }
.badge.in_investigation { background: #f5e8f4; color: #81507e; }
.badge.declined { background: #f4ece6; color: #8b5e3d; }
.badge.closed, .badge.completed, .badge.completed_sar, .badge.completed_investigation, .badge.analyzed { background: #e1eee8; color: #377157; }
.badge.active, .badge.success, .badge.processed { background: #e1eee8; color: #377157; }
.badge.inactive, .badge.failure { background: var(--red-soft); color: #9e3c37; }

.filter-bar { align-items: end; background: var(--white); border: 1px solid var(--line); display: flex; gap: 14px; margin-bottom: 18px; padding: 16px; }
.filter-bar label, .dialog-form label { color: var(--muted); display: grid; font-size: 9px; font-weight: 800; gap: 6px; letter-spacing: .06em; text-transform: uppercase; }
.filter-bar label.grow { flex: 1; }
input, select, textarea { background: white; border: 1px solid #cad9df; color: var(--ink); min-height: 40px; padding: 8px 10px; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(6, 155, 148, .1); outline: 0; }
.primary-button, .secondary-button { border: 1px solid var(--teal); font-size: 11px; font-weight: 800; min-height: 40px; padding: 10px 15px; }
.primary-button { background: var(--teal); color: white; }
.primary-button:hover { background: var(--teal-dark); }
.secondary-button { background: white; color: var(--teal-dark); }
button:disabled { cursor: not-allowed; opacity: .45; }

.kpi-link { border: 0; position: relative; text-align: left; width: 100%; }
.kpi-link i { color: var(--teal-dark); font-size: 15px; font-style: normal; position: absolute; right: 18px; top: 17px; transition: transform .2s; }
.kpi-link:hover i { transform: translateX(4px); }
.dashboard-support-grid { display: grid; gap: 18px; grid-template-columns: .9fr .9fr 1.2fr; margin-bottom: 18px; }
.dashboard-recent-grid { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; margin-bottom: 18px; }
.health-score { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 13px; padding-bottom: 15px; }
.health-score strong { color: var(--teal-dark); font-family: Georgia, serif; font-size: 32px; font-weight: 500; }
.health-score span { color: var(--muted); font-size: 10px; }
.metric-list { display: grid; gap: 9px; margin-top: 13px; }
.metric-list div { align-items: center; border-bottom: 1px solid #edf1f3; display: flex; justify-content: space-between; padding: 7px 0; }
.metric-list span { color: var(--muted); font-size: 9px; }
.metric-list b { font-size: 11px; }
.case-status-bars { display: grid; gap: 13px; }
.case-status-row { align-items: center; background: transparent; border: 0; display: grid; gap: 12px; grid-template-columns: minmax(120px, auto) 1fr 28px; padding: 5px 6px; text-align: left; transition: background .15s ease; width: 100%; }
.case-status-row:hover, .case-status-row:focus-visible { background: #f1f8f8; outline: none; }
.case-status-row progress { appearance: none; background: #edf2f4; border: 0; height: 8px; width: 100%; }
.case-status-row progress::-webkit-progress-bar { background: #edf2f4; }
.case-status-row progress::-webkit-progress-value { background: var(--teal); }
.case-status-row progress::-moz-progress-bar { background: var(--teal); }
.case-status-row b { font-family: Georgia, serif; font-size: 18px; text-align: right; }
.dashboard-notifications { display: grid; gap: 7px; }
.dashboard-notification { background: #f5f8f9; border: 0; border-left: 3px solid #b8c9d0; display: grid; gap: 4px; padding: 10px 11px; text-align: left; }
.dashboard-notification.unread { background: #ecf7f5; border-left-color: var(--teal); }
.dashboard-notification span { font-size: 10px; font-weight: 800; }
.dashboard-notification small, .dashboard-notification time { color: var(--muted); font-size: 8px; line-height: 1.4; }
.dashboard-notification time { text-align: right; }
.dashboard-feed-panel { padding: 0; }
.dashboard-feed-panel .panel-heading { margin: 0; padding: 22px 24px; }
.dashboard-records { border-top: 1px solid var(--line); display: grid; }
.dashboard-record { align-items: center; background: white; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) auto minmax(118px, auto) 16px; padding: 14px 24px; text-align: left; width: 100%; }
.dashboard-record:last-child { border-bottom: 0; }
.dashboard-record:hover { background: #f6fafb; }
.dashboard-record-main { display: grid; gap: 3px; min-width: 0; }
.dashboard-record-main code { color: var(--teal-dark); font-size: 9px; }
.dashboard-record-main b { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-record-main small, .dashboard-record-value small { color: var(--muted); font-size: 8px; }
.dashboard-record-value { display: grid; gap: 3px; min-width: 82px; text-align: right; }
.dashboard-record-value b { font-size: 11px; }
.dashboard-record-badges { align-items: flex-end; display: grid; gap: 4px; justify-items: end; }
.dashboard-record-badges .badge { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-record i { color: var(--teal-dark); font-style: normal; }
.summary-strip { background: white; border-left: 4px solid var(--teal); box-shadow: var(--shadow); display: grid; gap: 0; grid-template-columns: repeat(5, 1fr); margin-bottom: 18px; padding: 7px 0; }
.summary-strip article { background: transparent; border-left: 1px solid var(--line); color: var(--ink); display: flex; flex-direction: column-reverse; justify-content: center; min-height: 72px; padding: 12px 24px; }
.summary-strip article:first-child { border-left: 0; }
.summary-strip span, .summary-strip b { display: block; }
.summary-strip span { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .08em; margin-top: 5px; text-transform: uppercase; }
.summary-strip b { color: var(--teal-dark); font-family: Georgia, serif; font-size: 28px; font-weight: 500; line-height: 1; margin-top: 0; overflow-wrap: anywhere; }
.dialog-summary { margin-top: 18px; }
.filter-bar.wrap { flex-wrap: wrap; }
.filter-bar.wrap .grow { min-width: 260px; }
.table-actions { display: flex; gap: 5px; }
.table-link { background: transparent; border: 0; color: var(--teal-dark); font-size: 10px; font-weight: 800; padding: 0; text-decoration: underline; }
.warning-text { color: #a46607 !important; }
.data-quality-grid { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; margin-bottom: 18px; }
.quality-meter { align-items: center; display: grid; gap: 16px; grid-template-columns: auto 1fr; }
.quality-meter strong, .quality-meter span { display: block; }
.quality-meter strong { color: var(--teal-dark); font-family: Georgia, serif; font-size: 36px; font-weight: 500; }
.quality-meter span { color: var(--muted); font-size: 9px; }
.quality-meter progress, .latest-lot progress, .table-progress progress { appearance: none; background: #e8eff1; border: 0; height: 7px; width: 100%; }
.quality-meter progress::-webkit-progress-value, .latest-lot progress::-webkit-progress-value, .table-progress progress::-webkit-progress-value { background: var(--teal); }
.latest-lot { display: grid; gap: 11px; }
.latest-lot > div { align-items: center; display: flex; justify-content: space-between; }
.latest-lot > b { font-size: 13px; }
.latest-lot > small { color: var(--muted); font-size: 9px; }
.table-progress { align-items: center; display: flex; gap: 7px; min-width: 95px; }
.table-progress span { color: var(--muted); font-size: 8px; }
.processing-banner { align-items: center; background: #e7f5f3; border-left: 4px solid var(--teal); display: flex; gap: 13px; margin-bottom: 18px; padding: 15px; }
.processing-banner b, .processing-banner small { display: block; }
.processing-banner b { font-size: 11px; }
.processing-banner small { color: var(--muted); font-size: 9px; margin-top: 3px; }
.spinner { animation: spin 1s linear infinite; border: 3px solid #b8ded9; border-radius: 50%; border-top-color: var(--teal); height: 25px; width: 25px; }
@keyframes spin { to { transform: rotate(360deg); } }
.route-mode-banner { align-items: center; background: var(--navy-950); color: white; display: flex; gap: 16px; margin-bottom: 18px; padding: 18px 22px; }
.route-mode-banner > span { align-items: center; background: var(--teal); border-radius: 50%; display: flex; font-size: 19px; height: 38px; justify-content: center; width: 38px; }
.route-mode-banner b { display: block; font-size: 12px; }
.route-mode-banner p { color: #9db5c0; font-size: 10px; line-height: 1.5; margin: 4px 0 0; }
.route-path { color: var(--teal-dark); font-family: ui-monospace, monospace; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lots-table { min-width: 0; table-layout: fixed; }
.lots-table th, .lots-table td { min-width: 0; overflow: hidden; padding-left: 9px; padding-right: 9px; }
.lots-table th:nth-child(1) { width: 9%; }
.lots-table th:nth-child(2) { width: 22%; }
.lots-table th:nth-child(3) { width: 10%; }
.lots-table th:nth-child(4) { width: 9%; }
.lots-table th:nth-child(5), .lots-table th:nth-child(6), .lots-table th:nth-child(7), .lots-table th:nth-child(8) { width: 6%; }
.lots-table th:nth-child(9) { width: 8%; }
.lots-table th:nth-child(10) { width: 10%; }
.lots-table th:nth-child(11) { width: 8%; }
.lots-table td:first-child code { display: block; font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lots-table .badge { line-height: 1.25; max-width: 100%; white-space: normal; }
.lots-table .table-progress { min-width: 0; }
.lots-table .table-progress progress { min-width: 36px; width: 100%; }
.route-detail { background: #eef6f6; border-left: 3px solid var(--teal); display: grid; gap: 6px; margin-top: 18px; padding: 13px 15px; }
.route-detail span { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.route-detail code { font-size: 10px; overflow-wrap: anywhere; }
.badge.processed_with_warnings, .badge.processing, .badge.warning { background: var(--amber-soft); color: #8b5d0b; }
.badge.rejected, .badge.error { background: var(--red-soft); color: #9e3c37; }
.lot-metadata { grid-template-columns: repeat(4, 1fr); }
.checksum { font-family: ui-monospace, monospace; font-size: 8px !important; overflow-wrap: anywhere; }

.case-list-toolbar { align-items: center; background: white; border-left: 4px solid var(--teal); box-shadow: var(--shadow); display: flex; justify-content: space-between; margin-bottom: 14px; min-height: 54px; padding: 9px 16px; }
.case-list-toolbar p { color: var(--muted); font-size: 10px; margin: 0; }
.case-list-toolbar p b { color: var(--ink); font-size: 12px; }
.case-list-toolbar p span { border-left: 1px solid var(--line); margin-left: 10px; padding-left: 10px; }
.case-list-toolbar label { align-items: center; color: var(--muted); display: flex; font-size: 8px; font-weight: 800; gap: 9px; letter-spacing: .06em; text-transform: uppercase; }
.case-list-toolbar select { min-height: 34px; min-width: 72px; padding: 6px 28px 6px 9px; }
.case-grid { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); }
.case-card { background: var(--white); border-top: 3px solid var(--teal); box-shadow: var(--shadow); padding: 20px; }
.case-card.high, .case-card.critical { border-top-color: var(--red); }
.case-card.medium { border-top-color: var(--amber); }
.case-card-head { align-items: center; display: flex; justify-content: space-between; }
.case-card h3 { font-size: 18px; margin: 16px 0 6px; }
.case-card p { color: var(--muted); font-size: 11px; }
.case-progress { display: grid; gap: 7px; grid-template-columns: 1fr auto; margin-top: 15px; }
.case-progress span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.case-progress b { font-size: 11px; }
.case-progress progress { appearance: none; background: #edf2f4; border: 0; grid-column: 1 / -1; height: 6px; width: 100%; }
.case-progress progress::-webkit-progress-bar { background: #edf2f4; }
.case-progress progress::-webkit-progress-value { background: var(--teal); }
.case-progress progress::-moz-progress-bar { background: var(--teal); }
.case-facts { display: grid; gap: 9px; margin: 15px 0 0; }
.case-facts div { align-items: center; display: flex; justify-content: space-between; }
.case-facts dt { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.case-facts dd { font-size: 10px; margin: 0; }
.case-meta { border-top: 1px solid var(--line); display: flex; justify-content: space-between; margin-top: 16px; padding-top: 14px; }
.case-meta span { color: var(--muted); font-size: 10px; }
.case-card button { margin-top: 16px; width: 100%; }
.pagination-bar { align-items: center; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 20px; }
.pagination-button { background: white; border: 1px solid var(--line); color: var(--navy-800); font-size: 10px; font-weight: 800; min-height: 36px; min-width: 36px; padding: 7px 10px; }
.pagination-button:hover:not(:disabled), .pagination-button.active { background: var(--teal); border-color: var(--teal); color: white; }
.pagination-button:disabled { color: #aab9c0; cursor: default; }
.pagination-wide { min-width: 92px; }
.pagination-ellipsis { color: var(--muted); font-size: 11px; padding: 0 3px; }

.rule-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
.rule-card { background: var(--white); box-shadow: var(--shadow); display: grid; gap: 18px; grid-template-columns: 45px 1fr auto; padding: 20px; }
.rule-number { align-items: center; background: var(--navy-950); color: white; display: flex; font-family: ui-monospace, monospace; font-size: 10px; height: 40px; justify-content: center; }
.rule-card h3 { font-size: 15px; margin-bottom: 6px; }
.rule-card p { color: var(--muted); font-size: 11px; line-height: 1.5; margin-bottom: 10px; }
.rule-card small { color: var(--teal-dark); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.rule-title-line { align-items: start; display: flex; gap: 10px; justify-content: space-between; }
.rule-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.rule-chips span { background: #eef4f5; color: #426477; font-size: 8px; font-weight: 750; padding: 5px 6px; text-transform: uppercase; }
.rule-actions { align-items: center; display: flex; gap: 8px; }
.mini-button { background: white; border: 1px solid var(--line); color: var(--teal-dark); font-size: 9px; font-weight: 800; padding: 7px 9px; }
.toggle { align-self: start; background: #bdcbd1; border: 0; border-radius: 20px; height: 24px; padding: 3px; width: 42px; }
.toggle::after { background: white; border-radius: 50%; content: ""; display: block; height: 18px; transition: .2s; width: 18px; }
.toggle.on { background: var(--teal); }
.toggle.on::after { transform: translateX(18px); }
.notice { background: var(--amber-soft); color: #805510; font-size: 11px; line-height: 1.6; margin-top: 18px; padding: 13px 15px; }

.import-grid { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
.upload-panel { align-items: center; display: flex; flex-direction: column; padding: 42px; text-align: center; }
.upload-icon { align-items: center; border: 1px solid var(--teal); border-radius: 50%; color: var(--teal); display: flex; font-size: 26px; height: 58px; justify-content: center; margin-bottom: 18px; width: 58px; }
.upload-panel p { color: var(--muted); font-size: 12px; }
.upload-panel input { height: 1px; opacity: 0; overflow: hidden; position: absolute; width: 1px; }
.file-picker { background: var(--navy-950); color: white; cursor: pointer; font-size: 11px; font-weight: 800; padding: 11px 18px; }
#selected-file { color: var(--muted); font-size: 10px; margin: 12px 0 20px; }
.upload-actions { display: flex; gap: 10px; }
.contract-panel { padding: 30px; }
.field-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 28px; }
.field-cloud code { background: #eef4f5; color: #315469; font-size: 10px; padding: 7px 8px; }
.contract-panel a { color: var(--teal-dark); font-size: 11px; font-weight: 800; }
.validation-result { margin-top: 18px; }
.validation-result.ok { border-left: 4px solid #27a873; }
.validation-result.fail { border-left: 4px solid var(--red); }
.validation-result ul { color: var(--muted); font-size: 11px; line-height: 1.7; }

.security-banner { align-items: center; background: var(--navy-950); color: white; display: flex; gap: 18px; margin-bottom: 18px; padding: 23px 26px; }
.security-banner > span { align-items: center; background: var(--teal); border-radius: 50%; display: flex; font-size: 20px; height: 43px; justify-content: center; width: 43px; }
.security-banner b { display: block; font-size: 15px; }
.security-banner p { color: #aec1ca; font-size: 11px; margin: 5px 0 0; }
.security-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin-bottom: 18px; }
.security-card { background: white; border-left: 3px solid var(--teal); box-shadow: var(--shadow); padding: 18px; }
.security-card.external { border-left-color: var(--amber); }
.security-card div { align-items: center; display: flex; justify-content: space-between; }
.security-card h3 { font-size: 13px; margin: 0; }
.security-card p { color: var(--muted); font-size: 10px; line-height: 1.55; margin: 9px 0 0; }
.catalog-grid, .audit-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
.product-grid, .role-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); }
.product-card, .role-card { background: white; box-shadow: var(--shadow); padding: 24px; }
.product-card header, .role-card header { align-items: flex-start; display: flex; justify-content: space-between; }
.product-card h2, .role-card h2 { margin-bottom: 6px; }
.product-card p, .role-card p { color: var(--muted); font-size: 11px; line-height: 1.5; }
.product-card footer, .role-card footer { align-items: center; border-top: 1px solid var(--line); display: flex; justify-content: space-between; margin-top: 18px; padding-top: 15px; }
.permission-cloud { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.permission-cloud span { background: #eef4f5; color: #426477; font-size: 8px; padding: 5px 6px; }
#report-summary { margin-bottom: 18px; }
.checkbox-grid { display: grid; gap: 8px; grid-column: 1 / -1; grid-template-columns: repeat(2, 1fr); max-height: 310px; overflow: auto; padding: 4px; }
.checkbox-grid label { align-items: center; border: 1px solid var(--line); display: flex; flex-direction: row; gap: 9px; padding: 9px; text-transform: none; }
.checkbox-grid input { min-height: auto; }
.form-error { background: var(--red-soft); color: #943b36; font-size: 11px; line-height: 1.5; padding: 10px 12px; }

.login-screen { display: grid; grid-template-columns: minmax(420px, 1.2fr) minmax(430px, .8fr); min-height: 100vh; }
.login-art { background: linear-gradient(145deg, #061a29, #0c3448); color: white; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 52px 62px; position: relative; }
.login-art::after { border: 1px solid rgba(36, 207, 194, .3); border-radius: 50%; content: ""; height: 620px; position: absolute; right: -220px; top: 80px; width: 620px; }
.login-brand { align-items: center; display: flex; gap: 13px; position: relative; z-index: 1; }
.login-brand small { color: #8da8b5; display: block; font-size: 8px; letter-spacing: .2em; margin-top: 4px; }
.login-copy { max-width: 620px; position: relative; z-index: 1; }
.login-copy p { color: #36c8be; font-size: 9px; font-weight: 850; letter-spacing: .2em; }
.login-copy h1 { color: white; font-size: clamp(45px, 6vw, 76px); line-height: .98; margin: 0 0 25px; }
.login-copy span { color: #9db3be; font-size: 12px; letter-spacing: .08em; }
.login-panel { align-items: center; background: #f8fbfc; display: flex; flex-direction: column; justify-content: center; padding: 50px; position: relative; }
.login-panel > .language-switch { position: absolute; right: 38px; top: 34px; }
.login-form { display: grid; gap: 18px; max-width: 390px; width: 100%; }
.login-form h2 { font-family: Georgia, serif; font-size: 40px; font-weight: 500; margin-bottom: 10px; }
.login-form label { color: var(--muted); display: grid; font-size: 10px; font-weight: 800; gap: 7px; text-transform: uppercase; }
.login-form input { min-height: 48px; }
.wide { width: 100%; }
.browser-token-button { justify-self: center; }
.demo-credentials { border-top: 1px solid var(--line); display: grid; gap: 7px; margin-top: 34px; max-width: 390px; padding-top: 20px; width: 100%; }
.demo-credentials > b { color: var(--muted); font-size: 9px; letter-spacing: .1em; margin-bottom: 3px; text-transform: uppercase; }
.demo-credentials span { color: #67808d; font-size: 9px; }
.demo-credentials strong { color: var(--ink); display: inline-block; min-width: 86px; }

dialog { border: 0; box-shadow: 0 30px 80px rgba(0,0,0,.3); max-width: 720px; padding: 0; width: calc(100% - 32px); }
.wide-dialog { max-width: 1180px; }
dialog::backdrop { background: rgba(5, 22, 32, .68); }
.dialog-shell { padding: 28px; }
.wide-dialog .dialog-shell { max-height: calc(100vh - 52px); overflow-y: auto; }
.dialog-heading { align-items: flex-start; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; padding-bottom: 18px; }
.heading-inline { align-items: center; display: flex; gap: 12px; }
.close-button { background: transparent; border: 0; color: var(--muted); font-size: 26px; }
.detail-grid { display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); margin: 20px 0; }
.detail-grid div { background: #f1f6f7; padding: 12px; }
.detail-grid span, .detail-grid b { display: block; }
.detail-grid span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.detail-grid b { font-size: 12px; margin-top: 5px; }
.dialog-alert { border-left: 3px solid var(--amber); margin: 8px 0; padding: 8px 12px; }
.dialog-alert b { display: block; font-size: 11px; }
.dialog-alert small { color: var(--muted); font-size: 10px; }
.dialog-form { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin-top: 22px; }
.dialog-form .full { grid-column: 1 / -1; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.split-actions { align-items: center; border-top: 1px solid var(--line); justify-content: space-between; padding-top: 18px; }
.split-actions > div { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.workflow-track { display: grid; gap: 5px; grid-template-columns: repeat(8, minmax(92px, 1fr)); margin: 20px 0; overflow-x: auto; }
.workflow-step { background: #eef3f5; border-top: 3px solid #bdccd2; color: #6f858f; display: grid; gap: 4px; min-height: 60px; padding: 9px; }
.workflow-step span { font-family: ui-monospace, monospace; font-size: 8px; }
.workflow-step b { font-size: 9px; text-transform: uppercase; }
.workflow-step.visited { background: #e7f3f1; border-top-color: #75bbb5; color: #39736e; }
.workflow-step.current { background: var(--navy-950); border-top-color: var(--teal); color: white; }
.case-summary { grid-template-columns: repeat(6, 1fr); }
.case-section { border: 1px solid var(--line); margin-top: 16px; padding: 18px; }
.section-heading { align-items: center; display: flex; justify-content: space-between; margin-bottom: 15px; }
.section-heading h3 { font-size: 14px; margin: 2px 0 0; }
.section-heading > span { color: var(--teal-dark); font-size: 10px; font-weight: 800; }
.locked-label { background: #eef2f3; color: var(--muted) !important; padding: 6px 8px; text-transform: uppercase; }
.case-control-grid, .case-review-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
.case-control-grid label, .case-review-grid label, #workflow-reason-wrap { color: var(--muted); display: grid; font-size: 9px; font-weight: 800; gap: 6px; letter-spacing: .06em; text-transform: uppercase; }
.case-review-grid .full { grid-column: 1 / -1; }
.compact-table { min-width: 820px; }
.compact-table td, .compact-table th { padding: 10px 12px; }
.cell-subtitle { color: var(--muted); display: block; font-size: 9px; line-height: 1.4; margin-top: 4px; max-width: 320px; }
.reason-cell { line-height: 1.45; max-width: 330px; }
.history-list { list-style: none; margin: 0; padding: 0; }
.history-list li { display: grid; gap: 12px; grid-template-columns: 10px 1fr; padding: 7px 0; }
.history-list li > span { background: var(--teal); border-radius: 50%; height: 8px; margin-top: 4px; width: 8px; }
.history-list b, .history-list small { display: block; }
.history-list b { font-size: 11px; }
.history-list small, .history-list p { color: var(--muted); font-size: 9px; margin: 3px 0 0; }
.alert-reason { background: #f2f6f7; border-left: 3px solid var(--amber); margin: 14px 0; padding: 13px 15px; }
.alert-reason span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.alert-reason p { font-size: 12px; margin: 6px 0 0; }
.review-metadata { color: var(--muted); font-size: 9px; text-align: right; }
.alert-context-section { margin-top: 18px; }
.alert-context-section .section-heading { margin-bottom: 0; }
.alert-context { grid-template-columns: repeat(6, 1fr); margin-top: 12px; }
.alert-context .badge { display: inline-block; margin-top: 7px; }
.transaction-detail-section { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 20px; }
.transaction-detail-section .section-heading p:not(.eyebrow) { color: var(--muted); font-size: 10px; line-height: 1.5; margin: 5px 0 0; }
.transaction-groups { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.transaction-group { border: 1px solid var(--line); min-width: 0; }
.transaction-group.full { grid-column: 1 / -1; }
.transaction-group > header { align-items: center; background: #edf4f5; border-bottom: 1px solid var(--line); display: flex; gap: 10px; padding: 10px 12px; }
.transaction-group > header span { align-items: center; background: var(--navy-950); color: white; display: flex; font-family: ui-monospace, monospace; font-size: 8px; height: 24px; justify-content: center; width: 24px; }
.transaction-group h4 { font-size: 11px; margin: 0; text-transform: uppercase; }
.transaction-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.transaction-fact { border-bottom: 1px solid #e8eef0; min-width: 0; padding: 10px 12px; }
.transaction-fact:nth-child(odd) { border-right: 1px solid #e8eef0; }
.transaction-fact.wide { grid-column: 1 / -1; }
.transaction-fact dt { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .05em; line-height: 1.35; text-transform: uppercase; }
.transaction-fact dd { color: var(--ink); font-size: 10px; font-weight: 750; line-height: 1.45; margin: 4px 0 0; overflow-wrap: anywhere; }
.catalog-value { display: grid; gap: 3px; }
.catalog-value > b { font-size: 10px; }
.catalog-value > small { align-items: center; color: var(--muted); display: flex; flex-wrap: wrap; font-size: 8px; font-weight: 600; gap: 3px; }
.catalog-value .badge { font-size: 7px; padding: 3px 5px; }
#alert-analysis-form > .dialog-form { border-top: 1px solid var(--line); padding-top: 20px; }
label.checkbox-label { align-items: center; align-self: end; display: flex; flex-direction: row; min-height: 40px; text-transform: none; }
label.checkbox-label input { min-height: auto; }
.form-section-title { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 11px; margin: 10px 0 2px; padding-bottom: 10px; }
.form-section-title > span { align-items: center; background: var(--navy-950); color: white; display: flex; font-family: ui-monospace, monospace; font-size: 9px; height: 32px; justify-content: center; width: 32px; }
.form-section-title div { display: grid; gap: 2px; }
.form-section-title b { color: var(--ink); font-size: 12px; }
.form-section-title small { color: var(--muted); font-size: 9px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.form-section-title button { margin-left: auto; }
.rule-conditions { display: grid; gap: 8px; }
.rule-condition-row { align-items: end; background: #f3f7f8; border-left: 3px solid var(--teal); display: grid; gap: 8px; grid-template-columns: 34px 1fr 1.25fr .8fr .7fr 1.4fr .8fr 32px; padding: 11px; }
.rule-condition-row label { margin: 0; }
.condition-index { align-items: center; align-self: stretch; color: #77909b; display: flex; font-family: ui-monospace, monospace; font-size: 9px; justify-content: center; }
.remove-condition { background: var(--red-soft); border: 0; color: #9f3b36; font-size: 18px; height: 40px; }
.toast { background: var(--navy-950); bottom: 20px; color: white; font-size: 12px; opacity: 0; padding: 13px 17px; pointer-events: none; position: fixed; right: 20px; transform: translateY(10px); transition: .2s; z-index: 30; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1050px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { bottom: 0; box-shadow: 10px 0 40px rgba(0,0,0,.2); left: -260px; position: fixed; top: 0; transition: .2s; width: 248px; z-index: 20; }
  .sidebar.open { left: 0; }
  .menu-button { display: block; }
  .topbar > div:first-of-type { margin-right: auto; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .case-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-support-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-support-grid > :last-child { grid-column: 1 / -1; }
  .dashboard-recent-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1280px) {
  .lots-table-wrap { overflow: visible; }
  .lots-table { display: block; }
  .lots-table thead { display: none; }
  .lots-table tbody { background: #edf3f5; display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; }
  .lots-table tr { background: white; box-shadow: 0 2px 12px rgba(7, 32, 46, .06); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 0; padding: 9px 12px; }
  .lots-table td { border-top: 0; border-bottom: 1px solid #e5edef; display: grid; gap: 5px; min-height: 49px; padding: 9px 6px; }
  .lots-table td::before { color: #637b88; content: attr(data-label); font-size: 8px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
  .lots-table td:nth-child(1), .lots-table td:nth-child(2), .lots-table td:nth-child(11) { grid-column: 1 / -1; }
  .lots-table td:nth-child(10), .lots-table td:nth-child(11) { border-bottom: 0; }
  .lots-table td:first-child code { font-size: 11px; }
  .lots-table .route-path { white-space: normal; overflow-wrap: anywhere; }
  .lots-table .mini-button { justify-self: stretch; width: 100%; }
  .lots-table .empty-cell { grid-column: 1 / -1; }
  .lots-table .empty-cell::before { content: none; }
}

@media (max-width: 720px) {
  .topbar { padding: 0 18px; }
  .topbar-actions .connection { display: none; }
  main { padding: 28px 16px 50px; }
  .page-heading { align-items: flex-start; display: grid; gap: 15px; }
  .as-of { text-align: left; }
  .kpi-grid, .dashboard-overview-grid, .dashboard-support-grid, .dashboard-recent-grid, .case-grid, .rule-grid, .import-grid, .security-grid, .product-grid, .role-grid, .summary-strip, .data-quality-grid { grid-template-columns: 1fr; }
  .dashboard-support-grid > :last-child { grid-column: auto; }
  .case-status-row { grid-template-columns: minmax(100px, auto) 1fr 25px; }
  .dashboard-record { gap: 9px; grid-template-columns: minmax(0, 1fr) auto 16px; padding: 13px 16px; }
  .dashboard-record-value { display: none; }
  .dashboard-record-badges { display: flex; flex-wrap: wrap; grid-column: 1 / -1; grid-row: 2; justify-items: start; }
  .dashboard-record-badges .badge { display: inline-block; margin-right: 4px; }
  .dashboard-record > i { grid-column: 3; grid-row: 1; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .filter-bar label { width: 100%; }
  .panel { padding: 20px; }
  .table-panel { padding: 0; }
  .rule-card { grid-template-columns: 40px 1fr auto; }
  .dialog-form, .detail-grid { grid-template-columns: 1fr; }
  .dialog-form .full { grid-column: auto; }
  .case-summary, .case-control-grid, .case-review-grid { grid-template-columns: 1fr; }
  .lot-metadata { grid-template-columns: 1fr; }
  .alert-context, .transaction-groups, .transaction-facts { grid-template-columns: 1fr; }
  .transaction-group.full, .transaction-fact.wide { grid-column: auto; }
  .transaction-fact:nth-child(odd) { border-right: 0; }
  .case-review-grid .full { grid-column: auto; }
  .rule-condition-row { grid-template-columns: 32px 1fr; }
  .rule-condition-row .condition-values { grid-column: 2; }
  .split-actions { align-items: stretch; flex-direction: column; }
  .login-screen { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-panel { min-height: 100vh; padding: 32px 22px; }
  .notification-popover { max-width: calc(100vw - 24px); position: fixed; right: 12px; top: 66px; width: 390px; }
  .topbar-actions { gap: 7px; }
  .language-switch.compact, .user-button > span:last-child { display: none; }
  .lots-table tbody { grid-template-columns: 1fr; padding: 8px; }
  .summary-strip { padding: 0 16px; }
  .summary-strip article { align-items: center; border-left: 0; border-top: 1px solid var(--line); flex-direction: row; justify-content: space-between; min-height: 58px; padding: 11px 4px; }
  .summary-strip article:first-child { border-top: 0; }
  .summary-strip span { margin-top: 0; }
  .summary-strip b { font-size: 24px; }
  .case-list-toolbar { align-items: stretch; display: grid; gap: 10px; }
  .case-list-toolbar p { display: flex; flex-wrap: wrap; gap: 3px; }
  .case-list-toolbar p span { border-left: 0; display: block; margin-left: 0; padding-left: 0; width: 100%; }
  .case-list-toolbar label { justify-content: space-between; }
  .pagination-wide { min-width: 42px; }
}

/* Shared integration and recovered-module controls. */
.integration-settings { margin-top: 20px; padding: 24px; }
.integration-form { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 16px; margin: 20px 0; }
.integration-form label { display: grid; gap: 8px; font-size: 12px; color: var(--ink); }
.integration-form input, .integration-form select, .integration-form textarea, #column-mapping input, #column-mapping select { width: 100%; border: 1px solid var(--line); background: var(--white); color: var(--ink); padding: 10px; min-height: 40px; }
#column-mapping { margin-top: 20px; }
#column-mapping .table-wrap { max-height: 450px; overflow: auto; }
#column-mapping th { position: sticky; top: 0; background: var(--surface); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--teal-dark); outline-offset: 3px; }
#compliance-dialog { padding: 24px; }
#compliance-dialog pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; color: var(--muted); }
.integration-form input[type="checkbox"] { width: 18px; min-height: 18px; vertical-align: middle; accent-color: var(--teal-dark); }
.integration-form textarea { resize: vertical; }

/* Profiling — V4 configuration, using the New design tokens. */
.profiling-section-nav, .profiling-tabs { display: flex; gap: 6px; overflow-x: auto; }
.profiling-section-nav { border-bottom: 1px solid var(--line); margin: 0 0 28px; }
.profiling-section-nav button, .profiling-tabs button { border: 0; background: transparent; color: var(--muted); padding: 14px 18px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.profiling-section-nav button.active, .profiling-tabs button.active { color: var(--teal-dark); box-shadow: inset 0 -3px var(--teal-dark); }
.profiling-intro { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 22px; }
.profiling-intro h2 { margin: 6px 0 9px; font-size: 22px; }
.profiling-intro p:not(.eyebrow) { color: var(--muted); font-size: 13px; line-height: 1.6; }
.profiling-tabs { background: var(--white); border-bottom: 1px solid var(--line); }
.profiling-panel { padding: 24px; }
.profiling-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; margin-bottom: 22px; }
.profiling-toolbar > button { margin-left: auto; min-height: 40px; }
.profiling-toolbar label { display: grid; gap: 8px; font-size: 11px; }
.profiling-toolbar input, .profiling-toolbar select { padding: 11px 12px; border: 1px solid var(--line); background: var(--white); color: var(--ink); min-width: 180px; }
.profiling-empty { text-align: center; padding: 40px !important; color: var(--muted); }
.profiling-status { background: var(--teal-soft); color: var(--teal-dark); font-size: 10px; font-weight: 700; padding: 5px 9px; white-space: nowrap; }
.profiling-help { color: var(--muted); font-size: 12px; line-height: 1.7; margin-bottom: 20px; max-width: 900px; }
.profiling-settings-section { border-bottom: 1px solid var(--line); padding: 6px 0 24px; margin-bottom: 20px; }
.profiling-settings-section h4 { font-size: 14px; margin: 16px 0; }
.profiling-checks { display: flex; flex-wrap: wrap; gap: 20px; }
.profiling-check, .integration-form .profiling-check { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.profiling-check input { width: 18px; height: 18px; accent-color: var(--teal-dark); }
.profiling-form-actions { display: flex; justify-content: flex-end; margin-top: 22px; }
#profiling-settings-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
#profiling-config-dialog { max-width: 820px; }
#profiling-config-dialog .integration-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
#profiling-config-dialog select[multiple] { min-height: 108px; }
@media (max-width: 620px) { .profiling-panel { padding: 16px; } .profiling-intro { align-items: flex-start; } #profiling-config-dialog .integration-form { grid-template-columns: 1fr; } }
.profiling-dashboard { padding: 24px; margin-bottom: 24px; }
.profiling-dashboard .summary-strip { margin: 20px 0; }
.product-module-list { display: grid; gap: 10px; margin: 18px 0; }
.product-module-option { display: flex !important; align-items: center; gap: 12px; border: 1px solid var(--line); padding: 14px; }
.product-module-option input { width: 18px; min-height: 18px; accent-color: var(--teal-dark); }
.product-module-option span { display: grid; gap: 5px; }
.product-module-option small { color: var(--muted); font-size: 11px; }
.product-module-option:has(input:disabled) { background: var(--surface); opacity: .7; }
@media (min-width: 901px) { #kpis:has(> :nth-child(6)) { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (min-width: 1500px) { #kpis:has(> :nth-child(6)) { grid-template-columns: repeat(6,minmax(0,1fr)); } }
@media (min-width: 651px) { .profiling-dashboard .summary-strip { grid-template-columns: repeat(4,minmax(0,1fr)); } }
.dialog-form .product-enabled { display:flex; align-items:center; gap:10px; }
.dialog-form .product-enabled input { width:18px; min-height:18px; height:18px; accent-color:var(--teal-dark); }
.product-module-option span, .product-module-option small { text-transform:none; letter-spacing:normal; }

.screening-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; margin-top:24px; }
.screening-form label,.screening-dialog label {display:flex;flex-direction:column;gap:8px;font-size:13px;color:var(--muted);}
.screening-form fieldset {border:1px solid var(--line);padding:16px;display:grid;grid-template-columns:1fr 1fr;gap:12px;}
.screening-form legend {font-size:13px;font-weight:700;padding:0 8px;}
.screening-wide {grid-column:1/-1;}
.screening-upload {padding:20px;background:var(--surface-soft,#f1f6f6);}
.screening-upload>label {display:inline-flex;margin:8px 16px 16px 0;}
.screening-file {background:white;padding:18px;margin:12px 0;border:1px solid var(--line);}
.screening-mapping {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;}
.screening-actions {display:flex;gap:20px;align-items:center;flex-wrap:wrap;margin:20px 0;}
.screening-sub {display:block;color:var(--muted);margin-top:6px;}
.screening-dialog {width:min(1100px,94vw);max-height:90vh;overflow:auto;border:0;padding:28px;color:var(--ink);}
.screening-dialog::backdrop {background:#06233188;}
.screening-dialog form {margin:24px 0;}
.screening-dialog textarea,#sc-notes textarea {width:100%;margin:12px 0;}
.screening-dialog .profiling-check {flex-direction:row;align-items:center;}
.screening-comparison {display:grid;grid-template-columns:1fr 1fr;gap:20px;}
#screening-content details {margin:18px 0;}
#screening-content summary {cursor:pointer;color:var(--teal,#087f79);font-weight:700;}
#screening-print {display:none;}
@media(max-width:750px){.screening-form,.screening-comparison{grid-template-columns:1fr}.screening-mapping{grid-template-columns:1fr 1fr}}
@media print {
  body.screening-printing > :not(#screening-print) {display:none!important;}
  body.screening-printing #screening-print {display:block;color:#102c3a;background:white;font:11pt sans-serif;}
  #screening-print table {width:100%;border-collapse:collapse;} #screening-print td,#screening-print th {border-bottom:1px solid #ccd9dd;padding:8px;text-align:left;white-space:normal;}
  #screening-print h1,#screening-print h2,#screening-print h3 {break-after:avoid;}
  #screening-print tr {break-inside:avoid;}
}
.screening-dialog {max-width:1100px;}
.screening-comparison {grid-template-columns:repeat(2,minmax(0,1fr));}
.screening-comparison section {min-width:0;}
.screening-dialog table {min-width:0;}
.screening-dialog td {white-space:normal;overflow-wrap:anywhere;}
#screening-content .summary-strip {grid-template-columns:repeat(4,minmax(0,1fr));}
#screening-content .summary-strip > div {padding:16px 24px;border-right:1px solid var(--line);}
@media(max-width:750px){.screening-comparison{grid-template-columns:1fr}#screening-content .summary-strip{grid-template-columns:1fr 1fr}}
@media print {#screening-print table {min-width:0;}#screening-print p {white-space:pre-wrap;}}
.screening-dialog input[type=checkbox] {accent-color:var(--teal-dark);}
.sar-mode {padding:14px 20px;background:var(--teal-soft);color:var(--teal-dark);margin-bottom:20px;font-size:13px;}
.sar-form {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;border:0;padding:0;margin:20px 0;}
#sar-content label {display:flex;flex-direction:column;gap:8px;font-size:13px;color:var(--muted);}
#sar-content .profiling-check {flex-direction:row;align-items:center;}
#sar-content input[type=checkbox] {accent-color:var(--teal-dark);}
.sar-wide {grid-column:1/-1;}
.sar-create {display:flex;align-items:end;gap:20px;margin:20px 0;}.sar-create label{flex:1;}
.sar-validation {padding:18px;background:var(--amber-soft);margin-bottom:20px;font-size:13px;}
.sar-decision {border-top:1px solid var(--line);padding-top:20px;display:grid;gap:16px;}
#sar-content .summary-strip {grid-template-columns:repeat(4,minmax(0,1fr));}
#sar-print {display:none;}
@media(max-width:750px){.sar-form{grid-template-columns:1fr}.sar-create{flex-direction:column;align-items:stretch}}
@media print {
 body.sar-printing {background:white;}
 body.sar-printing>:not(#sar-print){display:none!important;}
 body.sar-printing #sar-print{display:block;color:var(--ink);font:11pt sans-serif;}
 #sar-print table{min-width:0;width:100%;border-collapse:collapse;}#sar-print td,#sar-print th{padding:8px;white-space:normal;overflow-wrap:anywhere;border-bottom:1px solid var(--line);}
 #sar-print p{white-space:pre-wrap;}#sar-print h1,#sar-print h2,#sar-print h3{break-after:avoid;}#sar-print tr{break-inside:avoid;}
}

/* Shared transaction analytics, using the client distribution theme. */
.analytics-filters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}.analytics-filters label{display:grid;gap:7px;min-width:0}.analytics-filters input,.analytics-filters select{width:100%;min-width:0;border:1px solid var(--line);background:var(--white);color:var(--ink);padding:10px}.analytics-filter-actions{display:flex;align-items:end;gap:8px}.analytics-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.analytics-currency{margin:30px 0}.analytics-bars{display:grid;gap:10px;margin-top:20px}.analytics-bar{display:grid;grid-template-columns:minmax(80px,1fr) minmax(50px,1fr) auto 42px;align-items:center;gap:10px;border:0;background:transparent;text-align:left;color:var(--ink);padding:6px 0;width:100%}.analytics-bar:hover{background:var(--surface)}.analytics-bar span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}.analytics-bar b,.analytics-bar small{font-size:11px}.analytics-bar svg{width:100%;height:14px}.chart-track{fill:var(--surface)}.chart-fill{fill:var(--teal-dark)}.chart-line{fill:none;stroke:var(--teal-dark);stroke-width:3}.chart-axis{stroke:var(--line)}.analytics-trend{width:100%;max-height:270px;margin-top:18px}.analytics-trend text{fill:var(--muted);font-size:12px}.analytics-currency details{margin-top:10px}.analytics-currency .summary-strip b{font-size:clamp(17px,2vw,28px)}.transaction-analysis[aria-busy=true]{opacity:.65;pointer-events:none}.transaction-analysis .panel h2{font-size:22px}.transaction-analysis .table-wrap{max-height:480px;overflow:auto}
@media(max-width:1100px){.analytics-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.analytics-grid{grid-template-columns:1fr}}@media(max-width:600px){.analytics-filters{grid-template-columns:1fr}.analytics-bar{grid-template-columns:1fr 60px auto}.analytics-bar small{display:none}}
.transaction-analysis>.summary-strip{grid-template-columns:repeat(6,minmax(0,1fr))}.transaction-analysis>.panel-heading{margin-top:18px}@media(max-width:1250px){.transaction-analysis>.summary-strip{grid-template-columns:repeat(3,minmax(0,1fr))}}
.analytics-currency .summary-strip{grid-template-columns:repeat(4,minmax(0,1fr))}@media(max-width:800px){.analytics-currency .summary-strip{grid-template-columns:repeat(2,minmax(0,1fr))}}
.dashboard-analytics-currencies{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,380px),1fr));gap:24px}.dashboard-country{display:grid;grid-template-columns:minmax(100px,1fr) minmax(40px,100px) auto 42px;gap:12px;align-items:center;padding:12px 0;border-bottom:1px solid var(--line)}.dashboard-country span{font-size:13px}.dashboard-country span small{display:block;color:var(--muted)}.dashboard-country progress{width:100%;height:8px;accent-color:var(--teal-dark)}.dashboard-country>b{font-size:13px}.dashboard-country>small{font-size:11px;text-align:right}@media(max-width:650px){.dashboard-country{grid-template-columns:1fr auto 40px}.dashboard-country progress{display:none}}
#list-screening-content[aria-busy=true]{opacity:.65;pointer-events:none}.list-match{border-top:1px solid var(--line);padding:24px 0}.list-source-url{overflow-wrap:anywhere;color:var(--muted);font-size:12px}.list-ai{white-space:pre-wrap}

.nav-section { display: grid; gap: 3px; }
.nav-item:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }

#list-evidence { scroll-margin-top: 90px; }
#list-evidence:focus { outline: 2px solid var(--teal); outline-offset: 3px; }

.customer-list-status{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:8px 0}.customer-list-status small{color:var(--muted)}
.transaction-party{padding:10px 0;white-space:normal;min-width:180px}.transaction-party+.transaction-party{border-top:1px solid var(--line)}

/* Compact transaction overview; participant evidence stays in the detail dialog. */
.transactions-compact{table-layout:fixed;min-width:900px}
.transactions-compact th,.transactions-compact td{padding:14px 12px;overflow-wrap:anywhere}
.transactions-compact th:nth-child(1){width:12%}.transactions-compact th:nth-child(2){width:19%}.transactions-compact th:nth-child(3){width:19%}.transactions-compact th:nth-child(4){width:12%}.transactions-compact th:nth-child(5){width:17%}.transactions-compact th:nth-child(6){width:13%}.transactions-compact th:nth-child(7){width:8%}
.transactions-compact .transaction-id{white-space:nowrap;font-weight:700}
.transactions-compact .transaction-amount{white-space:nowrap;text-align:right;font-variant-numeric:tabular-nums}
.transactions-compact th:nth-child(4){text-align:right}
.transaction-list-chip{display:inline-flex;align-items:center;gap:8px;border:1px solid var(--line);background:var(--teal-soft);color:var(--teal-dark);font-size:11px;font-weight:700;padding:6px 9px;text-align:left}
.transaction-list-chip.attention{background:var(--amber-soft);color:#875a14;border-color:#eddbb3}
.transaction-list-chip:hover{filter:brightness(.96)}.transaction-list-chip:focus-visible{outline:2px solid var(--teal-dark);outline-offset:3px}
.transaction-filters.filter-bar{display:grid;grid-template-columns:minmax(200px,2fr) repeat(3,minmax(65px,.65fr)) repeat(2,minmax(130px,1fr)) auto;gap:12px}
.transaction-filters.filter-bar label.grow{min-width:0}.transaction-filters label,.transaction-filters input{min-width:0;width:100%}
.transaction-parties-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:24px}
.transaction-parties-grid .transaction-party{padding:18px;border:1px solid var(--line);background:var(--surface);min-width:0}
.transaction-parties-grid .transaction-party>b{color:var(--teal-dark)}
@media(max-width:1450px){.transaction-filters.filter-bar{grid-template-columns:repeat(4,minmax(0,1fr))}.transaction-filters .grow{grid-column:span 2}}
@media(max-width:700px){.transaction-filters.filter-bar{grid-template-columns:repeat(2,minmax(0,1fr))}.transaction-parties-grid{grid-template-columns:1fr}}

/* Account profiling workspace: preserves the corporate palette across the V4 workflows. */
#profiling-content { min-width: 0; }
.profiling-section-nav { flex-wrap: wrap; gap: 4px; }
.pf-panel { padding: 24px; margin: 20px 0; min-width: 0; }
.pf-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; margin: 20px 0; padding: 20px; background: var(--white, #fff); border: 1px solid var(--line, #d7e3e8); }
.pf-filters label { flex: 1 1 155px; max-width: 300px; min-width: 0; }
.pf-form label,.pf-filters label { display: grid; gap: 7px; font-size: 13px; font-weight: 600; }
.pf-form input:not([type=checkbox]),.pf-form select,.pf-form textarea,.pf-filters input,.pf-filters select { width: 100%; min-width: 0; padding: 11px; color: inherit; background: #fff; border: 1px solid var(--line, #d7e3e8); font: inherit; }
.pf-form { display: grid; gap: 16px; }
.pf-form .primary-button { justify-self: start; }
.pf-form textarea { resize: vertical; }
.pf-context,.pf-bulk,.pf-pagination { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.pf-context p,.pf-case-context p { margin: 12px 0 0; }
.pf-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pf-bulk { justify-content: flex-start; margin-bottom: 16px; }
.pf-pagination { margin-top: 18px; font-size: 13px; }
.pf-badge { display: inline-flex; padding: 5px 8px; margin: 2px; background: #e0f1ed; color: #076b65; font-size: 11px; font-weight: 700; line-height: 1.4; }
.pf-badge.attention { background: #fff1d2; color: #8b5805; }
.pf-overdue { color: #a73532; font-weight: 700; }
.pf-workspace { display: grid; grid-template-columns: minmax(0,1fr) 290px; gap: 22px; align-items: start; }
.pf-workflow { position: sticky; top: 20px; }
.pf-workflow h3 { margin-bottom: 20px; }
.pf-workflow .pf-actions { margin-top: 20px; }
.pf-workspace pre, #profiling-content pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 300px; overflow: auto; }
.pf-panel table td { vertical-align: top; }
.pf-panel table td .text-button { white-space: normal; }
.pf-editor-table { min-width: 750px; }
.pf-editor-table td { padding: 8px; }
.pf-editor-table td:first-child { min-width: 195px; }
.pf-panel summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
@media(max-width:1250px) { .pf-workspace { grid-template-columns: minmax(0,1fr); } .pf-workflow { position: static; } .pf-panel { padding: 18px; } }
