/* transparency.css - visual polish for /transparency* pages */

body.transparency .liquidity-container,
body.transparency-tx .liquidity-container,
body.transparency-audit-anomalies .liquidity-container {
  overflow: hidden;
}

.trans-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 0.9rem;
}

.trans-kpi {
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.78);
  padding: 0.95rem 1rem;
  box-shadow: 0 14px 30px rgba(8, 13, 20, 0.07);
}

body.dark-mode .trans-kpi {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(15, 20, 28, 0.72);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
}

.trans-kpi .label {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.78;
}

.trans-kpi .value {
  margin-top: 0.35rem;
  font-weight: 900;
  font-size: 1.15rem;
}

.trans-kpi .value .mono {
  font-weight: 900;
}

.trans-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.trans-cell .mono {
  max-width: 26rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trans-cell .btn.btn-xs {
  padding: 0.2rem 0.55rem;
}

.trans-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.trans-filters .filters-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.trans-filters .filters-field input,
.trans-filters .filters-field select {
  border-radius: 12px;
  min-height: 42px;
  padding: 0.55rem 0.75rem;
}

.trans-filters .filters-field.severity { flex: 0 0 160px; }
.trans-filters .filters-field.run { flex: 0 0 280px; }
.trans-filters .filters-field.signature { flex: 1 1 320px; }
.trans-filters .filters-field.types { flex: 1 1 260px; }
.trans-filters .filters-field.min-abs-delta { flex: 0 0 190px; }
.trans-filters .filters-field.limit { flex: 0 0 140px; }

.trans-filters .filters-field.tx-days { flex: 0 0 180px; }
.trans-filters .filters-field.tx-limit { flex: 0 0 160px; }
.trans-filters .filters-field.q { flex: 1 1 260px; }

.trans-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 0.85rem;
}

.trans-type-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.trans-type-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(15, 23, 42, 0.05);
  font-size: 0.74rem;
  line-height: 1.2;
}

.trans-type-chip--critical {
  border-color: rgba(185, 28, 28, 0.35);
  background: rgba(185, 28, 28, 0.10);
}

.trans-type-chip--warn {
  border-color: rgba(180, 83, 9, 0.35);
  background: rgba(180, 83, 9, 0.10);
}

.trans-type-chip--info {
  border-color: rgba(8, 102, 177, 0.35);
  background: rgba(8, 102, 177, 0.10);
}

body.dark-mode .trans-type-chip {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.trans-quickfilters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.trans-trend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(46px, 1fr));
  gap: 0.55rem;
  align-items: end;
}

.trans-trend-col {
  display: grid;
  gap: 0.35rem;
  justify-items: center;
  padding: 0.25rem;
  border-radius: 10px;
  position: relative;
}

.trans-trend-link {
  display: grid;
  gap: 0.35rem;
  justify-items: center;
  width: 100%;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.trans-trend-link:focus-visible {
  outline: 2px solid rgba(11, 77, 216, 0.65);
  outline-offset: 2px;
  border-radius: 8px;
}

.trans-trend-col.is-selected {
  background: rgba(11, 77, 216, 0.10);
  border: 1px solid rgba(11, 77, 216, 0.25);
}

body.dark-mode .trans-trend-col.is-selected {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(96, 165, 250, 0.35);
}

.trans-trend-bar {
  width: 100%;
  max-width: 28px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  background: rgba(15, 23, 42, 0.25);
}

.trans-trend-bar.trend-bar--ok {
  background: rgba(16, 185, 129, 0.45);
  border-color: rgba(5, 150, 105, 0.45);
}

.trans-trend-bar.trend-bar--warn {
  background: rgba(245, 158, 11, 0.50);
  border-color: rgba(180, 83, 9, 0.45);
}

.trans-trend-bar.trend-bar--bad {
  background: rgba(239, 68, 68, 0.55);
  border-color: rgba(185, 28, 28, 0.55);
}

.trans-trend-h1 { height: 12px; }
.trans-trend-h2 { height: 18px; }
.trans-trend-h3 { height: 24px; }
.trans-trend-h4 { height: 30px; }
.trans-trend-h5 { height: 36px; }
.trans-trend-h6 { height: 42px; }
.trans-trend-h7 { height: 48px; }
.trans-trend-h8 { height: 54px; }

.trans-trend-label {
  font-size: 0.7rem;
  opacity: 0.8;
}

.trans-trend-popover {
  --trend-popover-x: -50%;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(var(--trend-popover-x)) translateY(4px);
  width: max-content;
  max-width: 260px;
  display: grid;
  gap: 0.2rem;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.20);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 25px rgba(2, 6, 23, 0.22);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
  z-index: 30;
}

.trans-trend-popover::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(255, 255, 255, 0.98);
}

.trans-trend-popover.is-edge-left {
  left: 0;
  --trend-popover-x: 0%;
}

.trans-trend-popover.is-edge-right {
  left: auto;
  right: 0;
  --trend-popover-x: 0%;
}

.trans-trend-popover.is-edge-left::after {
  left: 14px;
  transform: none;
}

