/* ══════════════════════════════════════════════════════
   PROFILE PAGE — D3 CORE
   Relies on CSS variables defined in sistema.css
   ══════════════════════════════════════════════════════ */

/* ── Page header (mirrors dashboard.css — needed if dashboard not loaded) ── */
.page-header  { margin-bottom: 2rem; }
.page-title   { font-size: 1.6rem; font-weight: 700; color: var(--text-color); margin: 0 0 0.25rem 0; }
.page-subtitle{ font-size: 0.875rem; color: #999; margin: 0; }
body.dark .page-title { color: #e2e8f0; }

/* ── admin-button (canonical, mirrors clients.css — needed when profile is first route) ── */
.admin-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 600;
  border-radius: 8px;
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}
.admin-button:hover    { transform: translateY(-1.5px); box-shadow: 0 4px 14px rgba(29,78,216,0.4); background-color: #1554C8; }
.admin-button:active   { transform: translateY(0); box-shadow: none; }
.admin-button:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Tabs nav ──────────────────────────────────────── */
.profile-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.75rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.profile-tabs::-webkit-scrollbar { display: none; }

.profile-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
  white-space: nowrap;
}
.profile-tab i { font-size: 1.05rem; }
.profile-tab:hover:not(.active) {
  color: var(--text-color);
  background: var(--primary-color-light);
}
.profile-tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  font-weight: 600;
}
body.dark .profile-tab { color: #94a3b8; }
body.dark .profile-tab.active { color: #60a5fa; border-bottom-color: #60a5fa; }

/* ── Panels ────────────────────────────────────────── */
.profile-panel { display: none; }
.profile-panel.active { display: block; }

/* ── Grid ──────────────────────────────────────────── */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
  align-items: start;
}
.profile-grid-security { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.profile-grid-prefs    { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.profile-grid-access   { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* ── Cards ─────────────────────────────────────────── */
.profile-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
}
.profile-card--muted { opacity: 0.88; }
body.dark .profile-card { background: #141b2d; border-color: #1e293b; }
body.dark .profile-card--muted { opacity: 0.75; }

.profile-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0 0 1.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.profile-card-title i { font-size: 1.1rem; color: var(--primary-color); }
body.dark .profile-card-title { color: #e2e8f0; }

/* ── Avatar ────────────────────────────────────────── */
/* Keep avatar card in the same grid row as the form card (side-by-side) */
.profile-avatar-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.profile-avatar-wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.profile-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--primary-color-light);
  border: 3px solid var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.profile-avatar-initials {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-color);
  user-select: none;
  letter-spacing: -0.03em;
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-avatar-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 0.2rem 0;
}
.profile-avatar-email {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem 0;
}
.profile-avatar-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}
body.dark .profile-avatar-name { color: #e2e8f0; }

/* ── Badges ────────────────────────────────────────── */
.profile-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--primary-color-light);
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.profile-badge--soon {
  background: #fef3c7;
  color: #92400e;
  font-size: 0.68rem;
}
body.dark .profile-badge--soon { background: #1c1906; color: #d97706; }

/* ── Form ──────────────────────────────────────────── */
.profile-form { display: flex; flex-direction: column; gap: 1rem; }

.profile-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 600px) { .profile-field-row { grid-template-columns: 1fr; } }

.profile-field { display: flex; flex-direction: column; gap: 0.35rem; }

.profile-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.profile-field input {
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--body-color);
  color: var(--text-color);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.18s, box-shadow 0.18s;
  outline: none;
}
.profile-field input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(29,78,216,0.1);
}
.profile-field input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: transparent;
}
body.dark .profile-field input {
  background: #0f172a;
  border-color: #1e293b;
  color: #e2e8f0;
}
body.dark .profile-field input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96,165,250,0.12);
}
body.dark .profile-field label { color: #94a3b8; }

.profile-field-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.15rem; }

