/* ========================================
   PIVOT POINT RECOVERY — PPR Login Portal
   ======================================== */

/* ---- Login Screen ---- */
.portal-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-offwhite);
  padding: calc(80px + 2rem) 1.5rem 2rem;
}
.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--color-white);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  padding: 2.5rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
.login-header {
  text-align: center;
  margin-bottom: 2rem;
}
.login-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-blue-light);
  color: var(--color-blue);
  border-radius: 14px;
  margin: 0 auto 1.25rem;
}
.login-icon svg { width: 28px; height: 28px; }
.login-subtitle {
  color: var(--color-text-mid);
  font-size: 0.95rem;
}
.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
}
.login-footer {
  text-align: center;
  margin-top: 1.25rem;
}
.login-link {
  background: none;
  border: none;
  color: var(--color-blue);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.login-link:hover { color: var(--color-blue-dark); text-decoration: underline; }
.login-divider {
  height: 1px;
  background: var(--color-border);
  margin: 1.5rem 0;
}

/* ---- Portal App Layout ---- */
.portal-app {
  display: flex;
  min-height: 100vh;
  background: var(--color-offwhite);
}

/* ---- Sidebar ---- */
.portal-sidebar {
  width: 260px;
  background: var(--color-navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 80px;
  left: 0;
  bottom: 0;
  z-index: 1100;
  transition: transform 0.3s var(--ease);
}
.sidebar-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sidebar-logo {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-blue);
  color: #fff;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
}
.sidebar-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}
.sidebar-close:hover { color: #fff; }

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  text-align: left;
}
.sidebar-link svg { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-link:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.9); }
.sidebar-link.active { background: var(--color-blue); color: #fff; }

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-blue);
  color: #fff;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}
.sidebar-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sidebar-user-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-email {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Main Content ---- */
.portal-main {
  flex: 1;
  margin-left: 260px;
  padding-top: 80px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.portal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 2rem;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 80px;
  z-index: 100;
}
.portal-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--color-text);
}
.portal-menu-btn svg { width: 24px; height: 24px; }
.portal-page-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-navy);
  letter-spacing: 0.02em;
}
.portal-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.portal-header-btn {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-size: 0.8rem !important;
  padding: 0.4rem 0.85rem !important;
}

/* ---- Tabs ---- */
.portal-tab {
  display: none;
  padding: 2rem;
  flex: 1;
}
.portal-tab.active { display: block; }

/* ---- Dashboard ---- */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--color-white);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
.stat-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  flex-shrink: 0;
}
.stat-icon svg { width: 24px; height: 24px; }
.stat-blue { background: var(--color-blue-light); color: var(--color-blue); }
.stat-gold { background: rgba(255,184,28,0.12); color: #b8860b; }
.stat-navy { background: rgba(26,43,74,0.08); color: var(--color-navy); }
.stat-green { background: rgba(16,185,129,0.1); color: #059669; }
.stat-info { display: flex; flex-direction: column; }
.stat-number {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-navy);
  line-height: 1;
}
.stat-label {
  font-size: 0.82rem;
  color: var(--color-text-light);
  margin-top: 0.25rem;
  font-weight: 500;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.dashboard-card {
  background: var(--color-white);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  overflow: hidden;
}
.dashboard-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
}
.dashboard-card-header h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-navy);
  letter-spacing: 0.03em;
}
.dashboard-card-body { padding: 1.25rem 1.5rem; }

/* Type distribution bars */
.type-bar-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.type-bar-item:last-child { margin-bottom: 0; }
.type-bar-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-mid);
  width: 120px;
  flex-shrink: 0;
  text-transform: capitalize;
}
.type-bar-track {
  flex: 1;
  height: 8px;
  background: var(--color-light);
  border-radius: 4px;
  overflow: hidden;
}
.type-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--color-blue);
  transition: width 0.6s var(--ease);
}
.type-bar-count {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-navy);
  width: 30px;
  text-align: right;
}

