Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

18.1 KB
Raw Blame
// ============================================
// USER MANAGEMENT STYLES
// ============================================

// --------------------------------------------
// Setup Page
// --------------------------------------------
.setup-card {
    max-width: 480px;
}

.setup-info {
    display: flex;
    gap: $space-4;
    padding: $space-4;
    background: fade($accent-primary-raw, 10%);
    border-radius: $radius-control;
    margin-bottom: $space-6;

    .setup-info-icon {
        flex-shrink: 0;
        color: $accent-primary;
    }

    p {
        margin: 0;
        font-size: $text-xs;
        color: $text-secondary;
        line-height: 1.5;
    }
}

.setup-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: $space-2;
    margin-top: $space-6;
    padding-top: $space-6;
    border-top: 1px solid $border-default;
    color: $text-tertiary;
    font-size: $text-xs;

    svg {
        color: $success;
    }
}

// --------------------------------------------
// Users Tab
// --------------------------------------------
.users-tab {
    .tab-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: $space-6;

        .tab-header-content {
            h3 {
                margin: 0 0 $space-1 0;
                font-size: $text-lg;
                font-weight: $font-weight-semibold;
            }

            p {
                margin: 0;
                color: $text-secondary;
                font-size: $text-xs;
            }
        }
    }
}

.users-action--warning { color: $warning; }
.users-action--success { color: $success; }
.users-action--danger { color: $danger; }

// `.users-table` is the DataTable wrap; only row/cell content is styled here.
.users-table {
    .inactive {
        opacity: 0.6;
    }

    .user-info {
        display: flex;
        align-items: center;
        gap: $space-4;
    }

    .user-avatar {
        width: 40px;
        height: 40px; // geometry: avatar
        border-radius: 50%;
        background: $accent-primary;
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: $font-weight-semibold;
        font-size: $text-md;
        flex-shrink: 0;
    }

    .user-details {
        display: flex;
        flex-direction: column;
        gap: $space-hair;

        .username {
            font-weight: $font-weight-medium;
            display: flex;
            align-items: center;
            gap: $space-2;
        }

        .email {
            font-size: $text-xs;
            color: $text-secondary;
        }
    }

    .you-badge {
        font-size: $text-xs;
        padding: $space-hair $space-tight;
        background: $accent-primary;
        color: #fff;
        border-radius: $radius-badge;
        font-weight: $font-weight-medium;
    }

    .status-badge {
        display: inline-flex;
        align-items: center;
        padding: $space-1 $space-3;
        border-radius: $radius-full;
        font-size: $text-xs;
        font-weight: $font-weight-medium;

        &.active {
            background: fade($success-raw, 15%);
            color: $success;
        }

        &.inactive {
            background: fade($warning-raw, 15%);
            color: $warning;
        }
    }

    .date-cell {
        font-size: $text-xs;
        color: $text-secondary;
        white-space: nowrap;
    }

    .actions-cell {
        display: flex;
        gap: $space-1;
    }
}

// --------------------------------------------
// User Modal Styles
// --------------------------------------------

.form-help {
    display: block;
    margin-top: $space-1;
    font-size: $text-xs;
    color: $text-tertiary;
}

.role-descriptions {
    margin-top: $space-6;
    padding: $space-4;
    background: $bg-hover;
    border-radius: $radius-control;

    h4 {
        margin: 0 0 $space-4 0;
        font-size: $text-xs;
        font-weight: $font-weight-semibold;
        color: $text-secondary;
    }

    .role-item {
        display: flex;
        gap: $space-2;
        padding: $space-2 0;

        &:not(:last-child) {
            border-bottom: 1px solid $border-default;
        }

        .role-name {
            font-weight: $font-weight-medium;
            min-width: 80px;
            font-size: $text-xs;
        }

        .role-desc {
            font-size: $text-xs;
            color: $text-secondary;
        }
    }
}

