.settings-page { color: var(--text-primary); }
.settings-page .main { padding-bottom: 8px; }

.settings-profile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  padding: 18px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  color: #fff;
  background: linear-gradient(135deg,#5632c3,#7b5ae0);
  box-shadow: 0 8px 24px rgba(86,50,195,.24);
}
.settings-profile::after {
  content: "";
  position: absolute;
  top: -45px;
  right: -35px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.settings-avatar {
  position: relative;
  z-index: 1;
  width: 56px;
  min-width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255,255,255,.35);
  border-radius: 50%;
  color: #5632c3;
  background: #fff;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 5px 14px rgba(0,0,0,.15);
}
.settings-profile-info { position: relative; z-index: 1; flex: 1; min-width: 0; }
.settings-profile-name { margin-bottom: 3px; font-size: 17px; font-weight: 700; line-height: 1.25; letter-spacing: -.25px; }
.settings-profile-email { overflow: hidden; color: rgba(255,255,255,.72); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.settings-profile-edit {
  position: relative;
  z-index: 2;
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(255,255,255,.16);
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}
.settings-profile-edit:hover { background: rgba(255,255,255,.24); }
.settings-profile-edit:active { transform: scale(.9); }
.settings-profile-edit svg { width: 16px; height: 16px; }

.settings-group-title {
  margin: 0 0 8px 4px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .8px;
  text-transform: uppercase;
}
.settings-card {
  margin: 0 0 20px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
}
.settings-row {
  width: 100%;
  min-height: 62px;
  padding: 12px 15px;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .18s ease;
}
.settings-row:last-child { border-bottom: 0; }
.settings-row:hover:not(.settings-row-static) { background: var(--section-bg); }
.settings-row:active:not(.settings-row-static) { background: var(--section-bg); }
.settings-row-static { cursor: default; }
.settings-row-icon {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,.1);
}
.settings-row-icon svg { width: 17px; height: 17px; }
.settings-row-icon.blue { background: linear-gradient(135deg,#3a8ee8,#5ba4f0); }
.settings-row-icon.orange { background: linear-gradient(135deg,#e8913a,#d47a25); }
.settings-row-icon.purple { background: linear-gradient(135deg,#5632c3,#7b5ae0); }
.settings-row-icon.green { background: linear-gradient(135deg,#49cd8b,#3ab575); }
.settings-row-icon.pink { background: linear-gradient(135deg,#d94f8a,#e86d9e); }
.settings-row-icon.fitbit { background:#00b0b9; }
.settings-row-icon.google { background:#4285f4; }
.settings-row-icon.microsoft { background:#0364b8; }
.settings-row-icon.neutral { background:linear-gradient(135deg,#6b6b76,#9b99a2); }
.settings-row-body { flex: 1; min-width: 0; display: block; }
.settings-row-label { display: block; color: var(--text-primary); font-size: 13px; font-weight: 600; line-height: 1.35; }
.settings-row-sub { display: block; margin-top: 2px; color: var(--text-muted); font-size: 10px; line-height: 1.35; }
.settings-row-sub.connected { color: var(--accent-secondary); font-weight: 600; }
.settings-row-value { color: var(--text-secondary); font-size: 11px; font-weight: 600; white-space: nowrap; }
.settings-row-arrow { width: 18px; height: 18px; color: var(--text-muted); }
.settings-row-arrow svg { width: 16px; height: 16px; }

.settings-toggle {
  position: relative;
  width: 42px;
  min-width: 42px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--border-medium);
  cursor: pointer;
  transition: background .22s ease;
}
.settings-toggle span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,.22);
  transition: transform .22s cubic-bezier(.34,1.56,.64,1);
}
.settings-toggle.on { background: var(--accent-primary); }
.settings-toggle.on span { transform: translateX(18px); }

.lang-switch {
  display: flex;
  padding: 3px;
  border-radius: 10px;
  background: var(--section-bg);
}
.lang-option {
  min-width: 40px;
  height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: transparent;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}
.lang-option.active { color: var(--accent-primary); background: var(--card-bg); box-shadow: var(--shadow-sm); }

.settings-logout,
.settings-login {
  width: 100%;
  min-height: 48px;
  margin: 4px 0 12px;
  border: 1px solid rgba(239,68,68,.18);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #ef4444;
  background: rgba(239,68,68,.06);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}
.settings-logout:hover { background: rgba(239,68,68,.1); }
.settings-logout:active,.settings-login:active { transform: scale(.98); }
.settings-logout svg { width: 16px; height: 16px; }
.settings-login { border-color:rgba(86,50,195,.18); color:var(--accent-primary); background:rgba(86,50,195,.07); }
.settings-version { color: var(--text-muted); font-size: 9px; font-weight: 500; text-align: center; }
.settings-spacer { height: 20px; }

.settings-row:focus-visible,.settings-toggle:focus-visible,.lang-option:focus-visible,.settings-profile-edit:focus-visible,.settings-logout:focus-visible,.settings-login:focus-visible {
  outline: 3px solid rgba(86,50,195,.25);
  outline-offset: -3px;
}
[dir="rtl"] .settings-group-title { margin-right: 4px; margin-left: 0; }
[dir="rtl"] .settings-row { text-align: right; }
[dir="rtl"] .settings-row-arrow svg { transform: rotate(180deg); }
[dir="rtl"] .settings-toggle span { right: 3px; left: auto; }
[dir="rtl"] .settings-toggle.on span { transform: translateX(-18px); }
[dir="rtl"] .settings-profile::after { right:auto; left:-35px; }

@media(max-width:370px) {
  .settings-profile { padding:15px; gap:11px; }
  .settings-avatar { width:50px; min-width:50px; height:50px; }
  .settings-row { padding-right:12px; padding-left:12px; gap:10px; }
  .settings-row-icon { width:32px; min-width:32px; height:32px; }
  .lang-option { min-width:36px; padding:0 6px; }
}
@media(prefers-reduced-motion:reduce) {
  .settings-page * { transition:none!important; }
}
