/* Admin header account menu, grouped navigation and AI test tools. */
.aio-header-icon-button,
.aio-account-trigger {
    align-items: center;
    background: #fff;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #1f2937;
    display: inline-flex;
    height: 42px;
    justify-content: center;
    position: relative;
    text-decoration: none;
    width: 42px;
}

.aio-header-icon-button {
    font-size: 21px;
}

.aio-header-icon-button:hover,
.aio-account-trigger:hover,
.aio-account-trigger[aria-expanded="true"] {
    background: #f3f6fa;
    border-color: #cbd5e1;
    color: #111827;
}

.aio-header-badge {
    align-items: center;
    background: #dc2626;
    border: 2px solid #fff;
    border-radius: 999px;
    color: #fff;
    display: flex;
    font-size: 10px;
    font-weight: 800;
    height: 19px;
    justify-content: center;
    min-width: 19px;
    padding: 0 4px;
    position: absolute;
    right: -3px;
    top: -4px;
}

.aio-header-badge[hidden] {
    display: none !important;
}

.aio-account-trigger {
    border-color: #cbd5e1;
    padding: 0;
}

.aio-user-avatar {
    align-items: center;
    background: #0788c7;
    border-radius: 7px;
    color: #fff;
    display: inline-flex;
    font-size: 21px;
    font-weight: 700;
    height: 36px;
    justify-content: center;
    line-height: 1;
    text-transform: uppercase;
    width: 36px;
}

.aio-user-avatar-lg {
    flex: 0 0 48px;
    font-size: 25px;
    height: 48px;
    width: 48px;
}

