@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');


:root {
    --bg: #090b0f;
    --bg-secondary: #0d1015;
    --panel: #11151c;
    --panel-hover: #151a22;

    --border: #202630;

    --text: #f1f3f5;
    --muted: #89919d;

    --accent: #d71920;
    --accent-dark: #99131a;

    --green: #3ddc84;
    --yellow: #f5c542;
    --blue: #4c8dff;

    --sidebar-width: 260px;
}


* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


html {
    min-height: 100%;
}


body {
    min-height: 100vh;

    background:
        radial-gradient(
            circle at 80% 0%,
            rgba(215, 25, 32, 0.08),
            transparent 35%
        ),
        var(--bg);

    color: var(--text);

    font-family:
        "Inter",
        Arial,
        sans-serif;
}

.legal-page {
    width: min(820px, calc(100% - 32px));
    margin: 0 auto;
    padding: 56px 0 40px;
}

.legal-brand {
    margin-bottom: 22px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.legal-brand span { color: var(--muted); font-weight: 500; }

.legal-document {
    padding: clamp(24px, 5vw, 48px);
    background: var(--panel);
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: 8px;
}

.legal-eyebrow { margin-bottom: 10px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; }
.legal-document h1 { margin-bottom: 8px; font-size: clamp(26px, 4vw, 38px); }
.legal-lead { margin-bottom: 10px; color: var(--text) !important; font-size: 16px !important; line-height: 1.6 !important; }
.legal-updated { margin-bottom: 38px; color: var(--muted); font-size: 12px; }
.legal-document h2 { margin: 26px 0 8px; color: var(--text); font-size: 16px; }
.legal-document p { color: #c5cad1; font-size: 14px; line-height: 1.75; }

.legal-links { display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 18px 2px; color: var(--muted); font-size: 12px; }
.legal-links a:hover { color: var(--text); }
.legal-hub { margin-top: 18px; padding: 18px; border: 1px solid var(--border); border-radius: 10px; background: rgba(17, 21, 28, 0.82); }
.legal-hub-heading { margin-bottom: 12px; color: var(--text); font-size: 12px; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase; }
.legal-hub-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.legal-hub-card { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg-secondary); transition: border-color 0.18s ease, transform 0.18s ease; }
.legal-hub-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.legal-hub-icon { font-size: 18px; }
.legal-hub-card strong, .legal-hub-card small { display: block; }
.legal-hub-card strong { color: var(--text); font-size: 11px; }
.legal-hub-card small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.legal-footer { padding: 16px 2px 0; color: var(--muted); font-size: 10px; text-align: center; }
@media (max-width: 650px) { .legal-hub-grid { grid-template-columns: 1fr; } }


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


button,
input,
select {
    font-family: inherit;
}


/* =========================================================
   APP
========================================================= */

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


/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
    position: fixed;

    left: 0;
    top: 0;
    bottom: 0;

    width: var(--sidebar-width);

    background:
        linear-gradient(
            180deg,
            #0e1116 0%,
            #090b0f 100%
        );

    border-right: 1px solid var(--border);

    display: flex;
    flex-direction: column;

    z-index: 100;
}


.brand {
    height: 90px;

    padding: 22px;

    display: flex;
    align-items: center;

    gap: 13px;

    border-bottom: 1px solid var(--border);
}


.brand-logo {
    width: 44px;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;
    overflow: hidden;

    background:
        linear-gradient(
            135deg,
            var(--accent),
            var(--accent-dark)
        );

    box-shadow:
        0 10px 30px
        rgba(215, 25, 32, 0.22);

    font-size: 14px;
    font-weight: 800;
}

.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


.brand-title {
    font-size: 16px;
    font-weight: 800;

    letter-spacing: 0.5px;
}


.brand-subtitle {
    margin-top: 2px;

    font-size: 9px;

    color: var(--muted);

    letter-spacing: 1.8px;
}


/* =========================================================
   NAV
========================================================= */

.navigation {
    flex: 1 1 auto;
    min-height: 0;
    padding: 22px 14px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #29313c transparent;
}

