:root {
    color-scheme: dark;
    --bg: #080a12;
    --panel: #101522;
    --panel-2: #151b2b;
    --line: #26314a;
    --text: #edf3ff;
    --muted: #8d9bb7;
    --cyan: #18d7ff;
    --pink: #ff3f9f;
    --green: #4ade80;
    --red: #fb7185;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(24, 215, 255, 0.16), transparent 32rem),
        linear-gradient(135deg, #080a12 0%, #101320 54%, #120814 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

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

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px;
    border-right: 1px solid var(--line);
    background: rgba(8, 10, 18, 0.82);
    backdrop-filter: blur(18px);
}

.brand,
.user,
nav a,
.card,
.panel {
    border: 1px solid var(--line);
    background: rgba(16, 21, 34, 0.82);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 8px;
    font-weight: 800;
}

.brand-mark,
.avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--cyan), var(--pink));
    color: #050711;
    font-weight: 900;
}

.user {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 22px 0;
    padding: 14px;
    border-radius: 8px;
}

.user span,
p,
small,
.eyebrow {
    color: var(--muted);
}

nav {
    display: grid;
    gap: 8px;
}

nav a {
    padding: 12px 14px;
    border-radius: 8px;
}

nav a:hover,
.card:hover {
    border-color: rgba(24, 215, 255, 0.75);
    box-shadow: 0 0 28px rgba(24, 215, 255, 0.12);
}

.content {
    width: min(1180px, 100%);
    padding: 34px;
}

.topbar,
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

h1,
h2 {
    margin: 0;
    letter-spacing: 0;
}

h1 {
    font-size: clamp(2rem, 6vw, 4.8rem);
    line-height: 0.95;
}

.panel h1,
.section-title h1,
.topbar h1 {
    font-size: 2rem;
    line-height: 1.1;
}

h2 {
    font-size: 1.2rem;
}

.eyebrow {
    display: block;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-size: 0.76rem;
    font-weight: 800;
}

.hero {
    display: grid;
    align-content: center;
    min-height: calc(100vh - 68px);
    max-width: 780px;
}

.hero p {
    max-width: 620px;
    font-size: 1.12rem;
}

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: fit-content;
    min-height: 42px;
    padding: 0 18px;
    border: 0;
    border-radius: 8px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.button.primary {
    background: linear-gradient(135deg, var(--cyan), var(--pink));
    color: #040711;
}

.button.danger {
    background: rgba(251, 113, 133, 0.14);
    color: var(--red);
}

.button.full {
    width: 100%;
}

.panel {
    padding: 22px;
    border-radius: 8px;
    margin-bottom: 18px;
}

.panel.narrow {
    max-width: 460px;
}

.grid {
    display: grid;
    gap: 16px;
}

.cards,
.metrics {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
    display: grid;
    gap: 10px;
    padding: 18px;
    border-radius: 8px;
}

.guild-card {
    grid-template-columns: 42px 1fr;
    align-items: center;
}

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

.form-grid h1,
.form-grid h2,
.form-grid .wide,
.form-grid .button {
    grid-column: 1 / -1;
}

.form-grid.compact {
    margin-top: 14px;
}

label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #0a0f1b;
    color: var(--text);
    font: inherit;
}

textarea {
    resize: vertical;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
}

.toggle input {
    width: 18px;
    min-height: 18px;
}

.alert,
.status {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    font-weight: 800;
}

.alert.success,
.status.ok {
    background: rgba(74, 222, 128, 0.12);
    color: var(--green);
}

.alert.error,
.status.warn {
    background: rgba(251, 113, 133, 0.12);
    color: var(--red);
}

.inline-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.inline-stats span {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-2);
}

.table {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.table > div {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) 2fr minmax(100px, auto);
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-2);
}

.table.simple > div,
.table.role-options > form {
    grid-template-columns: 1fr;
}

.module-block {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.actions,
.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 14px 0;
}

.actions form,
.inline-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.actions select {
    width: min(260px, 100%);
}

.role-options {
    margin-top: 14px;
}

.role-options form {
    display: grid;
    grid-template-columns: 1fr repeat(4, minmax(90px, 1fr)) auto auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-2);
}

@media (max-width: 820px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .content {
        padding: 20px;
    }

    .form-grid,
    .table > div {
        grid-template-columns: 1fr;
    }
}
