:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --accent-gradient: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: #3b82f6;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --background: #f8fafc;
    --sidebar-bg: #ffffff;
    --card-background: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    min-height: 80px;
    box-sizing: border-box;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-header {
    padding: 1.5rem 0.5rem;
    justify-content: center;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex-shrink: 0;
    transition: all 0.3s ease;
    object-fit: cover;
}

.sidebar.collapsed .sidebar-logo {
    width: 35px;
    height: 35px;
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-brand {
    opacity: 0;
    width: 0;
    font-size: 0;
}

.sidebar-toggle {
    background: var(--accent-gradient);
    border: none;
    color: white;
    font-size: 0.9rem;
    padding: 0.4rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.sidebar.collapsed .sidebar-toggle {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    margin-top: 0.5rem;
}

.sidebar-toggle:hover {
    background: linear-gradient(135deg, #224abe 0%, #1e3a8a 100%);
    transform: translateY(-50%) scale(1.05);
}

.sidebar.collapsed .sidebar-toggle:hover {
    transform: scale(1.05);
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 1rem 0;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 1.5rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .nav-section-title {
    opacity: 0;
    height: 0;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin: 0 1rem 0.5rem;
}

.sidebar.collapsed .nav-item {
    margin: 0 0.5rem 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .nav-link {
    padding: 0.875rem 0.5rem;
    justify-content: center;
    gap: 0;
}

.nav-link:hover {
    background: rgba(78, 115, 223, 0.08);
    color: #4e73df;
    text-decoration: none;
    transform: translateX(4px);
}

.sidebar.collapsed .nav-link:hover {
    transform: translateX(0) scale(1.05);
}

.nav-link.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.nav-link.active:hover {
    transform: translateX(0);
}

.sidebar.collapsed .nav-link.active:hover {
    transform: scale(1.05);
}

.nav-icon {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.nav-text {
    transition: all 0.3s ease;
    overflow: hidden;
}

.sidebar.collapsed .nav-text {
    opacity: 0;
    width: 0;
    font-size: 0;
}

/* Profile Section Header Styles */
.nav-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    user-select: none;
}

.nav-section-header:hover {
    background: rgba(78, 115, 223, 0.05);
}

.sidebar.collapsed .nav-section-header {
    padding: 0 0.5rem;
    justify-content: center;
}

.nav-section-content .nav-item {
    margin: 0 2rem 0.5rem;
}

.nav-section-content .nav-link {
    font-size: 0.85rem;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    opacity: 0.9;
}

.nav-section-content .nav-link:hover {
    color: #4e73df;
    opacity: 1;
}

.nav-section-content .nav-link.active {
    background: rgba(78, 115, 223, 0.1);
    color: #4e73df;
    opacity: 1;
}

.nav-section-content .nav-icon {
    font-size: 1rem;
    opacity: 0.8;
}

.sidebar.collapsed .nav-section-content .nav-item {
    margin: 0 0.5rem 0.5rem;
}

.nav-section-toggle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

.sidebar.collapsed .nav-section-toggle {
    opacity: 0;
    width: 0;
}

.nav-section-toggle i {
    transition: transform 0.3s ease;
}

.nav-section-toggle.rotated i {
    transform: rotate(180deg);
}

.nav-section-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-section-content.collapsed {
    max-height: 0;
}

.sidebar.collapsed .nav-section-content {
    max-height: 1000px !important;
}

.nav-section-header .nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
    padding: 0;
}

.nav-section-header {
    padding: 0 1.5rem !important;
    margin-left: 0 !important;
    margin-bottom: 0.75rem;
}

.nav-section:has(.nav-section-header)>.nav-section-title {
    display: none;
}

.nav-section-header+.nav-section-title {
    display: none;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed+.main-content {
    margin-left: 70px;
}

/* Top Navigation */
.top-navbar {
    background: var(--card-background);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 999;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.top-navbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.top-user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 12px;
    transition: background 0.3s ease;
    position: relative;
}

.top-user-profile:hover {
    background: var(--background);
}

.top-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.top-user-info {
    text-align: right;
}

.top-user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.top-user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
}

.content-area {
    padding: 2rem;
    max-width: 100%;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-title-main {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.page-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Plan Badge Styles */
.plan-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    font-size: 0.85rem;
    border: 2px solid transparent;
}

.plan-badge.free {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.1), rgba(156, 163, 175, 0.1));
    border-color: rgba(107, 114, 128, 0.2);
    color: #6b7280;
}

.plan-badge.premium {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.1));
    border-color: rgba(245, 158, 11, 0.3);
    color: #d97706;
}

.plan-badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.plan-badge.free:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.1));
    border-color: #f59e0b;
    color: #d97706;
}

