/*
 * AVIGRUPO · Visual theme from avigrupo_sistema_de_dise_o_web (1).html.
 * The platform keeps its approved white canvas and existing page structure.
 */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/static/assets/fonts/Inter-latin.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/assets/fonts/JetBrainsMono-latin.woff2") format("woff2");
}
:root,
:root[data-theme="light"] {
  color-scheme: light;
  --navy95: #060c28;
  --navy9: #0b1540;
  --navy8: #11205e;
  --navy7: #1b2d7a;
  --navy6: #2940a0;
  --gold: #f5b71b;
  --gold-h: #ffca3a;
  --gold-d: #b88400;
  --bg: #f4f7fc;
  --surface: #ffffff;
  --elevated: #ffffff;
  --soft: #eef2fa;
  --subtle: #e6ecf8;
  --line: #dce3f2;
  --line2: #c5d0e8;
  --head: #0b1540;
  --text: #26314e;
  --muted: #5e6887;
  --brand: #0b1540;
  --brand-h: #1b2d7a;
  --brand-ink: #ffffff;
  --ib-bg: #0b1540;
  --red: #c8312b;
  --red-d: #981e19;
  --green: #157a4b;
  --green-d: #0d5634;
  --blue: #1b2d7a;
  --t-blue: #ebf0fa;
  --t-blue-b: #c6d3f2;
  --t-gold: #fff8e5;
  --t-gold-b: #f2d479;
  --t-red: #fce8e7;
  --t-red-b: #f3b7b4;
  --t-green: #e3f5ec;
  --t-green-b: #a8dfc4;
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --ring: 0 0 0 3px rgb(245 183 27 / 45%);
  --sh-xs: 0 1px 2px rgb(11 21 64 / 4%);
  --sh-sm: 0 2px 6px -1px rgb(11 21 64 / 6%), 0 1px 3px rgb(11 21 64 / 4%);
  --sh-md: 0 10px 26px -10px rgb(11 21 64 / 14%), 0 2px 6px rgb(11 21 64 / 5%);
  --sh-lg: 0 22px 44px -16px rgb(11 21 64 / 24%), 0 4px 12px rgb(11 21 64 / 8%);
  --in-hi: inset 0 1px 0 rgb(255 255 255 / 70%);
  --font: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, "SFMono-Regular", monospace;
  --pv-ink: #26314e;
  --pv-navy: #0b1540;
  --pv-blue: #1b2d7a;
  --pv-gold: #f5b71b;
  --pv-teal: #157a4b;
  --pv-red: #c8312b;
  --pv-muted: #5e6887;
  --pv-soft: #eef2fa;
  --pv-line: #dce3f2;
  --pv-radius: 14px;
}

