/* ============================================================
   AGS Property & Investment — Reusable Components
   ============================================================ */

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  line-height: 1;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary-light);
  outline-offset: 2px;
}

/* Primary */
.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}
.btn-primary:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary-light);
  color: var(--color-white);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15,37,84,0.3);
}

/* Gold / Accent */
.btn-accent {
  background: var(--color-accent);
  color: var(--color-white);
  border-color: var(--color-accent);
}
.btn-accent:hover {
  background: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  color: var(--color-white);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(201,149,26,0.35);
}

/* Outline Primary */
.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

/* Outline White (for dark backgrounds) */
.btn-outline-white {
  background: transparent;
  color: var(--color-white);
  border-color: rgba(255,255,255,0.7);
}
.btn-outline-white:hover {
  background: var(--color-white);
  color: var(--color-primary);
  border-color: var(--color-white);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--color-gray-100);
  color: var(--color-text-primary);
}

/* Danger */
.btn-danger {
  background: var(--color-danger);
  color: var(--color-white);
  border-color: var(--color-danger);
}
.btn-danger:hover {
  background: #B91C1C;
  border-color: #B91C1C;
  color: var(--color-white);
}

/* Success */
.btn-success {
  background: var(--color-success);
  color: var(--color-white);
  border-color: var(--color-success);
}

/* Sizes */
.btn-sm { padding: 0.5rem 1rem; font-size: var(--text-xs); border-radius: var(--radius-sm); }
.btn-lg { padding: 1rem 2rem; font-size: var(--text-base); border-radius: var(--radius-lg); }
.btn-xl { padding: 1.125rem 2.25rem; font-size: var(--text-lg); border-radius: var(--radius-lg); }
.btn-full { width: 100%; }

/* Loading state */
.btn.loading { pointer-events: none; opacity: 0.75; }
.btn.loading::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-left: var(--space-2);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Icon button */
.btn-icon {
  padding: 0.625rem;
  border-radius: var(--radius-md);
  line-height: 1;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
}

.card-body { padding: var(--space-6); }
.card-header { padding: var(--space-5) var(--space-6); border-bottom: 1px solid var(--color-border); }
.card-footer { padding: var(--space-4) var(--space-6); border-top: 1px solid var(--color-border); background: var(--color-gray-50); }

/* ── Property Card ─────────────────────────────────────────── */
.property-card {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
}

.property-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-4px);
  border-color: var(--color-primary-200);
}

.property-card-image-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--color-gray-100);
}

.property-card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.property-card:hover .property-card-image-wrap img {
  transform: scale(1.05);
}

.property-card-badges {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  right: var(--space-3);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.property-card-body {
  padding: var(--space-5);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.property-card-type {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  margin-bottom: var(--space-2);
}

.property-card-title {
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  color: var(--color-text-primary);
  line-height: var(--leading-snug);
  margin-bottom: var(--space-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.property-card-location {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.property-card-location svg { flex-shrink: 0; }

.property-card-price {
  font-size: var(--text-xl);
  font-weight: var(--font-extrabold);
  color: var(--color-primary);
  margin-bottom: var(--space-1);
}

.property-card-price-period {
  font-size: var(--text-xs);
  font-weight: var(--font-regular);
  color: var(--color-text-muted);
  margin-left: var(--space-1);
}

.property-card-divider {
  height: 1px;
  background: var(--color-border);
  margin-block: var(--space-4);
}

.property-card-stats {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.property-stat {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  font-weight: var(--font-medium);
}

.property-stat svg { color: var(--color-text-muted); flex-shrink: 0; }

.property-card-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: auto;
}

/* ── Investment Card & Grid ────────────────────────────────── */
/* ── Investment Opportunities Section Header ───────────────── */
.investments-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.investments-header-title-box {
  flex: 1;
  min-width: 260px;
}

.investments-header-title-box .section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #D97706;
  margin-bottom: 4px;
}

.investments-main-title {
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  font-weight: 800;
  color: var(--color-text-primary);
  margin: 0 0 6px 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.investments-live-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
  animation: livePulse 2s infinite;
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.investments-header-desc {
  font-size: 13.5px;
  color: var(--color-text-muted);
  line-height: 1.45;
  margin: 0;
  max-width: 620px;
}

.investments-header-meta {
  flex-shrink: 0;
}

.investments-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #F8FAFC;
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  font-size: 13px;
  color: var(--color-text-secondary);
  box-shadow: var(--shadow-xs);
  white-space: nowrap !important;
}

.investments-count-badge strong {
  color: var(--color-text-primary);
  font-weight: 700;
}

/* ── Investment Card & Grid ────────────────────────────────── */
.investments-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
  margin-bottom: var(--space-10);
}

.investment-card {
  background: var(--color-white);
  color: var(--color-text-primary);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 0 1px 4px rgba(15, 37, 84, 0.04);
}

.section-dark .investment-card {
  color: var(--color-text-primary);
}

.investment-card:hover {
  box-shadow: 0 12px 28px -4px rgba(15, 37, 84, 0.12);
  transform: translateY(-4px);
  border-color: #CBD5E1;
}

.investment-card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #0F2554;
}

.investment-card-img-link {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
}

.investment-card-img-wrap .investment-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
}

.investment-card:hover .investment-card-image {
  transform: scale(1.06);
}

.investment-card-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,37,84,0.35) 0%, transparent 40%, rgba(15,37,84,0.45) 100%);
  pointer-events: none;
}

.investment-badge-overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}

.investment-return-overlay {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.investment-return-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(15, 37, 84, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #FBBF24;
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.investment-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.investment-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0 0 6px 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}

.investment-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}

.investment-card-title a:hover {
  color: var(--color-primary);
}

.investment-card-location {
  font-size: 12.5px;
  color: var(--color-text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.investment-card-location svg {
  flex-shrink: 0;
  color: #94A3B8;
}

/* 4 Financial Highlights Grid */
.investment-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin-bottom: 16px;
  background: #F8FAFC;
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  border: 1px solid #E2E8F0;
}

.investment-stat-item {
  min-width: 0;
  overflow: hidden;
}

.investment-stat-label {
  font-size: 10px;
  color: #64748B;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
  white-space: nowrap !important;
}

.investment-stat-value {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--color-text-primary);
  white-space: nowrap !important;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
}

