/* ============ 全局样式 ============ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f3f5f9;
  color: #2c3e50;
  font-size: 14px;
}

/* ============ 登录页 ============ */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-card {
  width: 400px; background: #fff; border-radius: 12px;
  padding: 40px; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.login-card h1 {
  margin: 0 0 8px; font-size: 22px; text-align: center; color: #2c3e50;
}
.login-card .subtitle {
  text-align: center; color: #7f8c8d; margin-bottom: 30px; font-size: 13px;
}
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; margin-bottom: 6px; font-size: 13px; color: #34495e;
  font-weight: 500;
}
.form-control {
  width: 100%; padding: 10px 12px; border: 1px solid #dcdfe6;
  border-radius: 6px; font-size: 14px; outline: none;
  transition: border-color 0.2s;
}
.form-control:focus { border-color: #409eff; }
.btn-primary {
  width: 100%; padding: 12px; background: #409eff; color: #fff;
  border: none; border-radius: 6px; font-size: 15px; cursor: pointer;
  transition: background 0.2s;
}
.btn-primary:hover { background: #66b1ff; }
.alert {
  padding: 10px 14px; border-radius: 6px; margin-bottom: 16px;
  font-size: 13px;
}
.alert-error { background: #fef0f0; color: #f56c6c; border: 1px solid #fde2e2; }
.alert-success { background: #f0f9eb; color: #67c23a; border: 1px solid #e1f3d8; }
.alert-warn { background: #fdf6ec; color: #e6a23c; border: 1px solid #faecd8; }
.hint {
  margin-top: 18px; padding-top: 16px; border-top: 1px dashed #ebeef5;
  font-size: 12px; color: #909399;
}
.hint code { background: #f5f7fa; padding: 2px 6px; border-radius: 3px; font-family: monospace; }

/* ============ 通用布局 ============ */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: #2c3e50; color: #ecf0f1;
  display: flex; flex-direction: column;
}
.sidebar-header {
  padding: 20px; font-size: 16px; font-weight: bold; text-align: center;
  background: #1a252f; border-bottom: 1px solid #34495e;
}
.sidebar-header small { display: block; font-size: 11px; color: #95a5a6; font-weight: normal; margin-top: 4px; }
.sidebar-menu { flex: 1; overflow-y: auto; padding: 10px 0; }
.sidebar-menu a {
  display: block; padding: 12px 20px; color: #ecf0f1; text-decoration: none;
  border-left: 3px solid transparent; transition: all 0.2s;
  cursor: pointer;
}
.sidebar-menu a:hover { background: #34495e; border-left-color: #3498db; }
.sidebar-menu a.active { background: #34495e; border-left-color: #3498db; }
.sidebar-menu .group-title {
  padding: 10px 20px 5px; font-size: 11px; color: #7f8c8d;
  text-transform: uppercase; letter-spacing: 1px;
}

.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid #ebeef5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.topbar-title { font-size: 16px; font-weight: 600; color: #303133; }
.user-info { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #606266; }
.user-info .badge {
  background: #409eff; color: #fff; padding: 2px 8px;
  border-radius: 10px; font-size: 11px;
}
.user-info button {
  background: #f56c6c; color: #fff; border: none;
  padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 12px;
}

.page-content { flex: 1; padding: 24px; overflow-y: auto; }
.page-header {
  margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid #ebeef5;
  display: flex; justify-content: space-between; align-items: center;
}
.page-header h2 { margin: 0; font-size: 18px; color: #303133; }

/* ============ 卡片/表格 ============ */
.card {
  background: #fff; border-radius: 8px; padding: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04); margin-bottom: 16px;
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; color: #303133; }

.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th {
  background: #f5f7fa; color: #606266; font-weight: 600;
  padding: 12px 10px; text-align: left; border-bottom: 2px solid #ebeef5;
  font-size: 13px;
}
.table td {
  padding: 10px; border-bottom: 1px solid #ebeef5;
  font-size: 13px; color: #606266;
}
.table tr:hover { background: #f8f9fb; }

/* ============ 状态标签 ============ */
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 500;
}
.tag-pending { background: #fdf6ec; color: #e6a23c; }
.tag-approved { background: #f0f9eb; color: #67c23a; }
.tag-rejected { background: #fef0f0; color: #f56c6c; }
.tag-shipped { background: #ecf5ff; color: #409eff; }
.tag-signed { background: #f0f9eb; color: #67c23a; }
.tag-voided { background: #f4f4f5; color: #909399; }
.tag-warning { background: #fef0f0; color: #f56c6c; }

/* ============ 按钮 ============ */
.btn {
  display: inline-block; padding: 6px 14px; border-radius: 4px;
  border: 1px solid transparent; font-size: 13px; cursor: pointer;
  transition: all 0.2s; text-decoration: none;
}
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-primary { background: #409eff; color: #fff; border-color: #409eff; }
.btn-primary:hover { background: #66b1ff; border-color: #66b1ff; }
.btn-success { background: #67c23a; color: #fff; border-color: #67c23a; }
.btn-success:hover { background: #85ce61; }
.btn-warning { background: #e6a23c; color: #fff; border-color: #e6a23c; }
.btn-danger { background: #f56c6c; color: #fff; border-color: #f56c6c; }
.btn-danger:hover { background: #f78989; }
.btn-default { background: #fff; color: #606266; border-color: #dcdfe6; }
.btn-default:hover { color: #409eff; border-color: #c6e2ff; }
.btn-link { background: transparent; color: #409eff; border: none; padding: 0; }

/* ============ 工具栏 ============ */
.toolbar {
  display: flex; gap: 10px; align-items: center; margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar .form-control { width: auto; min-width: 180px; }

/* ============ 模态框 ============ */
.modal-mask {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: #fff; border-radius: 8px; width: 500px;
  max-width: 90vw; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.modal-large { width: 720px; }
.modal-header {
  padding: 16px 20px; border-bottom: 1px solid #ebeef5;
  display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 { margin: 0; font-size: 16px; }
.modal-close {
  background: none; border: none; font-size: 20px;
  color: #909399; cursor: pointer; padding: 0;
}
.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px; border-top: 1px solid #ebeef5;
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ============ 警告/空状态 ============ */
.empty {
  text-align: center; padding: 60px 20px; color: #909399; font-size: 14px;
}
.warn-box {
  background: #fdf6ec; border-left: 4px solid #e6a23c;
  padding: 12px 16px; border-radius: 4px; margin-bottom: 16px;
  color: #8b5a00;
}

/* ============ 徽章/统计卡 ============ */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 16px;
}
.stat-card {
  background: #fff; border-radius: 8px; padding: 18px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  border-left: 4px solid #409eff;
}
.stat-card.success { border-left-color: #67c23a; }
.stat-card.warning { border-left-color: #e6a23c; }
.stat-card.danger { border-left-color: #f56c6c; }
.stat-card .label { color: #909399; font-size: 12px; margin-bottom: 6px; }
.stat-card .value { font-size: 24px; font-weight: 600; color: #303133; }

/* ============ 分页 ============ */
.pagination {
  display: flex; gap: 6px; justify-content: center;
  margin-top: 16px; align-items: center;
}
.pagination button {
  padding: 4px 10px; border: 1px solid #dcdfe6; background: #fff;
  border-radius: 4px; cursor: pointer; font-size: 12px;
}
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }
.pagination .page-info { font-size: 12px; color: #606266; margin: 0 8px; }

/* ============ 表单 ============ */
.form-row { display: flex; gap: 12px; margin-bottom: 12px; }
.form-row .form-group { flex: 1; margin-bottom: 0; }
.form-control { width: 100%; padding: 8px 10px; border: 1px solid #dcdfe6; border-radius: 4px; font-size: 13px; }
textarea.form-control { resize: vertical; min-height: 60px; }

/* GSP 水印 */
.gsp-watermark {
  position: fixed; bottom: 10px; right: 16px;
  font-size: 11px; color: #c0c4cc; pointer-events: none; z-index: 999;
}