/* ===========================================================
   SIFAR Command Center — dark theme
   =========================================================== */

:root {
    /* Same palette as the SIFAR website (public/site/site.css) */
    --bg: #071a24;
    --bg-soft: #0b2735;
    --panel: rgba(18, 55, 71, 0.55);
    --panel-solid: #0e2f3f;
    --panel-hover: rgba(27, 76, 98, 0.7);
    --line: rgba(159, 195, 211, 0.13);
    --line-strong: rgba(159, 195, 211, 0.26);
    --text: #f2fbff;
    --text-dim: #9fc3d3;
    --text-faint: #6f93a3;
    --accent: #1bb8d8;
    --accent-2: #f2559a;
    --good: #34d399;
    --warn: #fbbf24;
    --bad: #fb7185;
    --neutral: #94a3b8;
    --radius: 20px;
    --radius-sm: 12px;
    --shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.75);
    --font: 'Inter', 'Cairo', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-head: 'Fredoka', 'Inter', sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;
    --sidebar: 264px;
}

/* Section accents = the bot emblem colors used on the website */
body[data-section="system"] { --accent: #1bb8d8; --accent-2: #5fd3f0; }
body[data-section="lspd"] { --accent: #8b6cf6; --accent-2: #b9a4ff; }
body[data-section="department"] { --accent: #7fa9c2; --accent-2: #b7d3e3; }
body[data-section="illegal"] { --accent: #ef4444; --accent-2: #ff8a8a; }
body[data-section="tickets"] { --accent: #f5a524; --accent-2: #ffd08a; }
body[data-section="players"] { --accent: #f2559a; --accent-2: #1bb8d8; }
body[data-section="staff"] { --accent: #34d399; --accent-2: #1bb8d8; }
body[data-section="store"] { --accent: #f2559a; --accent-2: #1bb8d8; }
body[data-section="settings"] { --accent: #9fc3d3; --accent-2: #1bb8d8; }

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* Ambient aurora behind everything */
body::before,
body::after {
    content: '';
    position: fixed;
    z-index: 0;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.35;
    transition: background 0.6s ease;
}
body::before {
    width: 620px; height: 620px;
    top: -260px; left: 120px;
    background: var(--accent);
    opacity: 0.18;
}
body::after {
    width: 520px; height: 520px;
    bottom: -280px; right: -120px;
    background: var(--accent-2);
    opacity: 0.1;
}

a { color: inherit; text-decoration: none; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
code { background: rgba(148, 163, 255, 0.08); padding: 1px 6px; border-radius: 6px; color: #c7cbff; }

::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 255, 0.14); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

.icon { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------- Layout ---------------- */

.shell { position: relative; z-index: 1; display: flex; min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar);
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 22px 16px;
    background: linear-gradient(180deg, rgba(12, 14, 22, 0.92), rgba(8, 9, 15, 0.92));
    border-right: 1px solid var(--line);
    backdrop-filter: blur(18px);
    z-index: 20;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 20px; }
.brand-mark {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: 12px;
    background: conic-gradient(from 210deg, #8b7cff, #4fd1ff, #34d399, #f87171, #8b7cff);
    box-shadow: 0 8px 30px -8px rgba(139, 124, 255, 0.7);
    position: relative;
}
.brand-mark::after {
    content: 'S';
    position: absolute; inset: 2px;
    display: grid; place-items: center;
    border-radius: 10px;
    background: #0b0d16;
    font-weight: 800; font-size: 18px;
    background-clip: padding-box;
    color: #fff;
}
.brand-name { font-weight: 800; letter-spacing: 0.22em; font-size: 15px; }
.brand-sub { font-size: 11px; color: var(--text-faint); letter-spacing: 0.08em; text-transform: uppercase; }

.nav-label { margin: 14px 12px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); }

.nav-link {
    position: relative;
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-weight: 500;
    transition: background 0.18s, color 0.18s;
}
.nav-link:hover { background: rgba(148, 163, 255, 0.06); color: var(--text); }
.nav-link.active {
    color: var(--text);
    background: linear-gradient(90deg, color-mix(in srgb, var(--dot, var(--accent)) 18%, transparent), transparent);
}
.nav-link.active::before {
    content: '';
    position: absolute; left: -16px; top: 9px; bottom: 9px;
    width: 3px; border-radius: 0 3px 3px 0;
    background: var(--dot, var(--accent));
    box-shadow: 0 0 14px var(--dot, var(--accent));
}
.nav-link .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dot); margin-left: auto; box-shadow: 0 0 10px var(--dot); }

.sidebar-footer { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--radius); background: rgba(148, 163, 255, 0.04); border: 1px solid var(--line); }
.sidebar-footer img { width: 34px; height: 34px; border-radius: 50%; }
.sidebar-footer .who { flex: 1; min-width: 0; }
.sidebar-footer .who strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer .who span { font-size: 11px; color: var(--text-faint); }

.main { flex: 1; margin-left: var(--sidebar); padding: 28px 36px 60px; min-width: 0; }

.topbar { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.topbar h1 { margin: 0; font-size: 26px; font-weight: 750; letter-spacing: -0.02em; }
.topbar .crumb { font-size: 12px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 2px; }
.topbar .grow { flex: 1; }

.global-search { position: relative; width: min(360px, 40vw); }
.global-search input[type="search"] { padding-left: 40px; border-radius: 999px; background: rgba(10, 12, 19, 0.7); }
.global-search .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-faint); }

.btn.menu-toggle { display: none; }

/* ---------------- Surfaces ---------------- */

.card {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}
.card-pad { padding: 20px 22px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { margin: 0; font-size: 15px; font-weight: 650; }
.card-head .sub { color: var(--text-faint); font-size: 12px; }
.card-head .spacer, .toolbar .spacer { flex: 1; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.small { font-size: 12px; }
.mt { margin-top: 18px; }

/* Stat tiles */
.stat {
    padding: 18px 20px;
    overflow: hidden;
}
.stat::after {
    content: '';
    position: absolute; left: 20px; right: 20px; top: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--tile, var(--accent)), transparent);
    opacity: 0.8;
}
.stat .label { font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 8px; }
.stat .label .icon { width: 15px; height: 15px; color: var(--tile, var(--accent)); }
.stat .value { font-size: 30px; font-weight: 750; letter-spacing: -0.03em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .hint { font-size: 12px; color: var(--text-faint); margin-top: 2px; }

/* Bot status cards */
.bot-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.bot-card::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--tile) 16%, transparent), transparent 60%);
    pointer-events: none;
}
.bot-card .head { display: flex; align-items: center; gap: 12px; }
.bot-card .glyph {
    width: 42px; height: 42px; border-radius: 12px;
    display: grid; place-items: center;
    background: color-mix(in srgb, var(--tile) 16%, transparent);
    color: var(--tile);
    border: 1px solid color-mix(in srgb, var(--tile) 30%, transparent);
}
.bot-card .name { font-weight: 700; font-size: 15px; }
.bot-card .meta { display: flex; gap: 16px; font-size: 12px; color: var(--text-dim); }
.bot-card .meta strong { color: var(--text); font-variant-numeric: tabular-nums; }

.pulse { position: relative; width: 9px; height: 9px; border-radius: 50%; background: var(--c); display: inline-block; }
.pulse.live::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--c); animation: ping 1.8s ease-out infinite; }
@keyframes ping { from { transform: scale(0.6); opacity: 0.9; } to { transform: scale(1.6); opacity: 0; } }

/* ---------------- Tabs, filters, forms ---------------- */

.tabs { display: flex; gap: 4px; padding: 4px; background: rgba(148, 163, 255, 0.04); border: 1px solid var(--line); border-radius: 12px; width: fit-content; margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 8px 16px; border-radius: 9px; color: var(--text-dim); font-weight: 550; font-size: 13px; transition: 0.15s; }
.tabs a:hover { color: var(--text); }
.tabs a.active { background: color-mix(in srgb, var(--accent) 18%, rgba(255, 255, 255, 0.03)); color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.tabs a .count { margin-left: 6px; font-size: 11px; color: var(--text-faint); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-link { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-dim); font-size: 12px; font-weight: 550; transition: 0.15s; }
.chip-link:hover { border-color: var(--line-strong); color: var(--text); }
.chip-link.active { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--text); }
.chip-link .count { opacity: 0.6; margin-left: 4px; }

.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar form { display: flex; gap: 10px; flex: 1; min-width: 260px; }

input[type="text"], input[type="search"], input[type="number"], input[type="url"], select, textarea {
    width: 100%;
    padding: 10px 14px;
    background: rgba(5, 6, 10, 0.6);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 70%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-faint) 50%), linear-gradient(135deg, var(--text-faint) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
input[type="color"] { width: 44px; height: 40px; padding: 3px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: transparent; cursor: pointer; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    background: rgba(148, 163, 255, 0.06);
    color: var(--text);
    font: inherit; font-weight: 600;
    cursor: pointer;
    transition: 0.15s;
    white-space: nowrap;
}
.btn:hover { background: rgba(148, 163, 255, 0.12); }
.btn-primary { border: none; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #0a0b12; box-shadow: 0 10px 30px -12px var(--accent); }
.btn-primary:hover { filter: brightness(1.08); background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); padding: 8px; }
.btn-ghost:hover { color: var(--text); background: rgba(148, 163, 255, 0.08); }
.btn-discord { background: #5865f2; border: none; color: #fff; padding: 13px 22px; font-size: 15px; width: 100%; box-shadow: 0 14px 40px -14px #5865f2; }
.btn-discord:hover { background: #4752c4; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-dim); display: flex; justify-content: space-between; gap: 8px; }
.field label code { font-size: 10.5px; color: var(--text-faint); background: none; padding: 0; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }

.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; transition: 0.15s; }
.check:hover { border-color: var(--line-strong); }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.check:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }

.sticky-actions { position: sticky; bottom: 18px; display: flex; justify-content: flex-end; gap: 12px; padding: 14px 18px; margin-top: 18px; z-index: 5; }

/* ---------------- Tables ---------------- */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); padding: 12px 22px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 22px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: rgba(148, 163, 255, 0.035); }
tbody tr:last-child td { border-bottom: none; }
td.wrap { max-width: 380px; white-space: normal; word-break: break-word; color: var(--text-dim); }
td.nowrap { white-space: nowrap; }