/* Recent activity list */
.activity-list { display: flex; flex-direction: column; gap: 0.75rem; }
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  background: var(--color-offwhite);
}
.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-blue);
  margin-top: 0.4rem;
  flex-shrink: 0;
}
.activity-dot.gold { background: var(--color-gold); }
.activity-dot.green { background: #10b981; }
.activity-text {
  font-size: 0.88rem;
  color: var(--color-text-mid);
  line-height: 1.5;
}
.activity-text strong { color: var(--color-navy); }
.activity-time {
  font-size: 0.75rem;
  color: var(--color-text-light);
  margin-top: 0.15rem;
  display: block;
}

/* ---- Toolbar ---- */
.tab-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.tab-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  flex-wrap: wrap;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  padding: 0 1rem;
  transition: border-color 0.3s;
  flex: 1;
  max-width: 320px;
}
.search-box:focus-within { border-color: var(--color-blue); box-shadow: 0 0 0 3px rgba(0,81,145,0.1); }
.search-box svg { width: 18px; height: 18px; color: var(--color-text-light); flex-shrink: 0; }
.search-box input {
  border: none;
  background: none;
  padding: 0.7rem 0;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--color-text);
  width: 100%;
  outline: none;
}
.filter-select {
  padding: 0.7rem 1rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-white);
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 0.3s;
}
.filter-select:focus { outline: none; border-color: var(--color-blue); }

/* ---- Data Tables ---- */
.data-table-wrap {
  background: var(--color-white);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-light);
  padding: 0.85rem 1.25rem;
  text-align: left;
  background: var(--color-offwhite);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
.data-table td {
  padding: 0.85rem 1.25rem;
  font-size: 0.9rem;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(0,81,145,0.02); }

.contact-name {
  font-weight: 600;
  color: var(--color-navy);
}
.contact-type-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
  background: var(--color-blue-light);
  color: var(--color-blue);
}
.contact-type-badge.donor { background: rgba(255,184,28,0.12); color: #92400e; }
.contact-type-badge.partner { background: rgba(16,185,129,0.1); color: #065f46; }
.contact-type-badge.staff { background: rgba(26,43,74,0.08); color: var(--color-navy); }
.contact-type-badge.volunteer { background: rgba(139,92,246,0.1); color: #5b21b6; }
.contact-type-badge.potential_volunteer { background: rgba(139,92,246,0.06); color: #7c3aed; }
.contact-type-badge.board { background: rgba(234,88,12,0.1); color: #9a3412; }
.contact-type-badge.potential_participant { background: rgba(0,81,145,0.06); color: #1d4ed8; }
.contact-type-badge.potential_partner { background: rgba(16,185,129,0.06); color: #047857; }
.contact-type-badge.potential_donor { background: rgba(255,184,28,0.08); color: #b8860b; }

.table-actions {
  display: flex;
  gap: 0.35rem;
}
.table-action-btn {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  color: var(--color-text-mid);
  font-size: 0.78rem;
  font-family: var(--font-body);
  font-weight: 600;
  transition: all 0.2s;
}
.table-action-btn:hover { border-color: var(--color-blue); color: var(--color-blue); }
.table-action-btn.delete:hover { border-color: var(--color-red); color: var(--color-red); }

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--color-text-light);
  font-size: 0.92rem;
}

/* ---- Hours Summary ---- */
.hours-summary {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}
.hours-summary-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--color-white);
  border-radius: 8px;
  border: 1px solid var(--color-border);
}
.hours-summary-value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-navy);
}
.hours-summary-label {
  font-size: 0.82rem;
  color: var(--color-text-light);
  font-weight: 500;
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,43,74,0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--color-white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.15);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
}
.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-navy);
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--color-text-light);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}
.modal-close:hover { color: var(--color-text); }
.modal-body { padding: 1.5rem; }
.modal-body .form-group { margin-bottom: 1rem; }
.modal-body .form-group:last-of-type { margin-bottom: 1.5rem; }
.modal-body .btn { width: 100%; justify-content: center; }

/* ---- Business Card Scanner ---- */
.scanner-modal { max-width: 520px; }
.scanner-instructions {
  font-size: 0.92rem;
  color: var(--color-text-mid);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}
.scanner-capture-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.scanner-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem 1rem;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--color-text-mid);
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
}
.scanner-option:hover {
  border-color: var(--color-blue);
  color: var(--color-blue);
  background: var(--color-blue-light);
}
.scanner-option svg { width: 32px; height: 32px; }

.scanner-preview {
  margin-top: 1rem;
  text-align: center;
}
.scanner-preview img {
  max-width: 100%;
  max-height: 260px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  object-fit: contain;
  background: var(--color-offwhite);
}

.scanner-processing {
  text-align: center;
  padding: 2.5rem 1rem;
}
.scanner-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--color-border);
  border-top-color: var(--color-blue);
  border-radius: 50%;
  animation: scanSpin 0.8s linear infinite;
  margin: 0 auto 1.25rem;
}
@keyframes scanSpin { to { transform: rotate(360deg); } }

