/* 企业简洁风 — 设计令牌与全站样式
   规范：克制商务蓝 / 单一主色 / 白卡 + 1px 描边 / 两级阴影 / 12px 圆角 */

* { box-sizing: border-box; }

:root {
  /* 颜色 */
  --brand: #1e40af;              /* Corporate Blue：主行动、链接、关键图标 */
  --brand-hover: #18338c;        /* hover 更深一档 */
  --brand-light: #3b82f6;        /* Action Blue：焦点环、选中态、高亮 */
  --text: #0f172a;               /* 正文与标题 */
  --text-sub: #64748b;           /* 次要文字、说明 */
  --text-mute: #94a3b8;          /* 更弱的提示文字 */
  --line: #e5e7eb;               /* 描边 */
  --line-soft: #f1f5f9;          /* 极浅分隔 */
  --bg: #f8fafc;                 /* Level 0 Slate Mist：页面画布 */
  --surface: #ffffff;            /* Level 1 White Card */
  --login-bg: #e2e8f0;           /* 登录页底色（slate-200） */
  --table-head-bg: #f8fafc;      /* 表头底色 */
  --table-head-text: #475569;    /* 表头文字（slate-600） */
  --row-hover: #eef2fb;          /* 表格行 hover */
  --bar-track: #cbd5e1;          /* 进度条底槽 */
  --scroll-thumb: #cbd5e1;
  --scroll-thumb-hover: #94a3b8;
  --ok: #10b981;                 /* Confirm Green */
  --warn: #d97706;               /* 警告橙 */
  --danger: #dc2626;             /* 危险红 */
  --hint: #c559f0;               /* Hint Violet（极少使用） */

  /* 圆角 */
  --radius: 12px;                /* 卡片 */
  --radius-btn: 8px;             /* 按钮 / 输入框 */
  --radius-badge: 999px;         /* 徽标 */

  /* 阴影 */
  --shadow-1: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-2: 0 4px 12px rgba(15, 23, 42, .08);
  --focus-ring: 0 0 0 2px #f8fafc, 0 0 0 4px #3b82f6;

  /* 字体 */
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;

  --header-h: 64px;
  --sidebar-w: 222px;

  /* Element Plus 主题变量覆盖（须在 element-plus.css 之后加载） */
  --el-font-family: var(--font-sans);
  --el-color-primary: #1e40af;
  --el-color-primary-light-3: #6279c7;
  --el-color-primary-light-5: #8fa0d7;
  --el-color-primary-light-7: #bcc6e7;
  --el-color-primary-light-8: #d2d9ef;
  --el-color-primary-light-9: #e9ecf7;
  --el-color-primary-dark-2: #18338c;
  --el-color-success: #10b981;
  --el-color-success-light-3: #58cea7;
  --el-color-success-light-8: #cff1e6;
  --el-color-success-light-9: #e7f8f2;
  --el-color-warning: #d97706;
  --el-color-warning-light-3: #e4a051;
  --el-color-warning-light-8: #f7e4cd;
  --el-color-warning-light-9: #fbf1e6;
  --el-color-danger: #dc2626;
  --el-color-danger-light-3: #e76767;
  --el-color-danger-light-8: #f8d4d4;
  --el-color-danger-light-9: #fce9e9;
  --el-color-info: #64748b;
  --el-color-info-light-3: #939eae;
  --el-color-info-light-8: #e0e3e8;
  --el-color-info-light-9: #f0f1f3;
  --el-text-color-primary: #0f172a;
  --el-text-color-regular: #334155;
  --el-text-color-secondary: #64748b;
  --el-border-color: #e5e7eb;
  --el-border-color-light: #e5e7eb;
  --el-border-color-lighter: #f1f5f9;
  --el-border-radius-base: 8px;
  --el-bg-color: #ffffff;
  --el-fill-color-light: #f8fafc;
  --el-table-border-color: #e5e7eb;
  --el-table-header-bg-color: #f8fafc;
}

html, body, #app { height: 100%; margin: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
[v-cloak] { display: none; }
.boot-loading { padding: 120px 0; text-align: center; color: var(--text-mute); letter-spacing: .4px; }

