/* ==========================================================================
   Settings & User Menu Styles - Music Content ID & Lyrics Studio
   Font: Kantumruy Pro & Inter | Modern Glassmorphism & Micro-animations
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. User Menu & Dropdown (Top Header)
   -------------------------------------------------------------------------- */
.user-menu-wrapper {
  position: relative;
  display: inline-block;
}

.user-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 6px 12px 6px 8px;
  border-radius: 9999px;
  cursor: pointer;
  color: #f8fafc;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Kantumruy Pro', Inter, sans-serif;
  user-select: none;
}

.user-menu-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

.user-avatar-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
  text-transform: uppercase;
}

.user-meta-summary {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-email-text {
  font-size: 13px;
  font-weight: 500;
  color: #e2e8f0;
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.2px;
  line-height: 1.25;
  user-select: none;
}

.user-role-pill.role-superadmin {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  border: 1px solid #f59e0b;
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.2);
}

.user-role-pill.role-admin {
  background: #f5f3ff;
  color: #6b21a8;
  border: 1px solid #ddd6fe;
}

.user-role-pill.role-editor {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.user-role-pill.role-viewer {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

/* Header navbar override for user dropdown */
.user-menu-btn .user-role-pill {
  font-size: 10px;
  padding: 2px 7px;
  background: #312e81;
  color: #c7d2fe;
  border-color: #4338ca;
}

.user-menu-btn .user-role-pill.role-superadmin {
  background: linear-gradient(135deg, #78350f, #92400e);
  color: #fde68a;
  border-color: #f59e0b;
}

.user-menu-btn .user-role-pill.role-admin {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

.user-menu-btn .user-role-pill.role-editor {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.4);
}

.user-menu-btn .user-role-pill.role-viewer {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.4);
}

.user-chevron-icon {
  width: 14px;
  height: 14px;
  color: #94a3b8;
  transition: transform 0.2s ease;
}

.user-menu-wrapper.open .user-chevron-icon {
  transform: rotate(180deg);
}

/* Dropdown Menu Container */
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 290px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.08);
  padding: 8px;
  z-index: 999;
  animation: dropdownFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Kantumruy Pro', Inter, sans-serif;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dropdown-header-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 12px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 6px;
}

.dropdown-avatar-lg {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #9333ea);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(79, 70, 229, 0.35);
  flex-shrink: 0;
}

.dropdown-account-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown-account-email {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-account-role {
  font-size: 11px;
  color: #64748b;
}

.dropdown-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  color: #334155;
  text-decoration: none;
  font-family: 'Kantumruy Pro', Inter, sans-serif;
}

.dropdown-menu-item:hover {
  background: #f8fafc;
  color: #0f172a;
  transform: translateX(2px);
}

.dropdown-icon-sq {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  background: #f1f5f9;
}

