/* EShare CRM 系统样式 */

:root {
    --eshare-primary: #1e7feb;
    --eshare-secondary: #0d6efd;
    --eshare-success: #198754;
    --eshare-danger: #dc3545;
    --eshare-warning: #ffc107;
    --eshare-info: #0dcaf0;
    --eshare-light: #f8f9fa;
    --eshare-dark: #212529;
    --eshare-gray: #6c757d;
    --eshare-sidebar-bg: #2c3e50;
    --eshare-sidebar-text: #ecf0f1;
    --eshare-header-bg: #ffffff;
    --eshare-border: #dee2e6;
    --eshare-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* 全局样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f6fa;
    color: var(--eshare-dark);
    line-height: 1.6;
}

.page-wrapper {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 260px;
    background: linear-gradient(135deg, var(--eshare-sidebar-bg) 0%, #34495e 100%);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar-header {
    padding: 1.5rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header .logo {
    height: 40px;
    transition: all 0.3s ease;
}

.sidebar.collapsed .logo {
    height: 30px;
}

.sidebar-header h4 {
    color: var(--eshare-sidebar-text);
    margin-top: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.sidebar.collapsed .sidebar-header h4 {
    display: none;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-item {
    margin-bottom: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--eshare-sidebar-text);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 0;
    margin: 0 0.5rem;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transform: translateX(5px);
}

.nav-link.active {
    background-color: var(--eshare-primary);
    color: #ffffff;
}

.nav-link i {
    width: 20px;
    margin-right: 0.75rem;
    text-align: center;
    font-size: 1.125rem;
}

.sidebar.collapsed .nav-link span {
    display: none;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    margin: 0.25rem;
    border-radius: 0.375rem;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    margin-left: 260px;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed + .main-content {
    margin-left: 70px;
}

/* 顶部导航栏 */
.topbar {
    background: var(--eshare-header-bg);
    border-bottom: 1px solid var(--eshare-border);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--eshare-shadow);
    position: sticky;
    top: 0;
    z-index: 999;
}

.topbar-left {
    display: flex;
    align-items: center;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--eshare-gray);
    margin-right: 1rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background-color: var(--eshare-light);
    color: var(--eshare-primary);
}

.breadcrumb {
    background: none;
    padding: 0;
    margin: 0;
    font-size: 0.95rem;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-dropdown .dropdown-toggle {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    color: var(--eshare-dark);
    font-size: 0.95rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 0.5rem;
    background-color: var(--eshare-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

/* 页面内容 */
.page-content {
    padding: 1.5rem;
}

.page-title {
    margin-bottom: 1.5rem;
}

.page-title h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--eshare-dark);
    margin: 0;
}

.page-title .subtitle {
    color: var(--eshare-gray);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

/* 卡片样式 */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.075);
    border-radius: 0.5rem;
    overflow: hidden;
}

.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--eshare-border);
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: var(--eshare-dark);
}

.card-body {
    padding: 1.25rem;
}

/* 统计卡片 */
.stats-card {
    background: linear-gradient(135deg, var(--eshare-primary) 0%, var(--eshare-secondary) 100%);
    color: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(30px, -30px);
}