/* 键盘焦点：统一 2px offset 焦点环 */
:focus-visible { outline: none; box-shadow: var(--focus-ring); }
/* 输入框内部原生控件不加环，环由外层 wrapper 统一绘制 */
.el-input__inner:focus, .el-input__inner:focus-visible,
.el-select__input:focus-visible, .el-checkbox__original:focus-visible,
.el-radio__original:focus-visible { box-shadow: none !important; }

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- 登录页 */
.login-page {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  background: var(--login-bg) url("../image/login-bg.jpg") center / cover no-repeat;
}
/* 背景图上压一层半透明遮罩，保证登录卡片在任何主题下都清晰可读 */
.login-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .45);
}
.login-card {
  position: relative;
  z-index: 1;
  width: 880px;
  height: 460px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  display: flex;
  overflow: hidden;
}
.login-left {
  width: 440px;
  padding: 48px 44px;
  color: var(--text);
  background: var(--bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-left h1 {
  font-size: 30px; font-weight: 700; letter-spacing: -.02em;
  line-height: 1.25; margin: 0 0 8px; color: var(--text);
}
/* 登录页品牌区顶部的标志，比标题大一号做视觉锚点 */
.login-logo { height: 36px; width: auto; display: block; margin-bottom: 16px; }
.login-left .sub { color: var(--text-sub); font-size: 13px; line-height: 2; }
.login-left ul { padding-left: 18px; color: var(--text-sub); font-size: 13px; line-height: 2.1; margin: 0; }
.login-left ul li::marker { color: var(--brand); }
.login-right { flex: 1; padding: 40px 48px; }
.login-right h2 { font-size: 20px; font-weight: 600; line-height: 1.4; margin: 0 0 6px; color: var(--text); }
.login-right .tip { color: var(--text-sub); font-size: 12px; margin-bottom: 20px; }
.login-right .el-form-item { margin-bottom: 18px; }
.login-modes { display: flex; margin-bottom: 14px; }
.login-modes .el-radio-button { flex: 1; }
.login-modes .el-radio-button__inner { width: 100%; }
.guest-btn { width: 100%; margin-top: 4px; }
.login-tip { margin-top: 18px; font-size: 12px; color: var(--text-sub); line-height: 1.9; }

/* ---------------------------------------------------------------- 主框架 */
.layout { height: 100%; display: flex; flex-direction: column; }
.layout-header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  color: var(--text);
  display: flex;
  align-items: center;
  padding: 0 20px 0 0;
  flex-shrink: 0;
  z-index: 20;
}
.nav-toggle {
  width: 46px; height: var(--header-h);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-sub);
  transition: background .15s ease-out, color .15s ease-out;
}
.nav-toggle:hover { background: var(--line-soft); color: var(--brand); }
.nav-toggle .el-icon { font-size: 18px; }
.logo {
  width: var(--sidebar-w);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .2px;
  color: var(--text);
  padding-left: 4px;
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}
/* 品牌字标：透明底黑色 PZ 标志，与左侧字号等高的视觉重量 */
.logo-img { height: 24px; width: auto; flex-shrink: 0; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.header-right .user {
  cursor: pointer; display: flex; align-items: center; gap: 7px;
  padding: 5px 10px; border-radius: var(--radius-badge);
  transition: background .15s ease-out;
}
.header-right .user:hover { background: var(--line-soft); }
.header-right .link {
  cursor: pointer; padding: 6px 12px; border-radius: var(--radius-badge); color: var(--text-sub);
  transition: background .15s ease-out, color .15s ease-out;
}
.header-right .link:hover { background: var(--line-soft); color: var(--text); }
/* 亮 / 暗配色切换 */
.theme-toggle {
  width: 32px; height: 32px; flex-shrink: 0;
  padding: 0; border: 0; background: transparent; font: inherit;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-sub);
  border-radius: var(--radius-badge);
  transition: background .15s ease-out, color .15s ease-out;
}
.theme-toggle:hover { background: var(--line-soft); color: var(--brand); }
.theme-toggle .el-icon { font-size: 17px; }

.layout-body { flex: 1; display: flex; overflow: hidden; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  padding: 10px 0 24px;
  margin-left: 0;
  transition: margin-left .2s ease-out;
}
.layout.collapsed .logo { width: auto; }
.layout.collapsed .sidebar { margin-left: calc(var(--sidebar-w) * -1); }
.sidebar .el-menu { border-right: none; }
.sidebar .el-menu-item {
  height: 42px; line-height: 42px; font-size: 14px;
  margin: 2px 10px; border-radius: var(--radius-btn); position: relative;
  transition: background .15s ease-out, color .15s ease-out;
}
.sidebar .el-menu-item:hover { background: var(--line-soft); }
.sidebar .el-menu-item.is-active {
  background: var(--el-color-primary-light-9); color: var(--brand); font-weight: 600;
}
.sidebar .el-menu-item.is-active::after {
  content: ''; position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 16px; border-radius: 0 3px 3px 0; background: var(--brand);
}
.sidebar .el-sub-menu__title {
  height: 44px; line-height: 44px; font-size: 13px;
  color: var(--text-sub); font-weight: 600; letter-spacing: .04em;
}
.sidebar .el-sub-menu__title:hover { background: var(--line-soft); }
.sidebar-title {
  font-size: 12px; color: var(--text-mute); padding: 14px 20px 6px; letter-spacing: .04em;
}

