/* Theme 2: Clean Card Style - Material Design 2.0 */

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

:root {
    /* Colors */
    --primary: #696cff;
    --primary-light: #f3f0ff;
    --secondary: #8592a3;
    --success: #71dd37;
    --info: #03c3ec;
    --warning: #ffab00;
    --danger: #ff3e1d;
    
    /* Backgrounds */
    --bg-body: #f5f5f9;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    
    /* Text */
    --text-primary: #5f6368;
    --text-heading: #384551;
    --text-muted: #6c757d;
    --text-light: #a5acb8;
    
    /* Borders */
    --border-color: #e7e7e7;
    --border-light: #f0f2f8;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(58, 53, 65, 0.06);
    --shadow-sm: 0 2px 6px rgba(58, 53, 65, 0.1);
    --shadow-md: 0 4px 8px rgba(58, 53, 65, 0.1);
    --shadow-lg: 0 6px 14px rgba(58, 53, 65, 0.12);
    
    /* Layout */
    --sidebar-width: 260px;
    --navbar-height: 64px;
    --spacing: 24px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: all 0.25s ease-in-out;
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.sidebar.collapsed {
    margin-left: calc(-1 * var(--sidebar-width));
}

/* Logo Section */
.logo-section {
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-light);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: #ffffff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.logo-text {
    margin-left: 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-heading);
}

/* Navigation Menu */
.nav-menu {
    padding: 16px 0;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    padding: 8px 24px;
    margin-top: 16px;
}

.nav-section-title:first-child {
    margin-top: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 400;
    position: relative;
}

.nav-item i {
    font-size: 16px;
    width: 20px;
    margin-right: 12px;
    color: var(--text-muted);
}

.nav-item:hover {
    background: var(--bg-body);
    color: var(--text-heading);
}

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

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    border-left: 3px solid var(--primary);
    padding-left: 21px;
    font-weight: 500;
}

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

/* Main Wrapper */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: all 0.25s ease-in-out;
}

.main-wrapper.expanded {
    margin-left: 0;
}

/* Top Navbar */
.top-navbar {
    height: var(--navbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 999;
}

.navbar-left,
.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    color: var(--text-muted);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.btn-icon:hover {
    background: var(--bg-body);
    color: var(--text-heading);
}

.btn-icon-sm {
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0;
}

.btn-icon-sm:hover {
    color: var(--text-heading);
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    background: var(--danger);
    color: #ffffff;
    font-size: 10px;
    font-weight: 600;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-card);
}

/* Search Wrapper */
.search-wrapper {
    position: relative;
    width: 300px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.search-input {
    width: 100%;
    height: 40px;
    padding: 0 14px 0 40px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 13px;
    background: var(--bg-body);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.search-input::placeholder {
    color: var(--text-light);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(105, 108, 255, 0.08);
}

/* User Menu */
.user-toggle {
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--border-light);
}

.user-dropdown {
    min-width: 280px;
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: 6px;
    padding: 8px 0;
    margin-top: 8px;
}

.user-dropdown-header {
    padding: 16px 20px;
}

.user-avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.user-name-large {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-heading);
}

.user-email {
    font-size: 13px;
    color: var(--text-muted);
}

