/* ========================
   FinDeals - Additions for API-wired screens
   Small, targeted rules for markup added while wiring
   My Loans, Boost Post, and Chats to the backend APIs.
   Kept separate from style.css so the base stylesheet stays untouched.
======================== */

/* My Loans: status labels */
.myloan-status-label.is-promoted {
  color: var(--primary);
}
.myloan-status-label.is-draft {
  color: #f59e0b;
}
.myloan-status-label.is-pendingapproval {
  color: #3b82f6;
}
.myloan-status-label.is-cancelled {
  color: #9ca3af;
}

/* Browse: Near By quick button */
.browse-nearby-quick-btn {
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  border-color: #6a38ff;
  color: #6a38ff;
  background: rgba(106, 56, 255, 0.04);
  transition: all 0.2s ease;
  white-space: nowrap;
}
.browse-nearby-quick-btn:hover,
.browse-nearby-quick-btn.active {
  background: #6a38ff;
  color: #ffffff;
  border-color: #6a38ff;
}

/* Public Profile Hero Top Responsiveness */
.public-profile-hero-top {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 0.75rem !important;
  margin-bottom: 1.25rem !important;
}

.public-profile-hero-top .profile-hero-title {
  text-align: left !important;
  font-size: 1.2rem;
}

@media (max-width: 576px) {
  .public-profile-hero-top {
    gap: 0.5rem !important;
    margin-bottom: 1rem !important;
  }

  .public-profile-hero-top .profile-hero-title {
    font-size: 1.05rem !important;
  }

  .public-profile-hero-top .btn {
    font-size: 0.8rem !important;
    padding: 0.25rem 0.65rem !important;
  }
}

/* Boost Post: selectable tier cards */
.boost-highlight-card {
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.boost-highlight-card.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(106, 56, 255, .15);
}

/* ============================================================================
   FinDeals - Complete Synchronized Chat System Styling
   ============================================================================ */

/* Chat layout sizing & viewport lock */
.chats-app-main {
  height: calc(100vh - 74px);
  height: calc(100dvh - 74px);
  max-height: calc(100vh - 74px);
  max-height: calc(100dvh - 74px);
  padding: 0;
  margin: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #f8f7fc;
}

body:has(.chats-app-main) .site-footer,
body:has(.chats-app-main) footer {
  display: none !important;
}

.chats-app-shell {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  background: #ffffff;
  border-top: 1px solid #e9e5f5;
  overflow: hidden;
}

/* Sidebar styling */
.chats-sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: #faf9fd;
  border-right: 1px solid #ece8f7;
  overflow: hidden;
}

.chats-sidebar .chats-toolbar {
  padding: 1.1rem 1.25rem 0.5rem;
  margin-bottom: 0.25rem;
  flex-shrink: 0;
}

.chats-sidebar .chats-toolbar h1 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #1f1845;
  margin: 0;
  letter-spacing: -0.02em;
}

.chats-sidebar .chats-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 1rem 0.65rem;
  margin: 0;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.chats-sidebar .chats-tabs::-webkit-scrollbar {
  display: none;
}

.chats-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  border: 1px solid #e4def5;
  background: #ffffff;
  color: #554a7c;
  font-weight: 600;
  font-size: 0.78rem;
  white-space: nowrap;
  transition: all 0.2s ease;
  cursor: pointer;
}

.chats-tab:hover {
  background: #f1edfc;
  color: #6a38ff;
  border-color: #d6cbfa;
}

.chats-tab.is-active {
  background: #6a38ff !important;
  border-color: #6a38ff !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(106, 56, 255, 0.24);
}

.chats-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  padding: 0 4px;
  background: rgba(0, 0, 0, 0.07);
  font-size: 0.68rem;
  font-weight: 700;
}

.chats-tab.is-active .chats-tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.chats-search {
  position: relative;
  padding: 0 1rem 0.75rem;
  margin: 0;
  flex-shrink: 0;
}

.chats-search > i {
  position: absolute;
  left: 1.85rem;
  top: 40%;
  transform: translateY(-50%);
  color: #9a93b8;
  font-size: 0.95rem;
  pointer-events: none;
}

.chats-search .form-control {
  border-radius: 12px;
  border: 1px solid #e4def5;
  background: #ffffff;
  padding: 0.55rem 0.85rem 0.55rem 2.35rem;
  font-size: 0.85rem;
  height: 42px;
  box-shadow: none;
  transition: all 0.2s ease;
}

