:root {
    --bg: #0b1020;
    --panel: #11182b;
    --panel-2: #151d32;
    --line: #26304a;
    --text: #edf2ff;
    --muted: #8f9bb7;
    --accent: #6c7cff;
    --accent-2: #8a96ff;
    --danger: #ff6b7a;
    --warning: #f3b84b;
    --success: #4ad99b;
    --shadow: 0 18px 50px rgba(0, 0, 0, .28)
}

* {
    box-sizing: border-box
}

html {
    background: var(--bg);
    color: var(--text);
    font-family: Inter, system-ui, sans-serif
}

body {
    margin: 0;
    background: radial-gradient(circle at top right, rgba(108, 124, 255, .08), transparent 28%), var(--bg);
    min-height: 100vh
}

a {
    color: inherit;
    text-decoration: none
}

button,
input,
select,
textarea {
    font: inherit
}

.app-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: #0d1426;
    border-right: 1px solid var(--line);
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    z-index: 20
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #5865f2);
    box-shadow: 0 8px 24px rgba(108, 124, 255, .28);
    font-size: 15px
}

.brand-mark img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
    object-position: 58% center
}

.brand-mark.big {
    width: 56px;
    height: 56px;
    font-size: 24px;
    border-radius: 16px;
    margin: auto
}

.server-picker {
    margin: 28px 0 18px
}

.server-picker label,
.field label,
.filter-bar label {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .06em
}

.server-picker select,
.field input,
.field select,
.field textarea,
.filter-bar select {
    width: 100%;
    background: #0a1121;
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 10px;
    padding: 11px 12px;
    outline: none
}

.server-picker select:focus,
.field input:focus,
.field select:focus,
.field textarea:focus,
.filter-bar select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108, 124, 255, .12)
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 4px
}

.nav-label {
    color: #68738e;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .1em;
    font-weight: 700;
    margin: 18px 10px 7px
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 11px;
    border-radius: 9px;
    color: #aab5cf;
    font-size: 14px
}

.nav-item span {
    width: 18px;
    text-align: center
}

.nav-item:hover {
    background: #131c31;
    color: var(--text)
}

.nav-item.active {
    background: rgba(108, 124, 255, .14);
    color: #dce2ff
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid var(--line)
}

.user-row {
    display: flex;
    align-items: center;
    gap: 10px
}

.avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #27304a;
    color: #dfe5ff;
    font-weight: 700
}

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

.user-row strong {
    display: block;
    font-size: 13px
}

.user-row small {
    color: var(--muted);
    font-size: 11px
}

.text-button {
    background: none;
    border: 0;
    color: var(--muted);
    padding: 10px 0 0;
    cursor: pointer;
    font-size: 12px
}

.text-button:hover {
    color: var(--text)
}

.main {
    min-width: 0
}

.topbar {
    height: 64px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    background: rgba(11, 16, 32, .8);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 10
}

.menu-button {
    display: none;
    background: none;
    border: 0;
    color: var(--text);
    font-size: 20px
}

.eyebrow {
    color: #7f8aa6;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #aeb8ce;
    font-size: 12px
}

.status-pill span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(74, 217, 155, .08)
}

.content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 34px
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 26px
}

.page-heading h1 {
    font-size: 29px;
    line-height: 1.15;
    margin: 5px 0 8px;
    letter-spacing: -.03em
}

.page-heading p,
.panel-head p {
    margin: 0;
    color: var(--muted);
    font-size: 14px
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 10px 15px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer
}

.button.primary {
    background: linear-gradient(135deg, var(--accent), #5865f2);
    color: #fff
}

.button.primary:hover {
    filter: brightness(1.08)
}

.button.secondary {
    border-color: var(--line);
    background: #121a2e;
    color: #dce2f4
}

.button.large {
    padding: 13px 19px;
    font-size: 14px
}

.notice {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    font-size: 13px
}

.notice.warning {
    border-color: rgba(243, 184, 75, .28);
    background: rgba(243, 184, 75, .06)
}

.notice span {
    color: var(--muted)
}

.notice a {
    margin-left: auto;
    color: #ffd77c
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px
}

.stat-card,
.panel {
    background: linear-gradient(180deg, rgba(21, 29, 50, .96), rgba(17, 24, 43, .96));
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow)
}

.stat-card {
    padding: 18px
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 12px
}

.stat-card strong {
    display: block;
    font-size: 28px;
    margin: 10px 0 5px;
    letter-spacing: -.04em
}