.scanner-status {
  font-size: 0.95rem;
  color: var(--color-text-mid);
  font-weight: 600;
  margin-bottom: 1rem;
}
.scanner-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--color-light);
  border-radius: 3px;
  overflow: hidden;
}
.scanner-progress-fill {
  height: 100%;
  background: var(--color-blue);
  border-radius: 3px;
  transition: width 0.3s;
  width: 0%;
}

.scanner-raw-text {
  font-size: 0.78rem;
  color: var(--color-text-light);
  background: var(--color-offwhite);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.25rem;
  max-height: 80px;
  overflow-y: auto;
  line-height: 1.5;
  word-break: break-word;
}

.scanner-form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.scanner-form-actions .btn { flex: 1; justify-content: center; }

/* ---- Grant Pipeline ---- */
.grant-pipeline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--color-white);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.pipeline-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.85rem 1.25rem;
  background: var(--color-offwhite);
  border-radius: 8px;
  min-width: 90px;
  text-align: center;
  transition: background 0.2s;
  cursor: default;
}
.pipeline-stage.awarded { background: rgba(16,185,129,0.1); }
.pipeline-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pipeline-count {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-navy);
}
.pipeline-stage.awarded .pipeline-count { color: #059669; }
.pipeline-arrow {
  color: var(--color-text-light);
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ---- Grant Stage Badges ---- */
.grant-stage-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
  background: var(--color-offwhite);
  color: var(--color-text-mid);
}
.grant-stage-badge.research { background: rgba(139,92,246,0.1); color: #5b21b6; }
.grant-stage-badge.loi { background: rgba(139,92,246,0.1); color: #5b21b6; }
.grant-stage-badge.application { background: rgba(59,130,246,0.1); color: #1d4ed8; }
.grant-stage-badge.submitted { background: rgba(245,158,11,0.12); color: #92400e; }
.grant-stage-badge.under_review { background: rgba(245,158,11,0.12); color: #92400e; }
.grant-stage-badge.awarded { background: rgba(16,185,129,0.1); color: #065f46; }
.grant-stage-badge.declined { background: rgba(239,68,68,0.1); color: #991b1b; }
.grant-stage-badge.reporting { background: rgba(59,130,246,0.1); color: #1d4ed8; }
.grant-stage-badge.closed { background: var(--color-offwhite); color: var(--color-text-light); }
.overdue-text { color: #dc2626; font-weight: 600; }

/* ---- Donor Badge Colors ---- */
.contact-type-badge.active { background: rgba(16,185,129,0.1); color: #065f46; }
.contact-type-badge.lapsed { background: rgba(239,68,68,0.1); color: #991b1b; }
.contact-type-badge.prospect { background: rgba(245,158,11,0.12); color: #92400e; }
.contact-type-badge.major { background: rgba(139,92,246,0.1); color: #5b21b6; }
.contact-type-badge.pending { background: rgba(245,158,11,0.12); color: #92400e; }
.contact-type-badge.completed { background: rgba(16,185,129,0.1); color: #065f46; }
.contact-type-badge.inactive { background: var(--color-offwhite); color: var(--color-text-light); }
.contact-type-badge.applicant { background: rgba(59,130,246,0.1); color: #1d4ed8; }
.contact-type-badge.onboarding { background: rgba(245,158,11,0.12); color: #92400e; }

/* ---- Intake Form ---- */
.intake-container { max-width: 800px; }
.intake-form-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.intake-form-sections { display: flex; flex-direction: column; gap: 1.25rem; }
.intake-section {
  background: var(--color-white);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  overflow: hidden;
}
.intake-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: var(--color-offwhite);
  border-bottom: 1px solid var(--color-border);
}
.intake-section-number {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-blue);
  color: #fff;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}
.intake-section-header h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-navy);
  letter-spacing: 0.03em;
}
.intake-section-body { padding: 1.25rem 1.5rem; }
.intake-section-body .form-group { margin-bottom: 0.85rem; }
.intake-section-body .form-group:last-child { margin-bottom: 0; }

.intake-consent-group {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-top: 0.5rem;
}
.intake-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--color-text-mid);
  line-height: 1.5;
}
.intake-checkbox input[type="checkbox"] {
  margin-top: 0.25rem;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--color-blue);
}

.intake-form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 1.5rem 0 0;
}

/* Intake view modal */
.intake-view-grid { display: flex; flex-direction: column; gap: 0.25rem; }
.intake-view-row {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  font-size: 0.88rem;
  color: var(--color-text-mid);
  border-bottom: 1px solid var(--color-light);
}
.intake-view-row:last-child { border-bottom: none; }
.intake-view-label { font-weight: 600; color: var(--color-navy); flex-shrink: 0; margin-right: 1rem; }

/* ---- Donor Summary ---- */
.donor-summary-stats { margin-bottom: 1.5rem; }

/* ---- Sidebar Divider & Section Labels ---- */
.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 0.5rem 0.75rem;
}
.sidebar-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.3);
  padding: 0.35rem 1rem 0.15rem;
  margin: 0;
}

/* ---- Dashboard Quick Navigation ---- */
.dashboard-quicknav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
.quicknav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem 0.75rem;
  background: var(--color-white);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  text-align: center;
}
.quicknav-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.06); border-color: var(--color-blue); }
.quicknav-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}
.quicknav-icon svg { width: 22px; height: 22px; }
.quicknav-blue { background: var(--color-blue-light); color: var(--color-blue); }
.quicknav-teal { background: rgba(0,81,145,0.06); color: #2563eb; }
.quicknav-purple { background: rgba(139,92,246,0.1); color: #7c3aed; }
.quicknav-purple-light { background: rgba(139,92,246,0.06); color: #8b5cf6; }
.quicknav-green { background: rgba(16,185,129,0.1); color: #059669; }
.quicknav-green-light { background: rgba(16,185,129,0.06); color: #10b981; }
.quicknav-gold { background: rgba(255,184,28,0.12); color: #b8860b; }
.quicknav-gold-light { background: rgba(255,184,28,0.06); color: #d97706; }
.quicknav-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-mid);
  line-height: 1.3;
}
.quicknav-count {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-navy);
  line-height: 1;
}

/* ---- My Digital Card ---- */
.mycard-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 900px;
}
.mycard-section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-navy);
  letter-spacing: 0.03em;
  margin-bottom: 1.25rem;
}
.mycard-preview-section,
.mycard-editor-section {
  background: var(--color-white);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  padding: 1.5rem;
}

/* Digital Card Design */
.digital-card {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
.digital-card-header {
  background: linear-gradient(135deg, var(--color-navy), var(--color-blue));
  padding: 1.5rem;
  display: flex;
  align-items: center;
}
.digital-card-logo { width: 180px; height: auto; }
.digital-card-body { padding: 1.25rem 1.5rem; background: var(--color-white); }
.digital-card-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-navy);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.digital-card-title {
  font-size: 0.88rem;
  color: var(--color-blue);
  font-weight: 600;
  margin-top: 0.15rem;
}
.digital-card-details { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.digital-card-detail {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-text-mid);
}
.digital-card-detail svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--color-blue); }

.mycard-qr-section {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}
.mycard-qr-label {
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-bottom: 1rem;
}
.mycard-qr-code canvas {
  border-radius: 8px;
  border: 1px solid var(--color-border);
}
.mycard-share-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.mycard-share-actions .btn { flex: 1; justify-content: center; }

/* ---- QR Scanner ---- */
.scanqr-container {
  max-width: 520px;
}
.scanqr-card {
  background: var(--color-white);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  padding: 2rem;
}
.scanqr-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.scanqr-options .btn { justify-content: center; }

.qr-scanner-viewport {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
  background: #000;
}
.qr-scanner-viewport video {
  width: 100%;
  display: block;
}
.qr-stop-btn {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.9) !important;
  z-index: 10;
}

.qr-scan-result {
  background: var(--color-offwhite);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.qr-scan-result h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-navy);
  margin-bottom: 0.75rem;
}
.qr-result-card { padding: 0.5rem 0; }
.qr-result-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-navy);
  margin-bottom: 0.35rem;
}
.qr-result-detail {
  font-size: 0.88rem;
  color: var(--color-text-mid);
  margin-bottom: 0.25rem;
}
.qr-result-detail a { color: var(--color-blue); }

