/* ===== SCSD Statistik (Admin) ===== */

:root {
    --bg-dark: #0a0a0f;
    --bg-card: #111118;
    --bg-card-2: #15151f;
    --bg-input: #1a1a26;
    --bg-input-hover: #1f1f30;
    --accent-gold: #d4a843;
    --accent-gold-light: #e8c46a;
    --accent-gold-dim: rgba(212, 168, 67, 0.12);
    --green: #10b981;
    --green-dim: rgba(16, 185, 129, 0.15);
    --red: #ef4444;
    --red-dim: rgba(239, 68, 68, 0.15);
    --blue: #3b82f6;
    --text-primary: #f0f2f8;
    --text-secondary: #9ca3b4;
    --text-muted: #5c6478;
    --border: rgba(255, 255, 255, 0.06);
    --border-gold: rgba(212, 168, 67, 0.2);
    --radius: 12px;
    --radius-lg: 18px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    background-image:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(212, 168, 67, 0.04) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 50% 100%, rgba(212, 168, 67, 0.025) 0%, transparent 50%);
}

.bg-glow {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(140px);
}
.bg-glow-1 {
    width: clamp(280px, 40vw, 600px);
    height: clamp(280px, 40vw, 600px);
    top: -8%; left: -3%;
    background: radial-gradient(circle, rgba(212, 168, 67, 0.07), transparent 70%);
}
.bg-glow-2 {
    width: clamp(200px, 30vw, 500px);
    height: clamp(200px, 30vw, 500px);
    bottom: -8%; right: -3%;
    background: radial-gradient(circle, rgba(212, 168, 67, 0.05), transparent 70%);
}

.back-link {
    position: fixed;
    top: clamp(16px, 2.5vh, 24px);
    left: clamp(16px, 2.5vw, 32px);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
    z-index: 10;
}
.back-link:hover {
    color: var(--accent-gold);
    background: rgba(212, 168, 67, 0.08);
    border-color: var(--border-gold);
}
.back-link:hover i { transform: translateX(-3px); }
.back-link i { transition: transform 0.3s ease; font-size: 0.74rem; }

/* Page wrapper for denied screen */
.page-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
}
.center-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    text-align: center;
    max-width: 460px;
}
.denied-icon {
    font-size: 3rem;
    color: var(--red);
    margin-bottom: 16px;
}
.center-card h1 {
    font-size: 1.6rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.center-card p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}
.btn-primary {
    display: inline-block;
    padding: 12px 28px;
    background: var(--accent-gold);
    color: #0a0a0f;
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 700;
    transition: all 0.3s;
}
.btn-primary:hover {
    background: var(--accent-gold-light);
    transform: translateY(-2px);
}

/* Main wrapper */
.main-wrapper {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: clamp(72px, 10vh, 90px) clamp(16px, 4vw, 32px) 60px;
}

/* Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}
.header-left h1 {
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-weight: 800;
    color: var(--accent-gold);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.header-left h1 i { color: var(--accent-gold); }
.subtitle {
    margin-top: 6px;
    font-size: 0.82rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 500;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 6px;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 999px;
}
.user-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border-gold);
}
.user-name { font-size: 0.85rem; font-weight: 600; }
.user-role { font-size: 0.7rem; color: var(--text-muted); letter-spacing: 0.8px; text-transform: uppercase; }
.top-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 42px; height: 42px;
    border-radius: 10px;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.04);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.25s ease;
}
.top-link.logout:hover {
    color: var(--red);
    border-color: rgba(239,68,68,0.3);
    background: rgba(239,68,68,0.08);
}

/* Filter bar */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.filter-tabs {
    display: flex;
    gap: 6px;
    padding: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    flex-wrap: wrap;
}
.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.5px;
}
.filter-tab:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.03);
}
.filter-tab.active {
    background: var(--accent-gold-dim);
    border-color: var(--border-gold);
    color: var(--accent-gold);
    box-shadow: 0 4px 16px -8px rgba(212,168,67,0.3);
}
.filter-tab i { font-size: 0.8rem; }

.refresh-btn {
    width: 42px; height: 42px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
}
.refresh-btn:hover {
    color: var(--accent-gold);
    border-color: var(--border-gold);
    transform: rotate(90deg);
}

