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.

8.1 KB
Raw Blame
// ============================================
// NOTIFICATION SETTINGS STYLES
// ============================================

// User Notification Preferences
.user-notification-prefs {
    display: flex;
    flex-direction: column;
    gap: $space-4;
}

// "Email bouncing" warning shown in the Email Settings card when a user's
// address is auto-muted after repeated hard bounces.
.notif-bounce-warning {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: $space-3;
    flex-wrap: wrap;
    margin-top: $space-3;
    padding: $space-3;
    background: $danger-bg;
    border: 1px solid $danger-border;
    border-radius: $radius-control;

    &__body {
        display: flex;
        align-items: center;
        gap: $space-2;
        flex-wrap: wrap;
        font-size: $text-xs;
        color: $text-secondary;
        min-width: 0;
    }
}

.channel-toggles,
.category-toggles,
.severity-toggles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: $space-3;
}

.channel-toggle,
.category-toggle,
.severity-toggle {
    display: flex;
    align-items: center;
    gap: $space-3;
    padding: $space-3;
    background: $bg-card;
    border: 1px solid $border-default;
    border-radius: $radius-control;
    cursor: pointer;
    color: $text-primary;
    font-size: $text-xs;

    .form-group & { display: flex; margin-bottom: 0; color: $text-primary; }
    > span { flex: 1; order: -1; }
    &:hover { background: $bg-hover; }
    &:focus-within { border-color: $accent-primary; }
}

.notification-channels {
    display: flex;
    flex-direction: column;
    gap: $space-4;
}

.notification-channel-card {
    border: 1px solid $border-subtle;
    border-radius: $radius-card;
    background: $bg-card;
    overflow: hidden;
    transition: border-color 0.2s;

    &.enabled {
        border-color: fade($success-raw, 40%);
    }
}

