@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-primary: #0a0e14;
    --bg-secondary: #111820;
    --bg-card: #151c27;
    --bg-card-hover: #1a2332;
    --bg-input: #0d1219;
    --bg-sidebar: #0c1118;
    --accent-green: #00e676;
    --accent-green-dim: #00c853;
    --accent-green-glow: rgba(0, 230, 118, 0.15);
    --accent-gold: #ffd740;
    --accent-gold-dim: #ffab00;
    --accent-blue: #448aff;
    --accent-red: #ff5252;
    --accent-red-dim: #d32f2f;
    --accent-orange: #ff9100;
    --accent-purple: #b388ff;
    --text-primary: #e8edf3;
    --text-secondary: #8899aa;
    --text-muted: #556677;
    --text-inverse: #0a0e14;
    --border-color: rgba(255, 255, 255, 0.06);
    --border-active: rgba(0, 230, 118, 0.3);
    --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 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(0, 230, 118, 0.1);
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --header-height: 64px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-smooth: 350ms cubic-bezier(0.4, 0, 0.2, 1)
}

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

html {
    font-size: 14px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px
}

::-webkit-scrollbar-track {
    background: transparent
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary)
}

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

a:hover {
    text-decoration: underline
}

/* ═══ LOGIN ═══ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(0, 230, 118, 0.04) 0%, transparent 50%), radial-gradient(ellipse at 70% 80%, rgba(68, 138, 255, 0.03) 0%, transparent 50%);
    animation: bgPulse 8s ease-in-out infinite alternate
}

@keyframes bgPulse {
    0% {
        transform: scale(1)
    }

    100% {
        transform: scale(1.05) rotate(2deg)
    }
}

.login-card {
    position: relative;
    width: 420px;
    padding: 48px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    z-index: 1
}

.login-logo {
    text-align: center;
    margin-bottom: 32px
}

.login-logo h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text
}

.login-logo .subtitle {
    font-size: .85rem;
    color: var(--text-secondary);
    margin-top: 4px
}

.login-logo .shield {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px
}

/* ═══ FORMS ═══ */
.form-group {
    margin-bottom: 20px
}

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

.form-input,
.form-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: .95rem;
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none
}

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

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

.form-select option {
    background: var(--bg-card)
}

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

/* ═══ BUTTONS ═══ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
    text-decoration: none;
    white-space: nowrap
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-green), var(--accent-green-dim));
    color: var(--text-inverse);
    box-shadow: 0 2px 12px rgba(0, 230, 118, 0.25)
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 230, 118, 0.35);
    text-decoration: none
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-red), var(--accent-red-dim));
    color: #fff;
    box-shadow: 0 2px 12px rgba(255, 82, 82, 0.2)
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(255, 82, 82, 0.3);
    text-decoration: none
}

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

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--text-muted);
    text-decoration: none
}

.btn-warning {
    background: linear-gradient(135deg, var(--accent-orange), #ff6d00);
    color: #fff
}

.btn-sm {
    padding: 6px 14px;
    font-size: .8rem;
    border-radius: var(--radius-sm)
}

.btn-full {
    width: 100%
}

.btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none !important
}

/* ═══ ALERTS ═══ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: .88rem;
    display: flex;
    align-items: center;
    gap: 8px
}

.alert-error {
    background: rgba(255, 82, 82, 0.1);
    border: 1px solid rgba(255, 82, 82, 0.3);
    color: var(--accent-red)
}

.alert-success {
    background: rgba(0, 230, 118, 0.1);
    border: 1px solid rgba(0, 230, 118, 0.3);
    color: var(--accent-green)
}

.alert-warning {
    background: rgba(255, 145, 0, 0.1);
    border: 1px solid rgba(255, 145, 0, 0.3);
    color: var(--accent-orange)
}

/* ═══ LAYOUT ═══ */
.app-layout {
    display: flex;
    min-height: 100vh
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow: hidden
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px
}

.sidebar-header .logo-icon {
    font-size: 1.8rem
}

.sidebar-header .logo-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto
}

