/* 魔方罗盘仪表盘样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f5f7fa; min-height: 100vh; }
.header { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; padding: 20px 32px; display: flex; align-items: center; justify-content: space-between; }
.header h1 { font-size: 1.5em; font-weight: 600; }
.header .meta { font-size: 12px; opacity: 0.8; }
.tabs { display: flex; background: #fff; padding: 0 32px; border-bottom: 1px solid #eef0f5; overflow-x: auto; }
.tab { padding: 16px 24px; cursor: pointer; border-bottom: 3px solid transparent; color: #666; font-size: 14px; white-space: nowrap; transition: all .2s; }
.tab:hover { color: #667eea; }
.tab.active { color: #667eea; border-bottom-color: #667eea; font-weight: 600; }
.main { padding: 24px 32px; max-width: 1400px; margin: 0 auto; }
.toolbar { background: #fff; border-radius: 12px; padding: 16px 20px; margin-bottom: 20px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.toolbar label { font-size: 13px; color: #666; }
.toolbar select, .toolbar input { padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; min-width: 160px; }
.toolbar input[type=date] { min-width: 140px; }
.btn { padding: 8px 20px; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; transition: all .2s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(102,126,234,.4); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-pink { background: linear-gradient(135deg, #f093fb, #f5576c); }
.btn-green { background: linear-gradient(135deg, #11998e, #38ef7d); }
.btn-orange { background: linear-gradient(135deg, #f2994a, #f2c94c); color: #333; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.kpi-card .label { font-size: 12px; color: #999; margin-bottom: 8px; }
.kpi-card .value { font-size: 28px; font-weight: 700; color: #333; }
.kpi-card .unit { font-size: 14px; color: #999; margin-left: 4px; }
.kpi-card.profit .value { color: #10b981; }
.kpi-card.profit-rate .value { color: #6366f1; }
.chart-card, .table-card, .panel { background: #fff; border-radius: 12px; padding: 20px; margin-bottom: 20px; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.chart-card h3, .table-card h3, .panel h3 { font-size: 14px; color: #333; margin-bottom: 16px; }
.chart-wrapper { position: relative; height: 300px; }
.table-card { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f0f0f0; }
th { background: #fafbfc; color: #666; font-weight: 600; font-size: 12px; white-space: nowrap; }
tr:hover td { background: #fafbfc; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.status-banner { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.status-banner.loading { background: #eff6ff; color: #1e40af; }
.status-banner.error { background: #fef2f2; color: #991b1b; }
.status-banner.success { background: #f0fdf4; color: #166534; }
.status-banner.info { background: #fefce8; color: #854d0e; }
.debug-area { background: #1e1e1e; color: #d4d4d4; padding: 16px; border-radius: 8px; font-size: 12px; max-height: 400px; overflow-y: auto; font-family: Consolas, monospace; white-space: pre-wrap; word-break: break-all; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.upload-zone { border: 2px dashed #667eea; border-radius: 12px; padding: 40px; text-align: center; cursor: pointer; transition: all .2s; background: #fafbff; }
.upload-zone:hover { background: #eef0ff; }
.upload-zone.dragover { background: #dde1ff; border-color: #764ba2; }
.upload-zone p { color: #666; margin-top: 8px; }
.stat-row { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 16px; }
.stat-item { background: #f5f7fa; padding: 12px 16px; border-radius: 8px; font-size: 13px; }
.stat-item strong { color: #667eea; }
.progress-bar { height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #667eea, #764ba2); transition: width .3s; }
.hidden { display: none !important; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; }
.tag-matched { background: #dcfce7; color: #166534; }
.tag-unmatched { background: #fee2e2; color: #991b1b; }
.table-note { color: #999; font-size: 12px; margin-top: 8px; }

/* ===== 本地模拟模块 ===== */
.mock-upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.mock-tip { color: #888; font-size: 12px; margin-bottom: 12px; }
.mock-upload-zone { padding: 28px; }
.mock-preview { margin-top: 16px; padding-top: 16px; border-top: 1px solid #f0f0f0; }

/* 多天分组预览 */
.day-groups { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.day-group-row { display: flex; align-items: center; gap: 10px; background: #f5f6fa; border: 1px solid #ebedf3; border-radius: 8px; padding: 7px 12px; }
.day-group-row .dg-date { font-weight: 600; color: #2b2f3a; font-size: 13px; }
.day-group-row .dg-count { font-size: 12px; color: #6d5efc; background: rgba(109, 94, 252, .1); padding: 2px 8px; border-radius: 10px; font-weight: 600; }

/* 日期选择栏 */
.mock-date-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.mock-date-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mock-date-select { padding: 8px 12px; border: 1px solid #d9dce5; border-radius: 8px; font-size: 14px; background: #fff; color: #2b2f3a; cursor: pointer; min-width: 170px; }
.mock-date-select:focus { outline: none; border-color: #6d5efc; box-shadow: 0 0 0 3px rgba(109, 94, 252, .12); }
#mock-date-note { margin: 6px 0 14px; }

/* 横排人员标签页 */
.owner-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 2px solid #eef0f5; }
.owner-tab { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 10px 18px 8px; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; transition: all .2s; flex-shrink: 0; }
.owner-tab:hover { background: #f5f7ff; }
.owner-tab .ot-name { font-size: 14px; font-weight: 600; color: #666; }
.owner-tab .ot-qty { font-size: 11px; color: #999; }
.owner-tab.active { border-bottom-color: #667eea; }
.owner-tab.active .ot-name { color: #667eea; }
.owner-tab.active .ot-qty { color: #667eea; }

/* 明细面板 */
.owner-panels { padding-top: 18px; }
.owner-panel { display: none; }
.owner-panel.active { display: block; animation: panelFade .2s ease; }
@keyframes panelFade { from { opacity: 0; } to { opacity: 1; } }

/* 左右分栏 6:4 */
.op-split { display: grid; grid-template-columns: 6fr 4fr; gap: 16px; }
.op-col { border: 1px solid #eef0f5; border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; height: 520px; }
.col-title { font-size: 13px; font-weight: 600; color: #555; background: #fafbff; padding: 10px 14px; border-bottom: 1px solid #eef0f5; flex-shrink: 0; }
.bar-list { padding: 12px 14px; overflow-y: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.bar-empty { color: #aaa; font-size: 13px; }

/* 总计面板：右侧货号列表隐藏滚动条（滚轮仍可滚动） */
.total-panel .op-right .bar-list { scrollbar-width: none; -ms-overflow-style: none; }
.total-panel .op-right .bar-list::-webkit-scrollbar { width: 0; display: none; }

/* 进度条条目 */
.bar-item { position: relative; cursor: default; padding: 8px 10px 8px 14px; border-radius: 8px; transition: background .15s, box-shadow .15s; }
.op-left .bar-item { cursor: pointer; }
.op-left .bar-item:hover { background: #f5f7ff; }
.bar-item.active { background: linear-gradient(90deg, #e3e9ff, #eef1ff); box-shadow: inset 0 0 0 1px #c5cffb, 0 2px 8px rgba(102,126,234,.18); }
.bar-item.active::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: linear-gradient(180deg, #667eea, #764ba2); }
.bar-info { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 5px; }
.bar-label { font-size: 13px; font-weight: 600; color: #444; font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", -apple-system, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-item.active .bar-label { color: #4c5fc7; font-weight: 700; }
.bar-qty { font-size: 12px; color: #888; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-item.active .bar-qty { color: #5a6bc9; font-weight: 600; }
.bar-track { height: 7px; background: #eef1f7; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #667eea, #764ba2); border-radius: 4px; transition: width .4s ease; }
.bar-item.goods .bar-label { font-size: 12px; font-weight: 500; }
.bar-fill.goods-fill { background: linear-gradient(90deg, #10b981, #38ef7d); }
@media (max-width: 768px) {
  .header { padding: 16px; flex-direction: column; gap: 8px; }
  .tabs { padding: 0 16px; }
  .main { padding: 16px; }
  .toolbar { padding: 12px; }
  .mock-upload-grid { grid-template-columns: 1fr; }
  .op-split { grid-template-columns: 1fr; }
}
