/* Executive dashboard: the parts that only this demonstration needs. Everything else comes from the shared nx kit.
   Logical properties only; every rule is scoped under .nx so the site CSS and Bootstrap stay untouched. */

/* ---- screens ------------------------------------------------------------------------------------------------------------ */
.nx .bi-page {
  display: flex;
  flex-direction: column;
  gap: var(--nx-s-4);
  min-width: 0;
}
.nx .bi-gap {
  height: 0.6rem;
}
.nx .bi-asof {
  white-space: nowrap;
}
.nx .bi-chart {
  min-width: 0;
  min-height: 18rem;
}
.nx .bi-chart.short {
  min-height: 14.4rem;
}
.nx .nx-wrap {
  flex-wrap: wrap;
}
.nx .nx-delta.is-na {
  background: transparent;
  color: var(--nx-ink-3);
}
.nx .nx-rail > i.warn {
  background: var(--nx-warn);
}

/* ---- highlights --------------------------------------------------------------------------------------------------------- */
.nx .bi-hl-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--nx-s-3);
}
.nx .bi-hl {
  display: flex;
  align-items: flex-start;
  gap: var(--nx-s-3);
  width: 100%;
  min-width: 0;
  padding: 0.75rem 0.85rem;
  background: var(--nx-surface-2);
  border: 1px solid var(--nx-line);
  border-radius: var(--nx-r-lg);
  text-align: start;
  transition: border-color var(--nx-d-base) var(--nx-ease), background-color var(--nx-d-base) var(--nx-ease);
}
.nx .bi-hl:hover {
  border-color: var(--nx-brand-line);
  background: var(--nx-brand-soft);
}
.nx .bi-hl .ic {
  display: grid;
  place-content: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: var(--nx-r-md);
  background: var(--nx-surface-3);
  color: var(--nx-ink-2);
}
.nx .bi-hl .ic.pos {
  background: var(--nx-pos-soft);
  color: var(--nx-pos);
}
.nx .bi-hl .ic.neg {
  background: var(--nx-neg-soft);
  color: var(--nx-neg);
}
.nx .bi-hl .ic.warn {
  background: var(--nx-warn-soft);
  color: var(--nx-warn);
}
.nx .bi-hl .tx {
  flex: 1 1 0;
  min-width: 0;
  line-height: 1.55;
}
.nx .bi-hl > .nx-i {
  flex: none;
  margin-block-start: 0.3rem;
}

/* ---- small building blocks ---------------------------------------------------------------------------------------------- */
.nx .bi-key {
  display: inline-block;
  flex: none;
  vertical-align: middle;
}
.nx .bi-key.tgt {
  width: 2px;
  height: 0.95rem;
  margin-inline-end: 0.15rem;
  border-radius: 2px;
  background: var(--nx-accent);
}
.nx .bi-dot {
  display: inline-block;
  flex: none;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--c, var(--nx-brand));
}
.nx .bi-end {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}
.nx .bi-indent {
  display: inline-block;
  padding-inline-start: 1rem;
}
.nx .bi-person {
  gap: 0.4rem;
  min-width: 0;
}
.nx .bi-att {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  min-width: 4.75rem;
}
.nx .bi-att b {
  font-weight: 600;
}
.nx .bi-att b.pos {
  color: var(--nx-pos);
}
.nx .bi-att b.neg {
  color: var(--nx-neg);
}
.nx .bi-att b.warn {
  color: var(--nx-warn);
}
.nx .bi-att .nx-rail {
  width: 4.75rem;
}
.nx .bi-lock-v {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--nx-ink-3);
  font-size: var(--nx-fs-md);
  font-weight: 500;
}
.nx .nx-kpi.bi-locked {
  background: var(--nx-surface-2);
  border-style: dashed;
}
.nx .bi-mini-h {
  margin-block-end: 0.35rem;
  color: var(--nx-ink-3);
  font-size: var(--nx-fs-xs);
  font-weight: 600;
}

