/* Account area */

.account-page {
  padding: 2.5rem 0 4rem;
  background: #f7f9fc;
}

.account-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.account-sidebar {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 0.75rem;
  padding: 1.25rem 0.75rem;
  position: sticky;
  top: calc(var(--pref-bar-height, 40px) + 1rem);
}

.account-sidebar__user {
  padding: 0.5rem 1rem 1.25rem;
  border-bottom: 1px solid #eef1f5;
  margin-bottom: 0.75rem;
}

.account-sidebar__user-name {
  font-weight: 700;
  font-size: 1rem;
  margin: 0 0 0.15rem;
}

.account-sidebar__user-email {
  color: #6c757d;
  font-size: 0.875rem;
  margin: 0;
  word-break: break-all;
}

.account-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.account-nav__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  color: #191e3b;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.account-nav__link i {
  width: 1.25rem;
  text-align: center;
  color: #6c757d;
}

.account-nav__link:hover {
  background: rgba(13, 110, 253, 0.06);
  color: var(--bs-primary);
}

.account-nav__link:hover i {
  color: var(--bs-primary);
}

.account-nav__link.is-active {
  background: rgba(13, 110, 253, 0.1);
  color: var(--bs-primary);
}

.account-nav__link.is-active i {
  color: var(--bs-primary);
}

.account-nav__link--danger {
  color: #dc3545;
}

.account-nav__link--danger i {
  color: #dc3545;
}

.account-nav__divider {
  height: 1px;
  background: #eef1f5;
  margin: 0.5rem 0.75rem;
}

.account-panel {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 0.75rem;
  padding: 1.75rem;
  min-height: 320px;
}

.account-panel__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.account-panel__subtitle {
  color: #6c757d;
  margin: 0 0 1.5rem;
}

.account-nav__link--danger.is-active {
  background: #fff5f5;
  color: #dc3545;
}

.account-nav__link--danger.is-active i {
  color: #dc3545;
}

.account-delete-warning {
  background: #fff5f5;
  border: 1px solid #f5c2c7;
  border-radius: 0.75rem;
  color: #842029;
  padding: 1rem 1.15rem;
  margin: 0 0 1.5rem;
}

.account-panel .form-control::placeholder,
.account-panel .form-floating > label {
  color: #adb5bd !important;
  opacity: 1;
}

.account-recovery-codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: #f1f5f8;
  border-radius: 0.5rem;
  padding: 1rem;
}

.account-qr {
  display: inline-block;
  padding: 0.75rem;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 0.5rem;
}

@media (max-width: 991.98px) {
  .account-shell {
    grid-template-columns: 1fr;
  }

  .account-sidebar {
    position: static;
  }

  .account-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
  }

  .account-nav__divider {
    grid-column: 1 / -1;
  }

  .account-recovery-codes {
    grid-template-columns: 1fr;
  }
}

/* Header user dropdown */
.header-user-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-inline-start: 0.75rem;
  float: right;
}

html[dir="rtl"] .header-user-actions {
  float: left;
}

.header-user-menu {
  display: flex;
  align-items: center;
}

.navigation-portrait .header-user-actions {
  display: none;
}

.header-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e9ecef;
  display: block;
}

.mobile_nav .header-user-avatar {
  width: 32px;
  height: 32px;
}

.header-user-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.55rem;
  border: 0;
  background: transparent;
  border-radius: 999px;
  line-height: 1;
}

.header-user-toggle:hover,
.header-user-toggle:focus {
  background: rgba(13, 110, 253, 0.06);
}

.header-user-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: #191e3b;
  font-size: 0.9rem;
}

.header-user-caret {
  font-size: 0.65rem;
  color: #6c757d;
}

.header-user-dropdown {
  --hud-ink: #0b1f3a;
  --hud-muted: #6b7280;
  --hud-border: #e8edf3;
  --hud-soft: #f4f7fb;
  --hud-danger: #dc2626;
  min-width: 268px;
  border: 1px solid var(--hud-border);
  border-radius: 1rem;
  box-shadow: 0 16px 40px rgba(11, 31, 58, 0.12);
  padding: 0.55rem;
  margin-top: 0.55rem !important;
  z-index: 1050;
  overflow: hidden;
}

.header-user-dropdown__profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.65rem 0.8rem;
}

.header-user-dropdown__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--hud-border);
  flex-shrink: 0;
}

.header-user-dropdown__meta {
  min-width: 0;
}

.header-user-dropdown__name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--hud-ink);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-user-dropdown__email {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--hud-muted);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-user-dropdown__divider {
  height: 1px;
  margin: 0.2rem 0.45rem;
  background: var(--hud-border);
  list-style: none;
}

.header-user-dropdown__item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 0.7rem;
  padding: 0.65rem 0.7rem;
  color: var(--hud-ink);
  font-size: 0.92rem;
  font-weight: 600;
  text-align: start;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.header-user-dropdown__item:hover,
.header-user-dropdown__item:focus {
  background: var(--hud-soft);
  color: var(--hud-ink);
}

.header-user-dropdown__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.6rem;
  background: var(--hud-soft);
  color: #1d4ed8;
  flex-shrink: 0;
}

.header-user-dropdown__icon i {
  font-size: 0.85rem;
}

.header-user-dropdown__item--danger {
  color: var(--hud-danger);
}

.header-user-dropdown__item--danger .header-user-dropdown__icon {
  background: rgba(220, 38, 38, 0.08);
  color: var(--hud-danger);
}

.header-user-dropdown__item--danger:hover,
.header-user-dropdown__item--danger:focus {
  background: rgba(220, 38, 38, 0.08);
  color: var(--hud-danger);
}

.mobile_nav .dropdown {
  position: relative;
}

.mobile_nav ul.header-user-dropdown--mobile {
  display: none;
  position: absolute;
  top: calc(100% + 0.35rem);
  inset-inline-end: 0;
  inset-inline-start: auto;
  transform: none !important;
  margin-top: 0 !important;
  min-width: 260px;
  max-width: min(300px, calc(100vw - 1rem));
  width: max-content;
}

.mobile_nav ul.header-user-dropdown--mobile.show {
  display: block !important;
}

.mobile_nav .header-user-dropdown--mobile > li {
  display: block;
  width: 100%;
  margin: 0;
}

html[dir="rtl"] .header-user-dropdown__item--danger .fa-arrow-right-from-bracket,
html[dir="rtl"] .account-nav__link--danger .fa-arrow-right-from-bracket {
  transform: scaleX(-1);
}
