/* ============================================
   凯达盛航国际供应链管理 - 全局样式
   ============================================ */

:root {
    --primary: #1976d2;
    --primary-dark: #1565c0;
    --primary-light: #e3f2fd;
    --sidebar-bg: #1a1a2e;
    --sidebar-hover: #16213e;
    --header-bg: #ffffff;
    --body-bg: #f0f2f5;
    --text-primary: #1a1a2e;
    --text-secondary: #666;
    --text-muted: #999;
    --border-color: #e8e8e8;
    --card-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--body-bg);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ========== 顶部导航栏 ========== */
.top-header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.header-left { display: flex; align-items: center; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; color: var(--text-primary); }
.logo i { color: var(--primary); font-size: 24px; }

.header-nav { display: flex; align-items: center; gap: 4px; margin-left: 40px; flex: 1; }
.nav-link { padding: 8px 16px; border-radius: 8px; font-size: 15px; color: var(--text-secondary); transition: all 0.2s; }
.nav-link:hover { background: var(--primary-light); color: var(--primary); }
.nav-link.active { background: var(--primary); color: #fff; }
.nav-link i { margin-right: 6px; }

.header-right { display: flex; align-items: center; }
.user-info { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--text-secondary); }
.user-info i.fa-user-circle { font-size: 24px; color: var(--primary); }
.logout-link { margin-left: 8px; color: var(--text-muted); padding: 4px; }
.logout-link:hover { color: #e53935; }
.login-btn { padding: 8px 20px; background: var(--primary); color: #fff; border-radius: 8px; font-size: 15px; }
.login-btn:hover { background: var(--primary-dark); color: #fff; }

/* ========== 布局 ========== */
.layout {
    display: flex;
    margin-top: 56px;
    min-height: calc(100vh - 56px - 50px);
}

/* ========== 侧边栏 ========== */
.sidebar {
    width: 220px;
    background: var(--sidebar-bg);
    padding: 20px 0;
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 50px;
    overflow-y: auto;
}

.sidebar-section { margin-bottom: 8px; }
.sidebar-title { padding: 8px 20px; font-size: 12px; text-transform: uppercase; color: rgba(255,255,255,0.4); letter-spacing: 1px; }
.sidebar-link { display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: rgba(255,255,255,0.7); font-size: 15px; transition: all 0.2s; }
.sidebar-link:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-link.active { background: var(--primary); color: #fff; }
.sidebar-link i { width: 18px; text-align: center; }

/* ========== 主内容区 ========== */
.main-content {
    margin-left: 220px;
    flex: 1;
    padding: 24px;
    min-height: calc(100vh - 56px - 50px);
}

.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 22px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.page-header h1 i { color: var(--primary); }
.text-muted { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

/* ========== 快捷入口卡片 ========== */
.quick-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-bottom: 24px; }

.quick-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--card-shadow);
    transition: all 0.2s;
    cursor: pointer;
}
.quick-card:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(0,0,0,0.10); color: inherit; }

.card-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.card-icon i { font-size: 24px; }

.card-info h3 { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.card-info p { font-size: 12px; color: var(--text-muted); margin: 0; }
.card-arrow { margin-left: auto; color: #ddd; font-size: 12px; }

/* ========== 面板 ========== */
.panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
}
.panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border-color);
}
.panel-header h2 { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.panel-header h2 i { color: var(--primary); }
.panel-more { font-size: 15px; color: var(--primary); }
.panel-body { padding: 16px 20px; }

.badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* ========== 公告列表 ========== */
.announcement-list { display: flex; flex-direction: column; gap: 0; }
.announcement-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0; border-bottom: 1px solid #f5f5f5;
}
.announcement-item:last-child { border-bottom: none; }
.announcement-title { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.announcement-title i { color: #f57c00; font-size: 14px; }
.announcement-date { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* ========== 数据表格 ========== */
.data-table { display: flex; flex-direction: column; }
.data-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0; border-bottom: 1px solid #f5f5f5;
}
.data-row:last-child { border-bottom: none; }
.data-cell.main-cell { display: flex; align-items: center; flex: 1; font-size: 15px; }
.data-cell.date-cell { font-size: 13px; color: var(--text-muted); white-space: nowrap; margin-left: 16px; }

.tag { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 12px; margin-left: 8px; }
.tag-tinymce { background: #e8f5e9; color: #388e3c; }
.tag-onlyoffice { background: #e3f2fd; color: #1976d2; }

/* ========== 统计 ========== */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.stat-item { text-align: center; padding: 12px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.stat-label i { margin-right: 4px; }

/* ========== 内容网格 ========== */
.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ========== 分页 ========== */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 16px; padding-top: 16px; border-top: 1px solid #f5f5f5; }
.page-btn { padding: 6px 14px; border: 1px solid #ddd; background: #fff; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text-secondary); }
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ========== 工具栏 ========== */
.toolbar { margin-bottom: 8px; }
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 20px; border-radius: 8px; font-size: 14px; cursor: pointer; border: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }

/* ========== 统计卡片 ========== */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-card { background: #fff; border: 1px solid #eee; border-radius: 8px; padding: 14px 16px; text-align: center; }
.stat-num { font-size: 22px; font-weight: 700; }
.stat-num.blue { color: #1a56db; }
.stat-num.green { color: #16a34a; }
.stat-num.orange { color: #d97706; }
.stat-num.red { color: #dc2626; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ========== 筛选栏 ========== */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; padding: 10px 14px; background: #fafafa; border-radius: 6px; border: 1px solid #eee; }
.filter-bar select, .filter-bar input { padding: 6px 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; background: #fff; }

/* ========== 报销列表 ========== */
.expense-table { display: flex; flex-direction: column; }
.expense-row {
    display: grid;
    grid-template-columns: 3fr 1.5fr 1.5fr 1fr 1fr 1fr;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background 0.15s;
}
.expense-row:hover { background: #fafbfe; }
.expense-row:last-child { border-bottom: none; }
.expense-cell-title { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.expense-cell-title i { color: #e65100; }
.expense-cell-applicant { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.expense-cell-category { font-size: 12px; color: #666; background: #f0f0f0; padding: 1px 8px; border-radius: 3px; display: inline-block; }
.expense-cell-date { font-size: 12px; color: var(--text-muted); }
.expense-cell-amount { font-size: 15px; font-weight: 700; color: #e53935; text-align: right; }
.expense-cell-status { text-align: center; }
.expense-cell-actions { text-align: center; }
.expense-cell-actions .act-btn { display: inline-block; padding: 2px 10px; font-size: 11px; border: 1px solid #ddd; border-radius: 3px; background: #fff; margin: 0 2px; }
.expense-cell-actions .act-btn.approve { color: #16a34a; border-color: #16a34a; }
.expense-cell-actions .act-btn.reject { color: #dc2626; border-color: #dc2626; }

/* ========== 附件链接 ========== */
.attach-link { display: inline-block; padding: 4px 12px; background: #f5f5f5; border-radius: 4px; font-size: 12px; margin: 2px 4px 2px 0; }
.attach-link:hover { background: #eee; }

/* ========== 文件列表（表单上传） ========== */
.file-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.file-item:hover { background: #f5f5f5; border-radius: 4px; }
.file-item .btn-remove { opacity: 0.5; background: none; border: none; color: #e53935; cursor: pointer; font-size: 14px; padding: 2px 6px; }
.file-item:hover .btn-remove { opacity: 1; }

/* ========== 审批时间线 ========== */
.timeline { position: relative; padding-left: 24px; margin: 12px 0; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 4px; bottom: 4px; width: 2px; background: #e0e0e0; }
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item::before { content: ''; position: absolute; left: -20px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #e0e0e0; }
.timeline-item.done::before { background: #1a56db; }
.timeline-item.approved::before { background: #16a34a; }
.timeline-item.rejected::before { background: #dc2626; }
.timeline-item.active::before { background: #d97706; box-shadow: 0 0 0 3px rgba(217,119,6,0.2); }
.timeline-item .time { font-size: 11px; color: #999; }
.timeline-item .desc { font-size: 13px; margin-top: 2px; }


/* ========== 状态标签 ========== */
.status-tag { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 500; }
.status-draft { background: #f5f5f5; color: #999; }
.status-pending { background: #fff3e0; color: #e65100; }
.status-approved { background: #e8f5e9; color: #2e7d32; }
.status-rejected { background: #ffebee; color: #c62828; }
.status-completed { background: #e0f7fa; color: #00838f; }
.status-cancelled { background: #f5f5f5; color: #999; }
.status-paid { background: #e8f5e9; color: #2e7d32; }
.status-no_show { background: #ffebee; color: #c62828; }
.status-overtime { background: #e8eaf6; color: #283593; }
.status-late-early { background: #fce4ec; color: #ad1457; }
.status-paid { background: #e0f7fa; color: #00838f; }

/* ========== 表单 ========== */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; color: #555; font-size: 14px; font-weight: 500; }
.form-group label i { margin-right: 6px; color: var(--primary); }
.form-input {
    width: 100%; padding: 10px 14px; border: 1px solid var(--border-color); border-radius: 8px;
    font-size: 14px; transition: border-color 0.2s; box-sizing: border-box;
    font-family: inherit; background: #fff;
}
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(25,118,210,0.10); }
textarea.form-input { resize: vertical; }
select.form-input { appearance: auto; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.btn-sm { padding: 5px 14px; font-size: 13px; }

/* ========== 详情页 ========== */
.detail-grid { display: flex; flex-direction: column; }
.detail-row {
    display: flex; padding: 14px 0; border-bottom: 1px solid #f5f5f5;
}
.detail-label { width: 120px; flex-shrink: 0; font-size: 13px; color: var(--text-muted); }
.detail-label i { margin-right: 6px; width: 16px; }
.detail-value { flex: 1; font-size: 14px; color: var(--text-primary); }

/* ========== 错误提示 ========== */
.error-msg { background: #ffebee; color: #c62828; padding: 10px 14px; border-radius: 8px; font-size: 13px; }

/* ========== 状态提示 ========== */
.loading-tip, .empty-tip { text-align: center; padding: 30px 0; color: var(--text-muted); font-size: 14px; }
.loading-tip i, .empty-tip i { margin-right: 6px; }

/* ========== 页脚 ========== */
.footer {
    background: var(--header-bg);
    border-top: 1px solid var(--border-color);
    height: 50px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    margin-left: 220px;
}
.footer-inner { font-size: 13px; color: var(--text-muted); }
.footer-sep { margin: 0 12px; }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; }
    .footer { margin-left: 0; }
    .header-nav { display: none; }
    .quick-cards { grid-template-columns: 1fr; }
    .content-grid { grid-template-columns: 1fr; }
}
