/* 智云进销存 - 公共样式 */
:root {
  --ly-primary: #2563eb;
  --ly-primary-dark: #1d4ed8;
  --ly-bg: #f5f7fa;
  --ly-sidebar: #1e293b;
  --ly-sidebar-active: #2563eb;
  --ly-border: #e4e7ed;
  --ly-text: #303133;
  --ly-text-2: #606266;
  --ly-text-3: #909399;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body, #app { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--ly-text);
  background: var(--ly-bg);
  -webkit-font-smoothing: antialiased;
}

/* Element Plus 主色覆盖 */
.el-button--primary {
  --el-button-bg-color: var(--ly-primary);
  --el-button-border-color: var(--ly-primary);
  --el-button-hover-bg-color: var(--ly-primary-dark);
  --el-button-hover-border-color: var(--ly-primary-dark);
  --el-button-active-bg-color: var(--ly-primary-dark);
  --el-button-active-border-color: var(--ly-primary-dark);
}

/* ============ 通用页面容器 ============ */
.ly-page { padding: 14px; height: 100%; overflow: auto; }
.ly-card {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}
.ly-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; align-items: center; }
.ly-toolbar .grow { flex: 1; }
.ly-pagination { display: flex; justify-content: flex-end; margin-top: 14px; }

/* 表格行 hover 强化 */
.el-table th.el-table__cell { background: #f8fafc !important; color: #475569; font-weight: 600; }

/* 统计卡片 */
.ly-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 14px; }
.ly-stat {
  background: #fff; border-radius: 8px; padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04); position: relative; overflow: hidden;
}
.ly-stat .label { font-size: 13px; color: var(--ly-text-3); }
.ly-stat .value { font-size: 24px; font-weight: 700; margin-top: 6px; color: #1e293b; }
.ly-stat .sub { font-size: 12px; color: var(--ly-text-3); margin-top: 4px; }
.ly-stat .icon {
  position: absolute; right: 14px; top: 14px; width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 22px; color: #fff;
}

/* 表单弹窗宽度 */
.ly-form-dialog .el-select { width: 100%; }
.ly-text-right { text-align: right; }
.ly-flex { display: flex; align-items: center; gap: 8px; }

/* 单据编辑页布局 */
.ly-bill { padding: 14px; height: 100%; display: flex; flex-direction: column; overflow: auto; }
.ly-bill-head {
  background: #fff; border-radius: 8px; padding: 16px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}
.ly-bill-body { background: #fff; border-radius: 8px; padding: 16px; flex: 1; box-shadow: 0 1px 3px rgba(0, 0, 0, .04); }
.ly-bill-foot {
  background: #fff; border-radius: 8px; padding: 12px 16px; margin-top: 12px;
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}
.ly-bill-foot .summary { font-size: 14px; display: flex; gap: 26px; }
.ly-bill-foot .summary b { font-size: 17px; color: #ef4444; }
