/**
 * Canadian Association of Family Health Support (CAFHS)
 * User/Admin Auth, Dynamic Content, Notifications & Admin Portal Styles
 */

/* Brand Logo Image */
.brand-logo-img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid rgba(0, 128, 128, 0.2);
  box-shadow: 0 4px 12px rgba(13, 59, 58, 0.12);
  transition: transform 0.2s ease;
}

.brand-logo:hover .brand-logo-img {
  transform: scale(1.05);
}

/* Nav Actions & Auth */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-nav-ai {
  background: linear-gradient(135deg, #008080 0%, #0D5C58 100%);
  color: #FFFFFF !important;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 2px 10px rgba(0, 128, 128, 0.25);
  transition: all 0.2s ease;
}

.btn-nav-ai:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 128, 128, 0.35);
}

.notif-bell-btn {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.notif-bell-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.notif-unread-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: var(--crisis-red);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

.nav-guest-btns {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-auth-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-auth-outline:hover {
  background: var(--primary-light);
}

.btn-auth-solid {
  background: var(--primary-deep);
  color: #fff;
  border: none;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-auth-solid:hover {
  background: #000;
}

/* User Profile Pull-Down Menu */
.user-dropdown-container {
  position: relative;
  display: inline-block;
}

.user-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  color: inherit;
}

.user-dropdown-trigger:hover,
.user-dropdown-trigger[aria-expanded="true"] {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 4px 14px rgba(0, 128, 128, 0.18);
  transform: translateY(-1px);
}

.user-avatar-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  border: 1px solid rgba(0, 128, 128, 0.2);
}

.user-info-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.user-name-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-deep);
  line-height: 1.15;
}

.dropdown-chevron {
  font-size: 0.8rem;
  color: #64748B;
  transition: transform 0.2s ease, color 0.2s ease;
  margin-left: 0.2rem;
  font-weight: 700;
}

.user-dropdown-trigger[aria-expanded="true"] .dropdown-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 295px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.16), 0 4px 12px rgba(0, 0, 0, 0.05);
  padding: 0.4rem 0;
  z-index: 1050;
  display: none;
  animation: dropdownSlideIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-dropdown-menu.show {
  display: block;
}

@keyframes dropdownSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dropdown-user-header {
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  margin-bottom: 0.3rem;
  border-top-left-radius: 13px;
  border-top-right-radius: 13px;
}

.dropdown-user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  border: 1.5px solid rgba(0, 128, 128, 0.25);
}

.dropdown-user-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-align: left;
}

.dropdown-user-meta strong {
  font-size: 0.95rem;
  color: #0F172A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
}

.dropdown-user-meta span:not(.role-badge) {
  font-size: 0.78rem;
  color: #64748B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-badge {
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 4px;
  padding: 2px 7px;
  display: inline-block;
  margin-top: 2px;
}

.role-badge.admin {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
}

.role-badge.user {
  background: #E0F2FE;
  color: #0369A1;
  border: 1px solid #BAE6FD;
}

.dropdown-divider {
  height: 1px;
  background: #E2E8F0;
  margin: 0.35rem 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.1rem;
  color: #1E293B;
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
}

.dropdown-item:hover {
  background: #F1F5F9;
  padding-left: 1.25rem;
}

.dropdown-item-icon {
  font-size: 1.2rem;
  width: 26px;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.dropdown-item-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  text-align: left;
}

.dropdown-item-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1E293B;
}

.dropdown-item-desc {
  font-size: 0.73rem;
  color: #64748B;
  margin-top: 2px;
}

.dropdown-admin-item:hover {
  background: #FFFBEB;
}

.dropdown-admin-item:hover .dropdown-item-title {
  color: #B45309 !important;
}

.dropdown-logout-item:hover {
  background: #FEF2F2;
}

.dropdown-logout-item:hover .dropdown-item-title {
  color: #DC2626 !important;
}

/* Dynamic Articles Grid */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.75rem;
  margin-top: 2rem;
}

