/* ============================================
   MakLinkApp – settings.css
   ============================================ */

.app-body { background: var(--cream); min-height: 100vh; }

/* Top bar */
.topbar {
  height: 56px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-back  { font-size: 0.875rem; color: var(--text-muted); }
.topbar-title { font-size: 1rem; font-weight: 600; color: var(--navy); flex: 1; }
.topbar-actions { display: flex; gap: 10px; }

/* Settings layout */
.settings-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  max-width: 980px;
  margin: 32px auto;
  gap: 24px;
  padding: 0 24px;
}

/* Sidebar nav */
.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px;
  height: fit-content;
  position: sticky;
  top: 72px;
}
.sn-item {
  background: none;
  border: none;
  text-align: left;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.sn-item:hover  { background: var(--cream-dark); color: var(--navy); }
.sn-item.active { background: var(--gold-light); color: var(--navy); font-weight: 600; }
.sn-item.sn-danger { color: #A32D2D; }
.sn-item.sn-danger:hover { background: #FCEBEB; }
.sn-divider { height: 1px; background: var(--border); margin: 6px 0; }

/* Content */
.settings-content { min-width: 0; }
.settings-tab { display: none; }
.settings-tab.active { display: block; }

.settings-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.settings-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 16px;
}
.settings-card-head {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* Profile section */
.avatar-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
  padding: 18px 22px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.profile-avatar {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: rgba(196,154,42,0.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 700;
  color: var(--gold-dark);
  flex-shrink: 0;
}
.profile-name-display { font-size: 1rem; font-weight: 600; color: var(--navy); }
.profile-role-display { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }

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

/* Session items */
.session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.session-item:last-child { border-bottom: none; }
.session-device { font-size: 0.875rem; font-weight: 500; color: var(--text-primary); }
.session-meta   { font-size: 0.8rem; color: var(--text-muted); }
.badge-active { background: #EAF3DE; color: #3B6D11; font-size: 0.75rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; }

/* Connected apps */
.connected-app-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.connected-app-item:last-child { border-bottom: none; }
.ca-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.ca-name { font-size: 0.875rem; font-weight: 500; color: var(--text-primary); }
.ca-meta { font-size: 0.78rem; color: var(--text-muted); }
.badge-dev { background: var(--gold-light); color: #854F0B; font-size: 0.75rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; margin-left: auto; }
.connected-app-item .badge-active { margin-left: auto; }

@media (max-width: 700px) {
  .settings-shell { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; flex-wrap: wrap; }
}
