/* ═══════════════════════════════════════════════════════════════════════════
   bleed dashboards — shared chrome
   Same palette as the landing page, so the site reads as one product. Every
   colour that should follow the bot's profile picture is a variable, and
   brand.js rewrites them at runtime.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --ink: #050506;
    --ink-1: #08080a;
    --ink-2: #0d0d10;
    --panel: rgba(255, 255, 255, .028);
    --panel-2: rgba(255, 255, 255, .05);
    --panel-3: rgba(255, 255, 255, .075);
    --line: rgba(255, 255, 255, .075);
    --line-2: rgba(255, 255, 255, .14);
    --line-3: rgba(255, 255, 255, .24);
    --text: #f4f4f6;
    --muted: rgba(255, 255, 255, .56);
    --dim: rgba(255, 255, 255, .30);
    --red: #e11d2e;
    --red-2: #ff4b5c;
    --red-3: #ff8d97;
    --red-soft: rgba(225, 29, 46, .12);
    --red-line: rgba(225, 29, 46, .34);
    --green: #22c55e;
    --amber: #f5a524;
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 22px;
    --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --shadow: 0 20px 60px rgba(0, 0, 0, .6);
    --shadow-red: 0 18px 60px var(--red-soft);
    --sidebar: 244px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    min-height: 100vh;
    background: var(--ink);
    color: var(--text);
    font: 15px/1.62 var(--sans);
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(760px 460px at 78% -6%, var(--red-soft), transparent 68%),
        radial-gradient(620px 520px at 4% 12%, var(--red-soft), transparent 70%);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
code, .mono { font-family: var(--mono); font-size: .9em; }

/* ── layout ─────────────────────────────────────────────────────────────── */
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }

.side {
    border-right: 1px solid var(--line);
    background: rgba(0, 0, 0, .35);
    backdrop-filter: blur(14px);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.side .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.01em; }
.side .brand img { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line-2); }
.side .brand small { display: block; font-weight: 500; font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
    padding: 9px 11px;
    border-radius: var(--r-sm);
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 9px;
    transition: background .16s, color .16s;
}
.nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a.active { background: var(--red-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--red-line); }
.nav .group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); padding: 14px 11px 4px; }

.side .foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: var(--dim); }

.main { padding: 28px clamp(18px, 4vw, 46px) 70px; max-width: 1180px; width: 100%; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.topbar h1 { font-size: 25px; letter-spacing: -.02em; }
.topbar .sub { color: var(--dim); font-size: 13px; }

.who { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--panel); }
.who img { width: 26px; height: 26px; border-radius: 50%; }

/* ── cards ──────────────────────────────────────────────────────────────── */
.card {
    border: 1px solid var(--line);
    background: linear-gradient(180deg, var(--panel), transparent);
    border-radius: var(--r-lg);
    padding: 18px;
    margin-bottom: 16px;
}
.card h2 { font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.card .hint { color: var(--dim); font-size: 12.5px; margin-bottom: 14px; }

.grid { display: grid; gap: 14px; }
.grid.k2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.k3 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid.k4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.stat { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); padding: 14px; }
.stat .k { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--dim); }
.stat .v { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin-top: 3px; }
.stat .v.small { font-size: 16px; }