.channel-header {
    @include focus-ring();
    display: flex;
    align-items: center;
    gap: $space-4;
    padding: $space-4 $space-6;
    cursor: pointer;
    transition: background 0.2s;

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

.channel-icon {
    width: 48px;
    height: 48px; // geometry: icon tile
    display: flex;
    align-items: center;
    justify-content: center;
    background: $bg-hover;
    border-radius: $radius-control;
    flex-shrink: 0;

    svg {
        color: $text-secondary;
    }

    .notification-channel-card.enabled & svg {
        color: $accent-primary;
    }
}

.channel-info {
    flex: 1;
    min-width: 0;

    h3 {
        margin: 0 0 $space-1 0;
        font-size: $text-md;
    }

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

.channel-status {
    display: flex;
    align-items: center;
    gap: $space-4;
}

.expand-icon {
    color: $text-tertiary;
    transition: transform 0.2s;

    &.expanded {
        transform: rotate(180deg);
    }
}

.channel-config {
    padding: $space-6;
    border-top: 1px solid $border-subtle;
    background: $bg-card;
}

.toggle-switch-label {
    display: flex;
    justify-content: space-between;
    align-items: center;

    span {
        font-weight: $font-weight-medium;
    }
}

.channel-actions {
    display: flex;
    justify-content: flex-end;
    gap: $space-2;
    margin-top: $space-6;
    padding-top: $space-4;
    border-top: 1px solid $border-subtle;
}

// ============================================
// PER-EVENT OVERRIDE MATRIX + ORG DEFAULTS
// ============================================

.notif-event-matrix {
    display: flex;
    flex-direction: column;
    gap: $space-2;
}

.notif-event-category {
    border: 1px solid $border-subtle;
    border-radius: $radius-control;
    overflow: hidden;

    &__header {
        display: flex;
        align-items: center;
        gap: $space-3;
        width: 100%;
        padding: $space-3 $space-4;
        background: $bg-card;
        border: none;
        cursor: pointer;
        color: $text-primary;
        text-align: left;

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

        .expand-icon {
            margin-left: auto;
            transition: transform 0.15s ease;
            &.expanded { transform: rotate(180deg); }
        }
    }

    &__name { font-weight: $font-weight-semibold; }

    &__body {
        display: flex;
        flex-direction: column;
        border-top: 1px solid $border-subtle;
    }
}

.notif-event-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: $space-4;
    padding: $space-3 $space-4;
    flex-wrap: wrap;

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

    &__meta {
        display: flex;
        flex-direction: column;
        gap: $space-hair;
        min-width: 180px;
    }

    &__title { color: $text-primary; font-size: $text-base; }

    &__key {
        color: $text-tertiary;
        font-size: $text-xs;
        font-family: $font-mono;
    }

    &__channels {
        display: flex;
        align-items: center;
        gap: $space-2;
        flex-wrap: wrap;
    }

    &__reset {
        background: transparent;
        border: 1px solid $border-subtle;
        border-radius: $radius-badge;
        color: $text-secondary;
        padding: $space-1 $space-2;
        font-size: $text-xs;
        cursor: pointer;

        &:hover:not(:disabled) { background: $bg-hover; color: $text-primary; }
        &:disabled { opacity: 0.4; cursor: default; }
    }
}

.notif-chan-toggle {
    display: inline-flex;
    align-items: center;
    gap: $space-1;
    padding: $space-1 $space-2;
    border: 1px solid $border-subtle;
    border-radius: $radius-badge;
    background: $bg-card;
    color: $text-secondary;
    font-size: $text-xs;
    cursor: pointer;
    text-transform: capitalize;

    &__state {
        font-size: $text-xs;
        font-weight: $font-weight-semibold;
        opacity: 0.85;
    }

    &--inherit { border-style: dashed; color: $text-tertiary; }

    &--on {
        background: $accent-glow;
        border-color: $accent-primary;
        color: $accent-primary;
    }

    &--off {
        background: fade($danger-raw, 12%);
        border-color: fade($danger-raw, 40%);
        color: $danger;
    }

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

.notif-org-defaults {
    .notif-defaults-grid {
        display: flex;
        flex-direction: column;
        gap: $space-1;
        margin: $space-3 0;
        overflow-x: auto;
    }

    .notif-defaults-grid__head,
    .notif-defaults-grid__row {
        display: grid;
        grid-template-columns: 140px repeat(5, minmax(64px, 1fr));
        align-items: center;
        gap: $space-2;
    }

    .notif-defaults-grid__head {
        padding-bottom: $space-2;
        border-bottom: 1px solid $border-subtle;
    }

    .notif-defaults-grid__chan {
        text-align: center;
        font-size: $text-xs;
        color: $text-secondary;
        text-transform: capitalize;
    }

    .notif-defaults-grid__row {
        padding: $space-2 0;
        &:not(:last-child) { border-bottom: 1px solid $border-subtle; }
    }

    .notif-defaults-grid__cat {
        font-size: $text-sm;
        color: $text-primary;
        font-weight: $font-weight-medium;
    }

    .notif-defaults-grid__cell {
        display: flex;
        justify-content: center;
        cursor: pointer;
    }
}

// Email digest cadence selector
.notif-digest-options {
    display: flex;
    gap: $space-3;
    flex-wrap: wrap;
    margin-top: $space-2;
}

.notif-digest-option {
    display: flex;
    flex-direction: column;
    gap: $space-hair;
    flex: 1 1 140px;
    padding: $space-3 $space-4;
    background: $bg-card;
    border: 1px solid $border-subtle;
    border-radius: $radius-control;
    cursor: pointer;
    text-align: left;
    color: $text-secondary;

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

    &.active {
        border-color: $accent-primary;
        background: $accent-glow;
        color: $accent-primary;
    }

    &__label { font-weight: $font-weight-semibold; font-size: $text-base; }
    &__hint { font-size: $text-xs; color: $text-tertiary; }

    &.active &__hint { color: $accent-primary; opacity: 0.85; }
}