.investment-stat-value.return-value {
  color: #059669;
}

.risk-pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: capitalize;
  white-space: nowrap !important;
}

.risk-pill.risk-low {
  background: #ECFDF5;
  color: #047857;
}

.risk-pill.risk-medium {
  background: #EFF6FF;
  color: #1D4ED8;
}

.risk-pill.risk-high {
  background: #FFFBEB;
  color: #B45309;
}

/* ── Funding Figures (3-Column Strip) ───────────────────────── */
.investment-funding-figures {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px 12px;
  align-items: flex-end;
  margin-bottom: 10px;
}

.investment-funding-fig-item {
  min-width: 0;
}

.investment-funding-fig-item.text-right {
  text-align: right;
}

.investment-funding-fig-label {
  display: block;
  font-size: 10.5px;
  text-transform: uppercase;
  color: #64748B !important;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
  white-space: nowrap !important;
  line-height: 1.2;
}

.investment-funding-fig-val {
  font-size: 13.5px;
  font-weight: 800;
  color: #0F172A !important;
  white-space: nowrap !important;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  line-height: 1.25;
}

.investment-funding-fig-val.highlight {
  color: #0F2554 !important;
}

.investment-funding-fig-val.text-emerald {
  color: #059669 !important;
}

/* ── 2-Row Funding Strip (Eliminates 3-column squashing) ─────── */
.investment-funding-strip {
  background: #F8FAFC;
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin-top: auto;
  margin-bottom: 16px;
}

.investment-funding-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 8px;
}

.funding-stat-group {
  flex: 1;
  min-width: 0;
}

.funding-stat-group.text-right {
  text-align: right;
}

.funding-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  color: #64748B;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 1px;
  white-space: nowrap !important;
}

.funding-val {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--color-text-primary);
  white-space: nowrap !important;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.funding-val.highlight {
  color: var(--color-primary);
}

.investment-progress-wrap {
  margin-bottom: 8px;
}

.investment-progress-bar {
  height: 7px;
  background: #E2E8F0;
  border-radius: 9999px;
  overflow: hidden;
}

.investment-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0F2554 0%, #2563EB 100%);
  border-radius: 9999px;
  transition: width 0.6s ease;
}

.investment-funding-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--color-text-muted);
}

.funding-pct-text {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--color-text-primary);
  white-space: nowrap !important;
  font-size: 11.5px;
}

.funding-pct-text strong {
  color: var(--color-primary);
  font-weight: 800;
}

.funding-pct-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2563EB;
}

.funding-remaining-text {
  color: #64748B;
  white-space: nowrap !important;
  font-weight: 600;
  font-size: 11.5px;
}

/* Status Badges */
.badge-status-open {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}
.badge-status-fully-funded {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}
.badge-status-completed {
  background: #F5F3FF;
  color: #6D28D9;
  border: 1px solid #DDD6FE;
}
.badge-status-paused {
  background: #FFFBEB;
  color: #B45309;
  border: 1px solid #FDE68A;
}
.badge-status-closed {
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #CBD5E1;
}

/* CTA Button */
.investment-card-cta {
  min-height: 44px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13.5px;
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all 0.18s ease;
  user-select: none;
}

.investment-card-cta:hover {
  box-shadow: 0 4px 14px rgba(15, 37, 84, 0.2);
}

.cta-arrow {
  transition: transform 0.15s ease;
}

.investment-card-cta:hover .cta-arrow {
  transform: translateX(3px);
}

/* ── Tablet & Mobile Responsiveness for Opportunities Section ── */
@media (max-width: 1024px) {
  .investments-section-header {
    gap: var(--space-3);
    margin-bottom: var(--space-5);
  }

  .investments-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 18px !important;
  }

  .investment-card-body {
    padding: 16px;
  }

  .investment-card-title {
    font-size: 15px;
  }

  .investment-stats-grid {
    padding: 10px 12px;
    gap: 8px 10px;
    margin-bottom: 12px;
  }

  .investment-stat-label {
    font-size: 9.5px;
  }

  .investment-stat-value {
    font-size: 13px;
  }

  .funding-val {
    font-size: 12.5px;
  }

  .investment-funding-strip {
    padding: 10px 12px;
    margin-bottom: 14px;
  }
}

@media (max-width: 640px) {
  .investments-section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .investments-header-meta {
    width: 100%;
  }

  .investments-count-badge {
    width: 100%;
    justify-content: center;
  }

  .investments-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .investment-card-body {
    padding: 16px 14px;
  }

  .investment-stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
}

@media (max-width: 480px) {
  .investments-main-title {
    font-size: 1.45rem;
  }

  .investment-card-title {
    font-size: 14.5px;
    min-height: auto;
  }

  .investment-stat-value {
    font-size: 12.5px;
  }

  .funding-val {
    font-size: 12px;
  }

  .investment-card-cta {
    min-height: 42px;
    font-size: 13px;
  }
}

/* Filter Toolbar */
.investment-filter-toolbar {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  margin-bottom: var(--space-8);
  box-shadow: var(--shadow-sm);
}

.investment-status-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-gray-100);
}

.investment-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--color-text-secondary);
  background: var(--color-gray-50);
  border: 1px solid var(--color-border);
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap !important;
  user-select: none;
}

.investment-status-pill:hover {
  background: var(--color-gray-100);
  color: var(--color-text-primary);
  border-color: var(--color-gray-300);
}

.investment-status-pill.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  box-shadow: 0 2px 6px rgba(26,58,124,0.25);
}

.investment-pill-count {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-size: 10px;
  background: rgba(0,0,0,0.08);
  color: inherit;
  white-space: nowrap !important;
}

.investment-status-pill.active .investment-pill-count {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

.investment-filter-form-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1fr 1.3fr auto;
  gap: var(--space-3);
  align-items: center;
}

