:root {
  --ink:#17252a; --muted:#66757b; --line:#dfe7e7; --soft:#f3f7f6; --paper:#ffffff;
  --teal:#0f766e; --teal-dark:#0b5d57; --teal-soft:#dff4f0; --amber:#d97706;
  --amber-soft:#fff4d6; --red:#c2413a; --red-soft:#fde9e7; --blue:#2563eb;
  --accent-light:#48b7aa; --shadow:0 14px 40px rgba(22,45,48,.09); --radius:16px;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;font-family:"Microsoft YaHei","PingFang SC",system-ui,sans-serif;color:var(--ink);background:#eef3f2}
button,input,select,textarea{font:inherit}
button{cursor:pointer}

/* ===== 布局 ===== */
.app-shell{min-height:100vh;display:flex;flex-direction:column}
.main{min-width:0}
.content{padding:28px 34px 44px;max-width:1680px;margin:0 auto;width:100%}

/* ===== 顶栏 ===== */
.topbar{height:76px;padding:0 28px;background:rgba(255,255,255,.94);backdrop-filter:blur(12px);border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:30}
.topbar-left{display:flex;align-items:center;gap:16px}
.back-btn{height:40px;padding:0 16px;border-radius:10px;background:var(--soft);border:1.5px solid var(--line);color:var(--teal);font-size:15px;font-weight:700}
.back-btn:hover{background:var(--teal-soft)}
.topbar-title{display:flex;align-items:center;gap:13px}
.brand-mark{width:44px;height:44px;border-radius:13px;display:grid;place-items:center;font-weight:800;font-size:20px;color:#fff;box-shadow:0 8px 24px rgba(16,185,165,.24)}
.brand-mark.theme-raw{background:linear-gradient(145deg,#32b3a3,#0f766e)}
.brand-mark.theme-fin{background:linear-gradient(145deg,#ffad43,#e2680a);box-shadow:0 8px 24px rgba(226,104,10,.3)}
.topbar-title p{margin:0 0 3px;color:var(--teal);font-size:12px;font-weight:700;letter-spacing:.8px}
.topbar-title h1{margin:0;font-size:22px;letter-spacing:-.4px}
.topbar-right{display:flex;align-items:center;gap:12px;color:var(--muted);font-size:13px}
.btn-more{height:42px;padding:0 18px;border-radius:11px;background:#fff;border:1.5px solid var(--line);font-size:14px;color:#3c5356;font-weight:600}
.btn-more:hover{border-color:var(--teal);color:var(--teal)}
.btn-exit{height:42px;padding:0 18px;border-radius:11px;background:var(--soft);border:1.5px solid var(--line);font-size:14px;color:var(--red);font-weight:600}
.btn-exit:hover{background:var(--red-soft);border-color:#f0c8c4}

/* ===== 首页 4 大按钮 ===== */
.home-grid{flex:1;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;gap:28px;padding:40px;min-height:calc(100vh - 76px);align-content:center}
.big-btn{border:0;border-radius:26px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;color:#fff;position:relative;overflow:hidden;box-shadow:0 16px 36px rgba(22,45,48,.18);transition:transform .15s ease,box-shadow .15s ease;min-height:200px}
.big-btn:hover{transform:translateY(-4px);box-shadow:0 22px 48px rgba(22,45,48,.26)}
.big-btn:active{transform:translateY(1px)}
.big-icon{font-size:72px;line-height:1;filter:drop-shadow(0 4px 10px rgba(0,0,0,.18))}
.big-name{font-size:38px;font-weight:800;letter-spacing:4px}
.big-desc{font-size:15px;opacity:.85;letter-spacing:1px}
.home-grid.theme-raw .big-btn{background:linear-gradient(150deg,#0f766e,#14b8a6)}
.home-grid.theme-fin .big-btn{background:linear-gradient(150deg,#e2680a,#ff9e2f)}

/* ===== 深色汇总大屏 ===== */
.dash{background:radial-gradient(1200px 620px at 50% -10%,#12203a 0%,#0a0e1a 55%,#080b12 100%);border-radius:20px;padding:30px 34px;position:relative;overflow:hidden;box-shadow:0 20px 60px rgba(0,0,0,.35)}
.dash::before{content:"";position:absolute;inset:0;background-image:linear-gradient(rgba(56,130,200,.06) 1px,transparent 1px),linear-gradient(90deg,rgba(56,130,200,.06) 1px,transparent 1px);background-size:34px 34px;pointer-events:none}
.dash-title{text-align:center;font-size:26px;font-weight:800;color:#7df3ff;letter-spacing:5px;text-shadow:0 0 18px rgba(34,211,238,.5);margin-bottom:4px;position:relative}
.dash-sub{text-align:center;font-size:12px;color:#4a5878;letter-spacing:2px;margin-bottom:26px;position:relative}
.kpi-row{display:grid;grid-template-columns:repeat(4,1fr);gap:18px;margin-bottom:18px;position:relative}
.dash .kpi{background:rgba(255,255,255,.03);border:1px solid rgba(56,130,200,.22);border-radius:14px;padding:20px 18px;text-align:center;backdrop-filter:blur(4px)}
.dash .kpi .v{font-size:38px;font-weight:800;color:#eaf6ff;text-shadow:0 0 14px rgba(125,211,252,.4);line-height:1.1}
.dash .kpi .v.warn{color:#f87171;text-shadow:0 0 14px rgba(248,113,113,.5)}
.dash .kpi .l{font-size:13px;color:#6b7a9a;margin-top:6px;letter-spacing:1px}
.dash .kpi.accent{border-color:rgba(34,211,238,.4)}
.dash .kpi.accent .v{color:#7df3ff}
.dash-bottom{position:relative}
.dash-panel{background:rgba(255,255,255,.03);border:1px solid rgba(56,130,200,.22);border-radius:14px;padding:18px}
.dash-panel-title{font-size:14px;color:#8fb3d9;font-weight:600;margin-bottom:16px;letter-spacing:1px}
.trend{display:flex;align-items:flex-end;gap:18px;justify-content:center;padding-top:8px}
.trend-group{display:flex;flex-direction:column;align-items:center;gap:6px}
.trend-bars{display:flex;align-items:flex-end;gap:8px;height:130px}
.tb{width:34px;border-radius:5px 5px 0 0;display:block}
.tb.in{background:linear-gradient(180deg,#22d3ee,#0e7490)}
.tb.out{background:linear-gradient(180deg,#f97316,#9a3412)}
.trend-group small{font-size:11px;color:#6b7a9a}
.trend-legend{display:flex;gap:22px;justify-content:center;margin-top:14px;font-size:12px;color:#8fb3d9}
.trend-legend .ld{width:10px;height:10px;border-radius:3px;display:inline-block;margin-right:6px}
.trend-legend .ld.in{background:#22d3ee}
.trend-legend .ld.out{background:#f97316}
.search-dark input{background:rgba(255,255,255,.06);border-color:rgba(56,130,200,.3);color:#eaf6ff}

/* ===== 更多抽屉 ===== */
.drawer-backdrop{position:fixed;inset:0;background:rgba(8,27,30,.5);z-index:150;display:flex;justify-content:flex-end;animation:fade .15s ease}
.drawer{background:#fff;width:min(400px,100%);height:100%;display:flex;flex-direction:column;box-shadow:-20px 0 60px rgba(0,0,0,.3);animation:slide-left .2s ease}
.drawer-head{padding:20px 22px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center}
.drawer-head h2{margin:0;font-size:18px}
.drawer-close{border:0;background:var(--soft);width:34px;height:34px;border-radius:50%;font-size:20px}
.drawer-body{padding:12px;display:grid;gap:4px;overflow:auto}
.drawer-item{border:0;background:transparent;display:flex;align-items:center;gap:14px;padding:14px 14px;border-radius:12px;text-align:left;transition:background .13s ease}
.drawer-item:hover{background:var(--soft)}
.drawer-icon{font-size:22px;width:30px;text-align:center}
.drawer-text{flex:1;display:flex;flex-direction:column;gap:2px}
.drawer-text strong{font-size:14px;color:var(--ink)}
.drawer-text small{font-size:12px;color:var(--muted)}
.drawer-arrow{font-size:18px;color:#b6c1c3}

/* ===== 按钮 ===== */
.primary-button,.secondary-button,.ghost-button,.danger-button{border-radius:10px;padding:11px 18px;font-weight:700;border:1px solid transparent;transition:.16s ease}
.primary-button{background:var(--teal);color:#fff;box-shadow:0 6px 18px rgba(15,118,110,.2)}
.primary-button:hover{background:var(--teal-dark);transform:translateY(-1px)}
.big-create{padding:16px 34px;font-size:19px;border-radius:14px;font-weight:800;box-shadow:0 10px 28px rgba(15,118,110,.28)}
.secondary-button{background:var(--teal-soft);color:var(--teal);border-color:#c6e9e3}
.ghost-button{background:transparent;color:inherit;border-color:var(--line)}
.danger-button{background:var(--red-soft);color:var(--red)}
.full{width:100%}

/* ===== hero / kpi ===== */
.hero{background:linear-gradient(120deg,#0f766e,#145b63 72%,#173e48);border-radius:22px;color:#fff;padding:26px 30px;display:flex;align-items:center;justify-content:space-between;margin-bottom:22px;box-shadow:var(--shadow);overflow:hidden;position:relative}
.hero:after{content:"";position:absolute;width:260px;height:260px;border:50px solid rgba(255,255,255,.06);border-radius:50%;right:-70px;top:-115px;pointer-events:none}
.hero h2{margin:0 0 8px;font-size:25px}
.hero p{margin:0;color:#c8e0dd}
.hero>button{z-index:1;position:relative}
.hero .secondary-button{background:#fff;border-color:#fff}
.kpi-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px;margin-bottom:22px}
.kpi-card{background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);padding:18px;box-shadow:0 5px 20px rgba(22,45,48,.04)}
.kpi-card span{font-size:12px;color:var(--muted)}
.kpi-card strong{display:block;font-size:24px;margin-top:8px}

/* ===== 面板 / 表格 ===== */
.two-col{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(320px,.75fr);gap:18px}
.panel{background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);box-shadow:0 5px 20px rgba(22,45,48,.04);overflow:hidden}
.panel-head{padding:17px 20px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:14px}
.panel-head h3{margin:0;font-size:16px}
.panel-body{padding:18px 20px}
.panel.flush .panel-body{padding:0}
.toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:16px}
.toolbar-left,.toolbar-right{display:flex;gap:10px;align-items:center}
.search{position:relative;min-width:300px}
.search input{width:100%;padding-left:38px}
.search:before{content:"⌕";position:absolute;left:13px;top:9px;color:var(--muted);font-size:20px}
input,select,textarea{border:1px solid #cad6d5;border-radius:9px;padding:10px 11px;background:#fff;color:var(--ink);outline:none;min-height:40px}
input:focus,select:focus,textarea:focus{border-color:#55aaa2;box-shadow:0 0 0 3px rgba(15,118,110,.11)}
textarea{min-height:84px;resize:vertical}
.table-wrap{overflow:auto}
.data-table{width:100%;border-collapse:collapse;white-space:nowrap;font-size:13px}
.data-table th{background:#f5f8f7;color:#59686c;text-align:left;font-size:12px;padding:12px 14px;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:1}
.data-table td{padding:13px 14px;border-bottom:1px solid #edf1f0;vertical-align:middle}
.data-table tr:hover td{background:#fbfdfc}
.data-table .num{text-align:right;font-variant-numeric:tabular-nums}
.code{font-weight:700;color:#193d3c}
.subtle{color:var(--muted);font-size:12px}
.empty{padding:42px 24px;text-align:center;color:var(--muted)}
.badge{display:inline-flex;align-items:center;padding:4px 8px;border-radius:999px;font-size:11px;font-weight:700;background:#edf3f2;color:#536563}
.badge.good{background:var(--teal-soft);color:var(--teal)}
.badge.warn{background:var(--amber-soft);color:#9a5b06}
.badge.danger{background:var(--red-soft);color:var(--red)}
.badge.blue{background:#e8efff;color:#2455b9}
.location-list{display:flex;gap:6px;flex-wrap:wrap;max-width:420px}
.location-chip{background:#edf5f3;border:1px solid #d7e8e5;border-radius:8px;padding:5px 8px;color:#315e59;font-size:12px}
.row-actions{display:flex;gap:6px}
.icon-button{border:1px solid var(--line);background:#fff;color:#3c5356;border-radius:8px;padding:6px 9px}
.icon-button:hover{border-color:#8dbbb6;color:var(--teal)}
.order-list{display:grid;gap:10px}
.order-card{border:1px solid var(--line);border-radius:12px;padding:14px;display:grid;grid-template-columns:1fr auto;gap:8px}
.order-card h4{margin:0;font-size:14px}
.order-card p{margin:5px 0 0;color:var(--muted);font-size:12px}
.order-metric{text-align:right}
.order-metric strong{display:block;font-size:19px;color:var(--red)}

/* ===== 图表（今日概览） ===== */
.overview-chart-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-bottom:22px}
.chart-panel{min-width:0}
.chart-panel .panel-head{padding:14px 18px}
.chart-body{padding:18px;min-height:205px}
.donut-layout{display:flex;align-items:center;justify-content:center;gap:36px}
.donut-chart{--low-angle:0deg;width:158px;height:158px;flex:0 0 158px;border-radius:50%;background:conic-gradient(var(--red) 0 var(--low-angle),var(--teal) var(--low-angle) 360deg);display:grid;place-items:center;box-shadow:inset 0 0 0 1px rgba(0,0,0,.05),0 10px 28px rgba(23,37,42,.12)}
.donut-chart:before{content:"";grid-area:1/1;width:96px;height:96px;background:var(--paper);border-radius:50%;box-shadow:0 0 0 1px var(--line)}
.donut-chart>div{grid-area:1/1;z-index:1;text-align:center}
.donut-chart strong,.donut-chart span{display:block}
.donut-chart strong{font-size:28px}
.donut-chart span{font-size:11px;color:var(--muted);margin-top:2px}
.chart-legend{display:grid;gap:14px;min-width:190px}
.chart-legend p{display:grid;grid-template-columns:auto 1fr auto;gap:8px;align-items:center;margin:0;padding-bottom:10px;border-bottom:1px solid var(--line);font-size:13px}
.legend-dot{width:10px;height:10px;border-radius:50%;display:inline-block;background:var(--teal)}
.legend-dot.normal{background:var(--teal)}
.legend-dot.low{background:var(--red)}
.legend-dot.outgoing{background:#4d6b82}
.horizontal-bars{display:grid;align-content:center;gap:25px}
.horizontal-bar-row{display:grid;gap:8px}
.bar-label{display:flex;justify-content:space-between;align-items:center;font-size:13px}
.bar-label strong{font-size:17px}
.bar-track{height:18px;background:#edf2f1;border-radius:999px;overflow:hidden;box-shadow:inset 0 1px 3px rgba(0,0,0,.08)}
.bar-track i{height:100%;display:block;border-radius:999px;box-shadow:inset 0 -3px 0 rgba(0,0,0,.12)}
.bar-track i.in{background:linear-gradient(90deg,var(--teal),var(--accent-light))}
.bar-track i.out{background:linear-gradient(90deg,#4d6b82,#7893a7)}
.mini-legend{display:flex;gap:12px;font-size:12px;color:var(--muted)}
.line-chart-wrap{padding:8px}
.line-chart{width:100%;height:auto}
.line-chart .grid-line{stroke:#e5eceb;stroke-width:1}
.line-chart .axis-line{stroke:#c8d4d2;stroke-width:1}
.trend-line{fill:none;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}
.trend-line.incoming{stroke:var(--teal)}
.trend-line.outgoing{stroke:#4d6b82}
.trend-dot{stroke:#fff;stroke-width:2}
.trend-dot.incoming{fill:var(--teal)}
.trend-dot.outgoing{fill:#4d6b82}
.column-chart{display:flex;align-items:flex-end;gap:18px;justify-content:center;height:150px}
.column-group{display:flex;flex-direction:column;align-items:center;gap:6px}
.columns{display:flex;align-items:flex-end;gap:6px;height:120px}
.column{width:26px;border-radius:5px 5px 0 0;display:block}
.column.incoming{background:var(--teal)}
.column.outgoing{background:#4d6b82}
.column-group small{font-size:11px;color:var(--muted)}

/* ===== 弹窗 / 表单 ===== */
.modal-backdrop{position:fixed;inset:0;background:rgba(8,27,30,.52);z-index:100;display:grid;place-items:center;padding:24px;animation:fade .15s ease}
.modal{background:#fff;width:min(780px,100%);max-height:92vh;overflow:auto;border-radius:18px;box-shadow:0 30px 90px rgba(0,0,0,.28)}
.modal-head{padding:20px 24px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center}
.modal-head h2{margin:0;font-size:19px}
.modal-close{border:0;background:#eff4f3;width:34px;height:34px;border-radius:50%;font-size:20px}
.modal-body{padding:22px 24px}
.modal-foot{padding:16px 24px;border-top:1px solid var(--line);display:flex;justify-content:flex-end;gap:10px;background:#fafcfc}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.form-field{display:grid;gap:7px}
.form-field label{font-size:12px;font-weight:700;color:#526266}
.form-field.full{grid-column:1/-1}
.required:after{content:" *";color:var(--red)}
.form-hint{font-size:11px;color:#879497}
.section-title{grid-column:1/-1;margin-top:6px;padding-top:12px;border-top:1px dashed var(--line);font-size:13px;font-weight:800;color:var(--teal)}
.order-lines-section{gap:10px}
.order-lines-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.add-line-button{padding:7px 13px;min-height:34px}
.order-lines-section #order-lines{display:grid;gap:10px}
.order-line{display:grid;grid-template-columns:32px minmax(210px,1.5fr) minmax(105px,.55fr) minmax(150px,.8fr) auto;gap:10px;align-items:end;padding:13px;background:#f7faf9;border:1px solid var(--line);border-radius:12px}
.order-line-number{width:28px;height:28px;align-self:center;display:grid;place-items:center;border-radius:50%;background:var(--teal);color:#fff;font-size:12px;font-weight:800}
.remove-line-button{margin-bottom:2px;min-height:40px;color:var(--red)}

/* ===== toast / loading ===== */
.toast-root{position:fixed;right:24px;bottom:24px;z-index:200;display:grid;gap:10px}
.toast{background:#123c3a;color:#fff;padding:13px 16px;border-radius:11px;box-shadow:var(--shadow);min-width:260px;animation:slide .2s ease}
.toast.error{background:#8f302c}
.report-filter{display:flex;gap:12px;align-items:end}
.report-filter .form-field{min-width:170px}
.backup-path{background:#eef5f3;border:1px dashed #9bbfba;border-radius:12px;padding:14px 16px;word-break:break-all;color:#3f605d;font-size:13px}
.import-stat-row{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-bottom:16px}
.import-stat{border-radius:12px;padding:18px;text-align:center;font-size:15px;border:1px solid var(--line)}
.import-stat strong{display:block;font-size:32px;margin-top:6px}
.import-stat.success{background:#eafaf1;border-color:#b7e6c9;color:#157347}
.import-stat.fail{background:#fdeaea;border-color:#f0c4c4;color:#c0392b}
.import-errors{max-height:260px;overflow:auto;border:1px solid #f0d4d4;border-radius:10px;padding:12px 14px;background:#fff8f8}
.import-errors h4{margin:0 0 8px;font-size:13px;color:#c0392b}
.import-error-row{padding:5px 0;font-size:13px;color:#8a3b35;border-bottom:1px dashed #f0dcdc}
.import-error-row:last-child{border-bottom:0}
.import-progress-text{font-size:15px;text-align:center;margin:6px 0 14px;color:#334}
.progress-track{height:16px;border-radius:999px;background:#e8edf2;overflow:hidden}
.progress-fill{height:100%;background:linear-gradient(90deg,#0f766e,#14b8a6);border-radius:999px;transition:width .3s ease}
.import-progress-hint{margin-top:14px;font-size:13px;color:#8a94a3;text-align:center}
.loading-card{background:#fff;border-radius:16px;padding:50px;text-align:center;color:var(--muted)}

/* ===== 成品橙色主题 ===== */
body[data-mode="finished"]{--teal:#e97817;--teal-dark:#bd4f08;--teal-soft:#ffead7;--accent-light:#ffb25e;--line:#ecd9ca;--soft:#fff7f1;background:#f9f1eb}
body[data-mode="finished"] .topbar-title p{color:#e97817}
body[data-mode="finished"] .back-btn{color:#9a4108}
body[data-mode="finished"] .back-btn:hover{background:#ffead7}
body[data-mode="finished"] .btn-more:hover{border-color:#e97817;color:#e97817}
body[data-mode="finished"] .primary-button{color:#fff;box-shadow:0 6px 18px rgba(233,120,23,.26)}
body[data-mode="finished"] .big-create{box-shadow:0 10px 28px rgba(233,120,23,.3)}
body[data-mode="finished"] .secondary-button{color:#9a4108;border-color:#f2bf96}
body[data-mode="finished"] .hero{background:linear-gradient(120deg,#ff9e2f,#e56a10 72%,#a94005);color:#fff}
body[data-mode="finished"] .hero p{color:#fff0e5}
body[data-mode="finished"] .hero:after{border-color:rgba(255,255,255,.16)}
body[data-mode="finished"] input:focus,body[data-mode="finished"] select:focus,body[data-mode="finished"] textarea:focus{border-color:#e97817;box-shadow:0 0 0 3px rgba(233,120,23,.15)}
body[data-mode="finished"] .badge.good{color:#9a4108}
body[data-mode="finished"] .location-chip{background:#fff0e3;border-color:#f0c3a2;color:#873b0c}
body[data-mode="finished"] .data-table th{background:#fff3e9}
body[data-mode="finished"] .icon-button:hover{border-color:#f0a96b;color:#e97817}
body[data-mode="finished"] .order-line-number{background:#e97817}

@keyframes fade{from{opacity:0}to{opacity:1}}
@keyframes slide{from{transform:translateY(10px);opacity:0}to{transform:none;opacity:1}}
@keyframes slide-left{from{transform:translateX(40px);opacity:0}to{transform:none;opacity:1}}

@media(max-width:1150px){
  .kpi-grid{grid-template-columns:repeat(3,1fr)}
  .two-col{grid-template-columns:1fr}
  .content{padding-left:22px;padding-right:22px}
  .kpi-row{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:900px){
  .overview-chart-grid{grid-template-columns:1fr}
  .home-grid{grid-template-columns:1fr;padding:20px}
  .big-btn{min-height:140px}
  .big-icon{font-size:52px}
  .big-name{font-size:28px}
}
@media(max-width:760px){
  .topbar{height:auto;padding:14px 16px;flex-wrap:wrap;gap:10px}
  .topbar-right #today{display:none}
  .content{padding:16px}
  .kpi-grid{grid-template-columns:1fr 1fr}
  .form-grid{grid-template-columns:1fr}
  .form-field.full,.section-title{grid-column:1}
  .toolbar{align-items:stretch;flex-direction:column}
  .search{min-width:0}
  .hero{align-items:flex-start;gap:20px;flex-direction:column}
  .donut-layout{gap:20px;flex-direction:column}
  .order-line{grid-template-columns:32px 1fr}
  .order-line .form-field,.remove-line-button{grid-column:2}
  .order-line-number{grid-row:1/5;align-self:start}
}

/* ---------- 期间明细颜色区分 ---------- */
.data-table tbody tr.mvt-in td{background:#e6f4ea}
.data-table tbody tr.mvt-out td{background:#fdecec}
.data-table tbody tr.mvt-transfer td{background:#e8f1fb}
.badge.badge-in{background:#1e8e3e;color:#fff}
.badge.badge-out{background:#d93025;color:#fff}
.badge.badge-transfer{background:#1a73e8;color:#fff}

/* ---------- 批量新建弹窗 ---------- */
.modal-wide{width:min(980px,100%)}
.batch-hint{font-size:13px;color:#536563;margin:0 0 12px;line-height:1.6}
.batch-hint .code{background:#edf3f2;padding:2px 6px;border-radius:6px}
.batch-grid-wrap{max-height:420px;overflow:auto;border:1px solid var(--line);border-radius:10px;background:#fff}
.batch-grid{border-collapse:separate;border-spacing:0;width:max-content;min-width:100%}
.batch-grid th{position:sticky;top:0;background:#eef4f3;color:#2f3f3e;font-size:12px;font-weight:600;padding:8px 10px;border-bottom:1px solid var(--line);white-space:nowrap;z-index:1}
.batch-grid th:not(:last-child){border-right:1px solid var(--line)}
.batch-grid td{padding:0;border-bottom:1px solid var(--line)}
.batch-grid td:not(:last-child){border-right:1px solid var(--line)}
.batch-grid .batch-cell{width:130px;min-width:90px;border:none;outline:none;padding:7px 10px;font-size:13px;background:#fff;box-sizing:border-box;color:#2f3f3e;height:34px}
.batch-grid .batch-cell:focus{background:#f0f9f7;outline:2px solid var(--teal);outline-offset:-2px}

/* ---------- 出入库明细透视表 ---------- */
.pivot-filter{display:flex;gap:16px;align-items:flex-end;flex-wrap:wrap}
.pivot-filter .form-field{min-width:220px}
.pivot-wrap{overflow:auto;border:1px solid var(--line);border-radius:10px;background:#fff;max-height:72vh}
.pivot-table{border-collapse:separate;border-spacing:0;width:max-content;font-size:12px}
.pivot-table th{background:#eef4f3;color:#2f3f3e;font-weight:600;padding:8px 4px;border-bottom:1px solid var(--line);white-space:nowrap;text-align:center;position:sticky;top:0;z-index:3}
.pivot-table th.pivot-date{min-width:58px;font-size:11px}
.pivot-table td{border-bottom:1px solid #eef2f1;border-right:1px solid #eef2f1;padding:0;height:34px;text-align:center}
.pivot-table th.sticky-col,.pivot-table td.sticky-col{position:sticky;z-index:2;background:#fff;text-align:left;padding:0 12px}
.pivot-table th.sticky-col{background:#eef4f3;z-index:4}
.pivot-table th.sticky-col:first-child,.pivot-table td.sticky-col:first-child{left:0;min-width:140px;max-width:140px}
.pivot-table th.sticky-col:nth-child(2),.pivot-table td.sticky-col:nth-child(2){left:140px;min-width:180px;max-width:180px;border-right:2px solid #d5dedc}
.pivot-table td.sticky-col{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pivot-cell .pv-in,.pivot-cell .pv-out{height:34px;display:flex;align-items:center;justify-content:center;font-weight:600;font-size:11px}
.pivot-cell .pv-in{background:#d5f0d9;color:#1a7f37}
.pivot-cell .pv-out{background:#ffe0c2;color:#b35c00}
.pivot-cell.split .pv-in,.pivot-cell.split .pv-out{height:17px}
.pivot-legend{display:flex;gap:18px;align-items:center;margin-top:12px;font-size:13px;color:#536563}
.pivot-legend .legend-dot{display:inline-block;width:10px;height:10px;border-radius:2px;margin-right:6px}
.pivot-legend .legend-dot.normal{background:#d5f0d9}
.pivot-legend .legend-dot.outgoing{background:#ffe0c2}


/* ===== 登录页 ===== */
.login-view {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #0f766e 0%, #115e59 55%, #134e4a 100%);
}
.login-box {
  width: 360px; padding: 40px 36px 34px; border-radius: 16px;
  background: #fff; box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  text-align: center;
}
.login-mark {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 14px;
  background: #0f766e; color: #fff; font-size: 28px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.login-title { font-size: 20px; color: #17202a; margin: 0 0 4px; }
.login-sub { font-size: 13px; color: #8892a0; margin: 0 0 22px; }
.login-input {
  width: 100%; box-sizing: border-box; padding: 12px 14px; margin-bottom: 12px;
  border: 1px solid #d5dbe1; border-radius: 10px; font-size: 15px; color: #17202a;
  outline: none; transition: border-color .15s;
}
.login-input:focus { border-color: #0f766e; box-shadow: 0 0 0 3px rgba(15,118,110,0.12); }
.login-error { color: #c0392b; font-size: 13px; margin: -4px 0 10px; text-align: left; }
.login-btn {
  width: 100%; padding: 12px; border: none; border-radius: 10px;
  background: #0f766e; color: #fff; font-size: 16px; font-weight: 600; cursor: pointer;
}
.login-btn:hover { background: #0d6a63; }
.user-name { font-size: 13px; color: #5b6572; margin-right: 2px; }

.link-btn { background:none; border:none; color:#0f766e; cursor:pointer; font-size:13px; padding:2px 8px; }
.link-btn.danger { color:#c0392b; }
.link-btn:hover { text-decoration:underline; }

/* 修复：hidden 属性被 display:flex 覆盖，必须强制隐藏 */
.login-view[hidden], .app-shell[hidden] { display: none !important; }
