/* ============================================================
   koendb.nl — Main Stylesheet (Dark + Light themes)
   ============================================================ */

/* --- CSS Variables (Dark — default) --- */
:root,
[data-theme="dark"] {
    --bg-primary: #0a0b0e;
    --bg-secondary: #141519;
    --bg-elevated: #1e1f25;
    --bg-input: #1a1b22;
    --border: #2a2b32;
    --border-light: #35363d;

    --text-primary: #e8e8ed;
    --text-secondary: #8e8e9a;
    --text-muted: #6b6b76;

    --accent: #6c5ce7;
    --accent-hover: #7d6ff0;
    --accent-glow: rgba(108, 92, 231, 0.25);
    --secondary: #00cec9;
    --secondary-hover: #0de0db;
    --secondary-glow: rgba(0, 206, 201, 0.25);

    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #e17055;
    --info: #74b9ff;

    --success-bg: rgba(0, 184, 148, 0.12);
    --warning-bg: rgba(253, 203, 110, 0.12);
    --danger-bg: rgba(225, 112, 85, 0.12);
    --info-bg: rgba(116, 185, 255, 0.12);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;

    --topbar-height: 64px;
    --sidebar-width: 250px;
}

/* --- Light Theme --- */
[data-theme="light"] {
    --bg-primary: #f0f0f5;
    --bg-secondary: #ffffff;
    --bg-elevated: #f8f8fc;
    --bg-input: #eeeeff;
    --border: #dcdce6;
    --border-light: #e8e8f0;

    --text-primary: #1a1a2e;
    --text-secondary: #5a5a6e;
    --text-muted: #8a8a9a;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
}

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

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

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

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

img, svg { max-width: 100%; display: block; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* --- Top Bar --- */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.topbar-inner {
    padding: 0;
    height: 100%;
    display: flex;
    align-items: center;
}

.topbar-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    transition: opacity 0.2s;
    padding: 0 14px;
    height: 100%;
}
.topbar-logo:hover { opacity: 0.8; }

.logo-svg {
    width: 36px;
    height: 36px;
}

.topbar-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    flex: 1;
}

.topbar-spacer {
    flex: 1;
}

/* --- Navigation --- */
.topbar-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    padding-right: 4px;
    margin-left: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}
.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.icon-nav {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.avatar-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-profile {
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-logout {
    color: var(--text-muted);
}

/* --- Icon Button --- */
.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.icon-btn:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}
.icon-btn svg {
    width: 20px;
    height: 20px;
}

/* --- Theme Toggle --- */
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* --- Mobile Menu --- */
.mobile-menu-toggle { display: none; margin-left: auto; }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    color: #fff;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--accent-glow);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    border-color: var(--accent);
    background: var(--bg-input);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover {
    opacity: 0.9;
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-icon { padding: 8px; }

/* --- Main Content --- */
.main-content {
    margin-top: var(--topbar-height);
    flex: 1;
}

/* --- Construction Wall --- */
.construction-wall {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--topbar-height) - 60px);
    padding: 40px 24px;
    text-align: center;
}

.construction-svg {
    width: 200px;
    height: 200px;
    margin-bottom: 32px;
}

.construction-heading {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 700;
    color: var(--danger);
    margin-bottom: 12px;
}

.construction-text {
    color: var(--text-secondary);
    font-size: 16px;
    max-width: 480px;
    line-height: 1.7;
}

/* --- Error Page --- */
.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--topbar-height) - 60px);
    padding: 40px 24px;
    text-align: center;
    gap: 12px;
}

.error-icon { width: 120px; height: 120px; margin-bottom: 8px; }
.error-heading { font-family: var(--font-display); font-size: 28px; color: var(--danger); }
.error-text { color: var(--text-secondary); font-size: 16px; }

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

.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

/* --- Cards --- */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
    border-color: var(--border-light);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
}

.card-body { }

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all 0.2s;
}
.stat-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }

.stat-icon-accent { background: var(--accent-glow); color: var(--accent); }
.stat-icon-success { background: var(--success-bg); color: var(--success); }
.stat-icon-warning { background: var(--warning-bg); color: var(--warning); }
.stat-icon-danger { background: var(--danger-bg); color: var(--danger); }
.stat-icon-info { background: var(--info-bg); color: var(--info); }