.chats-search .form-control:focus {
  border-color: #6a38ff;
  box-shadow: 0 0 0 3px rgba(106, 56, 255, 0.12);
}

.chats-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

/* Chat Card in sidebar */
.chats-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #ebe6f8;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
  width: 100%;
}

.chats-card:hover {
  background: #f5f2ff;
  border-color: #d8cefb;
  transform: translateY(-1px);
}

.chats-card.is-active {
  background: #ede8ff !important;
  border-color: #b7a3fc !important;
  box-shadow: 0 4px 14px rgba(106, 56, 255, 0.12);
}

.chats-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.chats-card-body {
  min-width: 0;
  overflow: hidden;
}

.chats-card-top {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.15rem;
}

.chats-masked-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1f1845;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chats-tag {
  font-size: 0.64rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.chats-tag.is-borrowing {
  background: #efeaff;
  color: #6a38ff;
}

.chats-tag.is-lending {
  background: #fce7f3;
  color: #be185d;
}

.chats-last-msg {
  margin: 0;
  font-size: 0.78rem;
  color: #6e678a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chats-card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  min-width: 50px;
}

.chats-card-meta time {
  font-size: 0.68rem;
  color: #928ca9;
  white-space: nowrap;
}

.chats-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  padding: 0 4px;
  background: #6a38ff;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
}

/* Conversation Area */
.chats-conversation {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  min-width: 0;
  background: #ffffff;
  position: relative;
  overflow: hidden;
}

.chat-detail-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  background: #ffffff;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

/* Conversation Topbar */
.chat-detail-topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: #ffffff;
  border-bottom: 1px solid #ece7f8;
  flex-shrink: 0;
  color: #1f1845;
}

.chat-peer-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6a38ff 0%, #a855f7 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(106, 56, 255, 0.2);
}

.chat-peer-meta {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.chat-peer-meta strong {
  display: flex;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1f1845;
  min-width: 0;
  overflow: hidden;
}

.chat-peer-meta strong span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.chat-peer-online {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #16a34a;
}

.online-pulse {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.25);
}

.chat-top-loan {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: #f1edfc;
  color: #6a38ff;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #ded6fa;
  transition: all 0.18s ease;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-top-loan:hover {
  background: #6a38ff;
  color: #ffffff;
  border-color: #6a38ff;
}

.chat-more-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #e4def5;
  background: #ffffff;
  color: #554a7c;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.chat-more-btn:hover {
  background: #f3f0fc;
  color: #6a38ff;
}

.chat-more-menu .dropdown-menu {
  min-width: 180px;
  border-radius: 12px;
  border: none;
  box-shadow: 0 12px 32px rgba(60, 40, 120, .16);
  padding: .4rem;
}

.chat-more-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  border-radius: 8px;
  font-size: .85rem;
  padding: .5rem .6rem;
}

.chat-blocked-banner {
  margin: .7rem 1rem 0;
  display: flex;
  align-items: center;
  gap: .45rem;
  background: #fdeaea;
  color: #a12626;
  border-radius: 10px;
  padding: .55rem .75rem;
  font-size: .76rem;
  font-weight: 600;
}

.chat-blocked-banner i {
  color: #d92d2d;
}

.chat-secure-banner {
  margin: 0.5rem 1rem 0;
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  background: #f5f2ff;
  color: #5824e8;
  font-size: 0.74rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid #e7dffd;
  flex-shrink: 0;
}

/* Chat Message Thread */
.chat-thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  background: #fbfaff;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-msg {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  width: 100%;
}

.chat-msg.is-out {
  justify-content: flex-end;
}

.chat-msg.is-in {
  justify-content: flex-start;
}

.chat-bubble-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #ece7fb;
  color: #6a38ff;
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-bubble-avatar.is-me {
  background: #6a38ff;
  color: #ffffff;
}

.chat-bubble {
  max-width: min(76%, 500px);
  padding: 0.65rem 0.95rem;
  font-size: 0.86rem;
  line-height: 1.45;
  position: relative;
  word-break: break-word;
}

.chat-msg.is-in .chat-bubble {
  background: #ffffff;
  color: #1f1845;
  border-radius: 16px 16px 16px 4px;
  box-shadow: 0 2px 8px rgba(40, 28, 90, 0.05);
  border: 1px solid #ece7f8;
}