/* ---------------- Atoms ---------------- */

.user { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.user img { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; background: var(--bg-soft); }
.user .u-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.user .u-id { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }
a.user:hover .u-name { color: var(--accent); }
.user.sm img { width: 22px; height: 22px; }

.avatars { display: flex; }
.avatars img { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--panel-solid); margin-left: -8px; }
.avatars img:first-child { margin-left: 0; }
.avatars .more { width: 26px; height: 26px; border-radius: 50%; margin-left: -8px; display: grid; place-items: center; font-size: 10px; font-weight: 700; background: var(--panel-hover); border: 2px solid var(--panel-solid); color: var(--text-dim); }

.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11.5px; font-weight: 650;
    white-space: nowrap;
    color: var(--c);
    background: color-mix(in srgb, var(--c) 13%, transparent);
    border: 1px solid color-mix(in srgb, var(--c) 28%, transparent);
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.badge.plain::before { display: none; }
.tone-good { --c: var(--good); }
.tone-warn { --c: var(--warn); }
.tone-bad { --c: var(--bad); }
.tone-neutral { --c: var(--neutral); }
.tone-accent { --c: var(--accent); }

.role-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: color-mix(in srgb, var(--role) 14%, transparent); border: 1px solid color-mix(in srgb, var(--role) 32%, transparent); color: color-mix(in srgb, var(--role) 70%, white); }
.role-chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--role); }