/* ---- ranked lists --------------------------------------------------------------------------------------------------------- */
.nx .bi-rank {
  display: grid;
}
.nx .bi-rank > li {
  border-block-end: 1px solid var(--nx-line);
}
.nx .bi-rank > li:last-child {
  border-block-end: 0;
}
.nx .bi-rank-row {
  display: flex;
  align-items: center;
  gap: var(--nx-s-3);
  width: 100%;
  min-width: 0;
  padding: 0.5rem 0.25rem;
  border-radius: var(--nx-r-md);
  text-align: start;
}
.nx button.bi-rank-row:hover {
  background: var(--nx-surface-2);
}
.nx .bi-rank-row .nm {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 0;
}
.nx .bi-rank-row .v {
  flex: none;
  font-weight: 600;
  text-align: end;
}

/* ---- drawers ----------------------------------------------------------------------------------------------------------------- */
.nx .bi-drawer {
  display: flex;
  flex-direction: column;
  gap: var(--nx-s-4);
  min-width: 0;
}
.nx .bi-big {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
}
.nx .bi-big-v {
  font-size: var(--nx-fs-3xl);
  font-weight: 600;
  line-height: 1.1;
}
.nx .bi-sec {
  display: flex;
  flex-direction: column;
  gap: var(--nx-s-3);
  min-width: 0;
  padding-block-start: var(--nx-s-4);
  border-block-start: 1px solid var(--nx-line);
}
.nx .bi-sec-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--nx-s-3);
}
.nx .bi-sec-h h3 {
  font-size: var(--nx-fs-md);
  font-weight: 600;
  line-height: 1.4;
}
.nx .bi-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: var(--nx-s-2);
}
.nx .bi-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.6rem 0.75rem;
  background: var(--nx-surface-2);
  border: 1px solid var(--nx-line);
  border-radius: var(--nx-r-md);
}
.nx .bi-stat .k {
  color: var(--nx-ink-3);
  font-size: var(--nx-fs-xs);
}
.nx .bi-stat .v {
  font-size: var(--nx-fs-lg);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.nx .bi-stat .s {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.4rem;
  color: var(--nx-ink-3);
  font-size: var(--nx-fs-xs);
}
.nx .bi-lead {
  --c: var(--nx-brand);
  display: grid;
  place-content: center;
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--nx-r-lg);
  background: color-mix(in srgb, var(--c) 14%, transparent);
  color: var(--c);
}
.nx .bi-lead.pos {
  --c: var(--nx-pos);
}
.nx .bi-lead.neg {
  --c: var(--nx-neg);
}
.nx .bi-lead.warn {
  --c: var(--nx-warn);
}
.nx .bi-lead.info {
  --c: var(--nx-info);
}