.icon-amber { background: #fef3c7; color: #b45309; }
.icon-purple { background: #ede9fe; color: #6d28d9; }
.icon-sky { background: #e0f2fe; color: #0369a1; }
.icon-emerald { background: #dcfce7; color: #15803d; }
.icon-rose { background: #ffe4e6; color: #be123c; }
.icon-cyan { background: #cffafe; color: #0891b2; }

.dropdown-section-title {
  padding: 8px 12px 3px;
  font-size: 10.5px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dropdown-text-group {
  display: flex;
  flex-direction: column;
}

.dropdown-text-group strong {
  font-size: 13px;
  color: #1e293b;
  font-weight: 600;
}

.dropdown-text-group small {
  font-size: 11px;
  color: #64748b;
  margin-top: 1px;
}

.dropdown-divider-line {
  height: 1px;
  background: #f1f5f9;
  margin: 6px 0;
}

.dropdown-logout-item:hover {
  background: #fff1f2;
}

.dropdown-logout-item:hover strong {
  color: #e11d48;
}

/* --------------------------------------------------------------------------
   2. Settings Modal Dialog
   -------------------------------------------------------------------------- */
.settings-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.settings-modal-card {
  color-scheme: light;
  background: #ffffff;
  border-radius: 18px;
  width: 96vw;
  max-width: 1260px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  font-family: 'Kantumruy Pro', Inter, sans-serif;
  animation: modalScaleUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.settings-modal-header {
  padding: 18px 24px;
  background: #0f172a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-modal-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-modal-title h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}

.settings-modal-title p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #94a3b8;
}

.settings-modal-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.15s ease;
}

.settings-modal-close:hover {
  background: rgba(239, 68, 68, 0.85);
  color: #ffffff;
  border-color: rgba(239, 68, 68, 0.9);
}

/* Modal Body: Navigation & Content */
.settings-modal-body {
  display: grid;
  grid-template-columns: 195px minmax(0, 1fr);
  min-height: 520px;
  overflow: hidden;
}

/* Left Sidebar Tabs */
.settings-sidebar {
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-tab-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: #475569;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  width: 100%;
}

.settings-tab-btn:hover {
  background: #edf2f7;
  color: #0f172a;
}

.settings-tab-btn.active {
  background: #ffffff;
  color: #4f46e5;
  border-color: #e2e8f0;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

.settings-tab-icon {
  font-size: 16px;
}

/* Right Content Area */
.settings-content-pane {
  padding: 18px 20px;
  overflow-y: auto;
  max-height: calc(90vh - 75px);
  background: #ffffff;
}

.settings-tab-panel {
  display: none;
  animation: panelFade 0.2s ease;
}

.settings-tab-panel.active {
  display: block;
}

@keyframes panelFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.settings-panel-head {
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}

.settings-panel-head h3 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.settings-panel-head p {
  margin: 0;
  font-size: 13px;
  color: #64748b;
}

/* Form Layouts & Inputs */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

.settings-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.settings-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  color: #0f172a !important;
  background: #ffffff !important;
  transition: all 0.15s ease;
  font-family: inherit;
}

.settings-input:focus {
  outline: none;
  border-color: #6366f1 !important;
  background: #ffffff !important;
  color: #0f172a !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
}

.settings-input::placeholder {
  color: #94a3b8 !important;
}

/* Prevent browser autofill from darkening white settings fields */
.settings-input:-webkit-autofill,
.settings-input:-webkit-autofill:hover, 
.settings-input:-webkit-autofill:focus,
.settings-input:-webkit-autofill:active {
  -webkit-text-fill-color: #0f172a !important;
  -webkit-box-shadow: 0 0 0px 1000px #ffffff inset !important;
  box-shadow: 0 0 0px 1000px #ffffff inset !important;
  transition: background-color 5000s ease-in-out 0s;
  color: #0f172a !important;
}

select.settings-input {
  background-color: #ffffff !important;
  color: #0f172a !important;
}

select.settings-input option {
  background: #ffffff !important;
  color: #0f172a !important;
}

.settings-toggle-mask-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: #64748b;
  padding: 4px;
}

.settings-toggle-mask-btn:hover {
  color: #0f172a;
}

.settings-helper-text {
  font-size: 12px;
  color: #64748b;
  margin-top: 3px;
  line-height: 1.45;
}

/* Status Banner */
.settings-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
}

.settings-status-banner.banner-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.settings-status-banner.banner-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.settings-status-banner.banner-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* Action Buttons */
.settings-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  background: #4f46e5;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.settings-btn-primary:hover {
  background: #4338ca;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.settings-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.settings-btn-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.settings-btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.settings-btn-danger:hover {
  background: #dc2626;
  color: #ffffff;
}

.settings-btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   3. User Management Table & Forms
   -------------------------------------------------------------------------- */
.users-table-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.superadmin-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  user-select: none;
}

.superadmin-status-indicator.superadmin-active {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.superadmin-status-indicator .indicator-hint {
  font-weight: 500;
  color: #059669;
}

.superadmin-status-indicator.superadmin-readonly {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.users-table-container {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  overflow-x: auto;
}

.users-table-container::-webkit-scrollbar {
  height: 6px;
}

.users-table-container::-webkit-scrollbar-track {
  background: #f8fafc;
}

.users-table-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
  table-layout: auto;
}

.users-table th {
  background: #f8fafc;
  padding: 9px 8px;
  text-align: left;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.users-table .th-user-email { width: 22%; min-width: 140px; }
.users-table .th-user-role { width: 10%; min-width: 80px; }
.users-table .th-user-status { width: 9%; min-width: 75px; }
.users-table .th-user-plan { width: 16%; min-width: 115px; }
.users-table .th-user-studio { width: 21%; min-width: 155px; }
.users-table .th-user-date { width: 9%; min-width: 75px; }
.users-table .th-user-actions { width: 13%; min-width: 138px; }

.users-table td {
  padding: 8px 8px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.users-table tr:last-child td {
  border-bottom: none;
}

.users-table tr:hover td {
  background: #fbfcfe;
}

.user-email-col {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.user-cell-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e0e7ff, #ede9fe);
  color: #4f46e5;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  border: 1px solid #c7d2fe;
}

.user-cell-avatar.avatar-superadmin {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #b45309;
  border-color: #fcd34d;
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.25);
}

.user-email-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.user-email-title {
  font-weight: 600;
  color: #0f172a;
  font-size: 12.5px;
  max-width: 165px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-subtags {
  display: flex;
  align-items: center;
  gap: 4px;
}

.user-tag-super {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 4px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  font-size: 9.5px;
  font-weight: 700;
}

.user-tag-self {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: 4px;
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
  font-size: 9.5px;
  font-weight: 600;
}

.user-date-cell {
  color: #64748b;
  font-size: 11.5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.user-inline-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  white-space: nowrap;
}

.user-inline-actions button {
  white-space: nowrap;
  flex-shrink: 0;
  padding: 3px 6px;
  font-size: 11px;
  line-height: 1.25;
  border-radius: 6px;
}

.user-protected-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  background: #f1f5f9;
  color: #94a3b8;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

/* User Create / Edit Card */
.user-form-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 20px;
}

.user-form-card h4 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.user-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.user-form-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

/* Profile Details Card */
.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 24px;
}

.profile-avatar-large {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #9333ea);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.profile-meta-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-meta-info h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.profile-meta-info span {
  font-size: 12px;
  color: #64748b;
}

/* API Connection Test Box */
.api-test-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  margin-top: 10px;
}

.api-test-results {
  margin-top: 10px;
  padding: 10px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-family: monospace;
  font-size: 12px;
  color: #0f172a;
  max-height: 120px;
  overflow-y: auto;
}

/* Responsive adjustments */
/* Responsive adjustments for Mobile Viewers */
@media (max-width: 768px) {
  .settings-modal-card {
    width: 96vw;
    max-height: 94vh;
    border-radius: 14px;
    margin: auto;
  }
  .settings-modal-header {
    padding: 14px 16px;
  }
  .settings-modal-title h2 {
    font-size: 16px;
  }
  .settings-modal-title p {
    font-size: 11px;
  }
  .settings-modal-body {
    grid-template-columns: 1fr;
    min-height: auto;
    max-height: calc(94vh - 66px);
    overflow-y: auto;
  }
  .settings-sidebar {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    white-space: nowrap;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
    padding: 8px 10px;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .settings-sidebar::-webkit-scrollbar {
    display: none;
  }
  .settings-tab-btn {
    white-space: nowrap;
    padding: 7px 12px;
    font-size: 12px;
    border-radius: 8px;
    flex-shrink: 0;
  }
  .settings-tab-panel {
    padding: 16px 14px;
  }
  .settings-panel-head h3 {
    font-size: 16px;
  }
  .user-form-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .user-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .user-modal-dialog {
    width: 95vw !important;
    max-width: 480px !important;
    margin: auto !important;
    border-radius: 14px !important;
  }
  .user-modal-body {
    padding: 16px 14px !important;
  }
  .user-modal-footer {
    padding: 12px 14px !important;
    gap: 8px;
  }
  .user-modal-footer button {
    flex: 1;
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
   7. Super Admin & Studio Permission Styles
   -------------------------------------------------------------------------- */
.superadmin-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid #a7f3d0;
  border-left: 4px solid #10b981;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.06);
}

.superadmin-banner-icon {
  font-size: 26px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}

.superadmin-banner-content {
  flex: 1;
  min-width: 0;
}

.superadmin-banner-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.superadmin-banner-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #065f46;
}

.superadmin-email-tag {
  background: #d1fae5;
  color: #065f46;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #a7f3d0;
  font-family: 'JetBrains Mono', Consolas, monospace;
}

.superadmin-banner-desc {
  margin: 0;
  font-size: 12.5px;
  color: #047857;
  line-height: 1.55;
}

.superadmin-banner-desc strong {
  display: inline;
  color: #065f46;
  font-weight: 700;
}

.studio-perms-checkbox-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.studio-perm-check-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all 0.15s ease;
  user-select: none;
}

.studio-perm-check-label:hover {
  border-color: #6366f1;
  background: #f8fafc;
}

.studio-perm-check-label input:checked + .studio-perm-check-box {
  color: #4f46e5;
  font-weight: 700;
}

.studio-perm-check-box {
  font-size: 13px;
  color: #334155;
}

/* Quick Toggle Switches in Table */
.studio-quick-toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
}

.studio-toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #f8fafc;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  white-space: nowrap;
}

.studio-toggle-switch input {
  display: none;
}

.studio-toggle-switch .switch-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
  display: inline-block;
  transition: all 0.2s ease;
}