// --------------------------------------------
// Audit Log Tab
// --------------------------------------------
.audit-log-tab {
    .tab-header {
        margin-bottom: $space-6;

        h3 {
            margin: 0 0 $space-1 0;
            font-size: $text-lg;
            font-weight: $font-weight-semibold;
        }

        p {
            margin: 0;
            color: $text-secondary;
            font-size: $text-xs;
        }
    }
}

// NOTE: the audit-log / filters styles that previously lived here were a
// stale duplicate (overridden by the definitions further down). Removed to
// kill the dead code, including an orphaned colored left-border side-stripe.

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: $space-4;
    margin-top: $space-6;
    padding-top: $space-6;
    border-top: 1px solid $border-default;

    .pagination-info {
        font-size: $text-xs;
        color: $text-secondary;
    }
}

// --------------------------------------------
// Settings Nav Divider
// --------------------------------------------
.settings-nav-divider {
    padding: $space-3 $space-3 $space-1;
    margin-top: $space-3;
    font-size: $text-xs;
    font-weight: $font-weight-medium;
    color: var(--text-ghost);

    &:first-child {
        margin-top: 0;
    }
}

// --------------------------------------------
// Loading & Empty States
// --------------------------------------------

// --------------------------------------------
// Button Variants
// --------------------------------------------
.btn.text-warning {
    color: $warning;

    &:hover {
        background: fade($warning-raw, 10%);
    }
}

.btn.text-success {
    color: $success;

    &:hover {
        background: fade($success-raw, 10%);
    }
}

.btn.text-danger {
    color: $danger;

    &:hover {
        background: fade($danger-raw, 10%);
    }
}

// --------------------------------------------
// Permission Editor
// --------------------------------------------
.permission-editor {
    margin-top: $space-4;
    border: 1px solid $border-default;
    border-radius: $radius-control;
    max-height: 400px;
    overflow-y: auto;
}

.permission-header-row {
    display: grid;
    grid-template-columns: 1fr 60px 60px;
    gap: $space-2;
    padding: $space-2 $space-4;
    background: $bg-hover;
    font-size: $text-xs;
    font-weight: $font-weight-semibold;
    color: $text-secondary;
    border-bottom: 1px solid $border-default;
    position: sticky;
    top: 0;
    z-index: 1;
}

.permission-level-label {
    text-align: center;
}

.permission-group {
    &:not(:last-child) {
        border-bottom: 1px solid $border-default;
    }
}

.permission-group-label {
    padding: $space-2 $space-4;
    font-size: $text-xs;
    font-weight: $font-weight-semibold;
    color: $text-tertiary;
    background: fade($bg-hover-raw, 50%);
}

.permission-row {
    display: grid;
    grid-template-columns: 1fr 60px 60px;
    gap: $space-2;
    align-items: center;
    padding: $space-2 $space-4;

    &:hover {
        background: $bg-hover;
    }
}

.permission-feature-name {
    font-size: $text-xs;
}

.customize-permissions-section {
    margin-top: $space-4;

    > .btn {
        margin-bottom: $space-2;

        svg {
            margin-left: $space-1;
        }
    }
}

// --------------------------------------------
// Invitations Section
// --------------------------------------------
.invitations-section {
    margin-top: $space-8;
    padding-top: $space-8;
    border-top: 1px solid $border-default;

    .tab-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: $space-4;

        .tab-header-content {
            h4 {
                margin: 0 0 $space-1 0;
                font-size: $text-md;
                font-weight: $font-weight-semibold;
            }

            p {
                margin: 0;
                color: $text-secondary;
                font-size: $text-xs;
            }
        }
    }
}

.invitation-status {
    display: inline-flex;
    align-items: center;
    padding: $space-1 $space-2;
    border-radius: $radius-full;
    font-size: $text-xs;
    font-weight: $font-weight-medium;
    text-transform: capitalize;

    &.pending {
        background: fade($accent-primary-raw, 15%);
        color: $accent-primary;
    }

    &.accepted {
        background: fade($success-raw, 15%);
        color: $success;
    }

    &.expired {
        background: fade($text-tertiary-raw, 15%);
        color: $text-tertiary;
    }

    &.revoked {
        background: fade($danger-raw, 15%);
        color: $danger;
    }
}

