/* ===== PROFILE SETTINGS PAGE ===== */

.navbar {
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.18s;
}
.nav-link:hover { color: var(--text); }

/* User dropdown */
.user-dropdown { position: relative; }
.user-dropdown-trigger {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; background: none; border: none;
  font-family: inherit; padding: 4px 8px; border-radius: 8px;
  transition: background 0.18s;
}
.user-dropdown-trigger:hover { background: #f5f5f5; }
.user-avatar-sm {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #ff6b5b);
  color: #fff; font-weight: 800; font-size: 0.78rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.user-name-sm { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.user-dropdown-trigger svg { color: var(--text-2); transition: transform 0.2s; }
.user-dropdown.open .user-dropdown-trigger svg { transform: rotate(180deg); }
.user-dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 210px; background: var(--bg);
  border: 1.5px solid var(--border); border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  padding: 6px; z-index: 300;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
}
.user-dropdown.open .user-dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.user-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; font-size: 0.88rem;
  font-weight: 500; color: var(--text); text-decoration: none; transition: background 0.15s;
}
.user-dropdown-item:hover { background: #f5f5f5; }
.user-dropdown-item.active { background: rgba(232,68,58,0.06); color: var(--accent); font-weight: 600; }
.user-dropdown-item svg { color: var(--text-2); flex-shrink: 0; }
.user-dropdown-divider { height: 1px; background: var(--border); margin: 6px 0; }
.user-dropdown-logout { color: var(--accent) !important; }
.user-dropdown-logout svg { color: var(--accent) !important; }
.mob-divider { height: 1px; background: var(--border); margin: 8px 16px; }

/* ===== PAGE ===== */
.ps-page {
  background: var(--bg-2);
  min-height: 100vh;
  padding: 32px 0 60px;
}

/* ===== LAYOUT ===== */
.ps-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}

/* ===== SIDEBAR NAV ===== */
.ps-nav {
  position: sticky;
  top: 80px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 8px;
}

.ps-nav-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  padding: 10px 12px 6px;
}

.ps-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  background: none;
  border: none;
  font-family: inherit;
  width: 100%;
  text-align: left;
}
.ps-nav-item:hover { background: var(--bg-2); color: var(--text); }
.ps-nav-item.active {
  background: rgba(232,68,58,0.07);
  color: var(--accent);
  font-weight: 600;
}
.ps-nav-item svg { flex-shrink: 0; }
.ps-nav-item.danger { color: var(--accent); }
.ps-nav-item.danger:hover { background: #fff5f5; }

.ps-nav-divider { height: 1px; background: var(--border); margin: 6px 0; }

/* ===== SECTION PANELS ===== */
.ps-panel { display: none; }
.ps-panel.active { display: block; }

/* Card */
.ps-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 16px;
}
.ps-card:last-child { margin-bottom: 0; }

.ps-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.ps-card-sub {
  font-size: 0.83rem;
  color: var(--text-2);
  margin-bottom: 22px;
}

.ps-divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* Form elements */
.ps-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.ps-form-row.single { grid-template-columns: 1fr; }

.ps-field { display: flex; flex-direction: column; gap: 6px; }

.ps-label {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text);
}
.ps-label span {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-2);
  margin-left: 4px;
}

.ps-input,
.ps-select {
  width: 100%;
  padding: 0 14px;
  height: 42px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.18s;
  box-sizing: border-box;
}
.ps-input:focus,
.ps-select:focus { border-color: var(--accent); }
.ps-input:disabled {
  background: var(--bg-2);
  color: var(--text-2);
  cursor: not-allowed;
}

.ps-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.ps-input-hint {
  font-size: 0.78rem;
  color: var(--text-2);
}

/* Avatar block */
.ps-avatar-block {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
}
.ps-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-size: 1.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: -0.04em;
}
.ps-avatar-actions { display: flex; flex-direction: column; gap: 8px; }
.ps-avatar-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-2);
  background: var(--bg);
  cursor: pointer;
  transition: all 0.18s;
}
.ps-avatar-btn:hover { border-color: var(--text); color: var(--text); }
.ps-avatar-btn.accent {
  border-color: var(--accent);
  color: var(--accent);
  background: #fff5f5;
}
.ps-avatar-hint {
  font-size: 0.76rem;
  color: var(--text-2);
}

/* Toggle switch */
.ps-toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.ps-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.ps-toggle-slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 22px;
  cursor: pointer;
  transition: background 0.2s;
}
.ps-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  border-radius: 50%; background: #fff;
  left: 3px; top: 3px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.ps-toggle input:checked + .ps-toggle-slider { background: var(--accent); }
.ps-toggle input:checked + .ps-toggle-slider::before { transform: translateX(18px); }

/* Toggle row */
.ps-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.ps-toggle-row:first-of-type { padding-top: 0; }
.ps-toggle-row:last-of-type  { border-bottom: none; padding-bottom: 0; }
.ps-toggle-label { font-size: 0.9rem; font-weight: 500; color: var(--text); }
.ps-toggle-sub   { font-size: 0.79rem; color: var(--text-2); margin-top: 2px; }