.chat-msg.is-out .chat-bubble {
  background: linear-gradient(135deg, #6a38ff 0%, #5824e8 100%);
  color: #ffffff;
  border-radius: 16px 16px 4px 16px;
  box-shadow: 0 4px 14px rgba(106, 56, 255, 0.22);
}

.chat-msg.is-out .chat-bubble p {
  color: #ffffff;
}

.chat-bubble p {
  margin: 0 0 0.25rem;
}

.chat-bubble time {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  font-size: 0.68rem;
  opacity: 0.75;
}

.chat-msg.is-out .chat-bubble time {
  color: rgba(255, 255, 255, 0.85);
}

.chat-msg.is-out .chat-bubble time i {
  font-size: 0.85rem;
  color: #c7b3ff;
}

/* Quick replies horizontal scroll */
.chat-composer-dock {
  background: #ffffff;
  border-top: 1px solid #ece7f8;
  padding: 0.6rem 1rem 0.75rem;
  flex-shrink: 0;
}

.chat-quick-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 0.5rem;
  white-space: nowrap;
}

.chat-quick-row::-webkit-scrollbar {
  display: none;
}

.chat-quick-btn {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid #ded6fa;
  background: #f7f5fd;
  color: #6a38ff;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.chat-quick-btn:hover {
  background: #6a38ff;
  color: #ffffff;
  border-color: #6a38ff;
}

/* 2-column flex Composer fix */
.chat-composer {
  display: flex !important;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
}

.chat-composer .form-control {
  flex: 1;
  border-radius: 999px;
  border: 1px solid #ded6fa;
  padding: 0.6rem 1.15rem;
  font-size: 0.88rem;
  height: 44px;
  background: #fbfaff;
  box-shadow: none;
  transition: all 0.2s ease;
}

.chat-composer .form-control:focus {
  background: #ffffff;
  border-color: #6a38ff;
  box-shadow: 0 0 0 3px rgba(106, 56, 255, 0.12);
}

.chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #6a38ff 0%, #5824e8 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(106, 56, 255, 0.28);
  flex-shrink: 0;
}

.chat-send-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 16px rgba(106, 56, 255, 0.38);
}

/* Empty State */
.chat-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem;
  background: #fbfaff;
}

.chat-empty-icon {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #efeaff;
  color: #6a38ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 24px rgba(106, 56, 255, 0.15);
}

/* Responsive Mobile View Transition */
@media (max-width: 1199.98px) {
  .chats-app-main {
    height: calc(100vh - 64px);
    height: calc(100dvh - 64px);
    max-height: calc(100vh - 64px);
    max-height: calc(100dvh - 64px);
  }

  .chats-app-shell {
    grid-template-columns: 1fr;
  }

  .chats-sidebar {
    display: flex;
    width: 100%;
  }

  .chats-conversation {
    display: none;
    width: 100%;
  }

  .chats-app-shell.is-chat-open .chats-sidebar {
    display: none;
  }

  .chats-app-shell.is-chat-open .chats-conversation {
    display: flex;
  }

  .chat-detail-topbar {
    padding: 0.6rem 0.85rem;
    gap: 0.55rem;
  }

  .chat-back {
    display: inline-flex !important;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #ded6fa;
    background: #f5f2ff;
    color: #6a38ff;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    flex-shrink: 0;
  }

  .chat-peer-avatar {
    width: 36px;
    height: 36px;
    font-size: 0.76rem;
  }

  .chat-peer-meta {
    flex: 1;
    min-width: 0;
  }

  .chat-peer-meta strong {
    font-size: 0.88rem;
  }

  .chat-top-loan {
    max-width: 120px;
    padding: 0.3rem 0.55rem;
    font-size: 0.72rem;
    gap: 0.3rem;
  }

  .chat-top-loan span {
    max-width: 85px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .chat-more-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }
}

