/* ============================================================
   服装生产管理系统（MES v2）— 全局样式
   还原原系统视觉：Ant Design 蓝 #1890ff、浅蓝表头、绿色提示条
   ============================================================ */
:root {
  --primary: #1890ff;
  --primary-hover: #40a9ff;
  --primary-active: #096dd9;
  --primary-1: #e6f7ff;
  --primary-2: #bae7ff;
  --success: #52c41a;
  --success-1: #f6ffed;
  --success-3: #b7eb8f;
  --warning: #faad14;
  --error: #ff4d4f;
  --text: #262626;
  --text-2: #595959;
  --text-3: #8c8c8c;
  --border: #e8e8e8;
  --bg: #f0f2f5;
  --sider-w: 64px;
  --header-h: 56px;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; padding: 0; }
#app > div { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c8c8c8; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 登录页（浅蓝主题） ---------------- */
.login-page {
  height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(158deg, #dceeff 0%, #eef7ff 46%, #d2e7ff 100%);
  position: relative; overflow: hidden; padding: 24px;
}
/* 背景光斑 + 点阵 */
.login-deco { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.login-deco .grid {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(24, 144, 255, .10) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(circle at 50% 42%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 42%, #000 0%, transparent 72%);
}
.login-deco .blob { position: absolute; border-radius: 50%; filter: blur(58px); opacity: .55; }
.login-deco .b1 { width: 380px; height: 380px; left: -110px; top: -130px; background: #9ed0ff; animation: float1 13s ease-in-out infinite; }
.login-deco .b2 { width: 300px; height: 300px; right: -80px; top: 60px; background: #bfe1ff; animation: float2 16s ease-in-out infinite; }
.login-deco .b3 { width: 340px; height: 340px; right: 16%; bottom: -160px; background: #cfe8ff; animation: float1 19s ease-in-out infinite reverse; }
@keyframes float1 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(26px, 22px); } }
@keyframes float2 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-24px, 18px); } }

.login-card {
  position: relative; z-index: 1; width: 920px; max-width: 100%;
  background: #fff; border: 1px solid rgba(24, 144, 255, .13); border-radius: 16px;
  box-shadow: 0 20px 56px rgba(24, 144, 255, .18), 0 2px 8px rgba(24, 144, 255, .06);
  display: flex; overflow: hidden; min-height: 470px;
  animation: cardIn .5s cubic-bezier(.22, .9, .3, 1) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.login-left {
  width: 52%; padding: 44px 38px 30px; position: relative; overflow: hidden;
  background: linear-gradient(158deg, #eaf5ff 0%, #d8ebff 58%, #cae4ff 100%);
  display: flex; flex-direction: column;
}
.login-left::after {
  content: ''; position: absolute; width: 260px; height: 260px; border-radius: 50%;
  right: -104px; bottom: -104px; background: rgba(255, 255, 255, .55);
}
.login-left .brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.login-left .brand-mark {
  width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0;
  background: linear-gradient(135deg, #6cbaff, #1890ff); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; box-shadow: 0 6px 16px rgba(24, 144, 255, .32);
}
.login-left h1 { font-size: 22px; margin: 0; letter-spacing: 2px; font-weight: 600; color: #10467f; }
.login-left .sub { font-size: 12px; color: #5b88b6; margin-top: 3px; letter-spacing: .5px; }
.login-left .slogan {
  position: relative; z-index: 1; margin: 26px 0 20px; font-size: 13px; color: #2b6ba8;
  padding-left: 12px; border-left: 3px solid #1890ff; line-height: 1.6;
}
.login-left ul { position: relative; z-index: 1; margin: 0; padding: 0; list-style: none; }
.login-left ul li {
  position: relative; padding-left: 24px; margin-bottom: 11px;
  font-size: 13px; line-height: 1.65; color: #1f5d99;
}
.login-left ul li::before {
  content: '✓'; position: absolute; left: 0; top: 1px;
  width: 16px; height: 16px; border-radius: 50%; background: rgba(255, 255, 255, .95);
  color: #1890ff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(24, 144, 255, .22);
}
.login-foot { position: relative; z-index: 1; margin-top: auto; padding-top: 18px; font-size: 12px; color: #7ba4c9; }

.login-right { width: 48%; padding: 48px 42px; display: flex; flex-direction: column; background: #fff; }
.login-right h2 { font-size: 21px; margin: 0 0 6px; font-weight: 600; color: #173f6b; }
.login-right .welcome-sub { font-size: 13px; color: #93a6bb; margin-bottom: 26px; }
.login-right .ant-form-item { margin-bottom: 18px; }
.login-right .ant-form-item-label > label { color: #5b7796; font-size: 13px; }
.login-right .ant-input-affix-wrapper-lg,
.login-right .ant-input-lg { border-radius: 8px; }
.login-right .ant-btn-lg { border-radius: 8px; height: 44px; font-size: 15px; letter-spacing: 4px; }
.login-right .ant-form-item:last-child { margin-bottom: 0; }
/* 输入框前缀线性图标 */
.login-right .fld-ic {
  width: 15px; height: 15px; display: block;
  fill: none; stroke: #a4bdd8; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.login-right .ant-input-affix-wrapper-focused .fld-ic { stroke: #1890ff; }
.login-right .form-foot { display: flex; align-items: center; justify-content: space-between; }
.demo-account {
  margin-top: auto; padding: 10px 12px; border-radius: 8px;
  background: #f3f9ff; border: 1px dashed #b6dbff;
  font-size: 12px; color: #4a7ba7; display: flex; align-items: center; gap: 6px;
}
.demo-account .k { color: #7ba4c9; }
.demo-account .sep { color: #b6c9dc; }
.demo-account code {
  background: #fff; border: 1px solid #d6e9ff; padding: 1px 7px; border-radius: 4px;
  color: #096dd9; font-weight: 600; letter-spacing: .5px;
}
@media (max-width: 860px) {
  .login-card { min-height: 0; }
  .login-left { display: none; }
  .login-right { width: 100%; padding: 36px 26px; }
}

/* ---------------- 主框架 ---------------- */
.ws-layout { height: 100%; display: flex; flex-direction: column; }
.ws-body { flex: 1; display: flex; min-height: 0; }

.ws-sider {
  width: var(--sider-w); background: #fff; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; padding-top: 8px;
  transition: width .2s; z-index: 20; flex-shrink: 0;
}
.ws-sider.expanded { width: 176px; align-items: stretch; }
.sider-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 0; cursor: pointer;
  color: var(--text-2); justify-content: center; font-size: 13px; white-space: nowrap;
  border-left: 3px solid transparent;
}
.ws-sider.expanded .sider-item { justify-content: flex-start; padding-left: 17px; }
.sider-item:hover { color: var(--primary); background: #fafafa; }
.sider-item.active { color: var(--primary); background: var(--primary-1); border-left-color: var(--primary); }
.sider-icon { font-size: 19px; width: 22px; text-align: center; line-height: 1; }
.sider-label { display: none; }
.ws-sider.expanded .sider-label { display: inline; }
.sider-toggle { margin: 6px 0 10px; color: #bfbfbf; cursor: pointer; font-size: 15px; text-align: center; }

.ws-header {
  height: var(--header-h); background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 20px 0 16px; flex-shrink: 0; position: relative; z-index: 10;
}
.ws-logo { display: flex; align-items: center; gap: 10px; font-size: 21px; color: var(--primary); font-weight: 500; letter-spacing: 2px; }
.ws-logo .mark {
  width: 30px; height: 30px; border-radius: 6px; background: linear-gradient(135deg, #40a9ff, #1890ff);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; letter-spacing: 0;
}
.ws-header-right { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.hd-avatar { cursor: pointer; display: flex; align-items: center; gap: 8px; }

.ws-main { flex: 1; min-width: 0; overflow: auto; padding: 12px 16px 30px; }

/* ---------------- 通用块 ---------------- */
.page-title-bar { display: flex; align-items: center; margin-bottom: 10px; gap: 12px; }
.back-btn {
  border: 1px solid var(--border); background: #fff; border-radius: 3px; padding: 3px 12px;
  cursor: pointer; color: var(--text-2); font-size: 13px;
}
.back-btn:hover { color: var(--primary); border-color: var(--primary); }
.page-title { font-size: 16px; font-weight: 500; }

.tip-banner {
  background: var(--success-1); border: 1px solid var(--success-3); border-radius: 3px;
  padding: 12px 40px 12px 16px; margin-bottom: 12px; font-size: 13px; color: #389e0d;
  line-height: 1.95; position: relative;
}
.tip-banner b { color: #237804; }
.tip-banner .tip-close { position: absolute; right: 12px; top: 10px; cursor: pointer; color: #95de64; font-size: 15px; }
.tip-banner .tip-close:hover { color: #389e0d; }

.panel { background: #fff; border-radius: 3px; margin-bottom: 12px; }
.panel-title {
  background: var(--primary-1); color: var(--primary-active); font-size: 14px; font-weight: 500;
  padding: 7px 14px; text-align: center; border-radius: 3px 3px 0 0; position: relative;
}
.panel-title .panel-extra { position: absolute; right: 12px; top: 5px; font-weight: 400; }
.panel-body { padding: 14px; }

/* 统计条 */
.stat-strip { background: #fff; border-radius: 3px; margin-bottom: 12px; overflow: hidden; }
.stat-strip-head { display: flex; background: var(--primary-1); }
.stat-strip-head > div {
  flex: 1; text-align: center; padding: 8px 6px; color: var(--primary-active); font-size: 14px; font-weight: 500;
}
.stat-strip-body { display: flex; }
.stat-strip-body > div { flex: 1; text-align: center; padding: 16px 6px; font-size: 15px; }
.stat-strip-body .num { font-size: 17px; color: var(--text); }

/* 筛选栏 */
.filter-bar {
  background: #fafafa; border: 1px solid #f0f0f0; border-radius: 3px; padding: 10px 12px 2px;
  display: flex; flex-wrap: wrap; gap: 0 18px; margin-bottom: 10px; position: relative;
}
.filter-item { display: flex; align-items: center; margin-bottom: 8px; }
.filter-item > label { width: 62px; text-align: right; padding-right: 8px; color: var(--text-2); font-size: 13px; flex-shrink: 0; }
.filter-item > .filter-ctl { width: 150px; }
.filter-item.wide > .filter-ctl { width: 230px; }
.filter-actions { position: absolute; right: 12px; top: 10px; }

/* 表格 */
.ant-table-thead > tr > th { background: var(--primary-1) !important; color: var(--primary-active) !important; font-weight: 500 !important; }
.table-wrap { background: #fff; border-radius: 3px; overflow: hidden; }
/* 操作列：按钮文案不换行（「删除」不再被挤到第二行） */
.ops-links { white-space: nowrap; }
.ops-links > a, .ops-links > * { display: inline-block; vertical-align: middle; }
.ops-links .mr8:last-child { margin-right: 0; }
.empty-tip { text-align: center; color: var(--text-3); padding: 46px 0; font-size: 13px; }
.pager { display: flex; justify-content: flex-end; padding: 12px 4px; }

/* 表单网格 */
.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 18px; }
.form-grid .field { display: flex; align-items: center; }
.form-grid .field > label { width: 76px; text-align: right; padding-right: 8px; color: var(--text-2); font-size: 13px; flex-shrink: 0; }
.form-grid .field > label .req { color: var(--error); margin-right: 2px; }
.form-grid .field > .ctl { flex: 1; min-width: 0; }
.form-grid .field.span2 { grid-column: span 2; }

/* 明细表（规格/成本/物料） */
.detail-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.detail-table th, .detail-table td { border: 1px solid var(--border); padding: 5px 8px; text-align: center; }
.detail-table thead th { background: var(--primary-1); color: var(--primary-active); font-weight: 500; }
.detail-table td.col-name { background: #fafafa; color: var(--text-2); width: 92px; }
.detail-table input, .detail-table .ant-input { width: 100%; text-align: center; }

/* 卡片看板 */
.dash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.dash-card {
  background: #fff; border-radius: 4px; padding: 16px 18px; cursor: pointer;
  display: flex; align-items: center; gap: 16px; transition: box-shadow .2s, transform .2s;
  border: 1px solid transparent;
}
.dash-card:hover { box-shadow: 0 4px 16px rgba(24, 144, 255, .16); transform: translateY(-1px); border-color: var(--primary-2); }
.dash-card.hl { background: #fffbe6; border-color: #ffe58f; }
.dash-icon {
  width: 46px; height: 46px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0; background: var(--primary-1);
}
.dash-body { flex: 1; min-width: 0; }
.dash-name { font-size: 15px; font-weight: 500; margin-bottom: 8px; }
.dash-metrics { display: flex; gap: 26px; }
.dash-metrics .m { font-size: 12px; color: var(--text-3); }
.dash-metrics .m b { display: block; font-size: 15px; color: var(--text); font-weight: 500; margin-top: 2px; }
.dash-metrics .m.warn b { color: var(--warning); }
.dash-welcome {
  background: #fff; border-radius: 4px; padding: 26px; text-align: center; margin-bottom: 12px;
}
.dash-welcome h2 { margin: 0 0 10px; font-size: 26px; font-weight: 400; color: var(--text); }
.dash-welcome p { margin: 0; color: var(--text-3); font-size: 13px; line-height: 1.9; }

/* 通用 */
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mb8 { margin-bottom: 8px; }
.mb12 { margin-bottom: 12px; } .mr8 { margin-right: 8px; }
.flex { display: flex; } .flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap8 { gap: 8px; } .gap12 { gap: 12px; }
.text-right { text-align: right; } .text-gray { color: var(--text-3); }
.money { font-variant-numeric: tabular-nums; }
.up { color: var(--error); }   /* 中国习惯：涨/收入 红 */
.down { color: var(--success); } /* 跌/支出 绿 */
.sub-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.sub-tab { padding: 8px 18px; cursor: pointer; font-size: 14px; color: var(--text-2); border-bottom: 2px solid transparent; }
.sub-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.loading-mask { text-align: center; padding: 40px 0; color: var(--text-3); }
.code-hint { font-size: 12px; color: var(--text-3); }
.readonly-val { color: var(--text); padding: 5px 0; }
