/*
 * Users: organization directory, product assignments and employee editor.
 * The SaaS workspace also loads the directory and editor rules as its base layer.
 * Account workspace viewport and motion overrides live in ateam-account-responsive.css.
 */

/* ==========================================================================
   Seat summary and shared product marks
   ========================================================================== */

.users-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.users-summary-card,
.users-team-card {
    min-width: 0;
    background: #fff;
    border: 1px solid var(--color-line);
    border-radius: 16px;
    box-shadow: 0 5px 18px rgb(8 43 86 / 3%);
}

.users-summary-card {
    padding: 22px;
}

.users-product-logo {
    display: block;
    width: 180px;
    max-width: 100%;
    height: 30px;
    object-fit: contain;
    object-position: left center;
}

.users-summary-card p {
    margin: 12px 0 8px;
    font-size: 12px;
    color: var(--color-muted);
}

.users-summary-card strong {
    display: block;
    font-size: 28px;
    color: var(--color-navy);
}

.users-summary-card strong span {
    font-size: 14px;
}

.users-summary-card small {
    display: block;
    margin-top: 7px;
    color: var(--color-muted);
    font-size: 12px;
}

.users-summary-card a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    color: var(--color-blue);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.users-summary-total {
    display: flex;
    align-items: center;
    gap: 16px;
}

.users-summary-total p {
    margin-top: 0;
}

.users-summary-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 50%;
    color: var(--color-blue);
    background: #e6f4ff;
    font-size: 25px;
}

.users-license i,
.users-status i {
    font-size: 8px;
    margin-right: 5px;
    color: #8c9fb5;
}

.users-license.is-active i,
.users-status.is-active i {
    color: #139762;
}

/* ==========================================================================
   Employee directory heading and refresh action
   ========================================================================== */

.users-team-card {
    padding: 22px;
}

.users-table-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.users-table-heading h2 {
    margin: 0;
    font-size: 21px;
}

.users-table-heading h2 span {
    margin-left: 10px;
    color: var(--color-muted);
    font-size: 12px;
    font-weight: 400;
}

.users-table-heading [data-users-action="refresh"] {
    width: auto;
    flex: 0 0 auto;
    margin-left: auto;
    white-space: nowrap;
}

/* ==========================================================================
   Directory filters and shared native select controls
   ========================================================================== */

.users-filters {
    display: grid;
    grid-template-columns: minmax(200px, 2fr) repeat(3, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.users-filter {
    min-width: 0;
}

.users-filter .account-select {
    width: 100%;
    min-width: 0;
}

.users-filter .account-select,
.users-editor-body .account-select {
    display: block;
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--color-line);
    border-radius: 8px;
    color: var(--color-text);
    background: #fff;
    font: inherit;
    font-size: 12px;
}

.users-editor-body .account-select[aria-invalid="true"] {
    border-color: var(--color-error);
}

.users-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border: 1px solid var(--color-line);
    border-radius: 8px;
    color: var(--color-muted);
}

.users-search:focus-within {
    outline: 2px solid var(--color-blue);
    outline-offset: 2px;
}

.users-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--color-text);
    font: inherit;
    font-size: 12px;
    padding: 12px 0;
}

/* ==========================================================================
   Employee table, avatars and product assignments
   ========================================================================== */

.users-table-scroll {
    overflow-x: auto;
    border-radius: 8px;
}

.users-table {
    width: 100%;
    min-width: 1080px;
    border-collapse: collapse;
    font-size: 12px;
    text-align: left;
}

.users-table thead {
    background: #f3f8fd;
    color: var(--color-muted);
}

.users-table th,
.users-table td {
    padding: 15px 10px;
    border-bottom: 1px solid #e8eef5;
    vertical-align: middle;
}

.users-table thead th {
    padding-top: 12px;
    padding-bottom: 12px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.users-table thead .users-product-logo {
    width: 126px;
    height: 23px;
}

.users-table tbody th {
    font-weight: 400;
    width: 28%;
}

/* Account management is independent of product roles and paid product assignments. */
.users-account-management-cell {
    white-space: nowrap;
}

.users-creator-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-blue);
}

