/* ===========================================================================
   BestPixel Dev — Liquid Glass (dark)
   Brand: #8B82FF
   =========================================================================== */

:root {
    --brand: #8B82FF;
    --brand-2: #6C63FF;
    --brand-glow: rgba(139, 130, 255, 0.45);
    --brand-soft: rgba(139, 130, 255, 0.14);

    --bg-0: #0a0a0f;
    --bg-1: #0e0e16;
    --bg-2: #12121d;

    --text: #ECECF4;
    --text-dim: #A4A4B8;
    --text-faint: #6E6E84;

    --glass: rgba(255, 255, 255, 0.045);
    --glass-2: rgba(255, 255, 255, 0.07);
    --glass-border: rgba(255, 255, 255, 0.10);
    --glass-border-strong: rgba(255, 255, 255, 0.16);

    --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.55);

    --ok: #46d39a;
    --warn: #ffb454;
    --danger: #ff6b6b;
    --info: #6bb6ff;

    --radius: 18px;
    --radius-sm: 12px;
    --radius-lg: 26px;

    --sidebar-w: 248px;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(1200px 700px at 12% -10%, rgba(139, 130, 255, 0.18), transparent 60%),
        radial-gradient(900px 600px at 100% 0%, rgba(108, 99, 255, 0.12), transparent 55%),
        radial-gradient(700px 700px at 85% 110%, rgba(139, 130, 255, 0.10), transparent 60%),
        var(--bg-0);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    line-height: 1.5;
    overflow-x: clip;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: #b3aaff; }

h1, h2, h3, h4 { margin: 0 0 .4em; font-weight: 650; letter-spacing: -0.02em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.10); border-radius: 20px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.18); }

/* ---------- Glass primitive ---------- */
.glass {
    background: var(--glass);
    -webkit-backdrop-filter: blur(26px) saturate(150%);
    backdrop-filter: blur(26px) saturate(150%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.06);
}

/* ===========================================================================
   Auth / centered screens
   =========================================================================== */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.auth-card {
    width: 100%;
    max-width: 410px;
    padding: 38px 34px;
}
.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.auth-logo .brand-name { font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em; }
.auth-sub { color: var(--text-dim); margin-bottom: 26px; font-size: .92rem; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--text-faint); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--glass-border); }

/* ===========================================================================
   App shell
   =========================================================================== */
.shell { display: flex; min-height: 100vh; }

.sidebar {
    position: sticky;
    top: 0;
    align-self: flex-start;
    width: var(--sidebar-w);
    height: 100vh;
    flex: 0 0 var(--sidebar-w);
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(12, 12, 20, 0.55);
    -webkit-backdrop-filter: blur(30px) saturate(160%);
    backdrop-filter: blur(30px) saturate(160%);
    border-right: 1px solid var(--glass-border);
    overflow-y: auto;
}
.brand {
    display: flex; align-items: center; gap: 11px;
    padding: 6px 10px 18px;
}
.brand .brand-name { font-weight: 750; font-size: 1.08rem; letter-spacing: -.02em; }
.brand .brand-name small { display: block; font-weight: 500; font-size: .68rem; color: var(--text-faint); letter-spacing: .12em; text-transform: uppercase; }

.nav-group { display: flex; flex-direction: column; gap: 6px; }
.nav-label {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    width: 100%; background: none; border: 0; cursor: pointer;
    font-family: inherit; text-align: left;
    font-size: .68rem; text-transform: uppercase; letter-spacing: .14em;
    color: var(--text-faint); padding: 14px 12px 6px;
    transition: color .15s ease;
}
.nav-label:hover { color: var(--text-dim); }
.nav-label .ic { width: 14px; height: 14px; flex: 0 0 14px; opacity: .65; transition: transform .2s ease; }
.nav-group.collapsed .nav-label .ic { transform: rotate(-90deg); }
.nav-group-items {
    display: flex; flex-direction: column; gap: 6px;
    max-height: 1000px; overflow: hidden;
    transition: max-height .25s ease, opacity .2s ease;
}
.nav-group.collapsed .nav-group-items { max-height: 0; opacity: 0; pointer-events: none; }

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-size: .92rem; font-weight: 550;
    transition: background .15s ease, color .15s ease, transform .05s ease;
}
.nav-item .ic { width: 18px; height: 18px; flex: 0 0 18px; opacity: .9; }
.nav-item:hover { background: var(--glass-2); color: var(--text); }
.nav-item.active {
    background: linear-gradient(180deg, var(--brand-soft), rgba(139,130,255,.06));
    color: #fff;
    border: 1px solid rgba(139,130,255,.28);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 6px 20px -10px var(--brand-glow);
}
.nav-item .badge-count { margin-left: auto; }

.sidebar-foot { margin-top: auto; padding-top: 14px; }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 16px;
    padding: 16px 28px;
    background: rgba(10, 10, 16, 0.5);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    backdrop-filter: blur(24px) saturate(150%);
    border-bottom: 1px solid var(--glass-border);
}
.topbar .page-title { font-size: 1.15rem; font-weight: 680; letter-spacing: -.02em; }
.topbar .spacer { flex: 1; }
.topbar-search { position: relative; display: flex; align-items: center; margin-left: 24px; flex: 0 1 340px; }
.topbar-search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; }
.topbar-search .input { width: 100%; padding-left: 40px; height: 40px; border-radius: 999px; background: rgba(0,0,0,.28); }
.topbar-search .input:focus { background: rgba(0,0,0,.34); }
.topbar-search .input::-webkit-search-cancel-button { filter: invert(.6); }
@media (max-width: 760px) { .topbar-search { display: none; } }

