:root {
    --sidebar-width: 260px;
    --header-height: 60px;
    --primary-color: #0d6efd;
    --dark-bg: #212529;
    --light-bg: #f4f6f9;
    --border-color: #dee2e6;
    --card-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

body, html {
    height: 100%;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--light-bg);
}

/* Auth Pages (Login/Register) */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 15px;
}
.auth-card {
    width: 100%;
    max-width: 500px;
    box-shadow: var(--card-shadow);
    border: none;
    border-radius: 12px;
}

/* Main Dashboard Wrapper */
.wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Header */
.affiliate-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    z-index: 1030;
    display: flex;
    align-items: center;
    padding: 0 1rem;
}
.affiliate-header .navbar-brand {
    font-weight: 600;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100%;
    background-color: var(--dark-bg);
    z-index: 1020;
    padding-top: var(--header-height); /* Space for the header */
    transition: margin-left 0.3s ease-in-out;
}
.sidebar .nav-link {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
}
.sidebar .nav-link.active {
    background-color: var(--primary-color);
}
.sidebar .dropdown-toggle {
    cursor: pointer;
}

/* Main Content */
.main-content {
    margin-top: var(--header-height);
    margin-left: var(--sidebar-width);
    padding: 1.5rem;
    overflow-y: auto;
    height: calc(100vh - var(--header-height));
    transition: margin-left 0.3s ease-in-out;
}

/* Sidebar Collapsed State (Desktop) */
body.sidebar-collapsed .sidebar {
    margin-left: calc(-1 * var(--sidebar-width));
}
body.sidebar-collapsed .main-content {
    margin-left: 0;
}

/* Mobile View (< 768px) */
@media (max-width: 768px) {
    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width)); /* Hidden by default on mobile */
        z-index: 1040; /* Above overlay */
    }
    .main-content {
        margin-left: 0 !important; /* Full width */
    }

    /* When sidebar is open on mobile */
    body.sidebar-open .sidebar {
        margin-left: 0;
    }
    
    /* Overlay for mobile */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0,0,0,0.5);
        z-index: 1035;
    }
    body.sidebar-open .sidebar-overlay {
        display: block;
    }
}


/* Dashboard Stat Card Enhancements */
.stat-card .h5 {
    font-size: 2.25rem; /* Increased font size for balance */
    font-weight: 700;
}
.stat-card .text-xs {
    font-size: 0.9rem; /* Slightly larger label text */
    letter-spacing: 0.5px;
}

/* Dashboard Notification Bar */
.rules-notification {
    background-color: #f8d7da; /* Light red background */
    color: #721c24; /* Dark red text */
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.rules-notification a {
    color: #721c24;
    font-weight: 600;
    text-decoration: underline;
}
.rules-notification .btn-close {
    filter: invert(20%) sepia(50%) saturate(2000%) hue-rotate(330deg); /* Makes the 'x' red */
}