.stat-content { flex: 1; }
.stat-value { font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.stat-label { color: var(--text-secondary); font-size: 13px; }

/* --- Forms --- */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px var(--danger-bg);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8e9a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* --- Alert / Flash Messages --- */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert svg { width: 20px; height: 20px; flex-shrink: 0; }

.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning); }
.alert-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }
.alert-info { background: var(--info-bg); color: var(--info); border: 1px solid var(--info); }

/* --- Tables --- */
.table-wrap {
    overflow-x: auto;
}

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

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

th {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    background: var(--bg-elevated);
}

tr:hover td {
    background: var(--bg-elevated);
}

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-owner { background: linear-gradient(135deg, #ffd700, #ffaa00); color: #1a1a2e; }
.badge-superadmin { background: linear-gradient(135deg, var(--accent), var(--danger)); color: #fff; }
.badge-admin { background: var(--accent); color: #fff; }
.badge-playeradmin { background: var(--secondary); color: #0a0b0e; }
.badge-moderator { background: var(--info); color: #0a0b0e; }
.badge-player { background: var(--success); color: #fff; }
.badge-tester { background: var(--warning); color: #1a1a2e; }
.badge-user { background: var(--border); color: var(--text-secondary); }

.status-open { color: var(--success); }
.status-progress { color: var(--warning); }
.status-closed { color: var(--text-muted); }

/* --- Admin Layout --- */
.admin-layout {
    display: flex;
    min-height: calc(100vh - var(--topbar-height));
}

.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 20px 0;
    flex-shrink: 0;
    position: sticky;
    top: var(--topbar-height);
    height: calc(100vh - var(--topbar-height));
    overflow-y: auto;
}

.admin-sidebar-label {
    padding: 8px 24px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-top: 16px;
}

.admin-sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}
.admin-sidebar-link:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}
.admin-sidebar-link.active {
    color: var(--accent);
    background: var(--accent-glow);
    border-left-color: var(--accent);
}
.admin-sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }

.admin-content {
    flex: 1;
    padding: 32px;
    max-width: calc(100% - var(--sidebar-width));
}

/* --- Dashboard Quick Actions --- */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    text-align: center;
}
.quick-action-btn:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.quick-action-btn svg { width: 28px; height: 28px; color: var(--accent); }

/* --- Tabs --- */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
    overflow-x: auto;
    gap: 0;
}

.tab-btn {
    padding: 12px 20px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* --- Modal --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 560px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}
.modal-close:hover { color: var(--text-primary); }
.modal-close svg { width: 22px; height: 22px; }

/* --- Role Dropdown --- */
.role-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.role-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px 2px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.2s;
}
.role-tag .remove-role {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(0,0,0,0.3);
    cursor: pointer;
    font-size: 10px;
    line-height: 1;
}
.role-tag .remove-role:hover { background: rgba(0,0,0,0.5); }

/* --- Login/Register Layout --- */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--topbar-height) - 60px);
    padding: 40px 24px;
}

.auth-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
}

.auth-title {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4px;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
    margin-bottom: 28px;
}

.auth-divider {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin: 20px 0;
    position: relative;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

/* --- Profile Page --- */
.profile-card {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    color: #fff;
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.profile-username {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
}

.profile-roles {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin: 12px 0 20px;
}

.profile-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    text-align: left;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.profile-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.profile-meta-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}
.profile-meta-value {
    font-size: 14px;
    color: var(--text-primary);
}

/* --- Ticket System --- */
.ticket-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ticket-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.2s;
    cursor: pointer;
}
.ticket-item:hover {
    border-color: var(--accent);
}

.ticket-item-subject {
    flex: 1;
    font-weight: 500;
}

.ticket-item-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.ticket-thread {
    max-width: 720px;
    margin: 0 auto;
}

.ticket-message {
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
}

.ticket-message-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.ticket-message-author {
    font-weight: 600;
    font-size: 14px;
}

.ticket-message-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}

.ticket-message-body {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-primary);
    white-space: pre-wrap;
}

/* --- Settings Page --- */
.settings-section {
    margin-bottom: 32px;
}

.settings-section-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

