/* ════════════════════════════════════════════════════════════
   GALAXY DASHBOARD — modern, professional, galaxy-inspired theme
   No frosted glass: solid space panels, hairline borders,
   restrained depth, FontAwesome iconography.
   ════════════════════════════════════════════════════════════ */
:root {
    /* space surfaces */
    --bg: #05060f;
    --bg-2: #080a1a;
    --panel: #0b0e20;
    --panel-2: #0f132a;
    --panel-hi: #141934;
    --inset: #070912;

    /* lines */
    --border: #1c2142;
    --border-soft: #161a35;
    --border-strong: #2c336b;

    /* text */
    --text: #e8eaff;
    --text-dim: #8b91bf;
    --text-faint: #5f658f;

    /* accents — refined violet → indigo with a cool cyan spark */
    --primary: #6d5bff;
    --primary-2: #4c34e0;
    --primary-soft: rgba(109, 91, 255, 0.14);
    --accent: #34c8ff;
    --accent-2: #6ee7ff;
    --success: #34d399;
    --danger: #f6597b;
    --warn: #fbbf5c;

    --grad: linear-gradient(135deg, #7b6bff 0%, #4c34e0 100%);
    --grad-accent: linear-gradient(135deg, #6d5bff 0%, #34c8ff 100%);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 8px 28px -12px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 24px 60px -24px rgba(0, 0, 0, 0.85);
    --ring: 0 0 0 3px rgba(109, 91, 255, 0.22);

    --radius: 14px;
    --radius-sm: 10px;
    --font-display: "Space Grotesk", system-ui, sans-serif;
    --font-body: "Inter", system-ui, sans-serif;
}

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

html, body { height: 100%; }

body {
    font-family: var(--font-body);
    background:
        radial-gradient(1200px 700px at 78% -8%, #16143a 0%, rgba(22, 20, 58, 0) 58%),
        radial-gradient(1000px 620px at 12% 8%, #0c1c3a 0%, rgba(12, 28, 58, 0) 55%),
        var(--bg);
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    letter-spacing: 0.01em;
}

/* ─── space backdrop ─────────────────────────────────────── */
#stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.7; }

.nebula {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.08;
    z-index: 0;
    pointer-events: none;
    animation: drift 32s ease-in-out infinite alternate;
}

.nebula-1 { width: 560px; height: 560px; background: #5b3fd6; top: -200px; right: -120px; }
.nebula-2 { width: 480px; height: 480px; background: #1170a8; bottom: -180px; left: -150px; animation-delay: -10s; }
.nebula-3 { width: 360px; height: 360px; background: #7a1f5c; top: 42%; left: 56%; opacity: 0.1; animation-delay: -20s; }

@keyframes drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(36px, -26px, 0) scale(1.12); }
}

#app { position: relative; z-index: 1; min-height: 100vh; }

/* icons */
.fa-solid, .fa-regular, .fa-brands { line-height: 1; }

/* ─── boot loader ────────────────────────────────────────── */
.boot-loader {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    color: var(--text-dim);
    font-family: var(--font-display);
    letter-spacing: 0.04em;
}

.orbit-spinner { position: relative; width: 58px; height: 58px; }

.orbit-spinner span {
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
}

.orbit-spinner span:nth-child(2) { inset: 8px; border-top-color: var(--accent); animation-duration: 0.9s; animation-direction: reverse; }
.orbit-spinner span:nth-child(3) { inset: 16px; border-top-color: var(--primary-2); animation-duration: 0.6s; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── login hero ─────────────────────────────────────────── */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    gap: 20px;
}

.hero img.bot-avatar {
    width: 104px;
    height: 104px;
    border-radius: 28px;
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg), 0 0 0 6px rgba(109, 91, 255, 0.06);
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 6vw, 3.4rem);
    font-weight: 700;
    background: linear-gradient(180deg, #ffffff 0%, #c4bff0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.025em;
}

.hero p { color: var(--text-dim); max-width: 480px; line-height: 1.65; }

.hero .stats-strip { display: flex; gap: 12px; margin-top: 4px; flex-wrap: wrap; justify-content: center; }

.stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.84rem;
    color: var(--text-dim);
}

.stat-pill i { color: var(--accent); font-size: 0.8rem; }
.stat-pill b { color: var(--text); font-family: var(--font-display); font-weight: 600; }

/* ─── buttons ────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.92rem;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    color: #fff;
    background: var(--grad);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s, background 0.14s;
    text-decoration: none;
    white-space: nowrap;
}

.btn i { font-size: 0.9em; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 14px 34px -14px rgba(109, 91, 255, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.14); }
.btn:active { transform: translateY(0); }

.btn.ghost {
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    color: var(--text);
}
.btn.ghost:hover { border-color: var(--border-strong); background: var(--panel-hi); filter: none; }

.btn.danger { background: linear-gradient(135deg, #ff5d7c, #d12350); box-shadow: 0 10px 26px -14px rgba(246, 89, 123, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.14); }

.btn.small { padding: 7px 14px; font-size: 0.8rem; border-radius: 9px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; filter: none; }

/* ─── topbar ─────────────────────────────────────────────── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 13px 26px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.topbar .brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.08rem;
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--text);
    text-decoration: none;
}

.topbar .brand img { width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--border-strong); }
.topbar .spacer { flex: 1; }

.topbar .user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 8px 5px 5px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.85rem;
}

.topbar .user-chip img { width: 28px; height: 28px; border-radius: 50%; }

.topbar a.logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-dim);
    font-size: 0.8rem;
    text-decoration: none;
    margin-left: 6px;
    padding-right: 6px;
}
.topbar a.logout:hover { color: var(--danger); }

/* ─── page wrapper / guild picker ────────────────────────── */
.page { max-width: 1180px; margin: 0 auto; padding: 40px 26px 80px; }

.page-title { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.01em; }
.page-sub { color: var(--text-dim); margin-bottom: 30px; }

.guild-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
    gap: 16px;
}

.guild-card {
    position: relative;
    background: linear-gradient(180deg, var(--panel-2) 0%, var(--panel) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px 20px 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, border-color 0.18s, box-shadow 0.18s;
    overflow: hidden;
}

.guild-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(125, 110, 255, 0.55), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}

.guild-card:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.guild-card:hover::before { opacity: 1; }

.guild-card img, .guild-card .icon-fallback {
    width: 70px;
    height: 70px;
    border-radius: 20px;
    border: 1px solid var(--border-strong);
    object-fit: cover;
}

.guild-card .icon-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.4rem;
    color: #fff;
    background: var(--grad);
}

.guild-card h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 600; }

