/* ============================================
   ODDSTRADER PRO - Admin Panel Styles
   ============================================ */

:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1f2937;
    --bg-hover: #374151;
    --border-subtle: #374151;
    --border-accent: #00d4ff;
    --text-primary: #f9fafb;
    --text-secondary: #e5e7eb;
    --text-muted: #6b7280;
    --accent-cyan: #00d4ff;
    --accent-orange: #f97316;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-purple: #8b5cf6;
    --gradient-primary: linear-gradient(135deg, #00d4ff 0%, #0891b2 100%);
    --gradient-gold: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --font-main: 'Inter', -apple-system, sans-serif;
    --font-display: 'Space Grotesk', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
}

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

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
}

/* === Layout === */
.admin-layout {
    display: flex;
    height: 100vh;
}

/* === Sidebar === */
.admin-sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

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

.logo-mark {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
}

.logo-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
}

.badge {
    display: inline-block;
    padding: 2px 6px;
    background: var(--accent-cyan);
    color: var(--bg-primary);
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    margin-bottom: 4px;
}

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

.nav-item.active {
    color: var(--accent-cyan);
    background: rgba(0, 212, 255, 0.1);
}

.nav-icon {
    width: 20px;
    height: 20px;
}

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

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

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
}

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

/* === Main Content === */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* === Top Bar === */
.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
}

.page-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    width: 300px;
}

.search-bar svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.search-bar input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-main);
    outline: none;
}

.btn-icon {
    position: relative;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: var(--accent-red);
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === Pages === */
.page {
    display: none;
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.page.active {
    display: block;
}

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

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 4px;
}

/* === Stats Grid === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
}

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

.stat-title {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-badge {
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
}

.stat-badge.up {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
}

.stat-badge.neutral {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-muted);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-footer {
    font-size: 0.75rem;
}

.stat-change {
    color: var(--text-muted);
}

.stat-change.up {
    color: var(--accent-green);
}

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

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon.paypal {
    background: rgba(0, 112, 186, 0.1);
    color: #0070ba;
}

.stat-icon.whop {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-purple);
}

.stat-icon.binance {
    background: rgba(243, 186, 47, 0.1);
    color: #f3ba2f;
}

/* === Charts === */
.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.chart-card.large {
    grid-column: span 1;
}

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

.chart-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.chart-actions {
    display: flex;
    gap: 4px;
}

.btn-sm {
    padding: 6px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-sm:hover,
.btn-sm.active {
    background: var(--accent-cyan);
    color: var(--bg-primary);
    border-color: var(--accent-cyan);
}

.chart-body {
    height: 300px;
}

.chart-body canvas {
    width: 100%;
    height: 100%;
}

/* === Cards === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

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

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.card-actions {
    display: flex;
    gap: 8px;
}

.card-body {
    padding: 20px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--accent-cyan);
    cursor: pointer;
    font-size: 0.875rem;
}

/* === Tables === */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

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

.data-table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-primary);
}

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

.data-table td {
    font-size: 0.875rem;
}

/* === Buttons === */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--gradient-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-primary svg {
    width: 16px;
    height: 16px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn-secondary svg {
    width: 16px;
    height: 16px;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-sm-action {
    padding: 6px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-sm-action:hover {
    background: var(--bg-hover);
}

/* === Filters === */
.filters-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-group select,
.filter-group input {
    padding: 8px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.875rem;
    min-width: 150px;
}

/* === Badges === */
.badge-plan {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-plan.free {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-muted);
}

.badge-plan.starter {
    background: rgba(0, 212, 255, 0.1);
    color: var(--accent-cyan);
}

.badge-plan.pro {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-purple);
}

.badge-plan.enterprise {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.badge-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-status.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
}

.badge-status.inactive {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-muted);
}

.badge-status.banned {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
}

.badge-status.pending {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

/* === Plan Distribution === */
.plan-distribution {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.plan-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
}

.plan-header {
    padding: 8px;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.plan-header.free {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-muted);
}

.plan-header.starter {
    background: rgba(0, 212, 255, 0.1);
    color: var(--accent-cyan);
}

.plan-header.pro {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-purple);
}

.plan-header.enterprise {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.plan-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.plan-bar {
    height: 6px;
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 8px;
}

.plan-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
}

.plan-percent {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* === Settings === */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-label {
    flex: 1;
}

.setting-name {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.setting-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.setting-input {
    width: 300px;
    padding: 8px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.875rem;
}

.setting-input.small {
    width: 100px;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.toggle-switch.active {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.toggle-switch.active::after {
    left: 22px;
    background: white;
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* === Map === */
.map-container {
    width: 100%;
    height: 500px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

/* === Modal === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

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

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

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

.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;
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 16px;
}

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.875rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-cyan);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
}

/* === Responsive === */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-row {
        grid-template-columns: 1fr;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .plan-distribution {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        z-index: 100;
        transition: left var(--transition-normal);
    }
    
    .admin-sidebar.open {
        left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid.three {
        grid-template-columns: 1fr;
    }
    
    .plan-distribution {
        grid-template-columns: 1fr;
    }
    
    .filters-bar {
        flex-direction: column;
    }
    
    .search-bar {
        display: none;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}