.investment-filter-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.investment-filter-submit {
  min-height: 40px;
  padding: 0 18px;
  font-weight: 600;
  white-space: nowrap !important;
}

@media (max-width: 1024px) and (min-width: 601px) {
  .investment-filter-form-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
  }

  .investment-filter-search-col {
    grid-column: 1 / -1;
  }

  .investment-filter-actions {
    width: 100%;
  }

  .investment-filter-submit {
    flex: 1;
    min-height: 42px;
  }
}

@media (max-width: 600px) {
  .investment-filter-toolbar {
    padding: var(--space-4) var(--space-3);
  }

  .investment-status-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .investment-status-pills::-webkit-scrollbar {
    display: none;
  }

  .investment-status-pill {
    flex-shrink: 0;
  }

  .investment-filter-form-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .investment-filter-actions {
    width: 100%;
  }

  .investment-filter-submit {
    flex: 1;
    min-height: 44px;
    justify-content: center;
    font-weight: 700;
  }
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.badge-sale     { background: var(--color-primary);      color: white; }
.badge-rent     { background: #0284C7;                    color: white; }
.badge-lease    { background: #7C3AED;                    color: white; }
.badge-shortlet { background: #059669;                    color: white; }
.badge-land     { background: var(--color-accent-dark);   color: white; }
.badge-featured { background: var(--color-accent);        color: white; }
.badge-verified   { background: var(--color-success);       color: white; }
.badge-completed  { background: var(--color-success);       color: white; }
.badge-pending    { background: var(--color-warning);       color: white; }
.badge-requested  { background: var(--color-warning);       color: white; }
.badge-processing { background: #7C3AED;                    color: white; }
.badge-approved   { background: #D97706;                    color: white; }
.badge-rejected   { background: var(--color-danger);        color: white; }
.badge-failed     { background: var(--color-danger);        color: white; }
.badge-reversed   { background: #7e22ce;                    color: white; }
.badge-draft    { background: var(--color-gray-400);      color: white; }
.badge-open     { background: var(--color-success);       color: white; }
.badge-closed   { background: var(--color-gray-400);      color: white; }
.badge-pill     { border-radius: var(--radius-full); padding: 2px 8px; }

.badge-outline-primary {
  background: var(--color-primary-50);
  color: var(--color-primary);
  border: 1px solid var(--color-primary-200);
}

/* ── Favorite Button ───────────────────────────────────────── */
.btn-favorite {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.btn-favorite:hover,
.btn-favorite.active {
  background: var(--color-white);
  color: #EF4444;
  transform: scale(1.1);
}

.btn-favorite.active svg { fill: #EF4444; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: var(--space-5); }

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}

.form-label .required { color: var(--color-danger); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: var(--text-base);
  font-family: var(--font-sans);
  color: var(--color-text-primary);
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
  line-height: var(--leading-normal);
}

.form-control::placeholder { color: var(--color-text-muted); }

.form-control:focus {
  outline: none;
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(26,58,124,0.1);
}

.form-control:disabled {
  background: var(--color-gray-50);
  color: var(--color-text-muted);
  cursor: not-allowed;
}

.form-control.error { border-color: var(--color-danger); }
.form-control.success { border-color: var(--color-success); }

textarea.form-control { min-height: 120px; resize: vertical; }

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
  cursor: pointer;
}

.form-help {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--color-danger);
  margin-top: var(--space-1);
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

.input-group {
  display: flex;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-group:focus-within {
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(26,58,124,0.1);
}

.input-group-prefix,
.input-group-suffix {
  display: flex;
  align-items: center;
  padding: 0 var(--space-3);
  background: var(--color-gray-50);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  border: none;
  flex-shrink: 0;
}

.input-group .form-control {
  border: none;
  box-shadow: none;
  border-radius: 0;
}

.input-group .form-control:focus {
  box-shadow: none;
}

/* Checkbox / Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}

.form-check-input {
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  position: relative;
}

.form-check-input:checked {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.form-check-input:checked::after {
  content: '';
  position: absolute;
  inset: 2px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath d='M1 5l3.5 4L11 1' stroke='white' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}

.form-check-label { font-size: var(--text-sm); cursor: pointer; }

/* ── Alert ──────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  border: 1px solid transparent;
}

.alert-success { background: var(--color-success-bg); border-color: #BBF7D0; color: #166534; }
.alert-error   { background: var(--color-danger-bg);  border-color: #FECACA; color: #991B1B; }
.alert-warning { background: var(--color-warning-bg); border-color: #FDE68A; color: #92400E; }
.alert-info    { background: var(--color-info-bg);    border-color: #BAE6FD; color: #075985; }

.alert-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-body { flex: 1; }
.alert-title { font-weight: var(--font-semibold); margin-bottom: 2px; }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--color-white);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-2xl);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform var(--transition-spring);
}

.modal-backdrop.open .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
}

.modal-body { padding: var(--space-6); }
.modal-footer {
  padding: var(--space-5) var(--space-6);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* ── Progress Bar ───────────────────────────────────────────── */
.progress {
  height: 8px;
  background: var(--color-gray-100);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width 0.8s ease;
}

.progress-bar.accent { background: var(--color-accent); }
.progress-bar.success { background: var(--color-success); }

/* ── Pagination ─────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-10);
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.page-link:hover { border-color: var(--color-primary); color: var(--color-primary); }

.page-link.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.page-link.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ── Avatar ─────────────────────────────────────────────────── */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--color-primary-50);
  color: var(--color-primary);
  font-weight: var(--font-bold);
  overflow: hidden;
  flex-shrink: 0;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm  { width: 32px;  height: 32px;  font-size: var(--text-xs); }
.avatar-md  { width: 40px;  height: 40px;  font-size: var(--text-sm); }
.avatar-lg  { width: 56px;  height: 56px;  font-size: var(--text-lg); }
.avatar-xl  { width: 80px;  height: 80px;  font-size: var(--text-2xl);}
.avatar-2xl { width: 100px; height: 100px; font-size: var(--text-3xl);}

/* ── Data Table ─────────────────────────────────────────────── */
.data-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
}

.data-table {
  width: 100%;
  font-size: var(--text-sm);
}

.data-table th {
  background: var(--color-gray-50);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-weight: var(--font-semibold);
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.data-table td {
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-primary);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--color-gray-50); }

/* ── Stat Cards ─────────────────────────────────────────────── */
.stat-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: box-shadow var(--transition-base);
}

.stat-card:hover { box-shadow: var(--shadow-md); }

.stat-card-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.stat-card-value {
  font-size: var(--text-3xl);
  font-weight: var(--font-extrabold);
  color: var(--color-text-primary);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.stat-card-change {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  display: flex;
  align-items: center;
  gap: 4px;
}
.stat-card-change.up   { color: var(--color-success); }
.stat-card-change.down { color: var(--color-danger);  }

.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  font-size: 22px;
}

.stat-card-icon.blue   { background: var(--color-primary-50); color: var(--color-primary); }
.stat-card-icon.green  { background: var(--color-success-bg);  color: var(--color-success); }
.stat-card-icon.gold   { background: var(--color-accent-bg);   color: var(--color-accent); }
.stat-card-icon.purple { background: #F5F3FF; color: #7C3AED; }

/* ── Tag Filter ─────────────────────────────────────────────── */
.filter-tabs {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.filter-tab {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-tab:hover { border-color: var(--color-primary); color: var(--color-primary); }

.filter-tab.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  flex-wrap: wrap;
}

.breadcrumb-item { display: flex; align-items: center; gap: var(--space-2); }
.breadcrumb-link { color: var(--color-text-secondary); }
.breadcrumb-link:hover { color: var(--color-primary); }
.breadcrumb-separator { color: var(--color-text-muted); font-size: 12px; }
.breadcrumb-current { color: var(--color-text-primary); font-weight: var(--font-medium); }

/* ── Feature Chip ───────────────────────────────────────────── */
.feature-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-gray-50);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--color-text-secondary);
}

/* ── Step indicator ─────────────────────────────────────────── */
.steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: var(--space-8);
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}

.step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 18px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--color-border);
}