/* ---- About Us Tab ---- */
.about-app-container { max-width: 520px; }
.about-app-card {
  background: var(--color-white);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  padding: 2rem;
  text-align: center;
}
.about-app-logo { margin-bottom: 1rem; }
.about-app-logo svg { width: 220px; }
.about-app-tagline {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-blue);
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}
.about-app-desc {
  font-size: 0.92rem;
  color: var(--color-text-mid);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.about-app-links,
.about-app-info,
.about-app-install {
  text-align: left;
  margin-bottom: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
}
.about-app-links h4,
.about-app-info h4,
.about-app-install h4 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-navy);
  letter-spacing: 0.05em;
  margin-bottom: 0.85rem;
}
.about-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  color: var(--color-text-mid);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}
.about-link:hover {
  background: var(--color-blue-light);
  color: var(--color-blue);
}
.about-link svg { width: 20px; height: 20px; flex-shrink: 0; }

.about-info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  font-size: 0.88rem;
  color: var(--color-text-mid);
  border-bottom: 1px solid var(--color-light);
}
.about-info-row:last-child { border-bottom: none; }
.about-info-label { font-weight: 600; color: var(--color-navy); }

.about-app-install p {
  font-size: 0.88rem;
  color: var(--color-text-mid);
  margin-bottom: 1rem;
}
.install-instructions {
  margin-top: 1rem;
}
.install-platform-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-navy);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}
.install-steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.install-step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--color-text);
  line-height: 1.5;
}
.install-step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-blue);
  color: #fff;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 700;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .mycard-layout { grid-template-columns: 1fr; }
  .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-quicknav { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .portal-sidebar {
    transform: translateX(-100%);
  }
  .portal-sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .portal-main { margin-left: 0; }
  .portal-menu-btn { display: block; }
  .portal-header { padding: 1rem 1.25rem; }
  .portal-tab { padding: 1.25rem; }
  .dashboard-stats { grid-template-columns: 1fr 1fr; }
  .tab-toolbar { flex-direction: column; align-items: stretch; }
  .tab-toolbar-left { flex-direction: column; }
  .search-box { max-width: none; }
  .data-table th, .data-table td { padding: 0.7rem 0.85rem; font-size: 0.82rem; }
  .hours-summary { flex-direction: column; gap: 0.75rem; }
  .grant-pipeline { flex-wrap: wrap; gap: 0.35rem; }
  .pipeline-stage { min-width: 70px; padding: 0.6rem 0.75rem; }
  .pipeline-arrow { display: none; }
  .intake-section-body { padding: 1rem; }
  .intake-form-actions { flex-direction: column; }
}

