/* ==========================================
   Control Panel v3.0 — Premium Design
   Font: DM Sans + JetBrains Mono
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-primary: #13151e;
    --bg-secondary: #1a1d2b;
    --bg-card: #1c2033;
    --bg-card-alt: #212640;
    --bg-input: #232845;
    --text-primary: #eeeef5;
    --text-secondary: #a8adc6;
    --text-muted: #636985;
    --accent: #8b86ff;
    --accent-hover: #a5a1ff;
    --accent-soft: rgba(139,134,255,0.15);
    --accent-glow: rgba(139,134,255,0.10);
    --accent-border: rgba(139,134,255,0.35);
    --success: #34d399;
    --warning: #fbbf24;
    --error: #fb7185;
    --info: #60a5fa;
    --discord: #7289da;
    --border: rgba(255,255,255,0.09);
    --border-hover: rgba(255,255,255,0.16);
    --border-light: rgba(255,255,255,0.20);
    --shadow: 0 2px 8px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.25);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.35);
    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
    --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ==========================================
   Light Theme Override
   ========================================== */
[data-theme="light"] {
    --bg-primary: #f4f4f8;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-alt: #f8f8fc;
    --bg-input: #f0f0f6;
    --text-primary: #1a1a2e;
    --text-secondary: #5c5c7a;
    --text-muted: #9494ad;
    --accent: #6c63ff;
    --accent-hover: #5a52e0;
    --accent-soft: rgba(108,99,255,0.08);
    --accent-glow: rgba(108,99,255,0.06);
    --accent-border: rgba(108,99,255,0.25);
    --success: #16a34a;
    --warning: #d97706;
    --error: #dc2626;
    --info: #2563eb;
    --discord: #5865f2;
    --border: rgba(0,0,0,0.08);
    --border-hover: rgba(0,0,0,0.14);
    --border-light: rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.04);
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Dark body gradient (default) */
:root body { background: linear-gradient(145deg, #13151e 0%, #171a26 50%, #151921 100%); }
[data-theme="light"] body { background: #f4f4f8; }

/* Light theme specific overrides */
[data-theme="light"] .login-container { background: linear-gradient(145deg, #eef0f7 0%, #f4f4f8 50%, #eef0f7 100%); }
[data-theme="light"] .sidebar { background: var(--bg-secondary); box-shadow: 2px 0 12px rgba(0,0,0,0.03); }
[data-theme="light"] .sidebar::before { display: none; }
[data-theme="light"] .main-content::before,
[data-theme="light"] .main-content::after { display: none; }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.18); }
[data-theme="light"] #notification-badge { border-color: var(--bg-secondary); }
[data-theme="light"] .stat-icon.discord { background: rgba(88,101,242,0.1); }
[data-theme="light"] .stat-icon.fivem { background: rgba(234,88,12,0.1); }
[data-theme="light"] .stat-icon.users { background: rgba(22,163,74,0.1); }
[data-theme="light"] .stat-icon.logs { background: rgba(37,99,235,0.1); }
[data-theme="light"] .modal,
[data-theme="light"] .modal-overlay { background: rgba(0,0,0,0.25); backdrop-filter: blur(4px); }
[data-theme="light"] .confirm-overlay { background: rgba(0,0,0,0.2); }
[data-theme="light"] .card-header { background: var(--bg-card-alt); }

/* ==========================================
   Page Transitions
   ========================================== */
.main-content {
    animation: pageIn 0.25s ease forwards;
}

.main-content.page-exit {
    animation: pageOut 0.18s ease forwards;
}

@keyframes pageIn {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pageOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

/* Login page fade (kein main-content) */
.login-container {
    animation: pageIn 0.3s ease forwards;
}

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

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.07); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.14); }

/* ==========================================
   Login Page
   ========================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #13151e 0%, #171a26 50%, #151921 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(139,134,255,0.06) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(180,122,255,0.04) 0%, transparent 50%);
    pointer-events: none;
}

.login-box {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

.login-header { text-align: center; margin-bottom: 30px; }
.login-header h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: 5px; letter-spacing: -0.02em; }
.login-header h2 { font-size: 1.1rem; color: var(--accent); margin-bottom: 10px; font-weight: 500; }
.login-header p { color: var(--text-secondary); font-size: 0.9rem; }
.login-logo { width: 72px; height: 72px; margin-bottom: 15px; border-radius: 16px; }
.login-footer { text-align: center; margin-top: 30px; color: var(--text-muted); font-size: 0.85rem; }

/* ==========================================
   Layout
   ========================================== */
.app-container, .container { display: flex; min-height: 100vh; }

/* ==========================================
   Sidebar
   ========================================== */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, #171a28 100%);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: width 0.3s cubic-bezier(0.4,0,0.2,1);
    overflow: visible;
}