.content { padding: 26px 32px 60px; width: 100%; }

/* ---------- Avatar ---------- */
.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center;
    font-size: .76rem; font-weight: 700; color: #0b0b12;
    background: var(--brand);
    box-shadow: 0 4px 14px -4px var(--brand-glow);
    flex: 0 0 auto;
}
.avatar.sm { width: 26px; height: 26px; font-size: .64rem; }
.avatar.lg { width: 48px; height: 48px; font-size: 1rem; }

.topbar-bell { position: relative; }
.bell-dot { position: absolute; top: 1px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .62rem; font-weight: 700; display: grid; place-items: center; line-height: 1; box-shadow: 0 0 0 2px rgba(10,10,16,.85); }
.notif-row { display: flex; align-items: center; gap: 12px; padding: 13px 8px; border-bottom: 1px solid rgba(255,255,255,.05); color: var(--text); border-radius: 8px; transition: background .12s ease; }
.notif-row:last-child { border-bottom: none; }
.notif-row:hover { background: var(--glass); }
.notif-row.unread { background: rgba(139,130,255,.07); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: 0 0 auto; }

.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); }
.user-chip:hover { background: var(--glass-2); }
.user-chip .meta { line-height: 1.2; }
.user-chip .meta strong { font-size: .85rem; }
.user-chip .meta span { font-size: .72rem; color: var(--text-faint); }

/* ===========================================================================
   Buttons
   =========================================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border-strong);
    background: var(--glass-2);
    color: var(--text);
    font-family: inherit; font-size: .88rem; font-weight: 600;
    cursor: pointer;
    transition: transform .06s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.btn:hover { background: rgba(255,255,255,.12); border-color: var(--glass-border-strong); }
.btn:active { transform: translateY(1px); }
.btn.primary {
    background: linear-gradient(180deg, var(--brand), var(--brand-2));
    border: 1px solid rgba(255,255,255,.18);
    color: #fff;
    box-shadow: 0 10px 26px -10px var(--brand-glow), inset 0 1px 0 rgba(255,255,255,.3);
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: var(--glass-border); }
.btn.danger { color: #ffd9d9; border-color: rgba(255,107,107,.35); background: rgba(255,107,107,.12); }
.btn.danger:hover { background: rgba(255,107,107,.2); }
.btn.sm { padding: 7px 12px; font-size: .8rem; }
.btn.icon { padding: 9px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===========================================================================
   Forms
   =========================================================================== */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .82rem; font-weight: 600; color: var(--text-dim); margin-bottom: 7px; }
.input, .select, .textarea {
    width: 100%;
    padding: 11px 13px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(0,0,0,.28);
    color: var(--text);
    font-family: inherit; font-size: .9rem;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
    background: rgba(0,0,0,.34);
}
.textarea { resize: vertical; min-height: 92px; }
.select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23A4A4B8' stroke-width='2.5'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.hint { font-size: .78rem; color: var(--text-faint); margin-top: 6px; }
.field-error { font-size: .8rem; color: var(--danger); margin-top: 6px; }

/* Brand-tint any remaining native checkboxes/radios */
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); width: 17px; height: 17px; cursor: pointer; }

/* Polished colour picker */
input[type="color"] {
    -webkit-appearance: none; appearance: none;
    border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
    background: rgba(0,0,0,.25); cursor: pointer; padding: 4px;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 8px; }
input[type="color"]::-moz-color-swatch { border: none; border-radius: 8px; }

/* iOS-style toggle switch — HIG proportions (51:31 ≈ 46:28, knob inset 2) */
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; -webkit-user-select: none; user-select: none; font-size: .9rem; color: var(--text); }
.switch > span:last-child { line-height: 1.25; }
/* Inline checkbox + label rows: consistent gap + vertical centering */
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; -webkit-user-select: none; user-select: none; line-height: 1.25; font-size: .9rem; }
.check input[type="checkbox"] { margin: 0; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
    position: relative; display: inline-block; flex: 0 0 auto; width: 46px; height: 28px; border-radius: 999px;
    background: rgba(120, 120, 128, 0.34); border: none;
    transition: background .25s cubic-bezier(.4, 0, .2, 1);
}
.switch .track::after {
    content: ''; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%;
    background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.35), 0 0 1px rgba(0,0,0,.25);
    transition: transform .25s cubic-bezier(.4, 0, .2, 1);
}
.switch input:checked + .track { background: linear-gradient(180deg, var(--brand), var(--brand-2)); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 4px var(--brand-soft); }
.switch input:disabled + .track { opacity: .45; cursor: not-allowed; }

/* ===========================================================================
   Cards / grid
   =========================================================================== */
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card { padding: 20px 22px; }
.card .card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.card .card-head h3 { margin: 0; font-size: 1rem; }
.card .card-head .spacer { flex: 1; }

.stat { padding: 20px 22px; }
.stat .stat-label { font-size: .78rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .08em; }
.stat .stat-value { font-size: 2rem; font-weight: 720; letter-spacing: -.03em; margin-top: 6px; }
.stat .stat-foot { font-size: .8rem; color: var(--text-faint); margin-top: 4px; }
.stat .stat-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); border: 1px solid rgba(139,130,255,.25); }

.page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .spacer { flex: 1; }
.page-head .sub { color: var(--text-dim); font-size: .9rem; }