/* Active Lyrics */
.studio-toggle-switch.toggle-lyrics.active {
  background: #f5f3ff;
  color: #6b21a8;
  border-color: #c4b5fd;
  box-shadow: 0 1px 3px rgba(107, 33, 168, 0.08);
}

.studio-toggle-switch.toggle-lyrics.active .switch-dot {
  background: #8b5cf6;
  box-shadow: 0 0 6px rgba(139, 92, 246, 0.6);
}

/* Active Mastering */
.studio-toggle-switch.toggle-mastering.active {
  background: #ecfdf5;
  color: #047857;
  border-color: #86efac;
  box-shadow: 0 1px 3px rgba(4, 120, 87, 0.08);
}

.studio-toggle-switch.toggle-mastering.active .switch-dot {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

/* Fallback .active if class not specific */
.studio-toggle-switch.active:not(.toggle-lyrics):not(.toggle-mastering) {
  background: #ecfdf5;
  color: #047857;
  border-color: #6ee7b7;
}

.studio-toggle-switch.active:not(.toggle-lyrics):not(.toggle-mastering) .switch-dot {
  background: #10b981;
}

.studio-toggle-switch:hover {
  transform: translateY(-1px);
  border-color: #cbd5e1;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.studio-toggle-switch.active:hover {
  filter: brightness(0.97);
}

.studio-access-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.studio-access-pill.full-access {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  border: 1px solid #fcd34d;
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.15);
}