/* ── Password field ────────────────────────────────── */
.profile-pwd-wrap { position: relative; display: flex; }
.profile-pwd-wrap input { flex: 1; padding-right: 2.5rem; }
.profile-pwd-toggle {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.05rem;
  padding: 0.2rem;
  display: flex;
  align-items: center;
}
.profile-pwd-toggle:hover { color: var(--primary-color); }

/* Password strength bar */
.profile-pwd-strength {
  display: flex;
  gap: 4px;
  margin-top: 0.4rem;
}
.pwd-segment {
  height: 4px;
  flex: 1;
  border-radius: 2px;
  background: var(--border);
  transition: background 0.3s;
}
.pwd-strength-1 .pwd-segment:nth-child(1) { background: #ef4444; }
.pwd-strength-2 .pwd-segment:nth-child(-n+2) { background: #f97316; }
.pwd-strength-3 .pwd-segment:nth-child(-n+3) { background: #eab308; }
.pwd-strength-4 .pwd-segment { background: #22c55e; }

/* ── Form actions ──────────────────────────────────── */
.profile-form-actions { display: flex; justify-content: flex-end; margin-top: 0.25rem; }

.admin-button--danger {
  background: transparent;
  color: #ef4444;
  border: 1.5px solid #ef4444;
}
.admin-button--danger:hover {
  background: #fee2e2;
  border-color: #dc2626;
  color: #dc2626;
}
body.dark .admin-button--danger:hover { background: #1f0707; }

/* ── Info list ─────────────────────────────────────── */
.profile-info-list { display: flex; flex-direction: column; gap: 0.6rem; }
.profile-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
  flex-wrap: wrap;
}
.profile-info-row:last-child { border-bottom: none; }
.profile-info-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.profile-info-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-color);
  text-align: right;
}
body.dark .profile-info-value { color: #e2e8f0; }

/* ── Hint text ─────────────────────────────────────── */
.profile-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Preferences toggles ───────────────────────────── */
.profile-pref-group { display: flex; flex-direction: column; gap: 0.75rem; }
.profile-pref-group--disabled { opacity: 0.5; pointer-events: none; }

.profile-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  padding: 0.5rem 0;
}
.profile-toggle-label { display: flex; flex-direction: column; gap: 0.15rem; }
.profile-toggle-label strong { font-size: 0.9rem; color: var(--text-color); font-weight: 600; }
.profile-toggle-label small  { font-size: 0.78rem; color: var(--text-muted); font-weight: 400; }
body.dark .profile-toggle-label strong { color: #e2e8f0; }

.profile-toggle-switch {
  position: relative;
  flex-shrink: 0;
  width: 42px;
  height: 24px;
  display: inline-block;
}
.profile-toggle-switch input[type="checkbox"] {
  opacity: 0;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  margin: 0;
  z-index: 1;
}
.profile-toggle-knob {
  display: block;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--border);
  transition: background 0.2s;
  position: relative;
}
.profile-toggle-knob::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.profile-toggle-switch input:checked ~ .profile-toggle-knob { background: var(--primary-color); }
.profile-toggle-switch input:checked ~ .profile-toggle-knob::after { transform: translateX(18px); }
body.dark .profile-toggle-knob { background: #1e293b; }
body.dark .profile-toggle-switch input:checked ~ .profile-toggle-knob { background: #3b82f6; }

/* ── Theme chooser ─────────────────────────────────── */
.profile-theme-options {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.profile-theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  border: 2px solid var(--border);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: border-color 0.18s, background 0.18s, color 0.18s;
  user-select: none;
  min-width: 80px;
}
.profile-theme-option input { display: none; }
.profile-theme-option i { font-size: 1.4rem; }
/* Selected state — JS adds class .is-selected as :has() fallback */
.profile-theme-option:has(input:checked),
.profile-theme-option.is-selected {
  border-color: var(--primary-color);
  background: var(--primary-color-light);
  color: var(--primary-color);
}
.profile-theme-option:hover:not(:has(input:checked)):not(.is-selected) {
  border-color: #94a3b8;
  background: var(--primary-color-light);
}
body.dark .profile-theme-option:has(input:checked),
body.dark .profile-theme-option.is-selected {
  border-color: #60a5fa;
  color: #60a5fa;
  background: rgba(96,165,250,0.08);
}

/* ── Preferences save row ──────────────────────────── */
.profile-pref-save-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

/* ── Permissions list ──────────────────────────────── */
.profile-permissions-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.profile-permission-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-color);
}
.profile-permission-item:last-child { border-bottom: none; }
.profile-permission-item i { color: var(--primary-color); font-size: 1rem; }
body.dark .profile-permission-item { color: #cbd5e1; }

/* ── Status badge ──────────────────────────────────── */
.profile-status-badge {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.profile-status-badge--active {
  background: #dcfce7;
  color: #16a34a;
}
body.dark .profile-status-badge--active { background: #052e16; color: #4ade80; }

/* ── User card action button (bottom of sidebar card) ── */
.profile-user-card-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  margin-top: 1rem;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}
.profile-user-card-action i { font-size: 1rem; }
.profile-user-card-action:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: var(--primary-color-light);
}
body.dark .profile-user-card-action {
  border-color: #1e293b;
  color: #64748b;
}
body.dark .profile-user-card-action:hover {
  border-color: #3b82f6;
  color: #60a5fa;
  background: rgba(96,165,250,0.08);
}

/* ── Password modal ────────────────────────────────── */
.profile-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: pmOverlayIn 0.18s ease;
}
@keyframes pmOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.profile-modal {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  width: 100%;
  max-width: 460px;
  padding: 1.75rem;
  animation: pmModalIn 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes pmModalIn {
  from { opacity: 0; transform: scale(0.94) translateY(12px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}
body.dark .profile-modal {
  background: #141b2d;
  border-color: #1e293b;
}

.profile-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
body.dark .profile-modal-header { border-bottom-color: #1e293b; }

.profile-modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.profile-modal-title i { color: var(--primary-color); font-size: 1.1rem; }
body.dark .profile-modal-title { color: #e2e8f0; }

.profile-modal-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0;
}

.profile-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.4rem;
  padding: 0.1rem;
  display: flex;
  align-items: center;
  border-radius: 6px;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}
.profile-modal-close:hover {
  color: var(--text-color);
  background: var(--primary-color-light);
}
body.dark .profile-modal-close:hover { background: #1e293b; color: #e2e8f0; }

.profile-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
body.dark .profile-modal-footer { border-top-color: #1e293b; }

/* Ghost button variant */
.admin-button--ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}
.admin-button--ghost:hover {
  background: var(--body-color);
  color: var(--text-color);
  border-color: #94a3b8;
  transform: none;
  box-shadow: none;
}
body.dark .admin-button--ghost { border-color: #1e293b; }
body.dark .admin-button--ghost:hover { background: #1e293b; color: #e2e8f0; }

/* ── Card integrated header (title+desc anchored inside card) ── */
.profile-card-inset-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.profile-card-inset-header .profile-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
  flex-wrap: wrap;
}
.profile-card-inset-header .profile-section-title i {
  font-size: 1.1rem;
  color: var(--primary-color);
}
.profile-card-inset-header .profile-section-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.3rem 0 0;
  line-height: 1.4;
}
body.dark .profile-card-inset-header { border-bottom-color: #1e293b; }
body.dark .profile-card-inset-header .profile-section-title { color: #e2e8f0; }

/* ── Preferences 2-column layout ──────────────────── */
.profile-prefs-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
.profile-prefs-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.profile-prefs-layout .profile-pref-save-row {
  grid-column: 1 / -1;
}

/* ── Pref sublabel (e.g. "Tema da interface") ──────── */
.profile-pref-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.75rem;
}
body.dark .profile-pref-label { color: #64748b; }

/* ══════════════════════════════════════════════════════
   PERFIL TAB — Sidebar + Content layout
   ══════════════════════════════════════════════════════ */

/* ── Profile layout (sidebar + content columns) ────── */
.profile-layout {
  display: grid;
  grid-template-columns: 272px 1fr;
  gap: 1.75rem;
  align-items: start;
}

/* ── Sidebar ───────────────────────────────────────── */
.profile-sidebar {
  position: sticky;
  top: 1.5rem;
}

/* ── Enhanced user card ────────────────────────────── */
.profile-user-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  padding: 2.3rem 1.5rem;
}

.profile-avatar--lg {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--primary-color-light);
  border: 3px solid var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  margin-bottom: 0.5rem;
  box-shadow: 0 0 0 6px rgba(29,78,216,0.08);
}
.profile-avatar--lg .profile-avatar-initials {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
}
.profile-avatar--lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
body.dark .profile-avatar--lg {
  box-shadow: 0 0 0 6px rgba(96,165,250,0.1);
}

.profile-user-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0.25rem 0 0.1rem 0;
  line-height: 1.3;
}
.profile-user-email {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 0.4rem 0;
  word-break: break-all;
}
body.dark .profile-user-name { color: #e2e8f0; }

/* ── User card meta section ────────────────────────── */
.profile-user-meta {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--border);
  margin-top: 0.75rem;
  padding-top: 0.25rem;
}
.profile-user-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.profile-user-meta-row:last-child { border-bottom: none; }
.profile-user-meta-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}
.profile-user-meta-label i { font-size: 0.9rem; }
.profile-user-meta-value {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-color);
  text-align: right;
}
body.dark .profile-user-meta-value { color: #e2e8f0; }

/* ── Content area ──────────────────────────────────── */
.profile-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── Profile sections ──────────────────────────────── */
.profile-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.profile-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.profile-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
  letter-spacing: -0.01em;
}
.profile-section-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.2rem 0 0;
  line-height: 1.4;
}
body.dark .profile-section-title { color: #e2e8f0; }

/* ── Active sessions list ──────────────────────────── */
.profile-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.profile-card-title-row .profile-card-title { margin-bottom: 0; }

.profile-sessions-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.profile-session-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--body-color);
  transition: border-color 0.18s;
}
.profile-session-item--current {
  border-color: var(--primary-color);
  background: var(--primary-color-light);
}
body.dark .profile-session-item { background: #0f172a; border-color: #1e293b; }
body.dark .profile-session-item--current { background: rgba(96,165,250,0.07); border-color: #3b82f6; }

.profile-session-icon {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: var(--primary-color-light);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
body.dark .profile-session-icon { background: rgba(96,165,250,0.12); color: #60a5fa; }

.profile-session-info { flex: 1; min-width: 0; }
.profile-session-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-session-detail {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
body.dark .profile-session-name { color: #e2e8f0; }

.profile-session-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: #dcfce7;
  color: #16a34a;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
body.dark .profile-session-badge { background: #052e16; color: #4ade80; }

/* ── Small button variant ──────────────────────────── */
.admin-button--sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 900px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }
  .profile-sidebar {
    position: static;
  }
  .profile-user-card {
    flex-direction: row;
    flex-wrap: wrap;
    text-align: left;
    align-items: center;
    gap: 1rem;
  }
  .profile-avatar--lg { margin-bottom: 0; flex-shrink: 0; }
  .profile-user-meta { margin-top: 0; padding-top: 0; border-top: none; width: 100%; }
}
@media (max-width: 768px) {
  .profile-grid,
  .profile-grid-security,
  .profile-grid-prefs,
  .profile-grid-access,
  .profile-prefs-layout {
    grid-template-columns: 1fr;
  }
  .profile-theme-options { justify-content: stretch; }
  .profile-theme-option  { flex: 1; }
  .profile-prefs-layout .profile-pref-save-row { grid-column: 1; }
  .profile-card-title-row { flex-direction: column; align-items: flex-start; }
}