/* ─── dashboard layout ───────────────────────────────────── */
.dash { display: flex; min-height: calc(100vh - 60px); }

.sidebar {
    width: 270px;
    flex-shrink: 0;
    padding: 18px 14px 40px;
    border-right: 1px solid var(--border-soft);
    /* solid dark sidebar panel */
    background: var(--bg-2);
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }

.sidebar .guild-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 16px;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 14px;
}

.sidebar .guild-head img, .sidebar .guild-head .icon-fallback {
    width: 44px; height: 44px; border-radius: 13px;
    border: 1px solid var(--border-strong);
    object-fit: cover;
}

.sidebar .guild-head .icon-fallback {
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 600; color: #fff;
    background: var(--grad);
}

.sidebar .guild-head h4 { font-family: var(--font-display); font-size: 0.95rem; font-weight: 600; line-height: 1.25; }
.sidebar .guild-head a { display: inline-flex; align-items: center; gap: 5px; font-size: 0.74rem; color: var(--accent); text-decoration: none; margin-top: 3px; }
.sidebar .guild-head a:hover { color: var(--accent-2); }

.nav-section { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--text-faint); padding: 14px 12px 7px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 7px 9px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: none;
    color: var(--text-dim);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    margin-bottom: 2px;
    transition: background 0.14s, color 0.14s, border-color 0.14s;
}

.nav-item:hover { background: var(--panel); color: var(--text); }