/* Overview cards */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.ov-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all 0.25s ease;
}
.ov-card:hover {
    border-color: var(--border-gold);
    transform: translateY(-2px);
}
.ov-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.ov-data { min-width: 0; }
.ov-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 600;
    margin-bottom: 4px;
}
.ov-value {
    font-variant-numeric: tabular-nums;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

/* Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 25px 60px -20px rgba(0,0,0,0.5);
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.card-header h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.5px;
}
.card-header h2 i { color: var(--accent-gold); font-size: 0.9rem; }

.search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.search-wrap i {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 0.82rem;
}
.search-wrap input {
    height: 38px;
    width: 260px;
    padding: 0 14px 0 36px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.25s;
}
.search-wrap input:focus {
    border-color: var(--accent-gold);
    background: var(--bg-input-hover);
    box-shadow: 0 0 0 3px var(--accent-gold-dim);
}

/* Table */
.table-wrap {
    overflow-x: auto;
    margin: 0 -8px;
}
.stats-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}
.stats-table th {
    text-align: left;
    padding: 12px 14px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,0.015);
}
.stats-table td {
    padding: 14px;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}
.stats-table tbody tr {
    transition: background 0.2s;
}
.stats-table tbody tr:hover {
    background: rgba(212, 168, 67, 0.04);
}
.stats-table tbody tr:last-child td { border-bottom: none; }
.ta-right { text-align: right; }
.ta-center { text-align: center; }

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
}
.rank-badge.top1 { background: linear-gradient(135deg, #ffd700, #b8941f); color: #0a0a0f; }
.rank-badge.top2 { background: linear-gradient(135deg, #c0c0c0, #888); color: #0a0a0f; }
.rank-badge.top3 { background: linear-gradient(135deg, #cd7f32, #804d1d); color: #fff; }

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-cell .pic {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(212,168,67,0.15);
    color: var(--accent-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}
.user-cell .info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.user-cell .info-name { font-weight: 600; }
.user-cell .info-discord { font-size: 0.72rem; color: var(--text-muted); }

.duration-cell {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--accent-gold);
    font-size: 0.95rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    background: rgba(255,255,255,0.04);
    color: var(--text-muted);
}
.status-badge.live {
    background: var(--green-dim);
    color: var(--green);
}
.status-badge .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.status-badge.live .dot {
    box-shadow: 0 0 8px var(--green);
    animation: dot-pulse 1.5s ease-in-out infinite;
}
@keyframes dot-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.icon-btn {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    transition: all 0.2s;
}
.icon-btn:hover {
    color: var(--accent-gold);
    border-color: var(--border-gold);
    background: var(--accent-gold-dim);
}
.icon-btn.danger:hover {
    color: var(--red);
    border-color: rgba(239,68,68,0.3);
    background: rgba(239,68,68,0.08);
}

.empty {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fade-in 0.2s ease;
}
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modal-pop 0.3s cubic-bezier(.22,.9,.36,1);
}
@keyframes modal-pop {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.modal-header h3 i { color: var(--accent-gold); }
.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    width: 32px; height: 32px;
    border-radius: 8px;
    transition: all 0.2s;
}
.modal-close:hover {
    color: var(--red);
    background: rgba(239,68,68,0.08);
}
.modal-body {
    padding: 16px 24px 24px;
    overflow-y: auto;
}

/* Responsive */
@media (max-width: 800px) {
    .page-header { flex-direction: column; align-items: flex-start; }
    .filter-tabs { width: 100%; }
    .filter-tab { flex: 1; justify-content: center; padding: 10px 8px; font-size: 0.78rem; }
    .filter-tab span, .filter-tab i + span { display: none; }
    .search-wrap input { width: 100%; }
    .card-header { flex-direction: column; align-items: stretch; }
}

@media (max-width: 600px) {
    .back-link { top: 12px; left: 12px; padding: 8px 14px; font-size: 0.76rem; }
    .ov-card { padding: 16px; }
    .ov-value { font-size: 1.15rem; }
    .ov-icon { width: 40px; height: 40px; font-size: 1rem; }
}
