/* Halaman: Anggota, Galeri, Pohon — Fase 3 */

.page-toolbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}

.page-toolbar .form-control,
.page-toolbar .form-select {
  border-radius: 999px;
}

.member-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.member-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.member-card-photo {
  position: relative;
  padding: 1.25rem 1.25rem 0;
  text-align: center;
}

.member-card-photo img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary-light);
  box-shadow: var(--shadow-sm);
}

.member-card-status {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #fef2f2;
  color: #991b1b;
}

.member-card-body {
  padding: 0.85rem 1.15rem 1.15rem;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.member-card-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.member-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.member-card-meta i {
  color: var(--primary);
  margin-right: 0.2rem;
}

.member-card-ket {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
  flex: 1;
}

.member-card-actions {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  flex-wrap: wrap;
}

.tree-toolbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
}

.tree-bagan-wrap {
  width: 100%;
  max-width: 100%;
  min-height: 60vh;
  max-height: 85vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}

.tree-scroll-hint {
  display: none;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0.35rem 0.65rem;
  margin-bottom: 0.5rem;
  background: var(--bg);
  border-radius: 999px;
  width: fit-content;
  max-width: 100%;
}

#tree-simple {
  display: inline-block;
  min-width: 900px;
  min-height: 40vh;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.search-wrap {
  position: relative;
  min-width: 220px;
}

.search-wrap .form-control {
  border-radius: 999px;
  padding-left: 2.25rem;
  font-size: 0.875rem;
  background: var(--bg);
  border-color: transparent;
}

.search-wrap .form-control:focus {
  background: var(--surface);
  border-color: var(--primary);
}

.search-wrap-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
  z-index: 2;
}

.search-results {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 320px;
  max-height: 380px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 1060;
}

.search-results.show { display: block; }

.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg); }

.search-result-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.search-result-body { flex: 1; min-width: 0; }

.search-result-name {
  font-weight: 600;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.search-result-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-arrow { color: var(--text-light); font-size: 0.85rem; }

.search-status {
  font-size: 0.6rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  font-weight: 700;
}

.search-status-muted { background: #f1f5f9; color: #64748b; }

.search-empty {
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

body.page-dashboard .mobile-search-overlay {
  display: none !important;
}

.birthday-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-wa-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: #25d366;
  color: #fff !important;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
}

.btn-wa-sm:hover { background: #1da851; color: #fff; }

.import-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  background: var(--bg);
}

@media (max-width: 991.98px) {
  .search-wrap-desktop { display: none !important; }
  #tree-simple { min-width: 520px; padding: 0.75rem; }
  .tree-scroll-hint {
    display: flex;
  }
}

@media (min-width: 992px) {
  .mobile-search-bar { display: none !important; }
  .mobile-search-overlay { display: none !important; }
  .tree-scroll-hint { display: none !important; }
}

.branding-preview {
  text-align: center;
  padding: 1.25rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, var(--primary-light), var(--bg));
}

.branding-preview-logo {
  width: 96px;
  height: 96px;
  margin: 0 auto 0.85rem;
  border-radius: 1rem;
  background: #fff;
  padding: 8px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.branding-preview-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.branding-preview-name {
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.3;
  color: var(--text);
  word-break: break-word;
}

.branding-preview-sub {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}