.aio-user-avatar img {
    border-radius: inherit;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.aio-account-menu {
    border: 1px solid #d8dee8;
    border-radius: 14px;
    min-width: 290px;
    overflow: hidden;
    padding: 7px;
}

.aio-account-menu .dropdown-divider {
    margin: 7px -7px;
}

.aio-account-profile {
    align-items: center;
    border-radius: 9px;
    color: #111827;
    display: flex;
    gap: 12px;
    padding: 10px;
    text-decoration: none;
}

.aio-account-profile:hover {
    background: #f6f8fb;
    color: #111827;
}

.aio-account-identity {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.aio-account-identity strong,
.aio-account-identity small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aio-account-identity strong {
    font-size: 15px;
}

.aio-account-identity small {
    color: #6b7280;
    font-size: 12px;
    margin-top: 2px;
}

.aio-account-menu .aio-account-menu-item {
    align-items: center;
    border-radius: 8px;
    display: flex;
    font-weight: 500;
    gap: 12px;
    min-height: 48px;
    padding: 9px 11px;
}

.aio-account-menu-item i {
    color: #334155;
    font-size: 20px;
    text-align: center;
    width: 25px;
}

.aio-management-header {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 18px;
    overflow: hidden;
}

.aio-management-heading {
    align-items: flex-start;
    display: flex;
    gap: 20px;
    justify-content: space-between;
    padding: 18px 20px 14px;
}

.aio-management-heading h1 {
    font-size: 24px;
    margin: 0 0 3px;
}

.aio-management-heading p {
    color: #64748b;
    margin: 0;
}

.aio-management-tabs {
    border-top: 1px solid #e8edf3;
    display: flex;
    overflow-x: auto;
    padding: 0 12px;
}

.aio-management-tabs a {
    border-bottom: 3px solid transparent;
    color: #475569;
    flex: 0 0 auto;
    font-weight: 600;
    padding: 12px 14px 10px;
    text-decoration: none;
}

.aio-management-tabs a:hover {
    color: #0d6efd;
}

.aio-management-tabs a.active {
    border-bottom-color: #0d6efd;
    color: #0d6efd;
}

.aio-roles-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 22px 14px;
}

.aio-roles-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.aio-roles-search {
    align-items: center;
    border: 1px solid #d6e0ec;
    border-radius: 7px;
    display: flex;
    flex: 1 1 360px;
    min-height: 48px;
    padding: 0 14px;
}

.aio-roles-search i {
    color: #64748b;
    font-size: 18px;
    margin-right: 10px;
}

.aio-roles-search input {
    border: 0;
    color: #1e293b;
    min-width: 0;
    outline: 0;
    width: 100%;
}

.aio-roles-select {
    background-color: #fff;
    border: 1px solid #d6e0ec;
    border-radius: 7px;
    color: #334155;
    min-height: 48px;
    min-width: 180px;
    padding: 0 34px 0 13px;
}

.aio-roles-filter-button,
.aio-roles-clear-button {
    min-height: 44px;
}

.aio-roles-summary {
    color: #475569;
    margin: 20px 2px 12px;
    text-align: right;
}

.aio-roles-summary strong {
    color: #0d6efd;
    font-size: 20px;
}

.aio-roles-table-wrap {
    border: 1px solid #e3eaf2;
    border-radius: 10px;
    overflow: hidden;
}

.aio-roles-table {
    color: #334155;
    margin-bottom: 0;
}

.aio-roles-table thead th {
    background: #f7f9fc;
    border-bottom: 1px solid #e3eaf2;
    color: #475569;
    font-size: 14px;
    padding: 14px 24px;
    white-space: nowrap;
}

.aio-roles-table thead a {
    color: inherit;
    text-decoration: none;
}

.aio-roles-table tbody td {
    border-bottom: 1px solid #edf1f5;
    padding: 13px 24px;
}

.aio-roles-table tbody tr:last-child td {
    border-bottom: 0;
}

.aio-role-name-cell,
.aio-role-members {
    align-items: center;
    display: flex;
    gap: 14px;
}

.aio-role-name-cell > span:last-child {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.aio-role-icon {
    align-items: center;
    border-radius: 12px;
    display: inline-flex;
    flex: 0 0 50px;
    font-size: 22px;
    height: 50px;
    justify-content: center;
    width: 50px;
}

.aio-role-icon-system {
    background: #fff3d9;
    color: #f59e0b;
}

.aio-role-icon-custom {
    background: #eaf2ff;
    color: #2563eb;
}

.aio-role-name {
    color: #17233a;
    font-size: 16px;
}

.aio-role-badge {
    align-self: flex-start;
    border-radius: 999px;
    font-size: 12px;
    padding: 3px 10px;
}

.aio-role-badge-system {
    background: #e7f0ff;
    color: #2563eb;
}

.aio-role-badge-custom {
    background: #dcf8e8;
    color: #16944f;
}

.aio-role-members {
    color: #64748b;
}

.aio-role-members i {
    font-size: 23px;
}

.aio-role-members span {
    display: flex;
    flex-direction: column;
}

.aio-role-members strong {
    color: #17233a;
    font-size: 17px;
}

.aio-role-members small {
    color: #94a3b8;
    font-size: 12px;
}

.aio-role-description {
    color: #475569;
    max-width: 450px;
}

.aio-sort-indicator {
    color: #64748b;
    font-size: 16px;
    margin-left: 4px;
}

.aio-role-action {
    border: 1px solid #d6e0ec;
    margin-left: 7px;
    min-width: 84px;
    padding: 8px 12px;
}

.aio-role-edit {
    color: #334155;
}

.aio-role-permissions {
    border-color: #9ac3ff;
    color: #0d6efd;
}

@media (max-width: 900px) {
    .aio-roles-panel {
        padding: 15px;
    }

    .aio-roles-select {
        flex: 1 1 180px;
    }

    .aio-roles-summary {
        text-align: left;
    }

    .aio-roles-table thead th,
    .aio-roles-table tbody td {
        padding-left: 14px;
        padding-right: 14px;
    }
}

.aio-tools-page {
    padding: 20px;
}

.aio-tools-heading {
    margin-bottom: 16px;
}

.aio-tools-heading h1 {
    font-size: 25px;
    margin: 0 0 4px;
}

.aio-tools-heading p {
    color: #64748b;
    margin: 0;
}

.aio-tools-layout {
    align-items: start;
    display: grid;
    gap: 18px;
    grid-template-columns: 230px minmax(0, 1fr);
}

.aio-tools-nav {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: sticky;
    top: 90px;
}

.aio-tools-nav a {
    border-left: 3px solid transparent;
    color: #334155;
    font-weight: 600;
    padding: 14px 16px;
    text-decoration: none;
}

.aio-tools-nav a + a {
    border-top: 1px solid #edf0f4;
}

.aio-tools-nav a:hover {
    background: #f8fafc;
    color: #0d6efd;
}

.aio-tools-nav a.active {
    background: #eef5ff;
    border-left-color: #0d6efd;
    color: #0d6efd;
}

.aio-tools-content {
    min-width: 0;
}

.aio-tools-content > .container-fluid {
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-top: 0 !important;
}

.aio-profile-actions {
    align-items: center;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    margin-top: 22px;
    padding-top: 18px;
}

.aio-profile-avatar-editor {
    align-items: center;
    display: flex;
    gap: 20px;
}

.aio-profile-avatar-preview {
    align-items: center;
    background: #0788c7;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #cbd5e1;
    color: #fff;
    display: flex;
    flex: 0 0 104px;
    font-size: 42px;
    font-weight: 700;
    height: 104px;
    justify-content: center;
    overflow: hidden;
    width: 104px;
}

.aio-profile-avatar-preview img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.aio-profile-avatar-controls {
    max-width: 520px;
    min-width: 0;
    width: 100%;
}

@media (max-width: 575px) {
    .aio-profile-avatar-editor {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 1100px) {
    .admin-header {
        height: auto;
        min-height: 70px;
        padding-bottom: 10px;
        padding-top: 10px;
    }

    .header-left {
        gap: 14px;
    }

    .main-nav a.home-item,
    .main-nav .dropdown .dropdown-toggle {
        padding-left: 8px;
        padding-right: 8px;
    }

    .header-right {
        gap: 7px;
    }
}

@media (max-width: 820px) {
    .admin-header {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 8px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .header-left {
        flex: 1 1 100%;
        overflow-x: auto;
    }

    .main-nav {
        min-width: max-content;
    }

    .header-right {
        margin-left: auto;
    }

    .aio-account-menu {
        max-width: calc(100vw - 24px);
        min-width: min(290px, calc(100vw - 24px));
    }

    .aio-tools-page {
        padding: 14px;
    }

    .aio-tools-layout {
        display: block;
    }

    .aio-tools-nav {
        flex-direction: row;
        margin-bottom: 14px;
        overflow-x: auto;
        position: static;
    }

    .aio-tools-nav a {
        border-bottom: 3px solid transparent;
        border-left: 0;
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .aio-tools-nav a + a {
        border-left: 1px solid #edf0f4;
        border-top: 0;
    }

    .aio-tools-nav a.active {
        border-bottom-color: #0d6efd;
        border-left-color: transparent;
    }
}

@media (max-width: 560px) {
    .header-right {
        gap: 3px;
    }

    .logout-btn {
        font-size: 0;
        min-height: 40px;
        min-width: 38px;
    }

    .aio-management-heading {
        flex-direction: column;
    }

    .aio-management-heading .btn {
        width: 100%;
    }
}

