/* ===== SHARED SHELL: TOPBAR + SIDEBAR ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: #f2f4f8;
}

/* ---- TOPBAR ---- */
.settings-topbar {
  background: #ffffff;
  border-bottom: 1px solid #e8ecf0;
  height: 80px;
  padding: 0 30px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.acc-topbar-logo {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  text-decoration: none;
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.acc-topbar-help {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  color: #374151;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.acc-topbar-help:hover { background: #f0eeff; border-color: #c4b5fd; color: #7c3aed; }

.acc-topbar-login {
  display: inline-flex;
  align-items: center;
  padding: 9px 22px;
  border-radius: 999px;
  background: #7c3aed;
  color: white;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
  border: none;
}
.acc-topbar-login:hover { background: #6d28d9; transform: translateY(-1px); }
.acc-topbar-login:active { transform: translateY(0); }
.acc-topbar-help-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid #374151;
  color: #374151;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
}

/* ---- LAYOUT ---- */
.settings-body {
  display: flex;
  min-height: calc(100vh - 80px);
}
.settings-content {
  flex: 1 1 0;
  background: #f0f1f5;
  min-height: calc(100vh - 80px);
  align-self: stretch;
}

/* ---- SIDEBAR ---- */
.settings-sidebar {
  width: 288px;
  min-width: 288px;
  background: #ffffff;
  box-shadow: 1px 0 0 #e8ecf0;
  border-right: none;
  padding: 0;
  min-height: calc(100vh - 80px);
  position: sticky;
  top: 80px;
  height: calc(100vh - 80px);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
}

.sidebar-section-label {
  padding: 18px 14px 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  color: #9ca3af;
  text-transform: uppercase;
  font-family: 'Inter', sans-serif;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  margin: 1px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.12s;
  font-family: 'Inter', sans-serif;
  border: none;
  background: transparent;
  width: calc(100% - 28px);
  text-align: left;
  box-sizing: border-box;
}
.sidebar-nav-item svg { flex-shrink: 0; color: #6b7280; }
.sidebar-nav-item:hover { background: #f5f3ff; color: #5b21b6; }
.sidebar-nav-item:hover svg { color: #7c3aed; }
.sidebar-nav-item.active { background: #ede9fe; color: #5b21b6; font-weight: 600; }
.sidebar-nav-item.active svg { color: #7c3aed; }
.sidebar-nav-disabled {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}

/* Sidebar user card */
.sidebar-user-card {
  margin: 8px 10px;
  padding: 10px 12px;
  background: #f5f3ff;
  border: none;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s;
}
.sidebar-user-card:hover { background: #ede9fe; }
.sidebar-user-av {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: 'Inter', sans-serif;
}
.sidebar-user-card-name { font-size: 12.5px; font-weight: 600; color: #1e293b; font-family: 'Inter', sans-serif; }
.sidebar-user-card-id { font-size: 11px; color: #6b7280; font-family: 'Inter', sans-serif; }

/* Logout */
.sidebar-logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 10px 14px;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  width: calc(100% - 20px);
  text-align: left;
  font-family: 'Inter', sans-serif;
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
  box-sizing: border-box;
}
.sidebar-logout-btn:hover { background: #fef2f2; color: #ef4444; }
.sidebar-logout-btn svg { flex-shrink: 0; color: #6b7280; }

/* Dark-mode logo swap – handled exclusively by /js/dark-logo.js.
   The CSS `content: url()` trick is unreliable across browsers (Chromium
   caches the replaced image past the toggle, leaving the dark logo on a
   light page). JS swap is authoritative. */

/* === Unified page header (Konto-style) – 32px bold + 14.5px gray subtitle === */
.content-page-header,
.page-header{ margin: 4px 0 22px; }
.content-page-title,
.page-header > h2:first-child,
.page-header > h1:first-child,
.exp-header-text > h1{
  font-size: 32px !important;
  font-weight: 700 !important;
  color: #111827 !important;
  letter-spacing: -0.01em !important;
  margin: 0 0 6px !important;
  padding: 0 !important;
  line-height: 1.15 !important;
  font-family: 'Inter', sans-serif !important;
}
.content-page-subtitle,
.page-header > h2:first-child + p,
.page-header > h1:first-child + p,
.exp-header-text > h1 + p{
  margin: 0 0 22px !important;
  padding: 0 !important;
  color: #6b7280 !important;
  font-size: 14.5px !important;
  line-height: 1.5 !important;
  font-weight: 400 !important;
  font-family: 'Inter', sans-serif !important;
}
body.dark-mode .content-page-title,
body.dark-mode .page-header > h2:first-child,
body.dark-mode .page-header > h1:first-child,
body.dark-mode .exp-header-text > h1{ color: #f3f4f6 !important; }
body.dark-mode .content-page-subtitle,
body.dark-mode .page-header > h2:first-child + p,
body.dark-mode .page-header > h1:first-child + p,
body.dark-mode .exp-header-text > h1 + p{ color: #9ca3af !important; }

/* ===== DARK MODE – full shell (topbar, sidebar, body) ===== */
body.dark-mode { background: #0f1018; color: #e5e7eb; }
body.dark-mode .settings-topbar {
  background: #161825;
  border-bottom-color: rgba(96,165,250,0.16);
  box-shadow: 0 1px 4px rgba(0,0,0,0.45);
}
body.dark-mode .acc-topbar-logo { color: #f1f5f9; }
body.dark-mode .acc-topbar-help {
  background: rgba(255,255,255,0.04);
  border-color: rgba(96,165,250,0.20);
  color: #cbd5e1;
}
body.dark-mode .acc-topbar-help:hover {
  background: rgba(124,58,237,0.16);
  border-color: rgba(167,139,250,0.45);
  color: #ddd6fe;
}
body.dark-mode .acc-topbar-help-circle {
  background: transparent;
  border-color: #cbd5e1;
  color: #cbd5e1;
}
body.dark-mode .settings-content { background: #0f1018; }
body.dark-mode .settings-sidebar {
  background: #161825;
  box-shadow: 1px 0 0 rgba(96,165,250,0.16);
}
body.dark-mode .sidebar-section-label { color: #64748b; }
body.dark-mode .sidebar-nav-item { color: #94a3b8; }
body.dark-mode .sidebar-nav-item svg { color: #64748b; }
body.dark-mode .sidebar-nav-item:hover {
  background: rgba(124,58,237,0.16);
  color: #ddd6fe;
}
body.dark-mode .sidebar-nav-item:hover svg { color: #c4b5fd; }
body.dark-mode .sidebar-nav-item.active {
  background: rgba(124,58,237,0.22);
  color: #ddd6fe;
}
body.dark-mode .sidebar-nav-item.active svg { color: #c4b5fd; }
body.dark-mode .sidebar-user-card {
  background: rgba(124,58,237,0.14);
}
body.dark-mode .sidebar-user-card:hover {
  background: rgba(124,58,237,0.22);
}
body.dark-mode .sidebar-user-card-name { color: #f1f5f9; }
body.dark-mode .sidebar-user-card-id { color: #94a3b8; }
body.dark-mode .sidebar-logout-btn { color: #94a3b8; }
body.dark-mode .sidebar-logout-btn:hover {
  background: rgba(239,68,68,0.14);
  color: #fca5a5;
}
body.dark-mode .sidebar-logout-btn svg { color: #64748b; }
body.dark-mode .sidebar-logout-btn:hover svg { color: #fca5a5; }