.plan-badge.free:hover .upgrade-hint {
    opacity: 1;
    transform: translateY(0);
}

.plan-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.plan-badge.free .plan-icon {
    color: #9ca3af;
}

.plan-badge.premium .plan-icon {
    color: #f59e0b;
    animation: crownGlow 2s ease-in-out infinite;
}

@keyframes crownGlow {

    0%,
    100% {
        text-shadow: 0 0 5px rgba(245, 158, 11, 0.3);
    }

    50% {
        text-shadow: 0 0 15px rgba(245, 158, 11, 0.6);
    }
}

.plan-info {
    flex: 1;
    min-width: 0;
}

.plan-name {
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.plan-subtitle {
    font-size: 0.75rem;
    opacity: 0.8;
    line-height: 1.2;
    white-space: nowrap;
}

.upgrade-hint {
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    animation: upgradeFloat 2s ease-in-out infinite;
}

@keyframes upgradeFloat {

    0%,
    100% {
        transform: translateY(5px);
    }

    50% {
        transform: translateY(0px);
    }
}

.plan-badge.premium .upgrade-hint {
    display: none;
}

/* Shimmer effect for free plan */
.plan-badge.free::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.2), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Coming Soon Badge Styles */
.nav-badge.coming-soon {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-left: auto;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    animation: comingSoonPulse 3s ease-in-out infinite;
}

@keyframes comingSoonPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.5);
    }
}

.nav-badge.coming-soon::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: comingSoonShimmer 2.5s ease-in-out infinite;
}

@keyframes comingSoonShimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

.nav-link.coming-soon-link {
    cursor: not-allowed;
    opacity: 0.8;
    position: relative;
}

.nav-link.coming-soon-link:hover {
    background: rgba(99, 102, 241, 0.08);
    color: #6366f1;
    transform: translateX(2px);
}

.nav-link.coming-soon-link:hover .nav-badge.coming-soon {
    animation-play-state: paused;
    transform: scale(1.1);
}

/* Alert Messages */
.alert-container {
    margin-bottom: 2rem;
}

.custom-alert {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.alert-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--warning-color);
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.alert-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.alert-link {
    color: var(--warning-color);
    text-decoration: none;
    font-weight: 600;
}

.alert-link:hover {
    text-decoration: underline;
}

