* {
    box-sizing: border-box;
}

:root {
    --bg: #070707;
    --panel: #0d0d0f;
    --panel2: #111113;
    --panel3: #161618;
    --border: #242426;
    --border-light: #303033;
    --text: #f5f5f5;
    --muted: #8d8d94;
    --muted2: #66666d;
    --accent: #ffffff;
    --danger: #ff5d5d;
    --success: #61d38c;
    --warning: #e8c36a;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

body {
    overflow-x: hidden;
}

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

button {
    cursor: pointer;
}

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

.hidden {
    display: none !important;
}

.app {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 255px;
    flex-shrink: 0;
    min-height: 100vh;
    background: #09090a;
    border-right: 1px solid var(--border);
    padding: 22px 14px;
    display: flex;
    flex-direction: column;
}

.brand,
.brand-large {
    display: flex;
    align-items: center;
    gap: 11px;
}

.brand {
    padding: 4px 10px 22px;
}

.brand-mark {
    width: 36px;
    height: 36px;
    border: 2px solid white;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 19px;
}

.brand-text,
.brand-large div:last-child {
    display: flex;
    flex-direction: column;
}

.brand-text strong,
.brand-large strong {
    font-size: 15px;
    letter-spacing: -.2px;
}

.brand-text span,
.brand-large span {
    color: var(--muted);
    font-size: 11px;
}

.server-picker {
    border: 1px solid var(--border);
    background: var(--panel);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 2px 20px;
}

.server-icon {
    width: 35px;
    height: 35px;
    border-radius: 9px;
    background: white;
    color: black;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.server-picker > div:nth-child(2) {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.server-picker strong {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.server-picker span {
    color: var(--muted);
    font-size: 10px;
}

.chevron {
    color: var(--muted);
}

.nav-label {
    color: #55555b;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.2px;
    padding: 12px 12px 6px;
}

.nav-item {
    width: 100%;
    border: 0;
    background: transparent;
    color: #99999f;
    text-align: left;
    border-radius: 8px;
    padding: 10px 11px;
    display: flex;
    gap: 11px;
    align-items: center;
    font-size: 12px;
    margin: 2px 0;
}

.nav-item span {
    width: 16px;
    text-align: center;
    color: #77777d;
}

.nav-item:hover {
    color: white;
    background: #121214;
}

.nav-item.active {
    color: white;
    background: #19191b;
}

.nav-item.active span {
    color: white;
}

.sidebar-bottom {
    margin-top: auto;
    padding: 15px 8px 2px;
}

.version {
    color: #55555b;
    font-size: 9px;
    margin-bottom: 10px;
}

.logout {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 8px;
    padding: 8px;
    font-size: 11px;
}

.logout:hover {
    border-color: var(--border-light);
    color: white;
}

.main {
    flex: 1;
    min-width: 0;
}

.topbar {
    min-height: 86px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 35px;
}

.page-kicker {
    font-size: 9px;
    color: #5f5f65;
    font-weight: 800;
    letter-spacing: 1.5px;
    margin-bottom: 5px;
}

.topbar h1 {
    margin: 0;
    font-size: 22px;
    letter-spacing: -.5px;
}

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

.user-menu div:last-child {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.user-menu strong {
    font-size: 12px;
}

.user-menu span {
    color: var(--muted);
    font-size: 10px;
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #222;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
}

#content {
    max-width: 1400px;
    padding: 30px 35px 70px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
}

.page-header h2 {
    margin: 0 0 6px;
    font-size: 19px;
}

.page-header p {
    color: var(--muted);
    margin: 0;
    font-size: 12px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 18px;
}

.stat-card {
    min-height: 112px;
}

.stat-label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
}

.stat-value {
    margin-top: 12px;
    font-size: 26px;
    font-weight: 750;
    letter-spacing: -1px;
}

.stat-detail {
    margin-top: 5px;
    color: var(--muted2);
    font-size: 10px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 14px;
}

.card-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 15px;
}

.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}

.status-row:last-child {
    border-bottom: 0;
}

.status-left {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12px;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
}

.status {
    font-size: 10px;
    color: var(--success);
}

.activity {
    display: flex;
    gap: 11px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.activity:last-child {
    border: 0;
}

.activity-icon {
    width: 27px;
    height: 27px;
    border-radius: 7px;
    background: var(--panel3);
    display: grid;
    place-items: center;
    font-size: 10px;
}

.activity-text {
    font-size: 11px;
}

.activity-time {
    display: block;
    color: var(--muted2);
    font-size: 9px;
    margin-top: 3px;
}

.button {
    border: 1px solid var(--border-light);
    background: white;
    color: black;
    border-radius: 7px;
    padding: 9px 14px;
    font-size: 11px;
    font-weight: 700;
}

.button:hover {
    opacity: .88;
}

.button.secondary {
    background: var(--panel3);
    color: white;
    border-color: var(--border);
}

.button.danger {
    background: transparent;
    color: var(--danger);
    border-color: #402222;
}

.form {
    max-width: 650px;
}

.form-group {
    margin-bottom: 17px;
}

.form-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 7px;
}

.form-help {
    display: block;
    color: var(--muted);
    font-size: 10px;
    margin-top: 6px;
}

.input,
.textarea,
.select {
    width: 100%;
    background: #09090a;
    color: white;
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 11px 12px;
    outline: none;
}

.input:focus,
.textarea:focus,
.select:focus {
    border-color: #505055;
}

.textarea {
    min-height: 150px;
    resize: vertical;
}

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

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    color: #66666c;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .7px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 11px;
}