@media (max-width: 767.98px) {
  .chat-detail-topbar {
    padding: 0.5rem 0.65rem;
    gap: 0.45rem;
  }

  .chat-back {
    width: 30px;
    height: 30px;
    font-size: 0.95rem;
    border-radius: 8px;
  }

  .chat-peer-avatar {
    width: 34px;
    height: 34px;
    font-size: 0.72rem;
    box-shadow: none;
  }

  .chat-peer-meta {
    flex: 1;
    min-width: 0;
    overflow: hidden;
  }

  .chat-peer-meta strong {
    font-size: 0.84rem;
    line-height: 1.2;
  }

  .chat-peer-meta strong span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    max-width: 100%;
  }

  .chat-peer-online {
    font-size: 0.65rem;
    margin-top: 1px;
  }

  .chat-top-loan {
    max-width: 95px;
    padding: 0.25rem 0.45rem;
    font-size: 0.68rem;
    gap: 0.25rem;
    flex-shrink: 0;
  }

  .chat-top-loan i {
    font-size: 0.72rem;
  }

  .chat-top-loan span {
    max-width: 65px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
  }

  .chat-more-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }
}

@media (max-width: 380px) {
  .chat-detail-topbar {
    padding: 0.4rem 0.45rem;
    gap: 0.35rem;
  }

  .chat-back {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }

  .chat-peer-avatar {
    width: 30px;
    height: 30px;
    font-size: 0.68rem;
  }

  .chat-peer-meta strong {
    font-size: 0.8rem;
  }

  .chat-top-loan {
    max-width: 80px;
    padding: 0.2rem 0.35rem;
    font-size: 0.64rem;
  }

  .chat-top-loan span {
    max-width: 50px;
  }

  .chat-more-btn {
    width: 28px;
    height: 28px;
  }
}

/* ========================
   Edit Profile Enhancements
   ======================== */
.edit-profile-avatar-card {
  background: #fff;
  border: 1px solid #ebeaf2;
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 8px 24px rgba(40, 28, 90, .04);
}

.edit-avatar-preview-wrap {
  position: relative;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(106, 56, 255, .15);
  border: 3px solid #fff;
  overflow: hidden;
  background: linear-gradient(135deg, #6a38ff 0%, #a855f7 100%);
  flex-shrink: 0;
}

.edit-avatar-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.edit-avatar-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
}

.edit-avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 15, 45, .55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: .75rem;
  opacity: 0;
  transition: opacity .2s ease;
  cursor: pointer;
  border-radius: 50%;
}

.edit-avatar-preview-wrap:hover .edit-avatar-overlay {
  opacity: 1;
}

.edit-avatar-overlay i {
  font-size: 1.35rem;
  margin-bottom: 2px;
}

.edit-avatar-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 600;
  font-size: .88rem;
  padding: .5rem 1.1rem;
  border-radius: 12px;
  background: #f4f0ff;
  color: #6a38ff;
  border: 1px solid #e3d7fc;
  cursor: pointer;
  transition: all .2s ease;
}

.edit-avatar-upload-btn:hover {
  background: #6a38ff;
  color: #fff;
  border-color: #6a38ff;
}

.edit-avatar-remove-btn {
  font-size: .82rem;
  font-weight: 600;
  color: #ef4444;
  border: none;
  background: transparent;
  padding: .4rem .6rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  border-radius: 8px;
}

.edit-avatar-remove-btn:hover {
  background: #fee2e2;
}

.location-detect-btn {
  font-size: .8rem;
  font-weight: 600;
  padding: .35rem .75rem;
  border-radius: 8px;
  border: 1px solid #dcd7f5;
  background: #f8f6ff;
  color: #6a38ff;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  transition: all .2s;
}

.location-detect-btn:hover:not(:disabled) {
  background: #6a38ff;
  color: #fff;
  border-color: #6a38ff;
}

.profile-section-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a163a;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.profile-section-heading i {
  color: #6a38ff;
  font-size: 1.2rem;
}

.quick-action-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1.1rem;
  background: #fcfbfe;
  border: 1px solid #ebeaf2;
  border-radius: 14px;
  text-decoration: none;
  color: #1a163a;
  font-weight: 600;
  font-size: .9rem;
  transition: all .2s ease;
}

.quick-action-link:hover {
  background: #f4f0ff;
  border-color: #dcd7f5;
  color: #6a38ff;
  transform: translateY(-1px);
}

.quick-action-link.is-danger {
  color: #dc2626;
  background: #fffafa;
  border-color: #fee2e2;
}

.quick-action-link.is-danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.toast-feedback {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  min-width: 300px;
  max-width: 420px;
}