.step-item.active:not(:last-child)::after,
.step-item.done:not(:last-child)::after {
  background: var(--color-primary);
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-border);
  background: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: var(--color-text-muted);
  position: relative;
  z-index: 1;
  transition: all var(--transition-base);
}

.step-item.active .step-circle {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: white;
}

.step-item.done .step-circle {
  border-color: var(--color-success);
  background: var(--color-success);
  color: white;
}

.step-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
  text-align: center;
  font-weight: var(--font-medium);
}

.step-item.active .step-label { color: var(--color-primary); }
.step-item.done .step-label   { color: var(--color-success); }

/* ── Latest Properties — time badge ────────────────────────── */
.latest-time-badge {
  position: absolute;
  bottom: var(--space-3);
  left: var(--space-3);
  background: rgba(15, 37, 84, 0.85);
  color: #fff;
  font-size: 10px;
  font-weight: var(--font-semibold);
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(6px);
  pointer-events: none;
}

/* ── Agent Cards ────────────────────────────────────────────── */
.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-6);
}

.agent-card {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.agent-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.agent-card-avatar-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  padding: var(--space-8) var(--space-6) var(--space-4);
  background: linear-gradient(135deg, var(--color-gray-50) 0%, var(--color-gray-100) 100%);
}

.agent-card-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-white);
  box-shadow: var(--shadow-md);
}

.agent-card-avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: var(--color-white);
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  letter-spacing: -0.5px;
}

.agent-card-verified {
  position: absolute;
  bottom: calc(var(--space-4) + 4px);
  left: calc(50% + 28px);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-success);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-white);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.agent-card-body {
  padding: var(--space-4) var(--space-5) var(--space-2);
  text-align: center;
  flex: 1;
}

.agent-card-name {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--color-text-primary);
  margin: 0 0 var(--space-1);
}

.agent-card-type {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  margin-bottom: var(--space-2);
}

.agent-card-location {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.agent-card-bio {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.55;
  margin: 0 0 var(--space-4);
}

.agent-card-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-4);
}

.agent-stat-value {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--color-primary);
  line-height: 1;
}

.agent-stat-label {
  font-size: 10px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  margin-top: 2px;
}

.agent-card-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5) var(--space-5);
}

/* ── Newsletter Section ──────────────────────────────────────── */
.newsletter-section {
  padding: var(--space-20) 0;
  background: linear-gradient(135deg, var(--color-primary) 0%, #1a3d7a 60%, #0c2650 100%);
  position: relative;
  overflow: hidden;
}

.newsletter-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 50%, rgba(201,149,26,0.12) 0%, transparent 55%),
    radial-gradient(circle at 85% 20%, rgba(255,255,255,0.05) 0%, transparent 50%);
  pointer-events: none;
}

.newsletter-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
}

@media (max-width: 900px) {
  .newsletter-inner { grid-template-columns: 1fr; gap: var(--space-10); }
}

.newsletter-icon {
  font-size: 3rem;
  margin-bottom: var(--space-4);
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.newsletter-title {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--color-white);
  margin: 0 0 var(--space-3);
  line-height: 1.2;
}

.newsletter-subtitle {
  font-size: var(--text-base);
  color: rgba(255,255,255,0.75);
  line-height: 1.65;
  margin: 0 0 var(--space-6);
}

.newsletter-perks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.newsletter-perks li {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
}

/* Right column — form card */
.newsletter-form-wrap {
  background: rgba(255,255,255,0.07);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
}

.newsletter-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: rgba(255,255,255,0.9);
  margin-bottom: var(--space-2);
}

.newsletter-input-group {
  display: flex;
  align-items: stretch;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  position: relative;
}

.newsletter-input-group:focus-within {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(201,149,26,0.25);
}

.newsletter-input-icon {
  display: flex;
  align-items: center;
  padding: 0 var(--space-3);
  color: rgba(255,255,255,0.5);
  pointer-events: none;
  flex-shrink: 0;
}