/* Tier Info */
.tier-info {
    background: linear-gradient(135deg, rgba(78, 115, 223, 0.1), rgba(78, 115, 223, 0.05));
    border: 1px solid rgba(78, 115, 223, 0.2);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tier-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(78, 115, 223, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4e73df;
    flex-shrink: 0;
}

.tier-content {
    flex: 1;
}

.tier-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.tier-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Filters Section */
.filters-section {
    background: var(--card-background);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.filters-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filter-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.filters-grid {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr auto auto;
    gap: 1.5rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.filter-input {
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: white;
}

.filter-input:focus {
    border-color: #4e73df;
    box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.1);
    outline: none;
}

.btn-filter {
    background: var(--accent-gradient);
    border: none;
    color: white;
    padding: 0.875rem 2rem;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    height: fit-content;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-filter:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-clear {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.875rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    height: fit-content;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-clear:hover {
    border-color: var(--error-color);
    color: var(--error-color);
    background: rgba(239, 68, 68, 0.05);
    transform: translateY(-1px);
}

/* Compact Referrer Cards */
.referrers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.referrer-card {
    background: var(--card-background);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.referrer-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(78, 115, 223, 0.15);
}

.card-header {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.company-logo {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(78, 115, 223, 0.15);
    transition: all 0.3s ease;
    overflow: hidden;
}

.company-logo:hover {
    transform: scale(1.03);
}

.company-info {
    flex: 1;
    min-width: 0;
}

.company-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.referrer-designation {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.referrer-name {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.card-body {
    padding: 1.25rem;
}

.referrer-details {
    margin-bottom: 1rem;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

.detail-icon {
    width: 14px;
    color: #4e73df;
    text-align: center;
    font-size: 0.75rem;
}

.detail-text {
    color: var(--text-secondary);
    font-weight: 500;
}

.referrer-notes {
    background: rgba(248, 250, 252, 0.8);
    padding: 0.75rem;
    border-radius: 8px;
    border-left: 3px solid #4e73df;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Contact Button States */
.contact-main-btn {
    width: 100%;
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.contact-main-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.contact-main-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.contact-options {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.contact-options.show {
    display: grid;
}

.contact-btn {
    padding: 0.6rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    border: 2px solid transparent;
}

.contact-btn.whatsapp {
    background: #25d366;
    color: white;
    border-color: #25d366;
}

.contact-btn.whatsapp:hover {
    background: #128c7e;
    border-color: #128c7e;
    color: white;
    transform: translateY(-2px);
}

.contact-btn.linkedin {
    background: #0077b5;
    color: white;
    border-color: #0077b5;
}

.contact-btn.linkedin:hover {
    background: #005885;
    border-color: #005885;
    color: white;
    transform: translateY(-2px);
}

.contact-btn.email {
    background: #ea4335;
    color: white;
    border-color: #ea4335;
}

.contact-btn.email:hover {
    background: #c23321;
    border-color: #c23321;
    color: white;
    transform: translateY(-2px);
}

/* Free Tier Limit */
.reached-limit {
    opacity: 0.6;
    pointer-events: none;
}

.reached-limit .contact-main-btn {
    background: var(--text-muted);
    cursor: not-allowed;
}

/* Referrer Section Header */
.referrers-section {
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.results-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-background);
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.empty-icon {
    width: 80px;
    height: 80px;
    background: rgba(78, 115, 223, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4e73df;
    font-size: 2rem;
    margin: 0 auto 1.5rem;
}

.empty-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* Loading State */
.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: #4e73df;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.sidebar-overlay.show {
    display: block;
}

/* ====================================== */
/* RESPONSIVE DESIGN - MOBILE & TABLET   */
/* ====================================== */

/* Large Tablets (1024px and below) */
@media (max-width: 1024px) {
    .filters-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 1rem;
    }

    .filter-group:nth-child(4),
    .filter-group:nth-child(5) {
        grid-column: span 3;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .referrers-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* Tablets (768px and below) */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar.collapsed {
        width: 280px;
    }

    .main-content,
    .sidebar.collapsed+.main-content {
        margin-left: 0;
    }

    .top-navbar {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .top-navbar-right {
        gap: 1rem;
        flex-wrap: wrap;
    }

    .plan-badge {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
        min-width: auto;
    }

    .plan-subtitle {
        display: none;
    }

    .top-user-profile {
        padding: 0.25rem;
    }

    .top-user-avatar {
        width: 32px;
        height: 32px;
    }

    .top-user-name {
        font-size: 0.8rem;
    }

    .top-user-role {
        font-size: 0.7rem;
    }

    .content-area {
        padding: 1rem;
    }

    .page-title-main {
        font-size: 2rem;
        line-height: 1.2;
    }

    .page-subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .filters-section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
        border-radius: 16px;
    }

    .filters-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group:nth-child(4),
    .filter-group:nth-child(5) {
        grid-column: span 1;
        display: flex;
        flex-direction: column;
    }

    .btn-filter,
    .btn-clear {
        padding: 1rem 2rem;
        font-size: 1rem;
        width: 100%;
        justify-content: center;
    }

    .filters-header {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
    }

    .filters-header h3 {
        font-size: 1.125rem;
    }

    .referrers-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .card-header {
        padding: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .results-count {
        font-size: 0.85rem;
    }

    /* Better Alert Styling on Mobile */
    .custom-alert,
    .tier-info {
        padding: 1rem;
        margin-bottom: 1rem;
        flex-direction: column;
        text-align: center;
    }

    .alert-icon,
    .tier-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 1rem;
    }

    .alert-title,
    .tier-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .alert-text,
    .tier-description {
        font-size: 0.85rem;
        line-height: 1.5;
    }
}

/* Mobile Phones (480px and below) */
@media (max-width: 480px) {
    .page-title-main {
        font-size: 1.75rem;
    }

    .page-subtitle {
        font-size: 0.9rem;
    }

    .filters-section {
        padding: 1rem;
        border-radius: 12px;
    }

    .filters-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .filters-header h3 {
        font-size: 1rem;
    }

    .filter-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .btn-filter,
    .btn-clear {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
    }

    /* Improved Card Layout on Mobile */
    .referrer-card {
        border-radius: 12px;
    }

    .card-header {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .company-logo {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        align-self: center;
    }

    .company-info {
        text-align: center;
    }

    .company-name {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    .referrer-designation {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .referrer-name {
        justify-content: center;
        font-size: 0.8rem;
    }

    .card-body {
        padding: 1rem;
    }

    .contact-options {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .contact-btn {
        padding: 0.75rem;
        font-size: 0.85rem;
        justify-content: center;
    }

    .section-header {
        gap: 1rem;
    }

    .plan-icon {
        font-size: 1rem;
    }
}

/* Extra Small Mobile (360px and below) */
@media (max-width: 360px) {
    .content-area {
        padding: 0.75rem;
    }

    .page-title-main {
        font-size: 1.5rem;
    }

    .page-subtitle {
        font-size: 0.85rem;
    }

    .filters-section {
        padding: 0.75rem;
    }

    .btn-filter,
    .btn-clear {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

    .referrer-card {
        margin: 0 -0.25rem;
    }

    .company-logo {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .company-name {
        font-size: 1rem;
    }

    .referrer-designation {
        font-size: 0.8rem;
    }

    .referrer-name {
        font-size: 0.75rem;
    }
}

/* Landscape Mobile Devices */
@media (max-width: 768px) and (orientation: landscape) {
    .page-header {
        margin-bottom: 1rem;
    }

    .page-title-main {
        font-size: 1.75rem;
    }

    .page-subtitle {
        font-size: 0.95rem;
    }

    .filters-section {
        padding: 1rem;
    }

    .referrers-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

/* High DPI/Retina Displays */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .company-logo {
        border-width: 1px;
    }

    .top-user-avatar {
        border-width: 1px;
    }
}

/* Print Styles */
@media print {

    .sidebar,
    .top-navbar,
    .filters-section {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }

    .content-area {
        padding: 0;
    }

    .referrer-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* Emergency overflow fix */
html,
body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

.main-content {
    width: calc(100vw - 280px) !important;
    overflow-x: hidden !important;
}

.sidebar.collapsed+.main-content {
    width: calc(100vw - 70px) !important;
}

.content-area {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
}

/* Updated filters grid - only 3 columns for the input fields */
.filters-grid {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr;
    /* Only 3 columns for inputs */
    gap: 1.5rem;
    align-items: end;
    margin-bottom: 1.5rem;
    /* Add space before buttons */
}

/* New button container below the filters */
.filters-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    /* Align buttons to the left */
    align-items: center;
}

/* Alternative: Center the buttons */
.filters-buttons.center {
    justify-content: center;
}

/* Alternative: Right align the buttons */
.filters-buttons.right {
    justify-content: flex-end;
}

/* Ensure buttons maintain their styling */
.filters-buttons .btn-filter,
.filters-buttons .btn-clear {
    margin: 0;
    /* Remove any default margins */
    flex: 0 0 auto;
    /* Don't grow or shrink */
}

/* If you want just the clear button below, use this instead */
.filters-grid-with-search {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr auto;
    /* 4 columns - inputs + search button */
    gap: 1.5rem;
    align-items: end;
    margin-bottom: 1rem;
}

.clear-button-container {
    display: flex;
    justify-content: flex-start;
}

/* Mobile responsive updates */
@media (max-width: 1024px) {
    .filters-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .filters-buttons {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .filters-buttons .btn-filter,
    .filters-buttons .btn-clear {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .filters-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .filters-buttons {
        flex-direction: column;
        gap: 1rem;
    }

    .filters-buttons .btn-filter,
    .filters-buttons .btn-clear {
        width: 100%;
        padding: 1rem 2rem;
        font-size: 1rem;
        justify-content: center;
    }
}

.referrer-card.reached-limit {
    position: relative;
    opacity: 0.7;
}

.referrer-card.reached-limit::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    z-index: 10;
    border-radius: 16px;
    pointer-events: none;
}

.referrer-card.reached-limit::after {
    content: 'Upgrade to Premium to contact more referrers';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #4e73df, #224abe);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    z-index: 11;
    box-shadow: 0 4px 12px rgba(78, 115, 223, 0.3);
    cursor: pointer;
}

.referrer-card.reached-limit:hover::after {
    transform: translate(-50%, -50%) scale(1.05);
}

@media (max-width: 768px) {
    .referrer-card.reached-limit::after {
        font-size: 0.8rem;
        padding: 0.75rem 1rem;
    }
}

/* Add this to your css/referral.css file */

/* Pagination Styles */
.pagination-container {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.pagination-btn {
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    background: white;
    color: #6b7280;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 44px;
    justify-content: center;
}

.pagination-btn:hover {
    background: #f8fafc;
    border-color: #4e73df;
    color: #4e73df;
    transform: translateY(-1px);
}

.pagination-btn.active {
    background: linear-gradient(135deg, #4e73df, #224abe);
    border-color: #4e73df;
    color: white;
    font-weight: 600;
}

.pagination-btn.active:hover {
    background: linear-gradient(135deg, #224abe, #1e3a8a);
    transform: translateY(-1px);
}

.pagination-dots {
    padding: 0 0.5rem;
    color: #9ca3af;
    font-weight: 500;
}

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination {
        padding: 0.75rem 1rem;
        gap: 0.25rem;
    }
    
    .pagination-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        min-width: 40px;
    }
    
    /* Hide page numbers on very small screens, keep only prev/next */
    @media (max-width: 480px) {
        .pagination-btn:not(:first-child):not(:last-child) {
            display: none;
        }
        
        .pagination-dots {
            display: none;
        }
    }
}

/* Loading state for pagination */
.pagination-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Smooth transition for grid updates */
.referrers-grid {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}