.users-account-management-choice strong {
    font-size: 13px;
    color: var(--color-blue);
}

/* Account administrators stand out by cell tint, a contrasting badge and a shield icon. */
  
.users-administrator-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border-radius: 7px;
    background: #6541a0;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.users-person {
    display: flex;
    align-items: center;
    gap: 12px;
}

.users-person .account-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    aspect-ratio: 1;
    font-size: 12px;
}

.users-person strong {
    display: block;
    color: var(--color-navy);
}

.users-person small,
.users-team-role {
    display: block;
    margin-top: 4px;
    color: var(--color-muted);
    font-size: 11px;
    overflow-wrap: anywhere;
}

.users-person > div {
    min-width: 0;
}

.users-status {
    white-space: nowrap;
}

.users-access {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 112px;
    padding: 7px 8px;
    border-radius: 7px;
    font-size: 11px;
    white-space: nowrap;
}

.users-access.is-assigned {
    color: #176946;
    background: #e5f8ef;
}

.users-access.is-unassigned {
    color: #61758b;
    background: #f0f4f8;
}

.users-access.is-paused {
    color: #906218;
    background: #fff3da;
}

.users-access i {
    font-size: 10px;
}

.users-access-hint {
    display: block;
    max-width: 125px;
    margin: 5px 0 0;
    color: #876529;
    font-size: 10px;
    line-height: 1.4;
}

.users-row-inactive {
    background: #f8fafd;
}

.users-edit {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--color-blue);
    font: inherit;
    cursor: pointer;
}

.users-edit:hover {
    background: #edf6ff;
}

.users-edit:disabled {
    opacity: 0.5;
    cursor: default;
}

/* ==========================================================================
   Directory legend and pagination
   ========================================================================== */

.users-table-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 15px;
    color: var(--color-muted);
    font-size: 11px;
}

.users-table-footer p {
    margin: 0;
}

.users-legend,
.users-paging {
    display: flex;
    gap: 14px;
    align-items: center;
}

.users-legend span {
    white-space: nowrap;
}

.users-legend span:nth-child(1) i {
    color: #139762;
}

.users-legend span:nth-child(2) i {
    color: #8c9fb5;
}

.users-legend span:nth-child(3) i {
    color: #d69b29;
}

/* ==========================================================================
   Directory feedback and empty states
   ========================================================================== */

.users-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 15px;
    background: #eff7ff;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--color-muted);
}

.users-info > i {
    margin-top: 2px;
    color: var(--color-blue);
    font-size: 15px;
    flex-shrink: 0;
}

.users-empty,
.users-loading {
    padding: 26px;
    text-align: center;
    color: var(--color-muted);
}

#users-feedback {
    margin: 10px 0 18px;
    font-size: 12px;
}

/* ==========================================================================
   User editor panel, title and close control
   ========================================================================== */

/* Shared modal layer scrolls the complete editor, including its header and footer. */

.account-dialog.users-editor-dialog {
    --dialog-width: 760px;
    --dialog-padding: 0;
}

/* Clip nested form/footer backgrounds to the shared panel radius; the dialog viewport still owns scrolling. */
.users-editor-dialog .account-modal-surface {
    overflow: hidden;
}

.users-editor-dialog::backdrop {
    background: rgb(8 32 58 / 48%);
    backdrop-filter: blur(2px);
}

.users-editor-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 24px 26px 18px;
}

.users-editor-dialog .users-editor-header h2 {
    margin: 0;
    font-size: 23px;
}

.users-close {
    align-self: flex-start;
    margin-left: auto;
    padding: 6px;
    border: 0;
    background: transparent;
    color: var(--color-muted);
    font: inherit;
    cursor: pointer;
}

/* ==========================================================================
   New-user creation steps
   ========================================================================== */

.users-create-steps {
    display: flex;
    justify-content: center;
    gap: 45px;
    list-style: none;
    margin: 8px 0;
    padding: 10px 26px;
    color: var(--color-muted);
    font-size: 12px;
}

.users-create-steps li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.users-create-steps span {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    background: #e9f3ff;
    color: #61758b;
    border-radius: 50%;
}