.newsletter-input {
  flex: 1;
  min-width: 0;
  padding: var(--space-3) var(--space-2);
  background: transparent;
  border: none;
  outline: none;
  color: var(--color-white);
  font-size: var(--text-sm);
  font-family: inherit;
}

.newsletter-input::placeholder {
  color: rgba(255,255,255,0.4);
}

.newsletter-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  background: var(--color-accent);
  color: var(--color-white);
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition-base), transform var(--transition-base);
  flex-shrink: 0;
}

.newsletter-btn:hover {
  background: var(--color-accent-dark);
  transform: none;
}

.newsletter-hint {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin: var(--space-2) 0 0;
}

/* Trust bar */
.newsletter-trust {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255,255,255,0.1);
}

.newsletter-trust-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.6);
}

.newsletter-trust-item svg {
  stroke: rgba(255,255,255,0.5);
  flex-shrink: 0;
}

/* Alerts */
.newsletter-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  margin-bottom: var(--space-4);
}

.newsletter-alert svg { flex-shrink: 0; margin-top: 1px; }

.newsletter-alert-success {
  background: rgba(22, 163, 74, 0.2);
  color: #bbf7d0;
  border: 1px solid rgba(22,163,74,0.35);
}

.newsletter-alert-error {
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
  border: 1px solid rgba(239,68,68,0.35);
}

/* ── Price Drop Pill ───────────────────────────────────────── */
.price-drop-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-top: 3px;
}

.price-drop-tag {
  color: #059669;
  font-weight: var(--font-bold);
  font-size: 11px;
}

/* ── Notifications Floating Dropdown ──────────────────────── */
.notifications-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-width: 90vw;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: all var(--transition-base);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notifications-dropdown.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.notifications-dropdown-header {
  padding: var(--space-4) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-gray-50);
}

.notifications-dropdown-header strong {
  font-size: var(--text-sm);
  color: var(--color-text-primary);
}

.notifications-unread-pill {
  font-size: 10px;
  font-weight: var(--font-bold);
  background: var(--color-primary-100);
  color: var(--color-primary-700);
  padding: 2px 6px;
  border-radius: 999px;
  margin-left: 6px;
}

.btn-mark-all-read {
  background: transparent;
  border: none;
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  cursor: pointer;
}

.btn-mark-all-read:hover {
  text-decoration: underline;
}

.notifications-list {
  max-height: 380px;
  overflow-y: auto;
}

.notification-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-gray-100);
  text-decoration: none;
  color: inherit;
  transition: background var(--transition-fast);
}

.notification-item:hover {
  background: var(--color-gray-50);
}

.notification-item.unread {
  background: #F0FDF4;
}

.notification-icon-box {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--color-primary-50);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  color: var(--color-text-primary);
  line-height: 1.3;
}

.notification-msg {
  font-size: 11px;
  color: var(--color-text-secondary);
  line-height: 1.4;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-time {
  font-size: 10px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.notifications-dropdown-footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-border);
  background: var(--color-gray-50);
  text-align: center;
}

/* ── Property Card Comparison Chip ─────────────────────────── */
.property-card-compare-badge {
  position: absolute;
  bottom: var(--space-3);
  left: var(--space-3);
  z-index: 5;
}

.compare-checkbox-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: var(--font-semibold);
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  user-select: none;
}

.compare-checkbox-chip:hover {
  background: var(--color-primary);
  border-color: var(--color-accent);
  transform: translateY(-1px);
}

.compare-checkbox-chip input {
  cursor: pointer;
  accent-color: var(--color-accent);
  margin: 0;
  width: 14px;
  height: 14px;
}

/* ── Global Floating Compare Dock ──────────────────────────── */
.compare-floating-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: var(--space-3) 0;
  z-index: 999;
  transform: translateY(125%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -8px 36px rgba(0, 0, 0, 0.4);
}

.compare-floating-dock.visible {
  transform: translateY(0);
}

.compare-dock-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.compare-dock-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.compare-dock-icon {
  font-size: 28px;
  line-height: 1;
}

.compare-dock-heading {
  font-weight: var(--font-bold);
  font-size: var(--text-sm);
  color: #fff;
  line-height: 1.2;
}

.compare-dock-sub {
  font-size: var(--text-xs);
  color: #94A3B8;
  margin-top: 2px;
}

.compare-dock-previews {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: var(--space-2);
}

.compare-dock-thumb-wrap {
  position: relative;
  display: inline-block;
}

.compare-dock-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 2px solid var(--color-accent);
  background: #334155;
  display: block;
}

.compare-dock-thumb-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  background: var(--color-danger);
  color: #fff;
  border: 1px solid #fff;
  border-radius: 999px;
  font-size: 9px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s;
}

.compare-dock-thumb-del:hover {
  transform: scale(1.15);
}

.compare-dock-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.compare-btn-clear {
  color: #94A3B8 !important;
}

.compare-btn-clear:hover {
  color: #fff !important;
}

@media (max-width: 640px) {
  .compare-dock-inner {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }
  .compare-dock-right {
    justify-content: space-between;
  }
}

/* ══════════════════════════════════════════════════════════════
   16. INVESTMENT OPPORTUNITY DETAILS STYLES
   ══════════════════════════════════════════════════════════════ */
.opportunity-top-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.opportunity-title-wrap {
  flex: 1;
  min-width: 300px;
}

.opportunity-title {
  font-size: var(--text-3xl);
  font-weight: var(--font-black);
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
  line-height: var(--leading-tight);
}

.opportunity-submeta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.opportunity-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.btn-opportunity-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-opportunity-action:hover {
  background: var(--color-gray-50);
  border-color: var(--color-gray-300);
  color: var(--color-text-primary);
}

.btn-opportunity-action.saved {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.btn-opportunity-action.saved svg {
  fill: #dc2626;
  stroke: #dc2626;
}

/* Interactive Image Gallery */
.opportunity-gallery {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  margin-bottom: var(--space-8);
  box-shadow: var(--shadow-sm);
}

.opportunity-gallery-main {
  position: relative;
  width: 100%;
  aspect-ratio: 21/9;
  background: #0f172a;
  overflow: hidden;
}

@media (max-width: 768px) {
  .opportunity-gallery-main {
    aspect-ratio: 16/9;
  }
}

.opportunity-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.25s ease-in-out;
}

