/* ============================================================
   仓库工业风主题  ·  warehouse.css
   —— 叠加在 app.css 之上，只改视觉，不动任何结构/交互
   钢蓝 + 安全橙 + 冷灰金属地面网格 + 黄黑警示条 + 硬朗直角
   打印页不引入本文件（见 views/head.php），A4/B5 单据样式不受影响
   ============================================================ */

:root {
  --bg: #eceff2;
  --surface: #ffffff;
  --surface-2: #f6f9fb;
  --sunken: #e9eff4;
  --line: #d7e0e7;
  --line-strong: #bccbd7;
  --ink: #16283a;
  --ink-2: #3d5468;
  --ink-3: #66798a;
  --ink-4: #8d9cab;
  --brand: #1d5b86;
  --brand-2: #2773a4;
  --brand-soft: #e6f0f7;
  --brand-deep: #13466a;
  --accent: #dd6f18;          /* 安全橙 */
  --hazard: #f0b60a;          /* 警示黄 */
  --steel: #17384f;           /* 表头钢蓝 */
  --radius: 5px;
  --radius-lg: 6px;
  --shadow: 0 1px 2px rgba(16, 40, 62, .06), 0 4px 14px -10px rgba(16, 40, 62, .35);
}

/* 地面网格：淡淡的库位划线 */
body {
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(29, 91, 134, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 91, 134, .035) 1px, transparent 1px);
  background-size: 26px 26px;
}

a { color: var(--brand); }
a:hover { color: var(--accent); }

