/* AyamaG 后台样式 — 版权所有 © AyamaG */
* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body { font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif; background: #f0f2f5; color: #333; }

/* 需求15：所有弹窗占整个页面的 3/4，且上下左右居中 */
.ayamag-dialog { width: 75vw !important; max-width: 75vw; margin-top: 0 !important; }
/* 施工单弹窗：宽度 900px，高度随内容自适应，更紧凑 */
.ayamag-dialog.order-dialog { width: 900px !important; min-width: 700px !important; max-width: 95vw !important; height: auto !important; min-height: auto !important; max-height: 90vh !important; overflow: hidden !important; }
.ayamag-dialog.order-dialog .el-dialog__body { height: auto; max-height: calc(90vh - 140px); overflow-y: auto !important; padding: 16px 20px; box-sizing: border-box; }
/* 强制覆盖 Element Plus 默认 dialog 宽度与滚动 */
.el-overlay-dialog .ayamag-dialog.order-dialog { width: 900px !important; max-width: 95vw !important; overflow: hidden !important; }
.ayamag-dialog.order-dialog .el-dialog__wrapper { width: auto !important; overflow: hidden !important; }
/* 施工单弹窗内部表单取消 el-row 负 margin，避免横向滚动条 */
.ayamag-dialog.order-dialog .el-form { width: 100%; overflow-x: hidden; }
.ayamag-dialog.order-dialog .el-row { width: 100%; margin-left: 0 !important; margin-right: 0 !important; }
.ayamag-dialog.order-dialog .el-col { padding-left: 6px; padding-right: 6px; }
/* 彻底隐藏施工单弹窗内任何滚动条 */
html body .el-overlay-dialog .ayamag-dialog.order-dialog * { scrollbar-width: none !important; -ms-overflow-style: none !important; }
html body .el-overlay-dialog .ayamag-dialog.order-dialog *::-webkit-scrollbar { display: none !important; }
/* 弹窗标题不换行 */
.ayamag-dialog .el-dialog__title { white-space: nowrap; }
/* 表单标题(label)不换行 */
.ayamag-dialog .el-form-item__label { white-space: nowrap; }
/* 批量领退料弹窗：更紧凑、宽度适中 */
.ayamag-dialog.batch-inv-dialog { width: 720px !important; min-width: 520px !important; max-width: 95vw !important; }
.ayamag-dialog.batch-inv-dialog .el-dialog__body { padding: 12px 16px 8px; overflow: hidden; }
.ayamag-dialog.batch-inv-dialog .batch-inv-form .el-form-item { margin-bottom: 8px; }
.ayamag-dialog.batch-inv-dialog .batch-inv-form .el-form-item__label { line-height: 28px; }
.ayamag-dialog.batch-inv-dialog .batch-inv-form .el-input__inner, .ayamag-dialog.batch-inv-dialog .batch-inv-form .el-select .el-input__inner { height: 28px; line-height: 28px; }
.ayamag-dialog.batch-inv-dialog .batch-inv-table-title { font-size: 13px; color: #606266; margin-bottom: 6px; font-weight: 500; }
.ayamag-dialog.batch-inv-dialog .batch-inv-table .cell { padding-top: 4px; padding-bottom: 4px; }
.ayamag-dialog.batch-inv-dialog .batch-inv-table .el-input-number { width: 100% !important; }
.ayamag-dialog.batch-inv-dialog .batch-inv-table .el-input-number .el-input__inner { text-align: left; }
.ayamag-dialog.batch-inv-dialog .el-dialog__footer { padding: 8px 16px 12px; }
.el-dialog { display: flex; flex-direction: column; }
.el-dialog__body { overflow: auto; }
/* 销售单弹窗：明细标题 + 商品选择 */
.ayamag-dialog.sale-dialog { width: 780px !important; min-width: 620px !important; max-width: 95vw !important; height: auto !important; max-height: 90vh !important; }
.ayamag-dialog.sale-dialog .el-dialog__body { padding: 16px 20px 12px; overflow-x: hidden; }
.sale-items-header, .sale-item-row { display: grid; grid-template-columns: 110px 1fr 110px 80px 110px 50px; gap: 8px; align-items: center; }
/* 施工反馈弹窗：宽度固定、避免横向滚动、用料卡片化 */
/* 施工反馈弹窗：宽度固定、避免横向滚动、用料卡片化 */
.fb-dialog { width: 760px !important; min-width: 560px !important; max-width: 95vw !important; }
.fb-dialog .el-dialog__body { padding: 16px 20px 12px; overflow-x: hidden; }
.fb-dialog .fb-materials-list { max-height: 220px; overflow-y: auto; overflow-x: hidden; margin-bottom: 10px; }
.fb-dialog .fb-material-card { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid #ebeef5; border-radius: 6px; background: #fafbfc; margin-bottom: 6px; }
.fb-dialog .fb-material-card .fb-material-info { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* 兼容旧 flex 布局（保留，防止其他位置用到 .fb-add-material） */
.fb-dialog .fb-add-material { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fb-dialog .fb-add-material .el-select { flex: 1; min-width: 180px; }
.fb-dialog .fb-add-material .el-input-number { width: 130px !important; flex: 0 0 130px; }
.fb-dialog .fb-add-material .fb-mat-tag { flex: 0 0 auto; color: #606266; font-size: 13px; }
.fb-dialog .fb-add-material .fb-mat-unit { flex: 0 0 auto; color: #909399; font-size: 13px; margin-right: 4px; }
/* 添加用料：表头在上、输入框同行的类表格布局 */
.fb-dialog .fb-add-material-grid { display: flex; flex-direction: column; gap: 8px; }
.fb-dialog .fb-add-material-head,
.fb-dialog .fb-add-material-row { display: grid; gap: 12px; align-items: center; }
.fb-dialog .fb-add-material-head { color: #606266; font-size: 13px; font-weight: 500; padding-left: 4px; }
.fb-dialog .fb-add-material-head .fb-add-material-op { text-align: center; }
.fb-dialog .fb-add-material-num { display: flex; align-items: center; gap: 6px; }
.fb-dialog .fb-add-material-num .el-input-number { width: 120px !important; flex: none; }
.fb-dialog .fb-add-material-btn { justify-self: start; }
.sale-items-header { color: #909399; font-size: 12px; padding: 0 8px 6px; border-bottom: 1px solid #ebeef5; margin-bottom: 8px; }
.sale-item-row { padding: 6px 8px; margin-bottom: 6px; border: 1px solid #ebeef5; border-radius: 6px; background: #fafbfc; }
.sale-item-row .el-select, .sale-item-row .el-input, .sale-item-row .el-input-number { width: 100% !important; }
.sale-item-row .el-input-number .el-input__inner { text-align: left; padding-left: 8px; }
.sale-h-op { text-align: center; }
/* Element Plus align-center 已做垂直居中；此处再兜底保证水平居中 */
.el-overlay-dialog { display: flex; align-items: center; justify-content: center; }

.layout { display: flex; height: 100%; }
.sidebar { width: 220px; background: #2b7de9; color: #eaf2fd; flex-shrink: 0; height: 100vh; overflow-y: auto; padding-bottom: 40px; }
.sidebar h1 { font-size: 20px; color: #fff; padding: 14px 20px; margin: 0; border-bottom: 1px solid rgba(255,255,255,.28); display: flex; flex-direction: column; align-items: center; line-height: 1.3; letter-spacing: 1px; }
.sidebar .menu-item { padding: 14px 22px; cursor: pointer; color: rgba(255,255,255,.75); }
.sidebar .menu-item:hover, .sidebar .menu-item.active { background: #fff; color: #2b7de9; }
/* 一级导航：字体更大、字重更高、未选颜色更白，选中态强对比 */
.sidebar .menu-group { display: flex; align-items: center; justify-content: space-between; padding: 15px 22px 7px; color: #fff; font-size: 15px; font-weight: 400; cursor: pointer; user-select: none; border-left: 3px solid transparent; }
.sidebar .menu-group:hover { background: rgba(255,255,255,.15); }
.sidebar .menu-group.active { background: rgba(255,255,255,.22); border-left-color: #fff; }
.sidebar .menu-group .caret { font-size: 11px; color: rgba(255,255,255,.8); }
.sidebar .menu-group .el-icon { margin-right: 8px; font-size: 17px; color: #fff; width: 1.2em; text-align: center; }
/* 二级导航：在一级导航文字右侧再缩进 0.5 字符（即二级位于一级文字右方 0.5 字符处，图标宽度已计入对齐） */
.sidebar .menu-sub { padding: 11px 22px 11px calc(22px + 1.2em + 8px + 0.5em + 1em); cursor: pointer; color: #fff; font-size: 14px; font-weight: 500; border-left: 3px solid transparent; }
.sidebar .menu-sub:hover { background: rgba(255,255,255,.22); }
.sidebar .menu-sub.active { background: #fff; color: #2b7de9; border-left-color: #fff; font-weight: 700; box-shadow: inset 4px 0 0 #fff; }
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { height: 56px; background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid #e8e8e8; }
.content { flex: 1; overflow: auto; padding: 20px; }
.page-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; }

.login-wrap { height: 100%; display: flex; align-items: center; justify-content: center; background: url(../img/login-bg.jpg) no-repeat center center / cover fixed; position: relative; }
.login-wrap::before { content: ''; position: absolute; inset: 0; background: rgba(15,23,42,.45); }
.login-box { width: 360px; background: #fff; border-radius: 12px; padding: 32px; position: relative; z-index: 1; box-shadow: 0 8px 32px rgba(0,0,0,.25); }
.login-box h2 { text-align: center; margin: 0 0 8px; color: #2b7de9; line-height: 1.3; }
.login-box .copy { text-align: center; color: #aaa; font-size: 12px; margin-top: 16px; }

.kpi-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.kpi { flex: 1; min-width: 160px; background: #fff; border-radius: 10px; padding: 18px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.kpi .num { font-size: 26px; font-weight: 700; color: #2b7de9; }
.kpi .lab { color: #888; font-size: 13px; }
.toolbar { margin-bottom: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.muted { color: #999; }
.full { width: 100%; }

/* 需求8：派单可视化看板 */
.dispatch-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.lane { min-width: 230px; max-width: 230px; background: #f5f7fa; border: 1px solid #e8ebf0; border-radius: 10px; padding: 10px; }
.lane.pool { background: #fff8ec; border-color: #f5dab1; }
.lane.drop-hint { outline: 2px dashed #2b7de9; }
.lane-head { font-weight: 600; font-size: 14px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lane-sub { font-size: 12px; color: #999; margin-bottom: 8px; }
.sat-bar { height: 6px; background: #e6e8eb; border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.sat-bar > i { display: block; height: 100%; border-radius: 3px; transition: width .2s; }
.wo-card { background: #fff; border: 1px solid #ebeef5; border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; cursor: grab; }
.wo-card:active { cursor: grabbing; }
.wo-card:hover { border-color: #2b7de9; box-shadow: 0 2px 8px rgba(43,125,233,.12); }
.wo-line { font-size: 12px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wo-customer { font-weight: 600; font-size: 13px; color: #303133; }
.wo-customer-line { display: flex; justify-content: space-between; align-items: center; }
.wo-customer-name { font-weight: 600; font-size: 13px; color: #303133; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wo-address { color: #606266; }
.wo-note { color: #606266; margin-bottom: 4px; }
.wo-note .wo-lbl { color: #909399; }
.lane-empty { color: #bbb; font-size: 12px; text-align: center; padding: 14px 0; border: 1px dashed #dcdfe6; border-radius: 8px; }
.fb-detail-row { display:grid; grid-template-columns: 2fr 1fr 1fr 60px; gap:8px; align-items:center; margin-bottom:6px; }
.fb-detail-row.fb-detail-head { color:#606266; font-size:14px; font-weight:600; }
@media (max-width: 640px) { .fb-detail-row { grid-template-columns: 1fr 1fr; } .fb-detail-row .el-button { grid-column: span 2; } }