.studio-badge-wrap {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
}

.studio-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.studio-badge.granted {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.studio-badge.denied {
  background: #f8fafc;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
}

/* Locked Tab Styling in Header Navigation */
.tab.tab-locked {
  opacity: 0.75;
  cursor: pointer;
  position: relative;
  border-style: dashed;
}

.tab.tab-locked:hover {
  background: #fef2f2 !important;
  color: #991b1b !important;
  border-color: #fca5a5 !important;
}

/* ==========================================================================
   Avatar Management & Interactive Image Cropper Styles
   ========================================================================== */
.user-avatar-circle,
.dropdown-avatar-lg,
.user-cell-avatar {
  overflow: hidden;
  position: relative;
}

.avatar-photo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.user-cell-avatar-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #c7d2fe;
}

.user-cell-avatar-img.avatar-superadmin {
  border-color: #fcd34d;
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.25);
}

.profile-avatar-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.profile-avatar-large {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #4f46e5, #9333ea);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  cursor: pointer;
  border: 2px solid #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-avatar-large:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
}

.profile-avatar-edit-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1e293b;
  border: 2px solid #ffffff;
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: all 0.15s ease;
}

.profile-avatar-edit-badge:hover {
  background: #4f46e5;
  transform: scale(1.1);
}

.profile-avatar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.btn-avatar-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.btn-avatar-upload {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4338ca;
}