/* ============================================================================
   City / Location Search Modal Styling
   ============================================================================ */
.city-modal-content {
  background: #ffffff;
  border-radius: 20px !important;
  border: 1px solid #edf0f5;
  box-shadow: 0 20px 40px -10px rgba(10, 25, 60, 0.15) !important;
}

.city-modal-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #f0ecff;
  border-radius: 50%;
  font-size: 0.95rem;
}

.city-modal-search-wrap {
  position: relative;
}

.city-modal-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: #94a3b8;
  pointer-events: none;
  z-index: 2;
}

.city-modal-search-input {
  padding-left: 46px !important;
  padding-right: 42px !important;
  border-radius: 14px !important;
  border: 1.5px solid #e2e8f0 !important;
  font-size: 0.98rem !important;
  font-weight: 500;
  background: #f8fafc;
  transition: all 0.2s ease;
}

.city-modal-search-input:focus {
  background: #ffffff;
  border-color: #6a38ff !important;
  box-shadow: 0 0 0 3px rgba(106, 56, 255, 0.15) !important;
}

.city-modal-clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  padding: 4px 8px;
  font-size: 1.1rem;
  z-index: 2;
}

.city-modal-spinner {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

.city-chip-btn {
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #334155 !important;
  transition: all 0.15s ease !important;
}

.city-chip-btn:hover {
  background: #f1edff !important;
  border-color: #dcd3ff !important;
  color: #5824e8 !important;
  transform: translateY(-1px);
}

.city-modal-results-list {
  max-height: 280px;
  overflow-y: auto;
  margin-top: 8px;
}

.city-result-item {
  background: #ffffff;
  border: 1px solid transparent !important;
  transition: all 0.15s ease;
  cursor: pointer;
}

.city-result-item:hover {
  background: #f8faff !important;
  border-color: #e5e9f8 !important;
  transform: translateX(2px);
}

.city-result-item.active-city-item {
  background: #f2edff !important;
  border-color: #dcd3ff !important;
}

.city-result-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #f1edff;
  color: #6a38ff;
  border-radius: 10px;
  font-size: 0.95rem;
  flex-shrink: 0;
}

/* ============================================================================
   Interactive Hero Loan Search Box & Autocomplete Dropdown
   ============================================================================ */
.hero-search {
  position: relative;
  z-index: 50;
  width: 100%;
  max-width: 100%;
}

.search-input-wrap {
  position: relative;
  min-width: 0;
}

.search-clear-btn {
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  font-size: 1rem;
}

.search-clear-btn:hover {
  color: #0f172a;
  transform: scale(1.1);
}

.loan-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #ffffff;
  border: 1px solid rgba(106, 56, 255, 0.15);
  border-radius: 16px;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(106, 56, 255, 0.08);
  padding: 1.15rem;
  z-index: 1050;
  max-height: 460px;
  overflow-y: auto;
  overflow-x: hidden;
  animation: searchDropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.search-dropdown-section-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.search-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
  gap: 0.45rem;
  margin-bottom: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.search-category-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.18s ease;
  cursor: pointer;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.search-category-chip span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.search-category-chip:hover,
.search-category-chip.active {
  background: #f3f0ff;
  border-color: #6a38ff;
  color: #6a38ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(106, 56, 255, 0.1);
}

.search-category-chip img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.search-quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  width: 100%;
  box-sizing: border-box;
}

.search-quick-tag {
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  border-radius: 20px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  max-width: 100%;
  white-space: nowrap;
}

.search-quick-tag:hover {
  background: #e0e7ff;
  color: #4338ca;
  border-color: #c7d2fe;
  transform: translateY(-1px);
}

.search-suggestion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  color: #1e293b;
  transition: all 0.15s ease;
  margin-bottom: 0.25rem;
  width: 100%;
  box-sizing: border-box;
}

.search-suggestion-item:hover,
.search-suggestion-item.active {
  background: #f3f0ff;
  color: #6a38ff;
  transform: translateX(3px);
}

.search-suggestion-item .suggestion-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.65rem;
  flex-shrink: 0;
  color: #6a38ff;
}

@media (max-width: 576px) {
  .loan-search-dropdown {
    padding: 0.75rem;
    max-height: 380px;
    border-radius: 12px;
  }
  .search-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.35rem;
  }
  .search-category-chip {
    padding: 0.38rem 0.5rem !important;
    font-size: 0.75rem !important;
  }
}

