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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #f5f7fa;
    color: #333;
    min-height: 100vh;
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.sidebar-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.sidebar-header h2 {
    margin: 0;
    padding-right: 50px;
    font-size: 1.5em;
    font-weight: 600;
    color: white;
}

.sidebar-header .version {
    margin: 5px 0 0 0;
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

/* 侧边栏隐藏状态 */
.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .sidebar-header h2,
.sidebar.collapsed .version,
.sidebar.collapsed .menu-text {
    display: none;
}

.sidebar.collapsed .sidebar-toggle {
    right: 15px;
    left: 15px;
}

.sidebar.collapsed .menu-icon {
    margin-right: 0;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
}

.menu-item {
    margin: 0;
}

.menu-item a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.menu-item a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: white;
}

.menu-item.active a {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-left-color: white;
    font-weight: 500;
}

.menu-icon {
    font-size: 1.3em;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.menu-text {
    font-size: 1em;
}

/* 主内容区域 */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 0;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* 侧边栏隐藏时主内容区域 */
.sidebar.collapsed ~ .main-content {
    margin-left: 70px;
}

.content-header {
    background: white;
    padding: 25px 30px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.content-header h1 {
    margin: 0;
    font-size: 1.8em;
    font-weight: 600;
    color: #333;
}

.customers-list,
.salespeople-list,
.products-list,
.brands-list,
.employees-list,
.schedules-list {
    padding: 30px;
}

/* 卡片视图自适应布局 */
.customers-list,
.brands-list,
.employees-list,
.products-list,
.schedules-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* opportunities-list 样式在 style_opportunity.css 中定义 */
.opportunities-list {
    padding: 30px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: white;
    color: #667eea;
}

.btn-primary:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
    background: #667eea;
    color: white;
}

.btn-small:hover {
    background: #5568d3;
}

.search-box {
    margin-right: 10px;
}

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

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.view-toggle {
    display: flex;
    gap: 5px;
    background: #f0f0f0;
    padding: 4px;
    border-radius: 6px;
    z-index: 10;
    position: relative;
}

.btn-view-toggle {
    background: transparent;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 1.2em;
    color: #666;
}

.btn-view-toggle:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.btn-view-toggle.active,
.btn-icon.active {
    background: #667eea;
    color: white;
}

/* 表格视图样式 */
.customers-table-container,
.products-table-container,
.employees-table-container,
.opportunities-table-container,
.schedules-table-container {
    padding: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

/* 日历视图样式 */
.schedules-calendar-container {
    padding: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.calendar-header h2 {
    margin: 0;
    font-size: 1.5em;
    color: #333;
    font-weight: 600;
}

.calendar-grid {
    width: 100%;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    margin-bottom: 1px;
}

.calendar-weekday {
    padding: 12px;
    text-align: center;
    font-weight: 600;
    color: #667eea;
    background: #f8f9fa;
    font-size: 14px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e0e0e0;
}

.calendar-day {
    min-height: 120px;
    background: white;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.calendar-day:hover {
    background: #f8f9fa;
    transform: scale(1.02);
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.calendar-day.empty {
    background: #fafafa;
    cursor: default;
}

.calendar-day.empty:hover {
    transform: none;
    box-shadow: none;
}

.calendar-day.today {
    background: #fff8e1;
    border: 2px solid #667eea;
}

.calendar-day.today .calendar-day-number {
    background: #667eea;
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.calendar-day-number {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.calendar-day-schedules {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    max-height: calc(120px - 40px);
}

.calendar-schedule-item {
    background: #f0f0f0;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    border-left: 3px solid #667eea;
}

.calendar-schedule-item:hover {
    background: #e0e0e0;
    transform: translateX(2px);
}

.calendar-schedule-item.status-planned {
    border-left-color: #ff9800;
    background: #fff3e0;
}

.calendar-schedule-item.status-active {
    border-left-color: #2196f3;
    background: #e3f2fd;
}

.calendar-schedule-item.status-completed {
    border-left-color: #4caf50;
    background: #e8f5e9;
}

.calendar-schedule-item.status-cancelled {
    border-left-color: #9e9e9e;
    background: #f5f5f5;
    opacity: 0.6;
}

.schedule-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.schedule-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #333;
}

.calendar-schedule-more {
    font-size: 11px;
    color: #666;
    text-align: center;
    padding: 2px;
    font-style: italic;
}

/* 日历单元格溢出指示器（红色小点） */
.calendar-day-overflow-indicator {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    background: #e74c3c;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(231, 76, 60, 0.5);
    animation: pulse-dot 2s infinite;
    z-index: 2;
}

@keyframes pulse-dot {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* 排期弹出面板 */
.schedule-popup {
    position: fixed;
    width: 280px;
    max-height: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    display: none;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.schedule-popup-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.schedule-popup-date {
    font-weight: 600;
    font-size: 14px;
}

.schedule-popup-count {
    font-size: 12px;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
}

.schedule-popup-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
}

.schedule-popup-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid #667eea;
}

.schedule-popup-item:last-child {
    margin-bottom: 0;
}

.schedule-popup-item:hover {
    background: #e9ecef;
    transform: translateX(4px);
}

.schedule-popup-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.schedule-popup-product {
    font-weight: 600;
    font-size: 13px;
    color: #333;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 8px;
}

.schedule-popup-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

.schedule-popup-status.status-planned {
    background: #e3f2fd;
    color: #1565c0;
}

.schedule-popup-status.status-active {
    background: #fff3e0;
    color: #ef6c00;
}

.schedule-popup-status.status-completed {
    background: #e8f5e9;
    color: #2e7d32;
}

.schedule-popup-status.status-cancelled {
    background: #ffebee;
    color: #c62828;
}

.schedule-popup-item-info {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #666;
}

.schedule-popup-item-type {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
}

.schedule-popup-tip {
    text-align: center;
    font-size: 11px;
    color: #999;
    padding: 8px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

/* 日历视图响应式 */
@media (max-width: 768px) {
    .schedules-calendar-container {
        padding: 15px;
    }
    
    .calendar-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .calendar-header h2 {
        font-size: 1.2em;
    }
    
    .calendar-day {
        min-height: 80px;
        padding: 4px;
    }
    
    .calendar-day-number {
        font-size: 14px;
    }
    
    .calendar-schedule-item {
        font-size: 10px;
        padding: 2px 4px;
    }
    
    .calendar-weekday {
        padding: 8px 4px;
        font-size: 12px;
    }
}

.customers-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.customers-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.customers-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.customers-table th:first-child {
    border-radius: 8px 0 0 0;
}

.customers-table th:last-child {
    border-radius: 0 8px 0 0;
}

.customers-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.customers-table tbody tr:hover {
    background: #f8f9fa;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.customers-table tbody tr:active {
    background: #e9ecef;
}

.customers-table td {
    padding: 15px 12px;
    color: #555;
    vertical-align: middle;
}

.customers-table td:first-child {
    font-weight: 600;
    color: #667eea;
}

.customers-table .table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.customers-table .table-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.customers-table .table-actions .btn-view {
    background: #667eea;
    color: white;
}

.customers-table .table-actions .btn-view:hover {
    background: #5568d3;
}

.customers-table .table-actions .btn-edit {
    background: #28a745;
    color: white;
}

.customers-table .table-actions .btn-edit:hover {
    background: #218838;
}

.customers-table .table-actions .btn-delete {
    background: #dc3545;
    color: white;
}

.customers-table .table-actions .btn-delete:hover {
    background: #c82333;
}

.customers-table .contact-count {
    display: inline-block;
    background: #e7f3ff;
    color: #667eea;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.brand-tag {
    display: inline-block;
    background: #fff3cd;
    color: #856404;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 6px;
    margin-bottom: 4px;
    border: 1px solid #ffc107;
    white-space: nowrap;
}

.brand-tag:last-child {
    margin-right: 0;
}

/* 排期管理高亮样式 */
.schedule-customer-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    margin: 0 2px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.schedule-brand-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    margin: 0 2px;
    box-shadow: 0 2px 4px rgba(245, 87, 108, 0.3);
}

.schedule-product-line-badge {
    display: inline-block;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    margin: 0 2px;
    box-shadow: 0 2px 4px rgba(79, 172, 254, 0.3);
}

.schedule-spu-badge {
    display: inline-block;
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    margin: 0 2px;
    box-shadow: 0 2px 4px rgba(250, 112, 154, 0.3);
}

/* 客户评级徽章样式 */
.rating-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    min-width: 30px;
}

.rating-badge.rating-s {
    background: #ff6b6b;
    color: white;
}

.rating-badge.rating-a {
    background: #4ecdc4;
    color: white;
}

.rating-badge.rating-b {
    background: #45b7d1;
    color: white;
}

.rating-badge.rating-c {
    background: #f9ca24;
    color: #333;
}

.rating-badge.rating-d {
    background: #95a5a6;
    color: white;
}

.rating-badge:not(.rating-s):not(.rating-a):not(.rating-b):not(.rating-c):not(.rating-d) {
    background: #e0e0e0;
    color: #666;
}

/* 对接群状态标签样式 */
.group-chat-status-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
}

.group-chat-status-tag.status-active {
    background: #4caf50;
    color: white;
}

.group-chat-status-tag.status-occasional {
    background: #ff9800;
    color: white;
}

.group-chat-status-tag.status-dead {
    background: #f44336;
    color: white;
}

.group-chat-status-tag.status-none {
    background: #9e9e9e;
    color: white;
}

/* 添加对接群按钮样式 */
.btn-add-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 2px dashed #667eea;
    background: transparent;
    color: #667eea;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-status:hover {
    background: #667eea;
    color: white;
    border-style: solid;
}

.remove-status:hover {
    color: white !important;
}

/* 评级历史表格样式 */
.rating-history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
}

.rating-history-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.rating-history-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
}

.rating-history-table td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
}

