/* Navexa public products — phase 3 + phase 4-A */
.nx-quick-filters {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
  padding: .8rem 1rem;
  margin: .75rem 0 1rem;
  border: 1px solid rgba(59, 130, 246, .16);
  border-radius: 16px;
  background: rgba(248, 251, 255, .92);
}
.nx-quick-filters__title {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-inline-end: .2rem;
  color: #475569;
  font-size: .78rem;
  font-weight: 800;
}
.nx-filter-chip {
  border: 1px solid #dbe5f2;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  padding: .42rem .78rem;
  font-size: .76rem;
  font-weight: 750;
  line-height: 1.2;
  transition: border-color .15s ease, color .15s ease, background .15s ease, transform .15s ease;
}
.nx-filter-chip:hover { border-color: #93c5fd; color: #1d4ed8; transform: translateY(-1px); }
.nx-filter-chip.is-active { background: #eff6ff; border-color: #60a5fa; color: #1d4ed8; box-shadow: 0 4px 12px rgba(37, 99, 235, .1); }
.nx-filter-chip__count { margin-inline-start: .3rem; color: #64748b; font-size: .7rem; }
.nx-quick-filters__result { margin-inline-start: auto; color: #64748b; font-size: .74rem; white-space: nowrap; }

.nx-deadline-badge,
.nx-stop-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: .28rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
}
.nx-deadline-badge--urgent { color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; }
.nx-deadline-badge--near { color: #b45309; background: #fffbeb; border: 1px solid #fde68a; }
.nx-deadline-badge--normal { color: #047857; background: #ecfdf5; border: 1px solid #a7f3d0; }
.nx-deadline-badge--expired { color: #64748b; background: #f1f5f9; border: 1px solid #cbd5e1; }
.nx-deadline-badge--unknown { color: #64748b; background: #f8fafc; border: 1px solid #e2e8f0; }
.nx-stop-badge--critical { color: #b91c1c; background: #fef2f2; }
.nx-stop-badge--long { color: #b45309; background: #fffbeb; }
.nx-stop-badge--recent { color: #0369a1; background: #f0f9ff; }
.nx-stop-badge--normal { color: #475569; background: #f8fafc; }

.nx-fund-compare-bar {
  display: flex;
  align-items: center;
  gap: .8rem;
  flex-wrap: wrap;
  padding: .85rem 1rem;
  margin: .75rem 0 1rem;
  border: 1px solid rgba(79, 70, 229, .18);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(238, 242, 255, .96), rgba(248, 250, 252, .96));
}
.nx-fund-compare-bar__intro { min-width: 180px; }
.nx-fund-compare-bar__intro strong { display: block; color: #172554; font-size: .86rem; }
.nx-fund-compare-bar__intro span { color: #64748b; font-size: .72rem; }
.nx-fund-compare-selection { display: flex; gap: .4rem; flex-wrap: wrap; flex: 1 1 260px; min-width: 0; }
.nx-fund-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  max-width: 210px;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  background: #fff;
  color: #3730a3;
  padding: .34rem .62rem;
  font-size: .72rem;
  font-weight: 750;
}
.nx-fund-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-fund-chip button { border: 0; background: transparent; color: #64748b; padding: 0; line-height: 1; }
.nx-fund-compare-actions { display: flex; gap: .45rem; align-items: center; margin-inline-start: auto; }
.nx-fund-compare-status { flex: 1 0 100%; color: #b45309; font-size: .72rem; min-height: 1em; }
.nx-compare-cell { min-width: 84px; }
.nx-compare-toggle {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #475569;
  padding: .3rem .52rem;
  font-size: .7rem;
  font-weight: 750;
  transition: .15s ease;
}
.nx-compare-toggle:hover { border-color: #818cf8; color: #4338ca; }
.nx-compare-toggle.is-selected { border-color: #6366f1; color: #fff; background: #6366f1; }
.nx-compare-toggle.is-locked { color: #64748b; background: #f8fafc; }

.nx-fund-compare-modal .modal-dialog { max-width: min(1180px, calc(100vw - 2rem)); }
.nx-fund-compare-modal .modal-content { border: 0; border-radius: 22px; overflow: hidden; }
.nx-fund-compare-modal .modal-header { border-bottom: 1px solid #e2e8f0; background: #f8fafc; }
.nx-compare-return-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.nx-compare-fund-card { border: 1px solid #e2e8f0; border-radius: 16px; padding: .85rem; background: #fff; }
.nx-compare-fund-card h3 { font-size: .86rem; margin: 0 0 .75rem; color: #0f172a; }
.nx-compare-performance { display: grid; gap: .55rem; }
.nx-compare-performance__row { display: grid; grid-template-columns: 64px 1fr 62px; align-items: center; gap: .45rem; font-size: .7rem; color: #64748b; }
.nx-compare-performance__track { position: relative; height: 7px; border-radius: 999px; background: #eef2f7; overflow: hidden; direction: ltr; }
.nx-compare-performance__bar { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: #3b82f6; }
.nx-compare-performance__bar.is-negative { background: #ef4444; }
.nx-compare-performance__value { text-align: left; direction: ltr; font-weight: 800; color: #334155; }
.nx-compare-matrix { border: 1px solid #e2e8f0; border-radius: 16px; overflow: auto; }
.nx-compare-matrix table { min-width: 680px; margin: 0; }
.nx-compare-matrix th { background: #f8fafc; color: #475569; font-size: .74rem; white-space: nowrap; }
.nx-compare-matrix td { font-size: .76rem; white-space: nowrap; }
.nx-compare-matrix .is-best { background: #ecfdf5; color: #047857; font-weight: 850; }
.nx-gold-fund-note { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border: 1px solid #fde68a; background: #fffbeb; border-radius: 14px; padding: .75rem .9rem; margin-bottom: 1rem; color: #92400e; font-size: .76rem; }

@media (max-width: 768px) {
  .nx-quick-filters { padding: .7rem; }
  .nx-quick-filters__result { flex-basis: 100%; margin-inline-start: 0; }
  .nx-fund-compare-bar { align-items: stretch; }
  .nx-fund-compare-actions { width: 100%; margin-inline-start: 0; }
  .nx-fund-compare-actions .btn { flex: 1; }
  .nx-compare-performance__row { grid-template-columns: 58px 1fr 58px; }
}
.nx-fund-compare-status a { color: #1d4ed8; font-weight: 800; text-decoration: none; margin-inline-start: .3rem; }
.nx-fund-compare-status a:hover { text-decoration: underline; }

/* Keep Persian duration labels in the natural “۳ روز” order, even inside LTR cells. */
.nx-stop-badge .nx-duration-number { direction: ltr; unicode-bidi: isolate; }
.nx-stop-badge { direction: rtl; gap: .22rem; }