.badge {
    display: inline-block;
    padding: 4px 7px;
    border-radius: 5px;
    background: #19191b;
    color: #aaa;
    font-size: 9px;
}

.badge.success {
    color: var(--success);
}

.empty {
    padding: 45px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

.login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
        radial-gradient(circle at 50% 0%, #191919 0, transparent 38%),
        #070707;
}

.login-card {
    width: min(430px, 100%);
    border: 1px solid var(--border);
    background: #0c0c0e;
    border-radius: 16px;
    padding: 32px;
}

.brand-large {
    margin-bottom: 35px;
}

.login-card h1 {
    margin: 0 0 10px;
    font-size: 25px;
}

.login-card p {
    color: var(--muted);
    line-height: 1.6;
    font-size: 12px;
    margin-bottom: 25px;
}

.discord-login {
    display: block;
    text-align: center;
    background: white;
    color: black;
    border-radius: 8px;
    padding: 12px;
    font-weight: 750;
    font-size: 12px;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.75);
}

.modal-box {
    position: relative;
    width: min(600px, calc(100% - 30px));
    max-height: 85vh;
    overflow: auto;
    background: #101012;
    border: 1px solid var(--border-light);
    border-radius: 13px;
    padding: 25px;
    z-index: 1;
}

.modal-close {
    position: absolute;
    right: 13px;
    top: 10px;
    background: transparent;
    color: var(--muted);
    border: 0;
    font-size: 22px;
}

.toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 200;
    background: #151517;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 11px;
    box-shadow: 0 10px 30px #000;
}

.mobile-menu {
    display: none;
    background: transparent;
    border: 0;
    color: white;
    font-size: 20px;
    margin-right: 12px;
}

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

    .grid-2 {
        grid-template-columns: 1fr;
    }
}

@media(max-width: 760px) {
    .sidebar {
        position: fixed;
        z-index: 50;
        left: -270px;
        transition: left .2s;
    }

    .sidebar.open {
        left: 0;
    }

    .mobile-menu {
        display: block;
    }

    .topbar {
        padding: 15px 18px;
    }

    #content {
        padding: 22px 18px 60px;
    }

    .user-menu div:last-child {
        display: none;
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
}