/* Sidebar ambient glow */
.sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 200px;
    background: linear-gradient(180deg, rgba(139,134,255,0.04) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

.sidebar-header {
    padding: 22px 20px;
    border-bottom: 1px solid var(--border);
    text-align: center;
    min-height: 74px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.sidebar-logo {
    width: 112px; height: 112px;
    object-fit: contain;
    border-radius: 13px;
    box-shadow: 0 4px 20px rgba(139,134,255,0.2);
}

.sidebar-header h2 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.sidebar-header h3 { font-size: 0.8rem; color: var(--accent); font-weight: 500; margin: 0; }
.sidebar-header span { font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-mono); }

/* Navigation */
.nav-menu {
    list-style: none;
    padding: 16px 10px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    z-index: 1;
}

.nav-item { margin: 3px 0; }

.nav-section-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 10px 16px;
    margin-bottom: 4px;
    margin-top: 4px;
    list-style: none;
}

.nav-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin: 14px 12px;
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 13.5px;
    font-weight: 400;
    position: relative;
    border: 1px solid transparent;
}

.nav-link:hover {
    background: var(--bg-card-alt);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--accent-soft);
    color: var(--accent-hover);
    font-weight: 600;
    border-color: var(--accent-border);
    box-shadow: 0 0 12px rgba(139,134,255,0.08);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: linear-gradient(180deg, #8b86ff, #b47aff);
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(139,134,255,0.6);
}

.nav-link i { width: 22px; text-align: center; font-size: 1rem; flex-shrink: 0; }

.nav-badge {
    font-size: 11px;
    font-weight: 700;
    background: linear-gradient(135deg, #8b86ff, #b47aff);
    color: #fff;
    padding: 2px 9px;
    border-radius: 10px;
    font-family: var(--font-mono);
    margin-left: auto;
    box-shadow: 0 2px 10px rgba(139,134,255,0.35);
}

.nav-submenu { list-style: none; padding: 4px 0 0 22px; margin: 0; }
.nav-submenu li { margin: 3px 0; }
.nav-submenu .nav-link { padding: 8px 14px; font-size: 0.85rem; }

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 16px;
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #fbbf24, #f97316);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 3px 12px rgba(251,191,36,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
}

.user-details { flex: 1; min-width: 0; overflow: hidden; }
.user-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.75rem; color: var(--text-muted); }

.user-info-bar { display: flex; align-items: center; gap: 10px; }

/* ==========================================
   Main Content
   ========================================== */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px 40px;
    min-height: 100vh;
    position: relative;
}

/* Ambient background effects */
.main-content::before {
    content: '';
    position: fixed;
    top: -200px; right: -200px;
    width: 600px; height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139,134,255,0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.main-content::after {
    content: '';
    position: fixed;
    bottom: -300px; left: 30%;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(96,165,250,0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 15px;
    position: relative;
    z-index: 1;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.03em;
}

.page-header p { color: var(--text-muted); margin-top: 4px; font-size: 13px; }

/* ==========================================
   Cards
   ========================================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 18px;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow);
    position: relative;
    z-index: 1;
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 100%);
}

.card-header .btn { flex-shrink: 0; }

.card-title {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body { padding: 22px 24px; }

/* ==========================================
   Stats Grid
   ========================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}

/* Stat card shine line */
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 24px; right: 24px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
    transition: var(--transition);
}

.stat-card:hover::before {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
}

.stat-icon {
    width: 46px; height: 46px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: var(--transition);
}

.stat-icon.discord { background: rgba(114,137,218,0.18); color: var(--discord); }
.stat-icon.fivem   { background: rgba(255,140,66,0.18);  color: #ff8c42; }
.stat-icon.users   { background: rgba(52,211,153,0.18);  color: var(--success); }
.stat-icon.logs    { background: rgba(96,165,250,0.18);  color: var(--info); }

.stat-card:hover .stat-icon {
    box-shadow: 0 0 16px currentColor;
}

.stat-info h3 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 2px;
    letter-spacing: -0.04em;
}

.stat-info p { color: var(--text-secondary); font-size: 0.85rem; }

/* ==========================================
   Grid Layouts
   ========================================== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 18px;
    position: relative;
    z-index: 1;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-secondary);
}

input, select, textarea { font-family: var(--font-sans); }

.form-control {
    width: 100%;
    padding: 11px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow), 0 0 16px rgba(139,134,255,0.08);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a8adc6' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}

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

.form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }

/* ==========================================
   Search Box
   ========================================== */
.search-box { display: flex; gap: 10px; margin-bottom: 20px; }

.search-box input {
    flex: 1;
    padding: 11px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition);
    font-family: var(--font-sans);
}

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

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