.empty { padding: 46px 20px; text-align: center; color: var(--text-faint); }
.empty .icon { width: 34px; height: 34px; margin-bottom: 8px; opacity: 0.6; }

.flash { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); background: color-mix(in srgb, var(--c) 10%, rgba(10, 12, 19, 0.9)); color: color-mix(in srgb, var(--c) 40%, white); font-weight: 550; }

.pager { display: flex; justify-content: space-between; align-items: center; padding: 14px 22px; border-top: 1px solid var(--line); }

/* Feed */
.feed { list-style: none; margin: 0; padding: 6px 0; }
.feed li { display: flex; gap: 14px; padding: 12px 22px; align-items: flex-start; }
.feed li + li { border-top: 1px solid var(--line); }
.feed .tick { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; background: color-mix(in srgb, var(--tile) 14%, transparent); color: var(--tile); }
.feed .tick .icon { width: 15px; height: 15px; }
.feed .body { flex: 1; min-width: 0; }
.feed .line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.feed .details { color: var(--text-dim); font-size: 12.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed time { font-size: 12px; color: var(--text-faint); white-space: nowrap; }

/* Sector / gang cards */
.tile-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.tile-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--tile); opacity: 0.9; border-radius: var(--radius) var(--radius) 0 0; }
.tile-card .title { display: flex; align-items: center; gap: 12px; }
.tile-card .emoji { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: color-mix(in srgb, var(--tile) 15%, transparent); border: 1px solid color-mix(in srgb, var(--tile) 30%, transparent); }
.tile-card h3 { margin: 0; font-size: 15px; }
.tile-card .kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile-card .kv div { padding: 8px 10px; border-radius: 10px; background: rgba(148, 163, 255, 0.04); }
.tile-card .kv span { display: block; font-size: 11px; color: var(--text-faint); }
.tile-card .kv strong { font-size: 17px; font-variant-numeric: tabular-nums; }