.navigation::-webkit-scrollbar { width: 5px; }
.navigation::-webkit-scrollbar-thumb { background: #29313c; border-radius: 5px; }


.nav-label {
    margin: 18px 10px 8px;

    font-size: 10px;

    font-weight: 700;

    color: #555e69;

    letter-spacing: 1.4px;
}


.nav-label:first-child {
    margin-top: 0;
}


.nav-item {
    display: flex;

    align-items: center;

    gap: 12px;

    padding: 11px 12px;

    margin-bottom: 4px;

    border-radius: 8px;

    color: #9ca4af;

    font-size: 13px;

    transition:
        background 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease;
}


.nav-item:hover {
    background: #151920;

    color: white;

    transform: translateX(2px);
}

.nav-item.active { background: rgba(215, 25, 32, 0.11); color: var(--text); box-shadow: inset 2px 0 var(--accent); }
.nav-item.active .nav-icon { color: var(--accent); }


.nav-icon {
    width: 22px;

    text-align: center;

    color: #727b87;

    font-size: 16px;
}


.nav-item:hover .nav-icon {
    color: var(--accent);
}


/* =========================================================
   SIDEBAR BOTTOM
========================================================= */

.sidebar-bottom {
    margin-top: auto;

    padding: 15px;

    flex: 0 0 auto;

    border-top: 1px solid var(--border);
}


.system-status {
    display: flex;

    align-items: center;

    gap: 10px;

    padding: 12px;

    border-radius: 8px;

    background: #0d1116;
}


.status-dot {
    width: 8px;
    height: 8px;

    display: inline-block;

    border-radius: 50%;

    background: var(--green);

    box-shadow:
        0 0 12px
        rgba(61, 220, 132, 0.7);
}


.system-status strong {
    display: block;

    font-size: 11px;
}


.system-status small {
    display: block;

    margin-top: 3px;

    color: var(--muted);

    font-size: 9px;
}


.preview-box {
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    background: rgba(245, 197, 66, 0.1);
    border: 1px solid var(--yellow);
}

.preview-box small {
    display: block;
    color: var(--yellow);
    font-size: 9px;
    margin-bottom: 8px;
}

.preview-box select {
    width: 100%;
    padding: 6px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text);
    margin-bottom: 8px;
}


/* =========================================================
   MAIN
========================================================= */

.main {
    margin-left: var(--sidebar-width);

    width: calc(100% - var(--sidebar-width));

    min-height: 100vh;
}


/* =========================================================
   TOPBAR
========================================================= */

.topbar {
    height: 90px;

    padding: 0 34px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    border-bottom: 1px solid var(--border);

    background:
        rgba(9, 11, 15, 0.92);
}


.page-kicker {
    margin-bottom: 5px;

    color: var(--accent);

    font-size: 9px;

    font-weight: 800;

    letter-spacing: 1.8px;
}


.topbar h1 {
    font-size: 22px;

    font-weight: 700;
}


.topbar-right {
    display: flex;

    align-items: center;

    gap: 18px;
}


.connection {
    display: flex;

    align-items: center;

    gap: 8px;

    color: #8f98a4;

    font-size: 11px;
}


.user-avatar {
    width: 38px;
    height: 38px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 9px;
    overflow: hidden;

    background: #171b22;

    border: 1px solid var(--border);

    font-size: 10px;

    font-weight: 800;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* =========================================================
   CONTENT
========================================================= */

.content {
    padding: 34px;
}


/* =========================================================
   HERO
========================================================= */

.hero {
    margin-bottom: 28px;
}


.hero h2 {
    font-size: 30px;

    font-weight: 800;

    letter-spacing: -0.8px;
}


.hero p {
    margin-top: 7px;

    color: var(--muted);

    font-size: 13px;
}


/* =========================================================
   STATS
========================================================= */

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 14px;

    margin-bottom: 30px;
}


.stat-card {
    position: relative;

    overflow: hidden;

    padding: 20px;

    min-height: 125px;

    border-radius: 10px;

    background: var(--panel);

    border: 1px solid var(--border);

    transition:
        transform 0.2s ease,
        border-color 0.2s ease;
}


.stat-card:hover {
    transform: translateY(-3px);

    border-color: #343c48;
}


.stat-card::after {
    content: "";

    position: absolute;

    right: -30px;
    bottom: -40px;

    width: 110px;
    height: 110px;

    border-radius: 50%;

    background:
        rgba(215, 25, 32, 0.08);
}


.stat-icon {
    color: #747e8a;

    font-size: 18px;
}


.stat-value {
    margin-top: 13px;

    font-size: 27px;

    font-weight: 800;
}


.stat-label {
    margin-top: 4px;

    color: #9099a5;

    font-size: 11px;
}