/* ============================================================
   Loan Search Modal (Mobile & Tablet Popup)
   ============================================================ */
.loan-modal-content {
  border-radius: 20px !important;
  box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(106, 56, 255, 0.08) !important;
  overflow: hidden;
}

.loan-modal-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f1edfc;
  color: #6a38ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.loan-modal-search-wrap {
  position: relative;
  width: 100%;
}

.loan-modal-search-input {
  padding-left: 2.85rem !important;
  padding-right: 2.5rem !important;
  height: 52px !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  border-radius: 14px !important;
  border: 1.5px solid #e2e8f0 !important;
  background: #f8fafc !important;
  color: #0f172a !important;
  transition: all 0.2s ease !important;
}

.loan-modal-search-input:focus {
  background: #ffffff !important;
  border-color: #6a38ff !important;
  box-shadow: 0 0 0 3.5px rgba(106, 56, 255, 0.14) !important;
}

.loan-modal-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.15rem;
  color: #6a38ff !important;
  pointer-events: none;
  z-index: 2;
}

.loan-modal-clear-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #94a3b8;
  padding: 0.35rem;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 2;
  transition: color 0.15s ease;
}

.loan-modal-clear-btn:hover {
  color: #0f172a;
}

.loan-modal-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.65rem;
}

@media (max-width: 575.98px) {
  .loan-modal-category-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

.loan-modal-cat-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.95rem;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #e8e5f2;
  text-decoration: none;
  color: #0f172a;
  transition: all 0.18s ease;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.02);
}

.loan-modal-cat-card:hover {
  background: #f8f6fe;
  border-color: #c7bbf8;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(106, 56, 255, 0.1);
  color: #6a38ff;
}

.loan-modal-cat-card .cat-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.loan-modal-cat-card .cat-icon-wrap img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.cat-icon-gold {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
}

.cat-icon-vehicle {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe;
}

.cat-icon-property {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #bbf7d0;
}

.cat-icon-personal {
  background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  border: 1px solid #e9d5ff;
}

.cat-icon-business {
  background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
  border: 1px solid #fecdd3;
}

.loan-modal-cat-card .cat-info strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 2px;
}

.loan-modal-cat-card .cat-info small {
  display: block;
  font-size: 0.76rem;
  color: #64748b;
  line-height: 1.2;
}

.loan-modal-preset-btn,
.loan-modal-trend-btn {
  font-size: 0.8rem;
  font-weight: 500;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
  transition: all 0.15s ease;
  text-decoration: none;
  cursor: pointer;
}

.loan-modal-preset-btn:hover,
.loan-modal-trend-btn:hover {
  background: #f1edfc;
  border-color: #ded6fa;
  color: #6a38ff;
  transform: translateY(-1px);
}

/* Popular Loan Categories Responsiveness */
.categories-section .category-card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.categories-section .category-card h3 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ============================================================================
   About Us Page Styles & Image Enhancements
   ============================================================================ */
.about-hero-art {
  width: 100%;
  height: auto;
  min-height: 280px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.about-hero-image {
  width: 100%;
  max-width: 540px;
  height: auto;
  display: block;
  object-fit: contain;
  border-radius: 16px;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.25));
  transition: transform 0.3s ease;
}

.about-hero-image:hover {
  transform: translateY(-4px);
}

.about-story-card {
  width: 100%;
  min-height: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
}

.about-story-image {
  width: 100%;
  max-width: 580px;
  height: auto;
  display: block;
  object-fit: contain;
  border-radius: 20px;
  box-shadow: 0 16px 36px rgba(84, 34, 168, 0.14);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.about-story-image:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 44px rgba(84, 34, 168, 0.2);
}

@media (max-width: 991.98px) {
  .about-hero-art {
    margin-top: 1.5rem;
    min-height: auto;
  }
  .about-hero-image {
    max-width: 480px;
  }
  .about-story-card {
    margin-top: 2rem;
  }
  .about-story-image {
    max-width: 520px;
  }
}

@media (max-width: 767.98px) {
  .about-hero-art {
    margin-top: 1.25rem;
  }
  .about-hero-image {
    max-width: 100%;
  }
  .about-story-card {
    margin-top: 1.5rem;
  }
  .about-story-image {
    max-width: 100%;
  }
}