.trans-trend-popover.is-edge-right::after {
  left: auto;
  right: 14px;
  transform: none;
}

.trans-trend-popover.is-edge-left.is-edge-right {
  left: 50%;
  right: auto;
  --trend-popover-x: -50%;
}

.trans-trend-popover.is-edge-left.is-edge-right::after {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

.trans-trend-link:hover .trans-trend-popover,
.trans-trend-link:focus-visible .trans-trend-popover,
.trans-trend-link:focus-within .trans-trend-popover {
  opacity: 1;
  visibility: visible;
  transform: translateX(var(--trend-popover-x)) translateY(0);
}

body.dark-mode .trans-trend-popover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(15, 20, 28, 0.98);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
}

body.dark-mode .trans-trend-popover::after {
  border-top-color: rgba(15, 20, 28, 0.98);
}

.trans-inline-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(11, 77, 216, 0.45);
  text-underline-offset: 2px;
}

.trans-inline-link:hover {
  color: #0b4dd8;
}

.trans-diff-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.trans-diff-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  text-decoration: none;
  color: inherit;
  background: rgba(15, 23, 42, 0.04);
}

.trans-diff-chip--gain {
  border-color: rgba(5, 150, 105, 0.35);
  background: rgba(5, 150, 105, 0.12);
}

.trans-diff-chip--drop {
  border-color: rgba(185, 28, 28, 0.35);
  background: rgba(185, 28, 28, 0.10);
}

.trans-diff-chip:hover {
  filter: brightness(0.98);
}

.trans-diff-chip:focus-visible {
  outline: 2px solid rgba(11, 77, 216, 0.65);
  outline-offset: 2px;
}

.trans-pct-badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  font-size: 0.72rem;
  line-height: 1.2;
  background: rgba(15, 23, 42, 0.06);
}

.trans-narrative-card {
  flex: 1 1 260px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.78);
  padding: 0.9rem;
  box-shadow: 0 10px 22px rgba(8, 13, 20, 0.08);
}

.trans-narrative-card.is-outflow {
  border-color: rgba(185, 28, 28, 0.35);
  background: rgba(185, 28, 28, 0.06);
}

.trans-narrative-card.is-inflow {
  border-color: rgba(5, 150, 105, 0.32);
  background: rgba(5, 150, 105, 0.08);
}

.trans-row-overdue {
  background: rgba(239, 68, 68, 0.08);
}

.trans-row-overdue td {
  border-bottom-color: rgba(239, 68, 68, 0.25);
}

.trans-type-chip[title] {
  cursor: help;
}

body.dark-mode .trans-narrative-card {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(15, 20, 28, 0.72);
}

body.dark-mode .trans-row-overdue {
  background: rgba(185, 28, 28, 0.14);
}

.trans-pct-badge.pct-pos {
  border-color: rgba(5, 150, 105, 0.40);
  background: rgba(5, 150, 105, 0.12);
  color: #0a7a31;
}

.trans-pct-badge.pct-neg {
  border-color: rgba(185, 28, 28, 0.40);
  background: rgba(185, 28, 28, 0.12);
  color: #b91c1c;
}

.trans-pct-badge.pct-zero {
  border-color: rgba(71, 85, 105, 0.30);
  background: rgba(71, 85, 105, 0.10);
  color: var(--color-muted);
}

.trans-compare-meter {
  display: inline-flex;
  width: 86px;
  height: 8px;
  margin-left: 0.45rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.10);
  overflow: hidden;
  vertical-align: middle;
}

.trans-compare-meter > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: rgba(71, 85, 105, 0.55);
}

.trans-compare-meter.is-pos > span {
  background: rgba(5, 150, 105, 0.65);
}

.trans-compare-meter.is-neg > span {
  background: rgba(185, 28, 28, 0.65);
}

.trans-compare-meter.is-zero > span {
  background: rgba(71, 85, 105, 0.45);
}

.delta-pos {
  color: #0a7a31;
  font-weight: 800;
}

.delta-neg {
  color: #b91c1c;
  font-weight: 800;
}

.delta-zero {
  color: var(--color-muted);
  font-weight: 700;
}

.trans-hint {
  margin-top: 0.6rem;
  opacity: 0.85;
}

.trans-alert-snapshot {
  margin-top: 1rem;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.72);
}

body.dark-mode .trans-alert-snapshot {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(15, 20, 28, 0.65);
}

.trans-alert-snapshot h3 {
  margin: 0;
  font-size: 1rem;
}

.trans-alert-code {
  display: inline-block;
  margin-right: 0.3rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: rgba(15, 23, 42, 0.05);
  padding: 0.12rem 0.45rem;
  font-size: 0.72rem;
}

@media (max-width: 960px) {
  .trans-kpis {
    grid-template-columns: 1fr;
  }

  .trans-filters .filters-field.severity,
  .trans-filters .filters-field.min-abs-delta,
  .trans-filters .filters-field.limit {
    flex: 1 1 200px;
  }
}