.stats-card.success {
    background: linear-gradient(135deg, var(--eshare-success) 0%, #20c997 100%);
}

.stats-card.warning {
    background: linear-gradient(135deg, var(--eshare-warning) 0%, #ffca2c 100%);
}

.stats-card.danger {
    background: linear-gradient(135deg, var(--eshare-danger) 0%, #e74c3c 100%);
}

.stats-card .icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.stats-card .number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stats-card .label {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* 表格样式 */
.table-responsive {
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--eshare-shadow);
}

.dataTables_wrapper {
    padding: 0;
}

.dataTables_filter input {
    border-radius: 0.375rem;
    border: 1px solid var(--eshare-border);
    padding: 0.5rem 0.75rem;
}

.dataTables_length select {
    border-radius: 0.375rem;
    border: 1px solid var(--eshare-border);
    padding: 0.5rem;
}

/* 按钮样式 */
.btn-eshare {
    background-color: var(--eshare-primary);
    border-color: var(--eshare-primary);
    color: white;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.btn-eshare:hover {
    background-color: var(--eshare-secondary);
    border-color: var(--eshare-secondary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(30, 127, 235, 0.25);
}

.btn-outline-eshare {
    color: var(--eshare-primary);
    border-color: var(--eshare-primary);
    background-color: transparent;
}

.btn-outline-eshare:hover {
    background-color: var(--eshare-primary);
    border-color: var(--eshare-primary);
    color: white;
}

/* 表单样式 */
.form-control {
    border-radius: 0.375rem;
    border: 1px solid var(--eshare-border);
    padding: 0.5rem 0.75rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--eshare-primary);
    box-shadow: 0 0 0 0.125rem rgba(30, 127, 235, 0.25);
}

.form-select {
    border-radius: 0.375rem;
    border: 1px solid var(--eshare-border);
}

.form-select:focus {
    border-color: var(--eshare-primary);
    box-shadow: 0 0 0 0.125rem rgba(30, 127, 235, 0.25);
}

/* 状态标签 */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background-color: rgba(255, 193, 7, 0.2);
    color: #996600;
}

.status-approved {
    background-color: rgba(25, 135, 84, 0.2);
    color: #0f5132;
}

.status-rejected {
    background-color: rgba(220, 53, 69, 0.2);
    color: #721c24;
}

.status-completed {
    background-color: rgba(13, 202, 240, 0.2);
    color: #055160;
}

/* 优先级标签 */
.priority-low {
    color: var(--eshare-success);
}

.priority-medium {
    color: var(--eshare-warning);
}

.priority-high {
    color: var(--eshare-danger);
}

.priority-urgent {
    color: #dc3545;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* 模态框样式 */
.modal-content {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid var(--eshare-border);
    padding: 1.25rem;
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    border-top: 1px solid var(--eshare-border);
    padding: 1.25rem;
}

/* 图表容器 */
.chart-container {
    position: relative;
    height: 300px;
    margin: 1rem 0;
}

/* 加载动画 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.spinner-border {
    color: var(--eshare-primary);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar.collapsed + .main-content {
        margin-left: 0;
    }
    
    .page-content {
        padding: 1rem;
    }
    
    .topbar {
        padding: 0.5rem 1rem;
    }
    
    .stats-card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .page-title h1 {
        font-size: 1.5rem;
    }
    
    .stats-card {
        padding: 1rem;
    }
    
    .stats-card .number {
        font-size: 1.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
}

/* 滚动条样式 */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 过渡动画 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 工具提示 */
.tooltip-inner {
    background-color: var(--eshare-dark);
    color: white;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

/* 选项卡样式 */
.nav-tabs {
    border-bottom: 2px solid var(--eshare-border);
}

.nav-tabs .nav-link {
    border: none;
    color: var(--eshare-gray);
    font-weight: 500;
    padding: 0.75rem 1rem;
    margin-bottom: -2px;
    border-bottom: 2px solid transparent;
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    color: var(--eshare-primary);
}

.nav-tabs .nav-link.active {
    color: var(--eshare-primary);
    background-color: transparent;
    border-bottom-color: var(--eshare-primary);
}

/* 进度条 */
.progress {
    height: 8px;
    border-radius: 4px;
    background-color: rgba(30, 127, 235, 0.1);
}

.progress-bar {
    background-color: var(--eshare-primary);
    border-radius: 4px;
}

/* 时间轴 */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--eshare-border);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.375rem;
    top: 0.5rem;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background-color: var(--eshare-primary);
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--eshare-primary);
}

.timeline-content {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: var(--eshare-shadow);
    margin-left: 0.5rem;
}

/* 文件上传区域 */
.upload-area {
    border: 2px dashed var(--eshare-border);
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--eshare-primary);
    background-color: rgba(30, 127, 235, 0.05);
}

.upload-area.dragover {
    border-color: var(--eshare-primary);
    background-color: rgba(30, 127, 235, 0.1);
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    min-width: 300px;
    max-width: 400px;
}

.alert-dismissible .btn-close {
    padding: 0.75rem;
}

/* 数据为空状态 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--eshare-gray);
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--eshare-dark);
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* 打印样式 */
@media print {
    .sidebar,
    .topbar,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .page-content {
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #000;
    }
} 