.main { flex: 1; overflow-y: auto; padding: 18px 20px 0; will-change: scroll-position; }
.main > div { max-width: 1560px; margin: 0 auto; }
.page-head { display: flex; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.page-head h2 { font-size: 20px; margin: 0; font-weight: 600; line-height: 1.4; color: var(--text); }
.page-head .desc { color: var(--text-sub); font-size: 13px; }
.page-head .grow { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.footer-note {
  text-align: center; color: var(--text-mute); font-size: 12px; padding: 22px 0 26px; line-height: 1.9;
}

/* ---------------------------------------------------------------- 卡片 */
.el-card {
  border-radius: var(--radius);
  border-color: var(--line);
  box-shadow: var(--shadow-1) !important;
  transition: box-shadow .15s ease-out;
}
.el-card:hover { box-shadow: var(--shadow-2) !important; }
.el-card__header {
  padding: 14px 16px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--line-soft);
}
.el-card__body { padding: 16px; }
.dash-card { height: 100%; }
.card-title { font-size: 16px; font-weight: 600; color: var(--text); }
.card-title::before {
  content: ''; display: inline-block; width: 3px; height: 14px; background: var(--brand);
  border-radius: 2px; margin-right: 8px; vertical-align: -2px;
}
.card-extra { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ---------------------------------------------------------------- 仪表盘 */
.stat-wrap { display: flex; height: 268px; }
.stat-item {
  flex: 1; text-align: center; padding: 18px 6px;
  display: flex; flex-direction: column; justify-content: center;
}
.stat-item + .stat-item { border-left: 1px dashed var(--line); }
.stat-value {
  font-size: 26px; font-weight: 700; color: var(--brand);
  letter-spacing: .2px; font-variant-numeric: tabular-nums;
}
.stat-value.small { font-size: 20px; }
.stat-label { color: var(--text-sub); font-size: 12px; margin-top: 6px; }
.stat-unit { font-size: 12px; color: var(--text-sub); font-weight: 400; margin-left: 2px; }

.alert-list { height: 268px; overflow-y: auto; }
.alert-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 2px;
  border-bottom: 1px dashed var(--line-soft); font-size: 13px;
}
.alert-row:last-child { border-bottom: none; }
.alert-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-qty { color: var(--text-sub); font-variant-numeric: tabular-nums; }
.alert-tag { flex-shrink: 0; }
.empty-hint { text-align: center; color: var(--text-mute); padding: 40px 0; font-size: 13px; }

.rank-list { padding: 2px 0; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line-soft); }
.rank-row:last-child { border-bottom: none; }
.rank-no {
  width: 20px; height: 20px; border-radius: 6px; background: var(--line-soft); color: var(--text-sub);
  font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rank-no.top { background: var(--brand); color: #fff; }
.rank-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-bar { width: 90px; }
.rank-qty { width: 96px; text-align: right; color: var(--text-sub); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 表格页 */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .grow { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.table-summary {
  margin-top: 14px; display: flex; gap: 26px; color: var(--text-sub);
  font-size: 13px; flex-wrap: wrap;
}
.table-summary b { color: var(--brand); font-variant-numeric: tabular-nums; }
.el-pagination { margin-top: 16px; justify-content: flex-end; }
.money { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-mute); }
.danger-text { color: var(--danger); }
.item-editor .el-input-number { width: 100%; }
.dialog-footer { text-align: right; }
.order-total { text-align: right; padding: 10px 4px 0; color: var(--text-sub); font-size: 13px; }
.order-total b { color: var(--brand); font-size: 15px; margin: 0 4px; font-variant-numeric: tabular-nums; }
.report-total { font-weight: 600; }
.section-gap { margin-bottom: 16px; }
/* 表单项下方的补充说明文字 */
.form-tip { margin-top: 4px; font-size: 12px; line-height: 1.7; color: var(--text-sub); }
.retire-line { line-height: 1.8; }
.retire-line b { color: var(--warn); }
.retire-tag { margin-left: 6px; }

/* 查重分组（货品查重弹窗） */
.dup-group { border: 1px solid var(--line); border-radius: var(--radius-btn); padding: 10px 12px; margin-bottom: 14px; }
.dup-group-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.dup-group-head b { font-size: 14px; }
.dup-group-foot { text-align: right; margin-top: 8px; }

/* 表格外观 */
.el-table { --el-table-border-color: var(--line); --el-table-row-hover-bg-color: var(--row-hover); }
.el-table th.el-table__cell {
  background: var(--table-head-bg) !important;
  color: var(--table-head-text); font-weight: 600;
}
.el-table td.el-table__cell { padding: 9px 0; }
.el-table--border { border-radius: var(--radius-btn); }
.el-pagination { --el-pagination-font-size: 13px; }

/* 表单与弹窗 */
.el-button {
  border-radius: var(--radius-btn);
  transition: background-color .15s ease-out, border-color .15s ease-out,
    color .15s ease-out, box-shadow .15s ease-out, transform .15s ease-out;
}
.el-button:not(.is-disabled):active { transform: scale(.98); }
.el-button--primary {
  --el-button-bg-color: var(--brand);
  --el-button-border-color: var(--brand);
  --el-button-hover-bg-color: var(--brand-hover);
  --el-button-hover-border-color: var(--brand-hover);
  --el-button-active-bg-color: var(--brand-hover);
  --el-button-active-border-color: var(--brand-hover);
}
.el-button--primary:not(.is-disabled) {
  box-shadow: var(--shadow-1);
}
.el-button--primary:not(.is-disabled):hover {
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}
.el-button--primary:not(.is-disabled):active {
  transform: scale(.98);
  box-shadow: var(--shadow-1);
}
.el-input__wrapper, .el-textarea__inner {
  border-radius: var(--radius-btn);
  transition: box-shadow .15s ease-out;
}
.el-input__wrapper.is-focus,
.el-input__wrapper:focus-within,
.el-textarea__inner:focus {
  box-shadow: 0 0 0 1px var(--brand) inset, var(--focus-ring) !important;
}
.el-select__wrapper.is-focused { box-shadow: 0 0 0 1px var(--brand) inset, var(--focus-ring) !important; }
.el-dialog { border-radius: var(--radius); overflow: hidden; }
.el-dialog__header { margin-right: 0; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.el-dialog__body { padding: 18px 20px; }
.el-dialog__footer { padding: 12px 20px 16px; border-top: 1px solid var(--line-soft); }
.el-alert { border-radius: var(--radius-btn); }
.el-tag { border-radius: var(--radius-badge); font-weight: 500; }
.el-dropdown-menu__item { border-radius: 6px; }
.el-message { border-radius: var(--radius-btn); }

/* ---------------------------------------------------------------- 新模块 */
.warning-text { color: var(--warn); }
.stat-row { margin-bottom: 14px; }
.stat-box { padding: 2px 2px 4px; }
.stat-box .stat-label { color: var(--text-sub); font-size: 12px; }
.stat-box .stat-value { font-size: 24px; font-weight: 700; color: var(--brand); }
.expand-box { padding: 6px 16px 12px; }
.item-total { color: var(--text-sub); font-size: 13px; }
.item-total b { color: var(--brand); font-size: 15px; margin: 0 4px; }

/* 生产日历 */
.cal-cell { height: 100%; min-height: 62px; cursor: pointer; }
.cal-cell .cal-day { font-size: 14px; font-weight: 600; }
.cal-cell .cal-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.cal-badge { font-size: 11px; line-height: 16px; padding: 0 6px; border-radius: var(--radius-badge); white-space: nowrap; }
.cal-badge.stats { background: #e9ecf7; color: var(--brand); }
.cal-badge.plan { background: #fbf1e6; color: var(--warn); }
.cal-badge.order { background: #e7f8f2; color: #047857; }
.cal-badge.order.overdue { background: #fce9e9; color: var(--danger); font-weight: 600; }
.cal-badge.scrap { background: #fce9e9; color: var(--danger); }
/* 休息日与调休补班日标记（令牌随亮 / 暗配色自动切换） */
.cal-flag { font-size: 11px; line-height: 16px; padding: 0 5px; margin-left: 5px; font-weight: 500;
  border-radius: var(--radius-badge); background: var(--line-soft); color: var(--text-sub); }
.cal-flag.makeup { background: var(--el-color-primary-light-9); color: var(--brand); }
.cal-cell.off .cal-day { color: var(--text-mute); }
.el-calendar-table .el-calendar-day { height: auto; min-height: 64px; padding: 6px 8px; }
/* 节假日日历覆盖范围说明与到期提醒 */
.holiday-note { margin-top: 8px; font-size: 12px; color: var(--text-sub); text-align: center; }
.holiday-alert { margin-top: 8px; }

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 1440px) {
  .main .el-col-4 { width: 33.3333%; }
  .main .el-col-5 { width: 33.3333%; }
  .main .el-col-8 { width: 50%; }
}
@media (max-width: 1100px) {
  .main { padding: 14px 14px 0; }
  .main .el-col-8, .main .el-col-12 { width: 100%; }
  .main .el-col-4, .main .el-col-5, .main .el-col-6 { width: 50%; }
  .main .el-col-4:nth-child(n + 5) { margin-top: 12px; }
}
@media (max-width: 900px) {
  .login-card { width: 92%; height: auto; flex-direction: column; }
  .login-left { width: 100%; padding: 32px 28px; gap: 18px; border-right: none; border-bottom: 1px solid var(--line); }
  .login-left ul { display: none; }
  .login-right { padding: 30px 28px 34px; }
  .logo { width: auto; padding-left: 0; font-size: 16px; }
  .logo-img { height: 22px; }
  .login-logo { height: 30px; }
  .header-right .link { display: none; }
  .page-head h2 { font-size: 18px; }
}

/* ================================================================ 暗色配色
   规范：.trae/design-dark.md
   深板岩做底、明度分三级、靠 1px 白色低透明描边分层、发光朝内。
   由 <html data-theme="dark"> 切换，令牌与 Element Plus 变量一并覆盖。 */
html[data-theme="dark"] {
  /* 应用令牌：页面 #0f172a → 卡片 #1e293b → 浮层 #334155 */
  --brand: #3b82f6;
  --brand-hover: #2563eb;
  --brand-light: #60a5fa;
  --text: #e2e8f0;
  --text-sub: #94a3b8;
  --text-mute: #64748b;
  --line: rgba(255, 255, 255, .10);
  --line-soft: rgba(255, 255, 255, .06);
  --bg: #0f172a;
  --surface: #1e293b;
  --login-bg: #0f172a;
  --table-head-bg: #0f172a;
  --table-head-text: #94a3b8;
  --row-hover: rgba(59, 130, 246, .12);
  --bar-track: #334155;
  --scroll-thumb: #334155;
  --scroll-thumb-hover: #475569;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --hint: #c084fc;

  /* 暗色里投影几乎不可见，取消静置阴影，仅保留浮层阴影 */
  --shadow-1: none;
  --shadow-2: 0 8px 30px rgba(0, 0, 0, .50);
  --focus-ring: 0 0 0 2px #0f172a, 0 0 0 4px #3b82f6;

  /* Element Plus — 主色 */
  --el-color-primary: #3b82f6;
  --el-color-primary-rgb: 59, 130, 246;
  --el-color-primary-light-3: rgba(59, 130, 246, .72);
  --el-color-primary-light-5: rgba(59, 130, 246, .55);
  --el-color-primary-light-7: rgba(59, 130, 246, .36);
  --el-color-primary-light-8: rgba(59, 130, 246, .24);
  --el-color-primary-light-9: rgba(59, 130, 246, .16);
  --el-color-primary-dark-2: #60a5fa;

  /* Element Plus — 状态色 */
  --el-color-success: #22c55e;
  --el-color-success-light-3: rgba(34, 197, 94, .72);
  --el-color-success-light-5: rgba(34, 197, 94, .55);
  --el-color-success-light-8: rgba(34, 197, 94, .24);
  --el-color-success-light-9: rgba(34, 197, 94, .14);
  --el-color-success-dark-2: #4ade80;
  --el-color-warning: #f59e0b;
  --el-color-warning-light-3: rgba(245, 158, 11, .72);
  --el-color-warning-light-5: rgba(245, 158, 11, .55);
  --el-color-warning-light-8: rgba(245, 158, 11, .24);
  --el-color-warning-light-9: rgba(245, 158, 11, .14);
  --el-color-warning-dark-2: #fbbf24;
  --el-color-danger: #ef4444;
  --el-color-danger-light-3: rgba(239, 68, 68, .72);
  --el-color-danger-light-5: rgba(239, 68, 68, .55);
  --el-color-danger-light-8: rgba(239, 68, 68, .24);
  --el-color-danger-light-9: rgba(239, 68, 68, .14);
  --el-color-danger-dark-2: #f87171;
  --el-color-error: #ef4444;
  --el-color-error-light-3: rgba(239, 68, 68, .72);
  --el-color-error-light-5: rgba(239, 68, 68, .55);
  --el-color-error-light-8: rgba(239, 68, 68, .24);
  --el-color-error-light-9: rgba(239, 68, 68, .14);
  --el-color-error-dark-2: #f87171;
  --el-color-info: #94a3b8;
  --el-color-info-light-3: rgba(148, 163, 184, .72);
  --el-color-info-light-5: rgba(148, 163, 184, .55);
  --el-color-info-light-8: rgba(148, 163, 184, .24);
  --el-color-info-light-9: rgba(148, 163, 184, .14);
  --el-color-info-dark-2: #cbd5e1;

  /* Element Plus — 文字 */
  --el-text-color-primary: #e2e8f0;
  --el-text-color-regular: #cbd5e1;
  --el-text-color-secondary: #94a3b8;
  --el-text-color-placeholder: #64748b;
  --el-text-color-disabled: #475569;

  /* Element Plus — 背景与填充 */
  --el-bg-color: #1e293b;
  --el-bg-color-page: #0f172a;
  --el-bg-color-overlay: #1e293b;
  --el-fill-color: rgba(255, 255, 255, .10);
  --el-fill-color-light: rgba(255, 255, 255, .06);
  --el-fill-color-lighter: rgba(255, 255, 255, .04);
  --el-fill-color-extra-light: rgba(255, 255, 255, .02);
  --el-fill-color-dark: rgba(255, 255, 255, .14);
  --el-fill-color-darker: rgba(255, 255, 255, .18);
  --el-fill-color-blank: #1e293b;

  /* Element Plus — 描边 */
  --el-border-color: rgba(255, 255, 255, .10);
  --el-border-color-light: rgba(255, 255, 255, .10);
  --el-border-color-lighter: rgba(255, 255, 255, .06);
  --el-border-color-extra-light: rgba(255, 255, 255, .04);
  --el-border-color-dark: rgba(255, 255, 255, .16);
  --el-border-color-darker: rgba(255, 255, 255, .20);
  --el-border-color-hover: rgba(255, 255, 255, .24);

  /* Element Plus — 禁用与遮罩 */
  --el-disabled-bg-color: #1e293b;
  --el-disabled-text-color: #475569;
  --el-disabled-border-color: rgba(255, 255, 255, .08);
  --el-mask-color: rgba(15, 23, 42, .80);
  --el-mask-color-extra-light: rgba(15, 23, 42, .30);
  --el-overlay-color-lighter: rgba(15, 23, 42, .80);
  --el-popup-modal-bg-color: #0f172a;

  /* Element Plus — 阴影 */
  --el-box-shadow: 0 12px 32px 4px rgba(0, 0, 0, .36), 0 8px 20px rgba(0, 0, 0, .36);
  --el-box-shadow-light: 0 8px 30px rgba(0, 0, 0, .50);
  --el-box-shadow-lighter: 0 0 12px rgba(0, 0, 0, .36);
  --el-box-shadow-dark: 0 16px 48px 16px rgba(0, 0, 0, .36), 0 12px 32px rgba(0, 0, 0, .32);

  /* Element Plus — 承载层 */
  --el-card-bg-color: #1e293b;
  --el-card-border-color: rgba(255, 255, 255, .10);
  --el-dialog-bg-color: #1e293b;
  --el-drawer-bg-color: #1e293b;
  --el-popover-bg-color: #1e293b;
  --el-dropdown-menu-box-shadow: 0 8px 30px rgba(0, 0, 0, .50);
  --el-menu-bg-color: #1e293b;
  --el-menu-text-color: #cbd5e1;
  --el-menu-hover-bg-color: rgba(255, 255, 255, .06);
  --el-menu-hover-text-color: #e2e8f0;
  --el-menu-active-color: #60a5fa;
  --el-menu-border-color: transparent;

  /* Element Plus — 表格 */
  --el-table-bg-color: #1e293b;
  --el-table-tr-bg-color: #1e293b;
  --el-table-expanded-cell-bg-color: #1e293b;
  --el-table-header-bg-color: #0f172a;
  --el-table-header-text-color: #94a3b8;
  --el-table-text-color: #cbd5e1;
  --el-table-border-color: rgba(255, 255, 255, .10);
  --el-table-row-hover-bg-color: rgba(59, 130, 246, .12);
  --el-table-current-row-bg-color: rgba(59, 130, 246, .10);
  --el-table-fixed-box-shadow: 0 0 10px rgba(0, 0, 0, .40);

  /* Element Plus — 输入类 */
  --el-input-bg-color: #1e293b;
  --el-input-text-color: #e2e8f0;
  --el-input-border-color: rgba(255, 255, 255, .14);
  --el-input-hover-border-color: rgba(255, 255, 255, .24);
  --el-input-focus-border-color: #3b82f6;
  --el-input-placeholder-color: #64748b;
  --el-input-icon-color: #94a3b8;
  --el-input-clear-hover-color: #cbd5e1;
  --el-select-input-color: #94a3b8;
  --el-select-border-color-hover: rgba(255, 255, 255, .24);

  /* Element Plus — 日期与日历 */
  --el-datepicker-text-color: #cbd5e1;
  --el-datepicker-off-text-color: #64748b;
  --el-datepicker-header-text-color: #94a3b8;
  --el-datepicker-icon-color: #94a3b8;
  --el-datepicker-border-color: rgba(255, 255, 255, .10);
  --el-datepicker-inner-border-color: rgba(255, 255, 255, .08);
  --el-datepicker-inrange-bg-color: rgba(59, 130, 246, .16);
  --el-datepicker-inrange-hover-bg-color: rgba(59, 130, 246, .22);
  --el-datepicker-hover-text-color: #60a5fa;
  --el-datepicker-active-color: #3b82f6;
  --el-calendar-border: rgba(255, 255, 255, .10);
  --el-calendar-header-border-bottom: rgba(255, 255, 255, .10);
  --el-calendar-selected-bg-color: rgba(59, 130, 246, .16);

  /* Element Plus — 提示与其它 */
  --el-alert-bg-color: #1e293b;
  --el-message-bg-color: #1e293b;
  --el-message-border-color: rgba(255, 255, 255, .10);
  --el-message-text-color: #e2e8f0;
  --el-notification-border-color: rgba(255, 255, 255, .10);
  --el-descriptions-item-bordered-label-background: rgba(255, 255, 255, .04);
  --el-skeleton-color: #1e293b;
  --el-skeleton-to-color: #334155;
  --el-scrollbar-bg-color: rgba(255, 255, 255, .20);
  --el-scrollbar-hover-bg-color: rgba(255, 255, 255, .30);
  --el-empty-fill-color-0: #1e293b;
  --el-empty-fill-color-1: #24334a;
  --el-empty-fill-color-2: #2a3a53;
  --el-empty-fill-color-3: #30415c;
  --el-empty-fill-color-4: #364865;
  --el-empty-fill-color-5: #3c4f6e;
  --el-empty-fill-color-6: #425677;
  --el-empty-fill-color-7: #485d80;
  --el-empty-fill-color-8: #4e6489;
  --el-empty-fill-color-9: #546b92;
}

/* 暗色下的细节修正：品牌色文字提亮一档、按钮顶边内高光 */
html[data-theme="dark"] .nav-toggle:hover,
html[data-theme="dark"] .theme-toggle:hover,
html[data-theme="dark"] .sidebar .el-menu-item.is-active { color: var(--brand-light); }
html[data-theme="dark"] .table-summary b { color: var(--brand-light); }

html[data-theme="dark"] .el-button:not(.el-button--primary):not(.el-button--success):not(.el-button--warning):not(.el-button--danger):not(.el-button--info) {
  --el-button-bg-color: rgba(255, 255, 255, .05);
  --el-button-border-color: rgba(255, 255, 255, .12);
  --el-button-hover-bg-color: rgba(59, 130, 246, .16);
  --el-button-hover-border-color: rgba(59, 130, 246, .40);
  --el-button-hover-text-color: #e2e8f0;
  --el-button-active-bg-color: rgba(255, 255, 255, .08);
  --el-button-active-border-color: rgba(255, 255, 255, .18);
}

/* 暗色里投影看不见，主按钮靠顶边内高光与自身发光说明层次 */
html[data-theme="dark"] .el-button--primary:not(.is-disabled):not(.is-link):not(.is-text) {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15);
}
html[data-theme="dark"] .el-button--primary:not(.is-disabled):not(.is-link):not(.is-text):hover {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 0 10px rgba(59, 130, 246, .30);
}
html[data-theme="dark"] .el-button--primary:not(.is-disabled):not(.is-link):not(.is-text):active {
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .30);
}

/* 抬头里的角色徽标：暗色改为半透明底 + 浅灰字，避免白字压在浅灰上 */
html[data-theme="dark"] .header-right .el-tag.el-tag--info.el-tag--dark {
  --el-tag-bg-color: rgba(148, 163, 184, .20);
  --el-tag-border-color: transparent;
  --el-tag-text-color: #cbd5e1;
}

/* 生产日历标记 */
html[data-theme="dark"] .cal-badge.stats { background: rgba(59, 130, 246, .18); color: #93b4fb; }
html[data-theme="dark"] .cal-badge.plan { background: rgba(245, 158, 11, .18); color: #fbbf24; }
html[data-theme="dark"] .cal-badge.order { background: rgba(34, 197, 94, .18); color: #4ade80; }
html[data-theme="dark"] .cal-badge.order.overdue,
html[data-theme="dark"] .cal-badge.scrap { background: rgba(239, 68, 68, .18); color: #f87171; }

/* 品牌标志是透明底的黑色字标，暗色底上反相为白色 */
html[data-theme="dark"] .logo-img,
html[data-theme="dark"] .login-logo { filter: invert(1); }

/* 侧栏选中态与卡片 hover */
html[data-theme="dark"] .sidebar { border-right-color: rgba(255, 255, 255, .08); }
html[data-theme="dark"] .el-card { border-color: rgba(255, 255, 255, .10); }
html[data-theme="dark"] .el-card:hover { border-color: rgba(255, 255, 255, .16); }

/* 隔行变色行：显式给不透明深底与文字色，
   避免只靠 --el-fill-color-lighter / --el-table-text-color 继承而回落到 Element Plus 浅色默认值 */
html[data-theme="dark"] .el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell {
  background: #24334a;
  color: #cbd5e1;
}

/* ------------------------------------------------------------------
   工艺流程图（框体 + 连线）：组件分组框 / 工序框体 / 连线画布
   ------------------------------------------------------------------ */
.flow-stage {
  position: relative;
  overflow: auto;
  height: calc(100vh - 320px);
  min-height: 460px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: grab;
  user-select: none;
  background:
    linear-gradient(rgba(148, 163, 184, .16) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(148, 163, 184, .16) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--surface);
}
.flow-stage.is-panning { cursor: grabbing; }
.flow-canvas { position: relative; }

/* 组件分组框 */
.flow-group {
  position: absolute;
  z-index: 1;
  border: 1px dashed var(--brand-light);
  border-radius: 10px;
  background: rgba(59, 130, 246, .06);
  cursor: move;
}
.flow-group-head {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  background: rgba(59, 130, 246, .12);
  border-radius: 9px 9px 0 0;
  white-space: nowrap;
  overflow: hidden;
}
.flow-group-qty { color: var(--text-sub); font-weight: 500; }
.flow-group-ops { margin-left: auto; display: none; gap: 10px; }
.flow-group-ops a { color: var(--brand); font-weight: 500; cursor: pointer; }
.flow-group:hover .flow-group-ops { display: inline-flex; }
/* 上级组件「容器框」：自动放大包住子组件，实线边框以示区别（子组件框覆盖在其上） */
.flow-group.is-container { border-style: solid; background: rgba(59, 130, 246, .035); }
.flow-group.is-container > .flow-group-head { background: rgba(59, 130, 246, .18); }
.flow-group-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
  border-right: 2px solid var(--brand-light);
  border-bottom: 2px solid var(--brand-light);
  border-radius: 0 0 8px 0;
}

/* 连线层 */
.flow-edges {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  overflow: visible;
  pointer-events: none;
}
.flow-edge { fill: none; stroke: var(--text-mute); stroke-width: 1.6; }
.flow-edge-hit { fill: none; stroke: transparent; stroke-width: 14; pointer-events: stroke; cursor: pointer; }
.flow-edge-hit:hover + .flow-edge { stroke: var(--danger); stroke-width: 2.4; }
.flow-arrow-head { fill: var(--text-mute); }
.flow-edge-qty {
  font-size: 11px;
  fill: var(--text-sub);
  text-anchor: middle;
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 3px;
  stroke-linejoin: round;
}

/* 工序框体 */
.flow-node {
  position: absolute;
  z-index: 3;
  width: 150px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 14px;
  text-align: center;
  font-size: 12px;
  line-height: 1.25;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-1);
  cursor: move;
  user-select: none;
  transition: box-shadow .15s, border-color .15s, background .15s;
}
.flow-node:hover { border-color: var(--brand-light); box-shadow: var(--shadow-2); }
.flow-node.is-linked { border-color: var(--brand-light); background: #f1f5ff; }
.flow-node.is-temp { border-style: dashed; color: var(--warn); }
.flow-node.is-source { border-color: var(--ok); box-shadow: 0 0 0 2px rgba(16, 185, 129, .35); }
.flow-node-name {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.flow-node-order {
  position: absolute;
  left: -9px;
  top: -9px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  border-radius: 9px;
}
.flow-node-flag {
  position: absolute;
  left: -9px;
  top: -9px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: var(--warn);
  border-radius: 9px;
}
.flow-node-opt {
  position: absolute;
  right: -9px;
  top: -9px;
  height: 18px;
  max-width: 120px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border-radius: 9px;
}
.flow-edge-opt {
  font-size: 10px;
  fill: var(--brand);
  text-anchor: middle;
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 3px;
  stroke-linejoin: round;
}
.flow-node-link {
  position: absolute;
  right: -9px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  color: var(--brand);
  background: var(--surface);
  border: 1px solid var(--brand-light);
  border-radius: 50%;
  opacity: 0;
  cursor: crosshair;
  transition: opacity .15s;
}
.flow-node:hover .flow-node-link { opacity: 1; }

/* 暗色适配 */
html[data-theme="dark"] .flow-node.is-linked { background: rgba(59, 130, 246, .16); }
html[data-theme="dark"] .flow-edge-qty { stroke: #1e293b; }
html[data-theme="dark"] .flow-edge-opt { stroke: #1e293b; }
html[data-theme="dark"] .flow-group { background: rgba(59, 130, 246, .10); }
html[data-theme="dark"] .flow-node-link { background: #1e293b; }

/* ------------------------------------------------------------------
   出勤情况：月度出勤矩阵（1~31 日）
   固定布局，31 个日期列等分剩余宽度，保证所有列一页展示；
   出勤日整格填色（浅色取 Confirm Green #10b981，暗色取 State Green #22c55e）。
   配色规范：.trae/design-white.md · .trae/design-dark.md
   ------------------------------------------------------------------ */
.att-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.att-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  background: var(--surface);
}
.att-table th,
.att-table td {
  padding: 3px 2px;
  border-bottom: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.att-table th:last-child,
.att-table td:last-child { border-right: none; }
.att-table thead th {
  height: 30px;
  background: var(--table-head-bg);
  color: var(--table-head-text);
  font-size: 11px;
  font-weight: 600;
}
.att-table tbody tr:last-child td { border-bottom: none; }
.att-table tbody tr:hover td { background: var(--row-hover); }
/* 固定列宽：姓名 / 出勤天数 / 操作，其余宽度留给日期列 */
.att-table .att-name {
  width: 92px;
  padding-left: 10px;
  text-align: left;
  color: var(--text);
}
.att-table .att-count {
  width: 62px;
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.att-table .att-absent {
  width: 62px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--danger);
}
/* 全勤（缺勤 0）标绿 */
.att-table .att-absent.is-fullattend { color: var(--ok); }
/* 超出当月天数的日期列置灰 */
.att-table .is-out { background: var(--line-soft); color: var(--text-mute); }
/* 出勤格：上午填上半格、下午填下半格、整天填满。
   用内层色块绘制，避免行 hover 背景把填色盖掉 */
.att-table .att-day {
  position: relative;
  height: 26px;
  padding: 0;
}
.att-table .att-fill {
  position: absolute;
  left: 0;
  right: 0;
  background: #10b981;
}
.att-table .att-fill.is-full { top: 0; bottom: 0; }
.att-table .att-fill.is-am { top: 0; height: 50%; }
.att-table .att-fill.is-pm { bottom: 0; height: 50%; }
html[data-theme="dark"] .att-table .att-fill { background: #22c55e; }
/* 补考勤：位于考勤矩阵下方，与上方矩阵用分隔线隔开 */
.att-makeup {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

