:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --glass: rgba(30, 41, 59, 0.7);
    --border: rgba(255, 255, 255, 0.1);
    --radius: 16px;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --font-main: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-light);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100%;
    position: relative;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 2rem;
    transition: transform 0.3s ease;
    z-index: 50;
    height: 100%;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand i {
    color: var(--primary);
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    padding: 12px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0) 100%);
    color: var(--primary);
}

.nav-links a i {
    width: 20px;
    text-align: center;
}

.badge {
    background-color: var(--secondary);
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
}

.logout-section {
    margin-top: auto;
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    width: 100%;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    color: var(--secondary);
    background: rgba(236, 72, 153, 0.1);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at top right, #1e1b4b 0%, var(--bg-dark) 40%);
    position: relative;
    width: 100%;
}

.top-header {
    padding: 2rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.menu-toggle {
    display: none;
    /* Hidden by default on desktop */
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

.header-title h1 {
    font-size: 2rem;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
}

.content-area {
    padding: 0 3rem 3rem 3rem;
    flex: 1;
}

/* Dashboard Cards and Grid Layouts */
.dashboard-grid,
.product-grid {
    display: grid;
    gap: 2rem;
}

.dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    margin-top: 2rem;
}

/* Product Grid default loaded from inline styles in dashboard usually, but we define global here if wanted */

.card {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: -webkit-linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* Standard property for compatibility */
}

.card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.card p {
    color: var(--text-muted);
}

.action-btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
}

.action-btn:hover {
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
    transform: scale(1.02);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    font-weight: 500;
}

.alert-success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.alert-error {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-light);
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 40;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        /* Hide off canvas */
        height: 100vh;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        left: 0;
        transform: translateX(0);
    }

    .main-content {
        width: 100%;
    }

    .menu-toggle {
        display: block;
    }

    .top-header {
        padding: 1rem 1.5rem;
    }

    .header-title h1 {
        font-size: 1.5rem;
    }

    .content-area {
        padding: 0 1.5rem 2rem 1.5rem;
    }

    .user-name {
        display: none;
        /* Hide name on small screens, simplify header */
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        /* Stack items */
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr)) !important;
        /* Stack products or larger cards */
    }

    /* Make tables responsive (like cart) */
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
    }
}

/* Pagination Overrides for Glassmorphism */
.pagination {
    margin-bottom: 0;
    gap: 5px;
    justify-content: center;
    /* Center pagination */
}

.page-item .page-link {
    background-color: var(--glass) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-muted) !important;
    border-radius: 8px !important;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.page-item.active .page-link {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.page-item .page-link:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-light) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.page-item.disabled .page-link {
    background-color: transparent !important;
    border-color: transparent !important;
    color: rgba(255, 255, 255, 0.2) !important;
}

.page-item:first-child .page-link,
.page-item:last-child .page-link {
    border-radius: 8px !important;
    /* Override bootstrap rounded corners */
}