:root {
    color-scheme: dark;
    --bg: #080811;
    --panel: rgba(13, 14, 29, .78);
    --panel-solid: #111225;
    --line: rgba(148, 163, 184, .18);
    --text: #ffffff;
    --muted: #a6adbf;
    --muted-2: #6f7890;
    --blue: #3b82f6;
    --sky: #38bdf8;
    --purple: #8b5cf6;
    --violet: #a855f7;
    --discord: #5865f2;
    --shadow: rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    overflow-x: hidden;
    background:
        radial-gradient(circle at 14% 20%, rgba(59, 130, 246, .28), transparent 28rem),
        radial-gradient(circle at 82% 12%, rgba(168, 85, 247, .28), transparent 30rem),
        radial-gradient(circle at 64% 86%, rgba(56, 189, 248, .12), transparent 26rem),
        linear-gradient(180deg, #090913 0%, #080811 58%, #06060d 100%);
}

.shell,
.site-nav,
.hero-grid,
.dashboard-hero,
.grid,
.auth-panel,
.card {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .16;
    background-image:
        linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, #000, transparent 80%);
}

a { color: inherit; }

code {
    color: #c4b5fd;
    background: rgba(139, 92, 246, .12);
    border: 1px solid rgba(139, 92, 246, .24);
    border-radius: 7px;
    padding: 2px 6px;
}

.shell {
    position: relative;
    z-index: 1;
    width: min(1220px, calc(100vw - 40px));
    margin: 0 auto;
    padding: 26px 0 34px;
}

.dashboard-shell {
    width: min(1760px, calc(100vw - 32px));
    min-height: 100vh;
    padding: 22px 0 30px;
}

.login-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(420px, 100%);
    padding: 34px;
    border: 1px solid rgba(99, 102, 241, .28);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(17, 18, 37, .92), rgba(11, 12, 24, .92)),
        radial-gradient(circle at top left, rgba(59, 130, 246, .2), transparent 18rem);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .42);
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
    margin-bottom: 26px;
}

.login-title {
    font-size: 27px;
    font-weight: 900;
    letter-spacing: -.04em;
}

.login-error {
    margin-bottom: 16px;
    border: 1px solid rgba(251, 113, 133, .32);
    background: rgba(251, 113, 133, .09);
    color: #fecdd3;
    border-radius: 14px;
    padding: 13px;
    font-size: 13px;
    line-height: 1.45;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 58px;
    margin-bottom: 18px;
}

.dashboard-tabs {
    width: min(1482px, 100%);
    margin: 0 auto 28px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 16px;
    background: rgba(255,255,255,.035);
}

.dashboard-tabs a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border-radius: 12px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 850;
    font-size: 13px;
}

.dashboard-tabs a.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(37, 99, 235, .86), rgba(124, 58, 237, .86));
    box-shadow: 0 14px 34px rgba(79, 70, 229, .22);
}

.brand {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}

.logo,
.avatar-fallback {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: white;
    font-weight: 900;
    font-size: 20px;
    box-shadow: 0 18px 48px rgba(93, 95, 239, .35);
}

.brand-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.03em;
}

.brand-subtitle,
.muted {
    color: var(--muted);
    font-size: 13px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 26px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

.nav-links a {
    text-decoration: none;
    transition: color .16s ease;
}

.nav-links a:hover { color: #fff; }

.nav-pill,
.badge {
    border: 1px solid rgba(99, 102, 241, .42);
    color: #d8b4fe;
    background: rgba(99, 102, 241, .12);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.hero-grid {
    min-height: 590px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 440px);
    align-items: center;
    gap: 58px;
}

.hero-copy { padding: 20px 0 70px; }

.eyebrow,
.panel-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #bfdbfe;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.eyebrow::before,
.panel-kicker::before {
    content: "";
    width: 26px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--sky), var(--violet));
}

h1 {
    margin: 20px 0 20px;
    max-width: 650px;
    font-size: clamp(44px, 7vw, 82px);
    line-height: .96;
    letter-spacing: -.07em;
}