// --------------------------------------------
// Activity Tab
// --------------------------------------------
.activity-tab {
    .tab-header {
        margin-bottom: $space-6;

        h3 {
            margin: 0 0 $space-1 0;
            font-size: $text-xl;
            font-weight: $font-weight-semibold;
            color: $text-primary;
        }

        p {
            margin: 0;
            color: $text-secondary;
            font-size: $text-md;
        }
    }
}

// Restrained readout strip (replaces the hero-metric stat cards). Reads like
// the dashboard's server-identity line: mono numbers, muted labels, one row.
.activity-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: $space-3 $space-6;
    margin-bottom: $space-8;
    padding-bottom: $space-5;
    border-bottom: 1px solid $border-subtle;
    color: $text-tertiary;
    font-size: $text-xs;

    &__item {
        display: inline-flex;
        align-items: baseline;
        gap: $space-2;
    }

    &__value {
        font-size: $text-lg;
        font-weight: $font-weight-semibold;
        color: $text-primary;
        font-variant-numeric: tabular-nums;
    }
}

.most-active-users {
    margin-bottom: $space-8;
    padding: $space-6;
    background: $bg-card;
    border: 1px solid $border-default;
    border-radius: $radius-card;
    box-shadow: none;

    h4 {
        margin: 0 0 $space-6 0;
        font-size: $text-lg;
        font-weight: $font-weight-semibold;
        color: $text-primary;
    }
}

.active-users-list {
    display: flex;
    flex-direction: column;
    gap: $space-4;
}

.active-user-item {
    display: flex;
    align-items: center;
    gap: $space-4;

    .active-user-rank {
        width: 28px;
        height: 28px; // geometry: rank medallion, not a control
        display: flex;
        align-items: center;
        justify-content: center;
        background: $bg-hover;
        border-radius: 50%;
        font-weight: $font-weight-semibold;
        font-size: $text-xs;
        color: $text-tertiary;
    }

    .active-user-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: $space-1;
    }

    .active-user-name {
        font-size: $text-xs;
        font-weight: $font-weight-semibold;
        color: $text-primary;
    }

    .active-user-bar-wrapper {
        height: 6px;
        background: $bg-hover;
        border-radius: $radius-full;
        overflow: hidden;
    }

    .active-user-bar {
        height: 100%;
        background: linear-gradient(90deg, $accent-primary, $accent-hover);
        border-radius: $radius-full;
        transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .active-user-count {
        font-size: $text-xs;
        font-weight: $font-weight-semibold;
        color: $text-secondary;
        white-space: nowrap;
    }
}

.activity-feed-section {
    margin-top: $space-8;

    .section-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: $space-4;

        h4 {
            margin: 0;
            font-size: $text-lg;
            font-weight: $font-weight-semibold;
            color: $text-primary;
        }
    }
}

.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: $space-4;
    align-items: flex-end;
    margin-bottom: $space-6;
    padding: $space-5;
    background: $bg-hover;
    border-radius: $radius-card;
    border: 1px solid $border-default;

    .filter-group {
        display: flex;
        flex-direction: column;
        gap: $space-2;

        label {
            display: flex;
            align-items: center;
            gap: $space-2;
            font-size: $text-xs;
            font-weight: $font-weight-semibold;
            color: $text-tertiary;
        }

        select.form-control {
            min-width: 200px;
            height: $control-md;
            padding: 0 $space-3;
            background: $bg-card;
            border: 1px solid $border-default;
            border-radius: $radius-control;
            font-size: $text-xs;
            color: $text-primary;
            cursor: pointer;
            transition: border-color 0.2s, box-shadow 0.2s;

            &:focus {
                outline: none;
                border-color: $accent-primary;
                box-shadow: $focus-ring;
            }

            &:hover {
                border-color: $border-active;
            }
        }
    }

    .btn-clear {
        height: $control-md;
        display: flex;
        align-items: center;
        gap: $space-2;
        padding: 0 $space-4;
        color: $text-tertiary;

        &:hover {
            color: $danger;
            background: fade($danger-raw, 10%);
        }
    }
}

