:root {
    --bg-color: #0B0F19; /* Deep Space Dark */
    --sidebar-bg: rgba(15, 23, 42, 0.95);
    --panel-bg: rgba(30, 41, 59, 0.6);
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --accent-color: #3B82F6;
    --accent-gradient: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --border-light: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15), transparent 25%);
}

.dashboard-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-light);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.logo {
    padding: 30px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo i {
    font-size: 28px;
    color: #3B82F6;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo h2 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    padding: 0 16px;
    gap: 8px;
    margin-top: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    font-size: 15px;
    transition: var(--transition);
}

.nav-item i {
    font-size: 20px;
}

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

.nav-item.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.topbar {
    height: 80px;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
    background: rgba(11, 15, 25, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 90;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--panel-bg);
    padding: 10px 16px;
    border-radius: 20px;
    width: 300px;
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.search-bar:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.search-bar i {
    color: var(--text-secondary);
    margin-right: 10px;
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    outline: none;
    width: 100%;
    font-size: 14px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 24px;
}

.notifications {
    position: relative;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.notifications:hover {
    color: var(--text-primary);
}

.notifications i {
    font-size: 24px;
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: bold;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    cursor: pointer;
    transition: var(--transition);
}

.avatar:hover {
    transform: scale(1.05);
}

/* Content Wrapper */
.content-wrapper {
    padding: 30px 40px;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

.mt-2 { margin-top: 24px; }

/* Glass Panel Utility */
.glass-panel {
    background: var(--panel-bg);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--glass-shadow);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.stat-card {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.stat-icon.income { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.stat-icon.success { background: rgba(59, 130, 246, 0.15); color: var(--accent-color); }
.stat-icon.pending { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.stat-icon.subs { background: rgba(139, 92, 246, 0.15); color: #8B5CF6; }

.stat-details p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 4px;
}

.stat-details h3 {
    font-size: 24px;
    font-weight: 700;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--accent-color);
    font-weight: 500;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

.btn-text:hover {
    color: white;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-primary:hover {
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

/* Tables */
.table-container {
    padding: 0;
    overflow-x: auto;
}

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

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

.data-table th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    font-size: 14px;
}

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

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

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

/* Status Badges */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.status-success { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.status-pending { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.status-failed { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.status-active { background: rgba(59, 130, 246, 0.15); color: var(--accent-color); }
.status-expired { background: rgba(148, 163, 184, 0.15); color: var(--text-secondary); }

/* Tabs Logic */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.tab-content.active {
    display: block;
}

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

.text-center { text-align: center !important; }
.loading-text { color: var(--text-secondary); font-style: italic; }

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
        height: 100vh;
    }

    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        padding-bottom: 5px;
    }

    .logo {
        padding: 15px 20px 5px 20px;
    }

    .nav-menu {
        flex-direction: row;
        overflow-x: auto;
        padding: 0 10px 10px 10px;
        gap: 8px;
    }

    .nav-menu::-webkit-scrollbar {
        height: 4px;
    }
    
    .nav-menu::-webkit-scrollbar-thumb {
        background: var(--border-light);
        border-radius: 4px;
    }

    .nav-item {
        white-space: nowrap;
        padding: 10px 14px;
        font-size: 14px;
    }

    .topbar {
        height: auto;
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .search-bar {
        width: 100%;
        max-width: 100%;
    }

    .user-profile {
        width: 100%;
        justify-content: space-between;
    }

    .content-wrapper {
        padding: 20px 15px;
    }

    .page-title {
        font-size: 24px;
        margin-bottom: 15px;
    }

    .stat-card {
        padding: 15px;
    }
}
