/* ==========================================================================
   IBN — IMPERIAL BUSINESS NETWORK
   PHASE 2 DESIGN SYSTEM: MEMBER SEARCH, SEARCH RESULTS, PUBLIC MEMBER PROFILE
   ========================================================================== */

:root {
  --ibn-navy: #071224;
  --ibn-navy-dark: #050d1a;
  --ibn-navy-card: #0e1f38;
  --ibn-gold: #c59b27;
  --ibn-gold-hover: #b48a1c;
  --ibn-gold-light: #fef3c7;
  --ibn-gold-border: rgba(197, 155, 39, 0.35);
  --ibn-bg-page: #f8fafc;
  --ibn-surface: #ffffff;
  --ibn-border: #e2e8f0;
  --ibn-text-main: #0f172a;
  --ibn-text-muted: #64748b;
  --ibn-text-light: #94a3b8;
  --ibn-success: #10b981;
  --ibn-blue-accent: #2563eb;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.08);
}

/* Base resets for phase 2 portal and governance consoles */
body.portal-active,
body.director-active,
body.president-active,
body.admin-active {
  display: block !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  min-height: 100vh !important;
  background-color: var(--ibn-bg-page) !important;
}

#app-portal-section {
  width: 100%;
  min-height: 100vh;
  background-color: var(--ibn-bg-page);
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   1. PORTAL HEADER (UNIFIED IBN NAVIGATION)
   ========================================================================== */
.portal-header {
  background: #ffffff;
  border-bottom: 1px solid var(--ibn-border);
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.portal-header-inner {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.portal-brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--ibn-navy);
  padding: 8px 18px;
  border-radius: var(--radius-md);
  color: #ffffff;
  cursor: pointer;
  text-decoration: none;
}

.portal-brand-crown {
  width: 22px;
  height: 18px;
  display: flex;
  align-items: center;
}

.portal-brand-crown svg {
  width: 100%;
  height: 100%;
}

.portal-brand-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff;
}

/* Navigation Links */
.portal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 20px;
}

.portal-nav-link {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  border-radius: 20px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.portal-nav-link:hover {
  color: var(--ibn-navy);
  background: #f1f5f9;
}

.portal-nav-link.active {
  color: var(--ibn-navy);
  background: #fef9c3;
  font-weight: 700;
}

.portal-nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 16px;
  right: 16px;
  height: 3px;
  background: var(--ibn-gold);
  border-radius: 2px;
}

/* Header User Controls */
.portal-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-icon-action {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f8fafc;
  border: 1px solid var(--ibn-border);
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.header-icon-action:hover {
  background: #f1f5f9;
  color: var(--ibn-navy);
}

.header-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #ffffff;
}

.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  border-radius: 30px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  position: relative;
}

.user-profile-menu:hover {
  background: #f8fafc;
  border-color: var(--ibn-border);
}

.user-nav-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--ibn-navy);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid var(--ibn-gold);
}

.user-nav-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ibn-navy);
}

.user-nav-chevron {
  font-size: 11px;
  color: #94a3b8;
}

/* User Dropdown */
.profile-dropdown-content {
  position: absolute;
  top: 50px;
  right: 0;
  width: 210px;
  background: #ffffff;
  border: 1px solid var(--ibn-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px 0;
  display: none;
  z-index: 1000;
}

.profile-dropdown-content.show {
  display: block;
}

.dropdown-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13.5px;
  color: #334155;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dropdown-link:hover {
  background: #f8fafc;
  color: var(--ibn-navy);
}

.dropdown-divider {
  height: 1px;
  background: var(--ibn-border);
  margin: 6px 0;
}

/* ==========================================================================
   2. MAIN PORTAL CONTAINER
   ========================================================================== */
.portal-main-content {
  max-width: 1380px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 24px 60px;
  flex: 1;
}

/* View switching - Strict Isolation Between Dedicated Pages */
.portal-view {
  display: none !important;
}

.portal-view.active {
  display: block !important;
}