h1 span {
    display: inline-block;
    color: transparent;
    background: linear-gradient(90deg, var(--sky), var(--blue) 45%, var(--violet));
    -webkit-background-clip: text;
    background-clip: text;
}

.hero-copy p,
.auth-panel > p,
.dashboard-hero p {
    margin: 0;
    max-width: 610px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.65;
}

.hero-points {
    margin-top: 34px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.hero-points div {
    min-height: 96px;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, .035);
}

.hero-points strong {
    display: block;
    font-size: 14px;
}

.hero-points small {
    display: block;
    margin-top: 7px;
    color: var(--muted-2);
    line-height: 1.45;
}

.auth-panel,
.card {
    border: 1px solid var(--line);
    border-radius: 26px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .025)),
        var(--panel);
    box-shadow: 0 28px 90px var(--shadow);
    backdrop-filter: blur(18px);
    overflow: hidden;
}

.auth-panel {
    border-color: rgba(99, 102, 241, .32);
}

.auth-panel {
    padding: 34px;
    position: relative;
}

.auth-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(59, 130, 246, .22), transparent 36%, rgba(168, 85, 247, .18));
    mask: linear-gradient(#000, transparent 64%);
}

.auth-panel > * {
    position: relative;
    z-index: 1;
}

.auth-panel.soft { padding: 28px; }

.auth-panel h2 {
    margin: 13px 0 8px;
    font-size: 34px;
    letter-spacing: -.04em;
}

.panel-body { margin-top: 26px; }
.stack { display: grid; gap: 14px; }
.form { display: grid; gap: 18px; }

.field {
    position: relative;
    display: grid;
    gap: 7px;
}

label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.floating label {
    position: absolute;
    top: -8px;
    left: 12px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--panel-solid);
    color: #c4b5fd;
    font-size: 12px;
}

input {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, .22);
    background: rgba(3, 7, 18, .44);
    color: var(--text);
    border-radius: 13px;
    outline: none;
    padding: 15px 14px;
    font-size: 14px;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

input:focus {
    border-color: rgba(96, 165, 250, .82);
    background: rgba(3, 7, 18, .68);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .14);
}

.help {
    color: var(--muted-2);
    font-size: 12px;
    line-height: 1.55;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

button,
.button {
    appearance: none;
    border: 1px solid rgba(96, 165, 250, .5);
    background: linear-gradient(90deg, #2563eb, #7c3aed);
    color: #fff;
    font-weight: 900;
    border-radius: 12px;
    padding: 13px 16px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    box-shadow: 0 14px 34px rgba(79, 70, 229, .25);
    transition: transform .14s ease, box-shadow .14s ease;
}

button:hover,
.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 42px rgba(79, 70, 229, .34);
}

button.secondary,
.button.secondary {
    background: rgba(255,255,255,.04);
    border-color: rgba(148, 163, 184, .22);
    color: var(--text);
    box-shadow: none;
}

.button.discord {
    width: 100%;
    justify-content: center;
    background: linear-gradient(90deg, var(--discord), #7c3aed);
    border-color: rgba(255, 255, 255, .1);
}

.button .icon {
    width: 19px;
    height: 19px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255,255,255,.16);
    font-size: 16px;
    line-height: 1;
}

.compact {
    padding: 8px 11px;
    font-size: 12px;
}

.notice {
    display: flex;
    gap: 12px;
    border: 1px solid rgba(96, 165, 250, .24);
    background: rgba(59, 130, 246, .08);
    color: #dbeafe;
    border-radius: 14px;
    padding: 13px;
    font-size: 13px;
    line-height: 1.45;
}

.notice.danger {
    border-color: rgba(251, 113, 133, .32);
    background: rgba(251, 113, 133, .09);
    color: #fecdd3;
}

.infinity-loader {
    width: 70px;
    height: 42px;
    display: inline-block;
    overflow: visible;
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, .32));
    vertical-align: middle;
}