.stat-card .small-value {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.stat-card small {
    color: #6f7a96;
    font-size: 11px
}

.panel {
    padding: 20px;
    margin-bottom: 18px
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 20px
}

.panel-head h2 {
    font-size: 16px;
    margin: 0 0 6px
}

.text-link {
    font-size: 12px;
    color: #b7c1ff
}

.activity-list {
    display: flex;
    flex-direction: column
}

.activity-row {
    display: grid;
    grid-template-columns: 14px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid rgba(38, 48, 74, .68)
}

.activity-row:first-child {
    border-top: 0
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent)
}

.activity-row strong {
    font-size: 13px
}

.activity-row p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
    max-width: 780px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.activity-row time {
    font-size: 11px;
    color: #6f7a96
}

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 0
}

.field {
    margin-bottom: 16px
}

.field.compact {
    max-width: 280px
}

.field textarea {
    resize: vertical;
    min-height: 110px;
    line-height: 1.5
}

.field-grid {
    display: grid;
    gap: 14px
}

.field-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr))
}

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

.toggle-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #0f1729;
    cursor: pointer
}

.toggle-card.single {
    margin-top: 4px
}

.toggle-card strong,
.rule strong {
    display: block;
    font-size: 13px
}

.toggle-card span,
.rule span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-top: 4px
}

.toggle-card input,
.switch-only input {
    display: none
}

.toggle-card i,
.switch-only i {
    width: 38px;
    height: 22px;
    border-radius: 30px;
    background: #2a3551;
    position: relative;
    flex: none;
    transition: .2s
}

.toggle-card i:before,
.switch-only i:before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #d5daea;
    top: 3px;
    left: 3px;
    transition: .2s
}

.toggle-card input:checked+i,
.switch-only input:checked+i {
    background: var(--accent)
}

.toggle-card input:checked+i:before,
.switch-only input:checked+i:before {
    transform: translateX(16px);
    background: #fff
}

.switch-only {
    cursor: pointer
}

.split-panels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px
}

.hint-box {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 14px 16px;
    border: 1px dashed var(--line);
    border-radius: 11px;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 18px
}

.hint-box code {
    background: #0f1729;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 4px 7px;
    color: #c7d0ff
}

.sticky-actions {
    position: sticky;
    bottom: 16px;
    z-index: 5;
    background: rgba(15, 23, 41, .92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow)
}

.sticky-actions span {
    color: var(--muted);
    font-size: 12px
}

.rules-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px
}

.rule {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #0f1729
}

.rule input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent)
}

.nested-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px
}

.nested-fields .field,
.nested-one {
    margin: 0
}

.panel-actions {
    display: flex;
    justify-content: flex-end
}

.table-panel {
    padding: 0;
    overflow: hidden
}

.table-panel .panel-head {
    padding: 20px 20px 0
}

.table-wrap {
    overflow: auto
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px
}

th {
    text-align: left;
    color: #76829f;
    background: #0f1729;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 11px 14px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line)
}

td {
    padding: 13px 14px;
    border-bottom: 1px solid rgba(38, 48, 74, .66);
    font-size: 12px;
    color: #ccd4e7;
    vertical-align: top
}

tr:last-child td {
    border-bottom: 0
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: #aeb7d2
}

.reason-cell {
    max-width: 420px;
    white-space: normal
}

.badge,
.event-label {
    display: inline-flex;
    border-radius: 99px;
    padding: 4px 8px;
    background: #1c2740;
    color: #b8c4e1;
    font-size: 10px;
    text-transform: capitalize
}

.badge.open {
    background: rgba(74, 217, 155, .1);
    color: #76e7b7
}

.badge.closed {
    background: rgba(143, 155, 183, .1);
    color: #aeb8ce
}

.empty-cell,
.empty-inline {
    text-align: center;
    color: var(--muted);
    padding: 28px
}

.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 14px
}

.filter-bar form {
    width: 260px
}

.filter-bar span,
.count-chip {
    font-size: 11px;
    color: var(--muted);
    background: #121a2d;
    border: 1px solid var(--line);
    border-radius: 99px;
    padding: 7px 10px
}

.flash {
    margin-bottom: 18px;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 12px;
    border: 1px solid var(--line)
}

.flash.success {
    background: rgba(74, 217, 155, .08);
    border-color: rgba(74, 217, 155, .24);
    color: #9aefca
}

.flash.error {
    background: rgba(255, 107, 122, .08);
    border-color: rgba(255, 107, 122, .24);
    color: #ffadb5
}

.empty-state,
.center-card {
    text-align: center;
    border: 1px dashed var(--line);
    border-radius: 14px;
    padding: 60px 20px;
    background: rgba(17, 24, 43, .55)
}

.empty-state h2,
.center-card h1 {
    margin: 12px 0 8px
}

.empty-state p,
.center-card p {
    color: var(--muted);
    max-width: 580px;
    margin: 0 auto;
    line-height: 1.6
}