/* ==========================================================================
   3. GLOBAL WORLD MAP BACKGROUND
      Applied across:
      - Find Members (#view-member-search)
      - Chapters Directory (#view-chapters)
      - Ask & Referrals (#view-ask-referrals)
      - Messages / Inbox (#view-messages)
      - Events & Conclaves (#view-events)
      - Notifications Panel (#view-notifications)
   ========================================================================== */
.portal-main-content:has(#view-member-search.active),
.portal-main-content:has(#view-chapters.active),
.portal-main-content:has(#view-ask-referrals.active),
.portal-main-content:has(#view-messages.active),
.portal-main-content:has(#view-events.active),
.portal-main-content:has(#view-notifications.active),
body.world-map-bg-active .portal-main-content,
body.find-members-active .portal-main-content {
  max-width: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

#view-member-search,
#view-chapters,
#view-ask-referrals,
#view-messages,
#view-events,
#view-notifications {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 64px);
  background-color: #f0f7ff;
  background-image: url('/assets/world-map-bg.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  box-sizing: border-box;
  padding: 32px 24px 60px;
}

/* Ensure inner contents are cleanly centered within standard widths */
#view-member-search > * {
  max-width: 1380px;
  margin-left: auto;
  margin-right: auto;
}

#view-chapters > *,
#view-events > * {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

#view-ask-referrals > *,
#view-messages > * {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}

#view-notifications > * {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 768px) {
  #view-member-search,
  #view-chapters,
  #view-ask-referrals,
  #view-messages,
  #view-events,
  #view-notifications {
    padding: 20px 14px 40px;
    background-attachment: scroll;
  }
}

.search-hero {
  margin-bottom: 24px;
}

.search-page-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--ibn-navy);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.75);
}

.search-page-subtitle {
  font-size: 15px;
  color: #334155;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
}

/* Prominent Search Bar */
.search-bar-wrapper {
  display: flex;
  gap: 12px;
  background: #ffffff;
  padding: 8px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--ibn-border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}

.search-input-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
}

.search-icon {
  color: #94a3b8;
  font-size: 16px;
}

.main-search-input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: inherit;
  color: var(--ibn-text-main);
  background: transparent;
}

.main-search-input::placeholder {
  color: #94a3b8;
}

.search-btn-gold {
  background: var(--ibn-gold);
  color: #ffffff;
  border: none;
  padding: 12px 32px;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-btn-gold:hover {
  background: var(--ibn-gold-hover);
  box-shadow: 0 4px 12px rgba(197, 155, 39, 0.3);
}

.filter-toggle-btn {
  background: #ffffff;
  border: 1px solid var(--ibn-border);
  color: #334155;
  padding: 12px 22px;
  font-size: 14.5px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-toggle-btn:hover,
.filter-toggle-btn.active {
  background: #f8fafc;
  border-color: var(--ibn-gold);
  color: var(--ibn-navy);
}

/* Expandable Filter Panel (Drawer Card - NO permanent sidebar!) */
.filter-drawer-card {
  background: #ffffff;
  border: 1px solid var(--ibn-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
  display: none;
  animation: slideDown 0.25s ease-out;
}

.filter-drawer-card.show {
  display: block;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.filter-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ibn-navy);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.filter-select,
.filter-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--ibn-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--ibn-text-main);
  background: #ffffff;
  outline: none;
  transition: border-color 0.2s ease;
}

.filter-select:focus,
.filter-input:focus {
  border-color: var(--ibn-gold);
  box-shadow: 0 0 0 3px rgba(197, 155, 39, 0.15);
}

.filter-actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid #f1f5f9;
  padding-top: 16px;
}

.btn-filter-clear {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 9px 20px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-filter-clear:hover {
  background: #f1f5f9;
  color: var(--ibn-navy);
}

.btn-filter-apply {
  background: var(--ibn-navy);
  color: #ffffff;
  border: none;
  padding: 9px 24px;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-filter-apply:hover {
  background: #112240;
}

/* Active Filter Badges Bar */
.active-pills-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.active-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ibn-navy);
}

.active-pill-remove {
  cursor: pointer;
  color: #94a3b8;
  font-size: 12px;
}

.active-pill-remove:hover {
  color: #ef4444;
}

/* ==========================================================================
   4. PAGE 3: SEARCH RESULTS
   ========================================================================== */
.results-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
}