.article-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s, box-shadow 0.25s;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.article-img-wrap {
  height: 200px;
  position: relative;
  overflow: hidden;
}

.article-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.article-card:hover .article-img-wrap img {
  transform: scale(1.04);
}

.article-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(13, 59, 58, 0.88);
  color: #FFFFFF;
  backdrop-filter: blur(4px);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
}

.article-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.article-meta {
  font-size: 0.8rem;
  color: var(--text-subtle);
  margin-bottom: 0.6rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.article-title {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.75rem;
  color: var(--primary-deep);
}

.article-excerpt {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.article-footer {
  border-top: 1px solid #F1F5F9;
  padding-top: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.article-author {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-deep);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 420px;
  width: 90vw;
  pointer-events: none;
}

.cafhs-toast {
  pointer-events: auto;
  background: #FFFFFF;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border-left: 5px solid var(--primary);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.3s ease;
}

.cafhs-toast.toast-success {
  border-left-color: var(--success-green);
}

.cafhs-toast.toast-fade-out {
  opacity: 0;
  transform: translateX(30px);
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.toast-content {
  flex-grow: 1;
}

.toast-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--primary-deep);
  margin-bottom: 0.2rem;
}

.toast-message {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.toast-close {
  background: transparent;
  border: none;
  font-size: 1rem;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 0 0.2rem;
}

/* Email Inbox Viewer Modal */
.email-modal-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: 650px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.email-list-panel {
  background: var(--bg-card-alt);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
}

.email-list-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.15s;
}

.email-list-item:hover {
  background: #E8F0EE;
}

.email-list-item.active {
  background: #FFFFFF;
  border-left: 4px solid var(--primary);
}

.email-list-item.unread {
  font-weight: 700;
  background: #F0FDF4;
}

.email-item-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-subtle);
  margin-bottom: 0.25rem;
}

.email-item-subj {
  font-size: 0.9rem;
  color: var(--primary-deep);
  font-weight: 600;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-item-snippet {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-detail-panel {
  background: #FFFFFF;
  overflow-y: auto;
  padding: 1.5rem;
}

.email-viewer-card {
  max-width: 650px;
  margin: 0 auto;
}

.email-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
}

.email-branding {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.email-logo-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.email-brand-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary-deep);
}