.opportunity-gallery-badges {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  display: flex;
  gap: var(--space-2);
  z-index: 2;
}

.opportunity-thumbs-row {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-surface-sunken);
  overflow-x: auto;
  border-top: 1px solid var(--color-border);
}

.opportunity-thumb {
  width: 90px;
  height: 56px;
  border-radius: var(--radius-md);
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.7;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.opportunity-thumb:hover,
.opportunity-thumb.active {
  opacity: 1;
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Sticky Navigation Bar */
.opportunity-nav-sticky {
  position: sticky;
  top: 70px;
  z-index: 25;
  background: white;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-8);
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.opportunity-nav-list {
  display: flex;
  overflow-x: auto;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: var(--space-2);
}

.opportunity-nav-link {
  display: inline-block;
  padding: 12px 18px;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-text-secondary);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}

.opportunity-nav-link:hover,
.opportunity-nav-link.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-accent);
}

/* Developer Profile Card */
.developer-profile-box {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

.developer-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.developer-avatar {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: bold;
  flex-shrink: 0;
}

.developer-title {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--color-text-primary);
}

.developer-tag {
  font-size: var(--text-xs);
  color: var(--color-success);
  font-weight: var(--font-semibold);
}

.developer-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-4);
}

.developer-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-gray-100);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* 6-Metric Financial Grid */
.financial-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

@media (max-width: 768px) {
  .financial-metrics-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .financial-metrics-grid {
    grid-template-columns: 1fr;
  }
}

.financial-metric-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  transition: transform var(--transition-fast);
}

.financial-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.financial-metric-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: var(--font-semibold);
  letter-spacing: 0.5px;
  margin-bottom: var(--space-1);
}

.financial-metric-val {
  font-size: var(--text-2xl);
  font-weight: var(--font-black);
  color: var(--color-text-primary);
}

.financial-metric-val.highlight-green {
  color: var(--color-success);
}

.financial-metric-sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* Distribution Information Card */
.distribution-info-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

.distribution-info-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  color: #166534;
  font-weight: var(--font-bold);
  font-size: var(--text-base);
}

.distribution-info-body {
  font-size: var(--text-sm);
  color: #15803d;
  line-height: var(--leading-relaxed);
}

/* Milestone Timeline Track */
.timeline-track-wrap {
  position: relative;
  padding-left: 28px;
  margin: var(--space-6) 0;
}

.timeline-track-wrap::before {
  content: '';
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 9px;
  width: 2px;
  background: var(--color-border);
}

.timeline-step-node {
  position: relative;
  margin-bottom: var(--space-6);
}

.timeline-step-node:last-child {
  margin-bottom: 0;
}

.timeline-step-dot {
  position: absolute;
  left: -28px;
  top: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--color-gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.timeline-step-node.completed .timeline-step-dot {
  border-color: var(--color-success);
  background: var(--color-success);
}

.timeline-step-node.in_progress .timeline-step-dot {
  border-color: var(--color-primary);
  background: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(26,58,124,0.15);
}

.timeline-step-content {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
}

.timeline-step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.timeline-step-title {
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: var(--color-text-primary);
}

.timeline-step-desc {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  line-height: var(--leading-normal);
}

/* Documents Grid */
.opportunity-docs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

@media (max-width: 680px) {
  .opportunity-docs-grid {
    grid-template-columns: 1fr;
  }
}

.opportunity-doc-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-5);
  transition: all var(--transition-fast);
}

.opportunity-doc-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
}

.opportunity-doc-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.opportunity-doc-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.opportunity-doc-name {
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: var(--color-text-primary);
  margin-bottom: 2px;
}

.opportunity-doc-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Risk Disclosures Matrix */
.risk-matrix-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-6);
  font-size: var(--text-sm);
}

.risk-matrix-table th {
  background: var(--color-surface-sunken);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--text-xs);
  text-transform: uppercase;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}

.risk-matrix-table td {
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

/* Share Modal & Toast */
.share-modal-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.share-social-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-size: 11px;
  color: var(--color-text-secondary);
  transition: transform var(--transition-fast);
}

.share-social-item:hover {
  transform: translateY(-2px);
  color: var(--color-primary);
}

.share-social-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
}

.share-whatsapp { background: #25D366; }
.share-x { background: #000000; }
.share-linkedin { background: #0A66C2; }
.share-facebook { background: #1877F2; }
.share-email { background: #64748B; }

.toast-feedback {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  box-shadow: var(--shadow-xl);
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s ease-in-out;
  pointer-events: none;
}

.toast-feedback.show {
  opacity: 1;
  transform: translateY(0);
}

/* ══════════════════════════════════════════════════════════════
   17. INVESTMENT FLOW & PORTFOLIO STYLES
   ══════════════════════════════════════════════════════════════ */
#invest-modal {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

#invest-modal .modal {
  max-height: 90vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

#invest-wizard-form {
  overflow-y: auto !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  -webkit-overflow-scrolling: touch;
}

#invest-wizard-form::-webkit-scrollbar {
  width: 6px;
}
#invest-wizard-form::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.03);
}
#invest-wizard-form::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
#invest-wizard-form::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.invest-wizard-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-6);
  background: var(--color-surface-sunken);
  border-bottom: 1px solid var(--color-border);
  gap: var(--space-2);
  overflow-x: auto;
}

.wizard-step-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.wizard-step-badge.active {
  background: var(--color-primary);
  color: white;
}

.wizard-step-badge.completed {
  background: #ecfdf5;
  color: #047857;
}

.wizard-step-arrow {
  color: var(--color-border);
  font-size: 14px;
}

/* Quick Amount Chips */
.invest-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
  margin-bottom: var(--space-4);
}