.btn-avatar-upload:hover {
  background: #4338ca;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.btn-avatar-google {
  background: #ffffff;
  color: #1e293b;
  border-color: #cbd5e1;
}

.btn-avatar-google:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.btn-avatar-remove {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.2);
}

.btn-avatar-remove:hover {
  background: rgba(239, 68, 68, 0.15);
}

.avatar-status-msg {
  font-size: 12px;
  margin-top: 6px;
  min-height: 18px;
  font-weight: 500;
}

/* Crop Modal Backdrop & Overlay (Centers on top of Settings) */
.avatar-crop-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 7, 18, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 30000; /* Stits on top of Settings Modal (10000) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: cropBackdropFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.avatar-crop-backdrop[hidden] {
  display: none !important;
}

@keyframes cropBackdropFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.crop-modal-dialog {
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  width: 95vw;
  max-width: 440px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: cropModalScaleUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  margin: auto;
  position: relative;
}

@keyframes cropModalScaleUp {
  from { opacity: 0; transform: scale(0.94) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.crop-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.crop-modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.crop-modal-icon {
  font-size: 24px;
}

.crop-modal-title-group h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.crop-modal-title-group p {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: #94a3b8;
}

.crop-modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.crop-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.crop-modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.crop-viewport-wrap {
  width: 300px;
  height: 300px;
  position: relative;
  background: #020617;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.crop-viewport {
  width: 300px;
  height: 300px;
  position: relative;
  cursor: grab;
  user-select: none;
}

.crop-viewport:active {
  cursor: grabbing;
}

#cropCanvas {
  display: block;
  width: 300px;
  height: 300px;
}

.crop-circle-mask {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.75);
  border-radius: 50%;
  margin: 20px;
  border: 2px dashed rgba(255, 255, 255, 0.6);
}

.crop-drag-hint {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10px;
  color: #cbd5e1;
  pointer-events: none;
}

.crop-controls-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.crop-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 12px;
  border-radius: 8px;
}

.crop-control-label {
  font-size: 12px;
  color: #cbd5e1;
  font-weight: 600;
  white-space: nowrap;
}

.crop-btn-mini {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.crop-btn-mini:hover {
  background: rgba(255, 255, 255, 0.2);
}

.crop-range-slider {
  flex: 1;
  cursor: pointer;
  accent-color: #6366f1;
}

.crop-action-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.crop-btn-secondary {
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.crop-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.crop-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.crop-btn-cancel {
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.crop-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.crop-btn-save {
  padding: 8px 16px;
  border-radius: 8px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
  transition: all 0.15s ease;
}

.crop-btn-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.5);
}

/* ==========================================================================
   User Management: Edit User & Delete User Modals
   ========================================================================== */

.user-modal-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 27000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  animation: userModalFade 0.2s ease-out;
}

.user-modal-backdrop[hidden] {
  display: none !important;
}

@keyframes userModalFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.user-modal-dialog {
  background: linear-gradient(180deg, #131c31 0%, #0a0f1d 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(99, 102, 241, 0.15);
  overflow: hidden;
  color: #f8fafc;
  font-family: 'Kantumruy Pro', Inter, sans-serif;
  animation: userModalScale 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes userModalScale {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.user-modal-header {
  padding: 18px 22px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-modal-header.header-danger {
  border-bottom-color: rgba(239, 68, 68, 0.2);
}

.user-modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-modal-icon-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.user-modal-icon-badge.icon-edit {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.user-modal-icon-badge.icon-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.user-modal-title-group h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
}

.user-modal-title-group p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #94a3b8;
}

.user-modal-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.15s ease;
}

.user-modal-close:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ffffff;
  border-color: rgba(239, 68, 68, 0.5);
}

.user-modal-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* User Info Card */
.user-modal-info-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #090e1a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 16px;
}