.nav-item.active {
    background: var(--primary-soft);
    border-color: var(--border-strong);
    color: var(--text);
}

.nav-item .ico {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--panel-hi);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.82rem;
    transition: background 0.14s, color 0.14s, border-color 0.14s;
}

.nav-item:hover .ico { color: var(--text); }

.nav-item.active .ico {
    background: var(--grad);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 14px -6px rgba(109, 91, 255, 0.8);
}

.content { flex: 1; padding: 36px 40px 90px; display: flex; flex-direction: column; min-width: 0; }
.content > * { width: 100%; max-width: 1040px; margin: 0 auto; }

/* ─── icon badge (page / module headers) ─────────────────── */
.head-ico {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--grad);
    color: #fff;
    font-size: 1.05rem;
    box-shadow: 0 8px 20px -10px rgba(109, 91, 255, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* ─── overview ───────────────────────────────────────────── */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); gap: 14px; margin-top: 24px; }

.stat-card {
    position: relative;
    background: linear-gradient(180deg, var(--panel-2) 0%, var(--panel) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: border-color 0.18s, transform 0.18s;
}

.stat-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }

.stat-card .ico {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: 10px;
    background: var(--primary-soft);
    border: 1px solid var(--border-strong);
    color: var(--accent);
    font-size: 0.86rem;
    margin-bottom: 14px;
}

.stat-card .num { font-family: var(--font-display); font-size: 1.85rem; font-weight: 700; line-height: 1; }
.stat-card .lbl { color: var(--text-dim); font-size: 0.8rem; margin-top: 6px; }

/* ─── module form ────────────────────────────────────────── */
.module-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; flex-wrap: wrap; }
.module-head h2 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; display: flex; gap: 13px; align-items: center; letter-spacing: -0.01em; }
.module-desc { color: var(--text-dim); margin-bottom: 24px; font-size: 0.92rem; max-width: 70ch; line-height: 1.55; }

.module-note {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    margin: 0 0 22px;
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    border-left: 3px solid var(--accent);
    background: rgba(52, 200, 255, 0.06);
    color: #bfe9ff;
    font-size: 0.85rem;
    line-height: 1.5;
}
.module-note i { color: var(--accent); margin-top: 2px; }

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 28px 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}

.card h3.section-title {
    font-family: var(--font-display);
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent);
    padding: 18px 0 6px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border-soft);
}

.field { display: flex; flex-direction: column; gap: 8px; padding: 15px 0; border-bottom: 1px solid var(--border-soft); }
.field:last-child { border-bottom: none; }
.field label.fname { font-weight: 600; font-size: 0.9rem; display: flex; align-items: center; gap: 9px; }
.field label.fname .fname-head { display: flex; align-items: center; gap: 9px; }
.field label.fname > i, .field label.fname .fname-head > i { color: var(--text-dim); width: 16px; text-align: center; font-size: 0.85rem; }
.field .fhelp { font-size: 0.78rem; color: var(--text-faint); line-height: 1.45; }

.field.inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; }
.field.inline label.fname { flex: 1; flex-direction: column; align-items: flex-start; gap: 5px; }
.field.inline label.fname .fhelp { font-weight: 400; }

input[type="text"], input[type="number"], textarea, select {
    width: 100%;
    background: var(--inset);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 13px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.89rem;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:hover, textarea:hover, select:hover { border-color: var(--border-strong); }
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: var(--ring); background: var(--bg-2); }
textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
select { cursor: pointer; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%238b91bf'><path d='M4.5 6l3.5 4 3.5-4z'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
select option { background: var(--panel); color: var(--text); }
input[type="color"] { width: 56px; height: 38px; padding: 3px; border: 1px solid var(--border); border-radius: 9px; background: var(--inset); cursor: pointer; }

/* toggle switch */
.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }

.switch .track {
    position: absolute;
    inset: 0;
    background: var(--panel-hi);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s;
}

