/* ==========================================================================
 * peiste-cabinets.cn 数据驾驶舱主题
 * 加载顺序: theme-cream.css → mobile-responsive.css → cockpit.css
 * 创建: 2026-06-06
 * 设计: 参考 SAP Fiori / 阿里 Quick BI / 飞书多维表格 驾驶舱
 * ========================================================================== */

:root {
  --cockpit-grad-1: linear-gradient(135deg, #FAF6E9 0%, #F0E0CC 100%);
  --cockpit-grad-2: linear-gradient(135deg, #C4956A 0%, #A67B50 100%);
  --cockpit-grad-3: linear-gradient(135deg, #7D9B76 0%, #6A8A64 100%);
  --cockpit-grad-4: linear-gradient(135deg, #D4A574 0%, #B88A55 100%);
  --cockpit-grad-5: linear-gradient(135deg, #6B5B4F 0%, #3D3022 100%);
  --cockpit-grad-6: linear-gradient(135deg, #C47B6B 0%, #A65D4E 100%);
}

/* ==========================================================================
 * 驾驶舱全局 - 深色顶部 + 浅色主体 (Quick BI 风格)
 * ========================================================================== */

body {
  background: var(--cream-bg);
}

/* 工作台容器 */
.dashboard {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==========================================================================
 * 1. Hero 顶部驾驶舱头条 (深色品牌带)
 * ========================================================================== */
.dashboard > h2.page-title {
  display: none; /* 隐藏旧标题，驾驶舱自带 Hero */
}

/* 驾驶舱 Hero - 实时数据条 */
.dashboard::before {
  content: '';
  display: block;
  height: 8px;
  background: var(--cockpit-grad-2);
  border-radius: 4px;
  margin-bottom: -4px;
}

/* ==========================================================================
 * 2. 4 大核心数字卡 - 驾驶舱高亮卡
 * ========================================================================== */
.stat-card {
  position: relative;
  background: var(--card-bg) !important;
  border: 1px solid var(--border-light) !important;
  border-radius: 14px !important;
  padding: 20px !important;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(196, 149, 106, 0.08);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--cockpit-grad-2);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.stat-card:hover::after {
  transform: scaleX(1);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(196, 149, 106, 0.18);
  border-color: var(--primary-light) !important;
}

/* 数字加大 + 加粗 */
.stat-value {
  font-size: 32px !important;
  font-weight: 800 !important;
  background: var(--cockpit-grad-2);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.stat-label {
  color: var(--text-sub) !important;
  font-size: 13px !important;
  font-weight: 500;
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 图标改渐变圆形 */
.stat-icon {
  border-radius: 14px !important;
  width: 56px !important;
  height: 56px !important;
  font-size: 28px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  color: white !important;
  background: var(--cockpit-grad-2) !important;
  box-shadow: 0 4px 12px rgba(196, 149, 106, 0.3);
}

.stat-icon.orders    { background: var(--cockpit-grad-2) !important; }
.stat-icon.producing { background: var(--cockpit-grad-4) !important; box-shadow: 0 4px 12px rgba(212,165,116,0.3); }
.stat-icon.customers { background: var(--cockpit-grad-3) !important; box-shadow: 0 4px 12px rgba(125,155,118,0.3); }
.stat-icon.pending   { background: var(--cockpit-grad-6) !important; box-shadow: 0 4px 12px rgba(196,123,107,0.3); }

/* 数字卡底部小趋势条 (CSS 装饰, 假装迷你 sparkline) */
.stat-card .stat-info::after {
  content: '';
  display: block;
  margin-top: 10px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 40%, transparent 100%);
  opacity: 0.6;
}

/* ==========================================================================
 * 3. Section / Panel - 驾驶舱模块
 * ========================================================================== */
.section,
.panel {
  background: var(--card-bg) !important;
  border: 1px solid var(--border-light) !important;
  border-radius: 14px !important;
  padding: 0 !important;
  box-shadow: 0 2px 12px rgba(196, 149, 106, 0.06);
  overflow: hidden;
}

.section-header {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px !important;
  margin: 0 !important;
  background: linear-gradient(180deg, #FAF6E9 0%, #FFFFFF 100%);
  border-bottom: 1px solid var(--border-light) !important;
}

.section-header h3 {
  font-size: 15px !important;
  font-weight: 600;
  color: var(--text-main) !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-header h3::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 14px;
  background: var(--cockpit-grad-2);
  border-radius: 2px;
}

/* ==========================================================================
 * 4. 表格驾驶舱化
 * ========================================================================== */
.el-table {
  border-radius: 0 !important;
}

.el-table .el-table__cell {
  padding: 12px 0 !important;
}

.el-table tr {
  transition: background 0.2s;
}

/* ==========================================================================
 * 5. 驾驶舱快捷操作区 (Quick Actions)
 * ========================================================================== */
.quick-actions {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 10px !important;
  padding: 16px 20px !important;
}

.quick-actions .el-button {
  width: 100% !important;
  height: 48px !important;
  font-size: 14px !important;
  font-weight: 500;
  border-radius: 10px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ==========================================================================
 * 6. 财务概览驾驶舱条
 * ========================================================================== */
.commission-list {
  padding: 8px 20px 20px !important;
  display: flex !important;
  flex-direction: column;
  gap: 0 !important;
}

.commission-item {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center;
  padding: 14px 0 !important;
  border-bottom: 1px dashed var(--border-light) !important;
  font-size: 14px !important;
}

.commission-item:last-child {
  border-bottom: none;
}

.commission-item > span:first-child {
  color: var(--text-sub) !important;
  font-size: 14px !important;
  display: flex;
  align-items: center;
  gap: 8px;
}

.commission-item > span:first-child::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.commission-item:nth-child(2) > span:first-child::before { background: var(--warning); }
.commission-item:nth-child(3) > span:first-child::before { background: var(--success); }

.amount {
  font-size: 16px !important;
  font-weight: 700 !important;
  font-family: -apple-system, 'SF Pro Display', 'Helvetica Neue', sans-serif;
  letter-spacing: -0.3px;
}

.amount.success { color: var(--success) !important; }
.amount.warning { color: var(--warning) !important; }
.amount.danger  { color: var(--danger)  !important; }

/* ==========================================================================
 * 7. 驾驶舱响应式
 * ========================================================================== */
@media (max-width: 1024px) {
  .stat-value {
    font-size: 26px !important;
  }
}

@media (max-width: 768px) {
  .stat-card {
    padding: 14px !important;
    border-radius: 10px !important;
  }
  .stat-value {
    font-size: 22px !important;
  }
  .stat-label {
    font-size: 11px !important;
  }
  .stat-icon {
    width: 42px !important;
    height: 42px !important;
    font-size: 20px !important;
    border-radius: 10px !important;
  }
  .section-header {
    padding: 12px 14px !important;
  }
  .section-header h3 {
    font-size: 14px !important;
  }
  .quick-actions {
    padding: 12px 14px !important;
    gap: 8px !important;
  }
  .quick-actions .el-button {
    height: 40px !important;
    font-size: 12px !important;
  }
  .commission-list {
    padding: 6px 14px 14px !important;
  }
  .commission-item {
    padding: 10px 0 !important;
  }
}

@media (max-width: 480px) {
  .stat-cards .el-col,
  .dashboard .el-row:first-of-type .el-col {
    flex: 0 0 50% !important;
    max-width: 50% !important;
  }
}