.infinity-loader.mini {
    width: 38px;
    height: 22px;
    filter: drop-shadow(0 0 8px rgba(168, 85, 247, .34));
}

.infinity-loader.large {
    width: 168px;
    height: 98px;
}

.infinity-loader .track,
.infinity-loader .line {
    fill: none;
    stroke-width: 7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.infinity-loader .track {
    display: none;
}

.infinity-loader .line {
    stroke-dasharray: 34 346;
    animation: support-infinity-dash 1.05s linear infinite;
}

.loading-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.opening-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    overflow: hidden;
}

.opening-card {
    width: min(360px, 100%);
    display: grid;
    justify-items: center;
    gap: 14px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    text-align: center;
}

.opening-card h1 {
    margin: 0;
    font-size: 18px;
    letter-spacing: -.02em;
}

.opening-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

@keyframes support-infinity-dash {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: -380; }
}

.grid {
    display: grid;
    grid-template-columns: minmax(420px, 560px) minmax(560px, 900px);
    gap: 22px;
    align-items: start;
    justify-content: center;
    width: 100%;
}

.card-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.card-header.tight { padding: 16px 18px; }

.card-title {
    font-weight: 850;
    font-size: 18px;
    letter-spacing: -.03em;
}

.card-subtitle {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.card-body { padding: 20px; }

.dashboard-hero {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    margin-bottom: 24px;
    width: min(1482px, 100%);
    margin-left: auto;
    margin-right: auto;
}

.dashboard-hero h1 {
    margin: 14px 0 8px;
    font-size: clamp(38px, 5vw, 68px);
}

.compact-hero h1 {
    font-size: clamp(34px, 4vw, 56px);
}

.stat-strip {
    min-width: 280px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.stat-strip div {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255,255,255,.045);
}

.stat-strip strong {
    display: block;
    font-size: 20px;
}

.stat-strip span {
    display: block;
    color: var(--muted-2);
    font-size: 12px;
    margin-top: 3px;
}

.user-menu { position: relative; }

.user-pill {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    padding: 7px 10px 7px 7px;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 999px;
    background: rgba(255,255,255,.055);
    box-shadow: none;
}

.user-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 34px rgba(0, 0, 0, .22);
}

.user-pill span {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-pill .chevron {
    color: var(--muted);
    font-size: 16px;
    line-height: 1;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 260px;
    display: none;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 18px;
    background: rgba(13, 14, 29, .96);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
    backdrop-filter: blur(18px);
    z-index: 20;
}

.user-dropdown.open { display: grid; gap: 8px; }

.dropdown-user {
    display: grid;
    gap: 4px;
    padding: 8px 9px 11px;
    border-bottom: 1px solid rgba(148, 163, 184, .14);
}

.dropdown-user strong {
    font-size: 14px;
    letter-spacing: -.02em;
}

.dropdown-user span {
    color: var(--muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border-radius: 12px;
    color: #fecdd3;
    background: rgba(251, 113, 133, .1);
    border: 1px solid rgba(251, 113, 133, .22);
    text-decoration: none;
    font-weight: 850;
    font-size: 13px;
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--line);
}

.server-list-card { max-height: calc(100vh - 172px); }

.server-list-card .card-body {
    max-height: calc(100vh - 260px);
    overflow: auto;
}

.server-card {
    border: 1px solid rgba(148, 163, 184, .16);
    background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.025));
    border-radius: 16px;
    padding: 15px;
}

.server-card-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.server-logo {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    border-radius: 13px;
    object-fit: cover;
    border: 1px solid rgba(148, 163, 184, .2);
    background: rgba(255,255,255,.05);
}

.server-logo.fallback {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: #fff;
    font-weight: 900;
}

.server-card h3 {
    margin: 0 0 4px;
    font-size: 15px;
    letter-spacing: -.02em;
}

