/* Modern Dashboard Theme Variables - Premium Purple */
:root {
    --primary-color: #6a11cb;
    --primary-gradient: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    --primary-hover: #5a0eb0;
    --secondary-color: #64748b;
    --success-color: #00c851;
    --warning-color: #ffbb33;
    --danger-color: #ff4444;
    --info-color: #33b5e5;

    --bg-body: #f4f6f9;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    /* Will be gradient in specific class */

    --text-main: #333333;
    --text-muted: #6c757d;
    --text-light: #ffffff;

    --border-color: #e3e6f0;
    --radius-sm: 0.35rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;

    /* Premium Soft Shadows */
    --shadow-sm: 0 0.125rem 0.25rem rgba(58, 59, 69, 0.15);
    --shadow-md: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, .175);

    --nav-width: 260px;
    --header-height: 70px;
    --transition-speed: 0.3s;
}

/* Dark Mode Overrides */
[data-theme="dark"] {
    --bg-body: #121212;
    --bg-card: #1e1e2d;
    --bg-sidebar: #1e1e2d;

    --text-main: #e2e8f0;
    --text-muted: #a0aec0;

    --border-color: #2d3748;
    --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.4);
}

/* Global Reset & Typography */
body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-speed);
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Layout Grid */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--nav-width);
    background: var(--primary-gradient);
    color: var(--text-light);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
    transition: transform var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.brand-logo i {
    color: #fff;
    /* White icon on purple bg */
    font-size: 1.6rem;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

/* Nav Categories */
.nav-category {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.6);
    padding: 1.5rem 1.5rem 0.5rem;
    /* Increased top padding */
    font-weight: 700;
}

.nav-item {
    padding: 0.2rem 1rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-md);
    transition: all 0.2s;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.95rem;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(3px);
    /* Subtle nudge */
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    /* Subtle shadow for depth */
}

.nav-link i {
    font-size: 1.1rem;
    width: 1.5rem;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--nav-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin-left var(--transition-speed) ease;
}

/* Topbar Styling */
.topbar {
    height: var(--header-height);
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 40;
}

.toggle-sidebar-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
}

.toggle-sidebar-btn:hover {
    background-color: var(--bg-body);
    color: var(--primary-color);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.notification-bell {
    font-size: 1.25rem;
    color: var(--text-muted);
    position: relative;
    cursor: pointer;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--danger-color);
    color: white;
    font-size: 0.7rem;
    padding: 0.1rem 0.3rem;
    border-radius: 9999px;
    font-weight: bold;
}

/* Content Container */
.page-content {
    padding: 2rem;
    flex: 1;
}

/* Cards & Widgets */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

/* Stats Cards (Premium) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    border: none;
    /* Removed border */
    box-shadow: var(--shadow-sm);
    /* Soft shadow */
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    /* Circular icon */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
}

/* Icon Colors using variable opacity */
.stat-icon.primary {
    background: rgba(106, 17, 203, 0.1);
    color: var(--primary-color);
}

.stat-icon.success {
    background: rgba(0, 200, 81, 0.1);
    color: var(--success-color);
}

.stat-icon.warning {
    background: rgba(255, 187, 51, 0.1);
    color: var(--warning-color);
}

.stat-icon.info {
    background: rgba(51, 181, 229, 0.1);
    color: var(--info-color);
}

.stat-icon.danger {
    background: rgba(255, 68, 68, 0.1);
    color: var(--danger-color);
}

.stat-info {
    flex: 1;
}

.stat-info h3 {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-main);
    line-height: 1.2;
}

.stat-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin: 0;
}

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

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

    .main-content {
        margin-left: 0;
        padding-bottom: 80px;
        /* Space for Bottom Nav */
    }

    .bottom-nav {
        display: flex;
    }
}