.user-card {
  background: #ffffff;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}

.user-card-header {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid #e4e4e7;
}

.user-avatar-lg {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #18181b;
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-card-name {
  font-size: 15px;
  font-weight: 600;
  color: #09090b;
}

.user-card-email {
  font-size: 12px;
  color: #71717a;
  margin-top: 2px;
}

.user-field {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  border-bottom: 1px solid #f4f4f5;
}
.user-field:last-child { border-bottom: none; }
.user-field-label { color: #71717a; }
.user-field-value { color: #09090b; font-weight: 500; }

.badge-coming {
  font-size: 10px;
  background: #f4f4f5;
  color: #71717a;
  border-radius: 9999px;
  padding: 2px 8px;
  font-weight: 500;
}

.upgrade-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #09090b;
  text-decoration: none;
  background: #f4f4f5;
  border-radius: 9999px;
  padding: 3px 10px;
  transition: background 0.15s;
}
.upgrade-link:hover { background: #e4e4e7; }

.plan-switch-group {
  display: flex;
  gap: 4px;
}
.plan-switch-btn {
  font-size: 12px;
  font-weight: 600;
  color: #71717a;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  padding: 4px 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.plan-switch-btn:hover { background: #e4e4e7; }
.plan-switch-btn.active {
  background: #18181b;
  color: #ffffff;
  border-color: #18181b;
}
.plan-switch-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.debug-btn {
  font-size: 12px;
  font-weight: 600;
  color: #71717a;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  padding: 4px 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.debug-btn:hover { background: #e4e4e7; }
.debug-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.display-name-edit {
  display: flex;
  align-items: center;
  gap: 8px;
}
.display-name-edit input {
  font-size: 13px;
  font-weight: 500;
  color: #09090b;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  padding: 4px 10px;
  width: 160px;
  outline: none;
  transition: border-color 0.15s;
}
.display-name-edit input:focus { border-color: #a1a1aa; }

.bio-edit {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 220px;
}
.bio-edit textarea {
  font-size: 13px;
  color: #09090b;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  padding: 6px 10px;
  resize: vertical;
  outline: none;
  font-family: inherit;
  line-height: 1.5;
  transition: border-color 0.15s;
}
.bio-edit textarea:focus { border-color: #a1a1aa; }
.bio-edit-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.bio-edit-footer span {
  font-size: 11px;
  color: #a1a1aa;
}

/* ── Plan badge ── */
.plan-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  border-radius: 9999px;
  padding: 2px 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.plan-badge-free {
  background: #f4f4f5;
  color: #71717a;
}
.plan-badge-pro {
  background: #18181b;
  color: #ffffff;
}

/* ── Credits bar ── */
.credits-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 120px;
}
.credits-bar-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: #09090b;
}
.credits-bar-meta span { color: #71717a; font-weight: 400; }
.credits-bar-track {
  width: 100%;
  height: 5px;
  background: #e4e4e7;
  border-radius: 9999px;
  overflow: hidden;
}
.credits-bar-fill {
  height: 100%;
  background: #18181b;
  border-radius: 9999px;
  transition: width 0.4s ease;
}
.credits-bar-fill.low { background: #f87171; }

/* ── Subscription detail rows ── */
.sub-detail {
  display: none;
}
.is-pro .sub-detail { display: flex; }

/* ── Cancel notice ── */
.cancel-notice {
  display: none;
  font-size: 12px;
  color: #f87171;
  font-weight: 500;
}
.is-canceling .cancel-notice { display: inline; }

/* ── Admin granted notice & badge ── */
.admin-granted-badge {
  display: none;
  font-size: 11px;
  font-weight: 600;
  color: #4338ca;
  background: #eef2ff;
  padding: 2px 8px;
  border-radius: 99px;
}
.is-admin-granted .admin-granted-badge { display: inline; }

.admin-granted-notice {
  display: none;
  margin: 14px 20px 0;
  padding: 12px 14px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  font-size: 12px;
  color: #3730a3;
  line-height: 1.55;
}
.is-admin-granted .admin-granted-notice { display: block; }
.admin-granted-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #4338ca;
  margin-bottom: 4px;
}
.admin-granted-notice p { margin: 0; }
.admin-granted-notice b { color: #1e1b4b; }

/* ── Admin granted modal ── */
.admin-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 400;
  align-items: center; justify-content: center;
  padding: 16px;
}
.admin-modal {
  position: relative;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  max-width: 440px; width: 100%;
  padding: 22px 22px 18px;
}
.admin-modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 30px; height: 30px;
  border: none; background: none; cursor: pointer;
  color: #71717a;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
}
.admin-modal-close:hover { background: #f4f4f5; color: #09090b; }
.admin-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: #09090b;
  padding-right: 28px;
  margin-bottom: 10px;
}
.admin-modal-body { font-size: 13px; color: #3f3f46; line-height: 1.6; }
.admin-modal-body p { margin: 0 0 8px; }
.admin-modal-body ul { margin: 6px 0 0; padding-left: 18px; color: #52525b; }
.admin-modal-body li { margin-bottom: 4px; }
.admin-modal-footer {
  display: flex; justify-content: flex-end;
  margin-top: 14px;
}
.admin-modal-ok {
  border: none; background: #18181b; color: #fff;
  border-radius: 8px;
  padding: 7px 18px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.admin-modal-ok:hover { background: #3f3f46; }

/* ── Plan action buttons ── */
.btn-upgrade {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  background: #18181b;
  border: none;
  border-radius: 9999px;
  padding: 7px 18px;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
}
.btn-upgrade:hover { opacity: 0.8; }

.btn-manage-billing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #09090b;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  border-radius: 9999px;
  padding: 5px 14px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
  display: none;
}
.btn-manage-billing:hover { background: #e4e4e7; }
.is-pro .btn-manage-billing { display: inline-flex; }

.btn-cancel-plan {
  display: none;
  font-size: 12px;
  font-weight: 500;
  color: #71717a;
  background: transparent;
  border: none;
  padding: 5px 0;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.15s;
}
.btn-cancel-plan:hover { color: #f87171; }
.is-pro .btn-cancel-plan { display: inline-flex; }
.is-pro.is-canceling .btn-cancel-plan { display: none; }

/* ── Plan CTA row ── */
.plan-cta-row {
  display: none;
  padding: 14px 20px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.is-pro .plan-cta-row { display: flex; }

/* ── Free upgrade prompt (hidden when pro) ── */
.free-upgrade-row {
  padding: 14px 20px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.free-upgrade-row p {
  font-size: 12px;
  color: #71717a;
  margin: 0;
  line-height: 1.5;
}
.is-pro .free-upgrade-row { display: none; }