.user-modal-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #ffffff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.user-modal-info-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.user-modal-email {
  font-size: 14px;
  color: #f8fafc;
  word-break: break-all;
}

.user-modal-tags {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Form Fields */
.user-modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user-modal-field label span {
  font-size: 13px;
  color: #e2e8f0;
}

.user-modal-select,
.user-modal-input {
  width: 100%;
  padding: 10px 14px;
  background: #090e1a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #f8fafc;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.user-modal-select:focus,
.user-modal-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.user-modal-hint {
  font-size: 11.5px;
  color: #94a3b8;
  line-height: 1.4;
}

/* Studio Perms in Modal */
.user-modal-perms-group {
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 12px;
  padding: 12px 14px;
}

.user-modal-perms-label {
  font-size: 12px;
  font-weight: 700;
  color: #c7d2fe;
  display: block;
  margin-bottom: 8px;
}

.user-modal-perms-checks {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.user-perm-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #f1f5f9;
  cursor: pointer;
  user-select: none;
}

.user-perm-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #6366f1;
  cursor: pointer;
}

/* AI API Key Section in Edit User Modal */
.user-modal-subbox {
  background: rgba(10, 15, 29, 0.7);
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-modal-input-addon {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.user-modal-input-addon .user-modal-input {
  padding-right: 42px;
}

.user-btn-toggle-eye {
  position: absolute;
  right: 8px;
  background: transparent !important;
  border: none !important;
  color: #94a3b8 !important;
  cursor: pointer !important;
  padding: 6px !important;
  font-size: 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 6px !important;
  transition: all 0.15s ease !important;
  box-shadow: none !important;
}

.user-btn-toggle-eye:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.1) !important;
  transform: none !important;
}

.user-api-key-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  margin-top: 3px;
  letter-spacing: 0.2px;
}

.user-api-key-badge.key-assigned {
  background: rgba(147, 51, 234, 0.18);
  color: #d8b4fe;
  border: 1px solid rgba(147, 51, 234, 0.4);
}

.user-api-key-badge.key-custom {
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.user-modal-feedback {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12.5px;
}

.user-modal-feedback.feedback-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.user-modal-feedback.feedback-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

/* Footer Buttons */
.user-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-btn-secondary {
  padding: 9px 18px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.user-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.user-btn-primary {
  padding: 9px 20px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  transition: all 0.15s ease;
}

.user-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.5);
}

.user-btn-danger {
  padding: 10px 22px;
  border-radius: 10px;
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  border: 1px solid #ef4444;
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.45);
  transition: all 0.15s ease;
}

.user-btn-danger:hover {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  box-shadow: 0 6px 22px rgba(239, 68, 68, 0.6);
  transform: translateY(-1px);
}

/* Delete User Visual */
.user-delete-center-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 0 4px;
}

.user-delete-glow-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.25) 0%, rgba(239, 68, 68, 0.05) 70%);
  border: 2px solid rgba(239, 68, 68, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 14px;
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.35);
  animation: purgeGlowPulse 2s infinite ease-in-out;
}

.user-delete-lead {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #f8fafc;
}

.user-delete-sub {
  margin: 4px 0 16px;
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.4;
}