@media (max-width: 480px) {
  .dashboard-stats { grid-template-columns: 1fr; }
  .dashboard-quicknav { grid-template-columns: 1fr 1fr; }
  .login-card { padding: 1.5rem; }
  .stat-card { padding: 1rem; }
  .mycard-share-actions { flex-direction: column; }
  .scanqr-card { padding: 1.25rem; }
  .about-app-card { padding: 1.25rem; }
  .about-app-logo svg { width: 180px; }
  .digital-card-logo { width: 140px; }
}

/* ========================================
   TASKS MODULE
   ======================================== */

.task-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--color-blue);
}
.task-check-done {
  color: #10b981;
  font-size: 1.1rem;
  font-weight: 700;
}
.task-done-row { opacity: 0.55; }
.task-done-text { text-decoration: line-through; }
.task-overdue-row { background: rgba(239,68,68,0.04); }

.task-priority-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}
.task-priority-badge.low { background: rgba(156,163,175,0.15); color: #6b7280; }
.task-priority-badge.medium { background: rgba(59,130,246,0.1); color: #1d4ed8; }
.task-priority-badge.high { background: rgba(245,158,11,0.12); color: #92400e; }
.task-priority-badge.urgent { background: rgba(239,68,68,0.1); color: #991b1b; }

.contact-type-badge.open { background: rgba(59,130,246,0.1); color: #1d4ed8; }
.contact-type-badge.in_progress { background: rgba(245,158,11,0.12); color: #92400e; }
.contact-type-badge.cancelled { background: var(--color-offwhite); color: var(--color-text-light); }

.stat-icon.stat-red {
  background: rgba(239,68,68,0.1);
  color: #dc2626;
}

/* ========================================
   CONTACT DETAIL VIEW
   ======================================== */

.contact-detail-view { max-width: 100%; }

.contact-detail-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-border);
}
.contact-detail-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-navy), var(--color-blue));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
}
.contact-detail-info h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-navy);
  text-transform: uppercase;
}

.contact-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1.5rem;
  margin-bottom: 1.5rem;
}
.contact-detail-item {
  padding: 0.5rem 0;
  font-size: 0.88rem;
  color: var(--color-text-mid);
}
.contact-detail-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 0.15rem;
}
.contact-detail-item a { color: var(--color-blue); text-decoration: none; }
.contact-detail-item a:hover { text-decoration: underline; }