.results-count-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--ibn-navy);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.7);
}

.results-controls-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sort-dropdown-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: #1e293b;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
}

.sort-select {
  border: 1px solid var(--ibn-border);
  background: #ffffff;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--ibn-navy);
  outline: none;
}

.view-toggle-group {
  display: flex;
  border: 1px solid var(--ibn-border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  overflow: hidden;
}

.view-toggle-btn {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.view-toggle-btn.active {
  background: var(--ibn-navy);
  color: #ffffff;
}

/* Table / List View (Full Width) */
.results-table-card {
  background: #ffffff;
  border: 1px solid var(--ibn-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 24px;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.results-table th {
  background: #f8fafc;
  padding: 14px 18px;
  font-size: 12.5px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--ibn-border);
}

.results-table td {
  padding: 16px 18px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  font-size: 14px;
  color: #334155;
}

.results-table tr:hover td {
  background: #fafcff;
}

/* Member Column */
.table-member-cell {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 220px;
}

.member-row-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: #e2e8f0;
  color: #475569;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.member-row-info {
  display: flex;
  flex-direction: column;
}

.member-row-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ibn-blue-accent);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s ease;
}

.member-row-name:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.member-row-title {
  font-size: 12.5px;
  color: var(--ibn-text-muted);
  margin-top: 2px;
}

/* Ask Pill in Search Results */
.ask-pill-box {
  display: inline-block;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  line-height: 1.4;
  font-weight: 500;
  max-width: 320px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.ask-pill-box:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.ask-pill-blue {
  background: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
}

.ask-pill-green {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}

.ask-pill-yellow {
  background: #fefce8;
  color: #854d0e;
  border-color: #fef08a;
}

.ask-pill-purple {
  background: #faf5ff;
  color: #6b21a8;
  border-color: #e9d5ff;
}

/* Action buttons in row */
.table-actions-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.action-btn-circle {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--ibn-border);
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 13px;
}

.action-btn-circle:hover {
  background: #f8fafc;
  color: var(--ibn-navy);
  border-color: var(--ibn-gold);
}

.action-btn-connect {
  background: #ffffff;
  border: 1px solid var(--ibn-border);
  color: var(--ibn-navy);
  font-weight: 700;
}

.action-btn-connect:hover {
  background: var(--ibn-gold);
  color: #ffffff;
  border-color: var(--ibn-gold);
}

/* Card View Grid */
.results-card-grid {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.results-card-grid.show {
  display: grid;
}

.member-result-card {
  background: #ffffff;
  border: 1px solid var(--ibn-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.member-result-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-top-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.card-details-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #475569;
  margin-bottom: 14px;
}

.card-detail-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-ask-section {
  margin-bottom: 16px;
}

.card-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

/* Pagination Bar */
.pagination-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  font-size: 13.5px;
  color: var(--ibn-text-muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination-btn {
  min-width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ibn-border);
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.pagination-btn:hover {
  background: #f8fafc;
  border-color: var(--ibn-gold);
}

.pagination-btn.active {
  background: var(--ibn-navy);
  color: #ffffff;
  border-color: var(--ibn-navy);
}

/* ==========================================================================
   5. PAGE 4: PUBLIC MEMBER PROFILE
   ========================================================================== */
.profile-breadcrumb-bar {
  margin-bottom: 20px;
}

.btn-back-results {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--ibn-navy);
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.btn-back-results:hover {
  background: #e2e8f0;
}

.profile-layout-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 28px;
  align-items: start;
}

/* Left Profile Card */
.profile-sidebar-card {
  background: #ffffff;
  border: 1px solid var(--ibn-border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.profile-large-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--ibn-navy);
  color: #ffffff;
  font-size: 38px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border: 4px solid #ffffff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}

.profile-full-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--ibn-navy);
  margin-bottom: 4px;
}

.profile-job-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ibn-text-muted);
  margin-bottom: 2px;
}

.profile-company-name {
  font-size: 13.5px;
  color: #475569;
  margin-bottom: 14px;
}

.profile-badges-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.profile-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
}

.badge-ibn-member {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fef08a;
}

.badge-tenure {
  background: #f1f5f9;
  color: #475569;
}

