/* ===== ConSports Admin Panel - Style ===== */
:root {
    --bg-primary: #000000;
    --bg-card: #121212;
    --bg-hover: #1e1e1e;
    --text-primary: #ffffff;
    --text-muted: #8e8e93;
    --text-accent: #bb86fc;
    --border: rgba(255, 255, 255, 0.12);
    --border-active: rgba(255, 255, 255, 0.3);
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --radius: 12px;
    --radius-sm: 8px;
}

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

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
}

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

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ===== LOGIN PAGE ===== */
.page-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login-box {
    width: 100%;
    max-width: 380px;
    text-align: center;
}

.login-box .logo {
    width: 72px;
    height: 72px;
    margin-bottom: 8px;
}

.login-box h1 {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.login-box .subtitle {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    margin-bottom: 36px;
}

/* ===== FORM ELEMENTS ===== */
.form-group { margin-bottom: 12px; }

.form-input {
    width: 100%;
    height: 50px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 16px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus { border-color: var(--text-accent); }
.form-input::placeholder { color: var(--text-muted); }

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

textarea.form-input {
    padding: 12px 16px;
    height: auto;
    min-height: 80px;
    resize: vertical;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--text-accent);
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 50px;
    padding: 0 28px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    width: 100%;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--text-primary); color: var(--bg-primary); }
.btn-accent { background: var(--text-accent); color: #000; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-primary); }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { height: 38px; padding: 0 16px; font-size: 13px; width: auto; }

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

/* ===== SIDEBAR (desktop) ===== */
.sidebar {
    width: 240px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s;
}

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

.sidebar-header img { width: 36px; height: 36px; }
.sidebar-header span { font-size: 18px; font-weight: 900; }

.sidebar-nav { flex: 1; padding: 0 8px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: rgba(187, 134, 252, 0.15); color: var(--text-accent); }
.nav-item .icon { font-size: 18px; width: 24px; text-align: center; }
.nav-item.owner-only { border-left: 2px solid var(--text-accent); }

.sidebar-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
}

.user-info {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.user-info strong { color: var(--text-primary); display: block; }

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 24px;
    padding-bottom: 90px;
    max-width: 100%;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h2 { font-size: 20px; font-weight: 800; }

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.card-value {
    font-size: 28px;
    font-weight: 800;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

/* ===== TABLE ===== */
.table-wrap {
    overflow-x: auto;
    margin-bottom: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead th {
    text-align: left;
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    cursor: pointer;
}

tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    vertical-align: middle;
}

tbody tr:hover { background: var(--bg-hover); }
tbody tr { transition: background 0.15s; }

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.badge-success { background: rgba(76, 175, 80, 0.2); color: var(--success); }
.badge-warning { background: rgba(255, 152, 0, 0.2); color: var(--warning); }
.badge-danger { background: rgba(244, 67, 54, 0.2); color: var(--danger); }
.badge-info { background: rgba(187, 134, 252, 0.2); color: var(--text-accent); }

/* ===== TOAST / NOTIFICATION ===== */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    z-index: 9999;
    max-width: 380px;
    animation: slideIn 0.3s ease;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.toast.success { background: var(--success); color: white; }
.toast.error { background: var(--danger); color: white; }
.toast.info { background: var(--text-accent); color: #000; }

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

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s;
}

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

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    animation: scaleIn 0.2s;
}

@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal h3 {
    font-size: 18px;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions .btn { flex: 1; }

/* ===== TOKEN DISPLAY ===== */
.token-display {
    background: var(--bg-primary);
    border: 2px dashed var(--text-accent);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    margin: 16px 0;
}

.token-display .token {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 4px;
    color: var(--text-accent);
    font-family: 'Courier New', monospace;
}

.token-display .hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

/* ===== LOADING ===== */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--text-accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.loading-center {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 16px;
}

.pagination button {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination button:hover { background: var(--bg-hover); }
.pagination button.active { background: var(--text-accent); color: #000; border-color: var(--text-accent); }
.pagination button:disabled { opacity: 0.3; cursor: not-allowed; }

/* ===== FILTERS ===== */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover { border-color: var(--text-accent); color: var(--text-accent); }
.filter-btn.active { background: rgba(187, 134, 252, 0.15); border-color: var(--text-accent); color: var(--text-accent); }

.search-input {
    flex: 1;
    min-width: 200px;
    height: 38px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0 16px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}

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

/* ===== CHIP ===== */
.chip {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    background: rgba(255,255,255,0.08);
    margin: 1px;
}

/* ===== RESPONSIVE - MOBILE ===== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.open { transform: translateX(0); }

    .main-content {
        margin-left: 0;
        padding: 16px;
        padding-bottom: 80px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .page-header .btn { width: 100%; }

    /* Bottom nav for mobile */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-top: 1px solid var(--border);
        z-index: 99;
        padding: 6px 0;
        justify-content: space-around;
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 6px 12px;
        font-size: 10px;
        color: var(--text-muted);
        cursor: pointer;
        border: none;
        background: none;
        font-weight: 600;
        transition: color 0.2s;
    }

    .mobile-nav-item .icon { font-size: 20px; }
    .mobile-nav-item.active { color: var(--text-accent); }

    /* Hamburger */
    .hamburger {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        cursor: pointer;
        font-size: 20px;
        color: var(--text-primary);
    }

    /* Table -> cards on mobile */
    .table-wrap table thead { display: none; }

    .table-wrap table tbody tr {
        display: block;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 14px;
        margin-bottom: 10px;
    }

    .table-wrap table tbody tr:hover { background: var(--bg-card); }

    .table-wrap table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        border: none;
        gap: 8px;
    }

    .table-wrap table tbody td::before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 700;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }
}

@media (min-width: 769px) {
    .hamburger { display: none !important; }
    .mobile-bottom-nav { display: none !important; }
}

/* ===== MISC ===== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--text-accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }
.copy-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-accent);
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}
.copy-btn:hover { background: rgba(187, 134, 252, 0.1); }

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
    height: 16px;
    margin-bottom: 8px;
}

@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