.contact-detail-section-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-navy);
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border);
}

.contact-detail-timeline {
  margin-bottom: 1.25rem;
}

.timeline-item {
  display: flex;
  gap: 0.85rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-light);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-blue);
  flex-shrink: 0;
  margin-top: 0.35rem;
}
.timeline-dot.interaction { background: #2563eb; }
.timeline-dot.hours { background: #d97706; }
.timeline-dot.task { background: #7c3aed; }
.timeline-content { flex: 1; min-width: 0; }
.timeline-date {
  font-size: 0.75rem;
  color: var(--color-text-light);
  margin-bottom: 0.15rem;
}
.timeline-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-navy);
}
.timeline-text {
  font-size: 0.82rem;
  color: var(--color-text-mid);
  margin-top: 0.15rem;
}

.contact-detail-actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
}
.contact-detail-actions .btn { flex: 1; justify-content: center; min-width: 120px; }

.clickable-name {
  cursor: pointer;
  color: var(--color-blue);
  transition: color 0.15s;
}
.clickable-name:hover { color: var(--color-navy); text-decoration: underline; }

/* ========================================
   REPORTS & ANALYTICS
   ======================================== */

.reports-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.reports-kpi-card {
  background: var(--color-white);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  padding: 1.25rem;
  text-align: center;
}
.reports-kpi-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-navy);
}
.reports-kpi-label {
  font-size: 0.78rem;
  color: var(--color-text-light);
  font-weight: 500;
  margin-top: 0.25rem;
}

.reports-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.reports-chart-card {
  background: var(--color-white);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  padding: 1.5rem;
}
.reports-chart-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-navy);
  letter-spacing: 0.03em;
  margin-bottom: 1.25rem;
}

/* Vertical bar chart */
.reports-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  height: 180px;
  padding-top: 1rem;
}
.reports-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  height: 100%;
}
.reports-bar-value {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-mid);
}
.reports-bar-track {
  flex: 1;
  width: 100%;
  max-width: 40px;
  background: var(--color-offwhite);
  border-radius: 4px 4px 0 0;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.reports-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--color-blue), var(--color-navy));
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: height 0.5s ease;
}
.reports-bar-label {
  font-size: 0.72rem;
  color: var(--color-text-light);
  font-weight: 600;
}

/* Horizontal bar chart */
.reports-horizontal-chart {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.reports-horiz-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.reports-horiz-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-mid);
  min-width: 90px;
  flex-shrink: 0;
}
.reports-horiz-track {
  flex: 1;
  height: 22px;
  background: var(--color-offwhite);
  border-radius: 4px;
  overflow: hidden;
}
.reports-horiz-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
  min-width: 2px;
}
.reports-horiz-fill.participant { background: var(--color-blue); }
.reports-horiz-fill.donor { background: #d97706; }
.reports-horiz-fill.partner { background: #7c3aed; }
.reports-horiz-fill.staff { background: var(--color-navy); }
.reports-horiz-fill.volunteer { background: #10b981; }
.reports-horiz-fill.potential_volunteer { background: rgba(16,185,129,0.5); }
.reports-horiz-fill.board { background: #ea580c; }
.reports-horiz-fill.potential_participant { background: rgba(59,130,246,0.5); }
.reports-horiz-fill.potential_donor { background: rgba(217,119,6,0.5); }
.reports-horiz-fill.potential_partner { background: rgba(124,58,237,0.5); }
.reports-horiz-fill.open { background: var(--color-blue); }
.reports-horiz-fill.completed { background: #10b981; }
.reports-horiz-fill.urgent { background: #dc2626; }
.reports-horiz-value {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-navy);
  min-width: 30px;
  text-align: right;
}

/* Small button variant for export */
.btn-small {
  font-size: 0.78rem;
  padding: 0.4rem 0.75rem;
}

/* Reports responsive */
@media (max-width: 1024px) {
  .reports-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .reports-charts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .reports-kpi-grid { grid-template-columns: 1fr; }
  .contact-detail-grid { grid-template-columns: 1fr; }
  .contact-detail-actions { flex-direction: column; }
}

/* ========================================
   SUCCESS TOAST NOTIFICATION
   ======================================== */

.success-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #059669;
  color: #fff;
  padding: 0.85rem 1.5rem;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
}
.success-toast.show {
  display: flex;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
