/* NystBot Discord Control redesign — visual layer over the existing application. */
:root {
    --bg: #080a0f;
    --panel: #11141b;
    --panel-2: #171b24;
    --panel-3: #1d222d;
    --border: #292f3d;
    --border-strong: #384155;
    --text: #f5f7fb;
    --muted: #939cad;
    --accent: #5865f2;
    --accent-2: #7b61ff;
    --success: #23c483;
    --danger: #ef5d68;
    --warning: #e7a63b;
    --control-shadow: 0 18px 54px rgba(0, 0, 0, .26);
}

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

body {
    background:
        radial-gradient(circle at 76% -10%, rgba(88, 101, 242, .14), transparent 31rem),
        radial-gradient(circle at 8% 42%, rgba(123, 97, 255, .055), transparent 34rem),
        var(--bg);
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .22;
    background-image: linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.012) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, black, transparent 72%);
}

::selection { color: #fff; background: rgba(88, 101, 242, .72); }

.topbar {
    min-height: 68px;
    padding-top: 10px;
    padding-bottom: 10px;
    border-color: rgba(56, 65, 85, .72);
    background: rgba(8, 10, 15, .88);
    box-shadow: 0 1px 0 rgba(255,255,255,.018);
}

.topbar-inner { width: min(1540px, calc(100% - 38px)); }
.brand { gap: 10px; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; box-shadow: 0 8px 24px rgba(88,101,242,.22); }
.brand-copy strong { letter-spacing: -.025em; }
.brand-copy small { font-size: .67rem; letter-spacing: .025em; }

.button {
    min-height: 39px;
    border-radius: 8px;
    border-color: var(--border-strong);
    background: #171b24;
    box-shadow: 0 1px 0 rgba(255,255,255,.035) inset;
    font-size: .78rem;
    font-weight: 750;
}

.button:hover { transform: translateY(-1px); border-color: #505b75; background: #1d222d; }
.button.primary { border-color: #6873f5; background: linear-gradient(135deg, #5865f2, #6c5ce7); box-shadow: 0 8px 24px rgba(88,101,242,.22); }
.button.primary:hover { background: linear-gradient(135deg, #6672f5, #7a68ee); }

.app-frame { grid-template-columns: 245px minmax(0, 1fr); }
.sidebar {
    padding: 22px 13px 18px;
    border-right-color: rgba(56,65,85,.72);
    background: rgba(11, 14, 20, .96);
}
.sidebar-section + .sidebar-section { padding-top: 18px; border-top: 1px solid rgba(56,65,85,.48); }
.sidebar-title { padding: 0 10px; color: #697386; font-size: .63rem; letter-spacing: .115em; }
.side-nav { gap: 3px; }
.side-nav-item { min-height: 39px; padding: 9px 10px; border: 1px solid transparent; border-radius: 8px; color: #a4adbd; font-size: .76rem; }
.side-nav-item:hover { color: #eff2f8; border-color: rgba(56,65,85,.6); background: rgba(255,255,255,.035); }
.side-nav-item.active { color: #fff; border-color: rgba(88,101,242,.3); background: linear-gradient(90deg, rgba(88,101,242,.2), rgba(88,101,242,.07)); box-shadow: inset 3px 0 #6974f5; }
.side-nav-icon { width: 22px; opacity: .9; filter: saturate(.82); }
.sidebar-bottom { padding-top: 16px; }

.app-main { background: transparent; }
.page-container { width: min(1240px, calc(100% - 54px)); padding-top: 38px; }

.dashboard-heading { margin-bottom: 22px; }
.dashboard-heading h1, .page-title h1 { letter-spacing: -.045em; }
.dashboard-heading h1 { font-size: clamp(2rem, 3.4vw, 3rem); }
.dashboard-heading p, .page-title p { color: var(--muted); }
.dashboard-status-card { border-radius: 10px; border-color: var(--border); background: #11151d; }
.dashboard-status-card strong { color: var(--success); }

.control-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 11px;
    margin: 0 0 30px;
}

.control-metrics article {
    min-width: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 11px 13px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: linear-gradient(145deg, rgba(25,30,40,.96), rgba(15,18,25,.96));
    box-shadow: 0 10px 30px rgba(0,0,0,.15);
}

.control-metrics article::after { content: ""; height: 2px; grid-column: 1 / -1; border-radius: 2px; background: linear-gradient(90deg, rgba(88,101,242,.55), transparent); }
.control-metric-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; color: #c9ceff; background: rgba(88,101,242,.14); font-weight: 900; }
.control-metric-icon.green { color: #68e0af; background: rgba(35,196,131,.12); }
.control-metric-icon.blue { color: #83b8ff; background: rgba(56,139,253,.12); }
.control-metric-icon.amber { color: #f2bd64; background: rgba(231,166,59,.12); }
.control-metrics small, .control-metrics strong { display: block; }
.control-metrics small { color: #858fa1; font-size: .65rem; font-weight: 700; }
.control-metrics strong { margin-top: 3px; color: #f4f6fb; font-size: 1.15rem; letter-spacing: -.025em; }
.control-metrics em { grid-column: 2; margin-top: -9px; color: #636d7f; font-size: .62rem; font-style: normal; }

.whats-new-card, .launch-callout { border-radius: 11px; border-color: rgba(88,101,242,.28); background: linear-gradient(100deg, rgba(88,101,242,.13), rgba(17,20,27,.94) 58%); }
.whats-new-icon { border-radius: 9px; background: rgba(88,101,242,.18); }

.server-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.server-card, .available-server-card {
    border-radius: 12px;
    border-color: var(--border);
    background: linear-gradient(155deg, #171b24, #0f1218);
    box-shadow: 0 14px 34px rgba(0,0,0,.17);
}
.server-card { position: relative; overflow: hidden; }
.server-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: linear-gradient(#6974f5, #7b61ff); opacity: .8; }
.server-card:hover, .available-server-card:hover { transform: translateY(-2px); border-color: #3d465b; }
.server-icon { border-radius: 10px; background: linear-gradient(135deg, #5865f2, #7b61ff); }
.server-meta { border-color: rgba(56,65,85,.55); }
.pill { border-radius: 6px; letter-spacing: .04em; }
.pill.on { color: #cbd0ff; border-color: rgba(88,101,242,.36); background: rgba(88,101,242,.12); }

.panel, .empty-card, .available-empty-card {
    border-radius: 12px;
    border-color: var(--border);
    background: linear-gradient(160deg, rgba(23,27,36,.96), rgba(14,17,23,.96));
    box-shadow: var(--control-shadow);
}
.panel-heading { padding-bottom: 15px; border-bottom: 1px solid rgba(56,65,85,.58); }
.panel-heading h2 { font-size: 1.13rem; letter-spacing: -.025em; }
.eyebrow { color: #8992ff !important; }

.dashboard-form { gap: 14px; }
.field input, .field textarea, .field select, .discord-select, input:not([type="checkbox"]):not([type="radio"]), textarea, select {
    border-radius: 8px;
    border-color: #333b4d;
    background: #0d1016;
}
.field input:focus, .field textarea:focus, .field select:focus, input:focus, textarea:focus, select:focus { border-color: #6a75f6; box-shadow: 0 0 0 3px rgba(88,101,242,.14); }
.toggle-card { border-radius: 9px; border-color: #303747; background: rgba(255,255,255,.018); }
.toggle-card:hover { border-color: #47516a; background: rgba(255,255,255,.03); }
.toggle-card:has(input:checked) { border-color: rgba(88,101,242,.42); background: rgba(88,101,242,.08); }
.toggle-card input[type="checkbox"] {
    appearance: none;
    flex: 0 0 auto;
    width: 38px;
    height: 22px;
    margin: 0;
    border: 1px solid #465066;
    border-radius: 999px;
    background: radial-gradient(circle at 10px 50%, #a2aaba 0 6px, transparent 6.5px), #292f3b;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.toggle-card input[type="checkbox"]:checked {
    border-color: #7480ff;
    background: radial-gradient(circle at 27px 50%, #fff 0 6px, transparent 6.5px), #5865f2;
    box-shadow: 0 0 0 3px rgba(88,101,242,.1);
}
.toggle-card input[type="checkbox"]:focus-visible { outline: 2px solid #929aff; outline-offset: 2px; }

.module-groups { display: grid; gap: 9px; }
.module-group { overflow: hidden; border: 1px solid #303747; border-radius: 10px; background: #0e1117; }
.module-group[open] { border-color: #3a4358; background: #11151d; }
.module-group summary { min-height: 62px; display: flex; align-items: center; gap: 18px; padding: 13px 16px; cursor: pointer; list-style: none; user-select: none; }
.module-group summary::-webkit-details-marker { display: none; }
.module-group summary::after { content: "⌄"; width: 25px; height: 25px; display: grid; place-items: center; margin-left: 2px; border: 1px solid #363e51; border-radius: 7px; color: #929caf; background: #171b24; transition: transform .18s ease; }
.module-group[open] summary::after { transform: rotate(180deg); }
.module-group summary > span { min-width: 0; flex: 1; }
.module-group summary b, .module-group summary small { display: block; }
.module-group summary b { color: #eef1f7; font-size: .82rem; }
.module-group summary small { margin-top: 4px; color: #747f91; font-size: .65rem; }
.module-group summary em { flex: 0 0 auto; padding: 5px 8px; border: 1px solid rgba(88,101,242,.28); border-radius: 999px; color: #b5bcff; background: rgba(88,101,242,.09); font-size: .61rem; font-style: normal; font-weight: 800; }
.module-toggle-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; padding: 0 10px 10px; border-top: 1px solid rgba(56,65,85,.5); }
.module-toggle-grid .toggle-card { min-height: 68px; margin-top: 9px; padding: 12px 13px; }
.module-toggle-grid .toggle-card strong { font-size: .76rem; }
.module-toggle-grid .toggle-card small { font-size: .62rem; }

.alert { border-radius: 9px; }
.form-actions.dashboard-actions { position: sticky; bottom: 14px; z-index: 4; padding: 12px; border: 1px solid rgba(56,65,85,.8); border-radius: 11px; background: rgba(12,15,21,.9); backdrop-filter: blur(16px); box-shadow: 0 18px 45px rgba(0,0,0,.28); }

.public-body .marketing-shell { width: min(1240px, calc(100% - 42px)); }
.marketing-nav a { border-radius: 7px; }
.marketing-nav a.active { color: #fff; background: rgba(88,101,242,.12); }
.home-product { border-color: #31394b; border-radius: 13px; box-shadow: 0 35px 90px rgba(0,0,0,.42), 18px 18px 0 -12px rgba(88,101,242,.13); }
.home-feature-main, .home-feature-stack article { border-radius: 12px; background: linear-gradient(155deg, #151922, #0d1016); }
.home-game-mark { border-radius: 10px; }

@media (max-width: 1050px) {
    .app-frame { grid-template-columns: 215px minmax(0,1fr); }
    .server-grid { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
    .page-container { width: min(100% - 28px, 1240px); padding-top: 26px; }
    .control-metrics { grid-template-columns: 1fr; }
    .control-metrics article { grid-template-columns: auto 1fr auto; }
    .control-metrics em { grid-column: 3; grid-row: 1; margin: 0; text-align: right; }
    .server-control-metrics em { display: none; }
    .form-actions.dashboard-actions { bottom: 8px; }
    .module-toggle-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .topbar-inner { width: calc(100% - 22px); }
    .brand-copy small, .account-name { display: none; }
    .control-metrics article { grid-template-columns: auto 1fr; }
    .control-metrics em { grid-column: 2; grid-row: auto; text-align: left; }
    .dashboard-heading-actions { width: 100%; }
    .dashboard-heading-actions .button, .dashboard-status-card { width: 100%; }
    .form-actions.dashboard-actions { display: grid; grid-template-columns: 1fr; }
    .module-group summary em { display: none; }
}