.rating-history-table tbody tr:hover {
    background: #f8f9fa;
}

/* 确保表格列对齐 */
.customers-table td {
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.customers-table td:nth-child(8) {
    white-space: normal;
    max-width: 250px;
}

.customers-table td:nth-child(9) {
    white-space: normal;
    max-width: 300px;
    word-wrap: break-word;
}

.customers-table td:nth-child(9) .brand-tag {
    display: inline-block;
    margin: 2px 4px 2px 0;
    white-space: normal;
}

.customers-table .empty-table {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.customers-table .empty-table h3 {
    margin-bottom: 10px;
    color: #667eea;
}

/* 响应式设计 - 根据屏幕大小调整列数 */
@media (max-width: 1400px) {
    .customers-list,
    .brands-list,
    .employees-list,
    .products-list,
    .schedules-list {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 1200px) {
    .customers-list,
    .brands-list,
    .employees-list,
    .products-list,
    .schedules-list {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .customers-list,
    .brands-list,
    .employees-list,
    .products-list,
    .schedules-list {
        grid-template-columns: 1fr;
        padding: 20px;
    }
}

.customers-list[style*="display: none"],
.products-list[style*="display: none"] {
    display: none !important;
}

.customers-list .empty-state,
.brands-list .empty-state,
.employees-list .empty-state,
.products-list .empty-state,
.schedules-list .empty-state {
    grid-column: 1 / -1;
    text-align: center;
}

.customer-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    min-height: 280px;
    max-height: 600px;
    overflow: hidden;
    position: relative;
}

.customer-card::after {
    content: '点击查看详情';
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 0.75em;
    color: #999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.customer-card:hover::after {
    opacity: 1;
}

.customer-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

.customer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.customer-info h3 {
    color: #667eea;
    font-size: 1.2em;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-info .company {
    color: #6c757d;
    font-size: 1em;
    margin-bottom: 10px;
}

.customer-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
    font-size: 0.9em;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.customer-details div {
    color: #555;
    line-height: 1.5;
    word-wrap: break-word;
}

.customer-details div .brand-tag {
    display: inline-block;
    white-space: normal;
}

.customer-details .service-brands-row {
    flex-shrink: 0;
    margin: 4px 0;
}

.customer-details strong {
    color: #333;
    margin-right: 5px;
}

.customer-description {
    margin: 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    color: #666;
    font-style: italic;
    font-size: 0.85em;
    flex-shrink: 0;
    max-height: 80px;
    overflow-y: auto;
}

.contacts-list {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
    flex-shrink: 0;
    max-height: 200px;
    overflow-y: auto;
}

.contacts-list h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.contact-item {
    background: white;
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 5px;
    border-left: 3px solid #764ba2;
}

.contact-item strong {
    color: #333;
}

/* 移除actions样式，因为不再在卡片中显示按钮 */

/* Modal 样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 30px auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover {
    color: #000;
}

#modalTitle {
    margin-bottom: 20px;
    color: #667eea;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
    background-color: white;
}

.form-group select {
    cursor: pointer;
}

.form-group select[multiple] {
    min-height: 100px;
    padding: 8px;
}

.form-group select[multiple] option {
    padding: 6px;
    margin: 2px 0;
}

.form-group small {
    display: block;
    margin-top: 5px;
}

/* Compact multi-select */
.ms {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ms-selected {
    min-height: 38px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 4px 6px;
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    gap: 6px;
    background: #fff;
}

.ms-selected:empty::before {
    content: '请选择…';
    color: #999;
}

.ms-chip {
    background: #eef2ff;
    color: #4f46e5;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.2;
}

.ms-trigger {
    margin-top: 0;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
}

.ms-dropdown {
    position: absolute;
    z-index: 1000;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-top: 6px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    max-height: 220px;
    overflow-y: auto;
    display: none;
}

.ms-dropdown.open { display: block; }

/* 公司类型多选复选框组 */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 0;
}

.checkbox-group .checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px 12px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

.checkbox-group .checkbox-label:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.checkbox-group .checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.checkbox-group .checkbox-label:has(input:checked) {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 公司类型标签 */
.company-type-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #e8f0fe;
    color: #1967d2;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 4px;
    margin-bottom: 4px;
}

.ms-search {
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.ms-search input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.ms-options {
    display: block;
    padding: 8px;
    max-height: 220px;
    overflow-y: auto;
}

.ms-no-result {
    padding: 12px;
    text-align: center;
    color: #999;
    grid-column: 1 / -1;
}

.ms-option {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 8px;
    align-items: center;
    padding: 4px 6px;
    cursor: pointer;
    transition: background-color 0.2s;
    line-height: 1.3;
}

.ms-option:hover {
    background-color: #f5f5f5;
}

.ms-option input { 
    margin: 0 6px 0 0;
    cursor: pointer;
}

.ms-option label {
    cursor: pointer;
    flex: 1;
    user-select: none;
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.contacts-section {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid #eee;
}

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

.section-header h3 {
    color: #667eea;
    font-size: 1.2em;
}

.contact-field {
    background: #f8f9fa;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.contact-field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.contact-field-title {
    font-weight: 600;
    color: #667eea;
}

.contact-field-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
}

.status-active {
    background-color: #d4edda;
    color: #155724;
}

.status-inactive {
    background-color: #f8d7da;
    color: #721c24;
}

/* 客户列表响应式布局 */
@media (max-width: 1600px) {
    .customers-list,
    .schedules-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1200px) {
    .customers-list,
    .schedules-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .customers-list,
    .schedules-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
        overflow: visible;
    }

    .sidebar-header h2 {
        font-size: 1.2em;
        text-align: center;
        padding: 15px 5px;
    }

    .menu-text {
        display: none;
    }

    .menu-icon {
        margin-right: 0;
        font-size: 1.5em;
    }

    .menu-item a {
        justify-content: center;
        padding: 15px 10px;
    }

    .main-content {
        margin-left: 70px;
    }

    .content-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
        padding: 20px;
    }

    .content-header h1 {
        font-size: 1.5em;
    }

    .customer-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .customers-list,
    .schedules-list {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
        margin: 10px auto;
    }

    .contact-field-inputs {
        grid-template-columns: 1fr;
    }

    .customers-list {
        padding: 20px 15px;
    }
    
    .salespeople-list,
    .products-list,
    .brands-list,
    .employees-list,
    .schedules-list {
        padding: 20px 15px;
    }

    .form-row {
        grid-template-columns: 1fr !important;
    }

    .detail-grid {
        grid-template-columns: 1fr !important;
    }
}

/* 员工管理样式 */
.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
    margin-left: 8px;
}

.status-active {
    background-color: #d4edda;
    color: #155724;
}

.status-inactive {
    background-color: #f8d7da;
    color: #721c24;
}

.employee-detail {
    padding: 20px 0;
}

.detail-section {
    margin-bottom: 25px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0e0e0;
}

.detail-section h3 {
    margin: 0 0 15px 0;
    color: #667eea;
    font-size: 1.2em;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.detail-text {
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.communications-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.communications-section h3 {
    margin-bottom: 15px;
    color: #667eea;
}

.communication-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
}

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

.communication-type {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    margin-left: 10px;
}

.communication-location {
    display: inline-block;
    margin-left: 10px;
    color: #666;
    font-size: 0.9em;
}

.communication-summary {
    margin-bottom: 8px;
    font-weight: 500;
}

.communication-details {
    color: #666;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.btn-info {
    background-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.85em;
}

.empty-text {
    text-align: center;
    color: #999;
    padding: 20px;
}

.btn-link {
    background: none;
    border: none;
    color: #667eea;
    text-decoration: underline;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 0.9em;
}

.btn-link:hover {
    color: #764ba2;
}

.contact-synced {
    display: inline-block;
    color: #28a745;
    font-size: 0.85em;
    margin-left: 8px;
    font-weight: 500;
}

.contact-item {
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

/* employees-section 样式已在下面统一定义 */

.employee-card-mini {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
}

.employee-mini-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.employee-mini-position {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    margin-left: 8px;
}

.employee-mini-details {
    font-size: 0.9em;
    color: #666;
}

.contact-item-detail {
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 3px solid #667eea;
    transition: all 0.2s ease;
}

.contact-item-detail:hover {
    background: #e9ecef;
    transform: translateX(3px);
}

.detail-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.work-history-management {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.work-history-management .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.work-history-management h3 {
    margin: 0;
    color: #667eea;
    font-size: 1.1em;
}

.work-history-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.work-history-section h3 {
    margin-bottom: 15px;
    color: #667eea;
}

.work-history-item,
.work-history-item-form {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
}

.work-history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.work-history-item-details {
    font-size: 0.9em;
    color: #666;
}

.work-history-desc {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
    font-style: italic;
}

.badge-current {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    margin-left: 8px;
}

.change-logs-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.change-logs-section h3 {
    margin-bottom: 15px;
    color: #667eea;
}

.change-log-item {
    background: #fff3cd;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-left: 4px solid #ffc107;
    font-size: 0.9em;
}

.change-log-content {
    color: #856404;
    line-height: 1.6;
}

.change-log-content strong {
    color: #856404;
    font-weight: 600;
}


/* 产品渠道样式 */
.channels-section, .tags-section {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.channel-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.channel-card.main-channel {
    border-left: 4px solid #007bff;
}

.channel-card.distribution-channel {
    border-left: 4px solid #28a745;
}

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

.channel-header strong {
    font-size: 16px;
    color: #333;
}

.type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 10px;
    background: #007bff;
    color: white;
}

.follower-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 10px;
    background: #ffc107;
    color: #333;
}

.channel-content {
    color: #666;
}

.content-type {
    margin-bottom: 8px;
}

.price-item {
    display: inline-block;
    margin-right: 15px;
    margin-bottom: 5px;
}

.price-item .label {
    font-weight: 500;
    margin-right: 5px;
}

.price-item .value {
    color: #007bff;
    font-weight: bold;
}

.notes {
    margin-top: 10px;
    font-size: 14px;
    color: #888;
}

.channels-section h4 {
    margin: 15px 0 10px 0;
    color: #555;
    font-size: 16px;
}

.channels-section h4:first-child {
    margin-top: 0;
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header-row h3 {
    margin: 0;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #007bff;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    line-height: 1;
}

.btn-icon:hover {
    background: #0056b3;
    transform: rotate(90deg);
    box-shadow: 0 2px 8px rgba(0,123,255,0.3);
}

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

.tag-item {
    display: inline-block;
    background: #e7f3ff;
    padding: 5px 12px;
    border-radius: 15px;
    margin: 5px 10px 5px 0;
}

.tag-item span {
    margin-right: 8px;
}

.product-tags-list {
    margin: 10px 0;
}

.tag-item-mini {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin-right: 8px;
    margin-bottom: 5px;
}

.btn-small {
    padding: 5px 12px;
    font-size: 13px;
}


.detail-actions {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    gap: 10px;
}

/* detail-section 样式已在上面定义，这里不再重复 */

.highlight-number {
    color: #007bff;
    font-weight: bold;
    font-size: 18px;
}

.highlight-number-mini {
    color: #007bff;
    font-weight: bold;
    font-size: 16px;
}


/* 客户详情页面样式 */
.customer-detail-page {
    padding: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.detail-page-header {
    background: white;
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 50;
}

.detail-page-header h1 {
    margin: 0;
    font-size: 1.8em;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.detail-page-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.btn-back {
    background: #f0f0f0;
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #667eea;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
}

.btn-back:hover {
    background: #e0e0e0;
    transform: translateX(-2px);
}

.detail-page-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 30px;
    background: #f5f7fa;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.customer-detail {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 20px;
}

/* detail-page-actions 样式已移到 detail-page-header 中 */

.employees-section {
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0e0e0;
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.employees-section h3 {
    margin: 0 0 15px 0;
    color: #667eea;
    font-size: 1.2em;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    border-bottom: 2px solid transparent;
}
.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}
.tab-btn:hover {
    color: #667eea;
}

/* ========== 待定排期模块样式 ========== */
#pendingSchedulesContainer {
    margin-top: 20px;
    background: #fafbfc;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #eef0f2;
}

.pending-schedules-header {
    background: #f0f1f3;
    color: #666;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #eef0f2;
}

.pending-icon {
    font-size: 20px;
}

.pending-title {
    font-weight: 600;
    font-size: 16px;
    flex: 1;
}

.pending-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
}

.pending-schedules-body {
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 6px;
    min-height: 40px;
    transition: all 0.3s ease;
}

.pending-schedules-body.drop-target {
    background: rgba(33, 150, 243, 0.1);
}

.pending-schedules-body.drag-over {
    background: rgba(33, 150, 243, 0.2);
    border: 2px dashed #2196f3;
    border-radius: 8px;
}

.pending-schedules-body.drop-target-delete {
    background: rgba(231, 76, 60, 0.1);
    border: 2px dashed #e74c3c;
    border-radius: 8px;
}

.pending-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #999;
    padding: 10px;
    font-style: italic;
    font-size: 12px;
}

.pending-schedule-card {
    background: white;
    border-radius: 6px;
    padding: 6px 8px;
    cursor: grab;
    transition: all 0.2s ease;
    border-left: 3px solid #667eea;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pending-schedule-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #764ba2;
}

.pending-schedule-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.pending-schedule-card.status-planned {
    border-left-color: #ff9800;
}

.pending-schedule-card.status-active {
    border-left-color: #2196f3;
}

.pending-schedule-card.status-completed {
    border-left-color: #4caf50;
}

.pending-schedule-card.status-cancelled {
    border-left-color: #9e9e9e;
}

.pending-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.drag-handle {
    color: #999;
    cursor: grab;
    font-size: 14px;
}

.pending-product-name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pending-card-body {
    font-size: 12px;
}

.pending-info-row {
    display: flex;
    gap: 12px;
    color: #666;
    margin-bottom: 6px;
}

.pending-time-hint {
    color: #ff9800;
    font-weight: 500;
    margin-bottom: 6px;
}

.pending-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    background: #e3f2fd;
    color: #1565c0;
}

/* ========== 占位符卡片样式 ========== */
.placeholder-card {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    border: 2px dashed #9e9e9e;
    border-left: 4px dashed #9e9e9e;
    text-align: center;
    cursor: grab;
}

.placeholder-card:hover {
    background: linear-gradient(135deg, #e8e8e8 0%, #d5d5d5 100%);
    border-color: #757575;
}

.placeholder-icon {
    font-size: 16px;
    margin-bottom: 2px;
}

.placeholder-text {
    font-weight: 600;
    color: #666;
    font-size: 12px;
    margin-bottom: 2px;
}

.placeholder-hint {
    font-size: 10px;
    color: #999;
}

/* 日历中的占位符样式 */
.calendar-schedule-item.placeholder-item {
    background: #f5f5f5;
    border: 1px dashed #ccc;
    border-left: 3px dashed #9e9e9e;
    opacity: 0.8;
}

.calendar-schedule-item.placeholder-item:hover {
    background: #eeeeee;
    opacity: 1;
}

/* ========== 拖拽相关样式 ========== */
.calendar-day.drop-target {
    background: rgba(33, 150, 243, 0.05);
}

.calendar-day.drag-over {
    background: rgba(33, 150, 243, 0.15) !important;
    border: 2px dashed #2196f3 !important;
    transform: scale(1.02);
}

.calendar-day.drag-over .calendar-day-number {
    color: #2196f3;
    font-weight: 600;
}

.dragging {
    opacity: 0.5;
    cursor: grabbing !important;
}

/* 拖拽成功提示 */
.drag-success-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, #4caf50 0%, #43a047 100%);
    color: white;
    padding: 14px 28px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4);
    z-index: 100000;
    opacity: 0;
    transition: all 0.3s ease;
}

.drag-success-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.drag-success-toast.pending-toast {
    background: linear-gradient(135deg, #9e9e9e 0%, #757575 100%);
    box-shadow: 0 4px 20px rgba(158, 158, 158, 0.4);
}

/* 弹出面板中可拖拽的排期项 */
.schedule-popup-item[draggable="true"] {
    cursor: grab;
}

.schedule-popup-item[draggable="true"]:active {
    cursor: grabbing;
}

/* ========== 合同管理表格样式 ========== */
.contract-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: white;
}

.contract-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.contract-table th {
    padding: 14px 10px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    font-size: 13px;
}

.contract-table th:first-child {
    border-radius: 8px 0 0 0;
}

.contract-table th:last-child {
    border-radius: 0 8px 0 0;
}

.contract-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.contract-table tbody tr:hover {
    background: #f8f9fa;
}

.contract-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.contract-table tbody tr:nth-child(even):hover {
    background: #f0f2f5;
}

.contract-table td {
    padding: 12px 10px;
    color: #555;
    vertical-align: middle;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contract-table .contract-no {
    color: #667eea;
    font-weight: 600;
    font-size: 13px;
}

.contract-table .text-primary {
    color: #667eea;
    font-weight: 600;
}

.contract-table .text-muted {
    color: #999;
}

.contract-table .text-success {
    color: #28a745;
    font-weight: 500;
}

.contract-table .status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 0;
}

.contract-table .status-completed {
    background: #d4edda;
    color: #155724;
}

.contract-table .status-pending {
    background: #fff3cd;
    color: #856404;
}

.contract-table .status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.contract-table .btn-small {
    padding: 5px 12px;
    font-size: 12px;
}

/* 合同列表容器 */
#contractsList {
    padding: 20px 30px;
}

#contractsList .table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

#contractsList .data-table {
    margin: 0;
}

/* 响应式表格 */
@media (max-width: 1400px) {
    .contract-table td,
    .contract-table th {
        padding: 10px 8px;
        font-size: 12px;
    }
    
    .contract-table td {
        max-width: 120px;
    }
}

@media (max-width: 1200px) {
    #contractsList .table-container {
        overflow-x: auto;
    }
    
    .contract-table {
        min-width: 1100px;
    }
}

