/* CS16 Panel v9 — Users Core */

:root {
    --v9-panel: #0d131d;
    --v9-panel-2: #111925;
    --v9-panel-3: #080e16;
    --v9-line: #202c3d;
    --v9-line-soft: #182231;
    --v9-text: #edf2f8;
    --v9-muted: #8190a5;
    --v9-dim: #5e6d82;
    --v9-red: #e52943;
    --v9-red-soft: rgba(229, 41, 67, .12);
    --v9-green: #39d98a;
    --v9-green-soft: rgba(57, 217, 138, .11);
    --v9-yellow: #f4c95d;
    --v9-yellow-soft: rgba(244, 201, 93, .11);
    --v9-blue: #5d9cff;
    --v9-blue-soft: rgba(93, 156, 255, .11);
    --v9-purple: #b98cff;
    --v9-radius: 12px;
}

body.v9-modal-open {
    overflow: hidden;
}

#usersCorePage {
    min-height: calc(100vh - 82px);
}

.v9-page-head,
.v9-modal-head,
.v9-head-actions,
.v9-section-head,
.v9-list-head,
.v9-pagination,
.v9-pagination-controls,
.v9-limit-label,
.v9-user-identity,
.v9-row-actions,
.v9-modal-actions,
.v9-check,
.v9-status,
.v9-security-badge {
    display: flex;
    align-items: center;
}

.v9-page-head,
.v9-modal-head,
.v9-section-head,
.v9-list-head,
.v9-pagination,
.v9-modal-actions {
    justify-content: space-between;
}

.v9-page-head {
    gap: 20px;
    margin-bottom: 18px;
}

.v9-page-head h2,
.v9-modal-head h2 {
    margin: 0;
    color: var(--v9-text);
    font-size: 22px;
    line-height: 1.25;
}

.v9-page-head p,
.v9-modal-head p {
    margin: 5px 0 0;
    color: var(--v9-muted);
    font-size: 12px;
    line-height: 1.55;
}

.v9-kicker {
    display: block;
    margin-bottom: 7px;
    color: #ff6c80;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .95px;
    text-transform: uppercase;
}

.v9-head-actions,
.v9-row-actions,
.v9-pagination-controls,
.v9-modal-actions {
    flex-wrap: wrap;
    gap: 8px;
}

.v9-button,
.v9-mini-button,
.v9-icon-button {
    border: 1px solid #2a384d;
    background: #121a26;
    color: #cbd5e1;
    font-weight: 800;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background .15s ease, transform .15s ease, opacity .15s ease;
}

.v9-button {
    min-height: 38px;
    padding: 9px 13px;
    border-radius: 8px;
    font-size: 11px;
    letter-spacing: .2px;
}

.v9-button.small {
    min-height: 31px;
    padding: 6px 10px;
    font-size: 10px;
}

.v9-mini-button {
    min-height: 30px;
    padding: 6px 9px;
    border-radius: 7px;
    font-size: 9px;
    letter-spacing: .35px;
    white-space: nowrap;
}

.v9-icon-button {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    padding: 0;
    border-radius: 9px;
    font-size: 24px;
    line-height: 1;
}

.v9-button:hover:not(:disabled),
.v9-mini-button:hover:not(:disabled),
.v9-icon-button:hover:not(:disabled) {
    border-color: #4a607d;
    color: #fff;
    transform: translateY(-1px);
}

.v9-button:focus-visible,
.v9-mini-button:focus-visible,
.v9-icon-button:focus-visible,
.v9-field input:focus-visible,
.v9-field select:focus-visible,
.v9-search input:focus-visible,
.v9-select:focus-visible {
    outline: 2px solid var(--v9-red);
    outline-offset: 2px;
}

