/* 宝措卤阳 彩妆ODM工厂管理CRM - 样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", Arial, sans-serif; background: #f2f4f8; color: #1f2937; font-size: 14px; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* 顶栏 */
.topbar { background: #1e293b; color: #fff; }
.topbar-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 24px; padding: 0 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; background: linear-gradient(135deg, #e11d48, #be123c); color: #fff; font-weight: 700; font-size: 18px; }
.brand-logo.big { width: 56px; height: 56px; font-size: 28px; border-radius: 14px; }
.brand-text strong { display: block; font-size: 16px; letter-spacing: 2px; }
.brand-text em { display: block; font-style: normal; font-size: 11px; color: #94a3b8; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: #cbd5e1; padding: 8px 14px; border-radius: 6px; font-size: 14px; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.nav a.on { color: #fff; background: #2563eb; }
.userbox { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.userbox a { color: #94a3b8; }
.userbox a:hover { color: #fff; }
.uname { color: #e2e8f0; }

.role-tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; }
.role-admin { background: #fde68a; color: #92400e; }
.role-staff { background: #bfdbfe; color: #1e40af; }
.role-factory { background: #bbf7d0; color: #166534; }

/* 主体 */
.main { max-width: 1280px; margin: 0 auto; padding: 20px; }
.page-title { font-size: 20px; margin-bottom: 16px; color: #111827; }
.foot { text-align: center; color: #9ca3af; font-size: 12px; padding: 24px 0; }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 10px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.06); border-top: 3px solid #2563eb; }
.stat-card.warn { border-top-color: #f59e0b; }
.stat-card.ok { border-top-color: #16a34a; }
.stat-num { font-size: 28px; font-weight: 700; color: #111827; }
.stat-label { color: #6b7280; font-size: 13px; margin-top: 4px; }

/* 面板 */
.panel { background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 20px; padding: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.panel-head h3 { font-size: 16px; color: #111827; }
.mono { font-family: Consolas, monospace; }

/* 表格 */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 10px 8px; border-bottom: 1px solid #eef0f4; text-align: left; vertical-align: middle; font-size: 13px; }
.tbl th { color: #6b7280; font-weight: 600; background: #f9fafb; white-space: nowrap; }
.tbl tr:hover td { background: #f8fafc; }
.tbl .empty { text-align: center; color: #9ca3af; padding: 30px; }
.kf { color: #6b7280; max-width: 260px; }
.checklist-tbl td { vertical-align: top; }

/* 徽章 */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; white-space: nowrap; }
.st-draft { background: #f3f4f6; color: #6b7280; }
.st-submitted { background: #fef3c7; color: #b45309; }
.st-approved { background: #dcfce7; color: #15803d; }
.st-rejected { background: #fee2e2; color: #b91c1c; }
.stage-tag { background: #eef2ff; color: #4338ca; padding: 2px 8px; border-radius: 4px; font-size: 12px; }

/* 表单 */
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px; }
.fg label { display: block; font-size: 12px; color: #6b7280; margin-bottom: 4px; }
.fg.full { grid-column: 1 / -1; }
input[type=text], input[type=password], input[type=date], input[type=number], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px; font-family: inherit; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
textarea { resize: vertical; }

.btn { display: inline-block; padding: 8px 18px; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; color: #374151; font-size: 13px; cursor: pointer; }
.btn:hover { background: #f9fafb; text-decoration: none; }
.btn.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn.primary:hover { background: #1d4ed8; }
.btn.ok { background: #16a34a; border-color: #16a34a; color: #fff; }
.btn.ok:hover { background: #15803d; }
.btn.danger { background: #dc2626; border-color: #dc2626; color: #fff; }
.btn.danger:hover { background: #b91c1c; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.big { padding: 10px 26px; font-size: 14px; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; }
.linkbtn { background: none; border: none; color: #2563eb; cursor: pointer; font-size: 13px; padding: 0; }
.linkbtn:hover { text-decoration: underline; }
.link { font-size: 13px; }

/* 提示 */
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.alert.ok { background: #dcfce7; color: #15803d; }
.alert.err { background: #fee2e2; color: #b91c1c; }
.alert.warn { background: #fef3c7; color: #b45309; }
.muted { color: #9ca3af; font-size: 12px; }

/* 筛选 */
.filter-bar { margin-bottom: 16px; }
.filter-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-form input[type=text] { width: 220px; }
.stage-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.stage-tabs a { padding: 6px 14px; border-radius: 16px; background: #fff; color: #4b5563; font-size: 13px; border: 1px solid #e5e7eb; }
.stage-tabs a:hover { text-decoration: none; border-color: #2563eb; color: #2563eb; }
.stage-tabs a.on { background: #2563eb; color: #fff; border-color: #2563eb; }

/* 进度条 */
.stage-bars { display: flex; flex-direction: column; gap: 10px; }
.stage-bar-row { display: flex; align-items: center; gap: 12px; }
.stage-bar-row.big .bar { height: 14px; }
.stage-name { width: 90px; font-size: 13px; color: #374151; flex-shrink: 0; }
.bar { flex: 1; height: 10px; background: #eef0f4; border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #3b82f6, #2563eb); border-radius: 6px; transition: width .4s; }
.stage-pct { width: 110px; font-size: 12px; color: #6b7280; text-align: right; }

/* 批次记录块 */
.rec-block { margin-bottom: 14px; }
.rec-label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; color: #111827; }
.rec-view { border-bottom: 1px dashed #eef0f4; padding: 10px 0; }
.rec-content { color: #374151; font-size: 13px; line-height: 1.8; background: #f9fafb; border-radius: 6px; padding: 10px; margin-top: 6px; white-space: normal; }

/* 详情键值 */
.kv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 20px; }
.kv { padding: 6px 0; border-bottom: 1px dashed #eef0f4; font-size: 13px; }
.kv.full { grid-column: 1 / -1; }
.kv span { color: #6b7280; display: inline-block; min-width: 110px; }

/* 保存条 */
.save-bar { display: flex; gap: 12px; margin: 16px 0; align-items: center; flex-wrap: wrap; }
.save-hint { color: #9ca3af; font-size: 12px; }

/* 流程指示条 */
.flow-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; font-size: 13px; }
.flow-bar i { color: #cbd5e1; font-style: normal; }
.flow-step { padding: 6px 14px; border-radius: 16px; background: #fff; border: 1px solid #e5e7eb; color: #6b7280; }
.flow-step.done { background: #ecfdf5; border-color: #a7f3d0; color: #15803d; }
.flow-step.now { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; font-weight: 600; }

/* 门禁状态 */
.req { display: inline-block; padding: 1px 7px; border-radius: 10px; background: #fee2e2; color: #b91c1c; font-size: 11px; font-weight: 600; vertical-align: middle; }
.chip-row { display: flex; gap: 8px; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; white-space: nowrap; }
.chip.yes { background: #dcfce7; color: #15803d; }
.chip.no { background: #fee2e2; color: #b91c1c; }
.gate-hint { font-size: 13px; margin: 0 0 6px; }
.gate-ok { color: #15803d; font-weight: 600; }
.gate-no { color: #b45309; font-weight: 600; line-height: 1.8; }
.btn.is-locked { opacity: .55; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); cursor: not-allowed; }

/* 上传区 */
.upload-tips { background: #eff6ff; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 12px; color: #1e40af; line-height: 1.8; }
.upload-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.upload-box { border: 1px dashed #cbd5e1; border-radius: 8px; padding: 14px; text-align: center; }
.upload-box h4 { font-size: 13px; margin-bottom: 10px; color: #374151; }
.up-btn { display: inline-block; padding: 8px 16px; background: #eff6ff; color: #2563eb; border-radius: 6px; cursor: pointer; font-size: 13px; }
.up-btn:hover { background: #dbeafe; }

/* 工厂联系人照片上传区 */
.ph-wrap { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.ph-preview { width: 120px; height: 120px; border: 1px dashed #d1d5db; border-radius: 8px; background: #f9fafb; display: flex; align-items: center; justify-content: center; overflow: hidden; text-align: center; }
.ph-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-preview.lg { width: 140px; height: 140px; }
.ph-preview .muted { padding: 0 8px; }
.ph-ops { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.ph-ops .up-status { margin-top: 2px; }
/* 名录列表中的联系人照片缩略图 */
.fphoto { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; border: 1px solid #e5e7eb; vertical-align: middle; background: #f3f4f6; }
.up-status { margin-top: 12px; font-size: 12px; }
.up-status .ok { color: #15803d; }
.up-status .fail { color: #b91c1c; }

/* 文件列表 */
.file-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.file-item { border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; background: #fff; }
.file-item img { width: 100%; height: 130px; object-fit: cover; display: block; background: #f3f4f6; }
.file-item .fi-body { padding: 8px; font-size: 12px; }
.file-item .fi-name { color: #374151; word-break: break-all; height: 32px; overflow: hidden; }
.file-item .fi-meta { color: #9ca3af; margin-top: 2px; display: flex; justify-content: space-between; align-items: center; }
.file-item .fi-del { color: #dc2626; cursor: pointer; background: none; border: none; font-size: 12px; }
.file-item .fi-pdf { height: 130px; display: flex; align-items: center; justify-content: center; font-size: 40px; background: #fef2f2; text-decoration: none; }
.file-item a { display: block; }

/* 审核面板 */
.review-panel { border: 2px solid #16a34a; }
.review-checks { background: #f0fdf4; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }
.review-checks label { margin-right: 18px; font-size: 13px; color: #166534; }

/* 登录页 */
.login-page { background: linear-gradient(160deg, #1e293b 0%, #0f172a 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-wrap { text-align: center; }
.login-card { background: #fff; border-radius: 16px; padding: 36px 40px; width: 380px; box-shadow: 0 20px 50px rgba(0,0,0,.4); }
.login-brand { margin-bottom: 24px; }
.login-brand h1 { font-size: 24px; letter-spacing: 6px; margin-top: 12px; color: #111827; }
.login-brand p { color: #6b7280; font-size: 13px; margin-top: 4px; }
.login-brand .brand-logo { width: 64px; height: 64px; font-size: 32px; border-radius: 16px; }
.login-form { text-align: left; }
.login-form label { display: block; font-size: 12px; color: #6b7280; margin: 12px 0 4px; }
.login-form .btn { margin-top: 20px; padding: 10px; font-size: 15px; }
.login-tip { margin-top: 16px; font-size: 12px; color: #9ca3af; }
.login-foot { color: #64748b; font-size: 12px; margin-top: 20px; }
.no-auth { padding: 80px; text-align: center; color: #b91c1c; font-size: 16px; }

.st-sel { width: auto !important; display: inline-block; padding: 4px 6px !important; font-size: 12px !important; }
.note-in { display: inline-block; width: 160px !important; padding: 4px 6px !important; font-size: 12px !important; }

@media (max-width: 900px) {
  .form-grid, .kv-grid, .upload-grid { grid-template-columns: 1fr; }
  .topbar-inner { flex-wrap: wrap; height: auto; padding: 10px; }
}
@media print {
  .topbar, .foot, .filter-bar, .save-bar, .up-btn, .st-sel, .note-in, .btn, .flow-bar { display: none !important; }
  body { background: #fff; }
}