.badge-msp {
  background: #dbeafe;
  color: #1e40af;
}

.profile-actions-vertical {
  width: 100%;
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}

.btn-profile-connect {
  flex: 1;
  background: var(--ibn-gold);
  color: #ffffff;
  border: none;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-profile-connect:hover {
  background: var(--ibn-gold-hover);
}

.btn-profile-message {
  flex: 1;
  background: #ffffff;
  border: 1px solid var(--ibn-border);
  color: var(--ibn-navy);
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-profile-message:hover {
  background: #f8fafc;
  border-color: var(--ibn-navy);
}

.profile-meta-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  border-top: 1px solid #f1f5f9;
  padding-top: 20px;
}

.meta-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: #475569;
}

.meta-icon {
  color: var(--ibn-gold);
  margin-top: 3px;
  width: 16px;
  text-align: center;
}

/* Right Content Area */
.profile-main-area {
  background: #ffffff;
  border: 1px solid var(--ibn-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* Profile Navigation Tabs */
.profile-tabs-header {
  display: flex;
  border-bottom: 1px solid var(--ibn-border);
  background: #fafbfc;
  padding: 0 16px;
  overflow-x: auto;
}

.profile-tab-item {
  padding: 16px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.profile-tab-item:hover {
  color: var(--ibn-navy);
}

.profile-tab-item.active {
  color: var(--ibn-navy);
  font-weight: 700;
}

.profile-tab-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20px;
  right: 20px;
  height: 3px;
  background: var(--ibn-gold);
  border-radius: 3px 3px 0 0;
}

/* Profile Tab Content Area */
.profile-tab-pane {
  display: none;
  padding: 28px;
}

.profile-tab-pane.active {
  display: block;
}

/* Current Ask Highlight Card */
.current-ask-card {
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  position: relative;
}

.ask-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.ask-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #2563eb;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.ask-card-title {
  font-size: 17px;
  font-weight: 800;
  color: #1e3a8a;
}

.ask-card-body {
  font-size: 15px;
  line-height: 1.5;
  color: #1e293b;
  margin-bottom: 16px;
  font-weight: 500;
}

.btn-can-help-action {
  background: var(--ibn-navy);
  color: #ffffff;
  border: none;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-can-help-action:hover {
  background: #112240;
  box-shadow: 0 4px 12px rgba(7, 18, 36, 0.2);
}

/* About & Contact Cards */
.profile-overview-split {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
}

.content-section-card {
  border: 1px solid var(--ibn-border);
  border-radius: var(--radius-md);
  padding: 20px;
  background: #ffffff;
}

.section-card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--ibn-navy);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.contact-info-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: #334155;
}

.contact-info-icon {
  color: var(--ibn-blue-accent);
  width: 18px;
  text-align: center;
}

/* ==========================================================================
   6. MODALS & POPUPS (CONNECT, REFERRAL, MESSAGE)
   ========================================================================== */
.ibn-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 18, 36, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.ibn-modal-overlay.show {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ibn-modal-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
  overflow: hidden;
  animation: scaleUp 0.2s ease-out;
}