.v9-button:disabled,
.v9-mini-button:disabled,
.v9-icon-button:disabled,
.v9-field input:disabled,
.v9-field select:disabled,
.v9-select:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.v9-button.primary {
    border-color: #ef4058;
    background: linear-gradient(180deg, #ed2e49, #c81734);
    color: #fff;
    box-shadow: 0 10px 26px rgba(229, 41, 67, .18);
}

.v9-mini-button.warning {
    border-color: rgba(244, 201, 93, .38);
    background: var(--v9-yellow-soft);
    color: var(--v9-yellow);
}

.v9-mini-button.success {
    border-color: rgba(57, 217, 138, .36);
    background: var(--v9-green-soft);
    color: var(--v9-green);
}

.v9-mini-button.danger {
    border-color: rgba(229, 41, 67, .45);
    background: var(--v9-red-soft);
    color: #ff8293;
}

.v9-alert {
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(57, 217, 138, .34);
    border-radius: 9px;
    background: var(--v9-green-soft);
    color: #8ff0be;
    font-size: 12px;
    line-height: 1.5;
}

.v9-alert.error {
    border-color: rgba(229, 41, 67, .42);
    background: var(--v9-red-soft);
    color: #ff9aaa;
}

.v9-alert.warning {
    border-color: rgba(244, 201, 93, .4);
    background: var(--v9-yellow-soft);
    color: #ffe092;
}

.v9-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.v9-stat-card {
    position: relative;
    overflow: hidden;
    min-height: 112px;
    padding: 16px;
    border: 1px solid var(--v9-line);
    border-radius: var(--v9-radius);
    background: linear-gradient(145deg, #101824, #0b111a);
}

.v9-stat-card::after {
    content: '';
    position: absolute;
    right: -27px;
    bottom: -37px;
    width: 96px;
    height: 96px;
    border: 17px solid rgba(255, 255, 255, .025);
    border-radius: 50%;
}

.v9-stat-card.active {
    border-color: rgba(57, 217, 138, .25);
}

.v9-stat-card.disabled {
    border-color: rgba(229, 41, 67, .25);
}

.v9-stat-card.admin {
    border-color: rgba(185, 140, 255, .25);
}

.v9-stat-card.client {
    border-color: rgba(93, 156, 255, .25);
}

.v9-stat-card > span {
    display: block;
    color: var(--v9-muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .62px;
    text-transform: uppercase;
}

.v9-stat-card strong {
    position: relative;
    z-index: 1;
    display: block;
    margin: 9px 0 4px;
    color: #fff;
    font-size: 27px;
    line-height: 1;
}

.v9-stat-card small {
    position: relative;
    z-index: 1;
    color: var(--v9-dim);
    font-size: 10px;
}

.v9-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(145px, 180px));
    gap: 10px;
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid var(--v9-line);
    border-radius: var(--v9-radius);
    background: var(--v9-panel);
}

.v9-search {
    position: relative;
    display: block;
    margin: 0;
}

.v9-search > span {
    position: absolute;
    left: 13px;
    top: 50%;
    z-index: 1;
    transform: translateY(-50%);
    color: var(--v9-dim);
    font-size: 18px;
    pointer-events: none;
}

.v9-search input,
.v9-select,
.v9-field input,
.v9-field select {
    width: 100%;
    min-height: 40px;
    padding: 10px 12px;
    border: 1px solid #26354a;
    border-radius: 8px;
    outline: none;
    background: var(--v9-panel-3);
    color: #f8fafc;
    font: inherit;
    font-size: 12px;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.v9-search input {
    padding-left: 39px;
}

.v9-select {
    cursor: pointer;
}

.v9-search input:focus,
.v9-select:focus,
.v9-field input:focus,
.v9-field select:focus {
    border-color: var(--v9-red);
    box-shadow: 0 0 0 3px rgba(229, 41, 67, .1);
}

.v9-search input::placeholder,
.v9-field input::placeholder {
    color: #4f5e72;
}

.v9-list-card {
    overflow: hidden;
    border: 1px solid var(--v9-line);
    border-radius: var(--v9-radius);
    background: var(--v9-panel);
}

.v9-list-head {
    min-height: 55px;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid var(--v9-line);
    background: #0a1018;
}

.v9-list-head > div {
    min-width: 0;
}

.v9-list-head strong {
    display: block;
    color: #eef3f9;
    font-size: 12px;
}

.v9-list-head > div > span {
    display: block;
    margin-top: 3px;
    color: var(--v9-dim);
    font-size: 10px;
}

.v9-security-badge {
    flex: 0 0 auto;
    gap: 7px;
    padding: 6px 9px;
    border: 1px solid rgba(57, 217, 138, .2);
    border-radius: 999px;
    background: rgba(57, 217, 138, .06);
    color: #73dda9;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .45px;
}

.v9-security-badge i,
.v9-status i {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    border-radius: 50%;
    background: currentColor;
}

.v9-table-wrap {
    overflow-x: auto;
}

.v9-user-table {
    width: 100%;
    min-width: 1120px;
    border-collapse: collapse;
}

.v9-user-table th {
    padding: 12px 14px;
    border-bottom: 1px solid var(--v9-line);
    background: #0a1018;
    color: #72839a;
    font-size: 10px;
    letter-spacing: .6px;
    text-align: left;
    text-transform: uppercase;
}

.v9-user-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--v9-line-soft);
    color: #cbd5e1;
    font-size: 11px;
    vertical-align: middle;
}