/* ==========================================
   Buttons
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-xs);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    font-family: var(--font-sans);
    line-height: 1.4;
}

.btn-primary {
    background: linear-gradient(135deg, #8b86ff, #a57aff);
    color: white;
    box-shadow: 0 2px 10px rgba(139,134,255,0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(139,134,255,0.35);
    filter: brightness(1.1);
}

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

.btn-secondary:hover {
    background: var(--bg-card-alt);
    border-color: var(--border-hover);
    color: white;
}

.btn-success { background: var(--success); color: #000; }
.btn-success:hover { filter: brightness(1.1); }

.btn-danger { background: var(--error); color: white; }
.btn-danger:hover { filter: brightness(1.1); }

.btn-small { padding: 7px 14px; font-size: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

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

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

.data-table th,
.data-table td {
    padding: 13px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: rgba(0,0,0,0.2);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.data-table tr { transition: var(--transition); }
.data-table tr:hover { background: rgba(139,134,255,0.03); }
.data-table .text-center { text-align: center; }

/* ==========================================
   Player/Member Cards
   ========================================== */
.player-list, .member-list { display: flex; flex-direction: column; gap: 8px; }

.player-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.player-card:hover { border-color: var(--accent-border); background: var(--accent-glow); }

.player-avatar { width: 42px; height: 42px; border-radius: var(--radius-sm); object-fit: cover; }

.player-info { flex: 1; min-width: 0; }
.player-info h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-info span { font-size: 0.8rem; color: var(--text-secondary); }

.player-stats, .player-roles { display: flex; gap: 8px; flex-wrap: wrap; }
.player-stats span { display: flex; align-items: center; gap: 4px; font-size: 0.8rem; color: var(--text-secondary); }

/* ==========================================
   Roles
   ========================================== */
.roles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }

.role-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.role-card:hover { border-color: var(--border-hover); }
.role-name { font-weight: 500; font-size: 0.9rem; }
.role-count { font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-mono); }

.role-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; background: var(--accent); color: white;
    border-radius: 7px; font-size: 0.75rem; font-weight: 500;
}

.role-remove { background: none; border: none; color: white; cursor: pointer; font-size: 1rem; line-height: 1; opacity: 0.7; transition: var(--transition); }
.role-remove:hover { opacity: 1; }

/* ==========================================
   Modals
   ========================================== */
.modal {
    display: none; position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center; justify-content: center;
    padding: 20px; overflow-y: auto;
}

.modal.active { display: flex; }

.modal-overlay {
    display: none; position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center; justify-content: center;
    padding: 20px; overflow-y: auto;
}

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

.modal-content, .modal-overlay > .modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    width: 100%; max-width: 500px; max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    animation: modalSlide 0.25s cubic-bezier(0.4,0,0.2,1);
    box-shadow: var(--shadow-lg);
}

.modal-large { max-width: 700px; }