/* Profile */
.profile-hero { padding: 26px; display: flex; gap: 22px; align-items: center; overflow: hidden; }
.profile-hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(90% 140% at 0% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%); pointer-events: none; }
.profile-hero img { width: 92px; height: 92px; border-radius: 26px; box-shadow: 0 16px 40px -16px var(--accent); position: relative; }
.profile-hero h2 { margin: 0; font-size: 26px; letter-spacing: -0.02em; }
.profile-hero .handle { color: var(--text-dim); }
.server-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid color-mix(in srgb, var(--tile) 35%, transparent); background: color-mix(in srgb, var(--tile) 10%, transparent); }
.server-pill.off { opacity: 0.4; border-color: var(--line); background: transparent; }

.timeline { list-style: none; margin: 0; padding: 4px 22px 18px; }
.timeline li { position: relative; padding: 12px 0 12px 26px; border-left: 1px solid var(--line-strong); margin-left: 6px; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 17px; width: 11px; height: 11px; border-radius: 50%; background: var(--panel-solid); border: 2px solid var(--c, var(--accent)); }
.timeline .t-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.timeline .t-body { color: var(--text-dim); font-size: 13px; margin-top: 3px; }

/* Login */
.auth-wrap { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(440px, 100%); padding: 40px 36px; text-align: center; }
.auth-card .brand { justify-content: center; padding: 0 0 26px; }
.auth-card h1 { margin: 0 0 8px; font-size: 24px; letter-spacing: -0.02em; }
.auth-card p { color: var(--text-dim); margin: 0 0 28px; }
.auth-foot { margin-top: 22px; font-size: 12px; color: var(--text-faint); }
.bot-strip { display: flex; justify-content: center; gap: 10px; margin-bottom: 28px; }
.bot-strip span { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--tile); background: color-mix(in srgb, var(--tile) 13%, transparent); border: 1px solid color-mix(in srgb, var(--tile) 28%, transparent); }

/* ---------------- Responsive ---------------- */

@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.25s ease; box-shadow: 30px 0 80px rgba(0, 0, 0, 0.6); }
    body.nav-open .sidebar { transform: none; }
    .main { margin-left: 0; padding: 18px 16px 50px; }
    .btn.menu-toggle { display: inline-flex; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
    .span-2 { grid-column: auto; }
    .topbar { flex-wrap: wrap; }
    .global-search { width: 100%; order: 3; }
    th, td { padding: 11px 14px; }
    .profile-hero { flex-direction: column; text-align: center; }
}

/* ---------------- Staff activity ---------------- */