@keyframes scaleUp {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header-bar {
  padding: 20px 24px;
  background: var(--ibn-navy);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-text {
  font-size: 18px;
  font-weight: 800;
}

.modal-close-icon {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 20px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.modal-close-icon:hover {
  color: #ffffff;
}

.modal-body-content {
  padding: 24px;
}

.modal-target-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  border: 1px solid var(--ibn-border);
}

.modal-target-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.modal-footer-actions {
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1px solid var(--ibn-border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Toast Notice */
.ibn-toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ibn-navy);
  color: #ffffff;
  padding: 14px 22px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 2000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ibn-toast-notice.show {
  transform: translateY(0);
  opacity: 1;
}

.ibn-toast-notice.toast-success {
  border-left: 4px solid var(--ibn-success);
}

.ibn-toast-notice.toast-error {
  border-left: 4px solid #ef4444;
}

/* ==========================================================================
   IBN EXECUTIVE AUDIO CALL MODAL STYLES
   ========================================================================== */
.call-ctrl-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.call-ctrl-btn span {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
}
.call-ctrl-btn:hover {
  background: #e2e8f0;
  color: var(--ibn-navy);
  transform: translateY(-2px);
}
.call-ctrl-btn.active {
  background: #fef08a;
  color: #854d0e;
  border-color: #facc15;
}
.call-ctrl-btn.end-call {
  width: 66px;
  height: 66px;
  background: #ef4444;
  border-color: #dc2626;
  color: #ffffff;
  font-size: 20px;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}
.call-ctrl-btn.end-call:hover {
  background: #dc2626;
  transform: scale(1.05);
}
@keyframes callPulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(0.95); opacity: 0; }
}
.call-pulse-ring {
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border-radius: 50%;
  border: 2px solid #e5b842;
  animation: callPulse 1.8s infinite;
  z-index: 1;
}

/* ==========================================================================
   7. RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 1024px) {
  .filter-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .profile-layout-grid {
    grid-template-columns: 1fr;
  }
  .profile-overview-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .portal-nav {
    display: none;
  }
  .filter-grid {
    grid-template-columns: 1fr;
  }
  .search-bar-wrapper {
    flex-direction: column;
  }
  .results-table-card {
    display: none;
  }
  .results-card-grid {
    display: grid !important;
  }
  .portal-main-content {
    padding: 16px 14px 40px;
  }
}


/* ==========================================================================
   8. MODERN SAAS MY REFERRALS EXECUTIVE DASHBOARD (8-KPI CARDS & ACTIVITY)
   ========================================================================== */
.ref-dashboard-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 10px;
}

.ref-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.ref-kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.ref-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
}

.ref-kpi-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ref-kpi-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.ref-kpi-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.ref-kpi-value {
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  margin-bottom: 4px;
}

.ref-kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Card Specific Themes */
.ref-kpi-total .ref-kpi-icon-wrap { background: #eff6ff; color: #2563eb; }
.ref-kpi-given .ref-kpi-icon-wrap { background: #fef3c7; color: #d97706; }
.ref-kpi-received .ref-kpi-icon-wrap { background: #f0fdf4; color: #16a34a; }
.ref-kpi-completed .ref-kpi-icon-wrap { background: #ecfdf5; color: #059669; }
.ref-kpi-inprogress .ref-kpi-icon-wrap { background: #e0e7ff; color: #4f46e5; }
.ref-kpi-pending .ref-kpi-icon-wrap { background: #fff7ed; color: #ea580c; }
.ref-kpi-business .ref-kpi-icon-wrap { background: #f0fdf4; color: #10b981; }
.ref-kpi-opportunity .ref-kpi-icon-wrap { background: #f0f9ff; color: #0284c7; }

.ref-kpi-business .ref-kpi-value { color: #059669; }
.ref-kpi-opportunity .ref-kpi-value { color: #0284c7; }

/* Financial Separation Notice */
.ref-finance-notice {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Redesigned Referral Activity Section */
.ref-activity-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.ref-activity-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: #f8fafc;
}

.ref-direction-tabs {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ref-dir-tab-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ref-dir-tab-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.ref-dir-tab-btn.active {
  background: #071224;
  color: #ffffff;
  border-color: #071224;
  box-shadow: 0 2px 4px rgba(7, 18, 36, 0.2);
}

.ref-filter-pills {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.ref-pill-btn {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ref-pill-btn:hover {
  border-color: #cbd5e1;
  color: #0f172a;
}

.ref-pill-btn.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.ref-list-container {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Empty State */
.ref-empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #64748b;
}

.ref-empty-icon {
  font-size: 40px;
  color: #cbd5e1;
  margin-bottom: 14px;
}

.ref-empty-title {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 6px;
}

.ref-empty-text {
  font-size: 13.5px;
  color: #64748b;
  max-width: 440px;
  margin: 0 auto 18px;
  line-height: 1.5;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .ref-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .ref-kpi-grid {
    grid-template-columns: 1fr;
  }
  .ref-activity-header {
    flex-direction: column;
    align-items: stretch;
  }
  .ref-direction-tabs {
    flex-direction: column;
  }
  .ref-dir-tab-btn {
    width: 100%;
    justify-content: center;
  }
}