@keyframes modalSlide {
    from { opacity: 0; transform: translateY(-16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 1.1rem; font-weight: 600; }

.modal-close {
    background: none; border: none; color: var(--text-muted); font-size: 1.5rem;
    cursor: pointer; line-height: 1; transition: var(--transition); padding: 4px; border-radius: 6px;
}
.modal-close:hover { color: var(--text-primary); background: var(--bg-input); }

.modal-body { padding: 22px 24px; }

.modal-footer { padding: 18px 24px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

.member-detail, .player-detail { display: flex; flex-direction: column; gap: 20px; }
.member-header, .player-header { display: flex; align-items: center; gap: 16px; }
.member-avatar-large { width: 64px; height: 64px; border-radius: var(--radius-sm); }
.member-header h3, .player-header h3 { font-size: 1.2rem; margin-bottom: 4px; }
.member-header p, .player-header p { color: var(--text-secondary); font-size: 0.85rem; }

.member-section, .detail-section { padding: 18px; background: var(--bg-input); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.member-section h4, .detail-section h4 { font-size: 0.9rem; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; color: var(--accent); }
.current-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-grid { display: flex; flex-direction: column; gap: 16px; }
.detail-section p { margin-bottom: 6px; font-size: 0.9rem; }
.detail-section p strong { color: var(--text-primary); }

/* ==========================================
   Badges & Status
   ========================================== */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-dot.online { background: var(--success); box-shadow: 0 0 8px rgba(52,211,153,0.5); }
.status-dot.offline { background: var(--text-muted); }

.status-badge { display: inline-flex; padding: 4px 12px; border-radius: var(--radius-xs); font-size: 0.75rem; font-weight: 500; }
.status-badge.active { background: rgba(52,211,153,0.12); color: var(--success); }
.status-badge.inactive { background: rgba(251,113,133,0.12); color: var(--error); }

.action-badge, .type-badge { display: inline-flex; padding: 3px 10px; border-radius: var(--radius-xs); font-size: 0.7rem; font-weight: 500; background: rgba(255,255,255,0.06); }
.type-badge.discord { background: rgba(114,137,218,0.15); color: var(--discord); }
.type-badge.fivem { background: rgba(255,140,66,0.15); color: #ff8c42; }
.type-badge.panel { background: rgba(139,134,255,0.15); color: var(--accent); }

.color-dot { width: 18px; height: 18px; border-radius: 4px; display: inline-block; }

/* ==========================================
   Permissions & Checkboxes
   ========================================== */
.permissions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 16px; }

.perm-category { background: var(--bg-input); padding: 18px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.perm-category h4 { font-size: 0.9rem; margin-bottom: 12px; color: var(--accent); border-bottom: 1px solid var(--border); padding-bottom: 8px; }

.checkbox-label { display: flex; align-items: center; gap: 8px; padding: 6px 0; cursor: pointer; transition: var(--transition); font-size: 0.9rem; }
.checkbox-label:hover { color: var(--accent-hover); }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; border-radius: 4px; }

.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin-bottom: 16px; }

.job-item { display: flex; align-items: center; gap: 8px; padding: 8px; background: var(--bg-input); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.job-item input[type="number"] { width: 60px; padding: 4px 8px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 4px; color: var(--text-primary); font-family: var(--font-mono); font-size: 0.85rem; }

/* ==========================================
   Inventory
   ========================================== */
.inventory-list { display: flex; flex-direction: column; gap: 6px; }
.inventory-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--bg-secondary); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.inventory-item span { font-weight: 500; font-size: 0.9rem; }
.inventory-item .btn { padding: 4px 8px; font-size: 0.7rem; }

/* ==========================================
   Filter Row
   ========================================== */
.filter-row { display: flex; gap: 12px; flex-wrap: wrap; }
.filter-row .form-control { flex: 1; min-width: 140px; }

/* ==========================================
   Alerts
   ========================================== */
#alert-container { position: fixed; top: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }

.alert {
    padding: 14px 18px; border-radius: var(--radius-sm);
    min-width: 280px; max-width: 420px;
    animation: slideIn 0.3s cubic-bezier(0.4,0,0.2,1);
    display: flex; align-items: center; gap: 10px;
    box-shadow: var(--shadow-md);
    font-size: 0.9rem;
    backdrop-filter: blur(16px);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(60px); }
    to { opacity: 1; transform: translateX(0); }
}

.alert-success { background: rgba(52,211,153,0.12); border: 1px solid rgba(52,211,153,0.25); color: var(--success); }
.alert-error { background: rgba(251,113,133,0.12); border: 1px solid rgba(251,113,133,0.25); color: var(--error); }
.alert-info { background: rgba(96,165,250,0.12); border: 1px solid rgba(96,165,250,0.25); color: var(--info); }

/* ==========================================
   Confirm Dialog
   ========================================== */
.confirm-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(6px); z-index: 3000; align-items: center; justify-content: center; animation: fadeIn 0.2s ease; }
.confirm-overlay.active { display: flex; }

.confirm-box { background: var(--bg-card); border-radius: var(--radius); padding: 30px; width: 100%; max-width: 400px; text-align: center; border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: modalSlide 0.25s cubic-bezier(0.4,0,0.2,1); }

.confirm-icon { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; font-size: 1.5rem; }
.confirm-icon.warning { background: rgba(251,191,36,0.12); color: var(--warning); }
.confirm-icon.danger { background: rgba(251,113,133,0.12); color: var(--error); }
.confirm-icon.info { background: rgba(96,165,250,0.12); color: var(--info); }

.confirm-title { font-size: 1.15rem; font-weight: 600; margin-bottom: 8px; }
.confirm-message { color: var(--text-secondary); margin-bottom: 22px; line-height: 1.5; font-size: 0.9rem; }
.confirm-buttons { display: flex; gap: 8px; justify-content: center; }
.confirm-buttons .btn { min-width: 100px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ==========================================
   Loading
   ========================================== */
.loading { display: flex; justify-content: center; padding: 40px; }
.spinner { width: 32px; height: 32px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================
   Utility
   ========================================== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.no-results { text-align: center; padding: 28px; color: var(--text-muted); font-size: 0.9rem; }
.action-buttons { display: flex; gap: 8px; }

/* ==========================================
   Theme Toggle
   ========================================== */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 9px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 12.5px;
    font-weight: 500;
}

.theme-toggle:hover {
    border-color: var(--accent-border);
    color: var(--accent);
    background: var(--accent-soft);
}

.theme-toggle { margin-bottom: 8px; }

.theme-toggle i { font-size: 14px; transition: transform 0.3s ease; }
.theme-toggle:hover i { transform: rotate(25deg); }

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 1024px) {
    .sidebar { width: 70px; }
    .sidebar::before { display: none; }
    .sidebar-header h2, .sidebar-header h3, .sidebar-header span,
    .nav-link span, .nav-badge, .nav-section-label,
    .user-details, .sidebar-footer .btn span,
    .theme-toggle span { display: none; }
    .nav-divider { margin: 10px 6px; }
    .nav-link { justify-content: center; padding: 12px; }
    .nav-link i { font-size: 1.2rem; }
    .nav-link.active::before { width: 5px; height: 5px; left: 50%; top: auto; bottom: 2px; transform: translateX(-50%); border-radius: 50%; }
    .main-content { margin-left: 70px; padding: 24px; }
    .user-info { justify-content: center; }
    .sidebar-footer .btn { padding: 10px; justify-content: center; }
    .theme-toggle { padding: 10px; justify-content: center; }
}

@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 16px; }
    .main-content::before, .main-content::after { display: none; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
    .search-box { flex-direction: column; }
    .search-box input, .search-box button { width: 100%; }
    .modal-content { margin: 10px; max-height: calc(100vh - 20px); }
    .form-row { flex-direction: column; }
    .form-row .form-control, .form-row .btn { width: 100%; }
}