.bar { flex: 1; height: 6px; border-radius: 6px; background: rgba(148, 163, 255, 0.1); overflow: hidden; min-width: 60px; }
.bar > div { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.stars { display: inline-flex; align-items: center; gap: 2px; }
.stars .icon { width: 15px; height: 15px; color: var(--text-faint); }
.stars .icon.on { color: #fbbf24; fill: #fbbf24; }
.stars span { margin-left: 6px; }

.day-chart { display: flex; align-items: flex-end; gap: 4px; height: 140px; }
.day-chart .day { flex: 1; height: 100%; display: flex; align-items: flex-end; border-radius: 4px; background: rgba(148, 163, 255, 0.04); }
.day-chart .day > div { width: 100%; border-radius: 4px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 40%, transparent); }

.rating-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.rating-input input { display: none; }
.rating-input label { cursor: pointer; color: var(--text-faint); transition: 0.12s; }
.rating-input label .icon { width: 26px; height: 26px; }
.rating-input label:hover, .rating-input label:hover ~ label, .rating-input input:checked ~ label { color: #fbbf24; }
.rating-input label:hover .icon, .rating-input label:hover ~ label .icon, .rating-input input:checked ~ label .icon { fill: #fbbf24; }

.btn-danger { border-color: rgba(251, 113, 133, 0.4); background: rgba(251, 113, 133, 0.1); color: var(--bad); }
.btn-danger:hover { background: rgba(251, 113, 133, 0.2); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.modal { width: min(440px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--panel-solid); color: var(--text); }
.modal::backdrop { background: rgba(5, 6, 12, 0.7); backdrop-filter: blur(4px); }
.modal form { display: grid; gap: 12px; padding: 22px; }
.modal-head { display: flex; align-items: center; gap: 10px; }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal p { margin: 0; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

.modal-wide { width: min(680px, calc(100vw - 32px)); }
.modal form { max-height: calc(100vh - 64px); overflow-y: auto; }
.modal-avatar { width: 28px; height: 28px; border-radius: 50%; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.perm-group { margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); display: grid; gap: 8px; }
.perm-group legend { padding: 0 6px; font-weight: 600; font-size: 13px; }
.perm-item { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; cursor: pointer; }
.perm-item input { width: auto; margin-top: 2px; }
.chips-sm { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------- Tickets: embed editor & Discord preview ---------- */
textarea { resize: vertical; min-height: 90px; font-family: inherit; line-height: 1.5; }
.embed-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 24px; align-items: start; }
.embed-more summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-dim); }
.embed-field-row { display: grid; grid-template-columns: 1fr 1.6fr auto; gap: 8px; align-items: center; }
.question-row { display: grid; grid-template-columns: 28px 1.2fr 1.4fr 150px auto; gap: 8px; align-items: center; }
.q-num { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.dc-wrap { position: sticky; top: 18px; }
.dc { background: #313338; border-radius: 12px; padding: 16px 14px; color: #dbdee1; font: 15px/1.375 'gg sans', 'Noto Sans', 'Segoe UI', sans-serif; border: 1px solid #1e1f22; }
.dc-msg { display: flex; gap: 14px; }
.dc-avatar { width: 40px; height: 40px; border-radius: 50%; background: #1e1f22; padding: 6px; flex: none; }
.dc-body { min-width: 0; flex: 1; }
.dc-head { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.dc-name { font-weight: 600; color: #f2f3f5; }
.dc-bot { background: #5865f2; color: #fff; font-size: 10px; font-weight: 700; border-radius: 3px; padding: 0 4px; line-height: 15px; }
.dc-time { font-size: 12px; color: #949ba4; }
.dc-mention { background: rgba(88, 101, 242, 0.3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; }
.dc-embed { display: flex; gap: 16px; background: #2b2d31; border-left: 4px solid #202225; border-radius: 4px; padding: 10px 14px 14px 12px; margin-top: 6px; max-width: 432px; }
.dc-embed-main { min-width: 0; flex: 1; display: grid; gap: 6px; }
.dc-author { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #f2f3f5; }
.dc-author:empty, .dc-title:empty, .dc-fields:empty, .dc-footer:empty { display: none; }
.dc-author img { width: 24px; height: 24px; border-radius: 50%; }
.dc-title { font-weight: 700; color: #f2f3f5; }
.dc-title a { color: #00a8fc; }
.dc-desc { font-size: 14px; word-wrap: break-word; }
.dc-desc code, .dc-field code { background: #1e1f22; border-radius: 3px; padding: 0 3px; font-size: 13px; }
.dc-desc pre { background: #1e1f22; border-radius: 4px; padding: 8px; margin: 4px 0; white-space: pre-wrap; }
.dc-quote { display: block; border-left: 4px solid #4e5058; padding-left: 10px; }
.dc-h1 { display: block; font-size: 22px; font-weight: 700; color: #f2f3f5; }
.dc-h2 { display: block; font-size: 19px; font-weight: 700; color: #f2f3f5; }
.dc-h3 { display: block; font-size: 16px; font-weight: 700; color: #f2f3f5; }
.dc-fields { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 14px; }
.dc-field { flex: 1 1 100%; }
.dc-field.inline { flex: 1 1 28%; }
.dc-fname { font-weight: 600; color: #f2f3f5; margin-bottom: 2px; }
.dc-image { max-width: 100%; border-radius: 4px; margin-top: 6px; }
.dc-thumb { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; flex: none; }
.dc-footer { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #949ba4; margin-top: 4px; }
.dc-footer img { width: 20px; height: 20px; border-radius: 50%; }
.dc-embed.dc-empty { opacity: 0.6; }
.dc-select { display: flex; justify-content: space-between; align-items: center; background: #1e1f22; border: 1px solid #1e1f22; border-radius: 4px 4px 0 0; padding: 10px 12px; margin-top: 8px; max-width: 432px; color: #949ba4; font-size: 14px; }
.dc-options { background: #2b2d31; border: 1px solid #1e1f22; border-top: 0; border-radius: 0 0 4px 4px; max-width: 432px; max-height: 260px; overflow: auto; }
.dc-option { display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: 14px; color: #dbdee1; }
.dc-option + .dc-option { border-top: 1px solid #1e1f22; }
.dc-opt-emoji { width: 22px; text-align: center; font-size: 18px; }
.dc-opt-desc { font-size: 12px; color: #949ba4; }
.dc-emoji { width: 22px; height: 22px; vertical-align: middle; }
.dc-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.dc-btn { border-radius: 4px; padding: 5px 14px; font-size: 14px; font-weight: 500; color: #fff; }
.dc-btn.red { background: #da373c; }
.dc-btn.green { background: #248046; }
.dc-btn.grey { background: #4e5058; }
@media (max-width: 1100px) {
    .embed-editor { grid-template-columns: 1fr; }
    .dc-wrap { position: static; }
}
@media (max-width: 720px) {
    .question-row { grid-template-columns: 28px 1fr; }
    .question-row > :nth-child(n+3) { grid-column: 2; }
    .embed-field-row { grid-template-columns: 1fr; }
}


/* ===========================================================
   SIFAR website look (same sky, colors and fonts as "/")
   Only visual overrides: no layout or behaviour changes.
   =========================================================== */

body {
    background:
        radial-gradient(1100px 600px at 75% -10%, rgba(27, 111, 146, 0.55), transparent 60%),
        linear-gradient(180deg, #0e3b52 0%, var(--bg-soft) 38%, var(--bg) 100%) fixed;
}
/* Stars at the top, desert dunes at the bottom (replace the old aurora blobs) */
body::before {
    width: auto; height: 45vh; inset: 0 0 auto 0; top: 0; left: 0;
    border-radius: 0; filter: none; opacity: 0.8;
    background-color: transparent;
    background-image:
        radial-gradient(1.5px 1.5px at 12% 18%, #fff8, transparent), radial-gradient(1px 1px at 28% 8%, #fff7, transparent),
        radial-gradient(1.5px 1.5px at 52% 22%, #fff6, transparent), radial-gradient(1px 1px at 78% 12%, #fff8, transparent),
        radial-gradient(1.5px 1.5px at 90% 30%, #fff5, transparent), radial-gradient(1px 1px at 65% 6%, #fff7, transparent),
        radial-gradient(1px 1px at 40% 35%, #fff4, transparent), radial-gradient(1px 1px at 18% 38%, #fff5, transparent);
    animation: sifar-twinkle 5s ease-in-out infinite alternate;
}
body::after {
    width: auto; height: 220px; inset: auto 0 0 0; right: 0; bottom: 0;
    border-radius: 0; filter: none; opacity: 1;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 220' preserveAspectRatio='none'%3E%3Cpath d='M0 120 C220 70 380 110 600 90 C820 70 1000 50 1200 85 C1320 105 1400 98 1440 92 V220 H0Z' fill='%231a9b9b' fill-opacity='.16'/%3E%3Cpath d='M0 165 C240 130 420 165 700 145 C960 128 1140 140 1440 158 V220 H0Z' fill='%23157c86' fill-opacity='.22'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
}
@keyframes sifar-twinkle { from { opacity: 0.45; } to { opacity: 0.9; } }

h1, h2, h3, .topbar h1, .card-head h2, .card-head h3, .stat .value, .brand-name, .bot-card .name { font-family: var(--font-head); }
.topbar h1 { font-weight: 700; letter-spacing: 0; font-size: 28px; }
.topbar .crumb { color: var(--accent); font-weight: 700; }

/* Sidebar: glass panel with the SIFAR logo */
.sidebar { background: linear-gradient(180deg, rgba(11, 39, 53, 0.92), rgba(7, 26, 36, 0.94)); border-right-color: var(--line); }
.brand-mark { width: 44px; height: 44px; border-radius: 0; background: url('/static/site/logo-128.png') center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 6px 14px rgba(27, 184, 216, 0.35)); }
.brand-mark::after { display: none; }
.brand-name { letter-spacing: 0.12em; font-size: 17px; font-weight: 700; }
.brand-sub { color: var(--accent); letter-spacing: 0.2em; font-weight: 600; }
.nav-link { border-radius: 12px; }
.nav-link:hover { background: rgba(27, 184, 216, 0.08); }
.nav-link.active { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 20%, transparent), rgba(27, 184, 216, 0.04)); color: #fff; }
.sidebar-footer { background: rgba(18, 55, 71, 0.5); }

/* Cards like the website: glass, rounded, gradient top line */
.card { background: linear-gradient(160deg, rgba(18, 55, 71, 0.72), rgba(11, 39, 53, 0.72)); border-color: var(--line); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(14px); }
.stat { overflow: hidden; }
.stat::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--tile, var(--accent)), var(--accent-2)); opacity: 0.9; }
.card-head { border-bottom-color: var(--line); }

/* Buttons: pink primary like "Play now" on the website */
.btn { border-radius: 12px; font-weight: 650; transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s; }
.btn:hover { background: rgba(27, 184, 216, 0.12); }
.btn-primary, .btn-primary:hover { background: linear-gradient(135deg, #f2559a, #d93d82); color: #fff; box-shadow: 0 10px 26px -10px rgba(242, 85, 154, 0.7); }
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.06); }

/* Inputs, tabs, chips, tables in the SIFAR colors */
input[type="text"], input[type="search"], input[type="number"], input[type="url"], select, textarea { background: rgba(7, 26, 36, 0.7); border-color: var(--line-strong); }
.global-search input[type="search"] { background: rgba(7, 26, 36, 0.65); }
.tabs { background: rgba(7, 26, 36, 0.45); border-radius: 14px; }
.tabs a { border-radius: 10px; }
.chip-link { background: rgba(7, 26, 36, 0.35); }
th { color: var(--text-faint); }
tbody tr:hover { background: rgba(27, 184, 216, 0.05); }
code { background: rgba(27, 184, 216, 0.1); color: #8fe3f5; }
::-webkit-scrollbar-thumb { background: rgba(159, 195, 211, 0.2); border-color: var(--bg); }
::selection { background: rgba(242, 85, 154, 0.35); }

@media (prefers-reduced-motion: reduce) { body::before { animation: none; } }