.server-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.chip {
    border-radius: 999px;
    background: rgba(99, 102, 241, .1);
    border: 1px solid rgba(99, 102, 241, .22);
    color: #c4b5fd;
    padding: 5px 8px;
    font-size: 12px;
}

.chip.accent {
    background: rgba(59, 130, 246, .14);
    border-color: rgba(96, 165, 250, .35);
    color: #bfdbfe;
}

.server-note {
    margin-top: 10px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.api-log-card {
    width: min(1482px, 100%);
    margin: 0 auto;
}

.settings-grid {
    width: min(1482px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(320px, 1fr));
    gap: 22px;
    align-items: start;
}

.api-log-list {
    display: grid;
    gap: 10px;
    max-height: calc(100vh - 330px);
    min-height: 360px;
    overflow: auto;
}

.api-request-row {
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 14px;
    background: rgba(255,255,255,.035);
    padding: 12px 14px;
}

.api-request-top {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--muted);
}

.api-request-top strong {
    color: var(--text);
    font-size: 13px;
}

.api-request-top time { margin-left: auto; }

.method {
    border-radius: 999px;
    background: rgba(59, 130, 246, .14);
    border: 1px solid rgba(96, 165, 250, .35);
    color: #bfdbfe;
    padding: 4px 8px;
    font-weight: 900;
}

.api-request-meta {
    margin-top: 7px;
    color: #dbeafe;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.footer {
    margin-top: 28px;
    color: var(--muted-2);
    font-size: 12px;
    text-align: center;
}

@media (max-width: 980px) {
    .hero-grid,
    .grid,
    .settings-grid { grid-template-columns: 1fr; }
    .hero-copy { padding-bottom: 0; }
    .hero-points { grid-template-columns: 1fr; }
    .dashboard-hero,
    .site-nav {
        align-items: flex-start;
        flex-direction: column;
    }
    .nav-links {
        flex-wrap: wrap;
        gap: 12px;
    }
    .stat-strip {
        width: 100%;
        min-width: 0;
    }
    .dashboard-shell .site-nav {
        align-items: center;
        flex-direction: row;
    }
    .dashboard-shell .brand-title {
        max-width: 46vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

.grid .full-width {
    grid-column: 1 / -1;
}

button:disabled,
.button:disabled {
    cursor: not-allowed;
    opacity: .58;
    transform: none;
    box-shadow: none;
}

.server-list-card .card-body {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

.server-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.server-open-error {
    min-height: 18px;
    color: #fecdd3;
    font-size: 12px;
    line-height: 1.45;
}

.security-panel {
    width: min(1482px, 100%);
    margin: 0 auto 22px;
    border: 1px solid rgba(96, 165, 250, .22);
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, .12), rgba(124, 58, 237, .10)),
        rgba(255,255,255,.035);
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.security-panel h2 {
    margin: 10px 0 5px;
    font-size: 20px;
    letter-spacing: -.03em;
}

.security-panel p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.chip.success {
    background: rgba(34, 197, 94, .12);
    border-color: rgba(74, 222, 128, .32);
    color: #bbf7d0;
}

.chip.warning {
    background: rgba(250, 204, 21, .10);
    border-color: rgba(250, 204, 21, .26);
    color: #fef08a;
}

.actions.right {
    justify-content: flex-end;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(3, 7, 18, .72);
    backdrop-filter: blur(12px);
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-card {
    width: min(520px, 100%);
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .025)),
        #101223;
    box-shadow: 0 34px 90px rgba(0, 0, 0, .52);
    padding: 22px;
}

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

.modal-header h2 {
    margin: 12px 0 7px;
    font-size: 27px;
    letter-spacing: -.04em;
}

.modal-header p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.icon-button {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 12px;
    background: rgba(255,255,255,.04);
    border-color: rgba(148, 163, 184, .2);
    box-shadow: none;
    font-size: 24px;
    line-height: 1;
}

@media (max-width: 720px) {
    .security-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .server-list-card .card-body {
        grid-template-columns: 1fr;
    }
}