.email-brand-sub {
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.email-meta-table {
  background: var(--bg-card-alt);
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
  line-height: 1.6;
}

.email-body-content {
  font-size: 0.94rem;
  line-height: 1.7;
  color: #2D3748;
  margin-bottom: 2rem;
  white-space: pre-line;
}

.email-footer-legal {
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Admin Portal Modal (Modern Integrated Two-Pane Layout) */
.admin-modal-card {
  background: #FAFDFD;
  border-radius: 14px;
  max-width: 1360px;
  width: 96vw;
  height: 92vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(13, 59, 58, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.admin-header-bar {
  background: linear-gradient(135deg, #072625 0%, #0D3B3A 100%);
  color: #fff;
  padding: 0.85rem 1.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.admin-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-header-logo {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  object-fit: cover;
}

.admin-header-title-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.admin-header-left h3 {
  color: #fff;
  font-size: 1.2rem;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.admin-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 20px;
  font-size: 0.72rem;
  color: #6EE7B7;
  font-weight: 600;
}

.status-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
  display: inline-block;
  animation: pulse-green 2s infinite ease-in-out;
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.admin-header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-identity-badge {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.identity-avatar {
  font-size: 1.15rem;
  line-height: 1;
}

.identity-info strong {
  display: block;
  font-size: 0.82rem;
  color: #FFFFFF;
  line-height: 1.2;
}

.identity-info small {
  display: block;
  font-size: 0.7rem;
  color: #A3C9C7;
  line-height: 1.1;
}

.admin-header-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.admin-header-close-btn:hover {
  background: rgba(239, 68, 68, 0.8);
  color: #fff;
  transform: scale(1.05);
}

/* Workspace Layout: Left Sidebar + Main Content */
.admin-workspace-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #F8FAF9;
}

/* Sidebar Navigation */
.admin-sidebar {
  width: 270px;
  flex-shrink: 0;
  background: #082625;
  color: #D1E5E4;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid #134E4D;
  overflow: hidden;
}

.admin-sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1.1rem 0.85rem;
}

.admin-sidebar-scroll::-webkit-scrollbar {
  width: 5px;
}

.admin-sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.admin-nav-group {
  margin-bottom: 1.2rem;
}

.admin-nav-group-title {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #76A9A7;
  padding: 0 0.65rem;
  margin-bottom: 0.35rem;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  border: none;
  background: transparent;
  padding: 0.58rem 0.75rem;
  border-radius: 8px;
  color: #C2DFDE;
  font-size: 0.87rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease-in-out;
  position: relative;
  margin-bottom: 2px;
}

.admin-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  transform: translateX(3px);
}

.admin-nav-item.active {
  background: linear-gradient(135deg, #008080 0%, #047857 100%);
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(0, 128, 128, 0.35);
  border-left: 3px solid #6EE7B7;
}

.admin-nav-item .nav-item-icon {
  font-size: 1.05rem;
  line-height: 1;
  flex-shrink: 0;
}

.admin-nav-item .nav-item-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-nav-counter {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
  margin-left: auto;
}

.admin-nav-counter.highlight {
  background: #F59E0B;
  color: #78350F;
}

/* Sidebar Footer */
.admin-sidebar-footer {
  padding: 0.85rem 1rem;
  background: #051A19;
  border-top: 1px solid #134E4D;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-footer-brand {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: #64748B;
}

.sidebar-online-status {
  color: #10B981;
  font-weight: 600;
}

.btn-sidebar-quick-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 0.45rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #A3C9C7;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-sidebar-quick-action:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Main Body Content Pane */
.admin-main-body {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 2rem;
  background: #FAFDFD;
}

/* Responsive Admin Layout */
@media (max-width: 960px) {
  .admin-modal-card {
    width: 98vw;
    height: 96vh;
    border-radius: 8px;
  }
  .admin-workspace-layout {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #134E4D;
    max-height: 180px;
  }
  .admin-sidebar-scroll {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    padding: 0.6rem 0.75rem;
  }
  .admin-nav-group {
    margin-bottom: 0;
    display: flex;
    gap: 0.35rem;
    align-items: center;
  }
  .admin-nav-group-title {
    margin-bottom: 0;
    white-space: nowrap;
  }
  .admin-nav-item {
    margin-bottom: 0;
    white-space: nowrap;
    width: auto;
  }
  .admin-sidebar-footer {
    display: none;
  }
  .admin-main-body {
    padding: 1.25rem;
  }
}

/* Admin Overview Stats */
.admin-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.stat-box {
  background: #FFFFFF;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-box.highlight {
  border-left: 5px solid var(--primary);
}

.stat-box .stat-icon {
  font-size: 2rem;
}

.stat-box .stat-num {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary-deep);
  display: block;
  line-height: 1.1;
}

.stat-box .stat-title {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.admin-quick-actions-card {
  background: #FFFFFF;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 1.75rem;
}

.quick-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.admin-recent-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.recent-box {
  background: #FFFFFF;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.recent-box .box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #F1F5F9;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
}

.recent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid #F8FAFC;
}

.recent-sub {
  font-size: 0.8rem;
  color: var(--text-subtle);
}

/* Admin Tables */
.admin-table-wrapper {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.admin-table th {
  background: #F8FAFC;
  padding: 0.9rem 1rem;
  font-weight: 700;
  color: var(--primary-deep);
  border-bottom: 2px solid var(--border-color);
}

.admin-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #F1F5F9;
}

.badge-status {
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-block;
}

.status-active, .status-published, .status-completed {
  background: #DCFCE7;
  color: #166534;
}

.status-new {
  background: #FEF3C7;
  color: #92400E;
}

.status-in-progress, .status-contacted {
  background: #E0E7FF;
  color: #3730A3;
}

.btn-table-action {
  background: transparent;
  border: 1px solid var(--border-color);
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  margin-right: 0.35rem;
  transition: all 0.15s;
}

.btn-table-action:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.btn-table-action.btn-delete:hover {
  background: #FEE2E2;
  border-color: var(--crisis-red);
  color: var(--crisis-red);
}

/* Admin Editor Card */
.admin-editor-card {
  background: #FFFFFF;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--primary-light);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

/* ChatGPT Configuration Card */
.chatgpt-config-card {
  background: #FFFFFF;
  padding: 2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  max-width: 750px;
}

.api-status-banner {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.status-connected {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #065F46;
}

.status-fallback {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1E40AF;
}

.status-indicator-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

.test-alert {
  padding: 0.9rem 1.2rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.alert-success { background: #DCFCE7; color: #166534; }
.alert-warning { background: #FEF3C7; color: #92400E; }
.alert-info { background: #E0F2FE; color: #0369A1; }

/* Auth Modal Styles */
.auth-modal-card {
  max-width: 480px;
}

.auth-tabs-header {
  display: flex;
  border-bottom: 2px solid #E2E8F0;
  margin-bottom: 1.5rem;
}

.auth-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
}

.auth-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.quick-demo-box {
  background: #F1F5F9;
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-top: 1.5rem;
  border: 1px dashed #CBD5E1;
}

.quick-demo-box h6 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  margin-bottom: 0.5rem;
}

.demo-buttons-row {
  display: flex;
  gap: 0.5rem;
}

.btn-demo-pill {
  flex: 1;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-demo-pill:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-deep);
}

/* Chat lock badge */
.chat-lock-badge {
  position: absolute;
  top: -6px;
  left: -6px;
  background: #1A252C;
  color: #fff;
  font-size: 0.7rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

.chat-engine-status-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 0.5rem;
}

.chat-engine-status-tag.active-openai {
  background: #DCFCE7;
  color: #166534;
}

.chat-engine-status-tag.active-canadian {
  background: #E0F2FE;
  color: #0369A1;
}

@media (max-width: 768px) {
  .email-modal-grid {
    grid-template-columns: 1fr;
    height: 80vh;
  }
  .admin-recent-split {
    grid-template-columns: 1fr;
  }
  .form-row-2, .form-row-3 {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Header Overlap Fix & Navigation Modernization
   ========================================================================== */
.main-header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 10px rgba(13, 59, 58, 0.05);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  height: auto;
  padding: 0.5rem 0;
  gap: 1rem;
  flex-wrap: nowrap;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1.2vw, 1.3rem);
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
}

.nav-item a {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 0.4rem 0.2rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

@media (max-width: 1320px) {
  .logo-sub {
    display: none;
  }
}

@media (max-width: 1140px) {
  .mobile-menu-btn {
    display: block !important;
  }
  .nav-links {
    position: fixed;
    top: 72px;
    left: 0;
    width: 100%;
    background: #FFFFFF;
    flex-direction: column;
    align-items: stretch;
    padding: 1.25rem 2rem;
    box-shadow: var(--shadow-lg);
    border-bottom: 3px solid var(--primary);
    transform: translateY(-140%);
    transition: transform var(--transition-smooth);
    z-index: 999;
  }
  .nav-links.mobile-open {
    transform: translateY(0);
  }
  .nav-item a {
    display: block;
    padding: 0.75rem 0;
    font-size: 1rem;
    border-bottom: 1px solid #F1F5F9;
  }
}

/* ==========================================================================
   Social Login (Google & LinkedIn) Styles
   ========================================================================== */
.social-login-group {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.btn-social,
.btn-social-auth {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--border-color);
  background: #FFFFFF;
  color: var(--text-main);
  text-decoration: none;
}

.btn-social-google:hover,
.btn-social-auth.btn-social-google:hover {
  background: #F8FAFC;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-color: #CBD5E1;
}

.btn-social-linkedin,
.btn-social-auth.btn-social-linkedin {
  background: #0A66C2;
  color: #FFFFFF;
  border-color: #0A66C2;
}

.btn-social-linkedin:hover,
.btn-social-auth.btn-social-linkedin:hover {
  background: #004182;
  border-color: #004182;
  color: #FFFFFF;
}

.social-icon,
.social-icon-svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 1.25rem 0;
  color: var(--text-subtle);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.auth-divider span {
  padding: 0 0.75rem;
}

.social-account-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.social-account-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #FFFFFF;
  cursor: pointer;
  transition: all 0.18s;
  text-align: left;
  width: 100%;
}

.social-account-item:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.social-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  flex-shrink: 0;
}

.social-user-avatar.google {
  background: #EA4335;
  color: #FFFFFF;
}

.social-user-avatar.linkedin {
  background: #0A66C2;
  color: #FFFFFF;
}

.social-user-info {
  flex-grow: 1;
}

.social-user-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary-deep);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.social-user-email {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* =========================================================================
   Official Contribution Checkout, Receipt & Admin Registry Styles
   ========================================================================= */

.contribution-modal-card {
  max-width: 620px;
  width: 95%;
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 45px rgba(13, 59, 58, 0.25);
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.contrib-header-banner {
  background: linear-gradient(135deg, #0D3B3A 0%, #008080 100%);
  color: #FFFFFF;
  padding: 1.5rem 2rem;
  position: relative;
}

.contrib-header-banner h3 {
  margin: 0 0 0.25rem 0;
  color: #FFFFFF;
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contrib-header-banner p {
  margin: 0;
  font-size: 0.85rem;
  color: #A3C9C7;
  line-height: 1.4;
}

.contrib-amount-pill-bar {
  background: #E6F5F5;
  border-bottom: 1px solid #BFE3E2;
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
}

.contrib-amount-pill-bar strong {
  color: #0D3B3A;
  font-size: 1.25rem;
  font-weight: 800;
}

.contrib-body {
  padding: 1.75rem 2rem;
  max-height: 70vh;
  overflow-y: auto;
}

.contrib-method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 0.75rem 0 1.25rem 0;
}

.contrib-method-btn {
  background: #F8FAFC;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.contrib-method-btn.active {
  border-color: var(--primary);
  background: #F0FDF4;
  box-shadow: 0 0 0 1px var(--primary);
}

.contrib-method-btn .method-icon {
  font-size: 1.4rem;
  display: block;
  margin-bottom: 0.25rem;
}

.contrib-method-btn .method-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1E293B;
  display: block;
}

.contrib-method-btn .method-desc {
  font-size: 0.7rem;
  color: #64748B;
  display: block;
  margin-top: 2px;
}

.partner-institution-banner {
  background: #FFFBEB;
  border: 1px solid #FCD34D;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-size: 0.8rem;
  color: #92400E;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.partner-institution-banner a {
  color: #B45309;
  font-weight: 700;
  text-decoration: underline;
}

.contrib-disclosure-box {
  background: #F1F5F9;
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  font-size: 0.76rem;
  color: #475569;
  line-height: 1.45;
  margin: 1.25rem 0;
  border-left: 3px solid var(--primary);
}

/* Official Receipt Print & Display View */
.donation-receipt-preview {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 1.75rem;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1E293B;
  position: relative;
}

.donation-receipt-preview .receipt-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-25deg);
  font-size: 4rem;
  color: rgba(0, 128, 128, 0.05);
  font-weight: 900;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

.donation-receipt-preview .receipt-header {
  border-bottom: 2px solid #0D3B3A;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  text-align: center;
}

.donation-receipt-preview .receipt-header h4 {
  margin: 0 0 0.35rem 0;
  font-size: 1.2rem;
  color: #0D3B3A;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.donation-receipt-preview .receipt-header p {
  margin: 0;
  font-size: 0.82rem;
  color: #475569;
}

.donation-receipt-preview .receipt-row {
  display: flex;
  justify-content: space-between;
  padding: 0.45rem 0;
  border-bottom: 1px dashed #E2E8F0;
  font-size: 0.88rem;
}

.donation-receipt-preview .receipt-row span {
  color: #64748B;
}

.donation-receipt-preview .receipt-row strong {
  color: #0F172A;
  text-align: right;
}

.donation-receipt-preview .receipt-row.highlight {
  background: #F0FDF4;
  padding: 0.65rem 0.5rem;
  border-radius: 4px;
  border-bottom: none;
  margin: 0.5rem 0;
}

.donation-receipt-preview .receipt-footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 2px solid #E2E8F0;
  text-align: center;
}

.donation-receipt-preview .receipt-footer p {
  margin: 0 0 0.5rem 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: #0D3B3A;
}

/* Admin Contributions Tab */
.contrib-stats-banner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contrib-stat-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.contrib-stat-card .stat-val {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0D3B3A;
  display: block;
}

.contrib-stat-card .stat-lbl {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748B;
}

.contrib-table-wrap {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.contrib-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.contrib-table th {
  background: #F8FAFC;
  padding: 0.75rem 1rem;
  font-weight: 700;
  color: #475569;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.contrib-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}

.contrib-table tr:hover td {
  background: #F8FAFC;
}

.badge-payment {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  background: #E0E7FF;
  color: #3730A3;
}

.badge-payment.interac {
  background: #FEF3C7;
  color: #92400E;
}

.badge-payment.paypal {
  background: #E0F2FE;
  color: #0369A1;
}

.badge-receipt-sent {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #15803D;
  font-weight: 600;
  font-size: 0.76rem;
}

.partner-badge-type {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #E2E8F0;
  color: #334155;
}

@media (max-width: 640px) {
  #training-partner-modal .modal-card {
    padding: 1.25rem 1rem;
    max-height: 94vh;
  }
}

/* ==========================================================================
   Email Quick Reply Rich Text Editor & Toolbar Styles
   ========================================================================== */
.qr-modal-card {
  max-width: 820px !important;
  width: 95% !important;
  max-height: 92vh;
  overflow-y: auto;
  padding: 1.75rem 2rem !important;
  box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.25), 0 0 1px 1px rgba(0, 0, 0, 0.05) !important;
}

.qr-editor-container {
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  background: #FFFFFF;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}

.qr-editor-container:focus-within {
  border-color: #0D9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.qr-toolbar {
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  user-select: none;
}

.qr-toolbar-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.qr-toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 2px 4px;
}

.qr-select {
  height: 28px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #334155;
  border: 1px solid #CBD5E1;
  border-radius: 5px;
  padding: 0 6px;
  background: #FFFFFF;
  cursor: pointer;
  outline: none;
}
.qr-select:focus {
  border-color: #0D9488;
}

.qr-btn {
  height: 28px;
  min-width: 28px;
  padding: 0 6px;
  background: #FFFFFF;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.qr-btn:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
  color: #0F172A;
}

.qr-btn:active {
  background: #E2E8F0;
}

.qr-divider {
  width: 1px;
  height: 20px;
  background: #CBD5E1;
  margin: 0 2px;
}

.qr-color-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.2);
  cursor: pointer;
  padding: 0;
  display: inline-block;
  transition: transform 0.15s ease;
}

.qr-color-swatch:hover {
  transform: scale(1.25);
  box-shadow: 0 0 0 2px #0D9488;
}

.qr-color-input {
  width: 22px;
  height: 22px;
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
  vertical-align: middle;
}

.qr-editor {
  min-height: 220px;
  max-height: 360px;
  overflow-y: auto;
  padding: 14px 16px;
  font-size: 0.92rem;
  line-height: 1.6;
  color: #1E293B;
  outline: none;
  background: #FFFFFF;
}

.qr-editor p {
  margin: 0 0 0.6em 0;
}
.qr-editor p:last-child {
  margin-bottom: 0;
}

.qr-editor:empty:before {
  content: attr(placeholder);
  color: #94A3B8;
  pointer-events: none;
}

.qr-preview-box {
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 16px;
  margin-top: 10px;
  max-height: 380px;
  overflow-y: auto;
}