.empty-icon {
    margin: auto;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: #17213a;
    color: #b9c2ff;
    font-weight: 700
}

.center-card {
    max-width: 540px;
    margin: 12vh auto
}

.landing {
    min-height: 100vh;
    max-width: 1240px;
    margin: auto;
    padding: 0 32px
}

.landing-nav {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between
}

.hero {
    min-height: 620px;
    display: grid;
    grid-template-columns: 1.03fr .97fr;
    align-items: center;
    gap: 60px
}

.hero-kicker {
    display: inline-flex;
    padding: 6px 10px;
    border: 1px solid rgba(108, 124, 255, .25);
    background: rgba(108, 124, 255, .08);
    border-radius: 99px;
    color: #b8c2ff;
    font-size: 12px
}

.hero h1 {
    font-size: 56px;
    line-height: 1.02;
    letter-spacing: -.055em;
    margin: 18px 0 20px;
    max-width: 760px
}

.hero p {
    font-size: 18px;
    line-height: 1.7;
    color: var(--muted);
    max-width: 650px
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 28px
}

.hero-actions span {
    color: #6f7a96;
    font-size: 12px
}

.hero-panel {
    position: relative
}

.hero-art {
    position: relative;
    display: block;
    width: 100%;
    max-height: 560px;
    object-fit: cover;
    object-position: center;
    border: 1px solid #303b5a;
    border-radius: 12px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, .4);
    transform: perspective(1000px) rotateY(-3deg) rotateX(2deg)
}

.mini-top {
    display: flex;
    gap: 6px;
    padding: 4px 3px 12px
}

.mini-top span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #36415f
}

.mini-body {
    height: 330px;
    display: grid;
    grid-template-columns: 90px 1fr;
    border: 1px solid #222d48;
    border-radius: 10px;
    overflow: hidden
}

.mini-sidebar {
    background: #0b1121;
    border-right: 1px solid #222d48
}

.mini-content {
    padding: 26px
}

.mini-title {
    height: 18px;
    width: 44%;
    background: #283452;
    border-radius: 5px;
    margin-bottom: 22px
}

.mini-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px
}

.mini-cards i {
    height: 70px;
    border-radius: 8px;
    background: linear-gradient(180deg, #1b2641, #141d33);
    border: 1px solid #26324f
}

.mini-table {
    margin-top: 16px;
    border: 1px solid #26324f;
    border-radius: 8px;
    overflow: hidden
}

.mini-table b {
    display: block;
    height: 39px;
    border-bottom: 1px solid #26324f;
    background: #121b30
}

.mini-table b:last-child {
    border-bottom: 0
}

.feature-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding-bottom: 52px
}

.feature-strip article {
    border-top: 1px solid var(--line);
    padding: 20px 4px
}

.feature-strip strong {
    display: block;
    font-size: 13px
}

.feature-strip span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 6px;
    line-height: 1.5
}

@media(max-width:1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .field-grid.three {
        grid-template-columns: 1fr
    }

    .hero {
        grid-template-columns: 1fr
    }

    .hero-panel {
        display: none
    }

    .hero h1 {
        font-size: 46px
    }

    .feature-strip {
        grid-template-columns: 1fr
    }
}

@media(max-width:900px) {
    .app-shell {
        display: block
    }

    .sidebar {
        position: fixed;
        left: -280px;
        transition: .25s;
        width: 260px
    }

    .sidebar.open {
        left: 0;
        box-shadow: 30px 0 80px rgba(0, 0, 0, .5)
    }

    .menu-button {
        display: block
    }

    .topbar {
        padding: 0 18px
    }

    .content {
        padding: 24px 18px
    }

    .split-panels,
    .toggle-grid,
    .rules-grid {
        grid-template-columns: 1fr
    }

    .page-heading {
        align-items: flex-start
    }

    .sticky-actions {
        bottom: 10px
    }

    .landing {
        padding: 0 20px
    }

    .hero {
        min-height: 520px
    }

    .hero h1 {
        font-size: 40px
    }
}

@media(max-width:620px) {
    .stats-grid {
        grid-template-columns: 1fr
    }

    .page-heading {
        flex-direction: column
    }

    .activity-row {
        grid-template-columns: 16px 1fr
    }

    .activity-row time {
        grid-column: 2
    }

    .sticky-actions {
        gap: 12px
    }

    .sticky-actions span {
        display: none
    }

    .button {
        width: 100%
    }

    .landing-nav .button {
        width: auto
    }

    .hero-actions {
        align-items: flex-start;
        flex-direction: column
    }

    .hero-actions .button {
        width: auto
    }
}