.nav-section {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    padding: 16px 12px 6px
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: .88rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    margin-bottom: 2px
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    text-decoration: none
}

.nav-item.active {
    background: var(--accent-green-glow);
    color: var(--accent-green);
    font-weight: 600
}

.nav-item .icon {
    font-size: 1.15rem;
    width: 24px;
    text-align: center
}

.sidebar-footer {
    padding: 16px 10px;
    border-top: 1px solid var(--border-color)
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md)
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    color: var(--text-inverse);
    flex-shrink: 0
}

.user-name {
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-primary)
}

.user-role {
    font-size: .72rem;
    color: var(--text-muted)
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh
}

.content-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10, 14, 20, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 32px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between
}

.content-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700
}

.session-timer {
    font-size: .75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color)
}

.session-timer.warning {
    color: var(--accent-orange);
    border-color: rgba(255, 145, 0, 0.3)
}

.content-body {
    padding: 28px 32px
}

/* ═══ STATS ═══ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0
}

.stat-card.green::before {
    background: linear-gradient(90deg, var(--accent-green), var(--accent-green-dim))
}

.stat-card.blue::before {
    background: linear-gradient(90deg, var(--accent-blue), #2962ff)
}

.stat-card.gold::before {
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-gold-dim))
}

.stat-card.purple::before {
    background: linear-gradient(90deg, var(--accent-purple), #7c4dff)
}

.stat-card.red::before {
    background: linear-gradient(90deg, var(--accent-red), var(--accent-red-dim))
}

.stat-card.orange::before {
    background: linear-gradient(90deg, var(--accent-orange), #ff6d00)
}

.stat-card:hover {
    border-color: var(--border-active);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md)
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 12px
}

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1
}

.stat-label {
    font-size: .8rem;
    color: var(--text-secondary);
    margin-top: 6px;
    font-weight: 500
}

/* ═══ TABLES ═══ */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
    flex-wrap: wrap
}

.search-wrapper {
    position: relative
}

.search-wrapper::before {
    content: '🔍';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: .85rem;
    pointer-events: none
}

.search-input {
    padding: 8px 14px 8px 36px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: .85rem;
    font-family: inherit;
    outline: none;
    width: 260px;
    transition: border-color var(--transition-fast)
}

.search-input:focus {
    border-color: var(--accent-green)
}

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

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap
}

.data-table td {
    padding: 12px 16px;
    font-size: .88rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle
}

.data-table tbody tr {
    transition: background var(--transition-fast)
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02)
}

.data-table tbody tr:last-child td {
    border-bottom: none
}

.table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
    font-size: .82rem;
    color: var(--text-secondary)
}

.pagination-buttons {
    display: flex;
    gap: 4px
}

.pagination-buttons a,
.pagination-buttons span {
    padding: 6px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: .82rem;
    text-decoration: none;
    transition: all var(--transition-fast)
}

.pagination-buttons a:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary)
}

.pagination-buttons .active {
    background: var(--accent-green);
    color: var(--text-inverse);
    border-color: var(--accent-green)
}

.pagination-buttons .disabled {
    opacity: .3;
    pointer-events: none
}

/* ═══ BADGES ═══ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px
}

.badge-green {
    background: rgba(0, 230, 118, 0.12);
    color: var(--accent-green);
    border: 1px solid rgba(0, 230, 118, 0.2)
}

.badge-red {
    background: rgba(255, 82, 82, 0.12);
    color: var(--accent-red);
    border: 1px solid rgba(255, 82, 82, 0.2)
}

.badge-blue {
    background: rgba(68, 138, 255, 0.12);
    color: var(--accent-blue);
    border: 1px solid rgba(68, 138, 255, 0.2)
}

.badge-gold {
    background: rgba(255, 215, 64, 0.12);
    color: var(--accent-gold);
    border: 1px solid rgba(255, 215, 64, 0.2)
}

.badge-orange {
    background: rgba(255, 145, 0, 0.12);
    color: var(--accent-orange);
    border: 1px solid rgba(255, 145, 0, 0.2)
}

.badge-purple {
    background: rgba(179, 136, 255, 0.12);
    color: var(--accent-purple);
    border: 1px solid rgba(179, 136, 255, 0.2)
}

/* ═══ PANELS ═══ */
.detail-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px
}

