:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #10b981;
    --accent: #f59e0b;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --info: #3b82f6;

    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --sidebar-bg: #1e293b;
    --sidebar-active: #2d3748;
    --sidebar-hover: #2d3748;
    --border: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-secondary: #cbd5e1;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.4);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.6;
}

[data-theme="dark"] body {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --border: #334155;
}

/* App Container */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 1000;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    margin-bottom: 48px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.logo-text span {
    color: var(--primary);
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-section {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin: 20px 0 10px;
}

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

.nav-item i {
    width: 20px;
    font-size: 18px;
    transition: var(--transition);
}

.nav-item:hover {
    background-color: var(--sidebar-hover);
    color: var(--primary-light);
}

.nav-item.active {
    background-color: var(--sidebar-active);
    color: #fff;
    border-left: 4px solid var(--primary);
}

.nav-item.active i {
    color: var(--primary);
}

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

.user-minimal {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--secondary), #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.user-info {
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-balance {
    font-size: 12px;
    color: var(--secondary);
    font-weight: 600;
}

.logout-btn {
    color: var(--text-muted);
    font-size: 16px;
    transition: var(--transition);
}

.logout-btn:hover {
    color: var(--danger);
}

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

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

.search-box {
    position: relative;
    width: 400px;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: #fff;
    outline: none;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

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

.theme-toggle, .notification-bell {
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.theme-toggle:hover, .notification-bell:hover {
    color: #fff;
}

.notification-bell .dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background-color: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-dark);
}

/* Content Body */
.content-body {
    padding: 40px;
    flex: 1;
}

.section-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title i {
    color: var(--primary);
}

/* Product Cards Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.product-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(99, 102, 241, 0.1);
}

.pc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.pc-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    line-height: 1.4;
}

.pc-badge {
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.pc-badge.success { background: rgba(16, 185, 129, 0.1); color: var(--secondary); }
.pc-badge.danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

.pc-desc {
    font-size: 13px;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
}

.pc-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pc-price {
    display: flex;
    flex-direction: column;
}

.pc-price .label { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.pc-price .value { font-size: 20px; font-weight: 800; color: var(--danger); }

.buy-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-glow);
}

.buy-btn:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.buy-btn:disabled {
    background: var(--border);
    box-shadow: none;
    cursor: not-allowed;
}

/* Footer */
.app-footer {
    padding: 40px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 13px;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-muted);
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary);
}

/* Category Headers */
.category-wrapper {
    margin-bottom: 48px;
}

.category-title {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-title::after {
    content: '';
    height: 1px;
    flex: 1;
    background: var(--border);
}

/* Responsive */
@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none;
    }
    .topbar {
        padding: 0 20px;
    }
    .search-box {
        width: 250px;
    }
}