.stat-description {
    margin-top: 2px;

    color: #555e69;

    font-size: 9px;
}


/* =========================================================
   SECTION
========================================================= */

.section {
    margin-top: 28px;
}


.section-header {
    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 13px;
}


.section-title {
    font-size: 16px;

    font-weight: 700;
}


.section-description {
    margin-top: 4px;

    color: var(--muted);

    font-size: 11px;
}


/* =========================================================
   GUILDS
========================================================= */

.guild-grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(300px, 420px));

    gap: 14px;
}


.guild-card {
    padding: 20px;

    background: var(--panel);

    border: 1px solid var(--border);

    border-radius: 10px;

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}


.guild-card:hover {
    transform: translateY(-3px);

    background: var(--panel-hover);

    border-color: #343c48;
}

.guild-card { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16); }
.guild-card:hover { box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28); }


.guild-header {
    display: flex;

    align-items: center;

    gap: 12px;

    margin-bottom: 18px;
}


.guild-icon {
    width: 46px;
    height: 46px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background:
        linear-gradient(
            135deg,
            #1c222c,
            #11151c
        );

    border: 1px solid #2a3039;

    color: #e1e5e9;

    font-size: 14px;

    font-weight: 800;
}

.guild-icon img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.guild-card .guild-button { display: flex; align-items: center; justify-content: center; gap: 8px; }
.guild-card .guild-button::before { content: "↗"; color: var(--accent); font-size: 13px; }
.topbar-user { max-width: 150px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }


.guild-name {
    font-size: 14px;

    font-weight: 700;
}


.guild-id {
    margin-top: 3px;

    color: #5f6874;

    font-size: 9px;
}


.guild-info {
    display: flex;

    justify-content: space-between;

    padding-top: 15px;

    border-top: 1px solid var(--border);
}


.guild-info-item span {
    display: block;

    color: #5f6874;

    font-size: 9px;
}


.guild-info-item strong {
    display: block;

    margin-top: 4px;

    font-size: 13px;
}


.guild-button {
    display: block;

    width: 100%;

    margin-top: 15px;

    padding: 10px;

    text-align: center;

    border-radius: 7px;

    background: #191e26;

    border: 1px solid #292f39;

    color: #dce0e5;

    font-size: 11px;

    font-weight: 600;

    transition: 0.2s;
}


.guild-button:hover {
    background: var(--accent);

    border-color: var(--accent);

    color: white;
}


/* =========================================================
   EMPTY
========================================================= */

.empty-state {
    padding: 55px 25px;

    text-align: center;

    background: var(--panel);

    border: 1px solid var(--border);

    border-radius: 10px;
}


.empty-icon {
    font-size: 30px;

    color: #444c57;

    margin-bottom: 12px;
}


.empty-state h3 {
    font-size: 15px;
}


.empty-state p {
    margin-top: 7px;

    color: var(--muted);

    font-size: 11px;
}


/* =========================================================
   QUICK ACCESS
========================================================= */

.quick-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 14px;
}


.quick-card {
    padding: 20px;

    background: var(--panel);

    border: 1px solid var(--border);

    border-radius: 10px;

    transition: 0.2s;
}


.quick-card:hover {
    transform: translateY(-3px);

    border-color: #343c48;
}


.quick-icon {
    width: 38px;
    height: 38px;

    display: flex;

    align-items: center;
    justify-content: center;

    margin-bottom: 15px;

    border-radius: 8px;

    background: #191e26;

    color: #a8b0ba;
}


.quick-card h3 {
    font-size: 13px;
}


.quick-card p {
    margin-top: 6px;

    color: var(--muted);

    font-size: 10px;
}


.quick-arrow {
    margin-top: 14px;

    color: var(--accent);

    font-size: 12px;
}


/* =========================================================
   ALERTS
========================================================= */

.alert {
    margin-bottom: 18px;

    padding: 13px 15px;

    border-radius: 8px;

    font-size: 12px;

    border: 1px solid var(--border);
}


.alert.success {
    background: rgba(61, 220, 132, 0.08);

    border-color:
        rgba(61, 220, 132, 0.25);

    color: #9ef0bf;
}


.alert.error {
    background: rgba(215, 25, 32, 0.1);

    border-color:
        rgba(215, 25, 32, 0.3);

    color: #ff9b9f;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1100px) {

    .stats-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .quick-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .guild-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 420px)); }

}