/* Info row (for email/phone read-only display) */
.ps-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.ps-info-row:last-child { border-bottom: none; padding-bottom: 0; }
.ps-info-label { font-size: 0.83rem; font-weight: 600; color: var(--text-2); margin-bottom: 2px; }
.ps-info-value { font-size: 0.9rem; font-weight: 500; color: var(--text); }
.ps-info-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.73rem;
  font-weight: 600;
  background: #ecfdf5;
  color: #059669;
  margin-left: 8px;
}
.ps-info-badge svg { flex-shrink: 0; }
.ps-info-action {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
  transition: opacity 0.18s;
  flex-shrink: 0;
}
.ps-info-action:hover { opacity: 0.75; }

/* Password strength */
.ps-strength {
  margin-top: 6px;
  display: flex;
  gap: 4px;
  align-items: center;
}
.ps-strength-bar {
  height: 4px;
  flex: 1;
  border-radius: 2px;
  background: var(--bg-3);
  transition: background 0.2s;
}
.ps-strength-bar.weak   { background: var(--accent); }
.ps-strength-bar.medium { background: #f59e0b; }
.ps-strength-bar.strong { background: #10b981; }
.ps-strength-label {
  font-size: 0.75rem;
  color: var(--text-2);
  margin-left: 4px;
  width: 60px;
  text-align: right;
}

/* Sessions list */
.ps-sessions { display: flex; flex-direction: column; gap: 10px; }
.ps-session {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-2);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.ps-session-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--text-2);
}
.ps-session-body { flex: 1; min-width: 0; }
.ps-session-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.ps-session-current {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  background: #ecfdf5;
  color: #059669;
  border-radius: 20px;
}
.ps-session-meta { font-size: 0.78rem; color: var(--text-2); margin-top: 2px; }
.ps-session-del {
  background: none;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex; align-items: center;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.ps-session-del:hover { color: var(--accent); background: #fff5f5; }

/* Danger zone */
.ps-danger-card {
  border-color: #fecaca;
  background: #fff5f5;
}
.ps-danger-card .ps-card-title { color: var(--accent); }

.ps-danger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid #fecaca;
}
.ps-danger-row:last-child { border-bottom: none; padding-bottom: 0; }
.ps-danger-label { font-size: 0.9rem; font-weight: 500; color: var(--text); }
.ps-danger-sub   { font-size: 0.79rem; color: var(--text-2); margin-top: 2px; }
.ps-danger-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: none;
  border: 1.5px solid #fca5a5;
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  flex-shrink: 0;
}
.ps-danger-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Save bar */
.ps-save-bar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

/* ===== MODAL ===== */
.ps-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 500;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; visibility: hidden;
  transition: opacity 0.22s, visibility 0.22s;
}
.ps-modal-overlay.open { opacity: 1; visibility: visible; }
.ps-modal {
  background: var(--bg); border-radius: 18px; padding: 28px;
  width: 100%; max-width: 420px;
  transform: translateY(14px); transition: transform 0.22s;
}
.ps-modal-overlay.open .ps-modal { transform: translateY(0); }
.ps-modal-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px;
}
.ps-modal-title { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.ps-modal-close {
  width: 30px; height: 30px; border: none; background: var(--bg-2);
  border-radius: 8px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; color: var(--text-2);
}
.ps-modal-close:hover { background: var(--bg-3); }
.ps-modal-body { font-size: 0.88rem; color: var(--text-2); line-height: 1.6; margin-bottom: 20px; }
.ps-modal-body strong { color: var(--text); }
.ps-modal-field { margin-bottom: 16px; }
.ps-modal-label { font-size: 0.83rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.ps-modal-input {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: 10px; font-family: inherit; font-size: 0.9rem;
  color: var(--text); background: var(--bg); outline: none;
  transition: border-color 0.18s; box-sizing: border-box;
}
.ps-modal-input:focus { border-color: var(--accent); }
.ps-modal-footer { display: flex; justify-content: flex-end; gap: 10px; }
.ps-modal-cancel {
  padding: 9px 18px; background: none; border: 1.5px solid var(--border);
  border-radius: 9px; font-family: inherit; font-size: 0.88rem;
  font-weight: 500; color: var(--text-2); cursor: pointer; transition: border-color 0.18s;
}
.ps-modal-cancel:hover { border-color: var(--text); }
.ps-modal-confirm {
  padding: 9px 18px; background: var(--accent); color: #fff;
  border: none; border-radius: 9px; font-family: inherit;
  font-size: 0.88rem; font-weight: 600; cursor: pointer; transition: background 0.18s;
}
.ps-modal-confirm:hover { background: #c0392b; }
.ps-modal-confirm.danger { background: var(--accent); }

/* ===== TOAST ===== */
.ps-toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #1a1a1a; color: #fff;
  padding: 11px 20px; border-radius: 30px;
  font-size: 0.88rem; font-weight: 500; z-index: 600;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.ps-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.ps-toast svg { color: #4ade80; }

/* ===== RESPONSIVE ===== */
@media (max-width: 800px) {
  .ps-layout { grid-template-columns: 1fr; }
  .ps-nav { position: static; display: flex; flex-wrap: wrap; gap: 4px; padding: 10px; }
  .ps-nav-title { display: none; }
  .ps-nav-divider { display: none; }
  .ps-nav-item { width: auto; padding: 7px 14px; }
}
@media (max-width: 560px) {
  .ps-form-row { grid-template-columns: 1fr; }
  .ps-card { padding: 20px; }
  .ps-danger-row { flex-direction: column; align-items: flex-start; }
}