.users-create-steps [aria-current] {
    color: var(--color-navy);
    font-weight: 600;
}

.users-create-steps [aria-current] span {
    color: #fff;
    background: var(--color-blue);
}

/* ==========================================================================
   Selected employee identity and photo actions
   ========================================================================== */

.users-photo-message {
    margin: 0 26px 16px;
}

.users-editor-identity .button {
    width: auto;
    flex-shrink: 0;
    white-space: nowrap;
}

.users-editor-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    margin: 0 26px 10px;
    border-radius: 10px;
    background: #eef7ff;
}

.users-editor-identity .account-avatar {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    aspect-ratio: 1;
}

.users-editor-identity > div {
    min-width: 0;
    flex: 1;
}

.users-editor-identity strong {
    display: block;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.users-editor-identity small {
    display: block;
    margin-top: 4px;
    color: var(--color-muted);
    font-size: 11px;
    overflow-wrap: anywhere;
}

.users-created-note {
    margin: 12px 26px;
    color: #176946;
    font-size: 12px;
    line-height: 1.6;
}

/* ==========================================================================
   User editor tab navigation
   ========================================================================== */

.users-editor-tabs {
    display: flex;
    margin: 0 26px;
    border-bottom: 1px solid var(--color-line);
}

.users-editor-tabs button {
    flex: 1;
    padding: 14px 10px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--color-muted);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.users-editor-tabs [aria-selected="true"] {
    color: var(--color-blue);
    border-bottom-color: var(--color-blue);
}

/* ==========================================================================
   Profile and security form body
   ========================================================================== */

.users-editor-body {
    padding: 20px 26px 24px;
}

.users-editor-body h3 {
    margin: 0 0 8px;
    font-size: 16px;
}

.users-section-hint {
    margin: 0 0 18px;
    color: var(--color-muted);
    font-size: 12px;
    line-height: 1.6;
}

.users-editor-body .form-field {
    margin-bottom: 17px;
}

.users-editor-body .account-textarea {
    min-height: 78px;
}

.users-section-divider {
    margin-top: 24px !important;
    padding-top: 22px;
    border-top: 1px solid var(--color-line);
}

/* ==========================================================================
   Product access choices and assignment state
   ========================================================================== */

.users-product-choices {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.users-product-choice {
    border: 1px solid var(--color-line);
    border-radius: 8px;
    padding: 13px;
}

.users-product-choice > label {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
}

.users-product-choice input {
    width: 18px;
    height: 18px;
    accent-color: var(--color-blue);
    flex-shrink: 0;
}

.users-product-choice .users-product-logo {
    width: 175px;
    height: 27px;
}

.users-product-choice small {
    display: block;
    margin-top: 5px;
    color: var(--color-muted);
    font-size: 11px;
}

.users-choice-state {
    margin-left: auto;
    padding: 7px 10px;
    background: #f0f4f8;
    border-radius: 6px;
    font-size: 11px;
    color: var(--color-muted);
    white-space: nowrap;
}

.users-choice-state.is-assigned {
    color: #176946;
    background: #e5f8ef;
}

/* ==========================================================================
   Administrator confirmation fields
   ========================================================================== */

.users-confirmation {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 20px 0;
    padding: 15px;
    border-radius: 10px;
    background: #eef7ff;
}

.users-confirmation > i {
    color: var(--color-blue);
    font-size: 25px;
    margin-top: 9px;
}

.users-confirmation > div {
    min-width: 0;
    flex: 1;
}

.users-confirmation .form-field {
    margin: 0;
}

.users-confirmation .field-hint {
    margin-bottom: 0;
}

/* ==========================================================================
   Editor footer and security actions
   ========================================================================== */

.users-editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 18px 26px;
    border-top: 1px solid var(--color-line);
    background: #fff;
}

.users-editor-footer > div {
    display: flex;
    gap: 10px;
}

.users-editor-footer .button {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
}

.users-editor-footer p {
    margin: 0;
    color: var(--color-muted);
    font-size: 11px;
}

.users-security-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.users-security-actions .button {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
}

