.profile-card,
.profile-form-card {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 2rem;
  border-radius: 24px;
  background: var(--card-bg, #ffffff);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.18);
  width: 100%;
}

.profile-card {
  overflow: hidden;
}

.profile-form-card {
  display: block;
  min-height: auto;
}

.profile-form-card h2 {
  margin: 0 0 1.5rem;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}

.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
/* New container for right side button */
.profile-header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 200px;
}

/* Make button look balanced */
.profile-header-right .btn {
  margin-bottom: 10px;
  gap: 4px;
  min-height: 50px;
  padding: 0 24px;
  font-size: 1rem;
  border-radius: 14px;
}

.profile-image-wrap {
  width: 130px;
  height: 130px;
  flex-shrink: 0;
}

.profile-image {
  width: 130px;
  height: 130px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--secondary, #2563eb);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
}

.profile-placeholder {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: #334155;
  font-weight: 600;
  border: 2px dashed rgba(148, 163, 184, 0.3);
}

.profile-header-text {
   flex: 1;
  display: flex;
  flex-direction: column;
}

.profile-header-text h2 {
  margin: 0 0 0.4rem;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary, #0f172a);
}

.profile-subtitle {
  margin: 0 0 1rem;
  color: #64748b;
  font-size: 0.98rem;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
}

.profile-actions-edit {
  margin-top: 4px;
}

.profile-actions .btn,
.profile-actions-edit .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-sm {
  min-height: 44px;
  padding: 0 18px;
  font-size: 0.95rem;
  line-height: 1;
  border-radius: 12px;
}

.profile-actions-edit .btn {
  min-height: 46px;
  padding: 0 22px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  box-sizing: border-box;
  border: 1px solid transparent;
}

.status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.status-text {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.status-badge.approved {
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.2);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.08);
}

.status-badge.pending {
  background: rgba(245, 158, 11, 0.14);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.2);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.08);
}

.profile-progress-card {
  margin: 0 0 1.5rem;
  padding: 1.25rem;
  border-radius: 20px;
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.08),
    rgba(14, 165, 233, 0.08)
  );
  border: 1px solid rgba(37, 99, 235, 0.14);
}

.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.progress-header h3 {
  margin: 0;
}

.progress-badge {
  min-width: 68px;
  text-align: center;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-weight: 700;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.progress-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #0ea5e9);
}

.progress-note {
  margin: 0.85rem 0 0;
  color: #475569;
}

.success-note {
  color: #15803d;
  font-weight: 600;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.info-box {
  padding: 1.25rem;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.info-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
  border-color: rgba(37, 99, 235, 0.16);
}

.info-box h3 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.info-box p {
  margin: 0 0 0.65rem;
  line-height: 1.55;
}

.profile-form {
  width: 100%;
}

.profile-form .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1.5rem;
  width: 100%;
}

.profile-form .form-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group-full,
.profile-form .form-group-full {
  grid-column: 1 / -1;
}

.form-group label,
.profile-form label {
  margin-bottom: 0.5rem;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
}

.form-group input,
.form-group select,
.form-group textarea,
.profile-form input,
.profile-form select,
.profile-form textarea {
  width: 100%;
  min-height: 52px;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #ffffff;
  color: var(--text-primary, #0f172a);
  font-size: 1rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.profile-form textarea,
.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.profile-form input:focus,
.profile-form select:focus,
.profile-form textarea:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.profile-form input[readonly] {
  background: #f8fafc;
  cursor: not-allowed;
}

.profile-form input[type="file"] {
  padding: 0.75rem;
  min-height: auto;
  background: #ffffff;
}

.form-actions {
  margin-top: 1.75rem;
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.form-actions .btn {
  min-width: 160px;
  justify-content: center;
}

.admin-page-header {
  margin-bottom: 1.5rem;
}

.admin-page-header h2 {
  margin-bottom: 0.35rem;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.member-card {
  padding: 1.25rem;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.member-card-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.member-avatar-wrap {
  flex-shrink: 0;
}

.member-avatar {
  width: 74px;
  height: 74px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(37, 99, 235, 0.18);
}

.placeholder-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: #334155;
  font-weight: 600;
}

.member-meta h3 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.member-meta p {
  margin: 0.2rem 0;
  color: #64748b;
}

.member-progress-block {
  margin-top: 0.5rem;
}

.small-progress {
  height: 10px;
}

[data-theme="dark"] .profile-form-card,
[data-theme="dark"] .profile-card {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 12px 32px rgba(2, 6, 23, 0.45);
}

[data-theme="dark"] .profile-form-card h2,
[data-theme="dark"] .profile-form label,
[data-theme="dark"] .profile-header-text h2,
[data-theme="dark"] .info-box h3,
[data-theme="dark"] .info-box p {
  color: #e5e7eb;
}

[data-theme="dark"] .profile-subtitle,
[data-theme="dark"] .progress-note,
[data-theme="dark"] .member-meta p {
  color: #cbd5e1;
}

[data-theme="dark"] .profile-form input,
[data-theme="dark"] .profile-form select,
[data-theme="dark"] .profile-form textarea {
  background: #111827;
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.22);
}

[data-theme="dark"] .profile-form input[readonly] {
  background: #1f2937;
}

[data-theme="dark"] .profile-placeholder,
[data-theme="dark"] .info-box,
[data-theme="dark"] .member-card {
  background: #111827;
  color: #e5e7eb;
  border-color: rgba(148, 163, 184, 0.18);
}

[data-theme="dark"] .member-card {
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.35);
}

[data-theme="dark"] .profile-progress-card {
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.16),
    rgba(14, 165, 233, 0.12)
  );
  border-color: rgba(37, 99, 235, 0.22);
}

[data-theme="dark"] .progress-badge {
  background: rgba(37, 99, 235, 0.18);
  color: #93c5fd;
}

[data-theme="dark"] .success-note {
  color: #86efac;
}

[data-theme="dark"] .status-badge.approved {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.24);
  box-shadow: none;
}

[data-theme="dark"] .status-badge.pending {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.24);
  box-shadow: none;
}

[data-theme="dark"] .info-box:hover {
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.34);
  border-color: rgba(59, 130, 246, 0.2);
}

@media (max-width: 768px) {
  .profile-form-card,
  .profile-card {
    padding: 1.25rem;
    margin: 1rem auto;
    border-radius: 18px;
  }

  .profile-form-card h2,
  .profile-header-text h2 {
    font-size: 1.6rem;
  }

  .profile-header {
    align-items: flex-start;
  }

  .profile-form .form-grid,
  .profile-grid,
  .member-grid {
    grid-template-columns: 1fr;
  }

  .profile-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-actions .btn,
  .profile-actions .status-badge,
  .form-actions .btn {
    width: 100%;
  }

  .member-card-top {
    align-items: flex-start;
  }
}
/* Hide camera by default (desktop) */
#camera-section {
  display: none;
}

/* Show camera only on small screens (mobile) */
@media (max-width: 768px) {
  #camera-section {
    display: block;
  }
}