html { font-synthesis: none; }
*, *::before, *::after { box-sizing: border-box; }
body,
body.r1-standalone,
body.auth-app {
  color: var(--text) !important;
  background: #fff !important;
  font-family: var(--font) !important;
  font-variant-numeric: tabular-nums;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { color: var(--head); letter-spacing: -.025em; }
button, input, select, textarea { font-family: var(--font) !important; }
code, pre, kbd, samp, .sap-key, .candidate-key, .r4-code { font-family: var(--mono) !important; }
:where(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 0 !important;
  box-shadow: var(--ring) !important;
}

/* Brand navigation: deep navy with the gold active-state used in the guide. */
.sidebar,
.r1-standalone .r1-side,
.r1-main-sidebar {
  color: #c7d0f0 !important;
  background: var(--navy9) !important;
  border-color: rgb(255 255 255 / 10%) !important;
  box-shadow: 0 8px 24px -12px rgb(6 12 40 / 55%) !important;
}
.brand-caption, .menu-name, .nav-caption, .r1-nav-heading { color: #c7d0f0 !important; }
.nav-item, .r1-nav-link, .r1-main-sidebar .nav-item {
  color: #c7d0f0 !important;
  border-radius: 9px !important;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.nav-item:hover, .r1-nav-link:hover { background: rgb(255 255 255 / 9%) !important; color: #fff !important; }
.nav-item.active,
.r1-nav-link.is-current,
.r1-nav-link[aria-current="page"] {
  color: #fff !important;
  background: rgb(245 183 27 / 16%) !important;
  border-color: rgb(245 183 27 / 28%) !important;
  box-shadow: inset 3px 0 var(--gold) !important;
}
.nav-item.active .nav-symbol, .r1-nav-icon { color: var(--gold) !important; }
.av-sidebar-end, .r1-nav-foot { color: #c7d0f0 !important; border-color: rgb(255 255 255 / 12%) !important; }
.av-sidebar-end span, .r1-nav-foot span { color: #9eadd3 !important; }

.av-topbar, .topbar {
  color: #fff !important;
  background: var(--navy9) !important;
  border-color: rgb(245 183 27 / 42%) !important;
  box-shadow: 0 8px 24px -12px rgb(6 12 40 / 55%) !important;
}
.r1-standalone .topbar, .r1-standalone .av-topbar,
body[data-b3-active="true"] .av-topbar {
  color: #fff !important;
  background: var(--navy9) !important;
  border-bottom: 1px solid rgb(245 183 27 / 42%) !important;
  box-shadow: 0 8px 24px -12px rgb(6 12 40 / 55%) !important;
}
.av-topbar :is(a, span, strong, .av-topbar-crumb),
.topbar :is(a, span, strong, .crumb) { color: #e6ebfb; }
.av-topbar .av-topbar-crumb, .av-topbar .av-topbar-divider,
.topbar .r1-trail, .topbar .r1-trail a { color: #c7d0f0 !important; }
.av-topbar .av-topbar-crumb strong, .topbar .r1-trail strong { color: #fff !important; }
.av-topbar .e45-top-action,
.av-topbar .av-compact-button,
.av-topbar .av-account-link,
.av-topbar .av-account-logout,
.topbar button,
.topbar .top-actions button {
  color: #fff !important;
  background: rgb(255 255 255 / 8%) !important;
  border: 1px solid rgb(255 255 255 / 20%) !important;
  border-radius: 9px !important;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 8%);
}
.av-topbar .e45-top-action:hover,
.av-topbar .av-compact-button:hover,
.av-topbar .av-account-link:hover,
.av-topbar .av-account-logout:hover,
.topbar button:hover { background: rgb(245 183 27 / 16%) !important; border-color: rgb(245 183 27 / 55%) !important; }
.av-topbar .av-account-actions { background: rgb(255 255 255 / 8%) !important; border-color: rgb(255 255 255 / 18%) !important; }
.av-topbar .av-account-actions .av-account-name { color: #fff !important; }
.av-topbar .av-account-actions .av-account-link { color: var(--gold) !important; background: transparent !important; border-color: transparent !important; box-shadow: none !important; }
.av-topbar .av-account-actions #app-logout { color: var(--navy9) !important; background: var(--gold) !important; border-color: var(--gold) !important; box-shadow: inset 0 1px 0 rgb(255 255 255 / 45%) !important; }
.av-topbar .av-account-actions #app-logout:hover { background: var(--gold-h) !important; border-color: var(--gold-h) !important; }
.av-topbar kbd { color: #fff; background: rgb(255 255 255 / 12%); border-color: rgb(255 255 255 / 20%); }
.r1-standalone .topbar .r1-trail,
.r1-standalone .topbar .r1-trail a,
.r1-standalone .topbar .r4-top-actions,
.r1-standalone .topbar .r5-user-toolbar { color: #c7d0f0 !important; }
.r1-standalone .topbar .r1-trail strong { color: #fff !important; }
.mobile-toolbar {
  color: #fff !important;
  background: var(--navy9) !important;
  border-color: rgb(245 183 27 / 42%) !important;
}
.mobile-toolbar :is(button, a, span) { color: #fff; }

/* Tabs and segmented navigation. */
.av-hnav, .r5-tabs, .r5-tabbar, .b3-module-tabs, .b3-tabs, .tabs,
.r1-case-filter { border-color: var(--line) !important; background: #fff !important; }
.av-section-tab, .b3-module-tab, .r5-tabs button, .r5-tab, .r1-case-tabs button,
.tabs button, .segmented button {
  color: var(--muted) !important;
  border-radius: 9px 9px 0 0 !important;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}
.av-section-tab:hover, .b3-module-tab:hover, .r5-tabs button:hover, .r5-tab:hover,
.r1-case-tabs button:hover { color: var(--navy7) !important; background: var(--soft) !important; }
.av-section-tab.active, .b3-module-tab.active, .r5-tabs button.active, .r5-tab.active,
.r1-case-tabs button.selected, .tabs button[aria-selected="true"] {
  color: #fff !important;
  background: var(--navy9) !important;
  border-color: var(--navy9) !important;
  box-shadow: inset 0 -3px var(--gold) !important;
}
.av-section-tab.active .av-section-icon, .b3-module-tab.active .av-section-icon { color: var(--gold) !important; }

/* Surfaces, KPI cards, and alert panels. */
.chart-card, .table-card, .metric, .stat-panel, .intro-card, .balance-strip,
.b3-surface, .b3-kri-surface, .b3-kri-stat, .b3-live-page .b3-metric,
.e23-surface, .e23-data-panel, .r4-surface, .r5-surface, .b5-surface,
.r4-card, .r5-card, .b5-card, .panel, .source-panel, .checks-panel,
.cut-card, .source-card, .doc-card, .b1-rel, .b1-card {
  color: var(--text);
  background: #fff !important;
  border-color: var(--line) !important;
  border-radius: var(--r) !important;
  box-shadow: var(--sh-sm) !important;
}
.metrics .metric, .e23-metric, .b3-kri-stat, .b3-live-page .b3-metric,
.r5-view .r5-metrics article {
  border-radius: var(--r) !important;
  box-shadow: var(--sh-sm) !important;
}
.metric-negative, .b3-kri-stat--negative { border-top-color: var(--red) !important; }
.metric-positive, .b3-kri-stat--positive { border-top-color: var(--green) !important; }
.metric-net, .b3-kri-stat--follow { border-top-color: var(--gold-d) !important; }
.metric-neutral, .b3-kri-stat--universe { border-top-color: var(--navy7) !important; }
.metric-top, .b3-kri-stat > span, .b3-live-page .b3-metric-label { color: var(--text) !important; }
.metric-value, .b3-kri-stat > strong, .b3-live-page .b3-metric strong,
.e23-metric strong, .r5-view .r5-metrics article strong { color: var(--head) !important; }
.metric-icon-negative { color: var(--red) !important; background: var(--t-red) !important; border-color: var(--t-red-b) !important; }
.metric-icon-positive { color: var(--green) !important; background: var(--t-green) !important; border-color: var(--t-green-b) !important; }
.metric-icon-net { color: var(--gold-d) !important; background: var(--t-gold) !important; border-color: var(--t-gold-b) !important; }
.metric-icon-neutral { color: var(--blue) !important; background: var(--t-blue) !important; border-color: var(--t-blue-b) !important; }
.b3-kri-blocked, .notice, .alert-panel, .b1-alert {
  border-color: var(--t-gold-b) !important;
  background: var(--t-gold) !important;
}
.b3-kri-blocked > span, .b3-kri-blocked h2, .b3-kri-blocked p { color: var(--text) !important; }
.b3-kri-state--blocked { color: #765600 !important; background: var(--t-gold) !important; border-color: var(--t-gold-b) !important; }
.b3-kri-state--observed { color: var(--navy7) !important; background: var(--t-blue) !important; border-color: var(--t-blue-b) !important; }
.status-success, .badge-success, .check-status.ok { color: var(--green) !important; background: var(--t-green) !important; border-color: var(--t-green-b) !important; }
.status-error, .badge-error { color: var(--red) !important; background: var(--t-red) !important; border-color: var(--t-red-b) !important; }
.status-warning, .badge-warning, .check-status { color: #765600 !important; background: var(--t-gold) !important; border-color: var(--t-gold-b) !important; }
.status-neutral, .badge-neutral { color: var(--blue) !important; background: var(--t-blue) !important; border-color: var(--t-blue-b) !important; }

/* Buttons and form controls share the guide's radius, focus ring, and navy/gold actions. */
button, .button, .btn, .filterbar button, .toolbar button, .r4-main button,
.r5-view button, .b5-workspace button { border-radius: 10px; }
.primary, .btn-primary, .filter-apply, .filter-apply-button, #apply,
.main button.primary, .filterbar button.primary, .auth-submit,
.b3-kri-search button, .b3-kri-bottom button, .r4-main button.primary,
.r5-view button.primary, .b5-workspace button.primary, .b1-action-primary {
  color: #fff !important;
  background: var(--navy9) !important;
  border-color: var(--navy9) !important;
  box-shadow: 0 8px 18px -8px rgb(11 21 64 / 50%), inset 0 1px 0 rgb(255 255 255 / 12%) !important;
}
.primary:hover, .btn-primary:hover, .filter-apply:hover, #apply:hover,
.main button.primary:hover, .filterbar button.primary:hover, .auth-submit:hover,
.b3-kri-search button:hover, .b3-kri-bottom button:hover {
  background: var(--navy7) !important;
  border-color: var(--navy7) !important;
  transform: translateY(-1px);
}
.btn-secondary, .filter-clear, .filterbar button:not(.primary), .toolbar button:not(.primary),
.r4-main button:not(.primary), .r5-view button:not(.primary), .b5-workspace button:not(.primary) {
  color: var(--head) !important;
  background: #fff !important;
  border-color: var(--line2) !important;
}
.btn-secondary:hover, .filter-clear:hover, .filterbar button:not(.primary):hover,
.toolbar button:not(.primary):hover { background: var(--soft) !important; border-color: var(--blue) !important; }
input, select, textarea, .in, .b3-kri-search input, .r4-main input,
.r4-main select, .r5-view input, .r5-view select, .b5-workspace input,
.b5-workspace select, .table-tools input, .table-tools select {
  color: var(--text) !important;
  background-color: #fff !important;
  border-color: var(--line2) !important;
  border-radius: 10px !important;
}
input::placeholder, textarea::placeholder { color: var(--muted) !important; opacity: .78; }
input:hover, select:hover, textarea:hover { border-color: var(--blue) !important; }
input:focus, select:focus, textarea:focus { border-color: var(--gold-d) !important; box-shadow: var(--ring) !important; }

/* Data tables: soft blue header, fine dividers, readable SAP identifiers. */
.table-scroll, .b3-table-wrap, .b1-table-scroll, .r4-table-wrap,
.r5-table-wrap, .b5-table-wrap, .e23-table-scroll, .table-scroller {
  border-color: var(--line) !important;
  border-radius: 10px !important;
  background: #fff !important;
}
.table-scroll :is(th, thead th), .b3-table thead th, .b1-table-scroll th,
.r4-table th, .r5-table th, .b5-table th, .e23-table th, .table-scroller th,
.table th {
  color: var(--navy7) !important;
  background: var(--t-blue) !important;
  border-color: var(--line) !important;
  font-weight: 700 !important;
  letter-spacing: .06em;
}
.table-scroll td, .b3-table td, .b1-table-scroll td, .r4-table td,
.r5-table td, .b5-table td, .e23-table td, .table-scroller td, .table td {
  color: var(--text) !important;
  border-color: var(--line) !important;
}
.table-scroll tbody tr:hover, .b3-table tbody tr:hover, .r4-table tbody tr:hover,
.r5-table tbody tr:hover, .b5-table tbody tr:hover, .e23-table tbody tr:hover { background: var(--soft) !important; }
td.m, .b3-table code, .r4-table code, .r5-table code, .b5-table code,
.b3-candidate-key, .sap-key { color: var(--navy7) !important; font-family: var(--mono) !important; }

/* Charts and progress use the institutional blue/gold palette. */
.chart-grid, .gridline { stroke: var(--line) !important; }
.axis-text, .chart-axis, .e23-svg-label { fill: var(--muted) !important; }
.hbar-track, .b3-kri-track, .b3-live-rail, .trk, .pr { background: var(--subtle) !important; }
.hbar-fill, .b3-kri-track i, .b3-live-rail i, .pr i { background: linear-gradient(90deg, var(--navy7), var(--gold)) !important; }
.e23-svg-bar { fill: var(--navy7) !important; }
.e23-svg-bar:last-child { fill: var(--gold) !important; }
.v8-rank-bar i { background: linear-gradient(90deg, var(--navy7), var(--gold)) !important; }

/* Standalone investigation, cases, governance, integrations, and sign-in. */
.r4-main, .r5-view, .b5-workspace, .b0-main, .b1-main, .b2-main,
.workspace, .app-main, .main, #main-content { color: var(--text); background: #fff !important; }
.r4-main :is(h1,h2,h3), .r5-view :is(h1,h2,h3), .b5-workspace :is(h1,h2,h3),
.b0-main :is(h1,h2,h3), .b1-main :is(h1,h2,h3), .b2-main :is(h1,h2,h3) { color: var(--head) !important; }
.auth-app { color: var(--text) !important; background: #fff !important; }
.auth-card { border-color: var(--line) !important; border-radius: var(--r-lg) !important; box-shadow: var(--sh-lg) !important; }
.auth-card-heading h1, .auth-card-heading h2 { color: var(--head) !important; }
.source-card, .cut-card { background: var(--soft) !important; }
footer, .footer, .footer-status { color: var(--muted) !important; border-color: var(--line) !important; }

@media (max-width: 900px) {
  .sidebar, .r1-standalone .r1-side { background: var(--navy9) !important; }
  .av-topbar, .topbar { box-shadow: 0 4px 14px rgb(6 12 40 / 24%) !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Keep the dark chrome legible against older module-specific toolbar rules. */
body[data-b3-active="true"] .av-topbar .av-topbar-crumb,
body[data-b3-active="true"] .av-topbar .av-topbar-crumb strong,
body[data-b3-active="true"] .av-topbar .av-topbar-crumb span {
  color: #e6ebfb !important;
}
body[data-b3-active="true"] .av-topbar .e45-top-action,
body[data-b3-active="true"] .av-topbar .av-compact-button {
  color: #fff !important;
  background: rgb(255 255 255 / 8%) !important;
  border-color: rgb(255 255 255 / 20%) !important;
}
body[data-b3-active="true"] .av-topbar .av-account-actions {
  color: #fff !important;
  background: rgb(255 255 255 / 8%) !important;
  border-color: rgb(255 255 255 / 20%) !important;
}
body[data-b3-active="true"] .av-topbar .av-account-actions .av-account-name { color: #fff !important; }
body[data-b3-active="true"] .av-topbar .av-account-actions .av-account-link {
  color: var(--gold) !important;
  background: transparent !important;
  border-color: transparent !important;
}
.r1-standalone .topbar .r5-user-toolbar { background: transparent !important; border-color: transparent !important; }
.r1-standalone .topbar button:not(.primary) {
  color: #fff !important;
  background: rgb(255 255 255 / 8%) !important;
  border-color: rgb(255 255 255 / 20%) !important;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 8%) !important;
}
.r1-standalone .topbar button:not(.primary):hover {
  background: rgb(245 183 27 / 16%) !important;
  border-color: rgb(245 183 27 / 55%) !important;
}
.topbar .private-tag, .topbar .identity .pill, .topbar .pill {
  color: var(--gold) !important;
  background: rgb(255 255 255 / 8%) !important;
  border-color: rgb(255 255 255 / 20%) !important;
}

/* Full application shell: match the reference's 220 px rail and gold-tinted selection. */
@media (min-width: 901px) {
  body[data-av6-module] #sidebar {
    width: 220px !important;
    flex: 0 0 220px !important;
  }
  body[data-r1-page="/integraciones"] .shell,
  body[data-r1-page="/diccionario"] .shell,
  body[data-r1-page="/api-gateway"] .shell,
  body[data-r1-page="/gobierno"] .shell {
    grid-template-columns: 220px minmax(0, 1fr) !important;
  }
  body[data-r1-page="/investigacion"] .r4-shell {
    grid-template-columns: 220px minmax(0, 1fr) !important;
  }
  body[data-r1-page="/expedientes"] .workspace {
    grid-template-columns: 220px minmax(0, 1fr) !important;
  }
}

body[data-av6-module] #sidebar,
body[data-r1-page="/integraciones"] .sidebar,
body[data-r1-page="/diccionario"] .sidebar,
body[data-r1-page="/api-gateway"] .sidebar,
body[data-r1-page="/gobierno"] .sidebar,
body[data-r1-page="/investigacion"] .r4-shell > .sidebar,
body[data-r1-page="/expedientes"] .rail {
  color: #c7d0f0 !important;
  background: var(--navy9) !important;
  border-right: 1px solid rgb(255 255 255 / 10%) !important;
  box-shadow: none !important;
}

body[data-av6-module] #nav .nav-item.active,
body[data-av6-module] #nav .nav-item.selected {
  color: #fff !important;
  background: rgb(245 183 27 / 16%) !important;
  border: 1px solid rgb(245 183 27 / 28%) !important;
  box-shadow: inset 3px 0 var(--gold) !important;
  padding-left: 12px !important;
}
body[data-av6-module] #nav .nav-symbol {
  width: 22px !important;
  height: 22px !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #c7d0f0 !important;
}
body[data-av6-module] #nav .nav-item.active .nav-symbol,
body[data-av6-module] #nav .nav-item.selected .nav-symbol {
  color: var(--gold) !important;
  background: transparent !important;
}
body[data-av6-module] #nav .nav-item:hover:not(.active):not(.selected) {
  color: #fff !important;
  background: rgb(255 255 255 / 9%) !important;
}
.r1-nav-link .r1-nav-icon,
.r1-main-sidebar .nav-symbol {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  flex: 0 0 22px !important;
  color: #c7d0f0 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-size: 18px !important;
}
.r1-nav-link.is-current .r1-nav-icon,
.r1-nav-link[aria-current="page"] .r1-nav-icon {
  color: var(--gold) !important;
  background: transparent !important;
  border-color: transparent !important;
}
body[data-r1-page="/expedientes"] .rail nav button.selected {
  color: #fff !important;
  background: rgb(245 183 27 / 16%) !important;
  border-color: rgb(245 183 27 / 28%) !important;
  box-shadow: inset 3px 0 var(--gold) !important;
}
body[data-r1-page="/expedientes"] .rail nav button.selected span {
  color: var(--gold) !important;
}

/* Metric captions and technical identifiers follow the specimen's typography scale. */
body[data-av6-module] .metric-top,
.b3-kri-stat > span,
.b3-live-page .b3-metric-label,
.r4-kpis small {
  font-size: 10px !important;
  font-weight: 750 !important;
  letter-spacing: .06em !important;
  text-transform: uppercase !important;
}

/* Application components taken from the attached web design guide. */
.sidebar :is(.nav-item, .r1-nav-link),
.r1-main-sidebar :is(.nav-item, .r1-nav-link),
.rail nav button {
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
}
.sidebar :is(.nav-caption, .menu-name, .r1-nav-heading),
.rail :is(.nav-caption, .menu-name) {
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: .14em !important;
  text-transform: uppercase !important;
}
.sidebar :is(.nav-item, .r1-nav-link):hover,
.rail nav button:hover {
  background: rgb(255 255 255 / 9%) !important;
  color: #fff !important;
}
.sidebar :is(.nav-item.active, .nav-item.selected, .r1-nav-link.is-current, .r1-nav-link[aria-current="page"]),
.rail nav button.selected {
  background: rgb(245 183 27 / 16%) !important;
  color: #fff !important;
  box-shadow: inset 3px 0 var(--gold) !important;
}

/* The guide's cards use one edge, radius and restrained elevation. */
:is(.metric, .b1-kpi, .b2-statgrid article, .b3-kri-stat, .b3-metric,
    .b4-metric, .e23-metric, .r5-metrics article, .b2-metric,
    .chart-card, .table-card, .b1-panel, .b2-panel, .r4-surface,
    .r5-card, .r5-surface, .b5-surface, .b5-card, .panel,
    .source-panel, .checks-panel) {
  border: 1px solid var(--line) !important;
  border-radius: var(--r) !important;
  box-shadow: var(--sh-sm), var(--in-hi) !important;
}
:is(.metric, .b1-kpi, .b2-statgrid article, .b3-kri-stat, .b3-metric,
    .b4-metric, .e23-metric, .r5-metrics article) {
  min-width: 0;
}
:is(.metric, .b1-kpi, .b2-statgrid article, .b3-kri-stat,
    .b4-metric, .e23-metric, .r5-metrics article) :is(.metric-top, .b3-kri-stat-label),
.metric > span:first-child,
.b1-kpi > small:first-child,
.b2-statgrid article > small:first-child,
.b2-metric > small:first-child,
.e23-metric > small:first-child,
.r5-metrics article > small:first-child {
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: .06em !important;
  text-transform: uppercase !important;
}
:is(.metric, .b1-kpi, .b2-statgrid article, .b3-kri-stat,
    .b4-metric, .e23-metric, .r5-metrics article) :is(strong, .metric-value) {
  font-variant-numeric: tabular-nums;
  letter-spacing: -.025em !important;
}
:is(.b1-panel, .b2-panel, .r4-surface, .r5-card, .b5-card, .panel) :is(h2, h3),
.chart-card :is(h2, h3), .table-card :is(h2, h3) {
  color: var(--head) !important;
  font-weight: 750 !important;
  letter-spacing: -.02em !important;
  line-height: 1.25 !important;
}
:is(.b1-panel, .b2-panel, .r4-surface, .r5-card, .b5-card, .panel) :is(p, small) {
  line-height: 1.55;
}

/* Status chips and evidence tables follow the specimen's semantic colors. */
:is(.pill, .private-tag, .b2-tag, .module-status, .check-status,
    .b3-kri-state, .r5-state, .b5-status, .status-success,
    .status-error, .status-warning, .status-neutral) {
  border-radius: 999px !important;
  font-weight: 700 !important;
  letter-spacing: .03em;
}
:is(.pill.good, .module-status.live, .check-status.ok, .status-success) {
  background: var(--t-green) !important;
  border-color: var(--t-green-b) !important;
  color: var(--green) !important;
}
:is(.pill.warn, .module-status:not(.live), .status-warning) {
  background: var(--t-gold) !important;
  border-color: var(--t-gold-b) !important;
  color: #946a00 !important;
}
:is(.status-error, .badge-error) {
  background: var(--t-red) !important;
  border-color: var(--t-red-b) !important;
  color: var(--red) !important;
}
:is(.table-scroll, .table-scroller, .b1-table-scroll, .b2-table-wrap,
    .b3-table-wrap, .r4-table-wrap, .r5-table-wrap, .b5-table-wrap) table {
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
:is(.table-scroll, .table-scroller, .b1-table-scroll, .b2-table-wrap,
    .b3-table-wrap, .r4-table-wrap, .r5-table-wrap, .b5-table-wrap) th {
  background: var(--t-blue) !important;
  color: var(--navy7) !important;
  border-bottom: 1px solid var(--line) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: .08em !important;
  text-transform: uppercase;
}
:is(.table-scroll, .table-scroller, .b1-table-scroll, .b2-table-wrap,
    .b3-table-wrap, .r4-table-wrap, .r5-table-wrap, .b5-table-wrap) td {
  border-bottom: 1px solid var(--line) !important;
  font-size: 12px;
}

/* Sign-in uses the same padded card and single focused field treatment. */
.auth-app .auth-card {
  width: min(100%, 460px);
  max-width: 460px;
  padding: 28px 30px 24px;
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--r-lg) !important;
  box-shadow: var(--sh-lg) !important;
}
.auth-app .auth-card-heading > p { margin-bottom: 26px; }
.auth-app .auth-card label {
  color: var(--head) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}
.auth-app .auth-field {
  border: 1px solid var(--line2) !important;
  border-radius: 10px !important;
  box-shadow: var(--sh-xs) !important;
}
.auth-app .auth-field:focus-within {
  border-color: var(--gold-d) !important;
  box-shadow: var(--ring) !important;
}
.auth-app .auth-field input {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: 0 !important;
}
.auth-app .auth-field-icon { flex: 0 0 auto; }
.auth-app .auth-field-icon svg { width: 18px; height: 18px; display: block; }
.auth-app .auth-submit { min-height: 48px; }
@media (max-width: 480px) {
  .auth-app .auth-card { width: 100%; padding: 24px 21px 20px; }
}

/* Finishing states from the supplied component catalogue. */
::selection { color: var(--navy9); background: var(--gold); }
button, .button, .btn, input, select, textarea {
  transition: background-color .15s ease, border-color .15s ease,
    box-shadow .15s ease, color .15s ease, transform .15s ease;
}
:is(button, .button, .btn):disabled {
  cursor: not-allowed;
  opacity: .48;
  transform: none !important;
  box-shadow: none !important;
}
:is(.metric, .b1-kpi, .b2-statgrid article, .b3-kri-stat, .b3-metric,
    .b4-metric, .e23-metric, .r5-metrics article, .chart-card,
    .table-card, .b1-panel, .b2-panel, .r4-surface, .r5-card,
    .r5-surface, .b5-surface, .b5-card, .panel, .source-panel,
    .checks-panel, .filterbar) {
  background: var(--surface) !important;
}
/* Preserve the guide's navy emphasis cards and readable gold figures. */
.b1-kpi.accent,
.b2-statgrid article.highlight {
  color: #d3dcf5 !important;
  background: linear-gradient(135deg, var(--navy9), var(--navy8)) !important;
  border-color: var(--navy7) !important;
  box-shadow: var(--sh-md) !important;
}
.b1-kpi.accent strong,
.b2-statgrid article.highlight strong { color: var(--gold) !important; }
.b1-kpi.accent :is(small, span),
.b2-statgrid article.highlight :is(small, p) { color: #c7d0f0 !important; }
:is(.filterbar, .b1-filters, .b2-filters, .b3-kri-search,
    .r4-filters, .r5-filters, .b5-filters) {
  border-color: var(--line) !important;
  border-radius: var(--r) !important;
  box-shadow: var(--sh-sm) !important;
}
:is(.metric-icon, .b1-kpi-icon, .b2-stat-icon, .b3-kri-icon,
    .r4-kpi-icon, .r5-metric-icon) {
  border-radius: 11px !important;
}
:is(.table-scroll, .table-scroller, .b1-table-scroll, .b2-table-wrap,
    .b3-table-wrap, .r4-table-wrap, .r5-table-wrap, .b5-table-wrap) th {
  font-size: 11px !important;
  letter-spacing: .1em !important;
}
:is(.table-scroll, .table-scroller, .b1-table-scroll, .b2-table-wrap,
    .b3-table-wrap, .r4-table-wrap, .r5-table-wrap, .b5-table-wrap) tbody tr:hover td {
  background: var(--soft) !important;
}
.auth-app .auth-eyebrow { color: var(--gold-d) !important; }
.auth-app .auth-submit span { color: var(--gold) !important; }
.auth-app .auth-panel-footer { color: var(--muted) !important; }

/* One visual hierarchy for descriptive KRI 06–19. */
.b3-kri-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.b3-kri-context {
  display: grid;
  gap: 5px;
  padding: 15px 18px;
  color: var(--text);
  background: var(--soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold-d);
  border-radius: var(--r-sm);
}
.b3-kri-context-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.b3-kri-context-head .b3-kri-state { white-space: normal; }
.b3-kri-context > span {
  color: var(--gold-d);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
}
.b3-kri-context p { margin: 0; font-size: 13px; line-height: 1.5; }
.b3-kri-quality .b3-live-bars { margin: 0; }
.b3-kri-quality .b3-live-bar {
  grid-template-columns: minmax(180px, .9fr) minmax(100px, 1.7fr) minmax(104px, auto);
}
.b3-kri-quality .b3-live-bar strong {
  display: grid;
  justify-items: end;
  gap: 1px;
  color: var(--head) !important;
}
.b3-kri-quality .b3-live-bar strong small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}
.b3-kri-breakdown-value {
  color: var(--head) !important;
  font-family: var(--mono);
  font-size: 13px !important;
  font-weight: 700;
  white-space: nowrap;
}
.b3-kri-quality .b3-source-controls {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(130px, 1fr)) auto auto;
  align-items: end;
  gap: 9px;
  margin: 0 0 18px;
}
.b3-kri-quality .b3-source-controls label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
}
.b3-kri-quality .b3-source-controls :is(input, select) {
  width: 100%;
  max-width: none;
  min-height: 39px;
  margin: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line2);
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 12px;
  letter-spacing: 0;
}
.b3-kri-quality .b3-source-controls button { min-height: 39px; }
@media (max-width: 1100px) {
  .b3-kri-quality .b3-source-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .b3-kri-quality .b3-live-bar { grid-template-columns: 1fr auto; }
  .b3-kri-quality .b3-live-rail { grid-column: 1 / -1; grid-row: 2; }
  .b3-kri-quality .b3-source-controls { grid-template-columns: minmax(0, 1fr); }
}
