/*
 * AQUILA IF1-B2-R2
 * Commercial Inventory Finance workspace.
 * TEST only.
 * Presentation/read-only interaction layer only.
 */

#if1-r2-root {
  --ifx-navy: #17233a;
  --ifx-ink: #1f2c31;
  --ifx-muted: #66767b;
  --ifx-soft-muted: #87959a;

  --ifx-teal: #0d766d;
  --ifx-teal-dark: #095f58;
  --ifx-teal-soft: #edf9f6;

  --ifx-green: #2b875b;
  --ifx-green-soft: #eef8f2;

  --ifx-amber: #9a6818;
  --ifx-amber-soft: #fff7e5;

  --ifx-red: #a84343;
  --ifx-red-soft: #fff1ef;

  --ifx-blue: #3567a8;
  --ifx-blue-soft: #f0f5fb;

  --ifx-border: #dae4e2;
  --ifx-border-strong: #ccd9d6;

  --ifx-surface: #ffffff;
  --ifx-page: #f5f8f7;

  --ifx-shadow:
    0 1px 2px rgba(20, 43, 38, 0.03),
    0 8px 26px rgba(20, 43, 38, 0.055);

  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  color: var(--ifx-ink);
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

#if1-r2-root *,
#if1-r2-root *::before,
#if1-r2-root *::after {
  box-sizing: border-box;
}

#if1-r2-root[hidden],
#if1-r2-root [hidden] {
  display: none !important;
}

#if1-r2-root button,
#if1-r2-root input,
#if1-r2-root select {
  font: inherit;
}

#if1-r2-root .ifx-shell {
  width: 100%;
  min-width: 0;
  padding: 22px 24px 56px;
  background: var(--ifx-page);
}

#if1-r2-root .ifx-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

#if1-r2-root .ifx-header-main {
  min-width: 0;
}

#if1-r2-root .ifx-eyebrow {
  margin: 0 0 5px;
  color: var(--ifx-teal);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.085em;
  text-transform: uppercase;
}

#if1-r2-root .ifx-title {
  margin: 0;
  color: var(--ifx-navy);
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 820;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

#if1-r2-root .ifx-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

#if1-r2-root .ifx-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--ifx-border);
  border-radius: 999px;
  background: var(--ifx-surface);
  color: var(--ifx-muted);
  font-size: 11px;
  font-weight: 750;
}

#if1-r2-root .ifx-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

#if1-r2-root .ifx-chip--good {
  border-color: #bddfd2;
  background: var(--ifx-green-soft);
  color: var(--ifx-green);
}

#if1-r2-root .ifx-chip--warning {
  border-color: #edd8a4;
  background: var(--ifx-amber-soft);
  color: var(--ifx-amber);
}

#if1-r2-root .ifx-chip--danger {
  border-color: #edc5c1;
  background: var(--ifx-red-soft);
  color: var(--ifx-red);
}

#if1-r2-root .ifx-button {
  appearance: none;
  min-height: 36px;
  border: 1px solid var(--ifx-border-strong);
  border-radius: 9px;
  background: var(--ifx-surface);
  color: var(--ifx-navy);
  padding: 7px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 780;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease,
    background 120ms ease;
}

#if1-r2-root .ifx-button:hover,
#if1-r2-root .ifx-button:focus-visible {
  border-color: var(--ifx-teal);
  box-shadow: 0 3px 12px rgba(13, 118, 109, 0.10);
  outline: none;
  transform: translateY(-1px);
}

#if1-r2-root .ifx-button--primary {
  border-color: var(--ifx-teal);
  background: var(--ifx-teal);
  color: #fff;
}

#if1-r2-root .ifx-button--primary:hover,
#if1-r2-root .ifx-button--primary:focus-visible {
  background: var(--ifx-teal-dark);
}

#if1-r2-root .ifx-button--quiet {
  background: #f8faf9;
}

#if1-r2-root .ifx-summarybar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  min-height: 46px;
  margin-bottom: 13px;
  padding: 10px 14px;
  border: 1px solid var(--ifx-border);
  border-radius: 12px;
  background: var(--ifx-surface);
  box-shadow: 0 1px 2px rgba(20, 43, 38, 0.025);
  font-size: 11px;
  color: var(--ifx-muted);
}

#if1-r2-root .ifx-summarybar strong {
  color: var(--ifx-ink);
  font-weight: 800;
}

#if1-r2-root .ifx-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  margin-bottom: 16px;
  padding: 5px;
  border: 1px solid var(--ifx-border);
  border-radius: 12px;
  background: var(--ifx-surface);
  box-shadow: 0 1px 2px rgba(20, 43, 38, 0.025);
  scrollbar-width: thin;
}

#if1-r2-root .ifx-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ifx-muted);
  padding: 7px 11px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 790;
}

#if1-r2-root .ifx-tab:hover {
  background: #f6f9f8;
  color: var(--ifx-navy);
}

#if1-r2-root .ifx-tab[aria-selected="true"] {
  background: var(--ifx-teal-soft);
  color: var(--ifx-teal-dark);
}