/* ---- alerts ---------------------------------------------------------------------------------------------------------------------- */
.nx .bi-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--nx-s-2);
  padding: var(--nx-s-3) var(--nx-s-4);
  border-block-end: 1px solid var(--nx-line);
}
.nx .bi-alerts {
  display: grid;
}
.nx .bi-alert {
  display: flex;
  align-items: center;
  gap: var(--nx-s-3);
  border-block-end: 1px solid var(--nx-line);
}
.nx .bi-alert:last-child {
  border-block-end: 0;
}
.nx .bi-alert > .nx-btn {
  flex: none;
  margin-inline-end: var(--nx-s-4);
}
.nx .bi-alert-main {
  display: flex;
  align-items: flex-start;
  flex: 1 1 0;
  gap: var(--nx-s-3);
  min-width: 0;
  padding: 0.85rem var(--nx-s-4);
  text-align: start;
  transition: background-color var(--nx-d-fast) var(--nx-ease);
}
.nx .bi-alert-main:hover {
  background: var(--nx-surface-2);
}
.nx .bi-alerts.is-compact .bi-alert-main {
  padding: 0.65rem var(--nx-s-4);
}
.nx .bi-alert.is-done .bi-alert-t {
  color: var(--nx-ink-3);
  font-weight: 500;
}
.nx .bi-alert-ic {
  display: grid;
  place-content: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: var(--nx-r-md);
  background: var(--nx-brand-soft);
  color: var(--nx-brand);
}
.nx .bi-alert-ic.pos {
  background: var(--nx-pos-soft);
  color: var(--nx-pos);
}
.nx .bi-alert-ic.neg {
  background: var(--nx-neg-soft);
  color: var(--nx-neg);
}
.nx .bi-alert-ic.warn {
  background: var(--nx-warn-soft);
  color: var(--nx-warn);
}
.nx .bi-alert-tx {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  gap: 0.25rem;
  min-width: 0;
}
.nx .bi-alert-t {
  font-weight: 600;
  line-height: 1.4;
}
.nx .bi-alert-d {
  color: var(--nx-ink-2);
  font-size: var(--nx-fs-sm);
  line-height: 1.55;
}
.nx .bi-alert-m {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem 0.6rem;
  font-size: var(--nx-fs-xs);
}
.nx .bi-alert-top {
  min-width: 0;
}
.nx .bi-bullets {
  display: grid;
  gap: 0.4rem;
  padding-inline-start: 1.25rem;
}
.nx ul.bi-bullets {
  list-style: disc;
}
.nx ol.bi-bullets {
  list-style: decimal;
}
.nx .bi-bullets li::marker {
  color: var(--nx-ink-3);
}
.nx .bi-log {
  display: grid;
}
.nx .bi-log > li {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: var(--nx-s-3);
  padding-block: 0.45rem;
  border-block-end: 1px solid var(--nx-line);
}
.nx .bi-log > li:last-child {
  border-block-end: 0;
}
.nx .bi-log-btn {
  color: var(--nx-ink);
  font-weight: 400;
  text-decoration: none;
}
.nx .bi-log-btn:hover {
  color: var(--nx-brand);
  text-decoration: underline;
}
.nx .bi-rules {
  display: grid;
  gap: 0.7rem;
}
.nx .bi-rules > li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}
.nx .bi-rules > li.is-off {
  opacity: 0.65;
}
.nx .bi-rule {
  display: grid;
  gap: var(--nx-s-3);
  padding-block: var(--nx-s-4);
  border-block-end: 1px solid var(--nx-line);
}
.nx .bi-rule:last-child {
  border-block-end: 0;
}
.nx .bi-rule h3 {
  font-weight: 600;
}

/* ---- tables and chart tooltips -------------------------------------------------------------------------------------------- */
.nx .nx-table tbody tr.is-total :is(th, td) {
  background: var(--nx-surface-2);
  font-weight: 600;
}
.nx .nx-table tbody tr.is-strong :is(th, td) {
  border-block-start: 1px solid var(--nx-line-strong);
  background: var(--nx-brand-soft);
  color: var(--nx-brand-ink);
}
.nx .nx-ct .r.tot {
  margin-block-start: 0.25rem;
  padding-block-start: 0.25rem;
  border-block-start: 1px solid var(--nx-line);
  color: var(--nx-ink);
  font-weight: 600;
}

/* ---- narrow containers ---------------------------------------------------------------------------------------------------- */
@container nxapp (max-width: 760px) {
  .nx .bi-asof {
    display: none;
  }
  .nx .bi-hl-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .nx .bi-big-v {
    font-size: var(--nx-fs-2xl);
  }
  .nx .bi-alert {
    flex-wrap: wrap;
  }
  .nx .bi-alert-main {
    flex: 1 1 100%;
  }
  .nx .bi-alert > .nx-btn {
    margin-inline: calc(var(--nx-s-4) + 2rem + var(--nx-s-3)) 0;
    margin-block-end: 0.75rem;
  }
  .nx .bi-log > li {
    grid-template-columns: 3.75rem minmax(0, 1fr);
  }
}

/* Single-column grids: keep the column inside its container (long names truncate instead of pushing the layout). */
.nx .bi-rank,
.nx .bi-alerts,
.nx .bi-bullets,
.nx .bi-log,
.nx .bi-rules,
.nx .bi-rule {
  grid-template-columns: minmax(0, 1fr);
}

/* Narrow tables keep the figure and drop the change chip beside it. */
@container nxmain (max-width: 520px) {
  .nx .nx-table td .bi-end .nx-delta {
    display: none;
  }
}

/* A table date shows the year only when there is room for it. */
.nx .bi-d-s {
  display: none;
}
@container nxmain (max-width: 520px) {
  .nx .bi-d-l {
    display: none;
  }
  .nx .bi-d-s {
    display: inline;
  }
}