.v9-user-table tbody tr {
    transition: background .15s ease;
}

.v9-user-table tbody tr:hover {
    background: #121b28;
}

.v9-user-table tbody tr:last-child td {
    border-bottom: 0;
}

.v9-user-table time {
    color: #9eacbd;
    white-space: nowrap;
}

.v9-user-identity {
    min-width: 230px;
    gap: 11px;
}

.v9-avatar {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border: 1px solid #2d405a;
    border-radius: 10px;
    background: linear-gradient(145deg, #18243a, #101827);
    color: #8eb6ff;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .4px;
}

.v9-user-identity > span:last-child {
    min-width: 0;
}

.v9-user-identity strong,
.v9-user-identity small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v9-user-identity strong {
    max-width: 220px;
    color: #fff;
    font-size: 13px;
}

.v9-user-identity small {
    max-width: 250px;
    margin-top: 4px;
    color: #708197;
    font-size: 10px;
}

.v9-self-badge {
    display: inline-block;
    margin-top: 5px;
    padding: 2px 5px;
    border: 1px solid rgba(93, 156, 255, .25);
    border-radius: 4px;
    background: var(--v9-blue-soft);
    color: #85b4ff;
    font-size: 8px;
    letter-spacing: .5px;
}

.v9-role,
.v9-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .35px;
    text-transform: uppercase;
    white-space: nowrap;
}

.v9-role {
    border: 1px solid #2a3748;
    background: #17202c;
    color: #a9b5c5;
}

.v9-role.founder,
.v9-role.owner {
    border-color: rgba(185, 140, 255, .32);
    background: rgba(185, 140, 255, .1);
    color: #c7a7ff;
}

.v9-role.admin {
    border-color: rgba(229, 41, 67, .35);
    background: var(--v9-red-soft);
    color: #ff8d9d;
}

.v9-role.support {
    border-color: rgba(244, 201, 93, .32);
    background: var(--v9-yellow-soft);
    color: var(--v9-yellow);
}

.v9-role.client {
    border-color: rgba(93, 156, 255, .3);
    background: var(--v9-blue-soft);
    color: #85b4ff;
}

.v9-status.active {
    background: var(--v9-green-soft);
    color: var(--v9-green);
}

.v9-status.disabled {
    background: var(--v9-red-soft);
    color: #ff7f91;
}

.v9-server-count {
    color: #8291a5;
    white-space: nowrap;
}

.v9-server-count b {
    color: #eef3f9;
    font-size: 13px;
}

.v9-row-actions {
    min-width: 190px;
    justify-content: flex-end;
}

.v9-protected {
    color: #556579;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .55px;
}

.v9-empty {
    display: flex;
    min-height: 120px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--v9-muted);
    font-size: 11px;
    text-align: center;
}

.v9-empty strong {
    color: #d7dee8;
    font-size: 12px;
}

.v9-empty span {
    color: var(--v9-dim);
}

.v9-empty.error {
    color: #ff8293;
}

.v9-empty.loading {
    flex-direction: row;
}

.v9-empty.loading i {
    width: 14px;
    height: 14px;
    border: 2px solid #2c3d54;
    border-top-color: var(--v9-red);
    border-radius: 50%;
    animation: v9-spin .7s linear infinite;
}

@keyframes v9-spin {
    to { transform: rotate(360deg); }
}

.v9-pagination {
    min-height: 58px;
    gap: 14px;
    padding: 10px 14px;
    border-top: 1px solid var(--v9-line);
    background: #0a1018;
    color: #708197;
    font-size: 10px;
}

.v9-pagination-controls {
    justify-content: flex-end;
}

.v9-pagination-controls > span {
    min-width: 86px;
    color: #a9b5c5;
    text-align: center;
}

.v9-limit-label {
    gap: 7px;
    margin-right: 4px;
    color: #708197;
}

.v9-select.compact {
    width: 70px;
    min-height: 31px;
    padding: 5px 8px;
    font-size: 10px;
}

.v9-modal {
    position: fixed;
    inset: 0;
    z-index: 14000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(2, 5, 9, .84);
    backdrop-filter: blur(7px);
}

.v9-modal-card {
    width: min(100%, 820px);
    max-height: 94vh;
    overflow-y: auto;
    padding: 22px;
    border: 1px solid #2b3b52;
    border-radius: 15px;
    background: #0d141f;
    box-shadow: 0 34px 120px rgba(0, 0, 0, .72);
}

.v9-modal-card.compact {
    width: min(100%, 700px);
}

