* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", sans-serif; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); height: 100vh; overflow: hidden; }
#login-container { width: 100vw; height: 100vh; display: flex; align-items: center; justify-content: center; position: fixed; top: 0; left: 0; z-index: 9999; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.login-card { background: white; border-radius: 32px; padding: 40px 48px; width: 500px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); text-align: center; }
.login-card h1 { font-size: 28px; color: #1e293b; margin-bottom: 8px; }
.login-card p { color: #64748b; margin-bottom: 32px; font-size: 14px; }
.slogan { background: #f1f5f9; padding: 12px; border-radius: 60px; margin: 20px 0; font-size: 16px; font-weight: 500; line-height: 1.4; }
.slogan strong { color: #3b82f6; }
.input-group { margin: 20px 0; text-align: left; }
.input-group label { display: block; margin-bottom: 8px; font-weight: 600; }
.input-group input, .input-group select { width: 100%; padding: 12px 16px; border: 1px solid #cbd5e1; border-radius: 40px; font-size: 16px; }
.captcha-row { display: flex; gap: 10px; align-items: center; }
.captcha-row input { width: auto; flex: 1; min-width: 0; }
.captcha-img { flex-shrink: 0; height: 46px; width: 124px; border-radius: 10px; border: 1px solid #cbd5e1; background: #f8fafc; cursor: pointer; }
.captcha-img:hover { border-color: #3b82f6; }
.login-btn { width: 100%; background: #3b82f6; color: white; border: none; padding: 12px; border-radius: 40px; font-size: 18px; font-weight: 600; cursor: pointer; margin-top: 16px; }
.login-btn:hover { background: #2563eb; }
.login-btn.feishu { background: #00a854; margin-top: 10px; }
.login-btn.feishu:hover { background: #008a45; }
.error-msg { color: #ef4444; font-size: 14px; margin-top: 12px; display: none; }
.divider { display: flex; align-items: center; margin: 16px 0; }
.divider::before, .divider::after { content: ''; flex: 1; border-bottom: 1px solid #e2e8f0; }
.divider span { padding: 0 16px; color: #94a3b8; font-size: 14px; }
.app-container { display: none; width: 100vw; height: 100vh; background: #f1f5f9; overflow: hidden; position: relative; }
.sidebar { width: 260px; background: white; border-right: 1px solid #e2e8f0; display: flex; flex-direction: column; padding: 20px 0; overflow-y: auto; transition: width 0.25s ease, padding 0.25s ease; flex-shrink: 0; }
.sidebar.collapsed { width: 0; padding: 0; overflow: hidden; border-right: 0; }
.sidebar.collapsed .sidebar-header,
.sidebar.collapsed .user-info,
.sidebar.collapsed #nav-menu,
.sidebar.collapsed .logout-btn { display: none; }
.sidebar-toggle-btn { position: absolute; top: 16px; left: 268px; width: 28px; height: 28px; background: white; border: 1px solid #e2e8f0; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; color: #64748b; box-shadow: 0 2px 8px rgba(0,0,0,0.12); z-index: 200; transition: left 0.25s ease, transform 0.2s; }
.sidebar-toggle-btn:hover { color: #3b82f6; transform: scale(1.1); }
.app-container.collapsed .sidebar-toggle-btn { left: 8px; }
.sidebar-header { padding: 0 20px 20px; border-bottom: 1px solid #e2e8f0; margin-bottom: 20px; }
.sidebar-header h3 { color: #0f172a; }
.user-info { padding: 12px 20px; border-bottom: 1px solid #e2e8f0; margin-bottom: 12px; font-size: 13px; color: #334155; }
.user-info .name { font-weight: 600; color: #0f172a; }
.user-info .role { font-size: 12px; color: #64748b; }
.nav-item { padding: 12px 24px; margin: 4px 12px; border-radius: 12px; cursor: pointer; transition: 0.2s; color: #334155; font-weight: 500; }
.nav-item:hover { background: #f1f5f9; }
.nav-item.active { background: #3b82f6; color: white; }
/* 可展开父项 + 物料类型子项（料齐通大师：组装/电子双通道，全局作用域） */
.nav-parent { position: relative; padding-right: 30px; }
.nav-parent::after { content: "▸"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 12px; transition: transform 0.2s; }
.nav-parent.open::after { transform: translateY(-50%) rotate(90deg); }
.nav-parent.active::after { color: rgba(255,255,255,0.85); }
.nav-children { display: block; overflow: hidden; max-height: 0; opacity: 0; margin: 0 12px; transition: max-height 0.25s ease, opacity 0.18s ease, margin 0.25s ease; }
.nav-children.open { max-height: 140px; opacity: 1; margin: -2px 12px 8px; }
.nav-child { padding: 9px 12px 9px 22px; margin: 2px 0; font-size: 13px; color: #475569; border-left: 2px solid #e2e8f0; border-radius: 0 10px 10px 0; }
.nav-child.active { background: #3b82f6; color: white; border-left-color: #2563eb; }
.mat-type-badge { display: inline-block; vertical-align: middle; margin-left: 10px; padding: 4px 12px; border-radius: 14px; background: #eef2ff; color: #4338ca; font-size: 13px; font-weight: 600; border: 1px solid #c7d2fe; }
.logout-btn { margin-top: auto; background: #ef4444; color: white; border: none; padding: 10px; border-radius: 40px; margin: 20px 12px; cursor: pointer; font-weight: 600; }
.main-content { flex: 1; overflow-y: auto; padding: 24px; }
.func-page { display: none; }
.func-page.active-page { display: block; }
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: 20px; }
.product-card { background: white; border-radius: 20px; padding: 24px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.product-card h3 { font-size: 20px; color: #1e293b; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid #eee; }
.stat-item { font-size: 15px; padding: 4px 0; display: flex; justify-content: space-between; }
.stat-item .label { font-weight: normal; }
.stat-item .value { font-weight: bold; }
.upload-area { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.btn { padding: 6px 12px; border-radius: 8px; border: none; background: #3b82f6; color: white; cursor: pointer; font-size: 13px; }
.btn.gray { background: #64748b; }
.btn.red { background: #ef4444; }
.btn.green { background: #22c55e; }
.modal { display: none; position: fixed; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,0.5); z-index: 9999; }
.modal-content { background: white; margin: 5% auto; padding: 20px; width: 90%; height: 80%; overflow-y: auto; border-radius: 12px; transition: all 0.3s; }
.modal-content.fullscreen { width: 100%; height: 100%; margin: 0; border-radius: 0; max-width: 100%; max-height: 100%; }
.close { float: right; font-size: 24px; cursor: pointer; margin-left: 12px; }
.fullscreen-btn { float: right; font-size: 20px; cursor: pointer; margin-left: 12px; color: #3b82f6; }
.fullscreen-btn:hover { color: #1e40af; }
table { border-collapse: collapse; width: 100%; margin-top:10px; font-size: 12px; }
th,td { border:1px solid #ccc; padding:6px; text-align:left; }
th { background:#f1f5f9; }
.date-label { background:#fff; padding:12px 20px; border-radius:12px; margin-bottom:20px; font-size:16px; font-weight:bold; }
.detail-section { margin-bottom: 30px; }
.detail-section h4 { background: #f1f5f9; padding: 8px 12px; border-radius: 8px; margin-bottom: 10px; color: #1e293b; }
.auto-schedule-btn-area { text-align: center; margin-top: 20px; display: none; }
.btn-auto-schedule { padding: 12px 40px; border-radius: 40px; border: none; background: #8b5cf6; color: white; font-size: 18px; font-weight: bold; cursor: pointer; }
.btn-auto-schedule:hover { background: #7c3aed; }

/* 预测卡片样式 */
.fc-card { background: white; border-radius: 16px; padding: 0; box-shadow: 0 4px 16px rgba(0,0,0,0.06); overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; }
.fc-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.fc-card-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.fc-card-header h3 { font-size: 18px; color: white; margin: 0; }
.fc-month-badge { background: rgba(255,255,255,0.25); color: white; padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.fc-card-body { padding: 20px; }
.fc-total-block { text-align: center; margin-bottom: 16px; }
.fc-total-num { font-size: 32px; font-weight: 800; color: #1e293b; line-height: 1.2; }
.fc-total-unit { font-size: 14px; color: #64748b; font-weight: normal; }
.fc-total-label { font-size: 13px; color: #94a3b8; margin-top: 2px; }
.fc-cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.fc-cat-box { background: #f8fafc; border-radius: 10px; padding: 12px; text-align: center; border: 1px solid #e2e8f0; }
.fc-cat-box .cat-name { font-size: 12px; color: #64748b; margin-bottom: 4px; }
.fc-cat-box .cat-num { font-size: 18px; font-weight: 700; color: #334155; }
.fc-cat-box .cat-unit { font-size: 11px; color: #94a3b8; }
.fc-ai-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.fc-ai-row.ok { background: #f0fdf4; border: 1px solid #bbf7d0; }
.fc-ai-row.warn { background: #fef2f2; border: 1px solid #fecaca; }
.fc-ai-row.no-data { background: #f8fafc; border: 1px solid #e2e8f0; }
.fc-ai-label { display: flex; align-items: center; gap: 6px; color: #475569; }
.fc-ai-val { font-weight: 700; }
.fc-ai-dev { font-size: 13px; font-weight: 600; padding: 2px 8px; border-radius: 12px; }
.fc-ai-dev.ok { color: #16a34a; background: #dcfce7; }
.fc-ai-dev.warn { color: #dc2626; background: #fee2e2; }
.fc-card-footer { padding: 0 20px 20px; }
.schedule-modal-content { max-width: 800px; margin: 5% auto; background: white; padding: 20px; border-radius: 12px; max-height: 85%; overflow-y: auto; }
.schedule-form-group { margin-bottom: 15px; }
.schedule-form-group label { display: inline-block; width: 120px; font-weight: 600; }
.schedule-form-group input[type="file"], .schedule-form-group input[type="number"], .schedule-form-group input[type="text"] { width: 70%; padding: 6px 10px; border: 1px solid #ccc; border-radius: 4px; }
.schedule-form-group input[type="checkbox"] { margin-right: 10px; }
.schedule-log { background: #f4f4f4; padding: 10px; border-radius: 4px; height: 150px; overflow-y: auto; font-family: monospace; font-size: 12px; white-space: pre-wrap; }
.schedule-progress { width: 100%; height: 20px; background: #e0e0e0; border-radius: 10px; margin: 10px 0; }
.schedule-progress-bar { height: 100%; width: 0%; background: #3b82f6; border-radius: 10px; transition: width 0.3s; color: #fff; font-size: 11px; line-height: 20px; text-align: center; overflow: hidden; }
.feishu-import-area { margin: 10px 0; padding: 12px; background: #f0fdf4; border-radius: 8px; border: 1px solid #bbf7d0; display: none; }
.feishu-import-area .import-group { margin: 8px 0; padding: 10px; background: #f8fafc; border-radius: 6px; border: 1px solid #e2e8f0; }
.feishu-import-area .import-group label { font-weight: 600; font-size: 14px; display: block; margin-bottom: 6px; }
.feishu-import-area .import-group input { width: 45%; padding: 4px 8px; border: 1px solid #ccc; border-radius: 4px; margin: 2px 4px 2px 0; font-size: 12px; }
.feishu-import-area .import-group button { padding: 4px 12px; font-size: 12px; }
.total-row { margin-top: 12px; padding-top: 10px; border-top: 1px solid #eee; font-weight: bold; color: #e53935; display: flex; justify-content: space-between; }
.item { font-size: 15px; padding: 4px 0; display: flex; justify-content: space-between; }
.otd-preview { font-size: 12px; color: #64748b; margin-top: 4px; }
.otd-preview table { margin-top: 4px; font-size: 11px; border-collapse: collapse; }
.otd-preview td, .otd-preview th { border: 1px solid #e2e8f0; padding: 2px 6px; }
/* ===== 首页 ===== */
.home-hero { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border-radius: 20px; padding: 36px 40px; margin-bottom: 24px; position: relative; overflow: hidden; }
.home-hero::after { content: "📊"; position: absolute; right: 32px; top: 50%; transform: translateY(-50%); font-size: 96px; opacity: 0.18; }
.home-hero h1 { font-size: 30px; margin-bottom: 8px; font-weight: 700; }
.home-hero p { font-size: 15px; opacity: 0.9; max-width: 70%; line-height: 1.6; }
.home-hero .home-date { margin-top: 14px; display: inline-block; padding: 4px 14px; background: rgba(255,255,255,0.2); border-radius: 20px; font-size: 13px; }
.home-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.home-stat-card { background: white; border-radius: 16px; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); transition: transform 0.2s; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.home-stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.08); }
.home-stat-card .hs-icon { width: 44px; height: 44px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 12px; }
.home-stat-card .hs-label { font-size: 13px; color: #64748b; margin-bottom: 4px; }
.home-stat-card .hs-value { font-size: 34px; font-weight: 700; color: #0f172a; line-height: 1.15; }
.home-stat-card .hs-sub { font-size: 11px; color: #94a3b8; margin-top: 4px; }
.home-section-title { font-size: 18px; font-weight: 600; color: #1e293b; margin: 24px 0 14px; display: flex; align-items: center; gap: 8px; }
.home-section-title::before { content: ""; width: 4px; height: 18px; background: #3b82f6; border-radius: 2px; }
.home-module-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.home-module-card { background: white; border-radius: 14px; padding: 22px 20px; cursor: pointer; transition: all 0.2s; border: 1px solid #e2e8f0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; }
.home-module-card:hover { transform: translateY(-2px); border-color: #3b82f6; box-shadow: 0 6px 18px rgba(59,130,246,0.12); }
.home-module-card .hm-icon { font-size: 34px; line-height: 1.15; }
.home-module-card .hm-name { font-size: 17px; font-weight: 700; color: #0f172a; }
.home-module-card .hm-desc { font-size: 12.5px; color: #64748b; line-height: 1.5; }
.home-module-card.disabled { opacity: 0.5; cursor: not-allowed; }
.home-module-card.disabled:hover { transform: none; border-color: #e2e8f0; box-shadow: none; }
.home-ai-banner { background: linear-gradient(135deg, #f0fdf4 0%, #ecfeff 100%); border: 1px solid #bbf7d0; border-radius: 14px; padding: 16px 20px; margin-bottom: 24px; display: flex; align-items: center; gap: 14px; }
.home-ai-banner .ai-icon { font-size: 28px; }
.home-ai-banner .ai-text { flex: 1; font-size: 13px; color: #334155; line-height: 1.6; }
.home-ai-banner .ai-text strong { color: #16a34a; }

/* ===== 料齐通大师 ===== */
.mat-wf-tabbar { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.mat-wf-tab { padding: 9px 20px; border-radius: 22px; border: 1px solid #cbd5e1; background: #f8fafc; color: #475569; cursor: pointer; font-size: 14px; font-weight: 700; transition: all 0.2s; }
.mat-wf-tab.active { background: #3b82f6; color: white; border-color: transparent; box-shadow: 0 3px 10px rgba(59,130,246,0.3); }
.mat-wf-tab:hover:not(.active) { background: #eef2ff; color: #4338ca; }
.mat-wf-section { animation: matWfFade 0.2s ease; }
@keyframes matWfFade { from { opacity: 0; } to { opacity: 1; } }
.mat-dev-tip { margin-top: 12px; padding: 10px 14px; background: #eff6ff; border-left: 3px solid #3b82f6; border-radius: 6px; font-size: 12.5px; color: #1e40af; line-height: 1.6; }
.mat-tab-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.mat-tab { padding: 8px 18px; border-radius: 20px; border: 1px solid #e2e8f0; background: white; color: #64748b; cursor: pointer; font-size: 13px; font-weight: 600; transition: all 0.2s; }
.mat-tab.active { background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%); color: white; border-color: transparent; }
.mat-tab:hover:not(.active) { background: #f1f5f9; }

/* auto-fit 均分：②5张/③4张/⑤3张指标卡都占满一行对齐，不再出现孤卡折行 */
.mat-stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 20px; }
.mat-stat-card { background: white; border-radius: 14px; padding: 18px 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; border-left: 4px solid #3b82f6; }
.mat-stat-card.warn { border-left-color: #f59e0b; }
.mat-stat-card.ai { border-left-color: #8b5cf6; background: linear-gradient(135deg, #faf5ff 0%, #ffffff 100%); }
.mat-stat-card.risk { border-left-color: #ef4444; }
.mat-stat-icon { font-size: 26px; }
.mat-stat-num { font-size: 34px; font-weight: 700; color: #0f172a; line-height: 1.15; }
.mat-stat-label { font-size: 13px; color: #64748b; }

.mat-main-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.mat-panel { background: white; border-radius: 16px; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.mat-panel.right.ai { background: linear-gradient(135deg, #faf5ff 0%, #f5f3ff 100%); border: 1px solid #ddd6fe; }
.mat-panel-title { font-size: 15px; color: #1e293b; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid #eee; }
.mat-upload-group { margin-bottom: 12px; }
.mat-upload-label { display: block; font-size: 13px; color: #64748b; margin-bottom: 6px; font-weight: 600; }
.mat-file-input { width: 100%; padding: 8px; border: 1px dashed #cbd5e1; border-radius: 8px; font-size: 13px; background: #f8fafc; }
.mat-btn-group { display: flex; gap: 8px; margin-top: 14px; }
.mat-calc-btn { background: #3b82f6; color: white; border: none; padding: 10px 16px; border-radius: 10px; font-weight: 600; cursor: pointer; flex: 1; }
.mat-calc-btn:hover { opacity: 0.9; }
.mat-calc-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.mat-status { margin-top: 10px; font-size: 13px; color: #64748b; min-height: 18px; }
.mat-status.ok { color: #16a34a; }
.mat-status.err { color: #ef4444; }

.mat-ai-btn { width: 100%; background: #3b82f6; color: white; border: none; padding: 12px; border-radius: 10px; font-weight: 600; cursor: pointer; font-size: 14px; margin-bottom: 14px; }
.mat-ai-btn:hover { opacity: 0.9; }
.mat-ai-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.mat-ai-summary { font-size: 13px; color: #475569; line-height: 1.6; margin-bottom: 10px; }
.mat-ai-risk { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.mat-ai-risk .risk-chip { padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.mat-ai-risk .risk-chip.high { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.mat-ai-risk .risk-chip.mid { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.mat-ai-risk .risk-chip.low { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.mat-ai-suggestion { margin-top: 12px; }
.mat-ai-suggestion summary { cursor: pointer; font-size: 13px; font-weight: 600; color: #6366f1; padding: 8px 0; }
.mat-ai-suggestion-text { font-size: 13px; color: #475569; line-height: 1.7; white-space: pre-wrap; padding: 10px; background: rgba(255,255,255,0.6); border-radius: 8px; }

/* AI进度条（通用：料齐通+预测下达复用） */
.mat-ai-progress-wrap, .ai-progress-wrap { margin: 12px 0 0; padding: 12px; background: rgba(255,255,255,0.6); border-radius: 10px; }
.ai-progress-wrap { padding: 10px 12px; }
.mat-ai-progress-bar, .ai-progress-bar { width: 100%; height: 10px; background: rgba(99,102,241,0.15); border-radius: 5px; overflow: hidden; }
.mat-ai-progress-fill, .ai-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%); border-radius: 5px; transition: width 0.5s ease; }
.mat-ai-progress-text, .ai-progress-text { margin-top: 8px; font-size: 12px; color: #475569; font-weight: 500; }

/* 飞书同步进度条 */
.mat-sync-progress { margin: 14px 0 0; padding: 12px; background: rgba(255,255,255,0.6); border-radius: 10px; }
.mat-sync-progress-bar { width: 100%; height: 10px; background: rgba(16,185,129,0.15); border-radius: 5px; overflow: hidden; }
.mat-sync-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #10b981 0%, #059669 100%); border-radius: 5px; transition: width 0.4s ease; }
.mat-sync-progress-text { margin-top: 8px; font-size: 12px; color: #475569; font-weight: 500; }

/* 插单模拟/NPI 表单 */
.mat-sim-form { margin-top: 14px; }
.mat-form-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.mat-form-row label { font-size: 13px; color: #475569; white-space: nowrap; min-width: 70px; }
.mat-form-row input { padding: 6px 10px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 13px; min-width: 100px; }
.mat-form-row input:focus { outline: none; border-color: #3b82f6; }

/* 风险确认：标题独立行 + 操作条左对齐（导入主按钮做大）+ 次级说明带 */
.mat-risk-header { margin-bottom: 10px; }
.mat-risk-header h3 { margin: 0; padding: 0; border: none; font-size: 15px; color: #1e293b; }
.mat-risk-actions { display: flex; align-items: center; justify-content: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.mat-risk-actions input[type="file"] { display: none; }
.mat-file-pick { display: flex; align-items: center; gap: 8px; cursor: pointer; min-width: 0; max-width: 280px; }
.mat-file-pick-btn { padding: 9px 18px; border-radius: 9px; border: 1px dashed #93c5fd; background: #eff6ff; color: #1d4ed8; font-size: 14px; font-weight: 600; white-space: nowrap; transition: 0.2s; }
.mat-file-pick:hover .mat-file-pick-btn { background: #dbeafe; }
.mat-file-pick-name { font-size: 12.5px; color: #475569; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 主操作：大号醒目蓝钮带光晕，明确高于其他控件一级 */
.mat-po-import-btn { padding: 14px 38px; border-radius: 12px; background: #3b82f6; color: white; border: none; font-size: 16px; font-weight: 700; letter-spacing: 0.5px; cursor: pointer; box-shadow: 0 4px 14px rgba(59,130,246,0.4); transition: 0.2s; }
.mat-po-import-btn:hover { background: #2563eb; box-shadow: 0 6px 18px rgba(37,99,235,0.45); transform: translateY(-1px); }
.mat-po-import-btn:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(59,130,246,0.35); }
.mat-po-refresh-btn { padding: 8px 14px; border-radius: 8px; }
.mat-risk-note { margin-bottom: 6px; padding: 10px 14px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 12.5px; color: #64748b; line-height: 1.5; }
#mat-wf-risk .mat-status { margin: 0 0 14px; }
.mat-table-section { background: white; border-radius: 16px; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.mat-table-tabs { display: flex; gap: 4px; border-bottom: 1px solid #e2e8f0; margin-bottom: 14px; }
.mat-tab-btn { padding: 8px 16px; border: none; background: none; color: #64748b; cursor: pointer; font-size: 13px; font-weight: 600; border-bottom: 2px solid transparent; transition: 0.2s; }
.mat-tab-btn.active { color: #3b82f6; border-bottom-color: #3b82f6; }
.mat-tab-btn:hover:not(.active) { color: #1e293b; }
.mat-table-wrap { overflow-x: auto; }
.mat-data-table { width: 100%; border-collapse: collapse; font-size: 13px; }

/* === OTD 飞书嵌入看板 === */
.otd-feishu-embed { background: #fff; border-radius: 16px; padding: 14px 16px 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.06); margin-bottom: 20px; border: 1px solid #e2e8f0; }
.otd-embed-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.otd-embed-title { font-size: 14px; font-weight: 700; color: #0f172a; }
.otd-embed-link { font-size: 12px; color: #3b82f6; text-decoration: none; padding: 4px 10px; border-radius: 6px; background: #eff6ff; transition: 0.2s; }
.otd-embed-link:hover { background: #dbeafe; }
.otd-embed-iframe { width: 100%; height: 600px; border: 0; border-radius: 10px; background: #f8fafc; display: block; }

/* === 用户管理页面 === */
.admin-container { background: #fff; border-radius: 16px; padding: 20px 24px; box-shadow: 0 2px 12px rgba(0,0,0,0.05); }
.admin-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.admin-tip { margin-left: auto; font-size: 12px; color: #64748b; }
.admin-table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid #e2e8f0; }
.admin-user-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-user-table th { background: #f1f5f9; padding: 10px 12px; text-align: left; font-weight: 600; color: #475569; border-bottom: 1px solid #e2e8f0; white-space: nowrap; }
.admin-user-table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; color: #334155; vertical-align: middle; }
.admin-user-table tr:hover { background: #f8fafc; }
.admin-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.admin-badge.green { background: #dcfce7; color: #16a34a; }
.admin-badge.red { background: #fee2e2; color: #dc2626; }
.admin-badge.blue { background: #dbeafe; color: #2563eb; }
.admin-role-select { padding: 4px 8px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 12px; background: #fff; cursor: pointer; }
.admin-role-select:focus { outline: 2px solid #3b82f6; }
.btn-sm { padding: 4px 10px; border: none; border-radius: 6px; font-size: 12px; cursor: pointer; font-weight: 600; transition: 0.2s; }
.btn-sm.green { background: #22c55e; color: #fff; }
.btn-sm.green:hover { background: #16a34a; }
.btn-sm.warn { background: #f59e0b; color: #fff; }
.btn-sm.warn:hover { background: #d97706; }
.btn-sm.orange { background: #fb923c; color: #fff; }
.btn-sm.orange:hover { background: #ea580c; }
.btn-sm.red { background: #ef4444; color: #fff; }
.btn-sm.red:hover { background: #dc2626; }

/* ===== 计划管理：双 Tab ===== */
.plan-tab-bar { display:flex; gap:8px; margin-bottom:20px; }
.plan-tab { padding:10px 22px; border-radius:20px; border:1px solid #e2e8f0; background:white;
            color:#64748b; cursor:pointer; font-size:14px; font-weight:600; transition:all .2s; }
.plan-tab.active { background:linear-gradient(135deg,#3b82f6 0%,#6366f1 100%); color:white; border-color:transparent; }
.plan-tab:hover:not(.active) { background:#f1f5f9; }
.plan-tab-content { display:none; }
.plan-tab-content.active { display:block; }
.plan-overview-toolbar { display:flex; align-items:center; gap:12px; margin-bottom:16px;
                         background:white; padding:14px 20px; border-radius:12px; box-shadow:0 2px 8px rgba(0,0,0,0.04); }
.plan-overview-tip { color:#64748b; font-size:13px; flex:1; }
.plan-status-text { color:#64748b; font-size:13px; }

/* 企业级表格卡（每产品一行表） */
.plan-overview-grid { display:flex; flex-direction:column; gap:16px; }
.plan-product-card { background:white; border-radius:14px; padding:18px 22px;
                     box-shadow:0 2px 10px rgba(0,0,0,0.05); }
.plan-product-card .ppc-header { display:flex; align-items:center; justify-content:space-between;
                                  margin-bottom:10px; padding-bottom:8px; border-bottom:2px solid #f1f5f9; }
.plan-product-card .ppc-name { font-size:17px; font-weight:700; color:#1e293b; }
.plan-product-card .ppc-feishu { font-size:12px; padding:2px 10px; border-radius:10px; }
.plan-product-card .ppc-feishu.ok { background:#dcfce7; color:#16a34a; }
.plan-product-card .ppc-feishu.na { background:#fef3c7; color:#d97706; }
.ppc-table { width:100%; border-collapse:collapse; font-size:13px; }
.ppc-table th, .ppc-table td { border:1px solid #e2e8f0; padding:6px 10px; text-align:center; }
.ppc-table th { background:#f8fafc; color:#475569; font-weight:600; }
.ppc-table .ppc-row-label { background:#f1f5f9; font-weight:600; text-align:left; }
.ppc-table .ppc-num { font-weight:700; color:#1e293b; }
.ppc-table .ppc-rate { color:#3b82f6; }
.ppc-table .ppc-rate.warn { color:#dc2626; }

/* 计划管理卡片：月/周分区 + 达成率徽章 */
.ppc-section-title { display:flex; align-items:center; gap:8px; margin:14px 0 8px;
                     font-size:14px; font-weight:700; color:#334155; }
.ppc-section-title:first-of-type { margin-top:4px; }
.ppc-section-title .ppc-tag { font-size:11px; padding:1px 8px; border-radius:8px;
                              background:#e0f2fe; color:#0284c7; font-weight:700; }
.ppc-rate-badge { display:inline-block; min-width:52px; padding:2px 10px; border-radius:10px;
                  font-weight:700; font-size:12px; }
.ppc-rate-badge.good { background:#dcfce7; color:#16a34a; }
.ppc-rate-badge.mid { background:#fef9c3; color:#ca8a04; }
.ppc-rate-badge.warn { background:#fee2e2; color:#dc2626; }

/* 智能排产布局 */
.smart-layout { display:grid; grid-template-columns:380px 1fr; gap:20px; }
.smart-config-panel { background:white; border-radius:14px; padding:20px; box-shadow:0 2px 10px rgba(0,0,0,0.05);
                      height:fit-content; }
.smart-config-panel h3 { margin-bottom:16px; color:#1e293b; }
.smart-form-group { margin-bottom:12px; }
.smart-form-group label { display:block; font-size:13px; font-weight:600; color:#475569; margin-bottom:4px; }
.smart-form-group input[type=text], .smart-form-group input[type=number], .smart-form-group select {
    width:100%; padding:7px 10px; border:1px solid #cbd5e1; border-radius:6px; font-size:13px; }
.smart-form-group input[type=file] { width:100%; font-size:12px; }
.smart-inline { display:inline-flex; align-items:center; gap:4px; margin-right:14px; font-weight:normal; }
.smart-btn-row { display:flex; gap:8px; margin-top:18px; }
.smart-result-panel { display:flex; flex-direction:column; gap:16px; }
.smart-section { background:white; border-radius:12px; padding:14px 18px; box-shadow:0 2px 8px rgba(0,0,0,0.04); }
.smart-section h4 { background:#f1f5f9; padding:6px 10px; border-radius:6px; margin-bottom:10px; color:#1e293b; }
.smart-kitting-table table { width:100%; font-size:12px; border-collapse:collapse; }
.smart-kitting-table th, .smart-kitting-table td { border:1px solid #e2e8f0; padding:4px 8px; }
.smart-advice { font-size:13px; line-height:1.6; color:#334155; }
.smart-advice h3 { color:#1e293b; margin:10px 0 4px; }
.smart-advice ul, .smart-advice ol { margin:4px 0 4px 20px; }
.smart-summary-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; }
.smart-summary-card { background:#f8fafc; border:1px solid #e2e8f0; border-radius:8px; padding:10px; text-align:center; }
.smart-summary-card .ssc-num { font-size:20px; font-weight:800; color:#1e293b; }
.smart-summary-card .ssc-label { font-size:11px; color:#64748b; }
.smart-download-row { margin-top:14px; display:flex; justify-content:flex-end; }
.smart-download-btn { padding:9px 22px; font-size:14px; font-weight:600; border-radius:8px;
                      box-shadow:0 2px 6px rgba(22,163,74,0.25); transition:all .2s; }
.smart-download-btn:hover:not(:disabled) { transform:translateY(-1px); box-shadow:0 4px 12px rgba(22,163,74,0.35); }
.smart-download-btn:disabled { opacity:.65; cursor:wait; }
.mat-data-table th { background: #f8fafc; padding: 10px 12px; text-align: left; font-weight: 600; color: #475569; border-bottom: 1px solid #e2e8f0; white-space: nowrap; }
.mat-data-table td { padding: 8px 12px; border-bottom: 1px solid #f1f5f9; color: #334155; }
.mat-data-table tr:hover { background: #f8fafc; }
.mat-data-table .risk-high { color: #dc2626; font-weight: 600; }
.mat-data-table .risk-mid { color: #d97706; font-weight: 600; }
.mat-data-table .risk-low { color: #16a34a; }
.mat-empty-tip { text-align: center; padding: 40px; color: #94a3b8; font-size: 14px; }

/* ==================== ChatBI 计划助手 ==================== */
.chatbi-toggle-btn {
    position: fixed; right: 24px; bottom: 24px; width: 56px; height: 56px;
    border-radius: 50%; border: none; cursor: pointer; font-size: 26px;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%); color: white;
    box-shadow: 0 8px 24px rgba(59,130,246,0.4); z-index: 9000;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.chatbi-toggle-btn:hover { transform: scale(1.08); box-shadow: 0 12px 32px rgba(59,130,246,0.5); }
.chatbi-panel {
    position: fixed; right: -460px; top: 0; width: 440px; height: 100vh;
    background: #f8fafc; box-shadow: -8px 0 32px rgba(0,0,0,0.12);
    z-index: 9001; display: flex; flex-direction: column;
    transition: right 0.3s ease;
}
.chatbi-panel.open { right: 0; }
.chatbi-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: white; flex-shrink: 0;
}
.chatbi-title { font-size: 16px; font-weight: 700; }
.chatbi-header-actions { display: flex; align-items: center; gap: 4px; }
.chatbi-action-btn {
    background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.2);
    color: white; font-size: 12px; cursor: pointer; padding: 5px 10px;
    border-radius: 6px; transition: 0.15s; white-space: nowrap;
}
.chatbi-action-btn:hover { background: rgba(255,255,255,0.3); }
.chatbi-action-btn.close { border: none; background: none; font-size: 16px; padding: 5px 8px; }
.chatbi-action-btn.close:hover { background: rgba(255,255,255,0.2); }
.chatbi-suggest {
    display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px;
    background: white; border-bottom: 1px solid #e2e8f0; flex-shrink: 0;
}
.chatbi-suggest button {
    padding: 5px 10px; border: 1px solid #e2e8f0; border-radius: 16px;
    background: #f8fafc; color: #475569; font-size: 12px; cursor: pointer;
    transition: 0.15s;
}
.chatbi-suggest button:hover { background: #eff6ff; border-color: #3b82f6; color: #3b82f6; }
.chatbi-quick-btn {
    padding: 5px 10px; border: 1px solid #e2e8f0; border-radius: 16px;
    background: #f8fafc; color: #475569; font-size: 12px; cursor: pointer;
    transition: 0.15s; white-space: nowrap;
}
.chatbi-quick-btn:hover { background: #eff6ff; border-color: #3b82f6; color: #3b82f6; }
.chatbi-datacard-wrapper { align-self: flex-start; max-width: 100%; margin-bottom: 4px; }
.chatbi-datacard {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.chatbi-datacard .dc-title {
    font-size: 13px; font-weight: 700; color: #1e293b; margin-bottom: 6px;
    padding-bottom: 6px; border-bottom: 1px solid #e2e8f0;
}
.chatbi-datacard .dc-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 3px 0; font-size: 13px; color: #475569;
}
.chatbi-datacard .dc-row b { color: #1e293b; font-size: 14px; }
.chatbi-followup {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
    padding: 4px 0;
}
.chatbi-followup .fu-label { font-size: 12px; color: #94a3b8; width: 100%; }
.chatbi-followup .fu-tag {
    padding: 4px 10px; border: 1px solid #bfdbfe; border-radius: 14px;
    background: #eff6ff; color: #2563eb; font-size: 12px; cursor: pointer;
    transition: 0.15s;
}
.chatbi-followup .fu-tag:hover { background: #3b82f6; color: white; border-color: #3b82f6; }
.chatbi-retry-btn {
    margin-top: 6px; padding: 5px 14px; border: 1px solid #fca5a5;
    border-radius: 14px; background: #fef2f2; color: #ef4444;
    font-size: 12px; cursor: pointer; transition: 0.15s;
}
.chatbi-retry-btn:hover { background: #ef4444; color: white; border-color: #ef4444; }
.chatbi-messages {
    flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 12px;
}
.chatbi-msg { display: flex; gap: 8px; max-width: 100%; }
.chatbi-msg.user { justify-content: flex-end; }
.chatbi-msg.user .chatbi-bubble {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%); color: white;
    border-radius: 16px 16px 4px 16px; padding: 10px 14px; font-size: 14px; line-height: 1.5;
    max-width: 320px; word-break: break-word;
}
.chatbi-msg.ai .chatbi-avatar {
    width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #06b6d4 100%);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}
.chatbi-msg.ai .chatbi-bubble {
    background: white; color: #1e293b; border: 1px solid #e2e8f0;
    border-radius: 4px 16px 16px 16px; padding: 10px 14px; font-size: 14px; line-height: 1.6;
    max-width: 340px; word-break: break-word; box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.chatbi-msg.thinking .chatbi-bubble {
    background: #f1f5f9; color: #64748b; font-style: italic; border: none;
    border-radius: 12px; padding: 8px 14px; font-size: 13px;
}
.chatbi-dot {
    display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #3b82f6;
    animation: chatbi-bounce 1.2s infinite ease-in-out;
}
@keyframes chatbi-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}
.chatbi-tool-badge {
    align-self: flex-start; font-size: 11px; color: #6366f1; background: #eef2ff;
    border: 1px solid #c7d2fe; border-radius: 6px; padding: 3px 8px;
}
.chatbi-tool-badge code { font-family: monospace; font-weight: 600; }
.chatbi-bubble pre { background: #1e293b; color: #e2e8f0; padding: 8px 10px; border-radius: 6px; overflow-x: auto; font-size: 12px; margin: 6px 0; }
.chatbi-bubble code { background: #f1f5f9; padding: 1px 4px; border-radius: 3px; font-size: 13px; font-family: monospace; }
.chatbi-bubble pre code { background: none; padding: 0; }
.chatbi-bubble h2 { font-size: 15px; font-weight: 700; color: #1e293b; margin: 8px 0 4px; }
.chatbi-bubble h3 { font-size: 14px; font-weight: 700; color: #1e293b; margin: 6px 0 3px; }
.chatbi-bubble ul { margin: 4px 0 4px 18px; }
.chatbi-bubble li { margin: 2px 0; }
.chatbi-bubble strong { color: #0f172a; }
.chatbi-bubble table { border-collapse: collapse; margin: 6px 0; font-size: 12px; }
.chatbi-bubble th, .chatbi-bubble td { border: 1px solid #e2e8f0; padding: 4px 8px; }
.chatbi-bubble th { background: #f8fafc; font-weight: 600; }
.chatbi-input-area {
    display: flex; gap: 8px; padding: 12px 16px; background: white;
    border-top: 1px solid #e2e8f0; flex-shrink: 0;
}
.chatbi-input-area textarea {
    flex: 1; border: 1px solid #cbd5e1; border-radius: 10px; padding: 8px 12px;
    font-size: 14px; font-family: inherit; resize: none; outline: none;
    transition: border-color 0.15s;
}
.chatbi-input-area textarea:focus { border-color: #3b82f6; }
.chatbi-input-area button {
    padding: 8px 18px; border: none; border-radius: 10px; cursor: pointer;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%); color: white;
    font-weight: 600; font-size: 14px; transition: 0.15s;
}
.chatbi-input-area button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(59,130,246,0.3); }
.chatbi-input-area button:disabled { opacity: 0.5; cursor: not-allowed; }