.user-delete-card {
  background: rgba(10, 15, 26, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-delete-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.user-delete-label {
  color: #94a3b8;
  font-size: 12px;
}

.user-delete-value {
  color: #f8fafc;
  word-break: break-all;
}

/* Payment Records Styles */
.pay-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.pay-status-pill.status-paid {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.pay-status-pill.status-pending {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
  animation: pulsePending 2s infinite ease-in-out;
}
@keyframes pulsePending {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
.pay-status-pill.status-expired,
.pay-status-pill.status-failed {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
#paymentFilterBtns .settings-btn-secondary.active {
  background: #1e293b;
  color: #ffffff;
  border-color: #1e293b;
}

/* Universal GUI Confirmation Dialog Enhancements */
.user-modal-header.header-success {
  border-bottom-color: rgba(16, 185, 129, 0.25);
}
.user-modal-header.header-warning {
  border-bottom-color: rgba(245, 158, 11, 0.25);
}
.user-modal-icon-badge.icon-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}
.user-modal-icon-badge.icon-warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}
.user-delete-glow-icon.glow-success {
  background: radial-gradient(circle, rgba(16, 185, 129, 0.25) 0%, rgba(16, 185, 129, 0.05) 70%);
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.35);
}
.user-delete-glow-icon.glow-warning {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.25) 0%, rgba(245, 158, 11, 0.05) 70%);
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.35);
}
.user-btn-success {
  padding: 10px 22px;
  border-radius: 10px;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  border: 1px solid #10b981;
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
  transition: all 0.15s ease;
}
.user-btn-success:hover {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 6px 22px rgba(16, 185, 129, 0.6);
  transform: translateY(-1px);
}
.confirm-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  gap: 12px;
}
.confirm-detail-lbl {
  color: #94a3b8;
  font-size: 12px;
}
.confirm-detail-val {
  color: #f8fafc;
  font-weight: 600;
  word-break: break-all;
}

.security-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.security-status-card {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #f8fbff;
}

.security-status-card strong { color: #1e293b; font-size: 13px; }
.security-status-card small { color: #64748b; font-size: 11px; }
.security-status-ok { color: #047857; font-size: 12px; font-weight: 700; }
.security-notice { margin-top: 16px; padding: 12px 14px; border-radius: 9px; background: #fffbeb; color: #92400e; font-size: 12px; line-height: 1.5; }

@media (max-width: 700px) {
  .security-status-grid { grid-template-columns: 1fr; }
}

/* Keep the account dropdown focused; detailed account tools live in Settings. */
#userDropdownMenu #menuOpenSettingsApi,
#userDropdownMenu #menuOpenSettingsUsers,
#userDropdownMenu #menuOpenSettingsPayments,
#userDropdownMenu #menuOpenSettingsProfile {
  display: none !important;
}

#userDropdownMenu #menuOpenAbout {
  display: flex !important;
}

#userDropdownMenu #menuOpenSettingsGeneral .dropdown-text-group strong {
  font-size: 0;
}

#userDropdownMenu #menuOpenSettingsGeneral .dropdown-text-group strong::after {
  content: "Settings (ការកំណត់)";
  font-size: 13px;
}

#userDropdownMenu #menuOpenSettingsGeneral .dropdown-text-group small {
  font-size: 0;
}

#userDropdownMenu #menuOpenSettingsGeneral .dropdown-text-group small::after {
  content: "API, Users, Payments, Profile & System Settings";
  font-size: 11px;
}

@media (max-width: 600px) {
  .user-dropdown-menu > .dropdown-header-box + .dropdown-section-title,
  .user-dropdown-menu > .dropdown-nav-item {
    display: none;
  }

  .user-dropdown-menu {
    width: min(300px, calc(100vw - 20px));
    max-height: calc(100dvh - 92px);
    overflow-y: auto;
    padding: 6px;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.24), 0 3px 10px rgba(15, 23, 42, 0.12);
  }

  .dropdown-header-box { padding: 7px 9px 9px; margin-bottom: 3px; }
  .dropdown-avatar-lg { width: 34px; height: 34px; font-size: 14px; }
  .dropdown-menu-item { min-height: 0; gap: 9px; padding: 6px 8px; border-radius: 9px; }
  .dropdown-icon-sq { width: 28px; height: 28px; border-radius: 7px; font-size: 13px; }
  .dropdown-text-group strong { font-size: 12px; line-height: 1.2; }
  .dropdown-text-group small {
    font-size: 10px;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
  }
  .dropdown-section-title { padding: 6px 8px 2px; font-size: 9px; letter-spacing: 0.35px; }
  .dropdown-divider-line { margin: 4px 0; }
}
