/* ============================================================================
   Family Member Dashboard Styles
   A comprehensive "at-a-glance" profile view with 11 card sections
   ============================================================================ */

/* ============================================================================
   Container & Layout
   ============================================================================ */

.fm-dashboard-container {
  position: fixed;
  top: var(--nav-height);
  left: var(--side-nav-width);
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  z-index: var(--z-modal-primary);
  overflow-y: auto;
  overflow-x: hidden;
  display: none;
  padding: var(--space-lg);
}

.fm-dashboard-container.is-open {
  /* modal-integrity-scan S4: state driven by ModalManager `.is-open` (was .active) */
  display: block;
}

/* Mobile: Full width */
@media (max-width: 768px) {
  .fm-dashboard-container {
    left: 0;
    padding: var(--space-md);
  }
}

/* ============================================================================
   Dashboard Header
   ============================================================================ */

.fm-dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.fm-dash-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.fm-dash-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: var(--radius-lg);
  color: white;
  cursor: pointer;
  transition: all 0.2s;
  font-size: var(--font-sm);
  font-weight: var(--font-medium);
}

.fm-dash-back-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.fm-dash-title {
  font-size: var(--font-xl);
  font-weight: var(--font-semibold);
  color: white;
  margin: 0;
}

.fm-dash-header-actions {
  display: flex;
  gap: var(--space-sm);
}

.fm-dash-action-btn {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  color: white;
  font-size: var(--font-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.fm-dash-action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.fm-dash-action-btn svg {
  width: 16px;
  height: 16px;
}

/* ============================================================================
   Grid Layout
   ============================================================================ */

.fm-dash-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-lg);
  max-width: 1400px;
  margin: 0 auto;
}

/* Card sizing */
.fm-dash-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.fm-dash-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  opacity: 0;
  transition: opacity 0.3s;
}

.fm-dash-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.fm-dash-card:hover::before {
  opacity: 1;
}

/* Column spans */
.fm-dash-card--profile { grid-column: span 4; }
.fm-dash-card--identity { grid-column: span 8; }
.fm-dash-card--family { grid-column: span 12; }
.fm-dash-card--documents { grid-column: span 12; }
.fm-dash-card--life-events { grid-column: span 6; }
.fm-dash-card--residence { grid-column: span 6; }
.fm-dash-card--ancestry { grid-column: span 12; }
.fm-dash-card--presence { grid-column: span 6; }
.fm-dash-card--education { grid-column: span 6; }
.fm-dash-card--military { grid-column: span 12; }

/* Responsive grid */
@media (max-width: 1024px) {
  .fm-dash-card--profile,
  .fm-dash-card--identity,
  .fm-dash-card--life-events,
  .fm-dash-card--residence,
  .fm-dash-card--presence,
  .fm-dash-card--education {
    grid-column: span 12;
  }
}

@media (max-width: 768px) {
  .fm-dash-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .fm-dash-card {
    grid-column: span 1 !important;
  }
}

/* ============================================================================
   Card Header
   ============================================================================ */

.fm-dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.fm-dash-card-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-base);
  font-weight: var(--font-semibold);
  color: white;
  margin: 0;
}

.fm-dash-card-icon {
  font-size: 1.2em;
}

.fm-dash-card-actions {
  display: flex;
  gap: var(--space-xs);
}

.fm-dash-card-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s;
}

.fm-dash-card-btn:hover {
  background: rgba(102, 126, 234, 0.3);
  color: white;
}

/* ============================================================================
   Profile Photo Card
   ============================================================================ */

.fm-dash-profile-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.fm-dash-profile-photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(102, 126, 234, 0.5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.3s;
}

.fm-dash-profile-photo:hover {
  border-color: #667eea;
  transform: scale(1.05);
}

.fm-dash-profile-placeholder {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(3rem * var(--type-scale, 1));
  color: white;
  cursor: pointer;
  transition: all 0.3s;
}