.detail-panel h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px
}

.detail-label {
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted)
}

.detail-value {
    font-size: .95rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-top: 4px
}

/* ═══ TABS ═══ */
.tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 24px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 3px;
    border: 1px solid var(--border-color)
}

.tab {
    padding: 8px 20px;
    border: none;
    color: var(--text-secondary);
    font-size: .85rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    flex: 1;
    text-align: center
}

.tab:hover {
    color: var(--text-primary);
    text-decoration: none
}

.tab.active {
    background: var(--bg-card);
    color: var(--accent-green);
    font-weight: 600;
    box-shadow: var(--shadow-sm)
}

/* ═══ MODAL ═══ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 200ms ease
}

.modal-overlay.show {
    display: flex
}

@keyframes fadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px;
    width: 480px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 250ms ease
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

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

.modal-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 700
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all var(--transition-fast)
}

.modal-close:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary)
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px
}

/* ═══ LEADERBOARD ═══ */
.lb-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    transition: all var(--transition-fast)
}

.lb-card:hover {
    border-color: var(--border-active);
    transform: translateX(4px)
}

.lb-card.top-1 {
    border-left: 3px solid var(--accent-gold)
}

.lb-card.top-2 {
    border-left: 3px solid #b0bec5
}

.lb-card.top-3 {
    border-left: 3px solid #ff8a65
}

.lb-rank {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    min-width: 40px;
    text-align: center;
    color: var(--text-muted)
}

.lb-card.top-1 .lb-rank {
    color: var(--accent-gold)
}

.lb-card.top-2 .lb-rank {
    color: #b0bec5
}

.lb-card.top-3 .lb-rank {
    color: #ff8a65
}

.lb-info {
    flex: 1
}

.lb-name {
    font-weight: 600;
    font-size: .95rem
}

.lb-club {
    font-size: .8rem;
    color: var(--text-secondary)
}

.lb-points {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-green)
}

/* ═══ LOADING & EMPTY ═══ */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary)
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-green);
    border-radius: 50%;
    animation: spin 800ms linear infinite;
    margin: 0 auto 16px
}

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

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted)
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: .5
}

/* ═══ UTILITIES ═══ */
.text-green {
    color: var(--accent-green)
}

.text-red {
    color: var(--accent-red)
}

.text-gold {
    color: var(--accent-gold)
}

.text-blue {
    color: var(--accent-blue)
}

.text-muted {
    color: var(--text-muted)
}

.text-secondary {
    color: var(--text-secondary)
}

.flex {
    display: flex
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center
}

.gap-8 {
    gap: 8px
}

.gap-12 {
    gap: 12px
}

.gap-16 {
    gap: 16px
}

.mb-16 {
    margin-bottom: 16px
}

.mb-24 {
    margin-bottom: 24px
}

.mt-16 {
    margin-top: 16px
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px
}

.login-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    font-size: .75rem;
    color: var(--text-muted)
}

/* ═══ RESPONSIVE ═══ */
@media(max-width:1024px) {
    .sidebar {
        width: var(--sidebar-collapsed)
    }

    .sidebar .nav-label,
    .sidebar .logo-text,
    .sidebar .nav-section,
    .sidebar .user-name,
    .sidebar .user-role {
        display: none
    }

    .sidebar-header {
        justify-content: center;
        padding: 20px 10px
    }

    .main-content {
        margin-left: var(--sidebar-collapsed)
    }

    .sidebar-user {
        justify-content: center
    }
}

@media(max-width:768px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr
    }

    .content-body {
        padding: 20px 16px
    }

    .content-header {
        padding: 0 16px
    }

    .two-col {
        grid-template-columns: 1fr
    }

    .search-input {
        width: 100%
    }
}