#if1-r2-root .ifx-tab svg {
  width: 15px;
  height: 15px;
}

#if1-r2-root .ifx-actionbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

#if1-r2-root .ifx-actionbar-label {
  margin-right: 2px;
  color: var(--ifx-soft-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

#if1-r2-root .ifx-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}

#if1-r2-root .ifx-col-3 {
  grid-column: span 3;
}

#if1-r2-root .ifx-col-4 {
  grid-column: span 4;
}

#if1-r2-root .ifx-col-5 {
  grid-column: span 5;
}

#if1-r2-root .ifx-col-6 {
  grid-column: span 6;
}

#if1-r2-root .ifx-col-7 {
  grid-column: span 7;
}

#if1-r2-root .ifx-col-8 {
  grid-column: span 8;
}

#if1-r2-root .ifx-col-12 {
  grid-column: span 12;
}

#if1-r2-root .ifx-kpi {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 15px;
  border: 1px solid var(--ifx-border);
  border-radius: 13px;
  background: var(--ifx-surface);
  box-shadow: var(--ifx-shadow);
}

#if1-r2-root .ifx-kpi--danger {
  border-color: #edc9c5;
  background: var(--ifx-red-soft);
}

#if1-r2-root .ifx-kpi--warning {
  border-color: #ecd8a6;
  background: var(--ifx-amber-soft);
}

#if1-r2-root .ifx-kpi--good {
  border-color: #c3e1d5;
  background: var(--ifx-green-soft);
}

#if1-r2-root .ifx-kpi-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

#if1-r2-root .ifx-iconbox {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--ifx-teal-soft);
  color: var(--ifx-teal);
}

#if1-r2-root .ifx-kpi--danger .ifx-iconbox {
  background: rgba(168, 67, 67, 0.10);
  color: var(--ifx-red);
}

#if1-r2-root .ifx-kpi--warning .ifx-iconbox {
  background: rgba(154, 104, 24, 0.10);
  color: var(--ifx-amber);
}

#if1-r2-root .ifx-kpi-label {
  margin: 0;
  color: var(--ifx-muted);
  font-size: 11px;
  font-weight: 780;
  line-height: 1.35;
}

#if1-r2-root .ifx-kpi-value {
  margin: 0;
  color: var(--ifx-navy);
  font-size: clamp(23px, 2.4vw, 31px);
  font-weight: 850;
  letter-spacing: -0.035em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

#if1-r2-root .ifx-kpi-note {
  margin: 8px 0 0;
  color: var(--ifx-muted);
  font-size: 11px;
  line-height: 1.5;
}

#if1-r2-root .ifx-kpi-progress {
  height: 4px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(98, 117, 112, 0.13);
}

#if1-r2-root .ifx-kpi-progress span {
  display: block;
  height: 100%;
  max-width: 100%;
  border-radius: inherit;
  background: var(--ifx-teal);
}

#if1-r2-root .ifx-section {
  margin-top: 18px;
}

#if1-r2-root .ifx-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 9px;
}

#if1-r2-root .ifx-section-head h2 {
  margin: 0;
  color: var(--ifx-navy);
  font-size: 16px;
  font-weight: 820;
  letter-spacing: -0.015em;
}

#if1-r2-root .ifx-section-head p {
  margin: 4px 0 0;
  color: var(--ifx-muted);
  font-size: 11px;
  line-height: 1.45;
}

#if1-r2-root .ifx-panel-card {
  border: 1px solid var(--ifx-border);
  border-radius: 13px;
  background: var(--ifx-surface);
  box-shadow: var(--ifx-shadow);
  padding: 15px;
}

#if1-r2-root .ifx-ledger-flow {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    42px
    minmax(0, 1fr)
    42px
    minmax(0, 1fr);
  align-items: stretch;
}

#if1-r2-root .ifx-ledger-node {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--ifx-border);
  border-radius: 12px;
  background: var(--ifx-surface);
  box-shadow: var(--ifx-shadow);
}

#if1-r2-root .ifx-ledger-node small {
  display: block;
  margin-bottom: 7px;
  color: var(--ifx-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

#if1-r2-root .ifx-ledger-node strong {
  display: block;
  color: var(--ifx-navy);
  font-size: 22px;
  font-weight: 850;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

#if1-r2-root .ifx-ledger-node p {
  margin: 7px 0 0;
  color: var(--ifx-muted);
  font-size: 10.5px;
  line-height: 1.45;
}

#if1-r2-root .ifx-ledger-arrow {
  display: grid;
  place-items: center;
  color: #9aaba6;
  font-size: 22px;
  font-weight: 700;
}

#if1-r2-root .ifx-alert {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  margin-top: 10px;
  padding: 12px 13px;
  border: 1px solid var(--ifx-border);
  border-radius: 11px;
  background: var(--ifx-surface);
  font-size: 11px;
  line-height: 1.55;
}

#if1-r2-root .ifx-alert strong {
  color: var(--ifx-navy);
}

#if1-r2-root .ifx-alert--danger {
  border-color: #ebc6c2;
  background: var(--ifx-red-soft);
}

#if1-r2-root .ifx-alert--warning {
  border-color: #ead6a7;
  background: var(--ifx-amber-soft);
}

#if1-r2-root .ifx-alert-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  border-radius: 8px;
  background: rgba(255,255,255,0.75);
  font-weight: 850;
}

#if1-r2-root .ifx-risk-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

#if1-r2-root .ifx-risk-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--ifx-border);
  border-radius: 12px;
  background: var(--ifx-surface);
}

#if1-r2-root .ifx-risk-card--danger {
  border-color: #e9c3bf;
  background: var(--ifx-red-soft);
}

#if1-r2-root .ifx-risk-card--warning {
  border-color: #ead6a7;
  background: var(--ifx-amber-soft);
}

#if1-r2-root .ifx-risk-label {
  display: block;
  margin-bottom: 7px;
  color: var(--ifx-muted);
  font-size: 10px;
  font-weight: 800;
}

#if1-r2-root .ifx-risk-value {
  display: block;
  color: var(--ifx-navy);
  font-size: 17px;
  font-weight: 840;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

#if1-r2-root .ifx-risk-meta {
  display: block;
  margin-top: 6px;
  color: var(--ifx-muted);
  font-size: 10px;
  line-height: 1.45;
}

#if1-r2-root .ifx-risk-meter {
  height: 4px;
  overflow: hidden;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(80, 103, 97, 0.12);
}

#if1-r2-root .ifx-risk-meter span {
  display: block;
  height: 100%;
  max-width: 100%;
  border-radius: inherit;
  background: var(--ifx-teal);
}

#if1-r2-root .ifx-risk-card--danger .ifx-risk-meter span {
  background: var(--ifx-red);
}

#if1-r2-root .ifx-risk-card--warning .ifx-risk-meter span {
  background: var(--ifx-amber);
}

#if1-r2-root .ifx-confidence-list {
  display: grid;
  gap: 9px;
}

#if1-r2-root .ifx-confidence-row {
  display: grid;
  grid-template-columns: 160px minmax(120px, 1fr) 90px;
  gap: 10px;
  align-items: center;
}

#if1-r2-root .ifx-confidence-label {
  min-width: 0;
  color: var(--ifx-ink);
  font-size: 11px;
  font-weight: 760;
}

#if1-r2-root .ifx-confidence-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f0;
}

#if1-r2-root .ifx-confidence-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ifx-teal);
}

#if1-r2-root .ifx-confidence-row[data-kind="unresolved"]
  .ifx-confidence-track span {
  background: var(--ifx-amber);
}

#if1-r2-root .ifx-confidence-value {
  color: var(--ifx-muted);
  text-align: right;
  font-size: 10.5px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

#if1-r2-root .ifx-value-bridge {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--ifx-border);
  border-radius: 12px;
  background: var(--ifx-border);
}

#if1-r2-root .ifx-value-step {
  padding: 15px;
  background: var(--ifx-surface);
}

#if1-r2-root .ifx-value-step small {
  display: block;
  color: var(--ifx-muted);
  font-size: 10px;
  font-weight: 800;
}

#if1-r2-root .ifx-value-step strong {
  display: block;
  margin-top: 5px;
  color: var(--ifx-navy);
  font-size: 20px;
  font-weight: 840;
  font-variant-numeric: tabular-nums;
}

#if1-r2-root .ifx-value-step span {
  display: block;
  margin-top: 5px;
  color: var(--ifx-muted);
  font-size: 10px;
  line-height: 1.4;
}

#if1-r2-root .ifx-table-card {
  overflow: hidden;
  border: 1px solid var(--ifx-border);
  border-radius: 13px;
  background: var(--ifx-surface);
  box-shadow: var(--ifx-shadow);
}

#if1-r2-root .ifx-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 11px 12px;
  border-bottom: 1px solid var(--ifx-border);
  background: #fbfcfc;
}

#if1-r2-root .ifx-toolbar-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

#if1-r2-root .ifx-field,
#if1-r2-root .ifx-select {
  min-height: 35px;
  border: 1px solid var(--ifx-border-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ifx-ink);
  padding: 7px 9px;
  font-size: 11px;
}

#if1-r2-root .ifx-field {
  width: min(290px, 100%);
}

#if1-r2-root .ifx-field:focus,
#if1-r2-root .ifx-select:focus {
  border-color: var(--ifx-teal);
  outline: none;
  box-shadow: 0 0 0 3px rgba(13,118,109,0.08);
}

#if1-r2-root .ifx-table-wrap {
  width: 100%;
  overflow-x: auto;
}

#if1-r2-root table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
}

#if1-r2-root th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 9px 10px;
  border-bottom: 1px solid var(--ifx-border);
  background: #f6f9f8;
  color: #677875;
  text-align: left;
  font-size: 9.5px;
  font-weight: 850;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  white-space: nowrap;
}

#if1-r2-root td {
  padding: 10px;
  border-bottom: 1px solid #edf2f0;
  color: var(--ifx-ink);
  font-size: 10.5px;
  line-height: 1.4;
  vertical-align: top;
}

#if1-r2-root tbody tr:nth-child(even) {
  background: #fbfcfc;
}

#if1-r2-root tbody tr:hover {
  background: #f3f8f6;
}

#if1-r2-root tbody tr:last-child td {
  border-bottom: 0;
}

#if1-r2-root .ifx-product {
  color: var(--ifx-navy);
  font-weight: 780;
}

#if1-r2-root .ifx-subtext {
  display: block;
  margin-top: 3px;
  color: var(--ifx-muted);
  font-size: 9.5px;
  line-height: 1.35;
}

#if1-r2-root .ifx-money,
#if1-r2-root .ifx-num {
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#if1-r2-root .ifx-negative {
  color: var(--ifx-red);
  font-weight: 800;
}

#if1-r2-root .ifx-positive {
  color: var(--ifx-green);
  font-weight: 800;
}

#if1-r2-root .ifx-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 999px;
  background: #f0f4f3;
  color: #61716d;
  font-size: 9.5px;
  font-weight: 800;
  white-space: nowrap;
}

#if1-r2-root .ifx-badge--good {
  background: var(--ifx-green-soft);
  color: var(--ifx-green);
}

#if1-r2-root .ifx-badge--warning {
  background: var(--ifx-amber-soft);
  color: var(--ifx-amber);
}

#if1-r2-root .ifx-badge--danger {
  background: var(--ifx-red-soft);
  color: var(--ifx-red);
}

#if1-r2-root .ifx-coverage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#if1-r2-root .ifx-coverage-card {
  padding: 13px;
  border: 1px solid var(--ifx-border);
  border-radius: 11px;
  background: var(--ifx-surface);
}

#if1-r2-root .ifx-coverage-card h3 {
  margin: 0 0 7px;
  color: var(--ifx-navy);
  font-size: 12px;
}

#if1-r2-root .ifx-coverage-card p {
  margin: 8px 0 0;
  color: var(--ifx-muted);
  font-size: 10.5px;
  line-height: 1.5;
}

#if1-r2-root .ifx-note {
  margin-top: 12px;
  padding: 11px 13px;
  border: 1px solid #d5e4df;
  border-left: 3px solid var(--ifx-teal);
  border-radius: 8px;
  background: #f4f9f7;
  color: var(--ifx-muted);
  font-size: 10.5px;
  line-height: 1.55;
}

#if1-r2-root .ifx-note strong {
  color: var(--ifx-navy);
}

#if1-r2-root .ifx-empty {
  padding: 28px 16px;
  color: var(--ifx-muted);
  text-align: center;
  font-size: 11px;
}

#if1-r2-root .ifx-loading {
  display: grid;
  place-items: center;
  min-height: 260px;
  border: 1px solid var(--ifx-border);
  border-radius: 13px;
  background: var(--ifx-surface);
  color: var(--ifx-muted);
  text-align: center;
}

#if1-r2-root .ifx-loading strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ifx-navy);
}

#if1-r2-root .ifx-error {
  max-width: 700px;
  margin: 28px auto;
  padding: 17px;
  border: 1px solid #ebc6c2;
  border-radius: 12px;
  background: var(--ifx-red-soft);
}

#if1-r2-root .ifx-error h2 {
  margin: 0 0 7px;
  color: var(--ifx-navy);
  font-size: 16px;
}

#if1-r2-root .ifx-error p {
  margin: 0;
  color: #78534f;
  font-size: 11px;
  line-height: 1.55;
}

#if1-r2-root .ifx-error .ifx-button {
  margin-top: 12px;
}

#if1-r2-root .ifx-count {
  color: var(--ifx-muted);
  font-size: 10.5px;
  font-weight: 700;
}

@media (max-width: 1280px) {
  #if1-r2-root .ifx-risk-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #if1-r2-root .ifx-col-3 {
    grid-column: span 6;
  }

  #if1-r2-root .ifx-col-5,
  #if1-r2-root .ifx-col-7 {
    grid-column: span 6;
  }
}

@media (max-width: 900px) {
  #if1-r2-root .ifx-shell {
    padding: 18px 15px 44px;
  }

  #if1-r2-root .ifx-header {
    align-items: flex-start;
    flex-direction: column;
  }

  #if1-r2-root .ifx-header-actions {
    justify-content: flex-start;
  }

  #if1-r2-root .ifx-col-3,
  #if1-r2-root .ifx-col-4,
  #if1-r2-root .ifx-col-5,
  #if1-r2-root .ifx-col-6,
  #if1-r2-root .ifx-col-7,
  #if1-r2-root .ifx-col-8 {
    grid-column: span 12;
  }

  #if1-r2-root .ifx-ledger-flow {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  #if1-r2-root .ifx-ledger-arrow {
    transform: rotate(90deg);
    height: 24px;
  }

  #if1-r2-root .ifx-value-bridge {
    grid-template-columns: 1fr;
    gap: 1px;
  }

  #if1-r2-root .ifx-confidence-row {
    grid-template-columns: 130px minmax(90px, 1fr) 70px;
  }
}

@media (max-width: 620px) {
  #if1-r2-root .ifx-shell {
    padding: 14px 10px 38px;
  }

  #if1-r2-root .ifx-title {
    font-size: 25px;
  }

  #if1-r2-root .ifx-header-actions {
    width: 100%;
  }

  #if1-r2-root .ifx-header-actions .ifx-button {
    flex: 1 1 auto;
  }

  #if1-r2-root .ifx-risk-grid {
    grid-template-columns: 1fr 1fr;
  }

  #if1-r2-root .ifx-coverage-grid {
    grid-template-columns: 1fr;
  }

  #if1-r2-root .ifx-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  #if1-r2-root .ifx-table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  #if1-r2-root .ifx-toolbar-controls {
    width: 100%;
  }

  #if1-r2-root .ifx-field,
  #if1-r2-root .ifx-select {
    width: 100%;
  }

  #if1-r2-root .ifx-confidence-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  #if1-r2-root .ifx-confidence-value {
    text-align: left;
  }
}

@media (max-width: 430px) {
  #if1-r2-root .ifx-risk-grid {
    grid-template-columns: 1fr;
  }

  #if1-r2-root .ifx-tabs {
    margin-left: -2px;
    margin-right: -2px;
  }

  #if1-r2-root .ifx-kpi {
    padding: 13px;
  }
}

/*
 * ==========================================================
 * AQUILA IF1-B2-R3-R1
 * Financial UI refinement.
 * ==========================================================
 */


/*
 * WHAT DOES NOT RECONCILE
 *
 * Header + ledger flow stay full-width.
 * The two review messages sit side-by-side.
 */
#if1-r2-root .ifx-recon-section {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 12px;
}


#if1-r2-root .ifx-recon-section
  > .ifx-section-head,
#if1-r2-root .ifx-recon-section
  > .ifx-ledger-flow {
  grid-column: 1 / -1;
}


/*
 * Larger, more commercially visible warning cards.
 */
#if1-r2-root .ifx-recon-section
  > .ifx-alert {
  width: 100%;
  min-width: 0;
  min-height: 104px;

  margin-top: 0;

  padding: 17px 18px;

  border-radius: 13px;

  font-size: 14.5px;
  line-height: 1.6;

  box-shadow:
    0 1px 2px rgba(20, 43, 38, 0.025),
    0 8px 24px rgba(20, 43, 38, 0.055);
}


#if1-r2-root .ifx-recon-section
  > .ifx-alert strong {
  color: var(--ifx-navy);

  font-size: 15.5px;
  font-weight: 850;
  line-height: 1.45;
}


#if1-r2-root .ifx-recon-section
  > .ifx-alert
  .ifx-alert-icon {
  width: 34px;
  height: 34px;

  font-size: 15px;
}


/*
 * Financial convention:
 * right-align monetary and numerical values.
 */
#if1-r2-root .ifx-kpi-value,
#if1-r2-root .ifx-risk-value,
#if1-r2-root .ifx-risk-meta,
#if1-r2-root .ifx-ledger-node strong,
#if1-r2-root .ifx-value-step strong,
#if1-r2-root .ifx-value-step span,
#if1-r2-root .ifx-confidence-value,
#if1-r2-root td.ifx-money,
#if1-r2-root td.ifx-num {
  text-align: right !important;
}


/*
 * Tabular figures improve column comparison.
 */
#if1-r2-root .ifx-kpi-value,
#if1-r2-root .ifx-risk-value,
#if1-r2-root .ifx-ledger-node strong,
#if1-r2-root .ifx-value-step strong,
#if1-r2-root .ifx-confidence-value,
#if1-r2-root td.ifx-money,
#if1-r2-root td.ifx-num {
  font-variant-numeric:
    tabular-nums lining-nums;
}


/*
 * Explicitly right-align numeric table headings.
 */
#if1-r2-root th[style*="text-align:right"] {
  text-align: right !important;
}


/*
 * Currency is visually anchored to the right side
 * of the summary/control strip.
 */
#if1-r2-root .ifx-summarybar
  .ifx-r3-currency {
  order: 99;

  margin-left: auto;

  text-align: right;
}


/*
 * Refresh confirmation.
 */
#if1-r2-root .ifx-r3-refresh-status {
  color: var(--ifx-soft-muted);

  font-size: 10.5px;
  font-weight: 700;

  white-space: nowrap;
}


#if1-r2-root .ifx-r3-refresh-status.is-refreshing {
  color: var(--ifx-teal);
}


/*
 * Mobile/tablet:
 * warning cards return to one-column presentation.
 */
@media (max-width: 768px) {

  #if1-r2-root .ifx-recon-section {
    grid-template-columns: 1fr;
  }


  #if1-r2-root .ifx-recon-section
    > .ifx-section-head,
  #if1-r2-root .ifx-recon-section
    > .ifx-ledger-flow {
    grid-column: 1;
  }


  #if1-r2-root .ifx-summarybar
    .ifx-r3-currency {
    margin-left: 0;
  }

}


@media (max-width: 430px) {

  #if1-r2-root .ifx-recon-section
    > .ifx-alert {
    min-height: 0;

    padding: 14px;

    font-size: 13.5px;
  }


  #if1-r2-root .ifx-recon-section
    > .ifx-alert strong {
    font-size: 14px;
  }


  #if1-r2-root .ifx-kpi-value {
    font-size: 24px;
  }

}

/*
 * ==========================================================
 * AQUILA IF1-B2-R3-R3
 * Interactive warning / exception review.
 * ==========================================================
 */


/*
 * User requested removal of ALL submenu ACTIONS rows.
 * CSS enforces it even after an R2 re-render.
 */
#if1-r2-root .ifx-actionbar {
  display: none !important;
}


/*
 * Reviewable warning / exception cards.
 */
#if1-r2-root [data-ifx-reviewable="true"] {
  position: relative;

  cursor: pointer;

  transition:
    transform 130ms ease,
    box-shadow 130ms ease,
    border-color 130ms ease;
}


#if1-r2-root [data-ifx-reviewable="true"]:hover,
#if1-r2-root [data-ifx-reviewable="true"]:focus-visible {
  z-index: 2;

  transform: translateY(-2px);

  border-color: rgba(13, 118, 109, 0.42);

  box-shadow:
    0 2px 5px rgba(20, 43, 38, 0.04),
    0 12px 30px rgba(20, 43, 38, 0.09);

  outline: none;
}


#if1-r2-root .ifx-review-hint {
  display: inline-flex;

  margin-top: 12px;

  color: var(--ifx-teal);

  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.025em;
}


#if1-r2-root .ifx-review-hint::after {
  content: " →";

  margin-left: 3px;
}


/*
 * Priority exception action.
 */
#if1-r2-root .ifx-action-cell {
  width: 130px;

  text-align: right;

  white-space: nowrap;
}


#if1-r2-root .ifx-review-button {
  min-height: 32px;

  padding: 6px 9px;

  font-size: 10px;
}


#if1-r2-root .ifx-exception-row {
  transition:
    background 120ms ease;
}


/*
 * Modal.
 */
body.ifx-modal-open {
  overflow: hidden;
}


.ifx-modal-overlay {
  position: fixed;

  inset: 0;

  z-index: 2147483600;

  display: flex;

  align-items: flex-start;
  justify-content: center;

  overflow-y: auto;

  padding: 46px 18px;

  background:
    rgba(12, 24, 28, 0.56);

  backdrop-filter:
    blur(4px);
}


.ifx-resolution-modal {
  width: min(920px, 100%);

  overflow: hidden;

  border:
    1px solid #d6e1de;

  border-radius:
    16px;

  background:
    #ffffff;

  box-shadow:
    0 24px 70px
    rgba(7, 27, 24, 0.22);

  color:
    #1f2c31;

  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}


.ifx-modal-header {
  display: flex;

  align-items: flex-start;
  justify-content: space-between;

  gap: 18px;

  padding: 20px 22px;

  border-bottom:
    1px solid #dde6e4;

  background:
    #f8fbfa;
}


.ifx-modal-eyebrow {
  margin:
    0 0 5px;

  color:
    #0d766d;

  font-size:
    10px;

  font-weight:
    850;

  letter-spacing:
    0.08em;

  text-transform:
    uppercase;
}


.ifx-modal-header h2 {
  margin: 0;

  color:
    #17233a;

  font-size:
    22px;

  font-weight:
    850;

  letter-spacing:
    -0.025em;
}


.ifx-modal-value {
  display: block;

  margin-top:
    7px;

  color:
    #17233a;

  font-size:
    20px;

  font-variant-numeric:
    tabular-nums;

  text-align:
    right;
}


.ifx-modal-close {
  display: grid;

  place-items: center;

  flex:
    0 0 auto;

  width:
    34px;

  height:
    34px;

  border:
    1px solid #d6e1de;

  border-radius:
    9px;

  background:
    #fff;

  color:
    #64736f;

  cursor:
    pointer;

  font-size:
    23px;

  line-height:
    1;
}


.ifx-modal-close:hover,
.ifx-modal-close:focus-visible {
  border-color:
    #0d766d;

  color:
    #0d766d;

  outline:
    none;
}


.ifx-modal-body {
  padding:
    20px 22px 22px;
}


.ifx-modal-identity {
  display: grid;

  grid-template-columns:
    repeat(5, minmax(0, 1fr));

  gap:
    8px;

  margin-bottom:
    13px;
}


.ifx-modal-identity > div {
  min-width:
    0;

  padding:
    10px;

  border:
    1px solid #dde6e4;

  border-radius:
    9px;

  background:
    #fbfcfc;
}


.ifx-modal-identity span {
  display:
    block;

  margin-bottom:
    4px;

  color:
    #75837f;

  font-size:
    9px;

  font-weight:
    800;

  text-transform:
    uppercase;
}


.ifx-modal-identity strong {
  display:
    block;

  overflow-wrap:
    anywhere;

  color:
    #17233a;

  font-size:
    11px;
}


.ifx-modal-current {
  margin-bottom:
    13px;

  padding:
    12px 13px;

  border:
    1px solid #ead5a3;

  border-radius:
    10px;

  background:
    #fff8e8;
}


.ifx-modal-current > span,
.ifx-modal-analysis-card > span {
  display:
    block;

  margin-bottom:
    5px;

  color:
    #7d6a44;

  font-size:
    9.5px;

  font-weight:
    850;

  letter-spacing:
    0.035em;

  text-transform:
    uppercase;
}


.ifx-modal-current p,
.ifx-modal-analysis-card p,
.ifx-modal-control-note p,
.ifx-ai-status p {
  margin:
    0;

  font-size:
    12px;

  line-height:
    1.6;
}


.ifx-modal-analysis-grid {
  display:
    grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap:
    10px;
}


.ifx-modal-analysis-card {
  padding:
    14px;

  border:
    1px solid #ecd6a5;

  border-radius:
    11px;

  background:
    #fff9eb;
}


.ifx-modal-analysis-card--fix {
  border-color:
    #c6e1d7;

  background:
    #f0f9f5;
}


.ifx-modal-analysis-card--fix > span {
  color:
    #33705b;
}


.ifx-modal-control-note {
  margin-top:
    10px;

  padding:
    12px 13px;

  border:
    1px solid #dce5e3;

  border-radius:
    10px;

  background:
    #f8faf9;
}


.ifx-modal-control-note strong {
  display:
    block;

  margin-bottom:
    4px;

  color:
    #17233a;

  font-size:
    11px;
}


.ifx-ai-status {
  display:
    flex;

  gap:
    11px;

  margin-top:
    10px;

  padding:
    13px;

  border:
    1px solid #d5e0eb;

  border-radius:
    11px;

  background:
    #f5f8fc;
}


.ifx-ai-status-icon {
  display:
    grid;

  place-items:
    center;

  flex:
    0 0 auto;

  width:
    36px;

  height:
    36px;

  border-radius:
    10px;

  background:
    #e7eef8;

  color:
    #3567a8;

  font-size:
    11px;

  font-weight:
    900;
}


.ifx-ai-status strong {
  display:
    block;

  margin-bottom:
    4px;

  color:
    #17233a;

  font-size:
    12px;
}


.ifx-modal-actions {
  display:
    flex;

  justify-content:
    flex-end;

  flex-wrap:
    wrap;

  gap:
    8px;

  margin-top:
    16px;

  padding-top:
    14px;

  border-top:
    1px solid #e3eae8;
}


.ifx-resolution-modal .ifx-button {
  appearance:
    none;

  min-height:
    36px;

  padding:
    7px 12px;

  border:
    1px solid #ccd9d6;

  border-radius:
    9px;

  background:
    #fff;

  color:
    #17233a;

  cursor:
    pointer;

  font-size:
    11px;

  font-weight:
    800;
}


.ifx-resolution-modal
  .ifx-button--primary {
  border-color:
    #0d766d;

  background:
    #0d766d;

  color:
    #fff;
}


.ifx-resolution-modal
  .ifx-button:disabled {
  cursor:
    not-allowed;

  opacity:
    0.48;
}


.ifx-resolution-form {
  margin-top:
    15px;

  padding:
    15px;

  border:
    1px solid #d6e3df;

  border-radius:
    11px;

  background:
    #f8fbfa;
}


.ifx-resolution-form h3 {
  margin:
    0 0 5px;

  color:
    #17233a;

  font-size:
    14px;
}


.ifx-resolution-form > p {
  margin:
    0 0 13px;

  color:
    #687772;

  font-size:
    10.5px;

  line-height:
    1.55;
}


.ifx-modal-field {
  display:
    block;

  margin-top:
    10px;
}


.ifx-modal-field > span {
  display:
    block;

  margin-bottom:
    5px;

  color:
    #5f6f6a;

  font-size:
    10px;

  font-weight:
    800;
}


.ifx-modal-field input,
.ifx-modal-field textarea {
  width:
    100%;

  border:
    1px solid #ccd9d6;

  border-radius:
    8px;

  background:
    #fff;

  color:
    #1f2c31;

  padding:
    9px 10px;

  font:
    inherit;

  font-size:
    11px;
}


.ifx-modal-field textarea {
  resize:
    vertical;
}


.ifx-modal-field input:focus,
.ifx-modal-field textarea:focus {
  border-color:
    #0d766d;

  outline:
    none;

  box-shadow:
    0 0 0 3px
    rgba(13, 118, 109, 0.08);
}


.ifx-modal-form-footer {
  display:
    flex;

  align-items:
    center;

  justify-content:
    space-between;

  gap:
    14px;

  margin-top:
    14px;
}


.ifx-locked-message {
  max-width:
    620px;

  color:
    #7b6a45;

  font-size:
    10px;

  line-height:
    1.5;
}


@media (max-width: 768px) {

  .ifx-modal-overlay {
    padding:
      18px 10px;
  }


  .ifx-modal-analysis-grid {
    grid-template-columns:
      1fr;
  }


  .ifx-modal-identity {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }


  .ifx-modal-header {
    padding:
      17px 16px;
  }


  .ifx-modal-body {
    padding:
      16px;
  }


  .ifx-modal-form-footer {
    align-items:
      flex-start;

    flex-direction:
      column;
  }

}


@media (max-width: 430px) {

  .ifx-modal-identity {
    grid-template-columns:
      1fr;
  }


  .ifx-modal-actions {
    flex-direction:
      column;
  }


  .ifx-modal-actions
    .ifx-button {
    width:
      100%;
  }

}

/* ==========================================================
 * AQUILA IF2-B1-R3
 * Controlled Cost Provenance Resolution
 * ========================================================== */

.ifx-b1-loading {
  display: grid;
  gap: 5px;
  padding: 15px;
  border: 1px solid #d6e3df;
  border-radius: 10px;
  background: #f8fbfa;
}

.ifx-b1-loading strong {
  color: #17233a;
  font-size: 12px;
}

.ifx-b1-loading span {
  color: #687772;
  font-size: 10.5px;
}

.ifx-b1-form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.ifx-b1-form-head h3 {
  margin: 0 0 4px;
  color: #17233a;
  font-size: 15px;
  font-weight: 850;
}

.ifx-b1-form-head p {
  margin: 0;
  color: #687772;
  font-size: 10.5px;
}

.ifx-b1-write-scope {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid #c3e1d5;
  border-radius: 999px;
  background: #eef8f2;
  color: #2b875b;
  font-size: 9.5px;
  font-weight: 850;
}

.ifx-b1-immutable-grid {
  display: grid;
  grid-template-columns:
    repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 11px;
}

.ifx-b1-immutable-grid > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid #dde6e4;
  border-radius: 9px;
  background: #fff;
}

.ifx-b1-immutable-grid span {
  display: block;
  margin-bottom: 4px;
  color: #75837f;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.ifx-b1-immutable-grid strong {
  display: block;
  color: #17233a;
  font-size: 11px;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.ifx-b1-immutable-grid
  > div:nth-child(3)
  strong,
.ifx-b1-immutable-grid
  > div:nth-child(4)
  strong {
  text-align: right;
}

.ifx-b1-safety-banner {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 11px 12px;
  border: 1px solid #c8ded7;
  border-left: 3px solid #0d766d;
  border-radius: 9px;
  background: #f2f9f6;
}

.ifx-b1-safety-banner strong {
  color: #17233a;
  font-size: 11px;
}

.ifx-b1-safety-banner span {
  color: #65756f;
  font-size: 10px;
  line-height: 1.5;
}

.ifx-b1-field {
  display: block;
  margin-top: 11px;
}

.ifx-b1-field > span {
  display: block;
  margin-bottom: 5px;
  color: #53645e;
  font-size: 10px;
  font-weight: 820;
}

.ifx-b1-field select,
.ifx-b1-field input,
.ifx-b1-field textarea {
  width: 100%;
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid #ccd9d6;
  border-radius: 8px;
  background: #fff;
  color: #1f2c31;
  font: inherit;
  font-size: 11px;
}

.ifx-b1-field textarea {
  min-height: 92px;
  resize: vertical;
}

.ifx-b1-field select:focus,
.ifx-b1-field input:focus,
.ifx-b1-field textarea:focus {
  border-color: #0d766d;
  outline: none;
  box-shadow:
    0 0 0 3px
    rgba(13, 118, 109, 0.08);
}

.ifx-b1-field select:disabled {
  background: #f3f6f5;
  color: #87938f;
}

.ifx-b1-field small {
  display: block;
  margin-top: 5px;
  color: #75827e;
  font-size: 9.5px;
  line-height: 1.45;
}

.ifx-b1-result {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 10.5px;
  line-height: 1.5;
}

.ifx-b1-result--working {
  border: 1px solid #d4dfeb;
  background: #f3f7fb;
  color: #4d6481;
}

.ifx-b1-result--success {
  border: 1px solid #bfe0d2;
  background: #eef8f2;
  color: #2b7252;
}

.ifx-b1-result--error {
  border: 1px solid #edc5c1;
  background: #fff1ef;
  color: #914742;
}

.ifx-b1-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid #dde6e4;
}

.ifx-b1-form-footer > span {
  max-width: 620px;
  color: #687772;
  font-size: 9.5px;
  line-height: 1.5;
}

.ifx-b1-form-footer
  [data-if2-b1-submit] {
  flex: 0 0 auto;
  min-width: 132px;
}

@media (max-width: 768px) {

  .ifx-b1-immutable-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .ifx-b1-form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .ifx-b1-form-footer
    [data-if2-b1-submit] {
    width: 100%;
  }
}

@media (max-width: 430px) {

  .ifx-b1-immutable-grid {
    grid-template-columns: 1fr;
  }

  .ifx-b1-form-head {
    flex-direction: column;
  }
}