.quick-chip-btn {
  background: var(--color-surface-sunken);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quick-chip-btn:hover {
  background: var(--color-primary-50);
  border-color: var(--color-primary-light);
  color: var(--color-primary);
}

/* Review Box */
.invest-review-box {
  background: var(--color-surface-sunken);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}

.invest-review-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-sm);
}

.invest-review-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.invest-review-lbl {
  color: var(--color-text-muted);
}

.invest-review-val {
  font-weight: 700;
  color: var(--color-text-primary);
}

/* Terms Covenant Box */
.invest-terms-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
  max-height: 200px;
  overflow-y: auto;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}

/* Investment Recorded Receipt */
.invest-receipt-box {
  text-align: center;
  padding: var(--space-6) var(--space-4);
}

.invest-receipt-icon {
  width: 64px;
  height: 64px;
  background: #ecfdf5;
  color: #059669;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: var(--space-4);
  box-shadow: 0 0 0 8px rgba(16,185,129,0.1);
}

.receipt-ref-badge {
  display: inline-block;
  background: var(--color-primary-50);
  color: var(--color-primary);
  border: 1px solid var(--color-primary-100);
  border-radius: var(--radius-md);
  padding: 6px 14px;
  font-family: monospace;
  font-size: var(--text-sm);
  font-weight: 700;
  margin-top: var(--space-2);
  margin-bottom: var(--space-4);
}

/* Executive Portfolio KPI Grid */
.portfolio-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

@media (max-width: 960px) {
  .portfolio-kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .portfolio-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.portfolio-kpi-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.portfolio-kpi-lbl {
  font-size: var(--text-xs);
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-1);
}

.portfolio-kpi-val {
  font-size: var(--text-2xl);
  font-weight: 900;
  color: var(--color-text-primary);
}

.portfolio-kpi-sub {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* ── Portfolio Header & Actions ────────────────────────────── */
.portfolio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.portfolio-header-content {
  flex: 1;
  min-width: 260px;
}

.portfolio-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* 6-KPI Grid Extension */
.portfolio-kpi-grid.six-col {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

@media (max-width: 1399px) and (min-width: 861px) {
  .portfolio-kpi-grid.six-col {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
  }
}

@media (max-width: 860px) {
  .portfolio-kpi-grid.six-col {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
  }
}

@media (max-width: 520px) {
  .portfolio-kpi-grid.six-col {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
  }
  .portfolio-kpi-card {
    padding: var(--space-3) !important;
  }
  .portfolio-kpi-lbl {
    font-size: 10px !important;
  }
  .portfolio-kpi-val {
    font-size: clamp(1rem, 3.8vw, 1.25rem) !important;
    word-break: break-word;
  }
  .portfolio-kpi-sub {
    font-size: 10px !important;
  }
}

/* Portfolio Nav Tabs */
.portfolio-nav-tabs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.portfolio-nav-tabs::-webkit-scrollbar {
  display: none;
}

.portfolio-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 12px 18px;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all var(--transition-fast);
  margin-bottom: -2px;
}

.portfolio-tab-btn:hover {
  color: var(--color-primary);
}

.portfolio-tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-accent);
}

.portfolio-tab-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--color-surface-sunken);
  color: var(--color-text-muted);
  font-weight: 700;
}

.portfolio-tab-btn.active .portfolio-tab-badge {
  background: var(--color-primary-50);
  color: var(--color-primary);
}

/* Duration Progress Bar */
.portfolio-tenor-wrap {
  width: 100%;
  min-width: 110px;
}

.portfolio-tenor-bar {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 4px;
}

.portfolio-tenor-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: var(--radius-full);
}

.portfolio-tenor-fill.completed {
  background: #3b82f6;
}

/* Status Badges */
.badge-active-pulse {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-active-dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.badge-completed-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Documents Modal & List */
.portfolio-doc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-lg);
  font-size: 12px;
  font-weight: 600;
  background: white;
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.portfolio-doc-btn:hover {
  background: var(--color-surface-sunken);
  border-color: var(--color-primary-light);
  color: var(--color-primary);
}

.doc-list-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.doc-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-sunken);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
  gap: var(--space-3);
}

.doc-item-row:hover {
  background: white;
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-sm);
}

.doc-item-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.doc-item-icon {
  width: 40px;
  height: 40px;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.doc-item-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text-primary);
}

.doc-item-meta {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* ── Portfolio Mobile Cards & Responsive Layout ─────────────── */
.portfolio-mobile-cards,
.history-mobile-cards {
  display: none;
  flex-direction: column;
  gap: var(--space-3);
}

.portfolio-mobile-card {
  background: var(--color-white, #fff);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: all var(--transition-fast);
}

.portfolio-mobile-card:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-md);
}

.pmc-header {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.pmc-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--color-border);
}

.pmc-info {
  flex: 1;
  min-width: 0;
}

.pmc-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: 4px;
}

