:root {
    --account-primary: #534de6;
    --account-primary-dark: #270570;
    --account-primary-soft: #f0efff;
    --account-accent: #6ce0ca;
    --account-ink: #252b36;
    --account-muted: #737d8c;
    --account-border: #e4e6ef;
    --account-success: #008d79;
    --account-success-soft: #e7faf6;
}

.account-avatar {
    align-items: center;
    background: linear-gradient(145deg, var(--account-primary) 0%, var(--account-primary-dark) 100%);
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    flex: 0 0 auto;
    font-weight: 700;
    justify-content: center;
    overflow: hidden;
    text-transform: uppercase;
}
.account-avatar img { border-radius: inherit; display: block; height: 100%; object-fit: cover; width: 100%; }
.account-avatar--header { border: 2px solid rgba(255,255,255,.78); box-shadow: 0 4px 14px rgba(25,7,91,.25); font-size: 14px; height: 40px; width: 40px; }
.account-avatar--menu { box-shadow: 0 6px 16px rgba(39,5,112,.2); font-size: 20px; height: 52px; width: 52px; }
.account-avatar--large { background: rgba(255,255,255,.16); border: 3px solid rgba(255,255,255,.8); box-shadow: 0 8px 22px rgba(24,5,86,.25); font-size: 32px; height: 86px; width: 86px; }

