/* 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-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 {
  min-width: 220px;
  border: 1px solid #e9ecef;
  border-radius: 0.75rem;
  box-shadow: 0 10px 30px rgba(25, 30, 59, 0.08);
  padding: 0.35rem 0;
  margin-top: 0.5rem !important;
  z-index: 1050;
}

.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: 220px;
  max-width: min(280px, 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;
}

.mobile_nav .header-user-dropdown--mobile .dropdown-item {
  display: flex;
  align-items: center;
  width: 100%;
  white-space: normal;
}

.header-user-dropdown .dropdown-item {
  padding: 0.65rem 1rem;
  font-weight: 500;
}

.header-user-dropdown .dropdown-item i {
  width: 1.1rem;
  text-align: center;
}

.header-user-dropdown .dropdown-item.text-danger:hover,
.header-user-dropdown .dropdown-item.text-danger:focus {
  background: rgba(220, 53, 69, 0.08);
  color: #dc3545;
}

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