/* Login screen */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary) 0%, #4f46e5 50%, #312e81 100%);
  padding: 24px;
}
.login-screen--hidden { display: none; }
.main-wrapper--hidden,
.sidebar--hidden { display: none !important; }

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface-card);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.35);
}
.login-card__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.login-card__logo .logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card h1 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
}
.login-card__sub {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 24px;
}
.login-error {
  color: var(--color-danger);
  font-size: 13px;
  margin-bottom: 12px;
  min-height: 18px;
}
.login-hint {
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

.change-password-screen--hidden { display: none; }

.password-strength {
  margin-top: 8px;
}
.password-strength__bar {
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  overflow: hidden;
}
.password-strength__bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: width 0.2s ease, background 0.2s ease;
}
.password-strength__label {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
}
.password-strength--weak .password-strength__bar span { background: var(--color-danger); }
.password-strength--fair .password-strength__bar span { background: var(--color-warning); }
.password-strength--good .password-strength__bar span { background: #eab308; }
.password-strength--strong .password-strength__bar span { background: var(--color-success); }
.password-policy-hint {
  margin: 8px 0 0;
  padding-left: 18px;
}
.password-policy-hint li { margin-bottom: 2px; }

.header-user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-right: 8px;
  line-height: 1.2;
}
.header-user__name { font-size: 12px; font-weight: 600; }
.header-user__role { font-size: 10px; color: var(--text-muted); }

.header-account {
  position: relative;
  margin-right: 4px;
}
.header-account__trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 4px 8px 4px 4px;
  cursor: pointer;
  color: inherit;
  max-width: 220px;
}
.header-account__trigger:hover,
.header-account--open .header-account__trigger {
  border-color: var(--color-primary);
  background: var(--bg-subtle, rgba(99, 102, 241, 0.06));
}
.header-account__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.header-account__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
  min-width: 0;
  text-align: left;
}
.header-account__meta .header-user__name,
.header-account__meta .header-user__role {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-account__chev {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.header-account__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 6px;
  z-index: 1200;
}
.header-account__menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 6px;
}
.header-account__menu-user {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}
.header-account__menu-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-account__menu-email {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-account__divider {
  height: 1px;
  margin: 4px 6px;
  background: var(--border-color);
}
.header-account__avatar.acct-avatar--img,
.acct-avatar--img {
  object-fit: cover;
  background: var(--color-primary);
}
.acct-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.acct-avatar--menu {
  width: 36px;
  height: 36px;
  font-size: 14px;
}
.acct-avatar--lg {
  width: 64px;
  height: 64px;
  font-size: 24px;
}
.header-account__item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
  color: inherit;
}
.header-account__item:hover {
  background: var(--bg-subtle, rgba(99, 102, 241, 0.08));
}
.header-account__item--danger:hover {
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.08);
}

.btn-logout {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-muted);
}
.btn-logout:hover { color: var(--color-danger); border-color: var(--color-danger); }

/* ---- User account modals ---- */
.acct-profile__hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}
.acct-profile__name {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.acct-profile__email {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}
.acct-profile__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
}
.acct-profile__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.acct-profile__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.acct-profile__value {
  font-size: 14px;
  font-weight: 500;
}
.acct-activity__current {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-subtle, rgba(99, 102, 241, 0.04));
}
.acct-activity__current-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}
.acct-activity__table th,
.acct-activity__table td {
  font-size: 13px;
}
.acct-badge {
  display: inline-flex;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.acct-badge--current {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}
.acct-help__section + .acct-help__section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
}
.acct-help__heading {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
}
.acct-help__list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.acct-help__contact {
  display: grid;
  gap: 10px;
  font-size: 13px;
}
.acct-help__label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.settings-section--locked {
  opacity: 0.55;
  pointer-events: none;
  position: relative;
}
.settings-section--locked::after {
  content: 'Restricted';
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-warning);
}