.topbar .top-navbar .navbar-nav > .nav-item > .account-menu__trigger { align-items: center; display: flex; gap: 10px; line-height: 1.2; min-height: 74px; padding: 8px 24px 8px 14px; }
.account-menu__trigger-text { color: #fff; max-width: 210px; text-align: right; }
.account-menu__trigger-text strong,.account-menu__trigger-text small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu__trigger-text strong { font-size: 12px; font-weight: 700; }
.account-menu__trigger-text small { font-size: 9px; letter-spacing: .04em; opacity: .7; text-transform: uppercase; }
.account-menu__chevron { color: rgba(255,255,255,.72); font-size: 9px; transition: transform .2s ease; }
.account-menu.show .account-menu__chevron { transform: rotate(180deg); }
.topbar .account-menu__dropdown { border: 1px solid var(--account-border); border-radius: 14px; box-shadow: 0 20px 50px rgba(31,35,66,.18); margin-top: 8px; overflow: hidden; padding: 0; width: 350px; }
.account-menu__summary { align-items: center; background: linear-gradient(135deg,#f5f4ff 0%,#fbfbff 100%); border-bottom: 1px solid var(--account-border); display: flex; gap: 13px; padding: 20px; }
.account-menu__summary-text { min-width: 0; }
.account-menu__summary-text strong,.account-menu__summary-text small,.account-menu__summary-text span { display: block; }
.account-menu__summary-text strong { color: var(--account-ink); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu__summary-text small { color: var(--account-muted); font-size: 10px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu__summary-text span { color: var(--account-primary); font-size: 10px; font-weight: 700; margin-top: 5px; }
.account-menu__actions { padding: 8px; }
.topbar .account-menu__action { align-items: center; background: transparent; border: 0; border-radius: 9px; color: var(--account-ink); display: flex; gap: 12px; padding: 10px 11px; text-align: left; transition: background .18s ease,transform .18s ease; width: 100%; }
.topbar .account-menu__action:hover,.topbar .account-menu__action:focus { background: var(--account-primary-soft); color: var(--account-primary-dark); outline: 0; text-decoration: none; transform: translateX(2px); }
.account-menu__action-icon { align-items: center; background: #f4f5fa; border-radius: 8px; color: var(--account-primary); display: inline-flex; flex: 0 0 38px; height: 38px; justify-content: center; }
.account-menu__action > span:nth-child(2) { flex: 1; min-width: 0; }
.account-menu__action strong,.account-menu__action small { display: block; }
.account-menu__action strong { font-size: 12px; font-weight: 700; }
.account-menu__action small { color: var(--account-muted); font-size: 9px; margin-top: 2px; }
.account-menu__action-arrow { color: #aeb5c0; font-size: 9px; }
.account-menu__footer { background: #fafafd; border-top: 1px solid var(--account-border); padding: 10px 12px; }
.topbar .account-menu__logout { align-items: center; border-radius: 8px; color: #bd392e; display: flex; font-size: 11px; font-weight: 700; gap: 8px; justify-content: center; padding: 9px; }
.topbar .account-menu__logout:hover { background: #fff0ee; color: #a42b22; text-decoration: none; }

.account-profile { margin: 8px 0 34px; }
.account-profile__hero { align-items: center; background: linear-gradient(120deg,#270570 0%,#534de6 60%,#665ef0 100%); border-radius: 18px; box-shadow: 0 15px 34px rgba(39,5,112,.18); color: #fff; display: flex; gap: 24px; overflow: hidden; padding: 30px 34px; position: relative; }
.account-profile__hero::after { border: 28px solid rgba(255,255,255,.07); border-radius: 50%; content: ''; height: 210px; position: absolute; right: 20%; top: -115px; width: 210px; }
.account-profile__photo-form { align-items: center; display: flex; flex: 0 0 86px; flex-direction: column; gap: 7px; position: relative; z-index: 2; }
.account-photo-picker { cursor: pointer; margin: 0; position: relative; }
.account-photo-picker input[type=file] { height: 1px; opacity: 0; overflow: hidden; position: absolute; width: 1px; }
.account-photo-picker__icon { align-items: center; background: #fff; border: 2px solid var(--account-primary); border-radius: 50%; bottom: 0; color: var(--account-primary); display: inline-flex; height: 28px; justify-content: center; position: absolute; right: -2px; transition: transform .18s ease; width: 28px; }
.account-photo-picker:hover .account-photo-picker__icon { transform: scale(1.08); }
.account-photo-save { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.34); border-radius: 999px; color: #fff; cursor: pointer; font-size: 9px; font-weight: 700; padding: 5px 9px; white-space: nowrap; }
.account-photo-save:hover { background: #fff; color: var(--account-primary-dark); }
.account-profile__identity { flex: 1; min-width: 0; position: relative; z-index: 1; }
.account-profile__eyebrow { color: var(--account-accent); display: block; font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.account-profile__identity h1 { color: #fff; font-size: 28px; font-weight: 800; margin: 3px 0 2px; }
.account-profile__identity p { color: rgba(255,255,255,.82); font-size: 12px; margin: 0 0 12px; }
.account-profile__hero .account-status { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.22); color: #fff; }
.account-profile__actions { align-items: stretch; display: flex; flex-direction: column; gap: 8px; position: relative; z-index: 1; }

.account-button { align-items: center; border: 0; border-radius: 999px; cursor: pointer; display: inline-flex; font-size: 11px; font-weight: 700; gap: 8px; justify-content: center; min-height: 40px; padding: 9px 17px; transition: box-shadow .18s ease,transform .18s ease,background .18s ease; }
.account-button:hover,.account-button:focus { outline: 0; text-decoration: none; transform: translateY(-1px); }
.account-button--primary { background: var(--account-primary); box-shadow: 0 7px 18px rgba(83,77,230,.24); color: #fff; }
.account-button--primary:hover { background: #433ddd; color: #fff; }
.account-profile__hero .account-button--primary { background: #fff; color: var(--account-primary-dark); }
.account-button--hero-secondary { background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.28); color: #fff; }
.account-button--hero-secondary:hover { background: rgba(255,255,255,.22); color: #fff; }
.account-button--secondary { background: var(--account-primary-soft); color: var(--account-primary-dark); }
.account-button--secondary:hover { background: #e4e1ff; color: var(--account-primary-dark); }
.account-button--ghost { background: #f1f3f8; color: #5e6978; }
.account-button--ghost:hover { background: #e7eaf1; color: #3e4855; }

.account-profile__grid { display: grid; gap: 18px; grid-template-columns: repeat(2,minmax(0,1fr)); margin-top: 20px; }
.account-panel { background: #fff; border: 1px solid var(--account-border); border-radius: 15px; box-shadow: 0 7px 22px rgba(39,5,112,.05); padding: 25px; }
.account-panel--security { grid-column: 1/-1; }
.account-panel__heading { align-items: flex-start; display: flex; gap: 12px; margin-bottom: 22px; }
.account-panel__icon { align-items: center; background: var(--account-primary-soft); border-radius: 10px; color: var(--account-primary); display: inline-flex; flex: 0 0 42px; height: 42px; justify-content: center; }
.account-panel__heading h1,.account-panel__heading h2 { color: var(--account-ink); font-size: 17px; font-weight: 800; margin: 1px 0 3px; }
.account-panel__heading p { color: var(--account-muted); font-size: 10px; line-height: 1.45; margin: 0; }
.account-panel__empty { color: var(--account-muted); font-size: 11px; }
.account-details { margin: 0; }
.account-details__row { border-top: 1px solid #eceef4; display: grid; gap: 14px; grid-template-columns: minmax(130px,.7fr) minmax(0,1.3fr); padding: 13px 0; }
.account-details__row:first-child { border-top: 0; padding-top: 0; }
.account-details__row:last-child { padding-bottom: 0; }
.account-details__row dt { color: var(--account-muted); font-size: 9px; font-weight: 800; letter-spacing: .04em; margin: 0; text-transform: uppercase; }
.account-details__row dd { color: var(--account-ink); font-size: 12px; font-weight: 600; margin: 0; overflow-wrap: anywhere; text-align: right; }
.account-status { align-items: center; border: 1px solid transparent; border-radius: 999px; display: inline-flex; font-size: 9px; font-weight: 700; gap: 5px; padding: 5px 9px; }
.account-status--active { background: var(--account-success-soft); border-color: #c9eee5; color: var(--account-success); }
.account-status--inactive { background: #fff0ee; border-color: #f4d1cd; color: #bd392e; }
.account-roles { display: flex; flex-wrap: wrap; gap: 8px; }
.account-role { align-items: center; background: var(--account-primary-soft); border: 1px solid #dfdcff; border-radius: 999px; color: var(--account-primary-dark); display: inline-flex; font-size: 10px; font-weight: 700; gap: 6px; padding: 7px 11px; }
.account-role i { color: var(--account-primary); font-size: 8px; }
.account-access-summary { align-items: baseline; background: #f8f8fd; border-radius: 12px; display: flex; gap: 8px; margin-top: 22px; padding: 18px; }
.account-access-summary strong { color: var(--account-primary); font-size: 26px; line-height: 1; }
.account-access-summary span { color: var(--account-muted); font-size: 10px; font-weight: 700; }
.account-security-row { align-items: center; border-top: 1px solid #eceef4; display: flex; gap: 20px; justify-content: space-between; padding-top: 18px; }
.account-security-row strong,.account-security-row span { display: block; }
.account-security-row strong { color: var(--account-ink); font-size: 12px; }
.account-security-row span { color: #a0a7b1; font-size: 14px; letter-spacing: .08em; margin-top: 3px; }
.account-permissions { background: #fff; border: 1px solid var(--account-border); border-radius: 15px; box-shadow: 0 7px 22px rgba(39,5,112,.05); margin-top: 18px; overflow: hidden; }
.account-permissions summary { align-items: center; cursor: pointer; display: flex; justify-content: space-between; list-style: none; padding: 18px 22px; }
.account-permissions summary::-webkit-details-marker { display: none; }
.account-permissions summary span { color: var(--account-ink); font-size: 12px; font-weight: 800; }
.account-permissions summary span i { color: var(--account-primary); margin-right: 7px; }
.account-permissions summary small { color: var(--account-muted); font-size: 9px; }
.account-permissions[open] summary { border-bottom: 1px solid var(--account-border); }
.account-permissions__content { padding: 20px; }

.account-profile-edit { margin: 8px auto 34px; max-width: 860px; }
.account-profile-edit__panel { padding: 30px; }
.account-profile-form__grid { display: grid; gap: 19px; grid-template-columns: repeat(2,minmax(0,1fr)); }
.account-profile-field--wide { grid-column: 1/-1; }
.account-profile-field label { color: var(--account-ink); display: block; font-size: 10px; font-weight: 800; margin-bottom: 7px; }
.account-profile-field .form-control { border: 1px solid #dce0e9; border-radius: 10px; color: var(--account-ink); font-size: 12px; min-height: 45px; padding: 10px 12px; }
.account-profile-field .form-control:focus { border-color: var(--account-primary); box-shadow: 0 0 0 3px rgba(83,77,230,.1); }
.account-profile-field small { color: var(--account-muted); display: block; font-size: 9px; margin-top: 6px; }
.account-profile-field ul { color: #bd392e; font-size: 9px; list-style: none; margin: 5px 0 0; padding: 0; }
.account-profile-readonly { align-items: center; background: #f5f6fa; border: 1px solid #e1e4eb; border-radius: 10px; color: #687382; display: flex; font-size: 12px; gap: 10px; min-height: 45px; padding: 10px 12px; }
.account-profile-readonly span { flex: 1; }
.account-profile-form__actions { border-top: 1px solid #eceef4; display: flex; gap: 9px; justify-content: flex-end; margin-top: 24px; padding-top: 20px; }

.user-list-stats { display: grid; gap: 14px; grid-template-columns: repeat(3,minmax(0,1fr)); margin-bottom: 18px; }
.user-list-stat { align-items: center; background: #fff; border: 1px solid var(--account-border); border-radius: 13px; display: flex; gap: 12px; padding: 15px 17px; }
.user-list-stat i { align-items: center; background: var(--account-primary-soft); border-radius: 9px; color: var(--account-primary); display: inline-flex; height: 38px; justify-content: center; width: 38px; }
.user-list-stat--active i { background: var(--account-success-soft); color: var(--account-success); }
.user-list-stat--inactive i { background: #fff0ee; color: #bd392e; }
.user-list-stat strong,.user-list-stat span { display: block; }
.user-list-stat strong { color: var(--account-ink); font-size: 18px; line-height: 1; }
.user-list-stat span { color: var(--account-muted); font-size: 9px; margin-top: 4px; }
.user-list-avatar { align-items: center; background: linear-gradient(145deg,var(--account-primary),var(--account-primary-dark)); border-radius: 50%; color: #fff; display: inline-flex; flex: 0 0 34px; font-size: 11px; font-weight: 800; height: 34px; justify-content: center; overflow: hidden; vertical-align: middle; width: 34px; }
.user-list-avatar img { height: 100%; object-fit: cover; width: 100%; }
.user-list-identity { align-items: center; display: inline-flex; gap: 10px; text-align: left; }
.user-list-identity strong,.user-list-identity small { display: block; }
.user-list-identity strong { color: var(--account-ink); font-size: 11px; }
.user-list-identity small { color: var(--account-muted); font-size: 8px; margin-top: 2px; }
.user-list-filter { align-items: center; display: flex; gap: 8px; }
.user-list-filter label { color: var(--account-muted); font-size: 10px; font-weight: 700; margin: 0; }
.user-list-filter select { border: 1px solid var(--account-border); border-radius: 9px; color: var(--account-ink); font-size: 10px; height: 36px; min-width: 130px; }
.role-option-panel { background: #f9f9fd; border: 1px solid var(--account-border); border-radius: 13px; margin-top: 8px; padding: 18px; width: 100%; }
.role-option-panel legend { color: var(--account-ink); font-size: 12px; font-weight: 800; margin: 0; padding: 0; width: auto; }
.role-option-panel > p { color: var(--account-muted); font-size: 9px; margin: 4px 0 14px; }
.role-option-grid { display: grid; gap: 9px; grid-template-columns: repeat(3,minmax(0,1fr)); }
.role-option { align-items: center; background: #fff; border: 1px solid #dfe2eb; border-radius: 10px; cursor: pointer; display: flex; gap: 10px; margin: 0; padding: 11px; transition: background .16s ease,border-color .16s ease,transform .16s ease; }
.role-option:hover { border-color: #b9b4ff; transform: translateY(-1px); }
.role-option--selected,.role-option:has(input:checked) { background: var(--account-primary-soft); border-color: #b9b4ff; }
.role-option input { height: 1px; opacity: 0; position: absolute; width: 1px; }
.role-option__check { align-items: center; background: #fff; border: 1px solid #c7ccd7; border-radius: 6px; color: transparent; display: inline-flex; flex: 0 0 21px; height: 21px; justify-content: center; }
.role-option input:checked + .role-option__check { background: var(--account-primary); border-color: var(--account-primary); color: #fff; }
.role-option strong,.role-option small { display: block; }
.role-option strong { color: var(--account-ink); font-size: 10px; }
.role-option small { color: var(--account-muted); font-size: 8px; margin-top: 2px; }

@media (max-width: 991.98px) {
    .account-menu__trigger-text,.account-menu__chevron { display: none; }
}
@media (max-width: 767.98px) {
    .topbar .account-menu__dropdown { margin-right: 8px; width: min(350px,calc(100vw - 20px)); }
    .account-profile__hero { align-items: flex-start; flex-wrap: wrap; padding: 23px; }
    .account-avatar--large { height: 70px; width: 70px; }
    .account-profile__identity { min-width: calc(100% - 94px); }
    .account-profile__identity h1 { font-size: 22px; }
    .account-profile__actions { margin-left: 94px; width: calc(100% - 94px); }
    .account-profile__grid,.user-list-stats { grid-template-columns: 1fr; }
    .role-option-grid { grid-template-columns: 1fr; }
    .account-panel--security { grid-column: auto; }
    .account-security-row { align-items: stretch; flex-direction: column; }
    .account-permissions summary { align-items: flex-start; flex-direction: column; gap: 5px; }
}
@media (max-width: 479.98px) {
    .account-profile__actions { margin-left: 0; width: 100%; }
    .account-profile-form__grid { grid-template-columns: 1fr; }
    .account-profile-field--wide { grid-column: auto; }
    .account-profile-form__actions { align-items: stretch; flex-direction: column-reverse; }
    .account-profile-form__actions .account-button { width: 100%; }
    .account-details__row { grid-template-columns: 1fr; }
    .account-details__row dd { text-align: left; }
}