/* ===========================================================================
   Badges & pills
   =========================================================================== */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 999px;
    font-size: .72rem; font-weight: 650; letter-spacing: .01em;
    border: 1px solid var(--glass-border);
    background: var(--glass-2); color: var(--text-dim);
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-count { background: var(--brand-soft); color: #c9c2ff; border-color: rgba(139,130,255,.3); padding: 1px 8px; font-size: .72rem; }

.badge.low      { color: #9fb4c9; }
.badge.medium   { color: var(--info); border-color: rgba(107,182,255,.3); background: rgba(107,182,255,.1); }
.badge.high     { color: var(--warn); border-color: rgba(255,180,84,.3); background: rgba(255,180,84,.1); }
.badge.urgent,
.badge.critical { color: var(--danger); border-color: rgba(255,107,107,.3); background: rgba(255,107,107,.1); }

.badge.open        { color: var(--info); border-color: rgba(107,182,255,.3); background: rgba(107,182,255,.1); }
.badge.in_progress { color: var(--warn); border-color: rgba(255,180,84,.3); background: rgba(255,180,84,.1); }
.badge.check       { color: #c8b3ff; border-color: rgba(150,120,255,.35); background: rgba(150,120,255,.12); }
.badge.resolved    { color: var(--ok); border-color: rgba(70,211,154,.3); background: rgba(70,211,154,.1); }
.badge.closed      { color: var(--text-faint); }

/* ---------- Bug tags ---------- */
.tag-pill {
    display: inline-flex; align-items: center;
    padding: 2px 9px; border-radius: 999px; margin: 0 4px 2px 0;
    font-size: .68rem; font-weight: 650; letter-spacing: .02em;
    border: 1px solid var(--glass-border); background: var(--glass-2); color: var(--text-dim);
}
.tag-core     { color: #c9c2ff; border-color: rgba(139,130,255,.4);  background: rgba(139,130,255,.14); }
.tag-player   { color: #8fd3ff; border-color: rgba(107,182,255,.4);  background: rgba(107,182,255,.14); }
.tag-vehicle  { color: #ffce8a; border-color: rgba(255,180,84,.4);   background: rgba(255,180,84,.14); }
.tag-security { color: #ff9b9b; border-color: rgba(255,107,107,.4);  background: rgba(255,107,107,.14); }
.tag-other    { color: #b9c2d0; border-color: var(--glass-border);   background: var(--glass-2); }
.tag-qol      { color: #8ff0c6; border-color: rgba(70,211,154,.4);   background: rgba(70,211,154,.14); }

.tag-picker { display: flex; flex-wrap: wrap; gap: 8px; }
/* '.field label' (line ~237) sets display:block with higher specificity than a
   bare '.tag-opt', so we scope to '.field .tag-opt' to win and actually get a
   flex row. margin:0 resets the label's inherited margin-bottom. */
.field .tag-opt {
    display: inline-flex; align-items: center; gap: 10px; line-height: 1; margin: 0;
    padding: 9px 16px 9px 12px; border-radius: 999px; cursor: pointer;
    font-size: .8rem; font-weight: 600;
    border: 1px solid var(--glass-border); background: rgba(255,255,255,.04); color: var(--text-dim);
    transition: all .18s cubic-bezier(.4, 0, .2, 1);
    -webkit-user-select: none; user-select: none;
}
.tag-opt:hover { border-color: var(--glass-border-strong); background: rgba(255,255,255,.08); color: var(--text); }
/* hide the native checkbox; the pill + custom box are the control */
.tag-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.tag-opt::before {
    content: ''; display: block; width: 18px; height: 18px; border-radius: 5px; flex: 0 0 auto;
    border: 1.5px solid var(--glass-border-strong); background-color: rgba(0,0,0,.25);
    background-repeat: no-repeat; background-position: center; background-size: 11px 11px;
    transition: all .18s cubic-bezier(.4, 0, .2, 1);
}
.tag-opt:focus-within { box-shadow: 0 0 0 3px var(--brand-soft); }
/* checked state: tinted pill + filled box with a white check */
.tag-opt:has(input:checked) { color: #fff; border-color: rgba(139,130,255,.6); background: var(--brand-soft); box-shadow: 0 6px 18px -10px var(--brand-glow); }
.tag-opt:has(input:checked)::before {
    border-color: transparent; background-color: var(--brand);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6 9 17l-5-5'/></svg>");
}
.tag-opt.tag-player:has(input:checked)   { border-color: rgba(107,182,255,.6); background: rgba(107,182,255,.16); }
.tag-opt.tag-player:has(input:checked)::before   { background-color: var(--info); }
.tag-opt.tag-vehicle:has(input:checked)  { border-color: rgba(255,180,84,.6); background: rgba(255,180,84,.16); }
.tag-opt.tag-vehicle:has(input:checked)::before  { background-color: var(--warn); }
.tag-opt.tag-security:has(input:checked) { border-color: rgba(255,107,107,.6); background: rgba(255,107,107,.16); }
.tag-opt.tag-security:has(input:checked)::before { background-color: var(--danger); }
.tag-opt.tag-other:has(input:checked)::before    { background-color: var(--text-dim); }
.tag-opt.tag-qol:has(input:checked)      { border-color: rgba(70,211,154,.6); background: rgba(70,211,154,.16); }
.tag-opt.tag-qol:has(input:checked)::before      { background-color: var(--ok); }

/* ---------- Screenshot zone ---------- */
.shot-zone {
    border: 1.5px dashed var(--glass-border-strong); border-radius: var(--radius-sm);
    padding: 14px; background: var(--glass); transition: border-color .15s, background .15s; cursor: pointer;
}
.shot-zone.hover { border-color: var(--brand); background: var(--brand-soft); }
.shot-hint { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--text-faint); font-size: .82rem; padding: 6px; }
.shot-gallery { display: flex; flex-wrap: wrap; gap: 10px; }
.shot-gallery:empty { display: none; }
.shot-thumb {
    position: relative; width: 92px; height: 92px; border-radius: 10px; overflow: hidden;
    border: 1px solid var(--glass-border); background: rgba(0,0,0,.3); flex: 0 0 auto;
}
.shot-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot-thumb.loading { display: grid; place-items: center; }
.shot-thumb.loading::after { content: ''; width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,.2); border-top-color: var(--brand); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.shot-del {
    position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 6px;
    border: none; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 14px; line-height: 1;
    display: grid; place-items: center; opacity: 0; transition: opacity .15s;
}
.shot-thumb:hover .shot-del { opacity: 1; }
.shot-del:hover { background: var(--danger); }

/* ===========================================================================
   Tables
   =========================================================================== */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th {
    text-align: left; font-weight: 600; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em;
    color: var(--text-faint); padding: 12px 14px; border-bottom: 1px solid var(--glass-border);
}
table.data td { padding: 13px 14px; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background .12s ease; }
table.data tbody tr:hover { background: var(--glass); }
table.data th.sortable { cursor: pointer; user-select: none; white-space: nowrap; transition: color .12s ease; }
table.data th.sortable:hover { color: var(--text-dim); }
table.data th.sortable:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
table.data th .sort-ind { margin-left: 5px; opacity: .35; font-size: .92em; }
table.data th .sort-ind::after { content: '↕'; }
table.data th[aria-sort] .sort-ind { opacity: .95; color: var(--text-dim); }
table.data th[aria-sort="ascending"] .sort-ind::after { content: '↑'; }
table.data th[aria-sort="descending"] .sort-ind::after { content: '↓'; }

/* ===========================================================================
   Kanban
   =========================================================================== */
.board { display: flex; gap: 16px; align-items: flex-start; overflow-x: auto; padding-bottom: 16px; }
.board > .col, .board > .col-add { scroll-snap-align: start; }
.col {
    flex: 0 0 296px; width: 296px;
    padding: 14px;
    display: flex; flex-direction: column; gap: 10px;
    max-height: calc(100vh - 210px);
}
.col-add { flex: 0 0 230px; width: 230px; }
.col-add .input { background: rgba(0,0,0,.28); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 6px; }
.col-head h4 { margin: 0; font-size: .92rem; }
.col-head .count { font-size: .72rem; color: var(--text-faint); background: var(--glass-2); padding: 1px 8px; border-radius: 999px; }
.col-edit { margin-left: auto; padding: 4px 6px; opacity: 0; transition: opacity .15s ease; }
.col:hover .col-edit, .col-edit:focus-visible { opacity: .6; }
.col-edit:hover { opacity: 1; }
.col-body { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 60px; padding: 2px; }
.col-body.drag-over { outline: 2px dashed rgba(139,130,255,.5); outline-offset: 2px; border-radius: 12px; }

.task-card {
    padding: 13px 14px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,.05);
    border: 1px solid var(--glass-border);
    cursor: grab;
    transition: transform .08s ease, box-shadow .15s ease, border-color .15s ease;
}
.task-card:hover { border-color: rgba(139,130,255,.4); box-shadow: 0 8px 24px -12px var(--brand-glow); }
.task-card.dragging { opacity: .5; cursor: grabbing; }
.task-card .t-title { font-size: .9rem; font-weight: 600; margin-bottom: 8px; }
.task-card .t-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-card .t-label { font-size: .7rem; padding: 2px 8px; border-radius: 6px; background: var(--brand-soft); color: #c9c2ff; }

/* ===========================================================================
   Chat
   =========================================================================== */
/* Full-height chat that fits the frame: lock the shell so only the message stream scrolls.
   Fallback height for browsers without :has(); the @supports block perfects the fit. */
.chat-layout { display: grid; grid-template-columns: 230px 1fr; gap: 16px; height: calc(100dvh - 120px); min-height: 0; }
@supports selector(:has(*)) {
    .shell:has(.chat-layout) { height: 100dvh; overflow: hidden; }
    .content:has(.chat-layout) { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 16px 18px; overflow: hidden; }
    .chat-layout { height: auto; flex: 1 1 auto; }
}
.chat-channels { padding: 12px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; min-height: 0; }
.chat-channels .ch {
    display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-radius: 10px;
    color: var(--text-dim); font-weight: 550; font-size: .9rem; flex: none;
}
.chat-channels .ch:hover { background: var(--glass-2); color: var(--text); }
.chat-channels .ch.active { background: var(--brand-soft); color: #fff; border: 1px solid rgba(139,130,255,.3); }
.chat-channels .ch .hash { color: var(--text-faint); }
.chat-channels .ch-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chat-main { display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.chat-head { padding: 13px 18px; border-bottom: 1px solid var(--glass-border); flex: none; }
.chat-head h3 { margin: 0; }
.chat-head .topic { font-size: .8rem; color: var(--text-faint); }

.chat-stream-wrap { position: relative; flex: 1 1 auto; min-height: 0; }
.chat-stream { position: absolute; inset: 0; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.chat-stream .empty { margin: auto; }
.msg { display: flex; gap: 11px; }
.msg.grouped { margin-top: -7px; }
.msg.grouped .avatar { visibility: hidden; }
.msg.grouped .who { display: none; }
.msg .body { min-width: 0; flex: 1; }
.msg .who { display: flex; align-items: baseline; gap: 8px; }
.msg .who strong { font-size: .88rem; }
.msg .who time { font-size: .72rem; color: var(--text-faint); }
.msg .text { font-size: .9rem; color: var(--text); word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg .text a { color: var(--brand); text-decoration: underline; }

.chat-jump { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; background: var(--brand); color: #fff; border: none; font-size: .8rem; font-weight: 600; cursor: pointer; box-shadow: 0 6px 20px -6px var(--brand-glow); z-index: 2; }
.chat-jump[hidden] { display: none; }
.chat-jump .ic { transform: rotate(-90deg); }

.chat-compose { padding: 12px 14px; border-top: 1px solid var(--glass-border); display: flex; gap: 10px; align-items: flex-end; flex: none; }
.chat-compose .input { flex: 1; resize: none; min-height: 42px; max-height: 140px; line-height: 1.4; padding: 10px 12px; overflow-y: auto; }
.chat-compose .btn { flex: none; height: 42px; }

/* ===========================================================================
   File list / dropzone
   =========================================================================== */
.dropzone {
    border: 1.5px dashed var(--glass-border-strong);
    border-radius: var(--radius);
    padding: 30px; text-align: center; color: var(--text-dim);
    background: var(--glass); transition: border-color .15s, background .15s;
}
.dropzone.hover { border-color: var(--brand); background: var(--brand-soft); color: var(--text); }
.upload-progress { margin: 12px 0; }
.upload-progress .up-bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,.1); overflow: hidden; }
.upload-progress .up-bar span { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .15s ease; }
.upload-progress .up-label { margin-top: 7px; font-size: .8rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.upload-progress.error .up-bar span { background: var(--danger); }
.upload-progress.error .up-label { color: var(--danger); }
/* Server still working after the bytes are uploaded: animate a moving gradient so it reads as "busy". */
.upload-progress.processing .up-bar span {
    width: 100% !important;
    background: linear-gradient(90deg, var(--brand), var(--brand-2), var(--brand));
    background-size: 200% 100%;
    animation: upShift 1.1s linear infinite;
}
.upload-progress.processing .up-label::after { content: ''; }
@keyframes upShift { from { background-position: 200% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .upload-progress.processing .up-bar span { animation: none; } }
.file-row { display: flex; align-items: center; gap: 14px; }
.file-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); border: 1px solid rgba(139,130,255,.2); flex: 0 0 auto; }
.cdn-thumb { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: rgba(0,0,0,.3); border: 1px solid var(--glass-border); flex: 0 0 auto; }

/* CDN folders */
.cdn-crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; font-size: .88rem; }
.cdn-crumbs .crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--text-dim); padding: 5px 10px; border-radius: 8px; }
.cdn-crumbs .crumb:hover { background: var(--glass-2); color: var(--text); }
.cdn-crumbs .crumb:last-child { color: var(--text); font-weight: 600; }
.cdn-crumbs .crumb-sep { color: var(--text-faint); }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.folder-tile { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-radius: 12px; border: 1px solid var(--glass-border); background: rgba(255,255,255,.04); color: var(--text); transition: border-color .15s ease, background .15s ease, transform .06s ease; }
.folder-tile:hover { border-color: rgba(139,130,255,.4); background: var(--glass-2); }
.folder-tile:active { transform: scale(.99); }
.folder-tile .ic { color: var(--brand); flex: 0 0 auto; }
.folder-name { font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===========================================================================
   Flash / alerts
   =========================================================================== */
.flashes { position: fixed; top: 18px; right: 18px; z-index: 100; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.flash {
    padding: 13px 16px; border-radius: var(--radius-sm);
    background: rgba(20,20,30,.85); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border); box-shadow: var(--shadow);
    font-size: .88rem; display: flex; gap: 10px; align-items: center;
    animation: slideIn .3s ease;
}
.flash.success { border-left: 3px solid var(--ok); }
.flash.error   { border-left: 3px solid var(--danger); }
.flash.info    { border-left: 3px solid var(--info); }
.flash-close {
    margin-left: auto; flex: 0 0 auto; background: none; border: 0; cursor: pointer;
    color: var(--text-faint); font-size: 1.1rem; line-height: 1; padding: 0 2px;
}
.flash-close:hover { color: var(--text); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---------- A11y: visible keyboard focus + busy buttons ---------- */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn.is-busy, button.is-busy { opacity: .6; pointer-events: none; }

.posts-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 11px; }
.posts-list li { display: flex; align-items: center; gap: 11px; }
.posts-list .pi { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--brand-soft); color: #c9c2ff; flex: 0 0 auto; border: 1px solid rgba(139,130,255,.22); }

/* 2FA / OTP */
.otp-input { letter-spacing: .45em; text-align: center; font-size: 1.25rem; font-weight: 600; font-variant-numeric: tabular-nums; padding-left: 18px; }
.setup-steps { margin: 4px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 20px; color: var(--text-dim); font-size: .9rem; line-height: 1.6; }
.setup-steps li { padding-left: 4px; }
.setup-steps li::marker { color: var(--brand); font-weight: 700; }
.setup-steps strong { color: var(--text); font-weight: 650; }
.kv { display: flex; align-items: center; gap: 10px; margin: 9px 0; flex-wrap: wrap; }
.kv > span { width: 64px; color: var(--text-faint); font-size: .78rem; flex: 0 0 auto; }
.kv code { background: rgba(0,0,0,.3); border: 1px solid var(--glass-border); padding: 6px 11px; border-radius: 8px; color: var(--text); font-size: .85rem; font-family: var(--font-mono, ui-monospace, monospace); }
.otp-secret { letter-spacing: .18em; font-weight: 600; color: #c9c2ff !important; }
.qr-wrap { display: flex; margin: 14px 0 6px; }
.qr-box { background: #fff; padding: 12px; border-radius: 14px; line-height: 0; box-shadow: 0 10px 26px -14px rgba(0,0,0,.6); }
.qr-box img, .qr-box canvas { display: block; border-radius: 4px; }
.manual-entry { margin-top: 8px; }
.manual-entry summary { cursor: pointer; color: var(--text-dim); font-size: .85rem; font-weight: 600; padding: 6px 0; -webkit-user-select: none; user-select: none; }
.manual-entry summary:hover { color: var(--text); }
.manual-entry[open] summary { margin-bottom: 8px; }

/* ---------- Settings layout ---------- */
.settings-layout { display: grid; grid-template-columns: 210px 1fr; gap: 20px; align-items: start; }
.settings-nav { padding: 10px; position: sticky; top: 88px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav .snav { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--text-dim); font-weight: 550; font-size: .9rem; transition: background .15s, color .15s; }
.settings-nav .snav:hover { background: var(--glass-2); color: var(--text); }
.settings-content { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.settings-content section { scroll-margin-top: 90px; }
@media (max-width: 860px) {
    .settings-layout { grid-template-columns: 1fr; }
    .settings-nav { position: static; flex-direction: row; overflow-x: auto; }
}

/* ---------- Server status ---------- */
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.server-card { padding: 18px 20px; transition: opacity .2s ease; }
.server-card.is-offline { opacity: .65; }
.server-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.server-name { font-weight: 650; font-size: 1rem; }
.server-host { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 210px; }
.server-dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; background: var(--text-faint); }
.server-dot.online { background: var(--ok); box-shadow: 0 0 0 4px rgba(70,211,154,.18); }
.server-dot.offline { background: var(--danger); box-shadow: 0 0 0 4px rgba(255,107,107,.14); }
.server-dot.loading { background: var(--brand); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.server-players { font-size: 1.9rem; font-weight: 730; letter-spacing: -.03em; }
.server-players .server-max { font-size: 1rem; font-weight: 500; color: var(--text-faint); margin-left: 2px; }
.server-meta { margin-top: 4px; min-height: 18px; }

.empty { text-align: center; padding: 50px 20px; color: var(--text-faint); }
.empty .ic { opacity: .4; margin-bottom: 12px; }

/* ---------- Modal ---------- */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 90;
    background: rgba(5,5,10,.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    /* Plain scrollable overlay: the modal sits near the top via margin and the
       whole thing scrolls when tall, so the form is always fully reachable.
       (A flex/grid-centered scroll container clips the overflow you can't reach.) */
    display: none; overflow-y: auto; padding: 56px 24px 40px;
}
.modal-backdrop.open { display: block; animation: backdropIn .22s ease both; }
.modal { width: 100%; max-width: 560px; margin: 0 auto; padding: 26px; animation: modalIn .34s cubic-bezier(.22, .61, .36, 1) both; }
/* Dialogs sit over the dimmed backdrop — give them a near-solid panel so the
   form is comfortably readable rather than see-through. */
.modal.glass { background: rgba(20, 20, 30, 0.94); }
.modal h3 { margin-bottom: 18px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(-22px) scale(.98); } to { opacity: 1; transform: none; } }

/* ===========================================================================
   Motion & loading (Apple HIG-inspired)
   =========================================================================== */
@media (prefers-reduced-motion: no-preference) {
    .content { animation: pageRise .4s cubic-bezier(.22, .61, .36, 1) both; }
    .auth-card { animation: modalIn .42s cubic-bezier(.22, .61, .36, 1) both; }
    .sidebar .nav-item { animation: navIn .5s cubic-bezier(.22, .61, .36, 1) both; }
    .sidebar .nav-item:nth-child(2) { animation-delay: .03s; }
    .sidebar .nav-item:nth-child(3) { animation-delay: .06s; }
    .sidebar .nav-item:nth-child(4) { animation-delay: .09s; }
    .sidebar .nav-item:nth-child(5) { animation-delay: .12s; }
}
@keyframes navIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes pageRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.spinner {
    display: inline-block; width: 22px; height: 22px; border-radius: 50%;
    border: 2.5px solid rgba(255,255,255,.14); border-top-color: var(--brand);
    animation: spin .7s linear infinite; vertical-align: middle;
}
.spinner.lg { width: 40px; height: 40px; border-width: 3px; }
.loading-center { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 50px 20px; color: var(--text-faint); }

.skeleton {
    background: linear-gradient(100deg, rgba(255,255,255,.05) 30%, rgba(255,255,255,.11) 50%, rgba(255,255,255,.05) 70%);
    background-size: 300% 100%; border-radius: 8px; animation: shimmer 1.5s ease-in-out infinite;
}
.skeleton.line { height: 12px; margin: 8px 0; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -20% 0; } }

/* Buttons get a springy press */
.btn { transition: transform .08s cubic-bezier(.22,.61,.36,1), background .15s ease, border-color .15s ease, box-shadow .15s ease, filter .15s ease; }
.btn:active { transform: scale(.97); }

/* GitHub repository viewer */
.commit-row { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-bottom: 1px solid rgba(255,255,255,.05); color: var(--text); border-radius: 8px; transition: background .12s ease; }
.commit-row:last-child { border-bottom: none; }
.commit-row:hover { background: var(--glass); }
.commit-msg { font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.commit-sha { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .76rem; color: var(--text-faint); background: var(--glass-2); padding: 3px 8px; border-radius: 6px; flex: 0 0 auto; }
.commit-body { white-space: pre-wrap; font-size: .85rem; color: var(--text-dim); margin: 6px 0 0; font-family: inherit; }
.diff-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--glass-border); background: rgba(255,255,255,.02); }
.diff-name { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .82rem; color: var(--text); word-break: break-all; }
.diff { margin: 0; padding: 10px 0; overflow-x: auto; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .78rem; line-height: 1.55; background: rgba(0,0,0,.28); }
.diff .dl { display: block; padding: 0 16px; white-space: pre; min-height: 1.2em; }
.diff .dl.add { background: rgba(70,211,154,.13); color: #b6f0d8; }
.diff .dl.del { background: rgba(255,107,107,.13); color: #ffc4c4; }
.diff .dl.hunk { color: var(--info); background: rgba(107,182,255,.08); }
.diff .dl.meta { color: var(--text-faint); }
.repo-tabs { display: flex; gap: 2px; margin-bottom: 20px; border-bottom: 1px solid var(--glass-border); flex-wrap: wrap; }
.repo-tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; color: var(--text-dim); font-weight: 600; font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s ease; }
.repo-tab:hover { color: var(--text); }
.repo-tab.active { color: #fff; border-bottom-color: var(--brand); }
.tree-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-bottom: 1px solid rgba(255,255,255,.05); color: var(--text); border-radius: 8px; transition: background .12s ease; }
.tree-row:last-child { border-bottom: none; }
.tree-row:hover { background: var(--glass); }
.tree-ic { display: inline-grid; place-items: center; color: var(--text-faint); flex: 0 0 auto; }
.tree-ic.dir { color: var(--brand); }
.tree-name { font-size: .9rem; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filecode { margin: 0; padding: 14px 16px; overflow-x: auto; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .78rem; line-height: 1.6; background: rgba(0,0,0,.28); color: var(--text-dim); white-space: pre; }

/* Right-click context menu */
.ctx-menu {
    position: fixed; z-index: 200; min-width: 178px; padding: 6px;
    border-radius: 12px; background: rgba(18, 18, 28, 0.94);
    -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%);
    border: 1px solid var(--glass-border-strong); box-shadow: var(--shadow-lg);
    animation: modalIn .13s cubic-bezier(.22,.61,.36,1);
}
.ctx-item {
    display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
    padding: 9px 12px; border: none; background: none; color: var(--text);
    font: inherit; font-size: .88rem; font-weight: 550; border-radius: 8px; cursor: pointer;
}
.ctx-item:hover { background: var(--glass-2); }
.ctx-item.danger { color: var(--danger); }
.ctx-item.danger:hover { background: rgba(255,107,107,.14); }
.ctx-item .ic { width: 15px; height: 15px; opacity: .85; flex: 0 0 auto; }
.ctx-sep { height: 1px; background: var(--glass-border); margin: 5px 6px; }

.row-actions { display: flex; gap: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.text-dim { color: var(--text-dim); }
.text-faint { color: var(--text-faint); }
.text-sm { font-size: .85rem; }
.nowrap { white-space: nowrap; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
    .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .25s ease; z-index: 60; }
    .sidebar.open { transform: none; }
    .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
    .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
    .chat-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .chat-channels { flex-direction: row; overflow-x: auto; overflow-y: hidden; flex: none; }
    .menu-toggle { display: inline-flex !important; }
}
.menu-toggle { display: none; }

/* ---------- Command palette (Ctrl/Cmd+K) ---------- */
.cmdk-hint { margin-left: 8px; font: 600 11px/1 inherit; color: var(--color-text-faint, #8a8a93); background: rgba(255,255,255,.06); border: 1px solid var(--glass-border); border-radius: 6px; padding: 4px 7px; cursor: pointer; white-space: nowrap; }
.cmdk[hidden] { display: none; }
.cmdk { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.55); display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; }
.cmdk-box { width: min(620px, 92vw); max-height: 70vh; display: flex; flex-direction: column; background: #16161d; border: 1px solid var(--glass-border); border-radius: 14px; box-shadow: 0 24px 70px rgba(0,0,0,.6); overflow: hidden; }
.cmdk-search { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--glass-border); color: var(--color-text-faint, #8a8a93); }
.cmdk-input { flex: 1; background: transparent; border: 0; outline: 0; color: var(--color-text, #fff); font-size: 1rem; }
.cmdk-results { overflow-y: auto; padding: 6px; }
.cmdk-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: transparent; border: 0; border-radius: 9px; padding: 9px 11px; cursor: pointer; color: var(--color-text, #e8e8ee); }
.cmdk-item.active { background: rgba(139,130,255,.16); }
.cmdk-type { flex: none; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #b9b3ff; background: rgba(139,130,255,.14); border-radius: 5px; padding: 2px 7px; }
.cmdk-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.cmdk-sub { flex: none; max-width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; color: var(--color-text-faint, #8a8a93); }
.cmdk-empty { padding: 24px; text-align: center; color: var(--color-text-faint, #8a8a93); font-size: .9rem; }
.cmdk-foot { padding: 8px 14px; border-top: 1px solid var(--glass-border); font-size: .74rem; color: var(--color-text-faint, #8a8a93); }
.cmdk-foot kbd { background: rgba(255,255,255,.07); border: 1px solid var(--glass-border); border-radius: 4px; padding: 1px 5px; margin: 0 1px; font: inherit; font-size: .7rem; }

/* ---------- PWA: toast action button + install button ---------- */
.flash-action { margin-left: 12px; background: rgba(255,255,255,.16); border: 0; color: #fff; border-radius: 7px; padding: 4px 12px; font-weight: 600; font-size: .82rem; cursor: pointer; white-space: nowrap; }
.flash-action:hover { background: rgba(255,255,255,.26); }
.is-installed #installBtn { display: none !important; }

/* ---------- Card footer: patch-window status + age ---------- */
.t-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.06); font-size: .7rem; }
.t-created { color: var(--text-faint, #8a8a93); white-space: nowrap; }
.pw { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.pw .ic { width: 12px; height: 12px; }
.pw-good   { background: rgba(55,214,122,.14);  color: #46e08a; }
.pw-warn   { background: rgba(255,159,67,.16);   color: #ffb15c; }
.pw-closed { background: rgba(255,84,112,.15);   color: #ff7d92; }

/* GitHub token scope guidance (admin settings) */
.gh-scopes { display:flex; flex-direction:column; gap:9px; margin:12px 0; }
.gh-scope { display:flex; align-items:flex-start; gap:11px; }
.gh-scope-tag { flex:none; display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:8px; font-size:.78rem; font-weight:600; white-space:nowrap; min-width:172px; }
.gh-scope-tag.read  { background:rgba(255,255,255,.06); color:var(--text-dim); border:1px solid var(--glass-border); }
.gh-scope-tag.write { background:rgba(55,214,122,.14); color:#37d67a; border:1px solid rgba(55,214,122,.34); }
.gh-scope .text-sm { padding-top:3px; }
@media(max-width:560px){ .gh-scope{ flex-direction:column; gap:3px; } .gh-scope-tag{ min-width:0; } }

/* AI bug assist (Claude) */
.ai-out { margin-top: 14px; }
.ai-busy { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--text-dim); padding: 6px 0; }
.ai-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(139,130,255,.3); border-top-color: #8B82FF; animation: ai-spin .7s linear infinite; flex: none; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-err { padding: 11px 13px; border-radius: 10px; background: rgba(255,107,107,.1); border: 1px solid rgba(255,107,107,.32); color: #ff9b9b; font-size: .88rem; }
.ai-card { border: 1px solid rgba(139,130,255,.3); background: rgba(139,130,255,.06); border-radius: 12px; padding: 14px; }
.ai-card-h { font-weight: 600; font-size: .82rem; letter-spacing: .02em; color: #c9c4ff; margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.ai-field { margin-bottom: 10px; }
.ai-field label { display: block; font-size: .76rem; color: var(--text-faint); margin-bottom: 4px; }
.ai-md { font-size: .9rem; line-height: 1.55; color: var(--text-dim); }
.ai-md h3, .ai-md h4, .ai-md h5 { margin: 12px 0 5px; font-size: .9rem; color: var(--text); }
.ai-md h3:first-child, .ai-md h4:first-child { margin-top: 0; }
.ai-md p { margin: 0 0 8px; }
.ai-md ul { margin: 4px 0 10px; padding-left: 20px; }
.ai-md li { margin-bottom: 3px; }
.ai-md code { background: rgba(255,255,255,.08); padding: 1px 5px; border-radius: 5px; font-size: .85em; }
.ai-md strong { color: var(--text); }

/* Player moderation card ("Beheer") */
.mod-card { padding: 18px 18px 20px; }
.mod-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.mod-ic { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); border: 1px solid rgba(139,130,255,.25); }
.mod { display: flex; flex-direction: column; gap: 18px; }
.mod-sec { display: flex; flex-direction: column; gap: 10px; }
.mod-label { display: flex; align-items: center; gap: 7px; font-size: .68rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; color: var(--text-faint); }
.mod-label.danger { color: #ff8f8f; }
.mod-label svg { opacity: .8; }
.mod-panel { background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); padding: 13px; margin: 0; }
.mod-compose { display: flex; gap: 8px; align-items: stretch; }

/* $ amount input */
.mod-amount { position: relative; flex: 1; display: flex; align-items: center; }
.mod-amount > span { position: absolute; left: 12px; color: var(--text-faint); font-weight: 600; pointer-events: none; }
.mod-amount .input { padding-left: 24px; width: 100%; }

/* action tiles */
.mod-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mod-grid2 form { margin: 0; }
.mod-tile { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; padding: 11px 13px; border-radius: var(--radius-sm); background: var(--glass-2); border: 1px solid var(--glass-border); color: var(--text); cursor: pointer; transition: transform .14s ease, background .14s ease, border-color .14s ease; }
.mod-tile:hover:not(:disabled) { background: rgba(255,255,255,.09); border-color: var(--glass-border-strong); transform: translateY(-1px); }
.mod-tile:active:not(:disabled) { transform: translateY(0); }
.mod-tile:disabled { opacity: .4; cursor: not-allowed; }
.mod-tile-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); border: 1px solid rgba(139,130,255,.22); }
.mod-tile-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.mod-tile-body b { font-size: .88rem; font-weight: 600; line-height: 1.2; }
.mod-tile-body small { font-size: .73rem; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* danger zone */
.mod-danger { display: flex; flex-direction: column; gap: 10px; padding: 13px; border-radius: var(--radius-sm); border: 1px solid rgba(255,107,107,.22); background: rgba(255,107,107,.045); }
.mod-tile.danger .mod-tile-ic { background: rgba(255,107,107,.13); color: var(--danger); border-color: rgba(255,107,107,.3); }
.mod-tile.danger:hover:not(:disabled) { background: rgba(255,107,107,.09); border-color: rgba(255,107,107,.45); }

/* recent actions */
.mod-log { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.mod-log:last-child { border-bottom: 0; }
.mod-log form { margin: 0; flex: none; }
.mod-st { flex: none; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(255,255,255,.04); }
.mod-st.pending { background: var(--warn); }
.mod-st.done { background: var(--ok); }
.mod-st.failed { background: var(--danger); }
.mod-st.canceled { background: var(--text-faint); }
