:root {
    --primary-color: #447793;
    --primary-light: #5a8aa6;
    --primary-dark: #2d5a74;
    --card-background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    --card-border: #e8e8e8;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --text-primary: #262626;
    --text-secondary: #8c8c8c;
    --text-number: #1890ff;
    --trend-up: #70b3a4;
    --trend-down: #d19a9a;
    --page-background: #f0f4f8;
    --sidebar-width: 260px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--page-background);
    margin: 0;
    padding: 0;
}

.page-container {
    display: flex;
    min-height: 100vh;
}

.sales-sidebar {
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--card-border);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.sidebar-subtitle {
    font-size: 12px;
    opacity: 0.9;
}

.sales-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.sales-list::-webkit-scrollbar {
    width: 4px;
}

.sales-list::-webkit-scrollbar-track {
    background: transparent;
}

.sales-list::-webkit-scrollbar-thumb {
    background: #d9d9d9;
    border-radius: 2px;
}

.sales-card {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-bottom: 8px;
    border: 1px solid transparent;
}

.sales-card:hover {
    background: #f0f4f8;
    border-color: var(--card-border);
}

.sales-card.active {
    background: linear-gradient(135deg, rgba(24, 144, 255, 0.1) 0%, rgba(24, 144, 255, 0.05) 100%);
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.15);
}

/* 树形结构样式 */
.sales-group {
    margin-bottom: 4px;
}

.sales-parent {
    position: relative;
    padding-left: 36px;
    font-weight: 600;
}

.sales-expand-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.sales-group.expanded .sales-expand-icon i {
    transform: rotate(0deg);
}

.sales-children {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 20px;
}

.sales-group.expanded .sales-children {
    max-height: 1000px;
}

.sales-child {
    padding: 10px 12px;
    margin-bottom: 4px;
    font-size: 13px;
}

.sales-child .sales-avatar {
    width: 36px;
    height: 36px;
    font-size: 14px;
}

.sales-child .sales-name {
    font-size: 13px;
    font-weight: 500;
}

.sales-child .sales-count {
    font-size: 11px;
}

.sales-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    color: white;
    margin-right: 12px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.sales-info {
    flex: 1;
    min-width: 0;
}

.sales-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sales-card.active .sales-name {
    color: var(--primary-color);
}

.sales-count {
    font-size: 12px;
    color: var(--text-secondary);
}

.sales-count span {
    color: var(--primary-color);
    font-weight: 600;
}

.main-content {
    flex: 1;
    min-height: 100vh;
}

.masonry-grid {
    column-count: 3;
    column-gap: 20px;
    padding: 0 6px;
}

@media (max-width: 1400px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (max-width: 1024px) {
    .masonry-grid {
        column-count: 1;
    }
}

.customer-card {
    background: var(--card-background);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    break-inside: avoid;
    margin-bottom: 20px;
    cursor: pointer;
    overflow: hidden;
}

.customer-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    transform: translateY(-4px);
}

.customer-card-header {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.customer-card-body {
    padding: 16px;
}

.customer-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.value-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.filter-btn {
    transition: all 0.2s ease;
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.filter-btn:hover {
    background-color: var(--primary-light);
    color: white;
    border-color: var(--primary-light);
}

.breadcrumb {
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.loading-trigger {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.loading-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-more-data {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
    font-size: 14px;
}

.stats-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--card-border);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.stats-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.active {
    background: #70b3a4;
    box-shadow: 0 0 6px rgba(82, 196, 26, 0.4);
}

.status-dot.inactive {
    background: #faad14;
}

.status-dot.risk {
    background: #d19a9a;
    box-shadow: 0 0 6px rgba(255, 77, 79, 0.4);
}

.search-input {
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

.scroll-to-top {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: white;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.assigned-sales {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #f6ffed;
    border-radius: 6px;
    font-size: 12px;
}