.switch .track::before {
    content: "";
    position: absolute;
    width: 18px; height: 18px;
    left: 3px; top: 3px;
    border-radius: 50%;
    background: #9aa0cf;
    transition: transform 0.18s, background 0.18s;
}

.switch input:checked + .track {
    background: var(--grad);
    border-color: transparent;
}

.switch input:checked + .track::before { transform: translateX(20px); background: #fff; }
.switch input:focus-visible + .track { box-shadow: var(--ring); }

/* chips (multi select / list) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 7px 6px 12px;
    background: var(--primary-soft);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    font-size: 0.8rem;
}

.chip button {
    display: grid; place-items: center;
    width: 18px; height: 18px;
    background: rgba(255, 255, 255, 0.06);
    border: none; border-radius: 50%;
    color: var(--text-dim); cursor: pointer;
    font-size: 0.7rem; line-height: 1; padding: 0;
    transition: background 0.14s, color 0.14s;
}
.chip button:hover { background: var(--danger); color: #fff; }
.chips-add { display: flex; gap: 8px; margin-top: 10px; }
.chips-add select, .chips-add input { flex: 1; }

/* command list / repeating rows */
.row-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 12px;
    background: var(--inset);
    display: grid;
    gap: 10px;
}

.row-top { display: flex; gap: 10px; align-items: center; }
/* text fields and selects share the free space; number fields stay compact */
.row-top > input[type="text"], .row-top > select { flex: 1 1 0; min-width: 0; }
.row-top > input[type="number"] { flex: 0 0 auto; width: 96px; }

/* number field with a trailing unit label (e.g. "30  sec") */
.num-unit { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.num-unit input[type="number"] { width: 84px; flex: none; }
.num-unit .unit { color: var(--text-dim); font-size: 0.82rem; font-family: var(--font-display); font-weight: 500; }

/* the row remove button matches the field height and sheds the table icon-btn margin */
.row-top > .icon-btn { flex: 0 0 auto; width: 38px; height: 38px; margin-left: 0; font-size: 0.85rem; }

.save-bar {
    position: sticky;
    bottom: 20px;
    background: var(--panel-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 12px 24px;
    box-shadow: var(--shadow-lg);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    z-index: 50;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* toast */
#toast-zone { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 10px; }

.toast {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 22px;
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.88rem;
    border: 1px solid var(--border-strong);
    background: var(--panel-hi);
    box-shadow: var(--shadow-lg);
    animation: toast-in 0.25s ease;
}

.toast i { font-size: 1rem; }
.toast.ok { border-left: 3px solid var(--success); }
.toast.ok i { color: var(--success); }
.toast.err { border-left: 3px solid var(--danger); }
.toast.err i { color: var(--danger); }

@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* empty / error states */
.empty {
    text-align: center;
    padding: 72px 20px;
    color: var(--text-dim);
}

.empty .big {
    display: inline-grid;
    place-items: center;
    width: 78px; height: 78px;
    margin-bottom: 18px;
    border-radius: 22px;
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--text-faint);
    font-size: 1.9rem;
}

.empty h2 { font-family: var(--font-display); font-weight: 700; }

/* responsive */
@media (max-width: 860px) {
    .dash { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; display: flex; flex-wrap: wrap; gap: 4px; border-right: none; border-bottom: 1px solid var(--border); }
    .sidebar .guild-head { width: 100%; }
    .nav-section { width: 100%; }
    .nav-item { width: auto; }
    .content { padding: 26px 18px 70px; }
}

/* ─── moderation logs table ─── */
.log-filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
    flex-wrap: wrap;
}
.log-filter-bar input {
    flex: 1;
    min-width: 200px;
}
.log-filter-bar select {
    width: auto;
    min-width: 150px;
}
.log-table-container {
    overflow-x: auto;
    margin-top: 10px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: var(--inset);
}
.log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    color: var(--text);
}
.log-table th, .log-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
}
.log-table th {
    background: var(--panel-2);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
}
.log-table tr:last-child td {
    border-bottom: none;
}
.log-table tbody tr:hover td {
    background: var(--panel-2);
}
.log-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid transparent;
}
.log-badge.warning {
    background: rgba(251, 191, 92, 0.08);
    color: var(--warn);
    border-color: rgba(251, 191, 92, 0.25);
}
.log-badge.kick {
    background: rgba(246, 89, 123, 0.08);
    color: #ff8834;
    border-color: rgba(246, 89, 123, 0.25);
}
.log-badge.ban {
    background: rgba(246, 89, 123, 0.12);
    color: var(--danger);
    border-color: rgba(246, 89, 123, 0.35);
}
.log-badge.mute {
    background: rgba(109, 91, 255, 0.08);
    color: #a78bfa;
    border-color: rgba(109, 91, 255, 0.25);
}
.log-badge.timeout {
    background: rgba(52, 200, 255, 0.08);
    color: var(--accent);
    border-color: rgba(52, 200, 255, 0.25);
}
.log-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.log-user-info img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border-soft);
}
.log-user-info span.tag {
    font-size: 0.85rem;
    font-weight: 500;
}
.log-user-info span.id {
    font-size: 0.76rem;
    color: var(--text-faint);
}
.log-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
    flex-wrap: wrap;
    gap: 10px;
}
.log-pagination-info {
    font-size: 0.8rem;
    color: var(--text-dim);
}
.log-pagination-controls {
    display: flex;
    gap: 6px;
}