// Dense, scannable audit log (journalctl-style), not a social feed. One row
// per event inside a single bordered surface with hairline separators.
.audit-log-list {
    border: 1px solid $border-default;
    border-radius: $radius-card;
    overflow: hidden;
    background: $bg-card;
}

.log-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: $space-2 $space-3;
    padding: $space-2 $space-4;
    border-bottom: 1px solid $border-subtle;
    font-size: $text-xs;
    transition: background-color $transition-fast;

    &:last-child { border-bottom: none; }

    &:hover {
        background: $bg-hover;
    }

    // Severity reads from the dot color AND the action text, never color alone.
    .log-row__dot {
        flex-shrink: 0;
        align-self: center;
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: $text-tertiary;
    }

    &.action-success .log-row__dot { background: $success; }
    &.action-warning .log-row__dot { background: $warning; }
    &.action-danger  .log-row__dot { background: $danger; }
    &.action-info    .log-row__dot { background: $accent-primary; }

    .log-row__time {
        flex-shrink: 0;
        width: 124px;
        font-size: $text-xs;
        color: $text-tertiary;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }

    .log-row__action {
        font-family: $font-mono;
        font-weight: $font-weight-medium;
        color: $text-primary;
    }

    .log-row__user {
        color: $accent-primary;
        font-weight: $font-weight-medium;
        white-space: nowrap;
    }

    .log-row__target {
        color: $text-tertiary;
        white-space: nowrap;
    }

    .log-row__meta {
        margin-left: auto;
        display: inline-flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        align-items: baseline;
        gap: $space-1 $space-3;
        min-width: 0;
        font-size: $text-xs;
        color: $text-tertiary;
    }

    .log-row__detail {
        color: $text-secondary;
        max-width: 320px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .log-row__detail-key {
        color: $text-tertiary;
    }

    .log-row__ip {
        color: $text-tertiary;
    }
}

// --------------------------------------------
// One-Time Login Links (Users tab)
// --------------------------------------------
.login-links {
    margin-top: $space-10;

    &__form {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-end;
        gap: $space-4;
    }

    &__field {
        display: flex;
        flex-direction: column;
        gap: $space-1;

        // The caption only: a bare `span` also matched the Select's value.
        > span {
            font-size: $text-xs;
            color: $text-secondary;
        }

        > .ui-select-trigger { min-width: 160px; }

        input {
            min-width: 160px;
            padding: $space-2 $space-3;
            background: $bg-card;
            border: 1px solid $border-default;
            border-radius: $radius-control;
            color: $text-primary;
            font-size: $text-xs;
        }
    }

    &__bind {
        display: inline-flex;
        align-items: center;
        gap: $space-2;
        padding-bottom: $space-2;
        font-size: $text-xs;
        color: $text-secondary;
        cursor: pointer;
    }

    &__note {
        margin-top: $space-2;
        font-size: $text-xs;
        color: $text-tertiary;
    }

    &__reveal {
        margin-top: $space-4;
        padding: $space-4;
        border: 1px solid $border-default;
        border-radius: $radius-control;
        background: $bg-hover;

        &-title {
            margin: 0 0 $space-2;
            font-size: $text-xs;
            font-weight: $font-weight-semibold;
        }
    }

    &__list {
        list-style: none;
        margin: $space-4 0 0;
        padding: 0;
        border: 1px solid $border-default;
        border-radius: $radius-control;
    }

    &__item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: $space-3;
        padding: $space-3 $space-4;

        + .login-links__item {
            border-top: 1px solid $border-subtle;
        }
    }

    &__item-user {
        font-size: $text-xs;
        font-weight: $font-weight-medium;
        margin-right: $space-2;
    }

    &__item-meta {
        font-size: $text-xs;
        color: $text-tertiary;
    }
}