/* ── controls ───────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--line-2);
    background: var(--panel-2);
    border-radius: var(--r-sm);
    padding: 8px 14px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .16s, border-color .16s, opacity .16s;
}
.btn:hover { background: var(--panel-3); border-color: var(--line-3); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-2); border-color: var(--red-2); }
.btn.danger { background: transparent; border-color: var(--red-line); color: var(--red-3); }
.btn.danger:hover { background: var(--red-soft); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }

input[type="text"], input[type="search"], input[type="number"], select, textarea {
    width: 100%;
    background: var(--ink-1);
    border: 1px solid var(--line-2);
    border-radius: var(--r-sm);
    padding: 9px 11px;
    font-size: 14px;
    outline: none;
    transition: border-color .16s;
}
input:focus, select:focus, textarea:focus { border-color: var(--red-line); }
textarea { min-height: 110px; resize: vertical; font-family: var(--mono); font-size: 13px; }
label.field { display: block; margin-bottom: 12px; }
label.field span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); }
.switch .label { font-size: 13.5px; font-weight: 500; }
.switch .label small { display: block; color: var(--dim); font-size: 11.5px; font-weight: 400; }
.switch input { appearance: none; width: 40px; height: 22px; border-radius: 999px; background: var(--panel-3); border: 1px solid var(--line-2); position: relative; cursor: pointer; flex: none; transition: background .16s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .16s, background .16s; }
.switch input:checked { background: var(--red-soft); border-color: var(--red-line); }
.switch input:checked::after { transform: translateX(18px); background: var(--red-2); }

/* ── tables ─────────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--dim); padding: 8px 10px; border-bottom: 1px solid var(--line-2); font-weight: 600; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: var(--panel); }
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 2px 9px; font-size: 11.5px; font-weight: 600; border: 1px solid var(--line-2); background: var(--panel-2); }
.pill.on { border-color: rgba(34, 197, 94, .4); background: rgba(34, 197, 94, .12); color: #8ce9ae; }
.pill.off { border-color: var(--line-2); color: var(--dim); }
.pill.warn { border-color: rgba(245, 165, 36, .4); background: rgba(245, 165, 36, .12); color: #ffd08a; }
.pill.red { border-color: var(--red-line); background: var(--red-soft); color: var(--red-3); }

.guildpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 12px; }
.gpick { border: 1px solid var(--line); border-radius: var(--r-md); padding: 13px; background: var(--panel); display: flex; gap: 11px; align-items: center; cursor: pointer; transition: border-color .16s, background .16s; text-align: left; }
.gpick:hover { border-color: var(--line-3); background: var(--panel-2); }
.gpick.sel { border-color: var(--red-line); background: var(--red-soft); }
.gpick img, .gpick .fallback { width: 38px; height: 38px; border-radius: 11px; flex: none; border: 1px solid var(--line-2); }
.gpick .fallback { display: grid; place-items: center; font-weight: 800; background: var(--ink-2); }
.gpick .n { font-weight: 600; font-size: 14px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gpick .m { font-size: 11.5px; color: var(--dim); }

.empty { border: 1px dashed var(--line-2); border-radius: var(--r-md); padding: 26px; text-align: center; color: var(--dim); font-size: 13.5px; }

.skeleton { border-radius: var(--r-sm); background: linear-gradient(90deg, var(--panel), var(--panel-3), var(--panel)); background-size: 200% 100%; animation: sk 1.3s linear infinite; height: 14px; margin: 7px 0; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── toasts ─────────────────────────────────────────────────────────────── */
#toasts { position: fixed; z-index: 90; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 9px; max-width: min(380px, 90vw); }
.toast { border: 1px solid var(--line-2); background: rgba(13, 13, 16, .95); backdrop-filter: blur(12px); border-radius: var(--r-md); padding: 12px 14px; font-size: 13.5px; box-shadow: var(--shadow); animation: pop .2s var(--ease, ease); }
.toast.ok { border-color: rgba(34, 197, 94, .45); }
.toast.err { border-color: var(--red-line); }
.toast b { display: block; margin-bottom: 2px; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

.tabs { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 15px; }
.tabs button { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px; padding: 5px 13px; font-size: 12.5px; cursor: pointer; }
.tabs button:hover { color: var(--text); border-color: var(--line-3); }
.tabs button.on { background: var(--red-soft); border-color: var(--red-line); color: var(--text); }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── signed-out state ───────────────────────────────────────────────────── */
.gate { min-height: 76vh; display: grid; place-items: center; text-align: center; }
.gate .box { max-width: 460px; border: 1px solid var(--line); border-radius: var(--r-xl); background: linear-gradient(180deg, var(--panel), transparent); padding: 34px 30px; box-shadow: var(--shadow-red); }
.gate h1 { font-size: 26px; margin-bottom: 8px; letter-spacing: -.02em; }
.gate p { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.gate .discord { background: #5865f2; border-color: #5865f2; color: #fff; }

@media (max-width: 860px) {
    .shell { grid-template-columns: 1fr; }
    .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); }
    .side .nav { flex-direction: row; flex-wrap: wrap; }
    .side .nav .group { display: none; }
    .side .foot { margin-left: auto; margin-top: 0; }
    .main { padding: 20px 15px 60px; }
}