/* --- Database Stats --- */
.db-stat-bar {
    height: 8px;
    background: var(--bg-elevated);
    border-radius: 4px;
    overflow: hidden;
    margin: 12px 0;
}

.db-stat-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--accent), var(--secondary));
    transition: width 0.6s ease;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
}

.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.pagination a:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}
.pagination .active {
    background: var(--accent);
    color: #fff;
}

/* --- Footer --- */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 20px 24px;
    text-align: center;
}

.footer-text {
    font-size: 13px;
    color: var(--text-muted);
}

/* --- Grid layouts --- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
}
.empty-state svg {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    opacity: 0.4;
}
.empty-state h3 {
    font-family: var(--font-display);
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* --- Search Bar --- */
.search-bar {
    position: relative;
    max-width: 400px;
}
.search-bar input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.search-bar input:focus { border-color: var(--accent); }
.search-bar svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

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

/* --- Responsive --- */
@media (max-width: 1024px) {
    .admin-sidebar { width: 200px; }
    .admin-content { padding: 24px; }
}

@media (max-width: 768px) {
    .topbar-nav .nav-link span { display: none; }
    .nav-profile span { display: none !important; }

    .mobile-menu-toggle { display: flex !important; }

    .topbar-nav {
        display: none;
        position: absolute;
        top: var(--topbar-height);
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 12px;
        box-shadow: var(--shadow-lg);
    }
    .topbar-nav.open { display: flex; }
    .topbar-nav .nav-link { padding: 12px; }
    .topbar-nav .nav-link span { display: inline !important; }

    .admin-layout { flex-direction: column; }
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 12px;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }
    .admin-sidebar-label { display: none; }
    .admin-sidebar-link { padding: 8px 14px; border-left: none; border-radius: var(--radius-md); }
    .admin-sidebar-link.active { border-left: none; background: var(--accent-glow); }
    .admin-content { max-width: 100%; padding: 20px; }

    .form-row { grid-template-columns: 1fr; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

    .stats-grid { grid-template-columns: 1fr 1fr; }

    .auth-card { padding: 24px; }
    .modal { padding: 24px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .topbar-inner { padding: 0 12px; }
    .topbar-title { font-size: 20px; }
}

/* ============================================================
   Homepage
   ============================================================ */

.page-home { }

.hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--topbar-height) - 40px);
    padding: 60px 24px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 40%, var(--accent-glow) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(0, 206, 201, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.hero-body {
    position: relative;
    text-align: center;
    max-width: 600px;
}

.hero-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 28px;
}
.hero-icon svg { width: 100%; height: 100%; }

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(36px, 7vw, 72px);
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1.05;
    margin: 0 0 16px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    color: var(--text-secondary);
    font-size: clamp(15px, 1.8vw, 18px);
    line-height: 1.7;
    margin: 0 0 36px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- Sections --- */

.section {
    padding: 80px 24px;
}

.section-alt {
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-inner {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.section-inner-narrow {
    max-width: 600px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(24px, 3.5vw, 34px);
    font-weight: 700;
    letter-spacing: -0.5px;
    margin: 0 0 12px;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.7;
    max-width: 480px;
    margin: 0 auto 40px;
}

/* --- Feature Cards --- */

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    text-align: left;
}

.card-feature {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: border-color 0.2s, transform 0.2s;
}

.card-feature:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
}

.cf-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}
.cf-icon svg { width: 20px; height: 20px; }

.cf-icon-tickets { background: var(--accent-glow); color: var(--accent); }
.cf-icon-messages { background: rgba(0, 206, 201, 0.12); color: var(--secondary); }
.cf-icon-lobby { background: rgba(253, 203, 110, 0.12); color: var(--warning); }
.cf-icon-shield { background: rgba(0, 184, 148, 0.12); color: var(--success); }

.cf-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 6px;
}

.cf-desc {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
}

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

@media (max-width: 768px) {
    .hero { padding: 40px 20px; min-height: auto; }
    .section { padding: 60px 20px; }
    .grid-cards { grid-template-columns: 1fr; }
    .hero-actions { flex-direction: column; align-items: center; }
    .hero-actions .btn { width: 100%; max-width: 280px; justify-content: center; }
}