/* ---------------- 侧栏：金属拉丝 + 货架横纹 ---------------- */
.sidebar {
  background:
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(255, 255, 255, .022) 39px 40px),
    linear-gradient(170deg, #123249 0%, #0b2030 100%);
  box-shadow: inset -3px 0 0 rgba(221, 111, 24, .75);
  border-right: 1px solid #081a27;
}
.brand {
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  padding: 16px 14px 14px;
}
.brand-mark {
  border-radius: 4px;
  background: linear-gradient(150deg, #2d719c, #123a55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), 0 3px 0 #0a2030;
  position: relative;
}
.brand-mark::after {
  content: ''; position: absolute; right: -3px; bottom: -3px;
  width: 9px; height: 9px; background: var(--accent);
  border: 2px solid #102c40; border-radius: 1px;
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-text span { color: #8ba5b8; letter-spacing: .02em; }

/* 库区编号牌：A / B / C / D */
.nav-group > span { display: flex; align-items: center; gap: 7px; color: #7593a8; letter-spacing: .14em; }
.zone-code {
  display: inline-grid; place-items: center;
  width: 17px; height: 17px; flex: 0 0 17px;
  background: rgba(221, 111, 24, .16); color: #f0a35c;
  border: 1px solid rgba(221, 111, 24, .4); border-radius: 2px;
  font: 700 10px/1 ui-monospace, Menlo, Consolas, monospace; font-style: normal;
  letter-spacing: 0;
}
.nav a { border-radius: 3px; color: #c0d0dd; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.active {
  background: linear-gradient(90deg, rgba(221, 111, 24, .24), rgba(221, 111, 24, .03));
  box-shadow: inset 3px 0 0 var(--accent);
  color: #fff; font-weight: 600;
}
.sidebar-foot { border-top: 1px solid rgba(255, 255, 255, .09); }
.avatar { border-radius: 4px; background: linear-gradient(150deg, #2d719c, #123a55); }

/* ---------------- 顶栏：警示带 + 作业状态牌 ---------------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid #c9d6df;
  box-shadow: 0 2px 8px rgba(16, 40, 62, .07);
}
.topbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: repeating-linear-gradient(115deg, var(--hazard) 0 11px, #26333d 11px 22px);
  opacity: .55; pointer-events: none;
}
.topbar h1 { font-size: 21px; letter-spacing: .1px; color: #16283a; }
/* 页面标题区：金属图标块 + 系统代号牌 */
.page-ico {
  border-radius: 4px; border-color: #103b57; color: #fff;
  background: linear-gradient(150deg, #2d719c, #123a55);
  box-shadow: 0 2px 0 #0e2f45;
}
.page-ico svg { width: 15px; height: 15px; }
.page-code {
  border-radius: 2px; background: #f2f6f9; border-color: #cfdae3; color: #4d6275;
}
.topbar .sub { color: #66798a; }
.empty b { color: #3d5468; }
.wh-status {
  display: inline-flex; align-items: center; gap: 7px;
  height: 27px; padding: 0 10px; border-radius: 3px;
  background: #f2f6f9; border: 1px solid #cfdae3;
  font: 11.5px/1 ui-monospace, Menlo, Consolas, "Microsoft YaHei", monospace;
  color: #4d6275; white-space: nowrap;
}
.wh-status i {
  width: 7px; height: 7px; border-radius: 50%; background: #17a06e;
  box-shadow: 0 0 0 3px rgba(23, 160, 110, .16); flex: 0 0 7px;
}
.wh-status b { color: #17384f; font-weight: 700; }

/* ---------------- 卡片：硬朗边框 + 钢灰抬头 ---------------- */
.card {
  border: 1px solid #cfdae3; border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.card-head {
  background: linear-gradient(180deg, #f8fbfd, #eef4f8);
  border-bottom: 1px solid #d5e0e8; padding: 9px 13px;
}
.card-head h2, .card-head h3 { font-size: 13px; letter-spacing: .02em; }
.card-head h2::before, .card-head h3::before {
  content: ''; display: inline-block; width: 4px; height: 12px;
  background: var(--accent); border-radius: 1px;
  margin-right: 8px; vertical-align: -1px;
}
.card-head .badge { margin-left: 2px; }

/* ---------------- KPI：工业仪表牌 ---------------- */
.kpi {
  border: 1px solid #cfdae3; border-radius: var(--radius-lg);
  background: #fff; padding: 12px 14px 10px;
  box-shadow: inset 0 3px 0 #2a5f86, var(--shadow);
}
.kpi::after { width: 4px; }
.kpi.warn::after { background: var(--hazard); }
.kpi.danger::after { background: #c8392b; }
.kpi .label { color: #5d7183; font-weight: 600; letter-spacing: .03em; }
.kpi .value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 27px; letter-spacing: -1.2px;
}
.kpi .hint { color: #8998a6; }

/* ---------------- 按钮 / 表单 ---------------- */
.btn { border-radius: 4px; border-color: #bfcdd8; font-weight: 600; }
.btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.btn-primary {
  background: linear-gradient(180deg, #2a6d99, #16496c);
  border: 1px solid #103b57; box-shadow: 0 2px 0 #0e2f45;
}
.btn-primary:hover { background: linear-gradient(180deg, #3179a8, #1b5278); color: #fff; }
.btn-ok { border-radius: 4px; }
.btn-danger { border-radius: 4px; }
.input, select.input, textarea.input { border-radius: 4px; border-color: #bfcdd8; }
.input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(39, 115, 164, .14); }

/* ---------------- 表格：单据感（深钢蓝表头） ---------------- */
.table th {
  background: var(--steel); color: #dbe9f3;
  border-bottom: 2px solid #0c2537;
  font-size: 10.5px; letter-spacing: .09em; text-transform: none;
  font-weight: 600;
}
.table td { border-bottom: 1px solid #e6edf2; }
.table tbody tr:hover { background: #f1f7fb; }
.table tbody tr.sel { background: #e3f0f9; }
.table .id { color: #1d4563; }

/* ---------------- 徽标 / 提示 ---------------- */
.badge { border-radius: 3px; border: 1px solid transparent; font-size: 11px; }
.badge.ok { background: #e4f4ec; color: #0b6b4b; border-color: #c1e5d5; }
.badge.warn { background: #fff3d8; color: #9a6205; border-color: #f3dda8; }
.badge.danger { background: #fde9e6; color: #b13224; border-color: #f4c8c1; }
.badge.brand { background: #e5f0f8; color: #154c72; border-color: #c7dff0; }
.badge.gray { background: #eef2f5; color: #5f7283; border-color: #dde5eb; }
.flash.ok {
  background: #eaf3f9; border-color: #c9dfee; color: #154c72;
  border-left: 4px solid var(--brand);
}
.flash.err { background: #fdeceb; border-color: #e9b3ad; }
.modal.m-danger .modal-head { background: #b73426; }
.modal.m-danger .modal-body { background: repeating-linear-gradient(135deg, #fff8f7 0 12px, #fff2f0 12px 24px); }
.tabs a.active { color: var(--brand); border-bottom-color: var(--accent); }
.tabs { border-bottom-color: #d2dde5; }
.empty { color: #8b9aa7; }
.legend { color: #66798a; }

/* ---------------- 扫码区：黄黑警示带（仓库地标线） ---------------- */
.scan-box {
  position: relative; overflow: hidden;
  border: 2px solid #d9a63a; border-radius: 4px;
  background:
    repeating-linear-gradient(135deg, rgba(240, 182, 10, .06) 0 9px, transparent 9px 18px),
    #fcfdfe;
  padding-top: 18px;
}
.scan-box::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 5px;
  background: repeating-linear-gradient(115deg, var(--hazard) 0 10px, #26333d 10px 20px);
}
.scan-box:focus-within { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(39, 115, 164, .13); }
.scan-input { border: 2px solid #b9c9d6; border-radius: 3px; color: #17384f; }
.scan-input:focus { border-color: var(--brand-2); }
.scan-result { border-radius: 4px; }
.scan-result.err {
  background: linear-gradient(135deg, #fdeceb 0 10px, #fff5f4 10px 20px);
  border-left: 5px solid #c0392b;
}

/* ---------------- 仓库库位图（真实库位数据） ---------------- */
.wh-map {
  position: relative;
  padding: 12px 14px 14px;
  background:
    repeating-linear-gradient(0deg, transparent 0 29px, rgba(29, 91, 134, .04) 29px 30px),
    #fbfcfd;
}
.wh-zone { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 9px; }
.wh-zone:last-of-type { margin-bottom: 0; }
.wh-zone-name {
  flex: 0 0 62px; text-align: center;
  padding: 8px 4px; border-radius: 3px;
  background: #e8eff5; border: 1px solid #c6d7e4;
  color: #1c4a6b; font: 700 12px/1.35 ui-monospace, Menlo, Consolas, monospace;
}
.wh-zone-name small { display: block; font: 9px/1.4 ui-monospace, Menlo, Consolas, monospace; color: #7b8f9f; margin-top: 2px; }
.wh-slots { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.wh-slot {
  min-width: 96px; height: 40px; padding: 5px 8px;
  display: flex; flex-direction: column; justify-content: center;
  border: 1px solid #bccbd7; border-radius: 3px; background: #fff;
  box-shadow: inset 0 -3px 0 rgba(29, 91, 134, .09);
  font: 11px/1.35 ui-monospace, Menlo, Consolas, monospace; color: #4e6477;
}
.wh-slot b { font-size: 11.5px; font-weight: 700; letter-spacing: .02em; }
.wh-slot small { font-size: 9.5px; color: #8b9aa8; }
.wh-slot.used {
  background: linear-gradient(180deg, #2f719c, #1b5075);
  border-color: #123e5c; color: #fff;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18);
}
.wh-slot.used small { color: #cfe4f2; }
.wh-slot.picking {
  background: linear-gradient(180deg, #e8842a, #c75f10);
  border-color: #a44c0c; color: #fff;
}
.wh-slot.picking small, .wh-slot.used small { color: #ffe7cd; }
.wh-legend {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  margin-top: 11px; padding-top: 9px; border-top: 1px dashed #ccd9e3;
  font-size: 11px; color: #66798a;
}
.wh-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
/* 平面图右上角淡淡的区域图章（纯装饰，不表示库位） */
.wh-map::after {
  content: 'ZONE MAP / WMS';
  position: absolute; right: 15px; top: 10px; pointer-events: none;
  font: 700 12px/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .18em;
  color: rgba(29, 91, 134, .11);
}
.wh-legend .lg-used { background: #25638b; }
.wh-legend .lg-pick { background: #dd6f18; }
.wh-legend .lg-empty { background: #fff; border: 1px solid #bccbd7; }

/* 库位图右侧：库区概览（全部为真实统计） */
.wh-map-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 232px; align-items: stretch; }
.wh-side {
  border-left: 1px solid #d5e0e8; background: #fff;
  padding: 12px 14px 13px; display: flex; flex-direction: column;
}
.wh-side-title {
  font-size: 12px; font-weight: 700; color: #1c4a6b; letter-spacing: .03em;
  padding-bottom: 8px; border-bottom: 2px solid #e4edf4;
}
.wh-side-title span {
  display: block; margin-top: 2px;
  font: 9px/1.4 ui-monospace, Menlo, Consolas, monospace;
  color: #95a5b3; letter-spacing: .12em; font-weight: 400;
}
.wh-side-kpi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0 9px; }
.wh-side-kpi > div {
  background: #f2f7fa; border: 1px solid #dbe6ee; border-radius: 3px;
  padding: 7px 4px; text-align: center;
}
.wh-side-kpi b {
  display: block; font: 700 19px/1.1 ui-monospace, Menlo, Consolas, monospace;
  color: #1b5075; letter-spacing: -.6px;
}
.wh-side-kpi span { display: block; margin-top: 3px; font-size: 10px; color: #7a8b99; }
.wh-side-pick {
  font-size: 11px; color: #9a6205; background: #fff6e4;
  border: 1px solid #f3ddae; border-radius: 3px; padding: 6px 8px;
}
.wh-side-pick i {
  display: inline-block; width: 8px; height: 8px; border-radius: 2px;
  background: var(--accent); margin-right: 6px;
}
.wh-side-list { margin-top: 9px; font-size: 11px; }
.wh-side-list > div {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 5px 1px; border-bottom: 1px dashed #e3ebf1; color: #5d7183;
}
.wh-side-list > div:last-child { border-bottom: 0; }
.wh-side-list b { color: #1c4a6b; font-weight: 700; }

/* ---------------- 登录页：深色货架网格 + 橙色点缀 ---------------- */
.login-art {
  background:
    radial-gradient(1000px 460px at 8% 0%, rgba(45, 113, 156, .38), transparent 62%),
    repeating-linear-gradient(0deg, transparent 0 47px, rgba(255, 255, 255, .025) 47px 48px),
    repeating-linear-gradient(90deg, transparent 0 47px, rgba(255, 255, 255, .025) 47px 48px),
    linear-gradient(160deg, #12304a, #081a29 72%);
}
.login-art h1 em { color: #f2a052; }
.login-points i { border-radius: 3px; background: rgba(221, 111, 24, .2); color: #f5ae66; }
.login-card { border-radius: 6px; border-color: #cfdae3; }
.login-card .mark { border-radius: 5px; background: linear-gradient(150deg, #2d719c, #123a55); box-shadow: 0 3px 0 #0e2f45; }
.login-flow > div { border-radius: 5px; border-left: 2px solid rgba(221, 111, 24, .75); }
.login-flow > i { background: linear-gradient(90deg, rgba(242, 160, 82, .1), rgba(242, 160, 82, .8)); }
.login-flow > i::after { border-top-color: rgba(242, 160, 82, .8); border-right-color: rgba(242, 160, 82, .8); }

/* ---------------- 手机 / PDA：去掉装饰，保证触摸操作 ---------------- */
@media (max-width: 860px) {
  body { background-image: none; }
  .sidebar { box-shadow: none; }
  .topbar::after { display: none; }
  .wh-status { display: none; }
  .wh-map-wrap { grid-template-columns: 1fr; }
  .wh-side { border-left: 0; border-top: 1px solid #d5e0e8; }
  .wh-map { padding: 10px; }
  .wh-zone { gap: 7px; }
  .wh-zone-name { flex-basis: 48px; font-size: 11px; }
  .wh-slot { min-width: 82px; }
  .scan-box { padding-top: 14px; }
}