/* Tablet / FiveM */
@media (max-width: 950px) and (min-width: 600px) {
    .sidebar { width: 70px; overflow: visible; }
    .sidebar::before { display: none; }
    .sidebar-header { padding: 14px 8px; }
    .sidebar-header h2, .sidebar-header h3, .sidebar-header span { display: none; }
    .sidebar-logo { width: 34px; height: 34px; margin: 0 auto; }
    .nav-menu { padding: 8px 4px; }
    .nav-link { padding: 10px; justify-content: center; }
    .nav-link span, .nav-badge, .nav-section-label { display: none; }
    .nav-divider { margin: 8px 4px; }
    .nav-link i { margin: 0; font-size: 1.2rem; }
    .nav-link.active::before { width: 5px; height: 5px; left: 50%; top: auto; bottom: 2px; transform: translateX(-50%); border-radius: 50%; }
    .sidebar-footer { padding: 8px 4px; }
    .sidebar-footer .user-details, .sidebar-footer .btn span { display: none; }
    .sidebar-footer .user-avatar { margin: 0 auto 8px; }
    .sidebar-footer .btn { padding: 8px; justify-content: center; }
    .theme-toggle span { display: none; }
    .theme-toggle { padding: 8px; justify-content: center; }
    .main-content { margin-left: 70px; padding: 14px; }
    .page-header { flex-direction: column; gap: 8px; margin-bottom: 14px; }
    .page-header h1 { font-size: 1.1rem; }
    .card { margin-bottom: 12px; }
    .card-header { padding: 12px 16px; }
    .card-body { padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-info h3 { font-size: 1.3rem; }
    .data-table th, .data-table td { padding: 6px 8px; font-size: 0.8rem; }
    .btn { padding: 7px 12px; font-size: 0.8rem; }
    .btn-small { padding: 4px 6px; font-size: 0.7rem; }
    .form-control { padding: 7px 10px; font-size: 0.85rem; }
    .user-info { flex-direction: column; text-align: center; }
}

@media (max-width: 750px) {
    .sidebar { width: 52px; }
    .main-content { margin-left: 52px; padding: 10px; }
    .stats-grid { grid-template-columns: 1fr; }
    .page-header h1 { font-size: 1rem; }
    .card-title { font-size: 0.9rem; }
}

/* ==========================================
   Notifications
   ========================================== */
.notification-wrapper { position: relative; flex-shrink: 0; }

#notification-bell {
    position: relative;
    background: var(--bg-card-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: var(--transition);
    color: var(--text-secondary);
}

#notification-bell:hover {
    border-color: var(--accent-border);
    box-shadow: 0 0 16px rgba(139,134,255,0.15);
    color: var(--accent-hover);
}