@media (max-width: 800px) {

    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        display: none;
    }

    .main {
        width: 100%;
        margin-left: 0;
    }

    .content {
        padding: 20px;
    }

    .topbar {
        padding: 0 20px;
    }

}

@media (min-width: 801px) and (max-height: 760px) {
    .brand { height: 72px; padding: 14px 18px; }
    .brand-logo { width: 38px; height: 38px; }
    .navigation { padding: 12px 10px; }
    .nav-label { margin-top: 12px; margin-bottom: 5px; }
    .nav-item { padding: 7px 10px; margin-bottom: 2px; }
    .sidebar-bottom { padding: 10px; }
}


@media (max-width: 600px) {

    .stats-grid,
    .guild-grid,
    .quick-grid {
        grid-template-columns: 1fr;
    }

    .topbar-right {
        display: none;
    }

    .hero h2 {
        font-size: 24px;
    }

}


/* =========================================================
   LIVE DATA AND SETTINGS LAYOUT
========================================================= */

.live-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: -15px;
    margin-bottom: 28px;
    color: var(--muted);
    font-size: 11px;
}

.live-strip strong {
    margin-left: auto;
    color: var(--text);
    font-weight: 600;
}

.live-strip time {
    color: #59636f;
}

.settings-layout {
    display: grid;
    grid-template-columns: 205px minmax(0, 1fr);
    align-items: start;
    gap: 24px;
}

.settings-nav {
    position: sticky;
    top: 24px;
    padding: 15px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #0d1116;
}

.settings-nav-title {
    padding: 5px 10px 12px;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.settings-nav-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 10px;
    border-left: 2px solid transparent;
    color: var(--muted);
    font-size: 11px;
    transition: 0.18s ease;
}

.settings-nav-item span {
    color: #4c5662;
    font-size: 9px;
}

.settings-nav-item:hover,
.settings-nav-item.active {
    border-left-color: var(--accent);
    background: #151920;
    color: var(--text);
}

.settings-nav-note {
    margin: 18px 5px 3px;
    padding: 11px 9px;
    border-top: 1px solid var(--border);
    color: #697380;
    font-size: 10px;
    line-height: 1.5;
}

.settings-stack {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.settings-stack .panel-card {
    margin: 0;
}

.settings-stack .save-bar {
    margin-top: 0;
}

@media (max-width: 800px) {
    .settings-layout {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .settings-nav {
        position: static;
        display: flex;
        align-items: center;
        gap: 4px;
        overflow-x: auto;
        padding: 8px;
    }

    .settings-nav-title,
    .settings-nav-note {
        display: none;
    }

    .settings-nav-item {
        flex: 0 0 auto;
        border-left: 0;
        border-bottom: 2px solid transparent;
        white-space: nowrap;
    }

    .settings-nav-item:hover,
    .settings-nav-item.active {
        border-bottom-color: var(--accent);
        border-left-color: transparent;
    }
}

@media (max-width: 600px) {
    .live-strip {
        flex-wrap: wrap;
        margin-top: -10px;
    }

    .live-strip strong {
        margin-left: 0;
        width: 100%;
    }
}


/* =========================================================
   SERVER SETTINGS
========================================================= */

.guild-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border);
}

.back-link {
    display: inline-block;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 11px;
}

.back-link:hover { color: var(--text); }

.guild-title-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.big-guild-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border: 1px solid #3b414b;
    border-radius: 14px;
    background: linear-gradient(145deg, #252b34, #11151c);
    color: var(--accent);
    font-size: 20px;
    font-weight: 800;
}

.guild-title-row h1 {
    font-size: 25px;
    line-height: 1.1;
}

.guild-title-row p {
    margin-top: 6px;
    color: var(--muted);
    font-size: 11px;
}

.mono { color: #c8ced6; font-family: Consolas, monospace; }

.server-online {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid rgba(61, 220, 132, 0.2);
    border-radius: 7px;
    background: rgba(61, 220, 132, 0.06);
    color: #9ef0bf;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
}

.panel-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(90deg, rgba(255,255,255,0.025), transparent);
}

.card-kicker {
    margin-bottom: 7px;
    color: var(--accent);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.6px;
}

.card-header h2 { font-size: 17px; }

.card-header p {
    max-width: 570px;
    margin-top: 6px;
    color: var(--muted);
    font-size: 11px;
}

.card-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid #303742;
    border-radius: 8px;
    background: #181d25;
    color: #c0c7d0;
    font-weight: 700;
}

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

.form-group {
    min-width: 0;
    padding: 18px 20px;
    background: var(--panel);
}

.form-group label {
    display: block;
    color: #dce1e7;
    font-size: 12px;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    margin-top: 10px;
    padding: 11px 12px;
    border: 1px solid #303742;
    border-radius: 6px;
    outline: 0;
    background: #0b0e13;
    color: var(--text);
    font-family: Consolas, monospace;
    font-size: 12px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.12);
}

.form-group small {
    display: block;
    margin-top: 8px;
    color: #68727f;
    font-size: 10px;
}

.permissions-wrapper { overflow-x: auto; }

.roles-manager { padding: 20px 24px; }

.role-add-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.role-add-form input[type="text"] {
    min-width: 0;
    flex: 1;
    padding: 11px 12px;
    border: 1px solid #303742;
    border-radius: 6px;
    outline: 0;
    background: #0b0e13;
    color: var(--text);
    font-size: 12px;
}

.role-add-form input[type="text"]:focus { border-color: var(--accent); }

.role-add-form input[name="role_id"] { flex: 0 1 210px; font-family: Consolas, monospace; }

.role-add-form input[type="color"] {
    width: 38px;
    height: 38px;
    padding: 3px;
    border: 1px solid #303742;
    border-radius: 6px;
    background: #0b0e13;
    cursor: pointer;
}

.role-add-button {
    padding: 11px 14px;
    border: 0;
    border-radius: 6px;
    background: #242b35;
    color: #e7ebef;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
}

.role-add-button:hover { background: var(--accent); }

.role-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

.role-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px 7px 10px;
    border: 1px solid #303742;
    border-radius: 6px;
    background: #151a22;
    color: #cbd2da;
    font-size: 11px;
}

.role-color { width: 9px; height: 9px; border-radius: 50%; }
.role-chip small { display: block; margin-top: 3px; color: #697380; font: 9px Consolas, monospace; }

.role-delete {
    width: 20px;
    height: 20px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #77818d;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.role-delete:hover { background: rgba(215,25,32,0.2); color: #ff9b9f; }
.role-empty { margin-top: 16px; color: #68727f; font-size: 11px; }

.permissions-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 11px;
}

.permissions-table th,
.permissions-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.permissions-table th:first-child,
.permissions-table td:first-child { text-align: left; }

.permissions-table th {
    background: #0d1116;
    color: #8f99a5;
    font-size: 10px;
    font-weight: 700;
}

.permissions-table tr:last-child td { border-bottom: 0; }

.permissions-table tbody tr:hover { background: rgba(255,255,255,0.02); }

.command-name { color: var(--text); font-family: Consolas, monospace; font-weight: 700; }
.command-description { margin-top: 4px; color: #68727f; font-size: 10px; }

.checkbox input { display: none; }

.checkbox span {
    width: 17px;
    height: 17px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #3a424d;
    border-radius: 4px;
    background: #0b0e13;
    cursor: pointer;
}

.checkbox input:checked + span {
    border-color: var(--accent);
    background: var(--accent);
}

.checkbox input:checked + span::after {
    content: "✓";
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.command-list { padding: 8px 24px; }

.command-item {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.command-item:last-child { border-bottom: 0; }
.command-symbol { color: var(--accent); font-family: Consolas, monospace; font-size: 17px; }
.command-item strong { font-family: Consolas, monospace; font-size: 12px; }
.command-item p { margin-top: 4px; color: var(--muted); font-size: 10px; }

.empty-small {
    padding: 28px 24px;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

.empty-small strong { display: block; margin-top: 8px; color: #dce1e7; }
.empty-small p { margin-top: 6px; }

.save-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 20px;
    border: 1px solid rgba(215, 25, 32, 0.3);
    border-radius: 10px;
    background: linear-gradient(90deg, rgba(215,25,32,0.12), #11151c);
}

.save-bar strong { display: block; font-size: 12px; }
.save-bar span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }

.save-button {
    padding: 11px 16px;
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
}

.save-button:hover { background: #ef2930; }

@media (max-width: 800px) {
    .guild-page-header { align-items: flex-start; flex-direction: column; }
    .server-online { align-self: flex-start; }
    .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .card-header { padding: 18px; }
    .form-group { padding: 16px; }
    .command-list { padding: 6px 18px; }
    .save-bar { align-items: stretch; flex-direction: column; }
    .save-button { width: 100%; }
    .role-add-form { align-items: stretch; flex-wrap: wrap; }
    .role-add-form input[type="text"] { flex-basis: 100%; }
    .role-add-button { flex: 1; }
}

.hq-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 30px;
}

.hq-panel {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
}

.hq-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 19px 20px;
    border-bottom: 1px solid var(--border);
}

.hq-panel-header h2 { margin-top: 4px; font-size: 16px; }
.hq-counter { color: var(--accent); font: 800 18px Consolas, monospace; }
.hq-live-label { display: flex; align-items: center; gap: 7px; color: var(--green); font-size: 10px; }
.hq-list { min-height: 130px; padding: 5px 20px; }
.hq-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.hq-row:last-child { border-bottom: 0; }
.hq-row-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; background: rgba(215,25,32,0.12); color: var(--accent); font-size: 12px; }
.hq-row-main { min-width: 0; flex: 1; }
.hq-row-main strong { display: block; overflow: hidden; color: #e4e8ed; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.hq-row-main small { display: block; overflow: hidden; margin-top: 4px; color: #68727f; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.hq-pill { padding: 5px 7px; border: 1px solid #303742; border-radius: 5px; color: #aeb7c2; font-size: 9px; white-space: nowrap; }
.activity-mark { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px rgba(215,25,32,0.5); }
.hq-empty { padding: 35px 0; color: #68727f; font-size: 11px; text-align: center; }

.page-intro { margin-bottom: 24px; }
.page-intro h2 { margin-top: 5px; font-size: 27px; }
.page-intro p { margin-top: 7px; color: var(--muted); font-size: 12px; }
.personnel-card { overflow-x: auto; }
.bio-page-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.bio-page-meta span { padding: 7px 10px; border: 1px solid var(--border); border-radius: 5px; background: var(--panel); color: var(--muted); font-size: 10px; }
.bio-search-card { margin-bottom: 16px; }
.bio-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.bio-card { padding: 18px; border: 1px solid var(--border); border-radius: 9px; background: var(--panel); transition: border-color 0.18s ease, transform 0.18s ease; }
.bio-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.bio-card-top { display: flex; align-items: center; gap: 10px; }
.bio-avatar { width: 38px; height: 38px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 8px; background: rgba(215,25,32,0.14); color: var(--accent); font-size: 16px; font-weight: 800; }
.bio-card-top strong, .bio-card-top small { display: block; }
.bio-card-top strong { color: var(--text); font-size: 12px; }
.bio-card-top small { margin-top: 4px; color: var(--muted); }
.bio-state { margin-left: auto; padding: 4px 6px; border: 1px solid rgba(61,220,132,0.3); border-radius: 4px; color: var(--green); font-size: 9px; font-weight: 800; }
.bio-card-line { height: 1px; margin: 17px 0 12px; background: var(--border); }
.bio-card p { color: var(--muted); font-size: 9px; }
.bio-card time { display: block; margin-top: 4px; color: var(--text); font-size: 10px; }
.bio-open-button { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding: 9px 10px; border-radius: 5px; background: #29313c; color: var(--text); font-size: 10px; font-weight: 700; }
.bio-open-button:hover { background: var(--accent); }
@media (max-width: 1000px) { .bio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .bio-grid { grid-template-columns: 1fr; } }
.personnel-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 11px; }
.personnel-table th, .personnel-table td { padding: 15px 17px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.personnel-table th { background: #0d1116; color: #818b97; font-size: 10px; text-transform: uppercase; }
.personnel-table td strong, .personnel-table td small { display: block; }
.personnel-table td small { margin-top: 4px; color: #697380; }
.personnel-edit-form { display: flex; align-items: center; gap: 7px; }
.personnel-edit-form input, .personnel-edit-form select { min-width: 100px; padding: 7px 8px; border: 1px solid #303742; border-radius: 5px; background: #0b0e13; color: var(--text); font: 10px inherit; }
.personnel-edit-form input { width: 130px; }
.muted-cell { color: #697380; font-size: 10px; }
.table-empty { padding: 42px !important; color: #697380; text-align: center !important; }
.status-badge { display: inline-block; padding: 5px 8px; border: 1px solid rgba(61,220,132,0.25); border-radius: 5px; background: rgba(61,220,132,0.08); color: #9ef0bf; font-size: 10px; }
.status-cancelled { border-color: rgba(215,25,32,0.3); background: rgba(215,25,32,0.08); color: #ff9b9f; }
.operation-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.operation-card { padding: 20px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.operation-card-top { display: flex; justify-content: space-between; align-items: center; }
.operation-id { color: var(--accent); font: 700 12px Consolas, monospace; }
.operation-card h3 { margin-top: 18px; font-size: 15px; }
.operation-objective { color: #dce1e7 !important; line-height: 1.45; }
.operation-card p { margin-top: 8px; color: var(--muted); font-size: 10px; }
.operation-actions { display: flex; gap: 8px; margin-top: 18px; }
.mini-button { padding: 8px 11px; border: 0; border-radius: 5px; background: #29313c; color: #e7ebef; cursor: pointer; font-size: 10px; font-weight: 700; }
.mini-button:hover { background: var(--accent); }
.danger-button:hover { background: #99131a; }
@media (max-width: 800px) { .operation-board { grid-template-columns: 1fr; } }

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

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-card { width: 320px; padding: 32px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); text-align: center; }
.login-card h1 { font-size: 20px; margin-bottom: 8px; color: var(--accent); }
.login-card p { color: var(--muted); font-size: 12px; margin-bottom: 20px; }
.login-card form { display: flex; flex-direction: column; gap: 10px; }
.login-card input { padding: 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text); }
.flash { padding: 8px; border-radius: 6px; font-size: 11px; margin-bottom: 12px; }
.flash-success { background: rgba(61, 220, 132, 0.15); color: var(--green); }
.flash-error { background: rgba(215, 25, 32, 0.15); color: var(--accent); }

.analytics-bars { display: grid; gap: 12px; }
.analytics-bar-row { display: grid; grid-template-columns: 90px 1fr 30px; gap: 10px; align-items: center; color: var(--muted); font-size: 10px; }
.analytics-bar { height: 10px; border-radius: 5px; background: var(--bg-secondary); overflow: hidden; }
.analytics-bar i { display: block; height: 100%; min-width: 3px; border-radius: inherit; background: var(--accent); }
.audit-action { display: inline-block; padding: 5px 8px; border-radius: 5px; background: rgba(215, 25, 32, 0.13); color: var(--accent); font-size: 10px; font-weight: 700; }
.audit-command_used { background: rgba(76, 141, 255, 0.13); color: var(--blue); }
.audit-login { background: rgba(61, 220, 132, 0.13); color: var(--green); }
.site-footer { display: flex; justify-content: space-between; gap: 16px; padding: 24px 0 10px; color: var(--muted); font-size: 10px; border-top: 1px solid var(--border); margin-top: 28px; }
@media (max-width: 600px) { .site-footer { flex-direction: column; gap: 6px; } }
.apply-page { max-width: 980px; margin: 0 auto; }
.apply-form { padding: 24px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.apply-form-heading { display: flex; align-items: center; gap: 10px; margin: 4px 0 16px; }
.apply-form-heading span { padding: 5px 7px; border-radius: 4px; background: rgba(215,25,32,0.16); color: var(--accent); font: 700 10px Consolas, monospace; }
.apply-form-heading h3 { color: var(--text); font-size: 14px; }
.apply-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 28px; }
.apply-form label { display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: 10px; }
.apply-form input:not([type="checkbox"]), .apply-form textarea { width: 100%; padding: 11px 12px; border: 1px solid #303742; border-radius: 6px; background: var(--bg-secondary); color: var(--text); font: 11px inherit; }
.apply-form textarea { min-height: 100px; resize: vertical; margin-bottom: 14px; }
.apply-check { flex-direction: row !important; align-items: center; margin: 8px 0 18px; color: var(--text) !important; }
.apply-check input { accent-color: var(--accent); }
.apply-submit { width: 100%; padding: 12px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; cursor: pointer; font-weight: 700; }
.apply-submit:hover { background: var(--accent-dark); }
@media (max-width: 650px) { .apply-grid { grid-template-columns: 1fr; } .apply-form { padding: 18px; } }
.permission-tools { display: flex; align-items: center; gap: 10px; padding: 14px; border-bottom: 1px solid var(--border); }
.permission-tools-hint { color: var(--muted); font-size: 10px; }
.permission-role-toggle { display: block; margin: 7px auto 0; padding: 3px 6px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg-secondary); color: var(--muted); cursor: pointer; font-size: 9px; }
.permission-role-toggle:hover { color: var(--text); border-color: var(--accent); }