.fm-dash-profile-placeholder:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.fm-dash-profile-add-btn {
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: rgba(102, 126, 234, 0.2);
  border: 1px solid rgba(102, 126, 234, 0.4);
  border-radius: var(--radius-md);
  color: #a5b4fc;
  font-size: var(--font-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.fm-dash-profile-add-btn:hover {
  background: rgba(102, 126, 234, 0.3);
  color: white;
}

/* ============================================================================
   Identity Card
   ============================================================================ */

.fm-dash-identity-name {
  font-size: var(--font-2xl);
  font-weight: var(--font-bold);
  color: white;
  margin: 0 0 var(--space-xs) 0;
}

.fm-dash-identity-maiden {
  font-size: var(--font-base);
  color: rgba(255, 255, 255, 0.6);
  font-style: italic;
  margin: 0 0 var(--space-sm) 0;
}

.fm-dash-identity-dates {
  font-size: var(--font-base);
  color: rgba(255, 255, 255, 0.8);
  margin: 0 0 var(--space-md) 0;
}

.fm-dash-identity-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.fm-dash-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  font-size: var(--font-xs);
  color: rgba(255, 255, 255, 0.8);
}

.fm-dash-badge--generation {
  background: rgba(102, 126, 234, 0.2);
  color: #a5b4fc;
}

.fm-dash-badge--living {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.fm-dash-badge--deceased {
  background: rgba(156, 163, 175, 0.2);
  color: #9ca3af;
}

.fm-dash-identity-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.fm-dash-identity-btn {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: rgba(102, 126, 234, 0.2);
  border: 1px solid rgba(102, 126, 234, 0.4);
  border-radius: var(--radius-md);
  color: white;
  font-size: var(--font-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.fm-dash-identity-btn:hover {
  background: rgba(102, 126, 234, 0.3);
  border-color: rgba(102, 126, 234, 0.6);
}

.fm-dash-identity-btn--primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
}

.fm-dash-identity-btn--primary:hover {
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* ============================================================================
   Family Connections Card
   ============================================================================ */

.fm-dash-family-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

@media (max-width: 1024px) {
  .fm-dash-family-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .fm-dash-family-grid {
    grid-template-columns: 1fr;
  }
}

.fm-dash-family-group {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
}

.fm-dash-family-group-title {
  font-size: var(--font-sm);
  font-weight: var(--font-semibold);
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 var(--space-sm) 0;
}

.fm-dash-family-member {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-xs);
  cursor: pointer;
  transition: all 0.2s;
}

.fm-dash-family-member:hover {
  background: rgba(102, 126, 234, 0.2);
}

.fm-dash-family-member:last-child {
  margin-bottom: 0;
}

.fm-dash-family-member-photo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.fm-dash-family-member-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-sm);
  color: white;
  flex-shrink: 0;
}

.fm-dash-family-member-name {
  font-size: var(--font-sm);
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fm-dash-family-empty {
  color: rgba(255, 255, 255, 0.4);
  font-size: var(--font-sm);
  font-style: italic;
}

/* ============================================================================
   Documents Card
   ============================================================================ */

.fm-dash-docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-md);
}

.fm-dash-doc-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-md);
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s;
}

.fm-dash-doc-item:hover {
  background: rgba(102, 126, 234, 0.15);
  transform: translateY(-2px);
}

.fm-dash-doc-thumb {
  width: 60px;
  height: 80px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(2rem * var(--type-scale, 1));
  margin-bottom: var(--space-sm);
}

.fm-dash-doc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.fm-dash-doc-name {
  font-size: var(--font-xs);
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.fm-dash-doc-type {
  font-size: calc(0.65rem * var(--type-scale, 1));
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  margin-top: 2px;
}

.fm-dash-docs-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-xl);
  color: rgba(255, 255, 255, 0.4);
}

/* ============================================================================
   Life Events Timeline
   ============================================================================ */

.fm-dash-timeline {
  position: relative;
  padding-left: var(--space-lg);
}

.fm-dash-timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
  opacity: 0.5;
}

.fm-dash-timeline-item {
  position: relative;
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.fm-dash-timeline-item:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
}

.fm-dash-timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-lg) + 4px);
  top: 4px;
  width: 10px;
  height: 10px;
  background: #667eea;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.fm-dash-timeline-date {
  font-size: var(--font-xs);
  color: #a5b4fc;
  margin-bottom: 2px;
}

.fm-dash-timeline-event {
  font-size: var(--font-sm);
  color: white;
  margin-bottom: 2px;
}

.fm-dash-timeline-location {
  font-size: var(--font-xs);
  color: rgba(255, 255, 255, 0.5);
}

/* ============================================================================
   Residence History
   ============================================================================ */

.fm-dash-residence-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.fm-dash-residence-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
}

.fm-dash-residence-icon {
  font-size: 1.2em;
  margin-top: 2px;
}

.fm-dash-residence-details {
  flex: 1;
}

.fm-dash-residence-location {
  font-size: var(--font-sm);
  color: white;
}

.fm-dash-residence-years {
  font-size: var(--font-xs);
  color: rgba(255, 255, 255, 0.5);
}

/* ============================================================================
   FFA Presence Stats
   ============================================================================ */

.fm-dash-presence-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.fm-dash-presence-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-md);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-lg);
}

