/* ===================== 全局重置 ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif; background: #f0f2f5; color: #303133; font-size: 14px; }
button { cursor: pointer; border: none; outline: none; }
input, select, textarea { outline: none; font-family: inherit; }
a { text-decoration: none; color: inherit; }

/* ===================== 登录页 ===================== */
.login-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a2980 0%, #26d0ce 100%);
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 48px 40px;
  width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.logo-icon { font-size: 48px; color: #1a2980; margin-bottom: 10px; }
.login-title { font-size: 22px; font-weight: 700; color: #1a2980; }
.login-subtitle { font-size: 12px; color: #909399; margin-top: 4px; }
.login-form .form-group { margin-bottom: 18px; }
.login-form label { display: block; font-size: 13px; color: #606266; margin-bottom: 6px; font-weight: 500; }
.login-form input {
  width: 100%; padding: 10px 14px;
  border: 1px solid #dcdfe6; border-radius: 8px;
  font-size: 14px; transition: border-color .2s;
}
.login-form input:focus { border-color: #409eff; box-shadow: 0 0 0 2px rgba(64,158,255,0.1); }
.demo-accounts { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; font-size: 12px; color: #909399; }
.demo-accounts button {
  padding: 3px 10px; border: 1px solid #dcdfe6; border-radius: 12px;
  font-size: 12px; background: #f5f7fa; color: #606266; transition: all .2s;
}
.demo-accounts button:hover { border-color: #409eff; color: #409eff; background: #ecf5ff; }
.btn-login {
  width: 100%; padding: 12px;
  background: linear-gradient(135deg, #1a2980, #26d0ce);
  color: #fff; border-radius: 8px; font-size: 16px; font-weight: 600;
  transition: opacity .2s; letter-spacing: 4px;
}
.btn-login:hover { opacity: .9; }

/* ===================== 布局 ===================== */
.top-header {
  height: 56px; background: #fff;
  border-bottom: 1px solid #ebeef5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.header-left { display: flex; align-items: center; gap: 12px; }
.menu-toggle { background: none; font-size: 18px; color: #606266; padding: 4px 8px; border-radius: 4px; }
.menu-toggle:hover { background: #f5f7fa; }
.sys-name { font-size: 16px; font-weight: 700; color: #1a2980; }
.header-right { display: flex; align-items: center; gap: 12px; }
.user-badge {
  padding: 3px 10px; border-radius: 12px;
  font-size: 12px; font-weight: 500;
  background: #ecf5ff; color: #409eff;
}
.user-name { font-size: 14px; color: #303133; font-weight: 500; }
.btn-logout {
  padding: 6px 14px; border-radius: 6px;
  background: #fff; border: 1px solid #dcdfe6;
  color: #606266; font-size: 13px; transition: all .2s;
}
.btn-logout:hover { border-color: #f56c6c; color: #f56c6c; }

.main-layout { display: flex; min-height: 100vh; padding-top: 56px; }

.sidebar {
  width: 220px; background: #fff;
  border-right: 1px solid #ebeef5;
  position: fixed; top: 56px; left: 0; bottom: 0;
  overflow-y: auto; transition: width .2s;
  box-shadow: 2px 0 8px rgba(0,0,0,0.04);
}
.sidebar.collapsed { width: 0; overflow: hidden; }

.sidebar-nav { padding: 12px 0; }
.nav-group-title {
  padding: 10px 20px 4px;
  font-size: 11px; color: #909399; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; cursor: pointer;
  color: #606266; font-size: 14px;
  border-left: 3px solid transparent;
  transition: all .15s;
}
.nav-item:hover { background: #f5f7fa; color: #409eff; }
.nav-item.active { background: #ecf5ff; color: #409eff; border-left-color: #409eff; font-weight: 600; }
.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto; background: #f56c6c; color: #fff;
  font-size: 11px; padding: 1px 6px; border-radius: 10px; min-width: 18px; text-align: center;
}

.content-area { margin-left: 220px; padding: 24px; flex: 1; min-height: calc(100vh - 56px); transition: margin-left .2s; }
.content-area.expanded { margin-left: 0; }

/* ===================== 通用组件 ===================== */
.page-header { margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; }
.page-title { font-size: 20px; font-weight: 700; color: #1a2980; }
.page-subtitle { font-size: 13px; color: #909399; margin-top: 2px; }

/* 卡片 */
.card {
  background: #fff; border-radius: 10px;
  padding: 20px; margin-bottom: 20px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}
.card-title { font-size: 15px; font-weight: 600; color: #303133; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #f0f2f5; }

/* 统计卡片 */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: #fff; border-radius: 10px; padding: 20px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  display: flex; align-items: center; gap: 16px;
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.stat-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.stat-icon.blue { background: #ecf5ff; }
.stat-icon.green { background: #f0f9eb; }
.stat-icon.orange { background: #fdf6ec; }
.stat-icon.red { background: #fef0f0; }
.stat-info .stat-value { font-size: 28px; font-weight: 700; color: #303133; }
.stat-info .stat-label { font-size: 13px; color: #909399; margin-top: 2px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  background: #fafafa; padding: 12px 14px;
  text-align: left; font-size: 13px; font-weight: 600; color: #606266;
  border-bottom: 1px solid #ebeef5; white-space: nowrap;
}
td { padding: 12px 14px; border-bottom: 1px solid #f0f2f5; font-size: 13px; color: #303133; }
tr:hover td { background: #fafafa; }

/* 状态标签 */
.status-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 500;
}
.status-tag.pending { background: #fdf6ec; color: #e6a23c; }
.status-tag.admin-review { background: #ecf5ff; color: #409eff; }
.status-tag.gm-review { background: #f0f9eb; color: #67c23a; }
.status-tag.finance-pending { background: #e8f4fd; color: #2980b9; }
.status-tag.rejected { background: #fef0f0; color: #f56c6c; }
.status-tag.completed { background: #f0f9eb; color: #67c23a; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 6px; font-size: 13px; font-weight: 500; transition: all .15s; cursor: pointer; border: none; }
.btn-primary { background: #409eff; color: #fff; }
.btn-primary:hover { background: #337ab7; }
.btn-success { background: #67c23a; color: #fff; }
.btn-success:hover { background: #55a02e; }
.btn-danger { background: #f56c6c; color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-warning { background: #e6a23c; color: #fff; }
.btn-warning:hover { background: #c67c1b; }
.btn-default { background: #fff; color: #606266; border: 1px solid #dcdfe6; }
.btn-default:hover { border-color: #409eff; color: #409eff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* 表单 */
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 16px; }
.form-row.full { grid-template-columns: 1fr; }
.form-row.three { grid-template-columns: repeat(3, 1fr); }
.form-item { display: flex; flex-direction: column; gap: 6px; }
.form-item label { font-size: 13px; color: #606266; font-weight: 500; }
.form-item label .required { color: #f56c6c; margin-left: 2px; }
.form-item input, .form-item select, .form-item textarea {
  padding: 9px 12px; border: 1px solid #dcdfe6; border-radius: 6px;
  font-size: 14px; color: #303133; transition: border-color .2s;
  background: #fff;
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus {
  border-color: #409eff; box-shadow: 0 0 0 2px rgba(64,158,255,0.1);
}
.form-item textarea { resize: vertical; min-height: 80px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 16px; border-top: 1px solid #f0f2f5; margin-top: 8px; }

/* 筛选栏 */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filter-bar input, .filter-bar select { padding: 7px 12px; border: 1px solid #dcdfe6; border-radius: 6px; font-size: 13px; }
.filter-bar input { width: 180px; }

/* 模态框 */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 999;
}
.modal-box {
  background: #fff; border-radius: 12px;
  width: 90%; max-width: 680px; max-height: 85vh;
  overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-header {
  padding: 18px 24px 14px; border-bottom: 1px solid #f0f2f5;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: #fff; z-index: 1;
}
.modal-title { font-size: 16px; font-weight: 700; color: #303133; }
.modal-close { background: none; font-size: 18px; color: #909399; padding: 2px 6px; border-radius: 4px; }
.modal-close:hover { background: #f5f7fa; color: #303133; }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 14px 24px; border-top: 1px solid #f0f2f5; display: flex; justify-content: flex-end; gap: 10px; }

/* Toast */
.toast {
  position: fixed; top: 72px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.75); color: #fff;
  padding: 10px 24px; border-radius: 8px; font-size: 14px;
  z-index: 9999; pointer-events: none;
}
.toast.success { background: #67c23a; }
.toast.error { background: #f56c6c; }
.toast.warning { background: #e6a23c; }

/* 空状态 */
.empty-state { text-align: center; padding: 60px 20px; color: #909399; }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state .empty-text { font-size: 14px; }

/* 流程图 */
.flow-steps { display: flex; align-items: center; gap: 0; margin: 12px 0; flex-wrap: wrap; }
.flow-step { display: flex; flex-direction: column; align-items: center; min-width: 80px; }
.flow-step-dot {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  background: #c0c4cc;
}
.flow-step-dot.done { background: #67c23a; }
.flow-step-dot.active { background: #409eff; box-shadow: 0 0 0 4px rgba(64,158,255,0.2); }
.flow-step-dot.rejected { background: #f56c6c; }
.flow-step-label { font-size: 11px; color: #909399; margin-top: 4px; text-align: center; }
.flow-arrow { width: 40px; height: 2px; background: #dcdfe6; margin-bottom: 18px; position: relative; }
.flow-arrow.done { background: #67c23a; }
.flow-arrow::after { content: ''; position: absolute; right: -4px; top: -3px; border: 4px solid transparent; border-left-color: inherit; }

/* 详情项 */
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.detail-item { display: flex; flex-direction: column; gap: 3px; }
.detail-item .detail-label { font-size: 12px; color: #909399; }
.detail-item .detail-value { font-size: 14px; color: #303133; font-weight: 500; }
.detail-item.full { grid-column: 1 / -1; }

/* 附件预览区 */
.attach-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.attach-item {
  padding: 6px 12px; background: #f5f7fa; border-radius: 6px;
  border: 1px solid #dcdfe6; font-size: 12px; color: #606266;
  display: flex; align-items: center; gap: 6px;
}

/* 时间线 */
.timeline { padding: 0; }
.timeline-item { display: flex; gap: 12px; margin-bottom: 16px; }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; background: #409eff; margin-top: 4px; flex-shrink: 0; position: relative; }
.timeline-dot::after { content: ''; position: absolute; top: 10px; left: 4px; width: 2px; height: calc(100% + 6px); background: #dcdfe6; }
.timeline-item:last-child .timeline-dot::after { display: none; }
.timeline-content .tl-title { font-size: 13px; font-weight: 600; color: #303133; }
.timeline-content .tl-time { font-size: 12px; color: #909399; margin-top: 2px; }
.timeline-content .tl-remark { font-size: 12px; color: #606266; margin-top: 4px; background: #f5f7fa; padding: 6px 10px; border-radius: 6px; }

/* 角色颜色 */
.role-employee { color: #409eff; background: #ecf5ff; }
.role-admin { color: #67c23a; background: #f0f9eb; }
.role-gm { color: #e6a23c; background: #fdf6ec; }
.role-finance { color: #9b59b6; background: #f3e8ff; }
.role-superadmin { color: #f56c6c; background: #fef0f0; }

/* 搜索高亮 */
mark { background: #fff3cd; padding: 0 2px; border-radius: 2px; }

/* 响应式 */
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .sidebar { width: 0; }
  .content-area { margin-left: 0; }
  .modal-box { max-width: 95%; }
}

/* 分页 */
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 16px; }
.page-btn {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border: 1px solid #dcdfe6; border-radius: 4px; font-size: 13px; background: #fff; color: #606266; cursor: pointer;
}
.page-btn:hover { border-color: #409eff; color: #409eff; }
.page-btn.active { background: #409eff; border-color: #409eff; color: #fff; }

/* 进度条 */
.progress-bar { height: 6px; background: #ebeef5; border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #409eff, #67c23a); border-radius: 3px; transition: width .3s; }

/* 标签 */
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; }

/* 通知小红点 */
.notify-dot { width: 8px; height: 8px; border-radius: 50%; background: #f56c6c; display: inline-block; margin-left: 4px; }

/* 金额颜色 */
.amount-large { font-size: 20px; font-weight: 700; color: #1a2980; }
.amount-medium { font-weight: 600; color: #303133; }

/* 卡片悬浮 */
.hover-card { transition: transform .2s, box-shadow .2s; }
.hover-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.1); }