.user-dropdown .dropdown-item {
    padding: 10px 20px;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.user-dropdown .dropdown-item:hover {
    background: var(--bg-body);
    color: var(--primary);
}

.user-dropdown .dropdown-divider {
    margin: 8px 0;
    border-color: var(--border-light);
}

/* Page Content */
.page-content {
    padding: var(--spacing);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 24px;
}

.page-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

/* Stats Cards */
.stats-card {
    background: var(--bg-card);
    border-radius: 6px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    height: 100%;
}

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

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.stats-icon-wrapper {
    width: 42px;
    height: 42px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.stats-icon-wrapper.revenue {
    background: rgba(105, 108, 255, 0.12);
    color: var(--primary);
}

.stats-icon-wrapper.clicks {
    background: rgba(3, 195, 236, 0.12);
    color: var(--info);
}

.stats-icon-wrapper.conversions {
    background: rgba(113, 221, 55, 0.12);
    color: var(--success);
}

.stats-icon-wrapper.epc {
    background: rgba(255, 171, 0, 0.12);
    color: var(--warning);
}

.stats-body {
    flex: 1;
}

.stats-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.stats-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 8px;
    line-height: 1;
}

.stats-change {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
}

.stats-change.positive {
    color: var(--success);
}

.stats-change.negative {
    color: var(--danger);
}

.stats-change i {
    font-size: 14px;
}

.change-label {
    color: var(--text-muted);
    font-weight: 400;
}

/* Clean Cards */
.card-clean {
    background: var(--bg-card);
    border-radius: 6px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    height: 100%;
}

.card-header-clean {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 20px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 2px;
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

/* Chart Containers */
.chart-container {
    height: 320px;
    position: relative;
}

.chart-container-sm {
    height: 200px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Conversion Metrics */
.conversion-metrics {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.metric-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.metric-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.metric-dot.primary {
    background: var(--primary);
}

.metric-dot.gray {
    background: #e7e7e7;
}

.metric-label {
    font-size: 13px;
    color: var(--text-muted);
}

.metric-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-heading);
}

/* Tables */
.table-clean {
    margin-bottom: 0;
    font-size: 14px;
}

.table-clean thead th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: transparent;
    border-top: none;
    border-bottom: 1px solid var(--border-light);
    padding: 12px 16px;
}

.table-clean tbody td {
    padding: 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

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

.table-clean tbody tr:hover {
    background: var(--bg-body);
}

/* Offer Thumbnails */
.offer-thumbnail {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.offer-thumbnail.dating {
    background: rgba(255, 62, 29, 0.12);
    color: var(--danger);
}

.offer-thumbnail.finance {
    background: rgba(3, 195, 236, 0.12);
    color: var(--info);
}

.offer-thumbnail.ecommerce {
    background: rgba(113, 221, 55, 0.12);
    color: var(--success);
}

.offer-thumbnail.software {
    background: rgba(255, 171, 0, 0.12);
    color: var(--warning);
}

.offer-thumbnail.gaming {
    background: rgba(105, 108, 255, 0.12);
    color: var(--primary);
}

.offer-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-heading);
    margin-bottom: 2px;
}

.offer-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* Badges */
.badge-pill {
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-pill.dating {
    background: rgba(255, 62, 29, 0.12);
    color: var(--danger);
}

.badge-pill.finance {
    background: rgba(3, 195, 236, 0.12);
    color: var(--info);
}

.badge-pill.ecommerce {
    background: rgba(113, 221, 55, 0.12);
    color: var(--success);
}

.badge-pill.software {
    background: rgba(255, 171, 0, 0.12);
    color: var(--warning);
}

.badge-pill.gaming {
    background: rgba(105, 108, 255, 0.12);
    color: var(--primary);
}

.badge-status {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge-status.success {
    background: rgba(113, 221, 55, 0.12);
    color: var(--success);
}

.badge-status.warning {
    background: rgba(255, 171, 0, 0.12);
    color: var(--warning);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: #5f62ff;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(105, 108, 255, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.btn-sm {
    padding: 7px 16px;
    font-size: 13px;
}

.btn-outline-secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.btn-outline-secondary:hover,
.btn-outline-secondary.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* Responsive Design */
@media (max-width: 1199px) {
    .chart-container {
        height: 280px;
    }
}

@media (max-width: 991px) {
    :root {
        --sidebar-width: 0;
    }
    
    .sidebar {
        margin-left: calc(-1 * 260px);
    }
    
    .sidebar.collapsed {
        margin-left: 0;
    }
    
    .main-wrapper {
        margin-left: 0;
    }
    
    .search-wrapper {
        display: none;
    }
}

@media (max-width: 767px) {
    .page-content {
        padding: 16px;
    }
    
    .page-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .top-navbar {
        padding: 0 16px;
    }
    
    .stats-card {
        padding: 16px;
    }
    
    .stats-value {
        font-size: 24px;
    }
    
    .card-clean {
        padding: 16px;
    }
    
    .chart-container {
        height: 240px;
    }
}

@media (max-width: 575px) {
    .card-header-clean {
        flex-direction: column;
        gap: 12px;
    }
    
    .btn-group {
        width: 100%;
    }
    
    .btn-group .btn {
        flex: 1;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}
