/* ===========================================================
   BOM 数据管理系统 · 共享样式
   重庆阅品科技有限公司 · 浅色主题
   =========================================================== */
:root{
  --bg:#f5f7fb; --card:#ffffff; --line:#e6eaf1; --text:#1e293b; --sub:#64748b;
  --blue:#2563eb; --blue-d:#1d4ed8; --blue-l:#dbeafe; --soft:#f8fafc;
  --green:#16a34a; --amber:#d97706; --rose:#e11d48; --violet:#7c3aed; --teal:#0d9488;
  --gray:#94a3b8; --shadow:0 1px 2px rgba(16,24,40,.04),0 6px 16px rgba(16,24,40,.05);
  --navw:216px; --navw-min:68px;
}
*{box-sizing:border-box;}
html,body{margin:0;}
body{
  color:var(--text); background:linear-gradient(180deg,#f7f9fc 0%,#f2f5fa 320px,#f2f5fa 100%);
  font-family:"Microsoft YaHei","PingFang SC","Helvetica Neue",Arial,sans-serif;
  -webkit-font-smoothing:antialiased; font-size:14px;
}
a{color:var(--blue); text-decoration:none;}
.wrap{margin-left:var(--navw); max-width:1700px; padding:22px 30px 70px;}

/* ---------- 左侧导航 ---------- */
.sidenav{
  position:fixed; left:0; top:0; bottom:0; width:var(--navw); z-index:60;
  background:#fff; border-right:1px solid var(--line);
  box-shadow:4px 0 18px rgba(16,24,40,.045);
  display:flex; flex-direction:column; overflow:auto;
}
.sidenav .inner{display:flex; flex-direction:column; flex:1; padding:16px 12px 20px;}
.brand{display:flex; align-items:center; justify-content:center; gap:10px; font-weight:700; letter-spacing:.3px; font-size:14.5px;
  padding:6px 9px 15px; margin:0 0 12px; border-bottom:1px solid var(--line);}
/* OMS 字母 logo（居中；letter-spacing 末尾留白用负外边距补偿，视觉才真正居中） */
.brand .btxt{display:flex; flex-direction:column; line-height:1.12; min-width:0; margin-right:-3px;
  font-size:20px; font-weight:800; letter-spacing:3px; color:var(--blue-d);}
.brand small{font-weight:400; color:var(--sub); font-size:11px; letter-spacing:0; margin-top:3px;}

/* 页头里的小按钮：无背景、无边框，点击开合左侧导航 */
.navtoggle{
  flex:0 0 auto; width:34px; height:34px; display:grid; place-items:center; padding:0;
  background:none; border:1px solid transparent; border-radius:10px; color:var(--sub);
  cursor:pointer; transition:.16s; font:inherit;
}
.navtoggle:hover{background:#eef4ff; color:var(--blue); border-color:#dbeafe;}
.navtoggle svg{display:block;}
.navlinks{display:flex; flex-direction:column; gap:4px;}
.navlinks a{
  display:flex; align-items:center; gap:10px; padding:10px 13px; border-radius:10px;
  color:#475569; font-size:13.5px; font-weight:500; transition:.16s;
}
.navlinks a svg{flex:0 0 auto; opacity:.8; transition:.16s;}
.navlinks a .nlbl{white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0;}
.navlinks a:hover{background:#eef4ff; color:var(--blue);}
.navlinks a:hover svg{opacity:1;}
.navlinks a.active{background:var(--blue); color:#fff; box-shadow:0 6px 16px rgba(37,99,235,.26);}
.navlinks a.active svg{opacity:1;}

/* 收起 / 展开：收起后整条侧栏滑出屏幕左侧，完全隐藏；点页头小按钮再打开 */
.sidenav{transition:transform .26s cubic-bezier(.4,0,.2,1);}
.sidenav.hidden{transform:translateX(-100%); box-shadow:none;}
.wrap{transition:margin-left .26s cubic-bezier(.4,0,.2,1);}
body.nav-hidden .wrap{margin-left:0;}
.hgroup{display:flex; align-items:center; gap:15px; min-width:0;}

/* 窄屏：导航回到顶部横排 */
@media(max-width:900px){
  .sidenav{position:sticky; top:0; bottom:auto; width:auto; flex-direction:row; align-items:center;
    border-right:0; border-bottom:1px solid var(--line); box-shadow:0 1px 0 var(--line);}
  .sidenav .inner{flex-direction:row; align-items:center; gap:14px; padding:10px 16px;}
  .brand{padding:0; border-bottom:0; margin-bottom:0; flex:0 0 auto;}
  .brand .btxt{flex-direction:row; align-items:baseline; gap:8px;}
  .brand small{margin-top:0;}
  .navlinks{flex-direction:row; margin-left:auto; gap:6px;}
  /* 窄屏：收起时整条导航栏直接不占位（横排栏若只做位移会留下空白条） */
  .sidenav{transition:none;}
  .sidenav.hidden{transform:none; display:none; box-shadow:none;}
  .wrap{margin-left:0; padding:18px 16px 60px;}
  body.nav-hidden .wrap{margin-left:0;}
  .hgroup{gap:11px;}
}

/* ---------- 页头 ---------- */
header.page{display:flex; flex-wrap:wrap; align-items:flex-end; justify-content:space-between; gap:16px; margin:24px 0 18px;}
h1{font-size:23px; margin:0 0 6px; letter-spacing:.6px; font-weight:700;}
.meta{font-size:13px; color:var(--sub);}
.meta b{color:var(--blue); font-weight:600;}

/* ---------- 统计条 ---------- */
.bar{display:flex; background:#fff; border:1px solid var(--line); border-radius:14px; overflow:hidden; box-shadow:var(--shadow);}
.bar>div{flex:1; padding:13px 22px; text-align:right; border-right:1px solid #eef2f8; min-width:104px;}
.bar>div:last-child{border-right:0;}
.bar .t{font-size:11.5px; color:var(--sub); letter-spacing:.3px;}
.bar .v{font-size:22px; font-weight:700; color:var(--blue); letter-spacing:-.4px; margin-top:2px; font-variant-numeric:tabular-nums;}

/* ---------- 卡片 ---------- */
.card{background:var(--card); border:1px solid var(--line); border-radius:14px; padding:18px 20px; box-shadow:var(--shadow); margin-bottom:18px;}
.grid2{display:grid; grid-template-columns:1fr 1fr; gap:18px; margin-bottom:18px; align-items:start;}
.grid3{display:grid; grid-template-columns:repeat(3,1fr); gap:18px; margin-bottom:18px; align-items:start;}
.grid2 .card,.grid3 .card{margin-bottom:0;}
@media(max-width:1050px){.grid2,.grid3{grid-template-columns:1fr;} .grid2 .card,.grid3 .card{margin-bottom:18px;}}
.chead{display:flex; flex-wrap:wrap; align-items:flex-end; justify-content:space-between; gap:10px;}
.card h2{font-size:15.5px; margin:0; position:relative; padding-left:13px; letter-spacing:.3px;}
.card h2::before{content:""; position:absolute; left:0; top:1px; bottom:1px; width:3.5px; border-radius:2px;
  background:linear-gradient(180deg,#60a5fa,#2563eb);}
.card .desc{font-size:12px; color:var(--sub); margin:5px 0 0; padding-left:13px; line-height:1.6;}
.legend{display:flex; flex-wrap:wrap; gap:16px; font-size:12px; color:var(--sub); margin:14px 0 8px; padding-left:13px;}
.legend i{display:inline-block; width:11px; height:11px; border-radius:3px; margin-right:6px; vertical-align:-1px;}

/* ---------- KPI 小卡 ---------- */
.kpis{display:grid; grid-template-columns:repeat(5,1fr); gap:14px; margin-bottom:18px;}
.kpis.k4{grid-template-columns:repeat(4,1fr);}
@media(max-width:1050px){.kpis,.kpis.k4{grid-template-columns:repeat(2,1fr);}}
.kpi{background:#fff; border:1px solid var(--line); border-radius:14px; padding:15px 17px; box-shadow:var(--shadow); position:relative; overflow:hidden;}
.kpi::after{content:""; position:absolute; right:-18px; top:-18px; width:64px; height:64px; border-radius:50%; opacity:.10; background:var(--blue);}
.kpi .kt{font-size:12px; color:var(--sub); letter-spacing:.3px;}
.kpi .kv{font-size:26px; font-weight:700; letter-spacing:-.6px; margin-top:6px; font-variant-numeric:tabular-nums; color:var(--blue-d);}
.kpi .kv small{font-size:13px; font-weight:500; color:var(--sub); margin-left:3px; letter-spacing:0;}
.kpi.g::after{background:var(--green);} .kpi.g .kv{color:var(--green);}
.kpi.a::after{background:var(--amber);} .kpi.a .kv{color:var(--amber);}
.kpi.v::after{background:var(--violet);} .kpi.v .kv{color:var(--violet);}
.kpi.t::after{background:var(--teal);} .kpi.t .kv{color:var(--teal);}

/* ---------- 表格 ---------- */
.tblbox{margin-top:14px; overflow:auto; border:1px solid var(--line); border-radius:12px; background:#fff; max-height:640px;}
table{border-collapse:separate; border-spacing:0; width:100%; font-size:13px;}
th,td{padding:9px 13px; white-space:nowrap; text-align:left; vertical-align:middle;}
thead th{
  position:sticky; top:0; z-index:3; background:#f4f7fb; font-weight:600; color:#475569; letter-spacing:.4px;
  border-bottom:1px solid #dde3ec; font-size:11.5px; padding:10px 13px;
}
thead th.sortable{cursor:pointer; user-select:none;}
thead th.sortable:hover{color:var(--blue);}
thead th .arw{opacity:.35; font-size:9px; margin-left:4px;}
thead th.asc .arw,thead th.desc .arw{opacity:1; color:var(--blue);}
tbody tr:nth-child(even) td{background:#fcfdff;}
tbody tr:hover td{background:#eef6ff;}
td{border-bottom:1px solid #f1f5f9;}
.mono{font-family:"Consolas","SFMono-Regular",Menlo,monospace; font-size:12.5px; letter-spacing:-.2px; color:#334155;}
.name{font-weight:500;}
.rank{color:var(--gray); font-variant-numeric:tabular-nums;}
.hl{color:var(--blue-d); font-weight:600;}

/* ---------- 标签 ---------- */
.tag{display:inline-block; padding:2px 9px; border-radius:20px; font-size:11.5px; font-weight:600; line-height:1.7;}
.tag.c0{background:#dbeafe; color:#1d4ed8;}
.tag.c1{background:#dcfce7; color:#15803d;}
.tag.c2{background:#fef3c7; color:#b45309;}
.tag.c3{background:#ede9fe; color:#6d28d9;}
.tag.c4{background:#ccfbf1; color:#0f766e;}
.tag.c5{background:#ffe4e6; color:#be123c;}
.tag.soft{background:#eef2f7; color:#475569;}
.tag.shared{background:#fee2e2; color:#b91c1c;}
.tag.lv{background:#e0e7ff; color:#3730a3;}

/* ---------- 客户切换 Tab ---------- */
.custtabs{display:flex; flex-wrap:wrap; gap:9px; margin-bottom:18px;}
.custtabs button{
  display:flex; align-items:center; gap:9px; padding:9px 18px; border-radius:11px;
  border:1px solid var(--line); background:#fff; color:#475569; font-size:13.5px; font-weight:500;
  cursor:pointer; font-family:inherit; transition:.16s; box-shadow:var(--shadow);
}
.custtabs button:hover{border-color:#93c5fd; color:var(--blue); background:#f5f9ff;}
.custtabs button.on{background:var(--blue); border-color:var(--blue); color:#fff; box-shadow:0 6px 16px rgba(37,99,235,.26);}
.custtabs .n{font-size:11.5px; font-weight:600; padding:1px 8px; border-radius:20px; background:#eef2f7; color:#64748b;}
.custtabs button.on .n{background:rgba(255,255,255,.26); color:#fff;}
.custtabs .dot{width:8px; height:8px; border-radius:50%; flex:0 0 auto;}

/* ---------- 侧栏客户筛选（每个导航项下面各挂一份客户列表；有侧栏的页面自动隐藏顶部 Tab） ---------- */
.sidenav ~ .wrap .custtabs{display:none;}
.sidenav ~ .wrap .toolbar .custselwrap{display:none;}
.navlinks a .nvtog{
  flex:0 0 auto; margin-left:auto; display:inline-flex; align-items:center;
  padding:2px 0 2px 6px; color:#94a3b8; opacity:.7; cursor:pointer;
}
.navlinks a .nvtog svg{transform:rotate(-90deg); transition:transform .16s;}
.navlinks a.nvopen .nvtog svg{transform:rotate(0);}
.navlinks a:hover .nvtog{opacity:1;}
.navlinks a.active .nvtog{color:#dbeafe; opacity:1;}
.ncbody{display:none; padding:2px 0 10px 14px;}
.ncbody.open{display:block;}
.ncbody .ncsub{padding:6px 0 5px; font-size:12.5px; color:#b6c2d2;}
.ncbody .ncsel{
  display:block; width:100%; padding:7px 9px; border:1px solid var(--line); border-radius:8px;
  background:#fff; color:#334155; font:inherit; font-size:13px; cursor:pointer; outline:none; transition:.14s;
}
.ncbody .ncsel:hover{border-color:#c7dafc;}
.ncbody .ncsel:focus{border-color:var(--blue); box-shadow:0 0 0 3px rgba(37,99,235,.12);}
@media(max-width:900px){
  .ncbody{display:none !important;}
  .navlinks a .nvtog{display:none;}
}

/* ---------- 客户独立 BOM 卡片 ---------- */
.ccards{display:grid; grid-template-columns:repeat(3,1fr); gap:18px;}
@media(max-width:1050px){.ccards{grid-template-columns:1fr;}}
.ccard{background:#fff; border:1px solid var(--line); border-radius:14px; padding:18px 20px; box-shadow:var(--shadow);
  cursor:pointer; transition:.18s; position:relative; overflow:hidden;}
.ccard::before{content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--blue);}
.ccard:hover{transform:translateY(-2px); box-shadow:0 10px 26px rgba(16,24,40,.10); border-color:#c7dafc;}
.ccard .ch{display:flex; align-items:center; gap:10px; margin-bottom:14px;}
.ccard .ch h3{margin:0; font-size:16px;}
.ccard .cgrid{display:grid; grid-template-columns:repeat(4,1fr); gap:10px; text-align:center;}
.ccard .cgrid .it{background:var(--soft); border-radius:10px; padding:10px 6px;}
.ccard .cgrid .it .k{font-size:11px; color:var(--sub);}
.ccard .cgrid .it .v{font-size:19px; font-weight:700; color:var(--blue-d); margin-top:3px; font-variant-numeric:tabular-nums;}
.ccard .cproj{font-size:11.5px; color:var(--sub); margin-top:13px; line-height:1.9; word-break:break-all;}
.ccard .go{position:absolute; right:18px; top:18px; font-size:12px; color:var(--blue); font-weight:600;}

/* ---------- 分组树表 ---------- */
table.tree{font-size:13px;}
table.tree td{padding:9px 13px;}
tr.grp-cust td{background:#eef4ff; font-weight:700; color:#1d4ed8; border-bottom:1px solid #dbe7fe; cursor:pointer; font-size:13px;}
tr.grp-cust:hover td{background:#e2ecff;}
tr.grp-proj td{background:#f7faff; font-weight:600; color:#334155; border-bottom:1px solid #eef2f8; cursor:pointer;}
tr.grp-proj:hover td{background:#eef6ff;}
tr.grp-cust .tw,tr.grp-proj .tw{display:inline-block; width:14px; color:#94a3b8; transition:transform .18s; margin-right:6px; transform-origin:45% 50%;}
tr.collapsed .tw{transform:rotate(-90deg);}
.gmeta{font-weight:400; color:var(--sub); font-size:11.5px; margin-left:12px;}
.gmeta b{color:var(--blue-d); font-weight:600;}
tr.det td:first-child{padding-left:32px;}
tr.det.lv2 td:first-child{padding-left:52px;}
tr.det{background:#fff;}
tr.det:hover td{background:#f5f9ff;}
tr.det.lv2{background:#fdfefe;}
.hide{display:none;}

/* ---------- 客户原材料库 ---------- */
.inv-input{
  width:86px; padding:6px 9px; border:1px solid #e2e8f0; border-radius:7px; font-size:12.5px;
  font-family:inherit; text-align:right; color:var(--text); background:#fff; outline:none;
  font-variant-numeric:tabular-nums; transition:.15s;
}
.inv-input:hover{border-color:#cbd5e1; background:#fbfdff;}
.inv-input:focus{border-color:#93c5fd; box-shadow:0 0 0 3px rgba(37,99,235,.12); background:#fff;}
.inv-input.txt{width:70px; text-align:center;}
.inv-input::-webkit-outer-spin-button,.inv-input::-webkit-inner-spin-button{-webkit-appearance:none; margin:0;}
.inv-input[type=number]{-moz-appearance:textfield;}
td.num{text-align:right; font-variant-numeric:tabular-nums;}
.stock{font-weight:700; font-variant-numeric:tabular-nums;}
.stock.ok{color:var(--green);}
.stock.low{color:var(--amber);}
.stock.bad{color:var(--rose);}
.stock.zero{color:var(--gray);}
.st{display:inline-block; padding:2px 9px; border-radius:20px; font-size:11.5px; font-weight:600; line-height:1.7;}
.st.ok{background:#dcfce7; color:#15803d;}
.st.bad{background:#fee2e2; color:#b91c1c;}
.st.warn{background:#fef3c7; color:#b45309;}
.st.none{background:#eef2f7; color:#64748b;}
.sumcards{display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin-top:16px;}
@media(max-width:1050px){.sumcards{grid-template-columns:1fr;}}
.sumcard{border:1px solid var(--line); border-radius:12px; padding:15px 17px; background:var(--soft);}
.sumcard .sh{display:flex; align-items:center; gap:9px; font-weight:700; margin-bottom:12px;}
.sumcard .sg{display:grid; grid-template-columns:repeat(3,1fr); gap:9px; text-align:center;}
.sumcard .sg .it,.sumcard .sg2 .it{background:#fff; border:1px solid #e9eef6; border-radius:9px; padding:9px 5px; text-align:center;}
.sumcard .sg .it .k,.sumcard .sg2 .it .k{font-size:11px; color:var(--sub);}
.sumcard .sg .it .v,.sumcard .sg2 .it .v{font-size:16.5px; font-weight:700; color:var(--blue-d); margin-top:3px; font-variant-numeric:tabular-nums;}
.sumcard .sg .it.warn .v,.sumcard .sg2 .it.warn .v{color:var(--rose);}
.btn.sm{padding:6px 13px; font-size:12.5px; border-radius:8px;}
.hint{font-size:12.5px; color:var(--sub); line-height:1.9;}
.hint b{color:var(--blue-d);}
.invtd{padding:6px 10px;}
.filerow{display:flex; align-items:center; gap:8px;}

/* 记录表单 */
.recform{display:grid; grid-template-columns:1fr 1fr; gap:10px;}
.recform .full{grid-column:1 / -1;}
.recform label{display:block; font-size:11.5px; color:var(--sub); margin-bottom:5px;}
.recform input,.recform select{
  width:100%; padding:8px 11px; border:1px solid #dde3ec; border-radius:9px; font-size:13px;
  font-family:inherit; color:var(--text); background:#fff; outline:none; transition:.15s;
}
.recform input:focus,.recform select:focus{border-color:#93c5fd; box-shadow:0 0 0 3px rgba(37,99,235,.12);}
.recform .typepick{display:flex; gap:8px;}
.recform .typepick button{
  flex:1; padding:9px 0; border:1px solid #dde3ec; background:#fff; border-radius:9px; cursor:pointer;
  font-family:inherit; font-size:13px; color:#475569; font-weight:500; transition:.15s;
}
.recform .typepick button:hover{border-color:#93c5fd; color:var(--blue); background:#f5f9ff;}
.recform .typepick button.on[data-t="in"]{background:#dcfce7; border-color:#86efac; color:#15803d;}
.recform .typepick button.on[data-t="init"]{background:#ede9fe; border-color:#c4b5fd; color:#6d28d9;}
.recform .typepick button.on[data-t="transit"]{background:#fef3c7; border-color:#fcd34d; color:#b45309;}
.recform .typepick button.on[data-t="out"]{background:#dbeafe; border-color:#93c5fd; color:#1d4ed8;}
.tbtn{border:0; background:#f1f5f9; color:#475569; border-radius:7px; padding:4px 10px; font-size:11.5px;
  cursor:pointer; font-family:inherit; transition:.15s;}
.tbtn:hover{background:#e2e8f0; color:var(--text);}
.tbtn.del:hover{background:#fee2e2; color:#b91c1c;}
.tbtn.to:hover{background:#dcfce7; color:#15803d;}
.tbtn.plus{background:var(--blue-l); color:var(--blue-d); font-weight:600;}
.tbtn.plus:hover{background:var(--blue); color:#fff;}
.mini .ip{padding:6px 9px; font-size:12.5px; border:1px solid #e2e8f0; border-radius:7px;
  font-family:inherit; color:var(--text); width:100%; outline:none;}
.mini .ip:focus{border-color:#93c5fd; box-shadow:0 0 0 3px rgba(37,99,235,.12);}
.recstat{display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-bottom:6px;}
.recstat .it{background:var(--soft); border:1px solid #e9eef6; border-radius:10px; padding:10px 8px; text-align:center;}
.recstat .it .k{font-size:11px; color:var(--sub);}
.recstat .it .v{font-size:17px; font-weight:700; margin-top:3px; font-variant-numeric:tabular-nums; color:var(--blue-d);}
.recstat .it.g .v{color:var(--green);} .recstat .it.a .v{color:var(--amber);}
.recstat .it.b .v{color:var(--blue);} .recstat .it.r .v{color:var(--rose);}

/* 客户分块 */
.custblock{border:1px solid var(--line); border-radius:14px; background:#fff; box-shadow:var(--shadow);
  margin-bottom:18px; overflow:hidden;}
.cbhead{display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding:13px 18px;
  background:linear-gradient(90deg,#f4f8ff,#fbfcff); border-bottom:1px solid var(--line);}
.cbhead h3{margin:0; font-size:14.5px; letter-spacing:.3px; display:flex; align-items:center; gap:9px;}
.cbmeta{font-size:12px; color:var(--sub);}
.cbmeta b{color:var(--blue-d); font-weight:600;}
.cbhead .go{margin-left:auto;}
.custblock .tblbox{margin:0; border:0; border-radius:0; max-height:none;}
.custblock .tblbox table{font-size:12.5px;}
.custblock .tblbox thead th{background:#f7fafe; position:static;}
.subhd{padding:9px 18px; font-size:11.5px; color:var(--sub); letter-spacing:.4px;
  background:#fbfdff; border-bottom:1px solid #f1f5f9; font-weight:600;}
.sg2{display:grid; grid-template-columns:repeat(3,1fr); gap:9px;}
.sglab{font-size:11px; color:var(--sub); margin:12px 0 7px; font-weight:600; letter-spacing:.3px;}
.sglab:first-of-type{margin-top:2px;}

/* ---------- 视图切换 ---------- */
.viewtabs{display:inline-flex; background:#eef2f7; border-radius:10px; padding:3px;}
.viewtabs button{border:0; background:transparent; padding:7px 16px; border-radius:8px; font-size:13px;
  color:#64748b; cursor:pointer; font-family:inherit; font-weight:500; transition:.15s;}
.viewtabs button.on{background:#fff; color:var(--blue); box-shadow:0 1px 3px rgba(16,24,40,.10);}

/* ---------- 进度条单元格 ---------- */
.barcell{display:flex; align-items:center; gap:8px;}
.barcell .bg{flex:0 0 110px; height:8px; background:#eef2f7; border-radius:5px; overflow:hidden;}
.barcell .bg i{display:block; height:100%; border-radius:5px; background:linear-gradient(90deg,#93c5fd,#2563eb);}
.barcell .pc{font-size:11.5px; color:var(--sub); min-width:34px;}

/* ---------- 柱状图（纯 CSS/SVG） ---------- */
.chart{margin-top:12px;}
.bars{display:flex; align-items:flex-end; gap:14px; height:190px; padding:0 4px 0 8px;}
.bars .item{flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; height:100%; gap:6px;}
.bars .item .val{font-size:12.5px; font-weight:700; color:var(--blue-d); font-variant-numeric:tabular-nums;}
.bars .item .col{width:100%; max-width:62px; border-radius:7px 7px 3px 3px; background:linear-gradient(180deg,#93c5fd,#2563eb); transition:.3s;}
.bars .item .lbl{font-size:11.5px; color:var(--sub); text-align:center; white-space:nowrap;}
.bars .item:hover .col{filter:brightness(1.06);}

/* 横向条形 */
.hbars{display:flex; flex-direction:column; gap:11px; margin-top:14px;}
.hbar{display:grid; grid-template-columns:150px 1fr 48px; align-items:center; gap:12px; font-size:12.5px;}
.hbar .k{color:#334155; font-weight:500; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.hbar .t{height:9px; background:#eef2f7; border-radius:6px; overflow:hidden;}
.hbar .t i{display:block; height:100%; border-radius:6px; background:linear-gradient(90deg,#93c5fd,#2563eb);}
.hbar .n{color:var(--blue-d); font-weight:700; text-align:right; font-variant-numeric:tabular-nums;}

/* ---------- 筛选工具条 ---------- */
.toolbar{display:flex; flex-wrap:wrap; gap:10px; align-items:center; padding:13px 16px; background:#fff;
  border:1px solid var(--line); border-radius:12px; box-shadow:var(--shadow); margin-bottom:16px;}
.toolbar label{font-size:12.5px; color:var(--sub); margin-right:-4px;}
.toolbar input[type=text],.toolbar select{
  padding:8px 12px; border:1px solid #dde3ec; border-radius:9px; font-size:13px; color:var(--text);
  background:#fff; outline:none; font-family:inherit; transition:.15s;
}
.toolbar input[type=text]{min-width:230px;}
.toolbar input:focus,.toolbar select:focus{border-color:#93c5fd; box-shadow:0 0 0 3px rgba(37,99,235,.12);}
.btn{padding:8px 15px; border-radius:9px; border:1px solid #dde3ec; background:#fff; color:#334155;
  font-size:13px; cursor:pointer; font-family:inherit; transition:.15s; font-weight:500;}
.btn:hover{border-color:#93c5fd; color:var(--blue); background:#f5f9ff;}
.btn.pri{background:var(--blue); border-color:var(--blue); color:#fff; box-shadow:0 4px 12px rgba(37,99,235,.25);}
.btn.pri:hover{background:var(--blue-d); color:#fff;}
.btn.danger{border-color:#fecdd3; color:#be123c; background:#fff;}
.btn.danger:hover{background:#fff1f2; border-color:#fda4af; color:#be123c;}
.tbtns{display:flex; gap:5px; justify-content:flex-end; flex-wrap:nowrap;}
.spacer{flex:1;}
.count{font-size:12.5px; color:var(--sub);}
.count b{color:var(--blue);}

/* ---------- 空状态 ---------- */
.empty{padding:46px 20px; text-align:center; color:var(--gray); font-size:13.5px;}

/* ---------- 页脚 ---------- */
footer{margin-top:30px; padding-top:18px; border-top:1px solid var(--line); color:var(--gray); font-size:12.5px;
  display:flex; flex-wrap:wrap; gap:8px; justify-content:space-between;}

/* ---------- 详情抽屉 ---------- */
.drawer-mask{position:fixed; inset:0; background:rgba(15,23,42,.32); opacity:0; pointer-events:none; transition:.2s; z-index:90;}
.drawer-mask.on{opacity:1; pointer-events:auto;}
.drawer{position:fixed; top:0; right:0; height:100%; width:min(560px,94vw); background:#fff; z-index:100;
  box-shadow:-12px 0 34px rgba(15,23,42,.16); transform:translateX(102%); transition:.26s cubic-bezier(.4,0,.2,1);
  display:flex; flex-direction:column;}
.drawer.on{transform:translateX(0);}
.drawer .dh{padding:18px 22px; border-bottom:1px solid var(--line); display:flex; align-items:flex-start; justify-content:space-between; gap:12px;}
.drawer .dh h3{margin:0 0 4px; font-size:16px;}
.drawer .dh .sub{font-size:12.5px; color:var(--sub);}
.drawer .db{padding:18px 22px; overflow:auto; flex:1;}
.drawer .x{border:none; background:#f1f5f9; width:30px; height:30px; border-radius:8px; cursor:pointer; font-size:16px; color:var(--sub); line-height:1;}
.drawer .x:hover{background:#e2e8f0; color:var(--text);}
.kv-list{display:grid; grid-template-columns:88px 1fr; gap:9px 14px; font-size:13px;}
.kv-list .k{color:var(--sub);}
.kv-list .v{color:var(--text); font-weight:500; word-break:break-all;}
.sec-title{font-size:12.5px; font-weight:700; color:var(--blue-d); letter-spacing:.4px; margin:20px 0 10px;
  padding-bottom:6px; border-bottom:1px dashed #dbe7fe;}
.mini{width:100%; font-size:12.5px;}
.mini th,.mini td{padding:7px 10px;}
.mini thead th{position:static;}

/* ===========================================================
   每日入库交付 / 入库交付看板
   =========================================================== */
/* 日期区间输入 */
.toolbar input[type=date]{
  padding:7px 11px; border:1px solid #dde3ec; border-radius:9px; font-size:12.5px; color:var(--text);
  background:#fff; outline:none; font-family:inherit; transition:.15s;
}
.toolbar input[type=date]:focus{border-color:#93c5fd; box-shadow:0 0 0 3px rgba(37,99,235,.12);}
.toolbar .sep{color:#cbd5e1; font-size:12px; margin:0 1px;}
.rangepick{display:inline-flex; background:#eef2f7; border-radius:10px; padding:3px; flex-wrap:wrap;}
.rangepick button{border:0; background:transparent; padding:7px 14px; border-radius:8px; font-size:12.5px;
  color:#64748b; cursor:pointer; font-family:inherit; font-weight:500; transition:.15s;}
.rangepick button:hover{color:var(--blue);}
.rangepick button.on{background:#fff; color:var(--blue); box-shadow:0 1px 3px rgba(16,24,40,.10);}

/* 每日明细表 */
.dtbl td.num{text-align:right; font-variant-numeric:tabular-nums;}
.dtbl td.num.neg{color:var(--rose); font-weight:600;}
.dtbl tr.wknd td:first-child{color:var(--rose);}
.dtbl tr.dtot td{background:#f4f8ff; font-weight:700; border-top:1px solid #dbe7fe;}
.dtbl tr[data-date]{cursor:pointer;}
.dtbl .dtag{display:inline-block; min-width:22px; padding:1px 7px; border-radius:20px; font-size:11px;
  font-weight:600; text-align:center; background:#f1f5f9; color:#64748b;}
.dtbl .dtag.in{background:#dcfce7; color:#15803d;}
.dtbl .dtag.out{background:#dbeafe; color:#1d4ed8;}
.dnone{color:#cbd5e1;}

/* 每日趋势（双色分组柱） */
.trend{display:flex; align-items:flex-end; gap:10px; height:190px; padding:12px 6px 0; overflow-x:auto;}
.trend .dcol{flex:1 0 46px; display:flex; flex-direction:column; align-items:center; justify-content:flex-end;
  height:100%; gap:6px;}
.trend .dcol .pp{display:flex; align-items:flex-end; justify-content:center; gap:4px; height:100%; width:100%;}
.trend .dcol .pp i{display:block; width:12px; min-height:3px; border-radius:4px 4px 2px 2px; transition:.3s;}
.trend .dcol .pp i.in{background:linear-gradient(180deg,#86efac,#16a34a);}
.trend .dcol .pp i.out{background:linear-gradient(180deg,#93c5fd,#2563eb);}
.trend .dcol .tt{font-size:10.5px; color:var(--sub); white-space:nowrap;}
.legend i.in{background:linear-gradient(180deg,#86efac,#16a34a);}
.legend i.out{background:linear-gradient(180deg,#93c5fd,#2563eb);}
.legend i.net{background:linear-gradient(180deg,#c4b5fd,#7c3aed);}

/* 看板客户卡 */
.kcards{display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-top:16px;}
@media(max-width:1050px){.kcards{grid-template-columns:1fr;}}
.kcard{border:1px solid var(--line); border-radius:14px; background:#fff; box-shadow:var(--shadow); overflow:hidden;}
.kcard .kh{display:flex; align-items:center; gap:9px; padding:12px 16px; font-weight:700; font-size:14px;
  background:linear-gradient(90deg,#f4f8ff,#fbfcff); border-bottom:1px solid var(--line);}
.kcard .kh .go{margin-left:auto; font-size:12px; color:var(--blue); font-weight:600;}
.kcard .kh .kgo{margin-left:auto; display:flex; gap:14px; font-size:12px; font-weight:600;}
.kcard .kh .kgo span{color:var(--blue); cursor:pointer;}
.kcard .kh .kgo span:hover{text-decoration:underline;}
.kcard .kb{padding:14px 16px;}
.kcard .krow{display:grid; grid-template-columns:repeat(4,1fr); gap:8px; text-align:center;}
.kcard .krow .it{background:var(--soft); border:1px solid #e9eef6; border-radius:9px; padding:9px 4px;}
.kcard .krow .it .k{font-size:10.5px; color:var(--sub);}
.kcard .krow .it .v{font-size:16px; font-weight:700; margin-top:3px; font-variant-numeric:tabular-nums; color:var(--blue-d);}
.kcard .krow .it.g .v{color:var(--green);} .kcard .krow .it.a .v{color:var(--amber);}
.kcard .krow .it.b .v{color:var(--blue);} .kcard .krow .it.r .v{color:var(--rose);}
.spark{display:flex; align-items:flex-end; gap:3px; height:46px; margin-top:11px; padding-top:2px;}
.spark i{flex:1 0 auto; border-radius:3px 3px 1px 1px; background:linear-gradient(180deg,#bfdbfe,#60a5fa); min-height:2px;}
.spark i.hi{background:linear-gradient(180deg,#86efac,#16a34a);}
.spark .sday{flex:1 1 0; display:flex; align-items:flex-end; justify-content:center; gap:2px; height:100%; min-width:0;}
.spark .sday i{flex:0 0 46%; max-width:7px; min-height:2px;}
.spark .sday i.in{background:linear-gradient(180deg,#86efac,#16a34a);}
.spark .sday i.out{background:linear-gradient(180deg,#93c5fd,#2563eb);}
.kcard .kfoot{font-size:11.5px; color:var(--sub); margin-top:9px; line-height:1.7;}

/* 看板区块小标题 */
.boardsec{display:flex; flex-wrap:wrap; align-items:center; gap:10px; font-size:12.5px; color:var(--sub); margin:18px 0 4px;}
.boardsec .bl{font-weight:600; color:#334155; font-size:12.5px; margin-bottom:7px;}


/* 产品需求排产 */
.schmx th:first-child,.schmx td:first-child{position:sticky;left:0;background:#fff;z-index:1;}
.schmx thead th{position:sticky;top:0;z-index:2;background:#f7fafe;}
.schmx thead th:first-child{z-index:3;background:#f7fafe;}
.dtbl tr.short td{background:#fef2f2;}
.dtbl tr.short td.hl{background:#fef2f2;}

/* 缺料汇总：结论表格（缺料总览 / 产品缺料需求汇总 / 明细） */
.tag.warn{background:#ffedd5; color:#c2410c;}
.lead{font-weight:700; color:#b91c1c;}
.due{display:block; font-size:11px; color:var(--sub); margin-top:1px;}
.tnote{font-size:11.5px; color:var(--sub); padding:9px 14px; line-height:1.75; background:#fbfdff; border-top:1px dashed var(--line);}

/* ===== 缺料速览（商务风：浅色底 + 描边徽章 + 数据化排版） ===== */
.glance{margin:16px 0 4px; background:#fff; border:1px solid #e3e9f2; border-radius:14px;
  box-shadow:0 1px 2px rgba(16,24,40,.04), 0 10px 28px -16px rgba(16,24,40,.18); overflow:hidden;}
.glance::before{content:""; display:block; height:3px;
  background:linear-gradient(90deg,var(--blue-d),var(--blue) 45%,#38bdf8);}
.glance.ok::before{background:linear-gradient(90deg,#047857,#10b981);}
.ghd{display:flex; align-items:center; gap:12px; flex-wrap:wrap; padding:14px 18px;
  background:linear-gradient(180deg,#fbfcff,#f4f7fc); border-bottom:1px solid #e8edf5;}
.glance.ok .ghd{background:linear-gradient(180deg,#fbfefc,#f3fbf6);}
.gico{width:23px; height:23px; border-radius:7px; background:#d92d20; color:#fff; flex:none;
  display:flex; align-items:center; justify-content:center; font-weight:800; font-size:13px;
  box-shadow:0 2px 6px rgba(217,45,32,.32);}
.glance.ok .gico{background:#0e9f6e; box-shadow:0 2px 6px rgba(14,159,110,.3);}
.ghd h3{margin:0; font-size:15.5px; font-weight:800; color:#0f172a; letter-spacing:.4px;}
.gchips{display:flex; gap:7px; flex-wrap:wrap;}
.gchip{display:inline-flex; align-items:center; gap:5px; font-size:11.5px; color:#475569;
  background:#fff; border:1px solid #e2e8f0; border-radius:7px; padding:4px 10px;
  box-shadow:0 1px 1px rgba(16,24,40,.03);}
.gchip b{color:#0f172a; font-weight:800; font-size:12.5px; font-variant-numeric:tabular-nums;}
.gchip.r{border-color:#fbd5d5; background:#fff7f6; color:#b42318;}
.gchip.r b{color:#b42318;}
.gchip.ok{border-color:#bbf7d0; background:#f2fdf6; color:#166534; font-weight:700;}
.gsub{font-size:11px; color:var(--sub); letter-spacing:.2px;}
/* 列头 */
.gcols{display:grid; grid-template-columns:96px minmax(180px,1.5fr) 168px 100px minmax(150px,1fr);
  gap:12px; padding:8px 18px 8px 21px; border-bottom:1px solid #eef2f7; background:#f8fafc;}
.gcols span{font-size:10.5px; font-weight:700; color:#94a3b8; letter-spacing:1px;}
.glist{display:flex; flex-direction:column;}
.gitem{padding:13px 18px 13px 21px; border-top:1px solid #eef2f7; position:relative;
  transition:background .15s ease;}
.gitem:first-child{border-top:0;}
.gitem:hover{background:#fafcff;}
.gitem::before{content:""; position:absolute; left:0; top:9px; bottom:9px; width:3px;
  border-radius:0 3px 3px 0; background:#cbd5e1;}
.gitem.u1::before{background:#d92d20;}
.gitem.u2::before{background:#f79009;}
.gitem.u3::before{background:#fdb022;}
.gline{display:grid; grid-template-columns:96px minmax(180px,1.5fr) 168px 100px minmax(150px,1fr);
  align-items:center; gap:12px;}
.gurg{display:flex; flex-direction:column; align-items:center; gap:1px; line-height:1.25;
  font-size:11px; font-weight:800; color:#8a1c12; background:#fff7f6;
  border:1px solid #fbd5d5; border-radius:8px; padding:5px 8px; text-align:center;}
.gurg small{font-size:10px; font-weight:700; opacity:.85; font-variant-numeric:tabular-nums;}
.gitem.u1 .gurg{background:#fef3f2; border-color:#fecdc9; color:#b42318;}
.gitem.u2 .gurg{background:#fffaeb; border-color:#fedf89; color:#b54708;}
.gitem.u3 .gurg{background:#fefbe8; border-color:#feee95; color:#a15c07;}
.gwho{min-width:0;}
.gname{display:flex; align-items:center; gap:6px; flex-wrap:wrap;}
.gname .mono{font-size:13.5px; font-weight:800; color:#0f172a; letter-spacing:.2px;
  font-variant-numeric:tabular-nums;}
.gprods{font-size:11.5px; color:#64748b; margin-top:3px;}
.gctag{font-size:10.5px; color:#1d4ed8; background:#eff6ff; border:1px solid #bfdbfe;
  border-radius:6px; padding:1px 6px; font-weight:600;}
.gwhen{font-size:12.5px; color:#475569; font-variant-numeric:tabular-nums;}
.gwhen b{color:#0f172a; font-weight:700;}
.ggap{text-align:right; white-space:nowrap;}
.ggap b{font-size:18px; font-weight:800; color:#b42318; letter-spacing:-.2px;
  font-variant-numeric:tabular-nums;}
.ggap small{font-size:11px; color:#94a3b8; margin-left:3px; font-weight:600;}
.gdue{font-size:12px; color:#475569;}
.gdue b{color:#0f172a; font-weight:700; font-variant-numeric:tabular-nums;}
.gdue b.over{color:#b42318; font-weight:800;}
.gempty{padding:26px 18px; text-align:center; color:#166534; font-size:13.5px; font-weight:600;}
@media (max-width:900px){
  .gcols{display:none;}
  .gline{grid-template-columns:1fr; gap:5px;}
  .ggap{text-align:left;}
}
.mwrap{border-top:1px solid var(--line);}
.mwrap:first-of-type{border-top:0;}
.mhd{display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:10px 14px 8px; font-size:12px; color:#334155; background:#fbfdff;}
.ptbl th.shorthd{background:#fee2e2; color:#b91c1c;}
.ptbl th.shorthd small{color:#dc2626;}

.pwrap{margin:0 14px 14px; border:1px solid var(--line); border-radius:0 0 12px 12px; overflow:auto; max-height:520px; background:#fff; box-shadow:var(--shadow);}
/* 共料合并表：表内产品清单（每行一个产品 + 设备/产能/库存/操作） */
.gprods{display:flex; flex-direction:column; gap:6px; padding:10px 14px 2px;}
.gprod{display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:12px; color:#334155;
  background:#f8fbff; border:1px solid #e3edfb; border-radius:10px; padding:7px 11px;}
.gprod b{font-size:12.5px;}
.ptbl{border-collapse:separate; border-spacing:0; width:max-content; min-width:100%;}
.ptbl th,.ptbl td{padding:6px 9px; font-size:12px; white-space:nowrap; border-right:1px solid #f1f5f9; border-bottom:1px solid #f1f5f9;}
.ptbl thead th{position:sticky; top:0; z-index:2; background:#f7fafe; text-align:center; font-weight:700; color:#334155;}
.ptbl th.corner{left:0; z-index:4; min-width:96px; border-right:2px solid var(--line);}
.ptbl th.dayhd{min-width:54px; line-height:1.2;}
.ptbl th.dayhd small{display:block; font-weight:500; color:var(--sub); font-size:10px; letter-spacing:.5px;}
.ptbl th.dayhd.wknd{color:#94a3b8; background:#f4f6fa;}
.ptbl td.num{font-variant-numeric:tabular-nums; min-width:50px; text-align:right; color:#1e293b;}
.ptbl td.rl{position:sticky; left:0; z-index:1; background:#fff; font-weight:600; font-size:11.5px; color:#334155; text-align:left; min-width:96px; border-right:2px solid var(--line);}
.ptbl tbody tr:nth-child(odd) td.rl{background:#fbfcfe;}
.ptbl tr.pedit td.num{cursor:pointer;}
.ptbl tr.pedit td.num:hover{background:#eef4ff;}
.ptbl td.wkc{background:#f8fafc;}
.ptbl td.num.fill-red{background:#fee2e2 !important; color:#b91c1c !important; font-weight:700;}
.ptbl td.num.fill-green{background:#dcfce7 !important; color:#15803d !important; font-weight:700;}
.ptbl td.num.neg{color:var(--rose); font-weight:700;}
.ptbl .cellin{width:58px; border:1px solid #93c5fd; border-radius:6px; padding:2px 4px; font:inherit; font-size:12px; text-align:right; outline:none;}

.ptbl td.fill-red{background:#fee2e2 !important; color:#b91c1c !important; font-weight:700;}
.ptbl td.fill-green{background:#dcfce7 !important; color:#15803d !important; font-weight:700;}


/* ===========================================================
   UI 美化升级 · 全站统一
   独立卡片化 / 悬浮反馈 / 精修细节（浅色主题）
   =========================================================== */

/* -- 全局背景：柔和氛围光 -- */
body{
  background:
    radial-gradient(1000px 460px at 88% -120px, rgba(37,99,235,.075), transparent 62%),
    radial-gradient(760px 420px at -100px 240px, rgba(13,148,136,.055), transparent 62%),
    radial-gradient(600px 340px at 50% 108%, rgba(124,58,237,.045), transparent 65%),
    linear-gradient(180deg,#f8fafd 0%,#f1f4f9 100%);
  background-attachment:fixed;
}
::selection{background:#bfdbfe; color:#1e3a8a;}

/* -- 滚动条精修 -- */
::-webkit-scrollbar{width:10px; height:10px;}
::-webkit-scrollbar-track{background:transparent;}
::-webkit-scrollbar-thumb{background:#cdd8e6; border-radius:8px; border:2px solid transparent; background-clip:content-box;}
::-webkit-scrollbar-thumb:hover{background-color:#aebfd4;}
*{scrollbar-width:thin; scrollbar-color:#cdd8e6 transparent;}

/* -- 统计条 → 独立统计卡片 -- */
.bar{display:flex; flex-wrap:wrap; gap:14px; background:none; border:0; border-radius:0;
  overflow:visible; box-shadow:none; padding:0; margin-bottom:18px;}
.bar>div{flex:1 1 130px; min-width:130px; padding:16px 20px 14px; text-align:left;
  background:#fff; border:1px solid var(--line); border-radius:16px; box-shadow:var(--shadow);
  position:relative; overflow:hidden; transition:.18s;}
.bar>div::before{content:""; position:absolute; left:0; top:0; bottom:0; width:3.5px;
  background:linear-gradient(180deg,#60a5fa,#2563eb); opacity:.85;}
.bar>div:last-child{border-right:1px solid var(--line);}
.bar>div:hover{transform:translateY(-2px); box-shadow:0 10px 26px rgba(16,24,40,.09);}
.bar .t{font-size:11.5px; color:var(--sub); letter-spacing:.4px; font-weight:500;}
.bar .v{font-size:23px; font-weight:700; color:var(--blue-d); letter-spacing:-.4px; margin-top:5px; font-variant-numeric:tabular-nums;}

/* -- 页头精修 -- */
header.page{margin:26px 0 20px;}
h1{font-size:24px; letter-spacing:.5px; display:flex; align-items:center; gap:11px;}
h1::before{content:""; flex:0 0 auto; width:7px; height:26px; border-radius:4px;
  background:linear-gradient(180deg,#60a5fa,#2563eb); box-shadow:0 4px 10px rgba(37,99,235,.30);}
.meta{margin-top:2px;}

/* -- 卡片统一升级 -- */
.card,.toolbar,.custblock,.kcard,.sumcard{border-radius:16px;}
.card,.custblock,.kcard{box-shadow:0 1px 2px rgba(16,24,40,.04),0 8px 22px rgba(16,24,40,.06);}
.card{transition:box-shadow .18s;}
.card:hover{box-shadow:0 2px 4px rgba(16,24,40,.05),0 12px 30px rgba(16,24,40,.085);}
.card h2{font-size:16px; letter-spacing:.3px; display:flex; align-items:center;}
.card h2::before{width:4px; border-radius:3px; box-shadow:0 3px 8px rgba(37,99,235,.35);}
.card .desc{margin-top:6px;}

/* -- 说明卡（hint）独立信息面板样式 -- */
.card>.hint{background:linear-gradient(92deg,#eff6ff 0%,#f8fbff 70%);
  border:1px solid #dbeafe; border-radius:12px; padding:13px 18px;}

/* -- KPI 卡：彩色顶饰 + 悬浮 -- */
.kpi{border-radius:16px; transition:.18s;}
.kpi::before{content:""; position:absolute; left:0; right:0; top:0; height:3.5px;
  background:linear-gradient(90deg,#60a5fa,#2563eb);}
.kpi::after{opacity:.08;}
.kpi.g::before{background:linear-gradient(90deg,#4ade80,#16a34a);}
.kpi.a::before{background:linear-gradient(90deg,#fbbf24,#d97706);}
.kpi.v::before{background:linear-gradient(90deg,#a78bfa,#7c3aed);}
.kpi.t::before{background:linear-gradient(90deg,#2dd4bf,#0d9488);}
.kpi:hover{transform:translateY(-2px); box-shadow:0 10px 26px rgba(16,24,40,.10);}

/* -- 导航精修 -- */
.sidenav .inner{padding:18px 12px 22px;}
.navlinks a{border-radius:11px; position:relative;}
.navlinks a:hover{background:#eef4ff; transform:translateX(2px);}
.navlinks a.active{box-shadow:0 8px 20px rgba(37,99,235,.30);}

/* -- 客户切换 Tab -- */
.custtabs{gap:10px;}
.custtabs button{border-radius:12px; padding:9px 19px;}
.custtabs button:hover{transform:translateY(-1px); box-shadow:0 8px 20px rgba(37,99,235,.14);}
.custtabs button.on{box-shadow:0 8px 20px rgba(37,99,235,.30);}
.custtabs button.on:hover{transform:none;}

/* -- 表格精修 -- */
.tblbox{border-radius:14px;}
thead th{background:linear-gradient(180deg,#f6f9fd,#eff3f9); border-bottom:1px solid #dfe5ee; letter-spacing:.5px;}
tbody tr{transition:background .12s;}
tbody tr:hover td{background:#f0f7ff;}
tbody tr:nth-child(even) td{background:#fbfcfe;}
tbody tr:hover td{background:#eef5ff;}
td{border-bottom:1px solid #f2f5f9;}

/* -- 客户块头部精修 -- */
.cbhead{background:linear-gradient(90deg,#f2f7ff 0%,#fbfdff 60%,#f6fbff 100%);}
.cbhead h3{font-size:15px;}
.subhd{background:#f9fbfe;}

/* -- 按钮升级 -- */
.btn{border-radius:10px;}
.btn.pri{background:linear-gradient(135deg,#3b82f6,#2563eb); box-shadow:0 5px 14px rgba(37,99,235,.30);}
.btn.pri:hover{background:linear-gradient(135deg,#2f6fe0,#1d4ed8); transform:translateY(-1px); box-shadow:0 8px 18px rgba(37,99,235,.34);}
.btn:hover{transform:translateY(-1px);}
.btn.sm{border-radius:9px;}

/* -- 标签精修 -- */
.tag,.st{border:1px solid rgba(15,23,42,.06); padding:2px 10px;}

/* -- 看板客户卡 / 汇总卡悬浮 -- */
.kcard,.sumcard{transition:.18s;}
.kcard:hover{transform:translateY(-2px); box-shadow:0 12px 28px rgba(16,24,40,.10);}
.sumcard{background:linear-gradient(180deg,#fbfdff,#f6f9fd);}

/* -- 抽屉与遮罩 -- */
.drawer{border-radius:18px 0 0 18px;}
.drawer .dh{background:linear-gradient(90deg,#f4f8ff,#fbfcff);}
.drawer-mask{background:rgba(15,23,42,.38); backdrop-filter:blur(2px);}

/* -- 页脚 -- */
footer{border-top:1px dashed #d5dce8; margin-top:34px; padding-top:16px; letter-spacing:.2px;}

/* -- 图表精修 -- */
.bars .col{box-shadow:0 4px 12px rgba(37,99,235,.22);}
.trend .pp i{box-shadow:0 2px 6px rgba(16,24,40,.10);}
.spark i{transition:.16s;}
.kcard:hover .spark i{filter:brightness(1.05);}

/* -- 进度条 -- */
.barcell .bg{box-shadow:inset 0 1px 2px rgba(16,24,40,.06);}
.hbar .t{box-shadow:inset 0 1px 2px rgba(16,24,40,.06);}


/* -- 客户块内三段独立卡片（每日入库 / 每日交付） -- */
.custblock .sec{margin:14px; border:1px solid var(--line); border-radius:14px; background:#fff;
  box-shadow:0 1px 2px rgba(16,24,40,.04),0 6px 18px rgba(16,24,40,.05); overflow:hidden;}
.custblock .sec:last-of-type{margin-bottom:16px;}
.custblock .sec .subhd{background:linear-gradient(90deg,#f2f7ff,#fbfdff); font-size:12.5px;
  color:#334155; padding:10px 16px; border-bottom:1px solid var(--line); letter-spacing:.4px;}
.custblock .sec .empty{padding:32px 16px;}
.custblock .sec .tblbox{margin:0; border:0; border-radius:0; max-height:none;}

/* -- 缺料汇总页 -- */
tr.short td{background:#fef2f2 !important;}
tr.short:hover td{background:#fee2e2 !important;}
.sec .tblbox{max-height:none;}

/* ================= 生产报工 · 产品×日期×数量 汇总表 ================= */
.wwrap { overflow: auto; max-height: 70vh; border-radius: 12px; }
.wtab { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 12.5px; }
.wtab thead th {
  position: sticky; top: 0; z-index: 3;
  background: #f8fafc; color: #475569; font-weight: 600;
  padding: 8px 8px; border-bottom: 1px solid #e2e8f0;
  text-align: right; white-space: nowrap;
}
.wtab thead th small { display: block; font-weight: 400; color: #94a3b8; font-size: 10.5px; }
.wtab thead th.wk { background: #f1f5f9; color: #94a3b8; }
.wtab thead th.wpin, .wtab thead th.wtot { z-index: 4; }
.wtab td { padding: 6px 8px; border-bottom: 1px solid #f1f5f9; text-align: right; white-space: nowrap; }
.wtab tbody tr:hover td { background: #f8fbff; }
.wtab .wpin {
  position: sticky; left: 0; z-index: 2; text-align: left;
  background: #fff; min-width: 210px; max-width: 260px;
  padding-right: 14px;
}
.wtab thead th.wpin { background: #f8fafc; }
.wtab tbody tr:hover .wpin { background: #f8fbff; }
.wpin b { display: block; font-weight: 600; color: #1e293b; overflow: hidden; text-overflow: ellipsis; }
.wpin .wtag { display: inline-block; margin-top: 2px; font-size: 10.5px; color: #64748b; background: #f1f5f9; border-radius: 4px; padding: 0 5px; line-height: 16px; }
.wtab .wzero { color: #cbd5e1; }
.wtab .wtot {
  position: sticky; right: 0; z-index: 2;
  background: #f8fafc; font-weight: 700; color: #1e293b;
  border-left: 1px solid #e2e8f0; min-width: 74px;
}
.wtab thead th.wtot { color: #1e293b; }
.wtab tfoot td {
  position: sticky; bottom: 0; z-index: 3;
  background: #f8fafc; font-weight: 700; color: #334155;
  border-top: 1px solid #e2e8f0; border-bottom: none;
}
.wtab tfoot td.wtot, .wtab tfoot td.wpin { z-index: 4; background: #eef2f7; }
.wpin .wno { display:block; font-size:10.5px; color:#94a3b8; font-family:Consolas,'Courier New',monospace; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.wpin .wtag { margin-top: 3px; }

/* 产品交付 · 产品号独立吸附列 */
.wtab .wpin { min-width: 230px; max-width: 230px; }
.wtab .wpno {
  position: sticky; left: 230px; z-index: 2; text-align: left;
  background: #fff; min-width: 150px; max-width: 150px;
  font-family: Consolas,'Courier New',monospace; font-size: 11.5px; color: #475569;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wtab thead th.wpno { background: #f8fafc; color: #475569; font-family: inherit; }
.wtab tbody tr:hover .wpno { background: #f8fbff; }
.wtab tfoot td.wpno { background: #eef2f7; }

/* 生产报工 · 不良品卡片「客户」列（吸附在 产品 列右侧） */
.wtab .wcus {
  position: sticky; left: 230px; z-index: 2; text-align: left;
  background: #fff; min-width: 116px; max-width: 116px; white-space: nowrap;
}
.wtab thead th.wcus { background: #f8fafc; color: #475569; font-family: inherit; }
.wtab tbody tr:hover .wcus { background: #f8fbff; }
.wtab tfoot td.wcus { background: #eef2f7; }

/* 排产计划 · 自动同步单元格（报工→实际完成 / 交付→成品交付） */
.ptbl td.auto-act { background: #f0fdf6; color: #15803d; font-weight: 600; }
.ptbl td.auto-del { background: #f7f5ff; color: #6d28d9; font-weight: 600; }

/* 登录门禁 · 退出登录项 */
.navlinks #logoutBtn { color: #b42318; margin-top: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.navlinks #logoutBtn:hover { background: #fef2f2; }

/* 原材料入库 · 「含在途」开关 */
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--sub);
  cursor: pointer; user-select: none; white-space: nowrap; }
.chk input { width: 15px; height: 15px; accent-color: var(--blue-d); cursor: pointer; margin: 0; }

/* 原材料入库 · 在途行高亮 + 「转为入库」按钮 */
.dtbl tr.tr-transit td { background: #fffcf3; }
.dtbl tr.tr-transit:hover td { background: #fff7e6; }
.dtbl tr.tr-transit td.hl { color: #b45309; font-weight: 600; }
.tbtn.toin { background: #ecfdf5; color: #047857; font-weight: 600; border-color: #bbf7d0; }
.tbtn.toin:hover { background: #d1fae5; color: #065f46; }

/* ============ 不良品卡片（生产报工 / 每日交付 / 交付汇总 共用） ============ */
.dfcard { border-left: 4px solid #f43f5e; }
.dfcard h2::before { background: linear-gradient(180deg,#fb7185,#e11d48) !important; box-shadow: 0 3px 8px rgba(225,29,72,.35) !important; }
.dfcard .chead .dfbadge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700;
  color: #be123c; background: #fff1f2; border: 1px solid #fecdd3; border-radius: 20px; padding: 3px 11px; letter-spacing: .4px; }
/* 卡片内数据条 */
.dfstat { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 2px; }
.dfstat .dfitem { display: inline-flex; align-items: baseline; gap: 6px; background: #fff5f6; border: 1px solid #fde2e6;
  border-radius: 10px; padding: 7px 13px; }
.dfstat .dfitem i { font-style: normal; font-size: 11.5px; color: #9f1239; opacity: .85; }
.dfstat .dfitem b { font-size: 17px; font-weight: 700; color: #be123c; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.dfstat .dfitem em { font-style: normal; font-size: 11px; color: var(--sub); }
.dfstat .dfitem.warn { background: #fff1f2; border-color: #fda4af; }
.dfstat .dfitem.warn b { color: #e11d48; }
/* 可编辑单元格 */
.wtab td.dcell, table td.dcell { cursor: text; position: relative; }
table td.dcell:hover { background: #fff1f2 !important; box-shadow: inset 0 0 0 1px #fda4af; }
table td.dcell.has { color: #e11d48; font-weight: 700; }
table td.dcell .dzero { color: #cbd5e1; }
input.dinp { width: 58px; padding: 2px 5px; font-size: 12px; text-align: center; border: 1px solid #fda4af;
  border-radius: 6px; outline: none; background: #fff; color: #be123c; font-weight: 700;
  box-shadow: 0 0 0 3px rgba(244,63,94,.16); }
/* 不良品提示行 */
.dfhint { font-size: 11.5px; color: var(--sub); margin: 10px 0 0; }
.dfhint b { color: #be123c; }
/* 不良品卡片内 · 客户分块 */
.dfcust { margin-top: 14px; border: 1px solid #f3e2e6; border-radius: 12px; background: #fff; overflow: hidden; }
.dfcusthd { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 9px 14px;
  background: linear-gradient(90deg,#fff5f6,#fffdfd); border-bottom: 1px solid #f6e7ea; }
.dfcusthd b { font-size: 13px; color: #7f1d2d; }
.dfcusthd .cbmeta { font-size: 11.5px; color: var(--sub); flex: 1; }
.dfcusthd .cbmeta b { color: #be123c; font-size: 11.5px; }
.dfcust .tblbox { margin: 0; border: 0; border-radius: 0; }
.dfcust .tblbox thead th { background: #f7fafe; }
/* 不良品录入条 */
.dfadd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 2px;
  padding: 10px 12px; background: #fff7f8; border: 1px dashed #fbc7ce; border-radius: 10px; font-size: 12.5px; color: var(--sub); }
.dfadd select, .dfadd input { font: inherit; font-size: 12.5px; padding: 5px 9px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--text); outline: none; }
.dfadd select:focus, .dfadd input:focus { border-color: #fda4af; box-shadow: 0 0 0 3px rgba(244,63,94,.12); }
.dfadd select { min-width: 220px; }
.dfadd input.dfname { min-width: 260px; }
.dfadd input[type=date] { min-width: 140px; }
.dfadd .dfqty { width: 96px; }
.dfadd .btn { padding: 6px 14px; }

/* ============ 库存剩余页 ============ */
.stockwrap table td.num.negfill { background: #fee2e2 !important; color: #b91c1c !important; font-weight: 700; }
.stockwrap tr.shortrow td.hl { color: #b91c1c; }
.stockwrap tr.shortrow td { background: #fffafb; }
.stockwrap tr.shortrow:hover td { background: #fff1f2; }