/* ════════════════════════════════════════════════════════════
   PREMIUM + ADMIN PANEL
   ════════════════════════════════════════════════════════════ */

/* topbar links */
.topnav-link {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px; margin-right: 10px;
    border-radius: var(--radius-sm);
    color: var(--text-dim); text-decoration: none;
    font-weight: 600; font-size: .9rem;
    border: 1px solid var(--border-soft);
    transition: .15s;
}
.topnav-link:hover { color: var(--text); border-color: var(--border-strong); background: var(--panel-2); }
.topnav-link.admin { color: var(--accent); border-color: rgba(52, 200, 255, .3); }

/* premium gem icon reads gold wherever it appears in navigation */
.topnav-link .fa-gem { color: #f3cf78; }
.nav-item:not(.active) .ico .fa-gem { color: #f3cf78; }

/* admin sidebar logo */
.admin-logo {
    width: 42px; height: 42px; border-radius: 12px;
    display: grid; place-items: center;
    background: var(--grad); color: #fff; font-size: 1.1rem;
}

/* premium badge — the plan "pill" shown on the premium pages + admin list */
.prem-badge {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 8px 16px 8px 13px; border-radius: 11px;
    font-family: var(--font-display); font-weight: 600; font-size: .95rem;
    letter-spacing: -0.005em; color: #fff;
    background:
        linear-gradient(135deg,
            color-mix(in srgb, var(--pc, var(--primary)) 30%, var(--panel)),
            color-mix(in srgb, var(--pc, var(--primary)) 12%, var(--panel)));
    border: 1px solid color-mix(in srgb, var(--pc, var(--primary)) 50%, transparent);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.07),
        0 10px 26px -18px color-mix(in srgb, var(--pc, var(--primary)) 90%, transparent);
}
.prem-badge i {
    font-size: 0.9em;
    color: color-mix(in srgb, var(--pc, var(--primary)) 70%, #fff);
    filter: drop-shadow(0 0 7px color-mix(in srgb, var(--pc, var(--primary)) 65%, transparent));
}
.prem-badge.sm { padding: 4px 11px 4px 9px; gap: 7px; font-size: .82rem; border-radius: 8px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.prem-badge.sm i { font-size: .85em; }

/* small inline "premium" tag shown next to gated form fields */
.prem-tag {
    display: inline-flex; align-items: center; gap: 5px;
    margin-left: 8px; padding: 2px 9px 2px 8px;
    border-radius: 6px; font-size: .64rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .07em; white-space: nowrap;
    color: #f3cf78;
    background: linear-gradient(180deg, rgba(243, 207, 120, 0.16), rgba(243, 207, 120, 0.07));
    border: 1px solid rgba(243, 207, 120, 0.3);
}
.prem-tag i { font-size: .82em; opacity: .92; }

/* a premium-gated section the current guild hasn't unlocked */
.row-item.locked > div > .row-top { opacity: .55; }
.lock-note {
    display: flex; align-items: center; gap: 7px;
    margin: 4px 0 12px; font-size: .8rem; color: #f3cf78;
}
.lock-note i { font-size: .82em; }
.lock-note a { color: #f3cf78; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.lock-note a:hover { color: #ffe1a0; }

.feat-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.chip {
    padding: 4px 11px; border-radius: 999px; font-size: .8rem;
    background: var(--primary-soft); color: var(--text); border: 1px solid var(--border);
}
.redeem-row { display: flex; gap: 10px; flex-wrap: wrap; }
.redeem-row input { flex: 1; min-width: 220px; }

/* head with right-aligned actions */
.module-head.spread, .spread { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 8px; }
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.search-input { flex: 1; min-width: 220px; }

/* data tables */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th {
    text-align: left; padding: 10px 12px; color: var(--text-faint);
    font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em;
    border-bottom: 1px solid var(--border);
}
.data-table td { padding: 11px 12px; border-bottom: 1px solid var(--border-soft); color: var(--text-dim); vertical-align: middle; }
.data-table tr:hover td { background: var(--panel-2); }
.data-table code { color: var(--accent-2); font-size: .85rem; }
.muted { color: var(--text-faint); }
.muted.sm, .sm { font-size: .8rem; }

/* tags */
.tag {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600;
    background: var(--panel-hi); color: var(--text-dim); border: 1px solid var(--border);
}
.tag.user { color: var(--accent); border-color: rgba(52,200,255,.3); }
.tag.guild { color: var(--warn); border-color: rgba(251,191,92,.3); }
.tag.ok { color: var(--success); border-color: rgba(52,211,153,.3); }
.tag.off { color: var(--text-faint); }

/* icon buttons */
.icon-btn {
    display: inline-grid; place-items: center;
    background: var(--panel-hi); border: 1px solid var(--border);
    color: var(--text-dim); width: 32px; height: 32px; border-radius: 8px;
    font-size: .82rem; line-height: 1;
    cursor: pointer; margin-left: 5px; transition: .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }

.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }

/* admin guild cards */
.admin-guild { cursor: pointer; }
.admin-guild .tag { margin-top: 8px; }

/* key/value rows in modals */
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.kv > span:first-child { color: var(--text-faint); }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.user-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.user-avatar-lg { width: 56px; height: 56px; border-radius: 14px; }

/* feature picker */
.feat-picker { display: flex; flex-direction: column; gap: 14px; max-height: 320px; overflow-y: auto; padding: 4px; }
.feat-cat { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); margin-bottom: 6px; }
.feat-group { border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 10px 12px; }
.feat-item { display: flex; align-items: center; gap: 8px; padding: 5px 0; cursor: pointer; color: var(--text-dim); }
.feat-item:hover { color: var(--text); }
.inline-row { display: flex; gap: 10px; align-items: center; }

/* modal */
.modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(3, 4, 12, .72);
    display: grid; place-items: center; padding: 20px;
    backdrop-filter: blur(3px);
}
.modal-card {
    background: var(--panel); border: 1px solid var(--border-strong);
    border-radius: var(--radius); width: 100%; max-width: 480px;
    box-shadow: var(--shadow-lg); max-height: 90vh; display: flex; flex-direction: column;
}
.modal-card.wide { max-width: 640px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-family: var(--font-display); }
.modal-x { background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 1.1rem; }
.modal-x:hover { color: var(--text); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-body .field { margin-bottom: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }
.modal-err { margin: 0 20px; margin-top: 14px; padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(246,89,123,.12); color: var(--danger); font-size: .85rem; border: 1px solid rgba(246,89,123,.3); }
.btn.danger, .btn.ghost.danger { color: var(--danger); border-color: rgba(246,89,123,.4); }
.btn.ghost.danger:hover { background: rgba(246,89,123,.1); }
