/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0f1117;
    --bg-secondary: #161923;
    --bg-card: #1c1f2e;
    --bg-row-hover: #252840;
    --bg-input: #1c1f2e;
    --border: #2a2d3e;
    --text-primary: #e4e4e7;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --green: #22c55e;
    --yellow: #eab308;
    --red: #ef4444;
    --orange: #f97316;
    --cyan: #06b6d4;
    --font-mono: "JetBrains Mono", "Fira Code", "SF Mono", "Cascadia Code", monospace;
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --radius: 8px;
    --radius-lg: 12px;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s;
}

a:hover {
    color: var(--accent-hover);
}

/* ===== Layout ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Header ===== */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 24px 0;
    margin-bottom: 32px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-primary);
}

.header h1 span {
    color: var(--accent);
}

.header-stats {
    display: flex;
    gap: 24px;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-badge .value {
    color: var(--text-primary);
    font-weight: 600;
    font-family: var(--font-mono);
}

/* ===== Search & Controls ===== */
.controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-sans);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.search-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.page-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

/* ===== Filter Bar ===== */
.filter-bar {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    white-space: nowrap;
    line-height: 32px;
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-sans);
    opacity: 0.5;
}

.filter-pill:hover {
    opacity: 0.8;
}

.filter-pill.active {
    opacity: 1;
    box-shadow: 0 0 0 1px currentColor;
}

.filter-pill-all {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.filter-pill-all.active {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--text-secondary);
    box-shadow: none;
}

/* ===== Table ===== */
.table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-secondary);
}

thead th {
    padding: 14px 20px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    user-select: none;
}

thead th a {
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

thead th a:hover {
    color: var(--text-primary);
}

thead th.sorted a {
    color: var(--accent);
}

.sort-arrow {
    font-size: 0.65rem;
    opacity: 0.5;
}

thead th.sorted .sort-arrow {
    opacity: 1;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--bg-row-hover);
}

tbody td {
    padding: 12px 20px;
    font-size: 0.9rem;
    vertical-align: middle;
}

.col-rank {
    width: 60px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.col-player {
    min-width: 200px;
}

.player-name {
    font-weight: 500;
    color: var(--text-primary);
}

.player-steamid {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-top: 2px;
}

.col-group {
    width: 150px;
}

.group-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
    text-transform: capitalize;
}

.group-superadmin {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.group-director {
    background: rgba(244, 63, 94, 0.15);
    color: #f43f5e;
    border: 1px solid rgba(244, 63, 94, 0.25);
}

.group-management {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.25);
}

.group-admin {
    background: rgba(249, 115, 22, 0.15);
    color: var(--orange);
    border: 1px solid rgba(249, 115, 22, 0.25);
}

.group-moderator {
    background: rgba(234, 179, 8, 0.15);
    color: var(--yellow);
    border: 1px solid rgba(234, 179, 8, 0.25);
}

.group-vip {
    background: rgba(6, 182, 212, 0.15);
    color: var(--cyan);
    border: 1px solid rgba(6, 182, 212, 0.25);
}

.group-member {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.group-user {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-muted);
    border: 1px solid rgba(107, 114, 128, 0.2);
}

.group-default {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.col-wallet {
    width: 150px;
    font-family: var(--font-mono);
    color: var(--green);
    font-weight: 500;
}

.col-playtime {
    width: 140px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.col-lastseen {
    width: 140px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px 0 48px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-family: var(--font-mono);
    transition: all 0.15s;
}

.pagination a {
    color: var(--text-secondary);
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.pagination a:hover {
    background: var(--bg-row-hover);
    color: var(--text-primary);
    border-color: var(--accent);
}

.pagination .current {
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
    font-weight: 600;
}

.pagination .disabled {
    color: var(--text-muted);
    opacity: 0.4;
    pointer-events: none;
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.pagination .ellipsis {
    color: var(--text-muted);
    border: none;
    background: none;
    cursor: default;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 64px 20px;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 24px 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: 32px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: none;
    }

    .page-info {
        text-align: center;
    }

    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 850px;
    }

    thead th,
    tbody td {
        padding: 10px 14px;
    }
}