/* =============================================================================
   fh-members.css v14.0.0
   Member list, avatar, profile modal, picker, admin management, Head of Family
   --------------------------------------------------------------------------
   v14 changes:
   • Member rows: two-line layout — Name + relation chip + status badges
     on top, contact (email/phone) underneath.
   • Avatar: 40px, gradient fill, soft ring.
   • Deceased members: desaturated avatar, strike-through name,
     "Deceased" badge, subtle grey wash on row (no Head of Family badge).
   • New utility badges: gp-fh-badge-deceased, gp-fh-badge-expired,
     gp-fh-badge-muted.
   ============================================================================= */

/* --- Tabs (member picker) --- */
.gp-uh-tabs { display:flex; border-bottom:1px solid #e2e8f0; margin:-4px 0 14px; }
.gp-uh-tab { background:transparent; border:0; padding:10px 16px; font-size:13px; font-weight:500;
  color:#64748b; cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-1px; }
.gp-uh-tab:hover { color:#0f172a; }
.gp-uh-tab.active { color:#4f46e5; border-bottom-color:#4f46e5; }
.gp-uh-tab-content { display:none; }
.gp-uh-tab-content.active { display:block; }

#gp-uh-search { width:100%; padding:10px 12px; border:1px solid #cbd5e1; border-radius:6px; font-size:14px; margin-bottom:10px; }
.gp-uh-search-results { max-height:360px; overflow-y:auto; }
.gp-uh-pick-row { display:grid; grid-template-columns:1fr auto; align-items:center;
  gap:12px; padding:10px 12px; border:1px solid #f1f5f9; border-radius:8px;
  margin-bottom:6px; cursor:pointer; font-size:14px; transition:background .15s, border-color .15s; }
.gp-uh-pick-row:hover { background:#f8fafc; border-color:#e2e8f0; }
.gp-uh-pick-row:has(input[type="checkbox"]) { grid-template-columns:auto 1fr auto; }
.gp-uh-pick-selected { background:#eff6ff !important; border-color:#93c5fd !important; }
.gp-uh-pick-name { color:#0f172a; font-weight:500; }
.gp-uh-pick-hint { color:#64748b; font-size:12px; text-align:right; }

/* ============================================================
   MEMBER LIST  — redesigned
   ============================================================ */
.gp-fh-member-list { display:flex; flex-direction:column; gap:8px; }

.gp-fh-member-row {
  display:flex; align-items:flex-start; gap:12px;
  padding:12px 14px;
  background:#fff;
  border:1px solid #eef2f6;
  border-radius:10px;
  transition: background .15s, border-color .15s, transform .15s, box-shadow .15s;
  cursor:pointer;
}
.gp-fh-member-row:hover {
  background:#fafbfc;
  border-color:#e2e8f0;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px -2px rgba(15,23,42,.06);
}
.gp-fh-member-row.gp-uh-pending {
  background:#fffbeb;
  border-color:#fde68a;
}

/* Avatar */
.gp-fh-member-avatar {
  width:40px; height:40px;
  border-radius:50%;
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  color:#3730a3;
  display:flex; align-items:center; justify-content:center;
  font-size:15px; font-weight:650;
  flex-shrink:0;
  border:2px solid #fff;
  box-shadow: 0 0 0 1px #e2e8f0;
  letter-spacing:-.01em;
}

/* Info column */
.gp-fh-member-info { flex:1; min-width:0; padding-top:1px; }

.gp-fh-member-name-row {
  display:flex; flex-wrap:wrap; align-items:center;
  gap:6px;
  margin-bottom:5px;
  min-width:0;
}

.gp-fh-member-name-text {
  font-size:14.5px; font-weight:600;
  color:#0f172a;
  letter-spacing:-.01em;
  margin-right:2px;
}

/* Relation-to-root chip (Father / Mother / Brother / Creator …) */
.gp-fh-member-relation {
  font-size:11.5px;
  color:#475569;
  background:#f1f5f9;
  padding:2px 9px;
  border-radius:999px;
  font-weight:550;
  border:1px solid #e2e8f0;
  white-space:nowrap;
}

/* Contact line — email + phone */
.gp-fh-member-contact-row {
  display:flex; flex-wrap:wrap; align-items:center;
  gap:8px;
  font-size:12.5px;
  color:#64748b;
  min-width:0;
}
.gp-fh-member-contact {
  display:inline-flex; align-items:center; gap:6px;
  max-width:100%;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.gp-fh-member-contact i {
  font-size:11px; color:#94a3b8; flex-shrink:0;
}
.gp-fh-dot {
  color:#cbd5e1;
  user-select:none;
  font-weight:600;
}

/* Remove button */
.gp-uh-remove-btn {
  width:32px; height:32px;
  border-radius:8px; border:0;
  background:transparent; color:#94a3b8;
  cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center;
  font-size:13px;
  flex-shrink:0;
  transition: all .15s;
}
.gp-uh-remove-btn:hover { background:#fee2e2; color:#b91c1c; }

/* ============================================================
   HEAD OF FAMILY
   ============================================================ */
.gp-fh-badge-head {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color:#78350f;
  padding:3px 10px;
  border-radius:999px;
  font-size:11px; font-weight:650;
  display:inline-flex; align-items:center; gap:5px;
  white-space:nowrap;
  box-shadow: 0 1px 2px rgba(245,158,11,.25);
}
.gp-fh-badge-head i { font-size:9px; color:#92400e; }

.gp-fh-member-head {
  border-left:3px solid #f59e0b;
  background: linear-gradient(90deg, #fffbeb 0%, #fff 60%);
}
.gp-fh-avatar-head {
  background: linear-gradient(135deg, #fbbf24, #f59e0b) !important;
  color:#78350f !important;
  box-shadow: 0 0 0 2px #fde68a, 0 0 0 4px #fff !important;
}
.gp-fh-badge-creator i.fa-crown { font-size:10px; margin-right:2px; }

/* ============================================================
   DECEASED — no Head badge, desaturated, strike-through name
   ============================================================ */
.gp-fh-member-deceased {
  background:#fafafa;
}
.gp-fh-member-deceased .gp-fh-member-name-text {
  color:#475569;
  text-decoration: line-through;
  text-decoration-color: rgba(15,23,42,.28);
  text-decoration-thickness: 1px;
}
.gp-fh-avatar-deceased {
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1) !important;
  color:#64748b !important;
  filter: grayscale(40%);
  box-shadow: 0 0 0 1px #cbd5e1 !important;
}
.gp-fh-badge-deceased {
  background:#f1f5f9;
  color:#64748b;
  padding:2px 9px;
  border-radius:999px;
  font-size:11px; font-weight:550;
  display:inline-flex; align-items:center; gap:5px;
  font-style: italic;
  border:1px solid #e2e8f0;
}
.gp-fh-badge-deceased i { font-size:10px; color:#94a3b8; }

/* ============================================================
   MISC STATUS BADGES used in member rows
   ============================================================ */
.gp-fh-badge-expired {
  background:#fee2e2; color:#991b1b;
  padding:2px 9px; border-radius:999px;
  font-size:11px; font-weight:550;
  display:inline-flex; align-items:center; gap:5px;
}
.gp-fh-badge-expired i { font-size:10px; }

.gp-fh-badge-muted {
  background:#f1f5f9; color:#64748b;
  padding:2px 9px; border-radius:999px;
  font-size:11px; font-weight:550;
}

/* --- App Toggle UI (house create/edit) --- */
.gp-uh-apps-section { margin-top:16px; padding-top:16px; border-top:1px solid #e2e8f0; }
.gp-uh-apps-section-title { font-size:12px; font-weight:600; color:#475569; text-transform:uppercase; letter-spacing:.04em; margin-bottom:10px; }
.gp-uh-apps-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.gp-uh-app-item { display:flex; align-items:center; gap:8px; padding:8px 12px; background:#f8fafc;
  border:1px solid #e2e8f0; border-radius:8px; cursor:pointer; transition:all .15s; }
.gp-uh-app-item:hover { background:#f1f5f9; border-color:#cbd5e1; }
.gp-uh-app-item input[type="checkbox"] { width:16px; height:16px; accent-color:#6366f1; flex-shrink:0; }
.gp-uh-app-item label { font-size:13px; color:#334155; cursor:pointer; display:flex; align-items:center; gap:6px; margin:0; }
.gp-uh-app-item label i { color:#94a3b8; width:16px; text-align:center; }
.gp-fh-house-apps-row { display:flex; gap:6px; margin-bottom:10px; font-size:13px; color:#94a3b8; }
.gp-fh-house-apps-row i { transition:color .15s; }
.gp-fh-house-apps-row i:hover { color:#475569; }

/* --- Profile modal --- */
.gp-uh-profile-head { display:flex; gap:14px; align-items:flex-start; padding-bottom:14px; border-bottom:1px solid #e2e8f0; margin-bottom:14px; }
.gp-uh-profile-info { flex:1; min-width:0; }
.gp-uh-profile-name { margin:0 0 6px; font-size:17px; color:#0f172a; }
.gp-uh-profile-badges { display:flex; flex-wrap:wrap; gap:4px; margin-bottom:6px; }
.gp-uh-profile-meta { margin:0; font-size:13px; color:#64748b; }
.gp-uh-profile-table { width:100%; border-collapse:collapse; margin-bottom:14px; }
.gp-uh-profile-table tr td { padding:8px 0; font-size:13px; border-bottom:1px solid #f1f5f9; }
.gp-uh-profile-table tr td:first-child { color:#64748b; width:90px; text-transform:uppercase; font-size:11px; letter-spacing:.04em; }
.gp-uh-profile-table tr td:last-child { color:#0f172a; }
.gp-uh-profile-notes, .gp-uh-profile-houses { margin-top:14px; padding-top:14px; border-top:1px solid #f1f5f9; }
.gp-uh-profile-notes strong, .gp-uh-profile-houses strong { display:block; font-size:11px; color:#64748b; text-transform:uppercase; letter-spacing:.04em; margin-bottom:6px; }
.gp-uh-profile-notes p { margin:0; font-size:13px; color:#334155; line-height:1.5; }
.gp-uh-profile-houses > div { display:flex; flex-wrap:wrap; gap:4px; }
.gp-uh-profile-invite { margin-top:14px; padding-top:14px; border-top:1px solid #f1f5f9; }
.gp-uh-invite-hint { font-size:12px; color:#64748b; margin:0 0 8px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width:768px) {
  .gp-fh-member-row { padding:11px 12px; gap:10px; }
  .gp-fh-member-avatar { width:38px; height:38px; font-size:14px; }
  .gp-fh-member-name-text { font-size:14px; }
  .gp-fh-member-contact-row { gap:6px; font-size:12px; }
  .gp-fh-member-contact { max-width:100%; }
  .gp-uh-remove-btn { width:36px; height:36px; }
}
@media (max-width:480px) {
  .gp-fh-member-row { padding:10px 11px; }
  .gp-fh-member-name-row { gap:5px; }
  .gp-fh-member-relation { font-size:11px; padding:1px 7px; }
  /* Stack badges below name on very narrow screens for legibility */
  .gp-fh-member-contact { font-size:11.5px; }
  .gp-uh-apps-grid { grid-template-columns:1fr; }
}
/* ===================================================================
   Sibling separation (v1.0.0)
   =================================================================== */
.gp-fh-sep-toolbar {
    display: flex; align-items: center; gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 14px; padding: 10px 12px;
    background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px;
}
.gp-fh-sep-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 13px; font-size: 13px; font-weight: 600;
    color: #9a3412; background: #ffedd5; border: 1px solid #fdba74;
    border-radius: 8px; cursor: pointer; white-space: nowrap;
}
.gp-fh-sep-btn:hover { background: #fed7aa; }
.gp-fh-sep-hint { font-size: 12px; color: #9a3412; opacity: .85; }

.gp-fh-sep-modal .gp-fh-modal-body { max-height: 60vh; overflow-y: auto; }
.gp-fh-sep-list { display: flex; flex-direction: column; gap: 4px; }
.gp-fh-sep-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 9px;
    cursor: pointer; transition: background .12s;
}
.gp-fh-sep-row:hover { background: #f8fafc; }
.gp-fh-sep-cb { width: 17px; height: 17px; flex: 0 0 auto; cursor: pointer; }
.gp-fh-sep-name { font-weight: 600; color: #0f172a; }
.gp-fh-loading, .gp-fh-empty, .gp-fh-error { padding: 14px; text-align: center; color: #64748b; }
.gp-fh-error { color: #b91c1c; }