.v9-modal-head {
    gap: 16px;
    margin-bottom: 18px;
}

.v9-modal-head > div {
    min-width: 0;
}

.v9-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.v9-form-grid.password-grid {
    margin-top: 14px;
}

.v9-field {
    display: block;
    min-width: 0;
    margin: 0;
}

.v9-field + .v9-field:not(.v9-form-grid .v9-field) {
    margin-top: 14px;
}

.v9-field > span {
    display: block;
    margin-bottom: 7px;
    color: #9eacbd;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .22px;
}

.v9-field > span b {
    margin-left: 4px;
    color: #596b82;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
}

.v9-field > small {
    display: block;
    margin-top: 6px;
    color: #5f7187;
    font-size: 9px;
    line-height: 1.45;
}

.v9-field input:disabled,
.v9-field select:disabled {
    background: #0a0f16;
}

.v9-password-panel {
    margin-top: 17px;
    padding: 15px;
    border: 1px solid #223147;
    border-radius: 10px;
    background: #0a111a;
}

.v9-section-head {
    gap: 12px;
    margin-bottom: 13px;
}

.v9-section-head strong,
.v9-section-head span {
    display: block;
}

.v9-section-head strong {
    color: #edf2f8;
    font-size: 11px;
}

.v9-section-head span {
    margin-top: 3px;
    color: #66788f;
    font-size: 9px;
}

.v9-check {
    width: fit-content;
    gap: 8px;
    margin-top: 12px;
    color: #9eacbd;
    font-size: 10px;
    cursor: pointer;
}

.v9-check input {
    width: 15px;
    height: 15px;
    accent-color: var(--v9-red);
}

.v9-note,
.v9-warning {
    margin-top: 15px;
    padding: 11px 13px;
    border: 1px solid #25354a;
    border-radius: 8px;
    background: #0a1018;
    color: #75869c;
    font-size: 10px;
    line-height: 1.5;
}

.v9-note strong,
.v9-note span {
    display: block;
}

.v9-note strong {
    color: #b8c3d1;
    font-size: 10px;
}

.v9-note span {
    margin-top: 3px;
}

.v9-warning {
    border-color: rgba(244, 201, 93, .28);
    background: var(--v9-yellow-soft);
    color: #e7c970;
}

.v9-modal-actions {
    margin-top: 19px;
    padding-top: 15px;
    border-top: 1px solid var(--v9-line);
}

.v9-modal-actions .v9-button:first-child {
    margin-left: auto;
}

.v9-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 1240px) {
    .v9-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v9-toolbar {
        grid-template-columns: minmax(240px, 1fr) repeat(3, minmax(130px, 160px));
    }
}

@media (max-width: 920px) {
    .v9-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .v9-search {
        grid-column: 1 / -1;
    }

    .v9-toolbar .v9-select:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .v9-page-head,
    .v9-modal-head,
    .v9-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .v9-head-actions,
    .v9-pagination-controls {
        width: 100%;
    }

    .v9-pagination-controls {
        justify-content: flex-start;
    }

    .v9-form-grid {
        grid-template-columns: 1fr;
    }

    .v9-modal-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .v9-modal-actions .v9-button:first-child {
        margin-left: 0;
    }
}

@media (max-width: 620px) {
    #usersCorePage.page {
        padding: 17px 13px;
    }

    .v9-page-head h2,
    .v9-modal-head h2 {
        font-size: 18px;
    }

    .v9-stats,
    .v9-toolbar {
        grid-template-columns: 1fr;
    }

    .v9-search,
    .v9-toolbar .v9-select:last-child {
        grid-column: auto;
    }

    .v9-stat-card {
        min-height: 98px;
    }

    .v9-list-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .v9-security-badge {
        margin-top: 3px;
    }

    .v9-pagination-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .v9-limit-label,
    .v9-pagination-controls > span {
        grid-column: 1 / -1;
    }

    .v9-limit-label {
        justify-content: flex-start;
    }

    .v9-pagination-controls > span {
        min-width: 0;
        text-align: left;
    }

    .v9-modal {
        align-items: stretch;
        padding: 0;
    }

    .v9-modal-card,
    .v9-modal-card.compact {
        width: 100%;
        max-height: 100vh;
        padding: 16px;
        border: 0;
        border-radius: 0;
    }

    .v9-password-panel {
        padding: 12px;
    }

    .v9-modal-actions {
        position: sticky;
        bottom: -16px;
        margin-right: -16px;
        margin-left: -16px;
        padding: 12px 16px 16px;
        background: #0d141f;
    }
}