.pmc-ref {
  font-size: 10px;
  font-family: monospace;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pmc-title {
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 2px 0;
  word-break: break-word;
}

.pmc-title a {
  color: var(--color-primary);
  text-decoration: none;
}

.pmc-loc {
  font-size: 11px;
  color: var(--color-text-secondary);
}

.pmc-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  background: var(--color-surface-sunken, #f8fafc);
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.pmc-stat-box {
  min-width: 0;
}

.pmc-stat-lbl {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.pmc-stat-val {
  font-size: var(--text-sm);
  font-weight: 800;
  margin-top: 2px;
  line-height: 1.2;
}

.pmc-stat-val.primary { color: var(--color-primary); }
.pmc-stat-val.success { color: var(--color-success); }

.pmc-stat-sub {
  font-size: 10px;
  color: var(--color-text-muted);
  margin-top: 2px;
  word-break: break-word;
}

.pmc-stat-sub.success { color: #047857; font-weight: 600; }

.pmc-tenor-box {
  background: var(--color-gray-50, #f8fafc);
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.pmc-tenor-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.pmc-date-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.pmc-actions-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border);
}

.pmc-actions-footer .btn {
  flex: 1;
  justify-content: center;
  min-height: 38px;
  font-size: 12px;
}

/* History Mobile Card */
.history-mobile-card {
  background: var(--color-white, #fff);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: all var(--transition-fast);
}

.hmc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.hmc-ref {
  font-size: 10px;
  font-family: monospace;
  color: var(--color-text-muted);
  margin-left: var(--space-2);
}

.hmc-time {
  font-size: 11px;
  color: var(--color-text-muted);
}

.hmc-project {
  font-size: var(--text-sm);
  line-height: 1.35;
}

.hmc-desc {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.hmc-amount-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3);
  background: var(--color-surface-sunken, #f8fafc);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.hmc-stat-lbl {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 600;
}

.hmc-amount {
  font-size: var(--text-base);
  font-weight: 800;
  margin-top: 2px;
}

.hmc-amount.debit { color: #dc2626; }
.hmc-amount.credit { color: #16a34a; }

.hmc-bal {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-top: 2px;
}

.hmc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border);
  gap: var(--space-2);
}

.hmc-date {
  font-size: 11px;
  color: var(--color-text-muted);
}

.hmc-cert-btn {
  white-space: nowrap;
}

/* Portfolio Distribution Responsive Classes */
.portfolio-dist-card {
  padding: var(--space-6);
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.portfolio-dist-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.portfolio-dual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
}

.portfolio-dual-box {
  background: #f8fafc;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0,0,0,0.06);
}

/* Breakpoint for Switching Table to Mobile Cards */
@media (max-width: 768px) {
  .portfolio-header {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }

  .portfolio-header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
  }

  .portfolio-header-actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 40px;
    font-size: var(--text-xs);
  }

  .portfolio-dist-card {
    padding: var(--space-4);
  }

  .portfolio-dual-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .portfolio-desktop-table,
  .history-desktop-table {
    display: none !important;
  }

  .portfolio-mobile-cards,
  .history-mobile-cards {
    display: flex !important;
  }

  #portfolio-docs-modal .modal {
    margin: var(--space-3);
    max-width: calc(100% - var(--space-6));
    max-height: 90vh;
    border-radius: var(--radius-xl);
  }

  .doc-item-row {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
  }

  .doc-item-row .btn {
    width: 100%;
    justify-content: center;
    min-height: 38px;
  }
}

@media (max-width: 480px) {
  .portfolio-header-actions {
    grid-template-columns: 1fr 1fr;
  }
  .portfolio-dist-card {
    padding: var(--space-3);
  }
  .portfolio-dual-box {
    padding: var(--space-3);
  }
}

/* ── Custom Confirmation Dialog System ──────────────────────── */
.confirm-dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.confirm-dialog-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.confirm-dialog-card {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl, 16px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 440px;
  padding: var(--space-6);
  text-align: center;
  transform: translateY(16px) scale(0.96);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.confirm-dialog-backdrop.open .confirm-dialog-card {
  transform: translateY(0) scale(1);
}

.confirm-dialog-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
  font-size: 24px;
}

.confirm-dialog-icon.danger {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FECACA;
}

.confirm-dialog-icon.warning {
  background: #FFFBEB;
  color: #D97706;
  border: 1px solid #FDE68A;
}

.confirm-dialog-icon.info {
  background: #EFF6FF;
  color: #2563EB;
  border: 1px solid #BFDBFE;
}

.confirm-dialog-icon.success,
.confirm-dialog-icon.primary {
  background: #ECFDF5;
  color: #059669;
  border: 1px solid #A7F3D0;
}

.confirm-dialog-title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
  line-height: var(--leading-tight);
}

.confirm-dialog-message {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed, 1.6);
  margin-bottom: var(--space-6);
  word-break: break-word;
}

.confirm-dialog-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
}

.confirm-dialog-actions .btn {
  flex: 1;
  justify-content: center;
  font-weight: var(--font-semibold);
  padding-block: var(--space-3);
}

[data-theme="dark"] .confirm-dialog-card {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

[data-theme="dark"] .confirm-dialog-title {
  color: #f8fafc;
}

[data-theme="dark"] .confirm-dialog-message {
  color: #94a3b8;
}

[data-theme="dark"] .confirm-dialog-icon.danger {
  background: rgba(220, 38, 38, 0.2);
  border-color: rgba(220, 38, 38, 0.4);
}

[data-theme="dark"] .confirm-dialog-icon.warning {
  background: rgba(217, 119, 6, 0.2);
  border-color: rgba(217, 119, 6, 0.4);
}

[data-theme="dark"] .confirm-dialog-icon.info {
  background: rgba(37, 99, 235, 0.2);
  border-color: rgba(37, 99, 235, 0.4);
}

[data-theme="dark"] .confirm-dialog-icon.primary {
  background: rgba(5, 150, 105, 0.2);
  border-color: rgba(5, 150, 105, 0.4);
}

/* ── Skeleton Loading System ────────────────────────────────── */
.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  border-radius: 4px;
  width: 100%;
}

.skeleton-text-sm {
  height: 11px;
  margin-bottom: 6px;
  border-radius: 4px;
  width: 65%;
}

.skeleton-text-lg {
  height: 18px;
  margin-bottom: 10px;
  border-radius: 6px;
  width: 85%;
}

.skeleton-title {
  height: 24px;
  margin-bottom: 12px;
  border-radius: 6px;
  width: 55%;
}

.skeleton-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-badge {
  width: 70px;
  height: 22px;
  border-radius: 9999px;
  display: inline-block;
}

.skeleton-btn {
  width: 110px;
  height: 38px;
  border-radius: var(--radius-md, 8px);
  display: inline-block;
}

.skeleton-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-md, 8px);
}

.skeleton-card {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl, 12px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.skeleton-card-body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.skeleton-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-3, 12px);
  padding: var(--space-3, 12px);
  border-bottom: 1px solid var(--color-border);
}

.skeleton-list-item:last-child {
  border-bottom: none;
}

.skeleton-table-row {
  display: flex;
  align-items: center;
  gap: var(--space-4, 16px);
  padding: var(--space-4, 16px);
  border-bottom: 1px solid var(--color-border);
}