/* AVIGRUPO · sistema visual de alto contraste y lectura operativa. */
:root {
  --pv-ink: #18324d;
  --pv-navy: #173a5d;
  --pv-blue: #3f6e9b;
  --pv-gold: #b6842e;
  --pv-teal: #177568;
  --pv-red: #a84e48;
  --pv-muted: #526b83;
  --pv-soft: #f5f8fb;
  --pv-line: #dbe4ed;
  --pv-radius: 13px;
}

html { font-synthesis: none; }
body,
body.r1-standalone,
.auth-app {
  font-family: "Segoe UI Variable", "Segoe UI", Arial, sans-serif !important;
  color: var(--pv-ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:where(button, a, input, select, textarea, summary):focus-visible {
  outline: 3px solid #bd8c32 !important;
  outline-offset: 3px !important;
}

/* Shell and navigation */
.av-topbar { min-height: 68px; border-bottom-color: var(--pv-line); }
.av-topbar-crumb, .r1-trail { color: var(--pv-muted); font-size: 12px; }
.sidebar { background: linear-gradient(180deg,#172f4c 0%,#10233b 100%) !important; }
.brand-art { filter: drop-shadow(0 3px 6px #07172b24); }
.menu-name, .r1-main-sidebar .menu-name, .r1-nav-heading {
  color: #a8bdd2 !important;
  font-size: 10px !important;
  font-weight: 800;
  letter-spacing: .12em !important;
}
.nav-item, .r1-nav-link { min-height: 48px; font-size: 13px !important; }
.nav-item.active, .r1-nav-link.is-current, .r1-nav-link[aria-current="page"] {
  background: #254767 !important;
  border-color: #456382 !important;
  box-shadow: inset 3px 0 #d9b25d !important;
}
.nav-symbol svg, .r1-nav-icon svg { width: 19px; height: 19px; stroke-width: 1.8; }
.av-hnav { border-bottom-color: var(--pv-line); background: #fff; }
.av-section-tab {
  min-height: 51px !important;
  padding: 11px 16px !important;
  border-radius: 10px 10px 0 0 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #405a73 !important;
}
.av-section-tab .av-section-icon { color: #547da2 !important; }
.av-section-tab.active {
  color: #fff !important;
  background: var(--pv-navy) !important;
  box-shadow: inset 0 -3px #d8b45d !important;
}
.av-section-tab.active .av-section-icon { color: #e4c77f !important; }
.av-hnav-track { scrollbar-width: thin; scrollbar-color: #acbdcd transparent; }
.av-hnav-arrow { border-color: #ced9e4 !important; color: #385b7c !important; }

/* Inventory context, filter controls, and approved indicators */
.main { max-width: 1720px; min-width: 0; padding-top: 25px; }
body[data-av6-module] #content { display: grid; grid-template-columns: minmax(0, 1fr); gap: 19px; min-width: 0; }
body[data-av6-module] #content > * { min-width: 0; }
.filterbar {
  border: 1px solid var(--pv-line) !important;
  border-radius: var(--pv-radius) !important;
  box-shadow: 0 5px 18px #17324d0a !important;
  padding: 19px 20px !important;
}
.filterbar label, .toolbar label { color: #405c76 !important; font-size: 12px !important; font-weight: 700 !important; }
.filterbar input, .filterbar select, .toolbar input, .toolbar select,
.main input, .main select, .main textarea {
  min-height: 43px;
  border-color: #cbd8e4;
  border-radius: 8px;
  color: #1e3e5d;
  font-size: 13px !important;
}
.filterbar button, .toolbar button, .main button.primary, .main button.outline {
  min-height: 43px;
  border-radius: 8px;
  font-weight: 750;
}
.filterbar .primary, .main button.primary { background: #1d456b; border-color: #1d456b; }
#active-chips button { border-radius: 999px; background: #eef4f8; color: #365b78; }

.metrics { gap: 15px; margin-bottom: 0; }
.metrics .metric {
  position: relative;
  min-height: 154px;
  padding: 19px 19px 17px;
  overflow: hidden;
  border: 1px solid var(--pv-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 17px #17324d09;
  gap: 8px;
}
.metrics .metric::after { opacity: .16; }
.metric-head { margin-bottom: 2px !important; }
.metric-top { color: #3c5872 !important; font-size: 13px !important; font-weight: 720 !important; letter-spacing: 0 !important; text-transform: none !important; }
.metric-icon { width: 36px !important; height: 36px !important; border: 1px solid #e1e8ef; border-radius: 10px !important; font-size: 0 !important; }
.metric-icon svg { width: 19px; height: 19px; }
.metric-icon-neutral { background: #eef4f8 !important; color: #456b8d !important; }
.metric-icon-positive { background: #e8f5f1 !important; color: #237868 !important; }
.metric-icon-negative { background: #fff0ee !important; color: #a84e48 !important; }
.metric-icon-net { background: #fff7e5 !important; color: #9a7126 !important; }
.metric-value { color: #183957 !important; font-size: clamp(25px,2vw,32px) !important; font-weight: 790 !important; line-height: 1.13 !important; letter-spacing: -.035em !important; font-variant-numeric: tabular-nums; }
.metric-note { color: #5a7187 !important; font-size: 12px !important; line-height: 1.45 !important; }
.metric-positive { border-top: 2px solid #2b8979 !important; }
.metric-negative { border-top: 2px solid #b75f55 !important; }
.metric-net { border-top: 2px solid #bf963b !important; }
.metric-neutral { border-top: 2px solid #6085a7 !important; }

.cards { gap: 17px; }
.chart-card, .table-card, .explain, .method-card, .intro-card, .balance-strip {
  border: 1px solid var(--pv-line) !important;
  border-radius: var(--pv-radius) !important;
  background: #fff;
  box-shadow: 0 6px 22px #17324d0a !important;
}
.chart-card, .table-card { padding: 22px 23px !important; }
.card-heading, .table-head { gap: 16px; margin-bottom: 17px; }
.card-heading h2, .table-title { color: #183a58 !important; font-size: 18px !important; font-weight: 760 !important; line-height: 1.3 !important; letter-spacing: -.02em; }
.card-heading p, .table-head span { color: #5a7187 !important; font-size: 13px !important; line-height: 1.5 !important; }
.card-pill { border-radius: 999px; background: #f2f6f9; color: #44627e; font-size: 10px; font-weight: 800; letter-spacing: .06em; }
.chart-content { min-height: 215px; }
.hbar-row { grid-template-columns: minmax(135px, .78fr) minmax(80px, 1.8fr) 92px !important; gap: 13px !important; padding: 7px 0 !important; }
.hbar-label { color: #385671 !important; font-size: 13px !important; font-weight: 650 !important; }
.hbar-track { height: 10px !important; background: #edf2f6 !important; }
.hbar-fill { background: linear-gradient(90deg,#355f87,#638bb2) !important; }
.hbar-value { color: #1d3f5d !important; font-size: 13px !important; font-weight: 750; font-variant-numeric: tabular-nums; }
.chart-card svg text, .table-card svg text { font-family: inherit; }
.table-scroll { border-color: #dfe7ee !important; border-radius: 9px; }
.table-scroll table { width: 100%; }
.table-scroll thead th, .table-scroll th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 13px !important;
  background: #eff4f8 !important;
  color: #405c75 !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: .04em;
}
.table-scroll td { padding: 12px 13px !important; color: #334f69 !important; font-size: 13px !important; line-height: 1.45; }
.table-scroll tbody tr:nth-child(even) { background: #fafcfd; }
.table-scroll tbody tr:hover { background: #f1f6fa; }
.table-scroll .num { font-variant-numeric: tabular-nums; }
.explain { padding: 20px 22px !important; }
.explain h2, .explain strong { color: #274966; }
.explain p, .explain li { color: #526b83; font-size: 13px; line-height: 1.62; }

/* Live dashboards: clear status, actual measurement semantics, distinct KRI icons. */
body[data-b3-active="true"] #b3-portal { max-width: 1660px !important; padding: 0 4px 42px !important; }
.b3-module-tab { min-height: 52px !important; gap: 9px !important; border-radius: 10px 10px 0 0 !important; font-size: 13px !important; }
.b3-module-tab .av-section-icon svg { width: 18px; height: 18px; }
.b3-kri-quality { gap: 18px; }
.b3-kri-head { align-items: end !important; padding: 5px 1px 1px; gap: 18px; }
.b3-kri-overline { color: #8c692e !important; font-size: 11px !important; letter-spacing: .1em !important; }
.b3-kri-head h1 { margin: 8px 0 0 !important; color: #163752 !important; font-size: clamp(28px,2.6vw,36px) !important; font-weight: 780 !important; line-height: 1.14 !important; letter-spacing: -.035em !important; }
.b3-kri-state { border-radius: 999px !important; padding: 9px 13px !important; font-size: 11px !important; font-weight: 800 !important; letter-spacing: .015em; }
.b3-kri-meta { min-height: 44px; padding: 10px 15px !important; border-color: var(--pv-line) !important; border-radius: 9px !important; background: #f7f9fb !important; color: #546b81 !important; font-size: 12px !important; }
.b3-kri-meta strong { color: #1e4565 !important; font-weight: 750; }
.b3-kri-meta a { color: #235a83 !important; font-weight: 750; }
.b3-kri-stats { gap: 13px !important; }
.b3-kri-stat {
  position: relative;
  min-height: 150px;
  padding: 19px 17px 16px !important;
  border: 1px solid var(--pv-line) !important;
  border-top: 2px solid #5980a3 !important;
  border-radius: 11px !important;
  background: #fff !important;
  box-shadow: 0 5px 18px #17324d08;
}
.b3-kri-stat > span { max-width: calc(100% - 36px); color: #405b73 !important; font-size: 13px !important; font-weight: 700 !important; line-height: 1.4; }
.b3-kri-stat > strong { margin: 14px 0 7px !important; color: #173a59 !important; font-size: clamp(26px,2vw,34px) !important; font-weight: 790 !important; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.b3-kri-stat > small { color: #5c7388 !important; font-size: 12px !important; line-height: 1.5; }
.b3-kri-stat-icon { position: absolute; top: 15px; right: 15px; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #dce6ed; border-radius: 10px; background: #f1f6f9; color: #557b99; }
.b3-kri-stat-icon svg { width: 18px; height: 18px; }
.b3-kri-stat--universe { border-top-color: #99aabb !important; background: #f7f9fb !important; }
.b3-kri-stat--universe > strong { color: #526d84 !important; }
.b3-kri-stat--follow { border-top-color: #bd9139 !important; background: #fffdf8 !important; }
.b3-kri-stat--follow .b3-kri-stat-icon { background: #fbf5e8; border-color: #eee0bf; color: #9c752d; }
.b3-kri-surface, .b3-surface { border-color: var(--pv-line) !important; border-radius: var(--pv-radius) !important; box-shadow: 0 6px 22px #17324d09 !important; padding: 23px 23px !important; }
.b3-kri-surface-head { align-items: end !important; margin-bottom: 16px !important; }
.b3-kri-surface-head > div > span { color: #927037 !important; font-size: 10px !important; font-weight: 850 !important; letter-spacing: .1em !important; }
.b3-kri-surface-head h2 { margin: 5px 0 0 !important; color: #183a58 !important; font-size: 19px !important; font-weight: 760 !important; letter-spacing: -.02em; }
.b3-kri-surface-head > strong, .b3-kri-surface-head > span { color: #526d83 !important; font-size: 12px !important; font-variant-numeric: tabular-nums; }
.b3-kri-bars { gap: 8px !important; }
.b3-kri-bar { min-height: 44px; grid-template-columns: minmax(190px,.75fr) minmax(110px,1.8fr) 74px !important; gap: 14px !important; color: #395873 !important; font-size: 13px !important; }
.b3-kri-bar > strong { color: #173d5c !important; font-size: 13px !important; font-variant-numeric: tabular-nums; }
.b3-kri-track { height: 9px !important; border-radius: 999px !important; background: #eaf0f4 !important; }
.b3-kri-track i { border-radius: 999px !important; background: linear-gradient(90deg,#345f87,#6991b6) !important; }
.b3-kri-search { gap: 8px !important; }
.b3-kri-search input { min-height: 43px !important; border-radius: 8px !important; font-size: 13px !important; }
.b3-kri-search button, .b3-page-controls button, .b3-kri-bottom button { min-height: 42px !important; border-radius: 8px !important; font-size: 12px !important; font-weight: 750 !important; }
.b3-table-wrap { border-color: #dce5ed !important; border-radius: 9px !important; }
.b3-table thead th { padding: 12px 13px !important; background: #eff4f8 !important; color: #405c75 !important; font-size: 11px !important; font-weight: 800 !important; letter-spacing: .04em; }
.b3-table tbody td, .b3-table tbody th { padding: 12px 13px !important; color: #36526b !important; font-size: 13px !important; line-height: 1.45; }
.b3-table tbody tr:nth-child(even) { background: #fafcfd; }
.b3-kri-blocked { padding: 23px 25px !important; border: 1px solid #e6d8b8 !important; border-left: 4px solid #bc8d38 !important; border-radius: 11px !important; background: #fffdf8 !important; }
.b3-kri-blocked > span { color: #947030 !important; font-size: 10px !important; font-weight: 850 !important; letter-spacing: .12em; }
.b3-kri-blocked h2 { margin: 9px 0 !important; color: #3d5267 !important; font-size: 22px !important; line-height: 1.3; }
.b3-kri-blocked p { margin: 0 0 12px !important; color: #596f83 !important; font-size: 14px !important; line-height: 1.6; }
.b3-kri-blocked > div { color: #536b80 !important; font-size: 12px !important; }
.b3-live-page { gap: 18px !important; }
.b3-page-head h1 { font-size: clamp(28px,2.6vw,35px) !important; font-weight: 780 !important; letter-spacing: -.035em !important; }
.b3-page-head p { color: #526b83 !important; font-size: 14px !important; }
.b3-live-page .b3-metric-grid { gap: 14px !important; }
.b3-live-page .b3-metric { min-height: 155px !important; padding: 19px 18px !important; border-radius: 12px !important; border-color: var(--pv-line) !important; box-shadow: 0 5px 18px #17324d08 !important; }
.b3-live-page .b3-metric-label { color: #405b73 !important; font-size: 13px !important; font-weight: 700 !important; }
.b3-live-page .b3-metric strong { color: #173a59 !important; font-size: 28px !important; font-weight: 790 !important; }
.b3-live-page .b3-metric small { color: #5c7388 !important; font-size: 12px !important; line-height: 1.5; }
.b3-metric-icon { top: 15px !important; right: 15px !important; color: #537b9b !important; }
.b3-metric-icon svg { width: 20px !important; height: 20px !important; }
.b3-live-bar { min-height: 42px; color: #395873 !important; font-size: 13px !important; }
.b3-live-bar strong { color: #173d5c !important; font-size: 13px !important; font-variant-numeric: tabular-nums; }
.b3-live-rail { height: 9px !important; background: #eaf0f4 !important; }
.b3-live-rail i { background: linear-gradient(90deg,#345f87,#6991b6) !important; }
.b3-kri-quality .b3-kri-source .b3-kri-stats { grid-template-columns: repeat(auto-fit,minmax(210px,1fr)); }

/* Investigation, case work, governance, and access screens */
.r4-main, .r5-view, .b5-workspace { color: var(--pv-ink); }
.r4-surface, .r5-surface, .b5-surface { border-color: var(--pv-line) !important; border-radius: var(--pv-radius) !important; box-shadow: 0 6px 22px #17324d09 !important; }
.r4-main :is(h1,h2,h3), .r5-view :is(h1,h2,h3), .b5-workspace :is(h1,h2,h3) { color: #183a58; letter-spacing: -.02em; }
.r4-main h1, .b5-workspace h1, .r5-view h1 { font-size: clamp(27px,2.5vw,34px); font-weight: 780; }
.r4-table th, .r5-table th, .b5-table th { background: #eff4f8 !important; color: #405c75 !important; font-size: 11px !important; font-weight: 800 !important; }
.r4-table td, .r5-table td, .b5-table td { color: #36526b !important; font-size: 13px !important; line-height: 1.45; }
.b5-empty-panel { border-radius: 12px !important; background: #f7fafc !important; }
.b5-empty-panel h2 { color: #234663 !important; font-size: 23px !important; }
.b5-form-section h3 { color: #315774 !important; font-size: 15px !important; }
.r5-tabs button, .r5-tab { min-height: 46px !important; font-size: 13px !important; font-weight: 700 !important; }
.r5-view .r5-metrics article strong { color: #173a59; font-size: 30px; font-weight: 790; font-variant-numeric: tabular-nums; }
.auth-app { background: #fff !important; }
.auth-card { border: 1px solid #dce5ee !important; border-radius: 16px !important; box-shadow: 0 16px 46px #18324d12 !important; }
.auth-card-heading h1, .auth-card-heading h2 { font-size: 30px !important; font-weight: 780 !important; letter-spacing: -.035em; }
.auth-field { min-height: 52px; border-radius: 10px !important; }
.auth-submit { min-height: 50px !important; border-radius: 10px !important; font-weight: 750 !important; }

@media (max-width: 980px) {
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .b3-kri-stats { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
}
@media (max-width: 650px) {
  .main { padding: 15px 13px 26px; }
  .metrics { gap: 10px !important; }
  .metrics .metric { min-height: 143px !important; padding: 14px 13px !important; }
  .metrics .metric-top { max-width: 100%; font-size: 10.5px !important; line-height: 1.35; white-space: normal !important; overflow-wrap: anywhere; }
  .metric-value { font-size: clamp(20px,5.2vw,25px) !important; }
  .metric-note { font-size: 11px !important; }
  .chart-card, .table-card { padding: 17px 15px !important; }
  .card-heading h2, .table-title { font-size: 16px !important; }
  .card-heading p, .table-head span { font-size: 12px !important; }
  .hbar-row { grid-template-columns: minmax(95px,.85fr) minmax(50px,1fr) 72px !important; gap: 8px !important; }
  .hbar-label { font-size: 11px !important; }
  .hbar-value { font-size: 11px !important; }
  .av-section-tab, .b3-module-tab { min-height: 48px !important; padding: 9px 12px !important; font-size: 12px !important; }
  .av-hnav-track { scroll-snap-type: x proximity; }
  .av-hnav-track > button { scroll-snap-align: start; }
  .b3-kri-head { align-items: flex-start !important; flex-direction: column; }
  .b3-kri-head h1 { font-size: 27px !important; }
  .b3-kri-stats { grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 9px !important; }
  .b3-kri-stat { min-height: 145px; padding: 16px 13px !important; }
  .b3-kri-stat > span { font-size: 12px !important; }
  .b3-kri-stat > strong { font-size: 25px !important; }
  .b3-kri-stat > small { font-size: 11px !important; }
  .b3-kri-bar { grid-template-columns: minmax(115px,.9fr) minmax(55px,1.3fr) 58px !important; gap: 8px !important; font-size: 11px !important; }
  .b3-kri-surface, .b3-surface { padding: 17px 15px !important; }
  .b3-kri-surface-head h2 { font-size: 17px !important; }
  .b3-kri-blocked { padding: 19px 17px !important; }
  .b3-kri-blocked h2 { font-size: 19px !important; }
  .b3-live-page .b3-metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
  .b3-live-page .b3-metric { min-height: 145px !important; padding: 16px 13px !important; }
  .b3-live-page .b3-metric strong { font-size: 24px !important; }
  .b3-live-page .b3-metric-label { font-size: 12px !important; }
  .b3-live-page .b3-metric small { font-size: 11px !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