.fm-dash-presence-stat-icon {
  font-size: calc(1.5rem * var(--type-scale, 1));
  margin-bottom: var(--space-xs);
}

.fm-dash-presence-stat-value {
  font-size: var(--font-2xl);
  font-weight: var(--font-bold);
  color: white;
}

.fm-dash-presence-stat-label {
  font-size: var(--font-xs);
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fm-dash-top-stories {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Breadth-of-representation card (reconciling Pillar E) */
.fm-dash-card--representation { grid-column: span 6; }
.fm-rep-tier {
  font-size: var(--font-xs);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
}
.fm-rep-tier--thick { background: rgba(76, 175, 80, 0.25); color: #a5d6a7; }
.fm-rep-tier--rich { background: rgba(139, 195, 74, 0.22); color: #c5e1a5; }
.fm-rep-tier--moderate { background: rgba(255, 193, 7, 0.20); color: #ffe082; }
.fm-rep-tier--developing { background: rgba(255, 152, 0, 0.20); color: #ffcc80; }
.fm-rep-tier--thin { background: rgba(158, 158, 158, 0.20); color: #cfcfcf; }
.fm-rep-score-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}
.fm-rep-meter {
  flex: 1;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}
.fm-rep-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffb74d, #81c784);
  border-radius: 999px;
}
.fm-rep-score-value { font-size: var(--font-xl); font-weight: var(--font-bold); color: white; }
.fm-rep-score-max { font-size: var(--font-xs); color: rgba(255, 255, 255, 0.5); }
.fm-rep-components { display: flex; flex-direction: column; gap: var(--space-sm); }
.fm-rep-component {
  display: grid;
  grid-template-columns: 1.4rem 6rem 1fr 2rem;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-xs);
  color: rgba(255, 255, 255, 0.7);
}
.fm-rep-component-icon { text-align: center; }
.fm-rep-component-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}
.fm-rep-component-bar-fill { height: 100%; background: rgba(129, 199, 132, 0.7); border-radius: 999px; }
.fm-rep-component-count { text-align: right; color: rgba(255, 255, 255, 0.55); }

.fm-dash-top-stories-title {
  font-size: var(--font-xs);
  font-weight: var(--font-semibold);
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

.fm-dash-story-link {
  display: block;
  padding: var(--space-xs) var(--space-sm);
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  color: white;
  font-size: var(--font-sm);
  margin-bottom: var(--space-xs);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fm-dash-story-link:hover {
  background: rgba(102, 126, 234, 0.2);
}

/* ============================================================================
   Education & Career Card
   ============================================================================ */

.fm-dash-edu-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.fm-dash-edu-item {
  padding: var(--space-sm);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  border-left: 3px solid #667eea;
}

.fm-dash-edu-institution {
  font-size: var(--font-sm);
  font-weight: var(--font-semibold);
  color: white;
}

.fm-dash-edu-degree {
  font-size: var(--font-sm);
  color: rgba(255, 255, 255, 0.8);
}

.fm-dash-edu-year {
  font-size: var(--font-xs);
  color: rgba(255, 255, 255, 0.5);
}

.fm-dash-career-item {
  padding: var(--space-sm);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  border-left: 3px solid #10b981;
}

.fm-dash-career-title {
  font-size: var(--font-sm);
  font-weight: var(--font-semibold);
  color: white;
}

.fm-dash-career-employer {
  font-size: var(--font-sm);
  color: rgba(255, 255, 255, 0.8);
}

.fm-dash-career-years {
  font-size: var(--font-xs);
  color: rgba(255, 255, 255, 0.5);
}

/* ============================================================================
   Ancestry Sources Card
   ============================================================================ */

.fm-dash-ancestry-sources {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.fm-dash-ancestry-source {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
}

.fm-dash-ancestry-icon {
  font-size: 1.2em;
}

.fm-dash-ancestry-citation {
  flex: 1;
  font-size: var(--font-sm);
  color: rgba(255, 255, 255, 0.8);
}

.fm-dash-ancestry-link {
  color: #a5b4fc;
  cursor: pointer;
  transition: color 0.2s;
}

.fm-dash-ancestry-link:hover {
  color: white;
}

/* ============================================================================
   Military Service Card
   ============================================================================ */

.fm-dash-military-content {
  display: flex;
  align-items: flex-start;
  gap: var(--space-lg);
}

.fm-dash-military-emblem {
  font-size: calc(3rem * var(--type-scale, 1));
}

.fm-dash-military-details {
  flex: 1;
}

.fm-dash-military-branch {
  font-size: var(--font-lg);
  font-weight: var(--font-semibold);
  color: white;
  margin-bottom: var(--space-xs);
}

.fm-dash-military-rank {
  font-size: var(--font-base);
  color: rgba(255, 255, 255, 0.8);
}

.fm-dash-military-years {
  font-size: var(--font-sm);
  color: rgba(255, 255, 255, 0.6);
  margin-top: var(--space-xs);
}

.fm-dash-military-unit {
  font-size: var(--font-sm);
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}

/* ============================================================================
   Loading State
   ============================================================================ */

.fm-dash-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  color: rgba(255, 255, 255, 0.6);
}

.fm-dash-loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #667eea;
  border-radius: 50%;
  animation: fm-dash-spin 1s linear infinite;
  margin-bottom: var(--space-md);
}

@keyframes fm-dash-spin {
  to { transform: rotate(360deg); }
}

/* ============================================================================
   Empty States
   ============================================================================ */

.fm-dash-empty {
  text-align: center;
  padding: var(--space-xl);
  color: rgba(255, 255, 255, 0.4);
}

.fm-dash-empty-icon {
  font-size: calc(2rem * var(--type-scale, 1));
  margin-bottom: var(--space-sm);
  opacity: 0.5;
}

.fm-dash-empty-text {
  font-size: var(--font-sm);
  margin-bottom: var(--space-md);
}

.fm-dash-empty-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: rgba(102, 126, 234, 0.2);
  border: 1px dashed rgba(102, 126, 234, 0.4);
  border-radius: var(--radius-md);
  color: #a5b4fc;
  font-size: var(--font-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.fm-dash-empty-btn:hover {
  background: rgba(102, 126, 234, 0.3);
  border-style: solid;
  color: white;
}

/* ============================================================================
   Edit Modal Overlays
   ============================================================================ */

.fm-dash-edit-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: calc(var(--z-modal-primary) + 5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.fm-dash-edit-overlay.active {
  display: flex;
}

.fm-dash-edit-modal {
  background: #1a1a2e;
  border-radius: var(--radius-xl);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.fm-dash-edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.fm-dash-edit-title {
  font-size: var(--font-lg);
  font-weight: var(--font-semibold);
  color: white;
  margin: 0;
}

.fm-dash-edit-close {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.fm-dash-edit-close:hover {
  background: rgba(239, 68, 68, 0.3);
}

.fm-dash-edit-body {
  padding: var(--space-lg);
}

.fm-dash-edit-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Form elements in edit modals */
.fm-dash-form-group {
  margin-bottom: var(--space-lg);
}

.fm-dash-form-label {
  display: block;
  font-size: var(--font-sm);
  font-weight: var(--font-medium);
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: var(--space-xs);
}

.fm-dash-form-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  color: white;
  font-size: var(--font-base);
  transition: all 0.2s;
}

.fm-dash-form-input:focus {
  outline: none;
  border-color: #667eea;
  background: rgba(255, 255, 255, 0.08);
}

.fm-dash-form-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.fm-dash-form-textarea {
  min-height: 150px;
  resize: vertical;
}

.fm-dash-form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

@media (max-width: 600px) {
  .fm-dash-form-row {
    grid-template-columns: 1fr;
  }
}

.fm-dash-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: all 0.2s;
}

.fm-dash-btn--primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
}

.fm-dash-btn--primary:hover {
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  transform: translateY(-1px);
}

.fm-dash-btn--secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
}

.fm-dash-btn--secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ============================================================================
   Issue #1 (listen 2026-05-05) — compress photo+identity panels, parallel
   bio panels with shared control row, truncated previews. Aligns the
   Personal Profile Modal with the AI Biography Dual-Track principle.
   ============================================================================ */

/* Profile Photo card — horizontal layout: photo on left, action buttons on right. */
.fm-dash-profile-content--compact {
  flex-direction: row;
  align-items: center;
  gap: var(--space-md);
  text-align: left;
}
.fm-dash-card--compact .fm-dash-profile-photo,
.fm-dash-card--compact .fm-dash-profile-placeholder {
  width: 96px;
  height: 96px;
  font-size: calc(2rem * var(--type-scale, 1));
  flex-shrink: 0;
}
.fm-dash-profile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}
.fm-dash-profile-actions .fm-dash-profile-add-btn {
  margin-top: 0;
  padding: 0.4rem 0.7rem;
  font-size: calc(0.82rem * var(--type-scale, 1));
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Identity card — tighten spacing so the empty bottom area collapses. */
.fm-dash-card--identity .fm-dash-identity-actions {
  margin-top: var(--space-sm);
}
.fm-dash-card--identity .fm-dash-identity-badges {
  margin-bottom: var(--space-sm);
}

