/* ===========================================
   PARTNER PORTAL — DEDICATED STYLESHEET
   "Your inner sanctum. Your private office within our home."
   =========================================== */

/* ===== PAGE STRUCTURE ===== */
.partner-portal-page {
  position: relative;
  min-height: 100vh;
  background-color: var(--color-cream, #FDFBF7);
  padding-bottom: 4rem;
}

/* ===========================================
   PULSE MONITOR (Corner presence)
   =========================================== */
.portal-pulse-monitor {
  position: fixed;
  top: 5.5rem;
  right: 1.5rem;
  z-index: 90;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.monitor-dot {
  width: 7px;
  height: 7px;
  background: var(--color-olive, #7A8B5E);
  border-radius: 50%;
  position: relative;
  z-index: 2;
}

.monitor-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid rgba(122, 139, 94, 0.35);
  animation: monitorPulse 3s ease-out infinite;
}

@keyframes monitorPulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* ===========================================
   PORTAL CONTAINER
   =========================================== */
.portal-container {
  max-width: 880px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ===========================================
   EXECUTIVE GREETING
   =========================================== */
.portal-greeting {
  background: white;
  border-radius: 1.5rem;
  padding: 2.25rem;
  box-shadow: 0 4px 28px rgba(58, 50, 44, 0.07);
  margin-bottom: 2rem;
}

.greeting-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.greeting-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-olive, #7A8B5E), #9aab7c);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
  font-weight: 600;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.greeting-time {
  font-size: 0.9rem;
  color: var(--color-slate, #4A433D);
  margin-bottom: 0.15rem;
}

.greeting-name {
  font-family: var(--font-serif, 'Lora', Georgia, serif);
  font-size: 1.5rem;
  color: var(--color-chocolate, #3A322C);
  font-weight: 500;
  margin-bottom: 0.15rem;
}

.greeting-agency {
  font-size: 0.85rem;
  color: var(--color-olive, #7A8B5E);
  font-weight: 500;
}

.greeting-summary {
  background: rgba(122, 139, 94, 0.05);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  color: var(--color-chocolate, #3A322C);
  line-height: 1.6;
}

.greeting-summary strong {
  color: var(--color-olive, #7A8B5E);
  font-weight: 600;
}

.greeting-quick-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ===========================================
   SECTION HEADERS
   =========================================== */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-header h2 {
  font-family: var(--font-serif, 'Lora', Georgia, serif);
  font-size: 1.35rem;
  color: var(--color-chocolate, #3A322C);
  margin: 0;
}

.section-subtitle {
  width: 100%;
  font-size: 0.9rem;
  color: var(--color-slate, #4A433D);
  font-style: italic;
  margin-top: -0.5rem;
}

/* Section Tabs */
.section-tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--color-taupe, #F3EDE4);
  border-radius: 2rem;
  padding: 0.3rem;
}

.tab-button {
  background: transparent;
  border: none;
  padding: 0.5rem 1.1rem;
  border-radius: 2rem;
  font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
  font-size: 0.85rem;
  color: var(--color-slate, #4A433D);
  cursor: pointer;
  transition: all 0.25s;
  white-space: nowrap;
}

.tab-button:hover {
  color: var(--color-olive, #7A8B5E);
}

.tab-button.active {
  background: white;
  color: var(--color-olive, #7A8B5E);
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(58, 50, 44, 0.08);
}

/* ===========================================
   CLIENT GRID (Caseload Dashboard)
   =========================================== */
.caseload-section {
  animation: portalFadeIn 0.45s ease;
}

@keyframes portalFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

/* Client Card */
.client-portal-card {
  background: white;
  border-radius: 1rem;
  padding: 1.4rem;
  box-shadow: 0 2px 14px rgba(58, 50, 44, 0.04);
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  border: 1.5px solid transparent;
  position: relative;
  overflow: hidden;
}

.client-portal-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(58, 50, 44, 0.1);
  border-color: rgba(122, 139, 94, 0.18);
}

/* Subtle colored left-edge glow based on status */
.client-portal-card.status-thriving {
  border-left: 3px solid var(--color-olive, #7A8B5E);
}

.client-portal-card.status-transition {
  border-left: 3px solid #b8a88a;
}

.client-portal-card.status-attention {
  border-left: 3px solid var(--color-terracotta, #C27A5A);
}

.portal-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.portal-card-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-chocolate, #3A322C);
}

.portal-card-status {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem;
  border-radius: 1.5rem;
}

.status-thriving-badge {
  background: rgba(122, 139, 94, 0.12);
  color: var(--color-olive, #7A8B5E);
}

.status-transition-badge {
  background: rgba(180, 168, 138, 0.15);
  color: #7a6e5a;
}

.status-attention-badge {
  background: rgba(194, 122, 90, 0.1);
  color: var(--color-terracotta, #C27A5A);
}

.portal-card-category {
  font-size: 0.8rem;
  color: var(--color-slate, #4A433D);
  margin-bottom: 0.75rem;
}

.portal-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #b8b0a6;
}

.portal-card-next {
  font-size: 0.78rem;
  color: var(--color-olive, #7A8B5E);
  font-style: italic;
  margin-top: 0.6rem;
}

/* ===========================================
   CLIENT DETAIL PANEL
   =========================================== */
.client-detail-panel {
  animation: portalFadeIn 0.4s ease;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: none;
  color: var(--color-olive, #7A8B5E);
  font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.5rem 0;
  margin-bottom: 1.5rem;
  transition: color 0.3s;
}

.back-link:hover {
  color: #5d6e42;
}

.detail-card {
  background: white;
  border-radius: 1.25rem;
  padding: 2rem;
  box-shadow: 0 4px 28px rgba(58, 50, 44, 0.07);
  margin-bottom: 1.5rem;
}

.detail-top-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.detail-avatar-lg {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(122, 139, 94, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-olive, #7A8B5E);
}

.detail-name-lg {
  font-family: var(--font-serif, 'Lora', Georgia, serif);
  font-size: 1.4rem;
  color: var(--color-chocolate, #3A322C);
}

.detail-meta-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.detail-meta-item {
  background: rgba(122, 139, 94, 0.04);
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
}

.meta-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #b8b0a6;
  margin-bottom: 0.25rem;
}

.meta-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-chocolate, #3A322C);
}

.detail-journey {
  margin-bottom: 1.5rem;
}

.journey-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #b8b0a6;
  margin-bottom: 0.75rem;
}

.journey-bar {
  display: flex;
  align-items: center;
  gap: 0;
  height: 4px;
  background: #e8e4dc;
  border-radius: 2px;
  margin-bottom: 0.5rem;
}

.journey-segment {
  height: 100%;
  transition: width 0.5s ease;
}

.journey-segment.complete {
  background: var(--color-olive, #7A8B5E);
}

.journey-segment.remaining {
  background: #e8e4dc;
}

.journey-text {
  font-size: 0.78rem;
  color: var(--color-slate, #4A433D);
  font-style: italic;
}

.detail-actions-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ===========================================
   ADVOCACY NOTES
   =========================================== */
.advocacy-notes {
  background: white;
  border-radius: 1.25rem;
  padding: 1.75rem;
  box-shadow: 0 4px 28px rgba(58, 50, 44, 0.07);
}

.advocacy-notes h3 {
  font-family: var(--font-serif, 'Lora', Georgia, serif);
  font-size: 1.1rem;
  color: var(--color-chocolate, #3A322C);
  margin-bottom: 0.75rem;
}

.advocacy-note-item {
  background: rgba(122, 139, 94, 0.04);
  border-radius: 0.75rem;
  padding: 1rem 1.15rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: var(--color-chocolate, #3A322C);
  line-height: 1.5;
  border-left: 2px solid var(--color-olive, #7A8B5E);
}

.advocacy-note-item.partner-note {
  border-left-color: var(--color-terracotta, #C27A5A);
  background: rgba(194, 122, 90, 0.03);
}

.advocacy-note-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #b8b0a6;
  margin-bottom: 0.3rem;
}

/* ===========================================
   REVIEWS SECTION
   =========================================== */
.reviews-section {
  animation: portalFadeIn 0.45s ease;
}

.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.review-item {
  background: white;
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 2px 14px rgba(58, 50, 44, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.review-client-name {
  font-weight: 500;
  color: var(--color-chocolate, #3A322C);
}

.review-days {
  font-size: 0.8rem;
  color: var(--color-slate, #4A433D);
  font-style: italic;
  white-space: nowrap;
}

.review-days.urgent {
  color: var(--color-terracotta, #C27A5A);
  font-weight: 500;
}

/* ===========================================
   REPORTS SECTION
   =========================================== */
.reports-section {
  animation: portalFadeIn 0.45s ease;
}

.reports-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.report-card {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 2px 14px rgba(58, 50, 44, 0.04);
  text-align: center;
  transition: transform 0.25s, box-shadow 0.25s;
}

.report-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(58, 50, 44, 0.1);
}

.report-icon {
  color: var(--color-olive, #7A8B5E);
  margin-bottom: 0.75rem;
}

.report-card h3 {
  font-size: 1rem;
  color: var(--color-chocolate, #3A322C);
  margin-bottom: 0.3rem;
}

.report-card p {
  font-size: 0.8rem;
  color: var(--color-slate, #4A433D);
  margin-bottom: 1rem;
}

.report-status {
  background: rgba(122, 139, 94, 0.06);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-olive, #7A8B5E);
  font-style: italic;
}

/* ===========================================
   TOAST NOTIFICATIONS
   =========================================== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--color-chocolate, #3A322C);
  color: white;
  padding: 0.85rem 1.5rem;
  border-radius: 2.5rem;
  font-size: 0.88rem;
  box-shadow: 0 8px 28px rgba(58, 50, 44, 0.25);
  animation: toastIn 0.4s ease, toastOut 0.3s ease 3s forwards;
  text-align: center;
  pointer-events: auto;
}

.toast.success {
  background: var(--color-olive, #7A8B5E);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 700px) {
  .portal-container {
    padding: 1.25rem 1rem 3rem;
  }

  .portal-greeting {
    padding: 1.5rem 1.25rem;
  }

  .greeting-name {
    font-size: 1.25rem;
  }

  .greeting-quick-actions {
    flex-direction: column;
  }

  .greeting-quick-actions .btn {
    width: 100%;
    text-align: center;
  }

  .section-header {
    flex-direction: column;
    gap: 0.75rem;
  }

  .section-tabs {
    width: 100%;
    justify-content: center;
  }

  .client-grid {
    grid-template-columns: 1fr;
  }

  .detail-meta-row {
    grid-template-columns: 1fr 1fr;
  }

  .reports-options {
    grid-template-columns: 1fr;
  }

  .review-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .portal-pulse-monitor {
    top: 4.5rem;
    right: 1rem;
  }
}

@media (max-width: 400px) {
  .detail-meta-row {
    grid-template-columns: 1fr;
  }

  .detail-actions-row {
    flex-direction: column;
  }

  .detail-actions-row .btn {
    width: 100%;
    text-align: center;
  }
}

/* ===========================================
   REDUCED MOTION
   =========================================== */
@media (prefers-reduced-motion: reduce) {
  .monitor-ring {
    animation: none;
    opacity: 0;
  }

  .client-portal-card {
    transition: none;
  }

  .toast {
    animation: none;
  }
}