#notification-badge {
    position: absolute; top: -5px; right: -5px;
    background: linear-gradient(135deg, #8b86ff, #b47aff);
    color: white; font-size: 0.65rem; font-weight: 700;
    min-width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    padding: 0 3px; border: 2.5px solid var(--bg-primary);
    font-family: var(--font-mono);
    box-shadow: 0 2px 10px rgba(139,134,255,0.4);
}

#notifications-dropdown {
    position: fixed; bottom: 60px; left: 268px;
    width: 340px; max-height: 420px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    z-index: 1001; display: none; overflow: hidden;
}

#notifications-dropdown.show { display: block; animation: slideRight 0.2s cubic-bezier(0.4,0,0.2,1); }

@keyframes slideRight {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Collapsed sidebar: dropdown weiter links */
@media (max-width: 1024px) and (min-width: 769px) {
    #notifications-dropdown { left: 78px; }
}
@media (max-width: 950px) and (min-width: 600px) {
    #notifications-dropdown { left: 78px; }
}
@media (max-width: 768px) {
    #notifications-dropdown { left: 16px; right: 16px; width: auto; bottom: 80px; }
}

.notification-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.notification-header span { font-weight: 600; font-size: 0.9rem; }
.notification-mark-all { background: none; border: none; color: var(--accent); font-size: 0.75rem; cursor: pointer; font-family: var(--font-sans); }
.notification-mark-all:hover { text-decoration: underline; }

.notification-list { max-height: 300px; overflow-y: auto; }

.notification-item { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); cursor: pointer; transition: var(--transition); }
.notification-item:hover { background: var(--bg-card-alt); }
.notification-item.unread { background: rgba(139,134,255,0.04); }
.notification-item.unread:hover { background: rgba(139,134,255,0.07); }

.notification-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--accent-glow); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.85rem; }
.notification-content { flex: 1; min-width: 0; }
.notification-title { font-weight: 600; font-size: 0.85rem; margin-bottom: 2px; white-space: normal; }
.notification-message { font-size: 0.75rem; color: var(--text-secondary); white-space: normal; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notification-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; font-family: var(--font-mono); }

.notification-footer { padding: 12px 18px; border-top: 1px solid var(--border); text-align: center; }
.notification-clear { background: none; border: none; color: var(--text-muted); font-size: 0.75rem; cursor: pointer; font-family: var(--font-sans); }
.notification-clear:hover { color: var(--error); }

.notification-empty { padding: 28px; text-align: center; color: var(--text-muted); font-size: 0.9rem; }
.notification-empty i { font-size: 1.8rem; margin-bottom: 8px; opacity: 0.4; }
.notification-loading { padding: 28px; text-align: center; color: var(--accent); }

.sidebar-footer-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; width: 100%; }
.sidebar-footer-row .user-info { flex: 1; min-width: 0; }
.sidebar-footer-row .user-details { overflow: hidden; }
.sidebar-footer-row .user-name, .sidebar-footer-row .user-role { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }