:root {
  --navy: #002147;
  --navy-2: #013056;
  --navy-3: #02456f;
  --navy-line: #1a4a6e;
  --ink: #102433;
  --muted: #5d7684;
  --paper: #eaf3f6;
  --card: #f7fbfc;
  --cyan: #1ec8d4;
  --cyan-soft: #70c5ce;
  --cyan-hi: #b8eef2;
  --lime: #49d00a;
  --lime-hi: #b6f36a;
  --lime-lo: #2f9a08;
  --ok: #49d00a;
  --ng: #ff5a6a;
  --input: #ffffff;
  font-family: "Microsoft YaHei UI", "SimHei", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; color: var(--ink); background: var(--navy); }
body {
  background:
    radial-gradient(1200px 420px at 50% -80px, rgba(30, 200, 212, 0.16), transparent 70%),
    linear-gradient(180deg, #002b49 0%, #002147 48%, #00182f 100%);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
input, select, textarea { outline: none; }
input:focus, select:focus, textarea:focus {
  border-color: var(--cyan) !important;
  box-shadow: 0 0 0 2px rgba(30, 200, 212, 0.22);
}

.app {
  height: 100vh;
  display: grid;
  grid-template-rows: 92px 1fr 52px;
  background: transparent;
}

.topbar {
  display: flex; align-items: stretch;
  padding: 6px 10px 0;
  background: linear-gradient(180deg, rgba(0, 33, 71, 0.2), transparent);
}
.topbar-frame {
  flex: 1;
  display: grid;
  grid-template-columns: 204px minmax(0, 1fr) 168px;
  align-items: center;
  padding: 4px 18px 6px;
  background:
    linear-gradient(180deg, rgba(184, 238, 242, 0.08), transparent 28%),
    linear-gradient(180deg, #07416e 0%, #002147 58%, #001a38 100%);
  border: 1px solid rgba(30, 200, 212, 0.42);
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(184, 238, 242, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25),
    0 8px 18px rgba(0, 0, 0, 0.28);
  position: relative;
}
.topbar-frame::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--lime) 18%, var(--cyan) 50%, var(--lime) 82%, transparent);
}
.logos {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 100%;
  min-width: 0;
  padding: 4px 0;
}
.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 3px 8px 4px;
  background: #fff;
  border: 1px solid rgba(184, 238, 242, 0.55);
  border-radius: 3px;
  box-shadow:
    inset 0 0 0 1px #fff,
    0 1px 2px rgba(0, 12, 28, 0.32);
}
.brand-mark img {
  display: block;
  height: 40px;
  width: auto;
  max-width: 168px;
  object-fit: contain;
  object-position: center;
}
.logo-div {
  width: 2px; height: 34px; flex: 0 0 2px;
  background: linear-gradient(180deg, transparent, var(--cyan), transparent);
  opacity: 0.75;
}
.top-title {
  text-align: center; align-self: center;
  min-width: 0; overflow: hidden; padding: 0 8px;
}
.top-title strong {
  display: block; font-size: 34px; letter-spacing: 0; font-weight: 800; line-height: 1.12;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-title .zh-title {
  letter-spacing: 0.45em;
  margin-right: -0.45em;
}
.top-title small,
#en-banner {
  display: block; margin-top: 3px;
  color: var(--cyan-hi);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 0 10px rgba(30, 200, 212, 0.22);
}
.top-user {
  text-align: right;
  line-height: 1.25;
  color: var(--cyan-hi);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  height: 100%;
  min-width: 0;
  padding-right: 8px;
  transform: translateX(14px);
}
.top-user b,
#hdr-user {
  display: block;
  font-size: 18px;
  color: #fff;
  font-weight: 800;
  text-align: center;
  min-width: 4.8em;
  transform: translateX(-3px);
}
#hdr-role {
  display: block;
  font-size: 13px;
  color: var(--cyan-soft);
  font-weight: 700;
  text-align: center;
  min-width: 4.8em;
  transform: translateX(-10px);
}
#hdr-line {
  font-size: 17px;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.work { display: grid; grid-template-columns: 236px 1fr; min-height: 0; }
.rail {
  background: linear-gradient(180deg, #013056, #002147);
  border-right: 1px solid var(--navy-line);
  padding: 10px 10px 8px;
  display: flex; flex-direction: column; gap: 8px; overflow: auto;
}
.side-card {
  position: relative;
  background: linear-gradient(180deg, #06345c 0%, #002147 100%);
  border: 1px solid rgba(30, 200, 212, 0.35);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(184, 238, 242, 0.18), 0 8px 18px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
.side-card::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--lime) 18%, var(--cyan) 50%, var(--lime) 82%, transparent);
}
.io-box {
  padding: 10px 10px 8px;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.side-field {
  display: grid;
  grid-template-columns: 5.6em 1fr;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--cyan-hi);
  font-weight: 700;
}
.side-field span { white-space: nowrap; letter-spacing: 0.04em; }
.combo {
  position: relative;
  display: flex;
  min-width: 0;
  background: linear-gradient(180deg, #f7fbfc, #eaf3f6);
  border: 1px solid rgba(30, 200, 212, 0.55);
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 1px 2px rgba(0, 0, 0, 0.18);
}
.combo:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(30, 200, 212, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
.combo input {
  flex: 1;
  min-width: 0;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent;
  padding: 6px 8px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
}
.combo input::placeholder { color: #6a8494; font-weight: 600; }
.combo-caret {
  width: 24px;
  flex: none;
  border: 0;
  border-left: 1px solid rgba(30, 200, 212, 0.35);
  background: linear-gradient(180deg, rgba(30, 200, 212, 0.16), rgba(0, 33, 71, 0.08));
  border-radius: 0 6px 6px 0;
  position: relative;
}
.combo-caret:hover { background: linear-gradient(180deg, rgba(73, 208, 10, 0.28), rgba(30, 200, 212, 0.12)); }
.combo-caret::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--navy-3);
  transform: translate(-50%, -40%);
}
.combo-menu {
  position: fixed;
  z-index: 90;
  max-height: 240px;
  overflow: auto;
  background: linear-gradient(180deg, #fff, #f3f8fa);
  border: 1px solid rgba(30, 200, 212, 0.45);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0, 20, 40, 0.32);
  padding: 4px 0;
}
.combo-group {
  padding: 6px 10px 3px;
  font-size: 11px;
  color: var(--cyan);
  font-weight: 700;
  letter-spacing: 0.08em;
}
.combo-item {
  display: flex;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #163047;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 0;
}
.combo-item:hover, .combo-item.on { background: rgba(30, 200, 212, 0.16); color: var(--navy); }
.combo-empty { padding: 8px 10px; font-size: 12px; color: #7a8a96; }
.yield-box {
  display: grid;
  grid-template-columns: 1fr 78px;
  gap: 6px 8px;
  align-items: center;
  margin: 0 8px 10px;
  padding: 10px 10px 8px;
  background: linear-gradient(180deg, rgba(10, 74, 114, 0.42), rgba(0, 33, 71, 0.55));
  border: 1px solid rgba(30, 200, 212, 0.28);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(184, 238, 242, 0.12);
  position: relative;
  overflow: hidden;
}
.yield-box::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--lime), var(--cyan));
}
.yield-nums { font-size: 12px; color: var(--cyan-soft); font-weight: 700; line-height: 1.35; padding-left: 6px; }
.yield-nums span {
  display: block;
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.yield-ok span { color: var(--lime-hi); text-shadow: 0 0 10px rgba(73, 208, 10, 0.35); }
.yield-ng span { color: #ff8a96; }
.yield-ring { position: relative; width: 78px; height: 78px; justify-self: end; }
.yield-ring canvas { width: 78px; height: 78px; display: block; }
.yield-ring strong {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 13px; color: var(--lime-hi); font-weight: 800; pointer-events: none;
  letter-spacing: 0.02em;
  text-shadow: 0 0 10px rgba(73, 208, 10, 0.45), 0 1px 2px rgba(0, 20, 40, 0.7);
}
.yield-ring strong.warn {
  color: #ff9aa4;
  text-shadow: 0 0 10px rgba(255, 90, 106, 0.4), 0 1px 2px rgba(0, 20, 40, 0.7);
}
.yield-ring strong.empty {
  color: var(--cyan-hi);
  text-shadow: 0 0 8px rgba(30, 200, 212, 0.3), 0 1px 2px rgba(0, 20, 40, 0.7);
}
.yield-box .btn {
  grid-column: 1 / -1;
  justify-content: center;
  height: 30px;
  margin-left: 6px;
  background: linear-gradient(180deg, var(--lime-hi), var(--lime) 48%, var(--lime-lo));
  color: #062400;
  border: 1px solid #2f9a08;
  border-radius: 6px;
  font-weight: 800;
  letter-spacing: 0.06em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 2px 6px rgba(47, 154, 8, 0.25);
}

nav {
  display: flex; flex-direction: column; gap: 6px;
  padding: 4px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(8, 58, 96, 0.55), rgba(0, 28, 58, 0.35));
  border: 1px solid rgba(30, 200, 212, 0.16);
}
.nav {
  display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 12px 0 8px; text-align: left;
  color: #f3fbfe;
  background: linear-gradient(180deg, rgba(22, 108, 156, 0.96), rgba(3, 52, 90, 0.96));
  border: 1px solid rgba(140, 220, 232, 0.28);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  box-shadow: inset 0 1px 0 rgba(220, 248, 252, 0.22), 0 2px 6px rgba(0, 16, 36, 0.22);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.nav i {
  width: 26px; height: 26px; display: inline-grid; place-items: center;
  font-style: normal; color: #fff; flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(0, 0, 0, 0.22);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42), 0 2px 4px rgba(0, 0, 0, 0.28);
}
.nav-ico svg {
  width: 14px; height: 14px; display: block;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}
.nav-ico.filled svg { fill: currentColor; stroke: none; }
.nav-ico.filled svg circle[r="3.3"],
.nav-ico.filled svg [fill-rule="evenodd"] { fill: currentColor; }
.nav[data-module="login"] i { background: linear-gradient(180deg, #ff6a72, #c42832); border-color: #8e1820; }
.nav[data-module="preview"] i { background: linear-gradient(180deg, #f0cb55, #b88612); color: #002147; border-color: #8a6410; }
.nav[data-module="stats"] i { background: linear-gradient(180deg, #7eebf2, #12a8b4); color: #002147; border-color: #0c7480; }
.nav[data-module="monitor"] i { background: linear-gradient(180deg, #5ee0c8, #0e9a86); color: #002147; border-color: #0a6e60; }
.nav[data-module="quality"] i { background: linear-gradient(180deg, #8ae84a, #2f9a08); color: #062400; border-color: #1a5a04; }
.nav[data-module="product"] i { background: linear-gradient(180deg, #7eb6f0, #2a6cb8); border-color: #184a86; }
.nav[data-module="equipment"] i { background: linear-gradient(180deg, #8cbcf4, #1a5fd0); border-color: #123e86; }
.nav[data-module="person"] i { background: linear-gradient(180deg, #6ee4ee, #0a7a8a); color: #002147; border-color: #085860; }
.nav[data-module="engineering"] i { background: linear-gradient(180deg, #d7c8f8, #6a56b0); border-color: #463488; }
.nav[data-module="workorder"] i { background: linear-gradient(180deg, #ffe08a, #d49a16); color: #1a1400; border-color: #8a6410; }
.nav[data-module="settings"] i { background: linear-gradient(180deg, #6a8ef0, #1a4eb8); border-color: #123880; }
.nav[data-module="about"] i { background: linear-gradient(180deg, #b8eef2, #3aabb6); color: #002147; border-color: #1a7480; }
.nav:hover:not(.locked) {
  border-color: rgba(184, 238, 242, 0.8);
  background: linear-gradient(180deg, #1b86b6, #05557e);
  transform: translateX(2px);
}
.nav.locked { opacity: 0.42; }
.nav.locked:hover { opacity: 0.6; transform: none; }
.nav.active {
  background: linear-gradient(180deg, #2a9a52, #0d5a2c);
  border-color: #b6f36a;
  box-shadow: inset 3px 0 0 #e8ffb0, 0 6px 14px rgba(0, 0, 0, 0.24);
  color: #fff;
  transform: none;
}
.nav.active i { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 0 0 1px rgba(182, 243, 106, 0.35); }

.rail-clock-frame {
  margin-top: auto;
  padding: 0;
  border: 0;
  background: transparent;
}
.clock-widget {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  padding: 6px 8px 7px;
  background: linear-gradient(180deg, #06345c, #002147);
  border: 1px solid rgba(30, 200, 212, 0.32);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(184, 238, 242, 0.14), 0 6px 14px rgba(0, 0, 0, 0.22);
  position: relative;
  overflow: hidden;
}
.clock-widget::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan) 30%, var(--lime) 70%, transparent);
}
.clock-meta {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 11px; color: var(--cyan-soft); letter-spacing: 0.04em;
}
.clock-time {
  font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
  font-size: 18px; font-weight: 700; letter-spacing: 1.5px; line-height: 1.15;
  color: #fff;
  text-shadow: 0 0 10px rgba(30, 200, 212, 0.4);
}
.clock-uptime {
  margin-top: 3px;
  font-size: 11px; color: var(--cyan-soft);
  border-top: 1px solid rgba(30, 200, 212, 0.22);
  padding-top: 3px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.clock-uptime b { color: var(--cyan-hi); font-weight: 700; letter-spacing: 0.04em; }

.stage {
  min-width: 0; display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(180deg, #013056, #002147);
}
.mod-scope { display: none; }
.banner {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin: 8px 10px 0;
  padding: 6px 10px;
  min-height: 42px;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.banner-status { display: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.banner::before, .banner::after, .kpi::before, .card::before { display: none; }
.eyebrow { margin: 0 0 2px; font-size: 12px; color: var(--cyan); letter-spacing: 0.18em; }
.banner h2 { margin: 0; font-size: 32px; letter-spacing: 6px; font-weight: 700; }
.banner p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.hero-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: nowrap; align-items: center; z-index: 1; min-width: 0; max-width: 100%; }
#date-chips {
  flex: 1 1 auto;
  flex-wrap: nowrap;
  overflow-x: auto;
  min-width: 0;
}
#date-chips .chip { padding: 6px 9px; white-space: nowrap; }
.chips, .seg {
  display: flex;
  min-width: 0;
  max-width: 100%;
  border: 1px solid rgba(30, 200, 212, 0.35);
  background: rgba(0, 33, 71, 0.55);
  border-radius: 6px;
  overflow: hidden;
}
.chip {
  border: 0; background: transparent; color: #d7e7ee; padding: 6px 12px; font-size: 12px;
}
.chip.active {
  background: linear-gradient(180deg, var(--lime-hi), var(--lime) 48%, var(--lime-lo));
  color: #062400; font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn {
  border: 1px solid rgba(30, 200, 212, 0.4);
  background: linear-gradient(180deg, #0c5480, #023456);
  border-radius: 6px; padding: 5px 12px;
  display: inline-flex; align-items: center; color: #e8f4f8; font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(184, 238, 242, 0.16);
}
.btn:hover { filter: brightness(1.1); }
.btn.gold {
  background: linear-gradient(180deg, var(--lime-hi), var(--lime) 48%, var(--lime-lo));
  color: #062400; border-color: #2f9a08;
}
.btn.danger {
  background: linear-gradient(180deg, #ff8a96, #e04050); color: #fff; border-color: #a02030;
}
.btn.tiny { padding: 4px 8px; font-size: 12px; }

.stage-row { flex: 1; min-height: 0; display: grid; grid-template-columns: 38px 1fr; margin: 0 10px 10px; }
.vtabs {
  display: flex; flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 6px;
  padding: 8px 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: #01263f;
  border: 1px solid var(--navy-line);
  border-right: 0;
  border-radius: 10px 0 0 10px;
}
.vtab {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: none;
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
  border: 0;
  border-radius: 8px 0 0 8px;
  background: linear-gradient(90deg, #013056, #002147);
  color: var(--cyan-soft);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 4px;
  padding: 14px 6px;
  line-height: 1.15;
}
.vtab.active {
  background: linear-gradient(90deg, #eaf3f6, #d5e9ef);
  color: var(--navy);
  box-shadow: inset -3px 0 0 var(--lime);
}
.stage-main {
  overflow: auto; padding: 12px 14px 16px;
  min-height: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.65), rgba(234,243,246,0.92)),
    var(--paper);
  border: 1px solid rgba(30, 200, 212, 0.28);
  border-radius: 0 10px 10px 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.filters {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px;
  padding: 12px; margin-bottom: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.78), rgba(234,243,246,0.92));
  border: 1px solid rgba(30, 200, 212, 0.28);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 6px 14px rgba(0, 33, 71, 0.05);
}
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: #2a5a6e; font-weight: 700; letter-spacing: 0.04em; min-width: 0; }
.filters .wide { grid-column: span 2; }
.filters input, .filters select, textarea, .edit-grid input, .edit-grid select, .edit-grid textarea {
  background: #fff; border: 1px solid #b7cdd6; border-radius: 6px; padding: 6px 8px; color: var(--ink);
  width: 100%; min-width: 0; max-width: 100%;
}
.search { display: flex; gap: 8px; min-width: 0; align-items: center; }
.search input { flex: 1; min-width: 0; background: #fff; border: 1px solid #b7cdd6; border-radius: 6px; padding: 7px 10px; color: var(--ink); }
.scan-bar,
label.scan-slot {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 36px;
  background: #f4fafb;
  border: 1px solid #9eb8c4;
  border-radius: 8px;
  padding: 2px 8px 2px 10px;
}
.scan-bar::before {
  content: "扫码";
  flex: none;
  color: #013056;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}
.filters label.scan-slot,
.page-query label.scan-slot,
.entry-scan label.scan-slot {
  flex-direction: row;
  font-size: 12px;
  color: #013056;
  letter-spacing: 0;
  font-weight: 700;
}
label.scan-slot > span { flex: none; white-space: nowrap; color: #013056; font-weight: 700; }
.search.scan-bar > input,
label.scan-slot > input,
.pack-q-wrap.scan-bar > input {
  flex: 1;
  width: auto;
  min-width: 0;
  height: 32px;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0 4px;
  border-radius: 0;
  color: var(--ink);
}
.search.scan-bar > input:focus,
label.scan-slot > input:focus { outline: none; }
.pack-q-wrap.scan-bar > span { display: none; }
.learn-strip {
  margin: 0 0 10px;
  padding: 8px 12px;
  background: #f4fafb;
  border-left: 3px solid #1ec8d4;
  border-radius: 0 8px 8px 0;
  color: #245066;
  font-size: 12px;
  line-height: 1.55;
}
.page-query {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto auto;
  gap: 8px 10px;
  align-items: end;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(234,243,246,0.96));
  border: 1px solid rgba(30, 200, 212, 0.32);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 6px 14px rgba(0, 33, 71, 0.05);
}
.page-query label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 11px; color: #2a5a6e; font-weight: 700; letter-spacing: 0.04em;
}
.page-query input {
  background: #fff; border: 1px solid #b7cdd6; border-radius: 6px;
  padding: 6px 8px; color: var(--ink); width: 100%; min-width: 0;
}
.page-query input:focus {
  outline: none; border-color: #1ec8d4;
  box-shadow: 0 0 0 2px rgba(30, 200, 212, 0.18);
}
.page-query .btn { height: 32px; min-width: 72px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.kpi-dash, .kpi-8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.kpi-dash .kpi, .kpi-8 .kpi { min-width: 0; padding: 10px 12px; }
.kpi-dash .kpi strong, .kpi-8 .kpi strong { font-size: 22px; margin-top: 4px; }
.kpi-dash .kpi strong, .kpi-8 .kpi strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kpi-8 .kpi small, .kpi-dash .kpi small {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.35;
}
.page-stack { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.page-stack > .kpis,
.page-stack > .shifts { margin-bottom: 0; }
.page-stack > .hint { margin: 0; }
.page-stack .card .table-wrap { margin-top: 8px; }
.kpi {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, #fff, #eef6f8);
  border: 1px solid rgba(0, 33, 71, 0.12);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 6px 14px rgba(0, 33, 71, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}
.kpi::after {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--cyan);
}
.kpi.ok::after, .kpi.accent::after, .kpi.yield::after { background: var(--lime); }
.kpi.ng::after { background: var(--ng); }
.kpi span { color: #3a6a7a; font-size: 12px; letter-spacing: 0.08em; }
.kpi strong {
  display: block; font-size: 28px; margin-top: 6px; letter-spacing: 1px;
  font-variant-numeric: tabular-nums; color: var(--navy);
}
.kpi small { display: block; color: var(--muted); margin-top: 4px; font-size: 11px; }
.delta { margin-left: 6px; font-weight: 700; }
.delta.up { color: #1c8a12; }
.delta.down { color: #d02432; }
.delta.flat { color: var(--muted); font-weight: 600; }
.shift-out { text-align: right; }
.shift-out strong { display: block; font-size: 28px; color: var(--navy); }
.shift-out small { display: block; color: var(--muted); margin-top: 4px; }
.stats-note { margin: 0 0 10px; }
tr.bottleneck td { background: #ffe8dc; }
tr.yield-warn td { background: #fff8e6; }
.kpi.ng span { color: #9a3a44; }
.kpi.warn-yield strong { color: #9a6b00; }
.rty-loss { color: #c01828; font-weight: 700; }
.kpi.ok strong, .kpi.accent strong, .kpi.yield strong { color: #1f7a08; }
.kpi.ng strong { color: var(--ng); }
.kpi.yield { padding-right: 72px; }
.kpi.yield canvas { position: absolute; right: 10px; top: 14px; }

.shifts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.shift {
  background: var(--card); border: 1px solid rgba(0, 33, 71, 0.12);
  padding: 12px 14px; display: flex; justify-content: space-between; align-items: center;
}
.shift.day { box-shadow: inset 4px 0 0 #1c8a12; }
.shift.night { box-shadow: inset 4px 0 0 #1a8fc4; }
.shift .shift-name { display: block; font-size: 16px; color: var(--navy); }
.shift strong { font-size: 26px; color: var(--navy); font-variant-numeric: tabular-nums; }
.shift b { font-size: 22px; color: #1f7a08; }
.shift-compare { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
.shift-compare .cmp {
  background: linear-gradient(180deg, #fff, #f2f6f9);
  border: 1px solid #d5e1ea;
  padding: 10px 12px;
}
.shift-compare .cmp span { display: block; font-size: 12px; color: #5b6d7c; font-weight: 700; }
.shift-compare .cmp b { display: block; margin-top: 4px; font-size: 15px; color: var(--navy); }
.shift-compare .cmp small { display: block; margin-top: 4px; color: var(--muted); }
.legend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #4a5b6a; font-weight: 700; flex: none; white-space: nowrap; }
.legend i { width: 10px; height: 10px; display: inline-block; border-radius: 50%; }
.lg-day { background: #1c8a12; }
.lg-night { background: #1a8fc4; }
.grain-seg {
  flex-wrap: nowrap;
  width: 100%;
  margin: 0 0 10px;
}
.grain-seg .chip {
  flex: 1 1 0;
  min-width: 0;
  padding: 5px 2px;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage.cast-chrome .banner { display: none !important; }
.stage.cast-chrome .vtabs { display: none !important; }
.app.cast-max { grid-template-rows: 92px minmax(0, 1fr); }
.app.cast-max .rail,
.app.cast-max .dock { display: none !important; }
.app.cast-max .work { grid-template-columns: minmax(0, 1fr); }
.app.cast-max .stage.cast-chrome .stage-row { margin: 0; }
.stage.cast-chrome .stage-row { margin: 0 10px 10px; gap: 0; flex: 1; min-height: 0; }
.stage.cast-chrome .stage-main,
.stage.cast-chrome .stage-row.scada-wide .stage-main {
  padding: 0 !important;
  min-height: 0;
  border-radius: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
.page { min-width: 0; }
#page-dashboard { overflow-x: hidden; }
#page-dashboard .table-wrap { max-height: 320px; }
#page-dashboard .card-h, #page-broadcast .card-h { min-width: 0; }
.stage-main.cast-fit {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.stage-main.cast-fit #page-broadcast {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#page-broadcast { overflow: hidden; min-height: 0; }
.dash-cast { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; min-height: 0; --cast-n: 7; }
.dash-cast-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 4px 6px 8px;
  min-width: 0;
}
.dash-cast-seg {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--cast-n), minmax(0, 1fr));
  flex: 1;
  min-width: 0;
  padding: 4px;
  border-radius: 12px;
  background: linear-gradient(180deg, #eef4f7, #e4eef3);
  border: 1px solid rgba(0, 33, 71, 0.1);
  box-shadow: inset 0 1px 2px rgba(0, 33, 71, 0.06);
}
.dash-cast-thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc((100% - 8px) / var(--cast-n));
  border-radius: 9px;
  background: linear-gradient(180deg, #fff, #f4fbfd);
  box-shadow: 0 2px 8px rgba(0, 33, 71, 0.12), 0 0 0 1px rgba(30, 200, 212, 0.28);
  transition: transform 0.28s ease, width 0.28s ease;
  pointer-events: none;
  z-index: 0;
}
.dash-cast-tab {
  position: relative;
  z-index: 1;
  height: 32px;
  border: 0;
  background: transparent;
  color: #5d7684;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 2px;
  border-radius: 9px;
}
.dash-cast-tab.active { color: var(--navy); }
.dash-cast-bar.is-play .dash-cast-tab.active { color: #014b58; }
.dash-cast-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.dash-cast-idx {
  min-width: 2.6em;
  color: #5d7684;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  text-align: right;
}
.dash-cast-toggle {
  height: 32px;
  min-width: 68px;
  padding: 0 12px;
  border: 1px solid rgba(30, 200, 212, 0.4);
  border-radius: 9px;
  background: linear-gradient(180deg, #06345c, #002147);
  color: #b8eef2;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.dash-cast-bar.is-play .dash-cast-toggle {
  background: linear-gradient(180deg, #1a6a72, #0e4a52);
  border-color: rgba(30, 200, 212, 0.55);
  color: #fff;
}
.dash-cast-max {
  background: linear-gradient(180deg, #0c4a62, #06344a);
}
.dash-cast-max[aria-pressed="true"] {
  background: linear-gradient(180deg, #1a6a72, #0e4a52);
  color: #fff;
}
.dash-cast-sec {
  min-width: 2.4em;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}
.dash-cast-progress {
  position: absolute; left: 8px; right: 8px; bottom: 0; height: 3px; width: auto;
  max-width: none;
  background: linear-gradient(90deg, #128a96, #1ec8d4);
  border-radius: 99px;
  pointer-events: none;
  transform-origin: left center;
  width: 0;
}
.dash-cast-bar.is-play .dash-cast-progress {
  animation: dash-cast-bar var(--cast-ms, 12s) linear infinite;
}
@keyframes dash-cast-bar {
  from { width: 0; }
  to { width: calc(100% - 16px); }
}
.dash-cast-viewport {
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  flex: 1;
  border-radius: 12px;
  background: linear-gradient(180deg, #f6fafc, #eef4f7);
  box-shadow: inset 0 0 0 1px rgba(0, 33, 71, 0.06);
}
.dash-cast-track {
  display: grid;
  grid-template-columns: repeat(var(--cast-n), 1fr);
  width: calc(var(--cast-n) * 100%);
  height: 100%;
  transition: transform 0.65s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}
.dash-cast-slide {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 4px 4px;
  box-sizing: border-box;
}
.dash-cast-slide.cast-skip { display: none !important; }
.dash-cast-slide[data-cast-slide="order"] { order: 1; }
.dash-cast-slide[data-cast-slide="view"] { order: 2; }
.dash-cast-slide[data-cast-slide="heat"] { order: 3; }
.dash-cast-slide[data-cast-slide="scada"] { order: 4; }
.dash-cast-slide[data-cast-slide="cycle"] { order: 5; }
.dash-cast-slide[data-cast-slide="alerts"] { order: 6; }
.dash-cast-slide[data-cast-slide="equip"] { order: 7; }
.dash-cast-slide[data-cast-slide="key"] { order: 99; }
.dash-cast-slide[data-cast-slide="key"],
.dash-cast-slide[data-cast-slide="equip"],
.dash-cast-slide[data-cast-slide="order"] {
  overflow-x: hidden;
  overflow-y: auto;
}
.dash-cast-slide > .kpis,
.dash-cast-slide > .shifts { flex: none; margin: 0; }
.dash-cast-slide[data-cast-slide="view"] {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1.08fr) minmax(0, 0.82fr) minmax(0, 0.52fr);
  gap: 6px;
}
.dash-cast-slide[data-cast-slide="view"] > .cast-evidence { display: none; }
.dash-cast-slide[data-cast-slide="view"] > .grid-2,
.dash-cast-slide[data-cast-slide="view"] > .card {
  flex: none;
  min-height: 0;
  overflow: hidden;
  margin: 0 !important;
}
.dash-cast-slide > .card {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.dash-cast-slide > .card .table-wrap {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
}
.dash-cast-slide .cast-alert-wrap { overflow: auto; }
.dash-cast-slide .grid-2,
.dash-cast-slide .grid-eq2 { gap: 6px; min-height: 0; }
.dash-cast-slide .grid-2 > .card,
.dash-cast-slide .grid-eq2 > .card {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 6px 8px 8px;
}
.dash-cast-slide .card h3,
.dash-cast-slide .cast-alert-status h3,
.dash-cast-slide .cast-offline-band h3,
.dash-cast-slide .dash-alert-card h3 {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--navy);
}
.dash-cast-slide .card-h { margin-bottom: 2px; flex-wrap: nowrap; gap: 8px; }
.dash-cast-slide .card-h .hint { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-cast-slide .grain-seg { margin: 0 0 4px; }
.dash-cast-slide .grain-seg .chip { padding: 3px 2px; font-size: 11px; }
.dash-cast-slide table { font-size: 11px; }
.dash-cast-slide th, .dash-cast-slide td { padding: 3px 6px; }
.dash-cast canvas:not([id*="ring"]) {
  flex: 1 1 auto;
  min-height: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-height: 100%;
}
.dash-cast .kpi-dash { gap: 6px; }
#cast-kpis { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.dash-cast .kpi { padding: 5px 8px; }
.dash-cast .kpi strong { font-size: 18px; margin-top: 1px; }
.dash-cast .kpi span {
  font-size: 10px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.dash-cast .kpi small {
  margin-top: 0;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-cast .kpi.yield { padding-right: 42px; }
.dash-cast .kpi.yield canvas {
  width: 32px !important;
  height: 32px !important;
  top: 6px;
  right: 6px;
}
.dash-cast .shifts { gap: 6px; }
.dash-cast .shift { padding: 5px 10px; }
.dash-cast .shift .hint { display: none; }
.dash-cast .shift .shift-name { font-size: 13px; }
.dash-cast .shift > div:first-child > div { font-size: 11px; line-height: 1.3; }
.dash-cast .shift-out strong { font-size: 18px; }
.dash-cast .shift-out small { margin-top: 0; font-size: 10px; }
.dash-cast .legend { font-size: 11px; }
.dash-cast .dash-heat-card {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 6px 8px 8px;
}
.dash-cast .heat-caption { display: none; }
.dash-cast .heat-split { flex: 1; min-height: 0; gap: 8px; }
.dash-cast .heatmap { height: 100%; min-height: 0; overflow: hidden; }
.dash-cast .heat-grid {
  height: 100%;
  grid-template-rows: 22px;
  grid-auto-rows: minmax(22px, 1fr);
  align-content: stretch;
}
.dash-cast .heat-cell { aspect-ratio: auto; min-height: 0; height: 100%; }
.dash-cast .heat-charts { flex: 1; min-height: 0; padding: 6px 8px; gap: 6px; }
.dash-cast .heat-charts h4 { font-size: 12px; margin: 0 0 2px; }
.dash-cast .heat-charts > div {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.dash-cast .scada,
.dash-cast .dash-scada {
  flex: 1;
  min-height: 0 !important;
  height: 100%;
  overflow: hidden;
  padding: 8px 10px;
  gap: 6px;
}
.dash-cast .scada-head { padding: 2px 2px 6px; }
.dash-cast .scada-title b {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.dash-cast .scada-title span { font-size: 11px; letter-spacing: 0.04em; }
.dash-cast .scada-ticker { display: none; }
.dash-cast .scada-op { min-height: 0; overflow: hidden; padding: 4px 6px 6px; gap: 4px; }
.dash-cast .scada-stations { flex: 1; min-height: 0; gap: 3px; overflow: hidden; }
.dash-cast .scada-cell { padding: 3px 6px; gap: 2px 6px; min-height: 0; overflow: hidden; }
.dash-cast .scada-bay { min-height: 0; height: 28px; }
.dash-cast .scada-puck { width: 36px; height: 20px; }
.dash-cast .scada-data { max-height: 1.35em; }
.dash-cast .scada-legend { padding-top: 0; font-size: 11px; gap: 10px; flex: none; }
.dash-cast-slide[data-cast-slide="cycle"] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.88fr);
  gap: 6px;
}
.dash-cast-slide[data-cast-slide="cycle"] > .kpis { flex: none; }
#cast-cycle-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.dash-cast-slide[data-cast-slide="cycle"] > .cast-cycle-charts {
  flex: none;
  min-height: 0;
  margin: 0;
  overflow: hidden;
}
.dash-cast-slide[data-cast-slide="cycle"] .cast-cycle-charts .card {
  min-height: 0;
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  padding: 6px 8px 8px;
}
.dash-cast-slide[data-cast-slide="cycle"] .cast-cycle-charts canvas {
  flex: 1 1 auto;
  min-height: 0 !important;
}
.cast-offline-band {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 4px;
  min-height: 0;
  overflow: hidden;
}
.cast-offline-band > .card-h {
  margin: 0;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
}
.cast-offline-band > .card-h h3 {
  font-size: 13px;
  letter-spacing: 0.04em;
}
.dash-cast-slide[data-cast-slide="cycle"] #cast-offline-recent-tabs {
  flex: none;
  gap: 0;
}
.dash-cast-slide[data-cast-slide="cycle"] #cast-offline-recent-tabs .chip {
  padding: 2px 8px;
  font-size: 11px;
}
.cast-offline-band > .card-h .hint {
  margin-left: auto;
  min-width: 0;
}
.dash-cast-slide[data-cast-slide="cycle"] .cast-offline-band .cast-cycle-charts {
  margin: 0;
}
.dash-cast-slide[data-cast-slide="alerts"],
.dash-cast-slide[data-cast-slide="key"] {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  align-content: start;
}
.dash-cast-slide[data-cast-slide="alerts"]::-webkit-scrollbar,
.dash-cast-slide[data-cast-slide="key"]::-webkit-scrollbar { width: 8px; }
.dash-cast-slide[data-cast-slide="alerts"]::-webkit-scrollbar-thumb,
.dash-cast-slide[data-cast-slide="key"]::-webkit-scrollbar-thumb {
  background: rgba(0, 33, 71, 0.22);
  border-radius: 99px;
}
.dash-cast-slide[data-cast-slide="alerts"] > *,
.dash-cast-slide[data-cast-slide="key"] > * {
  flex: none;
  height: auto;
  min-height: 0;
}
.cast-alert-status {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  overflow: visible;
  padding: 8px 10px 10px;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #f3f8fa);
  box-shadow: 0 6px 14px rgba(0, 33, 71, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 33, 71, 0.12);
}
.cast-alert-status > .card-h { margin: 0; }
.cast-alert-status > .kpis { margin: 0; }
.cast-alert-status > .card {
  margin: 0 !important;
  min-height: 160px;
  height: auto;
  display: flex;
  flex-direction: column;
  padding: 6px 8px 8px;
}
.cast-alert-status > .card[hidden] { display: none !important; min-height: 0; }
.cast-alert-status > .card canvas {
  flex: none;
  height: 140px !important;
  min-height: 140px !important;
}
.dash-cast-slide[data-cast-slide="alerts"] #cast-over-recent-tabs,
.dash-cast-slide[data-cast-slide="key"] #cast-over-recent-tabs { flex: none; }
.dash-cast-slide[data-cast-slide="alerts"] #cast-over-recent-tabs .chip,
.dash-cast-slide[data-cast-slide="key"] #cast-over-recent-tabs .chip {
  padding: 2px 8px;
  font-size: 11px;
}
#cast-over-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.dash-cast .cast-over-trends {
  min-height: 0;
  margin: 0;
  gap: 6px;
  height: auto;
  grid-auto-rows: minmax(168px, auto);
}
.dash-cast .cast-over-trends .card {
  min-height: 168px;
  height: auto;
  margin: 0;
  display: flex;
  flex-direction: column;
  padding: 6px 8px 8px;
}
.dash-cast .cast-over-trends canvas {
  flex: none;
  height: 120px !important;
  min-height: 120px !important;
}
.dash-cast .dash-alert-card {
  flex: none;
  min-height: 280px;
  height: auto;
  overflow: visible;
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  margin: 0 !important;
}
.dash-cast-slide[data-cast-slide="alerts"] .dash-alert-card .table-wrap,
.dash-cast .cast-alert-wrap {
  flex: none;
  overflow: visible;
  max-height: none;
  min-height: 200px;
}
.dash-cast .cast-alert-table { font-size: 11px; }
.dash-cast .cast-alert-table th,
.dash-cast .cast-alert-table td { padding: 3px 6px; white-space: nowrap; }
.dash-cast .cast-alert-table td:nth-child(3),
.dash-cast .cast-alert-table td:nth-child(7) {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-cast tr.cast-alert-open td { background: #fff6e8; }
.dash-scada .scada-over, .dash-scada .scada-alerts, .dash-scada .scada-cycle { display: none; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid-eq2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #fff, #f3f8fa);
  border: 1px solid rgba(0, 33, 71, 0.12);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 6px 14px rgba(0, 33, 71, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.card canvas { display: block; width: 100%; max-width: 100%; }
.card h3 small, .hint { color: var(--muted); font-weight: 400; font-size: 12px; line-height: 1.55; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; min-width: 0; flex-wrap: wrap; }
.card-h h3 { margin: 0; flex: none; }
.card-h.proc-head { flex-wrap: wrap; align-items: flex-start; }
.page-report { margin: 0 0 10px; }
.page-report h3 { font-size: 16px; }
.report-actions { display: flex; gap: 6px; flex: none; align-items: center; }
#proc-tabs.seg {
  flex-wrap: wrap;
  overflow: visible;
  max-width: 100%;
}

.maintain-hero, .product-hero {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
  margin-bottom: 10px; padding: 14px 16px;
  border: 1px solid rgba(30, 200, 212, 0.28);
  background: linear-gradient(90deg, rgba(0, 33, 71, 0.08), rgba(30, 200, 212, 0.08));
}
.maintain-hero h3, .product-hero h3 { margin: 0 0 6px; font-size: 20px; color: var(--navy); }
.maintain-hero p, .product-hero p { margin: 0; color: var(--muted); font-size: 13px; max-width: 640px; }
.product-hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: stretch; }
.product-hero p { max-width: none; }
.product-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
#product-kpis {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
#product-kpis .kpi { padding: 10px 12px; }
#product-kpis .kpi strong {
  font-size: 16px;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prod-pick { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.prod-pick select { min-width: 180px; }
.product-empty { padding: 8px 2px 4px; }
.product-pick-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.product-card-body { margin-top: 12px; }
.product-card-actions { margin-top: 10px; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { background: var(--input); border: 1px solid #c3d5dc; padding: 5px 10px; font-size: 12px; }
.pill b { color: var(--lime-lo); margin-left: 4px; }
.maintain-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lookup-h { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.lookup-h h3 { margin: 0 0 4px; }
.ico-badge {
  width: 40px; height: 40px; display: grid; place-items: center;
  font-weight: 800; font-size: 12px; flex-shrink: 0;
  border: 1px solid rgba(30, 200, 212, 0.4);
  background: var(--navy); color: var(--cyan-hi);
}

.table-wrap { overflow: auto; max-height: 560px; background: #fff; border: 1px solid #c3d5dc; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 11px; border-bottom: 1px solid #e2eef2; text-align: left; white-space: nowrap; color: var(--ink); }
th { color: #fff; position: sticky; top: 0; background: #013056; z-index: 1; font-weight: 700; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable .sort-mark { display: inline-block; min-width: .8em; margin-left: 4px; }
th.sortable.on, th.sortable.filtered { color: #7adbe4; }
.col-menu {
  position: fixed; z-index: 80; width: 260px; max-height: 360px;
  background: #fff; color: var(--ink); border: 1px solid #9ec3cc;
  display: flex; flex-direction: column;
}
.col-menu-sort, .col-menu-bar { display: flex; gap: 6px; padding: 8px; background: #f4fafb; }
.col-menu-sort button, .col-menu-bar button {
  flex: 1; height: 28px; border: 1px solid #9ec3cc; background: #fff; color: #013056; cursor: pointer;
}
.col-menu-sort button.on { background: #013056; color: #fff; }
.col-menu-bar button:disabled { opacity: .45; cursor: default; }
.col-menu-bar button.gold { background: #013056; color: #fff; }
.col-menu-text { display: flex; gap: 4px; padding: 0 8px; }
.col-menu-text select, .col-menu-text input, .col-menu-text button {
  height: 28px; border: 1px solid #9ec3cc; background: #fff; color: #013056;
}
.col-menu-text input { flex: 1; min-width: 0; padding: 0 6px; }
.col-menu-text button { padding: 0 8px; cursor: pointer; }
.col-menu-all { display: flex; gap: 6px; align-items: center; margin: 8px 8px 0; font-size: 12px; color: #013056; }
.col-menu-note { margin: 0 8px; }
.col-menu-q { margin: 8px 8px 0; height: 30px; border: 1px solid #c3d5dc; padding: 0 8px; }
.col-menu-list { overflow: auto; padding: 8px; min-height: 72px; }
.col-menu-item { display: flex; gap: 6px; align-items: center; padding: 3px 0; font-size: 12px; color: var(--ink); }
.col-menu-item input { flex: 0 0 auto; }
td.cell-code {
  max-width: 168px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 12px;
}
td.cell-clip {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
tr:nth-child(even) td { background: #f4fafb; }
tr:hover td { background: #e7f8d8; }
.badge { padding: 2px 8px; font-size: 12px; border: 1px solid transparent; }
.badge.ok { background: #e4f8d0; color: #1f7a08; border-color: #8ed08e; }
.badge.ng { background: #ffe0e4; color: #a00020; }
.badge.exc-chk { background: #e8f4ff; color: #155a9c; border-color: #8cbcde; }
.badge.exc-sus { background: #fff0d6; color: #8a5a00; border-color: #e0b56a; }
.badge.exc-ng { background: #ffe0e4; color: #a00020; border-color: #f0a0a8; }
.badge.exc-abn { background: #f3e8ff; color: #6b2d9c; border-color: #c9a6e8; }
.badge.exc-stale { background: #eceff1; color: #455a64; border-color: #b0bec5; }
.kpi[data-exckind] { cursor: pointer; }
.kpi.exc-chk::after { background: #2b6cb0; }
.kpi.exc-sus::after { background: #e8b020; }
.kpi.exc-ng::after { background: var(--ng); }
.kpi.exc-abn::after { background: #8a4ecf; }
.kpi.exc-stale::after { background: #78909c; }
.exception-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.ops { display: flex; gap: 4px; flex-wrap: wrap; }
.btn.tiny.act-check { background: #e8f7f8; color: #0a6e78; border: 1px solid #9ad7dc; }
.hist-visit-h .ops { margin-left: auto; }

.pager { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 13px; min-width: 0; }
.hidden { display: none !important; }
.mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: 13px; }
textarea { width: 100%; min-height: 140px; }
.compare { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }

.stage-row.scada-wide { grid-template-columns: 1fr; }
.stage-row.scada-wide .vtabs { display: none; }
.stage-row.scada-wide .stage-main { border-radius: 10px; padding: 8px; position: relative; }

.scada {
  min-height: calc(100vh - 220px);
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 12px 12px;
  color: #d7eef4;
  background:
    radial-gradient(900px 280px at 50% -40px, rgba(30, 200, 212, 0.16), transparent 70%),
    linear-gradient(180deg, #083a5c 0%, #01203a 42%, #001526 100%);
  border: 1px solid rgba(30, 200, 212, 0.38);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(184, 238, 242, 0.18), 0 10px 24px rgba(0, 20, 40, 0.28);
  overflow: auto;
  position: relative;
}
.scada::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(30, 200, 212, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 200, 212, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}
.scada-head, .scada-flow, .scada-legend, .scada-ticker, .scada-over, .scada-alerts, .scada-cycle { position: relative; z-index: 1; }
.scada-ticker {
  display: grid;
  grid-template-columns: 1fr 18px 1fr 18px 1.2fr 18px .85fr 18px .7fr;
  gap: 6px;
  align-items: center;
  min-height: 42px;
  padding: 4px 0 6px;
}
.scada-tick {
  position: relative;
  height: 34px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(30, 200, 212, 0.28);
  background: #041828;
  display: flex; align-items: center; gap: 6px;
  padding: 0 8px;
}
.scada-tick::before {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, rgba(30,200,212,.12) 0 10px, transparent 10px 20px);
  animation: belt 1.8s linear infinite;
  opacity: .55;
}
.scada-tick b { position: relative; z-index: 1; color: var(--cyan-hi); font-size: 12px; letter-spacing: .08em; }
.scada-tick span {
  position: relative; z-index: 1;
  font-size: 11px; color: #cfe8ee;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.scada-tick.has-wip {
  border-color: rgba(73, 208, 10, 0.55);
  box-shadow: 0 0 10px rgba(73, 208, 10, 0.18);
}
.scada-tick.has-wip span { color: var(--lime-hi); font-weight: 700; }
.scada-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 4px 2px 8px;
  border-bottom: 1px solid rgba(30, 200, 212, 0.22);
}
.scada-title { display: flex; flex-direction: column; gap: 2px; }
.scada-title b {
  font-size: 16px; letter-spacing: 0.12em; color: #fff;
  text-shadow: 0 0 12px rgba(30, 200, 212, 0.35);
}
.scada-title span { font-size: 12px; color: #8fb8c6; }
.scada-meta { display: flex; align-items: center; gap: 12px; font-variant-numeric: tabular-nums; }
.scada-meta em {
  font-style: normal; font-size: 22px; font-weight: 800; color: var(--lime-hi);
  text-shadow: 0 0 10px rgba(73, 208, 10, 0.35);
}
.scada-meta span { color: #9fd3dc; font-size: 12px; }
.scada-flow {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 18px 1fr 18px 1.2fr 18px .85fr 18px .7fr;
  gap: 6px;
  align-items: stretch;
  min-height: 0;
}
.scada-op {
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
  padding: 8px 8px 10px;
  background: linear-gradient(180deg, rgba(8, 58, 92, 0.7), rgba(0, 20, 40, 0.72));
  border: 1px solid rgba(30, 200, 212, 0.28);
  border-radius: 8px;
}
.scada-op.offline { opacity: 0.62; }
.scada-op header {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 0 2px 6px;
  border-bottom: 1px dashed rgba(30, 200, 212, 0.28);
}
.scada-op header b {
  color: var(--cyan-hi); letter-spacing: 0.16em; font-size: 15px;
}
.scada-op header small { color: #8fb8c6; font-size: 11px; }
.scada-stations { display: flex; flex-direction: column; gap: 6px; }
.scada-cell {
  display: grid;
  grid-template-columns: 1fr 54px;
  grid-template-rows: auto 1fr;
  gap: 4px 8px;
  padding: 6px 7px;
  border-radius: 7px;
  border: 1px solid rgba(120, 160, 176, 0.28);
  background: linear-gradient(180deg, rgba(4, 28, 48, 0.88), rgba(2, 18, 32, 0.92));
  transition: border-color .35s, box-shadow .35s, background .35s;
}
.scada-head-cell { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 6px; }
.scada-head-cell b { color: #fff; font-size: 12px; letter-spacing: 0.08em; }
.scada-head-cell em { font-style: normal; color: #8fb8c6; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scada-kv { min-width: 0; }
.scada-serial, .scada-time, .scada-qr {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.scada-serial { font-size: 11px; color: #cfe8ee; }
.scada-qr { font-size: 11px; color: var(--lime-hi); }
.scada-qr em {
  font-style: normal; color: #8fb8c6; margin-right: 5px;
}
.scada-data {
  font-size: 11px; color: var(--cyan-soft);
  white-space: pre-line; line-height: 1.3; max-height: 2.8em; overflow: hidden;
}
.scada-data.warn { color: #ffcc66; }
.scada-time { font-size: 10px; color: #6f93a2; }
.scada-bay {
  grid-row: 2; grid-column: 2;
  position: relative; min-height: 52px;
  display: grid; place-items: center;
}
.scada-fixture {
  position: absolute; inset: 8px 4px 4px;
  border-radius: 4px;
  background:
    repeating-linear-gradient(90deg, #1a3344 0 6px, #152a38 6px 12px);
  animation: belt 1.2s linear infinite;
  opacity: 0.55;
  border: 1px solid rgba(30, 200, 212, 0.2);
}
.scada-puck {
  position: relative; z-index: 1;
  width: 46px; height: 28px;
  border-radius: 4px 4px 6px 6px;
  display: grid; place-items: center;
  font-size: 9px; font-weight: 800; color: #062400;
  background: linear-gradient(180deg, #d7e3ea, #8aa0ad);
  border: 1px solid #4d6673;
  box-shadow: 0 4px 0 #1a2c36, 0 0 0 1px rgba(255,255,255,0.12) inset;
  transition: transform .4s ease, background .3s, color .3s, box-shadow .3s, opacity .3s;
}
.scada-puck span { max-width: 42px; overflow: hidden; text-overflow: ellipsis; }
.scada-puck.is-empty { opacity: 0.28; transform: scale(0.86); }
.scada-puck.is-busy {
  color: #062400;
  background: linear-gradient(180deg, var(--lime-hi), var(--lime) 55%, var(--lime-lo));
  border-color: #2f9a08;
  box-shadow: 0 4px 0 #145806, 0 0 12px rgba(73, 208, 10, 0.55);
  animation: pulse 1.6s ease-in-out infinite;
}
.scada-puck.pop { animation: popin .55s ease; }
.scada-cell.busy {
  border-color: rgba(73, 208, 10, 0.7);
  box-shadow: 0 0 14px rgba(73, 208, 10, 0.22), inset 0 0 0 1px rgba(73, 208, 10, 0.18);
}
.scada-cell.ng {
  border-color: rgba(255, 90, 106, 0.8);
  box-shadow: 0 0 14px rgba(255, 90, 106, 0.28);
}
.scada-cell.ng .scada-puck.is-busy,
.scada-cell.done-ng .scada-puck:not(.is-empty) {
  color: #fff;
  background: linear-gradient(180deg, #ff8a96, #e04050);
  border-color: #a02030;
  box-shadow: 0 4px 0 #6a1020, 0 0 12px rgba(255, 90, 106, 0.5);
}
.scada-cell.done-ok {
  border-color: rgba(30, 200, 212, 0.45);
}
.scada-cell.done-ok .scada-puck:not(.is-empty) {
  color: #002147;
  background: linear-gradient(180deg, #b8eef2, #1ec8d4);
  border-color: #128a96;
  box-shadow: 0 4px 0 #0a5460;
}
.scada-cell.idle .scada-fixture { animation-play-state: paused; opacity: 0.28; }
.scada-cell.warn {
  border-color: rgba(255, 176, 64, 0.85);
  box-shadow: 0 0 14px rgba(255, 176, 64, 0.28), inset 0 0 0 1px rgba(255, 176, 64, 0.18);
}
.scada-join {
  display: flex; align-items: center; justify-content: center;
}
.scada-join span {
  width: 0; height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 10px solid var(--cyan);
  filter: drop-shadow(0 0 6px rgba(30, 200, 212, 0.8));
  animation: blink 1.4s ease-in-out infinite;
}
.scada-legend {
  display: flex; gap: 14px; align-items: center;
  font-size: 12px; color: #9fd3dc; padding-top: 4px;
}
.scada-legend i {
  width: 12px; height: 12px; border-radius: 3px; display: inline-block;
  margin-right: 4px; vertical-align: -1px;
}
.scada-legend i.busy { background: var(--lime); box-shadow: 0 0 8px var(--lime); }
.scada-legend i.ok { background: var(--cyan); }
.scada-legend i.ng { background: var(--ng); }
.scada-legend i.idle { background: #4d6673; }
.scada-legend i.warn { background: #ffb040; box-shadow: 0 0 8px rgba(255, 176, 64, 0.7); }
.scada-msws {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  z-index: 2; display: flex; gap: 3px; pointer-events: none;
}
.scada-msws .msw {
  width: 14px; height: 8px; padding: 0; border-radius: 8px; display: block;
  border: 1px solid rgba(180, 210, 220, 0.4); background: #3a5360;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28); pointer-events: auto;
}
.scada-msws .msw.on {
  background: linear-gradient(180deg, #9af04a, #49d00a);
  border-color: #2f9a08; box-shadow: 0 0 6px rgba(73, 208, 10, 0.75); opacity: 1;
}
.scada-msws .msw.off { opacity: 0.42; background: #4d6673; }
.metric-card { position: relative; }
.metric-pick { position: absolute; top: 8px; right: 8px; }
.metric-pick input { width: 16px; height: 16px; }
.cfg-edit-table tr.selected td, .iface-table tr.selected td { background: rgba(30, 200, 212, 0.12); }
.metric-switch-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(520px, 1fr));
  gap: 8px 12px; margin-top: 10px;
}
.metric-card {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 10px;
  padding: 8px 10px; border: 1px solid #d5e4ea; border-radius: 6px; background: #fff;
}
.metric-on {
  display: flex; align-items: center; gap: 8px; flex: 1 1 180px;
  font-size: 13px; color: var(--ink);
}
.metric-on input { width: 16px; height: 16px; }
.metric-on small { color: var(--muted); font-size: 11px; }
.metric-th {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  margin-left: auto; color: var(--muted); font-size: 12px;
}
.metric-th .th-fn {
  display: inline-flex; align-items: center; gap: 6px;
}
.metric-th .th-fn > span { color: var(--ink); }
.metric-th input[type="checkbox"] { width: 15px; height: 15px; }
.metric-th input[type="number"] {
  width: 76px; height: 28px; padding: 0 6px;
  border: 1px solid #c5d6de; border-radius: 4px;
}
.metric-th em { font-style: normal; min-width: 1.6em; color: var(--navy); font-size: 12px; }
.metric-card.is-off .metric-th { opacity: 0.45; }
.th-fn.is-off input[type="number"] { opacity: 0.5; }
.alert-reason-tag.ooc {
  color: #6a1020; background: #fde2e6; border-color: #e09098;
}
.alert-reason-tag.limit {
  color: #7a3b00; background: #ffe8c6; border-color: #e0b56a;
}
.scada-over, .scada-alerts, .scada-cycle {
  margin-top: 14px;
  padding: 14px 16px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 33, 71, 0.12);
  background: linear-gradient(180deg, #fff, #f3f8fa);
  box-shadow: 0 6px 14px rgba(0, 33, 71, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.scada-over .page-report, .scada-alerts .page-report, .scada-cycle .page-report { margin-bottom: 8px; }
.scada-over .card-h h3, .scada-alerts .card-h h3, .scada-cycle .card-h h3 { color: var(--navy); margin: 0; font-size: 16px; }
.scada-over .hint, .scada-alerts .hint, .scada-cycle .hint { color: var(--muted); margin: 0 0 10px; }
.scada-over .card-h .hint, .scada-alerts .card-h .hint, .scada-cycle .card-h .hint { margin: 0; flex: 1; font-size: 12px; }
.scada-over .kpis, .scada-cycle .kpis { margin-bottom: 10px; }
#over-kpis, #cycle-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
#over-kpis .kpi strong, #cycle-kpis .kpi strong { font-size: 22px; }
#over-summary-chart { width: 100%; display: block; margin-bottom: 10px; background: #fff; border: 1px solid #d5e4ea; border-radius: 8px; }
.scada-cycle .cycle-charts { margin: 0 0 10px; }
.scada-cycle .cycle-charts .card { margin: 0; }
.scada-cycle .cycle-charts canvas { width: 100%; display: block; background: #fff; border: 1px solid #d5e4ea; border-radius: 8px; }
.scada-cycle .cycle-table-card { margin: 0; }
.scada-cycle .table-wrap {
  margin-top: 0;
  max-height: 320px;
  border-radius: 6px;
  border: 1px solid #9bb8c4;
  background: #fff;
}
.scada-cycle table { width: 100%; color: var(--ink); font-size: 12px; }
.scada-cycle thead th {
  background: #013056;
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-align: center;
  border-bottom: 2px solid #1ec8d4;
}
.scada-cycle th, .scada-cycle td { padding: 6px 9px; text-align: center; }
.scada-cycle td { border-bottom: 1px solid #e2eef2; }
.scada-cycle tr.on td { background: #fff4e8; }
.scada-cycle td.cycle-name { text-align: left; font-weight: 600; }
#over-charts { display: grid; gap: 10px; }
#over-charts .q-metric { margin: 0; }
.q-basis-table tr.over td { background: #fff1f1; }
.q-basis-table tr.over .q-val { color: #c01828; }
.over-only-off tr.over td { background: #fff1f1; }
@media (max-width: 1400px) {
  #over-kpis, #cycle-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #dash-kpis, .kpi-8 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.scada-alerts .report-actions { color: var(--muted); flex-wrap: wrap; }
.scada-alerts #alert-info { font-size: 12px; color: var(--muted); }
.scada-alerts .table-wrap {
  margin-top: 0;
  max-height: 360px;
  border-radius: 6px;
  border: 1px solid #9bb8c4;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(184, 238, 242, 0.45);
}
.scada-alerts thead th {
  background: #013056;
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-align: center;
  border-bottom: 2px solid #1ec8d4;
}
.scada-alerts table { width: 100%; color: var(--ink); font-size: 12px; table-layout: fixed; }
.scada-alerts th, .scada-alerts td { padding: 6px 9px; }
.scada-alerts th { color: #fff; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scada-alerts td { border-bottom: 1px solid #e2eef2; vertical-align: top; overflow: hidden; color: var(--ink); }
.scada-alerts .col-time { width: 124px; }
.scada-alerts .col-st { width: 118px; }
.scada-alerts .col-prod { width: 12%; }
.scada-alerts .col-c1 { width: 15%; }
.scada-alerts .col-c2 { width: 17%; }
.scada-alerts .col-val { width: 64px; }
.scada-alerts .col-reason { width: 120px; }
.scada-alerts .col-act { width: 92px; }
.scada-alerts .col-msg { width: auto; }
.scada-alerts td.alert-st,
.scada-alerts td.alert-prod { white-space: normal; word-break: break-word; }
.scada-alerts td.alert-code {
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 11px;
  word-break: break-all;
  white-space: normal;
}
.scada-alerts td.alert-msg { white-space: normal; }
.scada-alerts td.alert-act { text-align: center; vertical-align: middle; }
.scada-alerts td.alert-act .btn { margin: 2px 0; }
.scada-alerts td.alert-reason-cell { white-space: normal; overflow: hidden; }
.scada-alerts .alert-reason-tag { max-width: 100%; }
.scada-alerts tr.alert-row-jump td { background: #fff8e4; }
.scada-alerts tr.alert-row-drift td { background: #fff0f2; }
.scada-alerts tr.alert-row-both td { background: #ffe8d6; }
.alert-reason-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
  max-width: 230px;
}
.alert-reason-tag.jump {
  background: #fff4d6;
  color: #8a5a00;
  border-color: #e0c070;
}
.alert-reason-tag.drift {
  background: #ffe0e4;
  color: #a00020;
  border-color: #e09098;
}
.alert-reason-tag.both {
  background: #ffe4cc;
  color: #9a3a00;
  border-color: #f0a060;
  box-shadow: 0 0 0 1px rgba(240, 160, 96, 0.35);
}
.alert-reason-tag.other {
  background: #e8f4f8;
  color: #02456f;
  border-color: #9bb8c4;
}
#alert-reason.alert-reason-tag { max-width: none; margin: 8px 0 0; }
#alert-modal { z-index: 200; }
.alert-sheet h3 { color: #b42318; }
.alert-dl {
  display: grid; grid-template-columns: 72px 1fr; gap: 6px 10px;
  margin: 12px 0 0; font-size: 13px;
}
.alert-dl dt { color: var(--muted); }
.alert-dl dd { margin: 0; color: var(--ink); word-break: break-all; }
.alert-content {
  margin: 12px 0 0; padding: 10px 12px;
  background: #fff6e8; border: 1px solid #f0c889; color: #5a3a00;
  font-size: 13px; line-height: 1.5;
}
.scada-fly {
  position: absolute; z-index: 20; pointer-events: none;
  min-width: 56px; height: 28px; padding: 0 8px;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 800; color: #062400;
  background: linear-gradient(180deg, var(--lime-hi), var(--lime));
  border: 1px solid #2f9a08; border-radius: 6px;
  box-shadow: 0 8px 16px rgba(0,0,0,.35), 0 0 12px rgba(73,208,10,.45);
  transition: left .8s cubic-bezier(.2,.8,.2,1), top .8s cubic-bezier(.2,.8,.2,1), opacity .8s;
  opacity: 0.95;
}
.scada-fly.go { opacity: 0.15; }
@keyframes belt {
  from { background-position: 0 0; }
  to { background-position: 12px 0; }
}
@keyframes pulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
@keyframes popin {
  0% { transform: scale(0.4); opacity: 0; }
  70% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
@keyframes blink {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.field-grid, .edit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.field-item, .edit-grid label {
  background: #fff; border: 1px solid #c3d5dc; padding: 8px 10px;
}
.field-item .lbl, .edit-grid label span { color: var(--muted); font-size: 12px; }
.field-item .val { margin-top: 6px; white-space: pre-wrap; word-break: break-all; }
.edit-grid label { display: flex; flex-direction: column; gap: 6px; }
.edit-grid label.wide { grid-column: 1 / -1; }
.q-range { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.q-range label { display: flex; flex-direction: column; gap: 4px; margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.q-range input { height: 28px; }
#q-recent-n { width: 88px; }
.q-range input[type="datetime-local"] { width: 188px; }
.q-class select { height: 28px; min-width: 108px; flex: 1; }
.q-metric { overflow: visible; }
.q-metric:has(.q-method-pop[open]) { z-index: 6; }
.q-method-pop { position: relative; flex: 0 0 auto; margin-left: auto; }
.q-method-pop > summary {
  list-style: none;
  cursor: pointer;
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid rgba(1, 48, 86, 0.18);
  background: #fff;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
}
.q-method-pop > summary::-webkit-details-marker { display: none; }
.q-method-pop[open] > summary { background: #e7f4f6; }
.q-method-pop:not([open]) > .q-curve-method { display: none; }
.q-curve-method {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 8;
  width: min(420px, 72vw);
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(1, 48, 86, 0.16);
  background: #fff;
  box-shadow: 0 12px 28px rgba(1, 48, 86, 0.16);
  max-height: min(70vh, 520px);
  overflow: auto;
}
.q-curve-method .edit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.q-curve-method .btn-label { justify-content: flex-end; }
.q-method-sec { margin: 0 0 8px; padding-bottom: 8px; border-bottom: 1px solid rgba(1, 48, 86, 0.08); }
.q-method-sec h4 { margin: 0 0 2px; font-size: 12px; letter-spacing: 0.06em; color: var(--navy); }
.q-method-sec .hint { margin: 0 0 6px; font-size: 11px; line-height: 1.4; }
.q-curve-method > .btn { margin-top: 2px; }
.edit-section { margin: 8px 0 16px; }
.edit-section h4 { margin: 0 0 10px; font-size: 12px; color: var(--navy); font-weight: 700; }
.edit-grid.full { grid-template-columns: 1fr; }
.edit-grid textarea { min-height: 90px; resize: vertical; }
.entry-form .edit-grid textarea { min-height: 64px; }
.entry-form { margin-top: 8px; }
.entry-scan { margin-top: 4px; }
.entry-scan .edit-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.entry-scan .hint { margin: 10px 0 0; }
.entry-scan-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.entry-scan-auto {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 0; padding: 0; border: 0; background: transparent;
  font-size: 13px; color: var(--navy); cursor: pointer; user-select: none;
}
.entry-scan-auto input { width: 16px; height: 16px; margin: 0; accent-color: var(--gold, #c9a12a); }
#entry-save-modal.entry-save-overlay {
  z-index: 90;
  cursor: pointer;
  background: rgba(0, 10, 24, 0.62);
  backdrop-filter: blur(6px);
}
.entry-save-card {
  position: relative;
  width: min(360px, 88vw);
  padding: 26px 28px 22px;
  overflow: hidden;
  text-align: center;
  cursor: pointer;
  color: #e8f4f8;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(30, 200, 212, 0.28), transparent 58%),
    linear-gradient(180deg, #02456f 0%, #013056 42%, #002147 100%);
  border: 1px solid rgba(184, 238, 242, 0.35);
  border-radius: 22px;
  box-shadow:
    0 0 0 1px rgba(0, 21, 45, 0.4),
    0 28px 70px rgba(0, 8, 20, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.entry-save-bar {
  position: absolute;
  left: 28px;
  right: 28px;
  top: 0;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, transparent, #c9a12a 18%, var(--cyan) 50%, #c9a12a 82%, transparent);
}
.entry-save-kicker {
  margin: 4px 0 0;
  font-size: 12px;
  letter-spacing: 0.42em;
  color: var(--cyan-hi);
  font-weight: 700;
}
.entry-save-ring {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 14px auto 4px;
}
.entry-save-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  filter: drop-shadow(0 0 8px rgba(30, 200, 212, 0.55));
}
.entry-save-track, .entry-save-arc { fill: none; stroke-width: 7; }
.entry-save-track { stroke: rgba(255, 255, 255, 0.12); }
.entry-save-arc {
  stroke: var(--cyan);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.95s linear;
}
.entry-save-num {
  position: absolute;
  inset: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, rgba(30, 200, 212, 0.16), rgba(0, 21, 45, 0.35) 72%);
  box-shadow: inset 0 0 0 1px rgba(184, 238, 242, 0.12);
}
.entry-save-num span {
  font-size: 64px;
  line-height: 0.9;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgba(30, 200, 212, 0.45);
}
.entry-save-num small {
  margin-top: 4px;
  font-size: 12px;
  letter-spacing: 0.35em;
  color: var(--cyan-soft);
}
.entry-save-msg {
  margin: 6px 0 0;
  min-height: 38px;
  color: #d5eef3;
  font-size: 13px;
  line-height: 1.55;
}
.entry-save-tip {
  margin: 14px 0 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: rgba(184, 238, 242, 0.78);
}
.process-table td { white-space: pre-wrap; vertical-align: top; }
.pdata { min-width: 260px; max-width: 480px; }
.product-card { margin-bottom: 10px; }
.product-card summary { cursor: pointer; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.product-card summary::-webkit-details-marker { display: none; }

.heatmap { overflow: auto; min-width: 0; }
.heat-split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.95fr); gap: 12px; align-items: stretch; }
.heat-charts {
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
  padding: 8px 10px 10px;
  background: linear-gradient(180deg, #f7fbfc, #eef5f8);
  border: 1px solid #d5e4ea;
  border-radius: 8px;
}
.heat-charts h4 { margin: 0 0 4px; font-size: 13px; color: var(--navy, #013056); }
.heat-charts canvas { width: 100%; max-width: 100%; }
.heat-head { align-items: baseline; flex-wrap: nowrap; }
.heat-head h3 { min-width: 0; }
#hour-target-note {
  min-width: 0; max-width: 58%;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.heat-caption { margin: 0 0 8px; }
.heat-grid {
  display: grid;
  grid-template-columns: 48px repeat(24, minmax(0, 1fr));
  gap: 2px;
  font-size: 10px;
  color: var(--muted);
  width: 100%;
  min-width: 0;
}
.heat-grid .heat-label { display: grid; place-items: center; font-weight: 700; overflow: hidden; }
.heat-grid .heat-night { color: #6aa0b4; }
.heat-cell.miss-target { box-shadow: inset 0 0 0 1px #ff5a6a; }
.heat-cell.miss-yield { box-shadow: inset 0 0 0 1px #c48a12; }
.heat-cell.heat-open { outline: 1px dashed #5a7380; outline-offset: -1px; }
.hour-target-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; margin-top: 8px; }
.hour-target-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.hour-target-grid input { width: 100%; }
@media (max-width: 1180px) {
  .heat-split { grid-template-columns: 1fr; }
  #hour-target-note { max-width: none; }
}
.heat-cell { width: auto; min-width: 0; aspect-ratio: 1; background: #dce8ec; position: relative; border-radius: 2px; }
.heat-cell.has-ng::after { content: ""; position: absolute; top: 1px; right: 1px; width: 4px; height: 4px; background: var(--ng); }
.tag-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tag-legend span { background: var(--input); border: 1px solid #c3d5dc; padding: 6px 10px; font-size: 12px; color: var(--muted); }
.bar {
  height: 10px; background: #dce8ec; border: 1px solid #9bb8c4;
  overflow: hidden; min-width: 80px; display: inline-block; vertical-align: middle;
}
.bar i {
  display: block; height: 100%;
  background: linear-gradient(180deg, var(--lime-hi), var(--lime) 46%, var(--lime-lo));
}

.dock {
  display: grid;
  grid-template-columns: 204px max-content 1fr auto;
  align-items: center;
  column-gap: 8px;
  padding: 6px 12px 7px 0;
  background: linear-gradient(180deg, #013056, #00182f);
  border-top: 1px solid rgba(30, 200, 212, 0.28);
}
.dock-init {
  height: 36px;
  margin: 0 12px 0 10px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 14px; color: #042428;
  background: linear-gradient(180deg, #7ee0ea, var(--cyan));
  border: 1px solid #128a96;
}
.dock-init.wait {
  background: linear-gradient(180deg, #7ee0ea, var(--cyan));
  border-color: #128a96;
  color: #042428;
}
.dock-init.ok {
  background: linear-gradient(180deg, var(--lime-hi), var(--lime));
  border-color: #2f9a08;
  color: #062400;
}
.dock-init.err {
  background: linear-gradient(180deg, #ff8a96, #e04040);
  border-color: #a02020;
  color: #fff;
}
.dock-states {
  display: flex; justify-content: flex-start; gap: 4px;
}
.dock-states span {
  width: 68px; height: 36px;
  display: grid; place-items: center;
  padding: 0;
  font-size: 13px; color: #b8eef2; font-weight: 800;
  letter-spacing: 0.02em;
  background:
    linear-gradient(180deg, rgba(184, 238, 242, 0.18), transparent 34%),
    linear-gradient(180deg, #08608a 0%, #02456f 48%, #013056 100%);
  border: 1px solid rgba(30, 200, 212, 0.46);
  box-shadow:
    inset 0 1px 0 rgba(184, 238, 242, 0.42),
    inset 0 -1px 0 rgba(0, 18, 36, 0.45),
    0 2px 6px rgba(0, 8, 20, 0.28);
  opacity: 1;
  filter: none;
  transition: background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.dock-states span.hot {
  background: linear-gradient(180deg, #fff3a0, #e6c200 46%, #c9aa3a);
  border-color: #c9aa3a;
  color: #1a1400;
  box-shadow: inset 0 1px 0 rgba(255, 255, 230, 0.7), 0 0 8px rgba(230, 194, 0, 0.35);
}
.dock-states span.live {
  background: linear-gradient(180deg, var(--lime-hi), var(--lime) 46%, var(--lime-lo));
  color: #062400; border-color: var(--lime);
  box-shadow: inset 0 1px 0 rgba(230, 255, 180, 0.7), 0 0 8px rgba(73, 208, 10, 0.28);
}
.dock-states span.warn {
  background: linear-gradient(180deg, #ffe08a, #e8b020 55%, #c99210);
  border-color: #c99212;
  color: #2a1a00;
  box-shadow: inset 0 1px 0 rgba(255, 244, 200, 0.7), 0 0 12px rgba(232, 176, 32, 0.55);
}
.dock-states span.alarm {
  background: linear-gradient(180deg, #ff6a78, #e04040 55%, #b02020);
  color: #fff; border-color: #a02020;
  box-shadow: inset 0 1px 0 rgba(255, 200, 200, 0.35), 0 0 12px rgba(224, 64, 64, 0.55);
}
.dock-data { display: none; }
.ng-cause-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}
.ng-cause-tag.process { background: #fff4d6; color: #8a5a00; border-color: #e0c070; }
.ng-cause-tag.overrun { background: #ffe0e4; color: #a00020; border-color: #e09098; }
.ng-cause-tag.param { background: #e8f4f8; color: #02456f; border-color: #9bb8c4; }
.ng-cause-tag.operate { background: #eef6e4; color: #2f6a08; border-color: #8ed08e; }
.ng-cause-tag.cred { background: #fff4d6; color: #8a5a00; border-color: #e0c070; }
.ng-cause-tag.proc { background: #efe8ff; color: #4a2d8a; border-color: #b8a6e0; }
.ng-cause-tag.flow { background: #e8f4f8; color: #02456f; border-color: #9bb8c4; }
.ng-cause-tag.cycle { background: #e8eef8; color: #1d3f8a; border-color: #9aaed4; }
.ng-cause-tag.tamper { background: #ffe0e4; color: #a00020; border-color: #e09098; }
.ng-cause-tag.ok { background: #eef4f0; color: #3d5a4c; border-color: #b7cfc0; }
.poss-grid { align-items: stretch; }
.poss-list { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow: auto; padding-right: 2px; }
.poss-row {
  display: grid;
  grid-template-columns: 88px 1fr 52px;
  gap: 8px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 1px solid #c5d6de;
  background: #f7fbfc;
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.poss-row:hover, .poss-row.on { border-color: #2b6cb0; background: #eef6fb; }
.poss-row b { font-size: 12px; }
.poss-row em { font-style: normal; font-size: 11px; color: var(--muted); grid-column: 1 / -1; }
.poss-row .poss-bar { height: 8px; background: #dce8ee; border-radius: 99px; overflow: hidden; }
.poss-row .poss-bar i { display: block; height: 100%; background: #2b6cb0; }
.poss-row .poss-pct { font-weight: 700; font-size: 12px; text-align: right; }
.kpi[data-ngcause], .kpi[data-skind], .kpi[data-qid] { cursor: pointer; }
.kpi.on { outline: 2px solid #2b6cb0; }
.q-metric.on { outline: 2px solid #2b6cb0; }
.cause-mix { display: flex; gap: 2px; height: 8px; margin-top: 4px; border-radius: 99px; overflow: hidden; background: #e4eef2; }
.cause-mix i { display: block; height: 100%; min-width: 0; }
.cause-mix i.process { background: #e8b020; }
.cause-mix i.overrun { background: #ff5a6a; }
.cause-mix i.param { background: #2b6cb0; }
.cause-mix i.operate { background: #49a050; }
.suspect-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
  align-items: start;
  margin: 8px 0 12px;
}
.suspect-form label.wide { grid-column: 1 / -1; }
.suspect-form textarea {
  min-height: 52px;
  resize: vertical;
  background: #fff;
  border: 1px solid #b7cdd6;
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--ink);
}
.suspect-period {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
}
.suspect-keys { grid-column: 1 / -1; }
.s-key-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 8px;
  margin-top: 6px;
  align-items: center;
}
.s-key-row select, .s-key-row input {
  background: #fff;
  border: 1px solid #b7cdd6;
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--ink);
}
.suspect-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.suspect-form input {
  background: #fff;
  border: 1px solid #b7cdd6;
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--ink);
}
.suspect-form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.suspect-one { margin: 0 0 10px; }
#tbl-suspect tr.pick td { background: rgba(30, 200, 212, 0.14); }
.ng-clue {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 600;
  color: #334;
  line-height: 1.35;
  word-break: break-word;
}
.q-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.q-metric .q-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 12px;
  color: var(--muted);
}
.q-metric canvas { width: 100%; }
.q-hist { margin-top: 6px; }
.q-methods {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 10px;
}
.q-method {
  border: 1px solid rgba(1, 48, 86, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
  background: linear-gradient(180deg, #f4fafb, #eef6f8);
}
.q-method h4 {
  margin: 0 0 2px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--navy);
}
.q-method strong {
  display: block;
  font-size: 15px;
  line-height: 1.3;
}
.q-method p {
  margin: 4px 0 0;
  font-size: 11px;
  color: #3a5a6a;
}
.q-method small {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  color: #6a808c;
  line-height: 1.35;
}
.q-method.g-ok strong { color: #128a12; }
.q-method.g-warn strong { color: #9a6b00; }
.q-method.g-bad strong { color: #c01828; }
.q-method.g-mute strong { color: #5a7380; }
.q-basis {
  margin-top: 8px;
}
.q-basis summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.q-basis summary .btn { flex: 0 0 auto; }
.q-basis summary .report-actions { margin-left: auto; }
.q-basis .table-wrap {
  max-height: 280px;
  border-radius: 6px;
  border: 1px solid #9bb8c4;
  box-shadow: inset 0 1px 0 rgba(184, 238, 242, 0.45);
}
.q-basis-table {
  table-layout: fixed;
  font-size: 12px;
}
.q-basis-table col.col-no { width: 52px; }
.q-basis-table col.col-time { width: 148px; }
.q-basis-table col.col-part { width: 96px; }
.q-basis-table col.col-c1 { width: 168px; }
.q-basis-table col.col-c2 { width: 210px; }
.q-basis-table col.col-val { width: 92px; }
.q-basis-table th,
.q-basis-table td {
  padding: 6px 9px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.q-basis thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #013056;
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-align: center;
  border-bottom: 2px solid #1ec8d4;
}
.q-basis .q-no {
  text-align: center;
  color: #5a7380;
}
.q-basis .q-time { color: #5a7380; }
.q-basis .q-part {
  font-weight: 700;
  color: #02456f;
}
.q-basis .q-code {
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 11px;
}
.q-basis .q-val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: #013056;
}
.dock-data label {
  display: flex; align-items: center; gap: 4px; white-space: nowrap;
}
.dock-data input {
  width: 148px; height: 28px;
  background: rgba(255, 255, 255, 0.92); border: 1px solid #9bb8c4;
  border-radius: 6px;
  padding: 2px 6px; color: var(--navy); font-weight: 700;
}
.dock-states span { cursor: default; }
.dock-states span#st-auto { cursor: pointer; user-select: none; width: 72px; }
.edit-grid label.cfg-check {
  flex-direction: row; align-items: center; gap: 10px;
}
.edit-grid label.cfg-check span { min-width: 96px; }
.edit-grid label.cfg-check input { width: 18px; height: 18px; }
.edit-grid label.cfg-scan-lab .btn { width: fit-content; }
.cfg-scan-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.cfg-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.cfg-sec-head h3 { margin: 0; }
.cfg-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cfg-filter { height: 28px; min-width: 72px; }
.cfg-def-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr);
  gap: 16px;
  margin-top: 12px;
}
.cfg-def-pane { min-width: 0; }
.cfg-def-pane h4 { margin: 0; font-size: 14px; }
.cfg-def-pane .cfg-sec-head { margin-bottom: 8px; }
.cfg-run-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.9fr);
  gap: 10px;
  margin-top: 10px;
  align-items: start;
}
.cfg-run-grid > .card { margin-top: 0; }
.cfg-inline { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cfg-inline input { flex: 1 1 72px; min-width: 0; width: auto; }
.edit-grid .cfg-inline input { width: auto; }
.cfg-inline .btn { flex: 0 0 auto; }
#page-iface .cfg-metric-table { min-width: 720px; }
@media (max-width: 1100px) {
  .cfg-def-grid, .cfg-run-grid { grid-template-columns: minmax(0, 1fr); }
}
.line-file-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.line-file-check { display: flex; align-items: center; gap: 8px; }
.line-file-check input { width: 16px; height: 16px; }
.line-file-check em { font-style: normal; font-size: 12px; opacity: .72; }
.cfg-line-grid { grid-template-columns: minmax(240px, 1.2fr) minmax(200px, 1fr); max-width: 720px; }
#page-iface { min-width: 0; overflow: hidden; }
#page-iface .card { min-width: 0; overflow: hidden; }
#page-iface .cfg-table-wrap {
  max-width: 100%;
  overflow: auto;
}
#page-iface .iface-table,
#page-iface .cfg-edit-table {
  width: 100%;
  min-width: 640px;
  table-layout: fixed;
}
#page-iface .col-pick { width: 36px; }
#page-iface .col-src { width: 64px; }
#page-iface .col-act { width: 64px; }
.iface-table tr.iface-row { cursor: pointer; }
.iface-table tr.iface-row.selected { background: rgba(32, 108, 176, 0.08); }
.iface-table tr.iface-row.locked { cursor: default; }
.iface-table .iface-pick,
.cfg-edit-table .iface-pick { width: 36px; text-align: center; }
.iface-table .iface-pick input,
.cfg-edit-table .iface-pick input { width: 16px; height: 16px; margin: 0; }
.cfg-edit-table tr.selected { background: rgba(32, 108, 176, 0.08); }
.cfg-edit-table tr.candidate { background: rgba(232, 176, 32, 0.12); }
.cfg-edit-table td,
.iface-table td { overflow: hidden; vertical-align: middle; }
.cfg-edit-table td input,
#tbl-cfg-if select,
#tbl-cfg-if input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid #c3d5dc;
  border-radius: 6px;
  background: #fff;
}
.cfg-edit-table .src-tag,
.iface-table .hint {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cfg-edit-table .src-tag { font-size: 11px; color: var(--muted); }
.cfg-edit-table .src-tag.cand { color: #b45309; font-weight: 700; }
.iface-table .btn-if-scan { white-space: nowrap; padding: 4px 8px; max-width: 100%; }
#tbl-cfg-if .if-ok { color: #1f7a08; font-weight: 700; }
#tbl-cfg-if .if-off { color: #b42318; font-weight: 700; }
.auto { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--cyan-soft); white-space: nowrap; }
.leds { display: flex; gap: 6px; justify-content: flex-end; }
.leds i {
  font-style: normal; font-size: 10px; color: var(--cyan-soft); text-align: center;
  width: auto; min-width: 42px; padding: 2px 4px 16px; position: relative; letter-spacing: 0; font-weight: 700;
}
.leds i::after {
  content: ""; position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%);
  width: 12px; height: 12px; border-radius: 50%;
  background: #3a5560; box-shadow: inset 0 1px 2px rgba(0,0,0,0.45), 0 0 0 1px #1a3340;
}
.leds i.on::after { background: var(--lime); box-shadow: 0 0 8px var(--lime), inset 0 1px 1px #fff; }
.leds i.off::after { background: #3a5560; }
.leds i.err::after { background: #ff2020; box-shadow: 0 0 6px #ff2020; }
.leds i.err.off::after { background: #ff2020; box-shadow: 0 0 6px #ff2020; }

.user-manage-sheet { width: min(1080px, calc(100vw - 48px)); max-height: calc(100vh - 48px); overflow: auto; }
.um-domains { display: flex; flex-wrap: wrap; gap: 12px 18px; margin: 10px 0; align-items: center; }
.um-domains label { display: flex; gap: 6px; align-items: center; }
.login-sheet {
  width: 360px;
  background: linear-gradient(180deg, #06345c, #002147);
  color: #fff;
  border: 1px solid rgba(30, 200, 212, 0.45);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(73, 208, 10, 0.12);
  padding: 18px 24px 20px;
}
.login-sheet h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  display: flex; align-items: center; gap: 8px;
  color: #fff;
}
.login-sub {
  margin: 0 0 16px;
  color: var(--cyan-soft);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.login-chip {
  width: 18px; height: 18px; display: inline-block; position: relative;
  background: var(--lime); border-radius: 50%;
}
.login-chip::before {
  content: ""; position: absolute; left: 5px; top: 3px;
  width: 8px; height: 8px; border-radius: 50%; background: #002147;
}
.login-chip::after {
  content: ""; position: absolute; left: 3px; bottom: 1px;
  width: 12px; height: 7px; border-radius: 6px 6px 0 0; background: #002147;
}
.login-sheet label {
  display: block; font-size: 13px; margin-bottom: 10px; color: var(--cyan-hi);
}
.login-sheet input {
  display: block; width: 100%; margin-top: 4px;
  height: 30px; border: 1px solid #9bb8c4; background: #fff; color: var(--ink);
  padding: 2px 8px;
}
.login-systems { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.login-systems.hidden { display: none; }
.login-systems .hint { color: #d7deea; }
.login-systems .btn { width: 100%; }
.cfg-access-table { min-width: 1080px; }
.cfg-access-table select, .cfg-access-table input[type="text"] { width: 100%; min-width: 88px; }
body.access-read .stage .btn.gold,
body.access-read .stage .btn.danger,
body.access-read .stage-main button.is-locked,
body.access-read .stage-main [data-write-lock="1"] { pointer-events: none; opacity: 0.45; }
.login-actions { display: flex; gap: 8px; align-items: center; }
.login-actions #btn-login-submit {
  flex: 1; justify-content: center; height: 34px;
  background: linear-gradient(180deg, var(--lime-hi), var(--lime) 48%, var(--lime-lo));
  color: #062400; border-color: #2f9a08;
}
.btn-user-gear {
  width: 34px; height: 34px; padding: 0;
  border: 1px solid rgba(30, 200, 212, 0.4);
  background: linear-gradient(180deg, #0a4a72, #023456);
  font-size: 16px; color: #e8f4f8;
}
.login-extra { display: flex; gap: 8px; margin-top: 10px; }
.login-sheet .hint { margin: 8px 0 0; color: #ffb0b8; min-height: 16px; }

.overlay {
  position: fixed; inset: 0; background: rgba(0, 21, 45, 0.62);
  display: grid; place-items: center; z-index: 40; padding: 24px;
}
.overlay.hidden { display: none !important; pointer-events: none !important; }
#login-modal, #user-modal { z-index: 120; }
.sheet {
  width: min(1080px, 96vw); max-height: 90vh; overflow: auto;
  background: var(--paper); border: 1px solid rgba(30, 200, 212, 0.35); padding: 18px 20px; color: var(--ink);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.sheet.wide { width: min(1180px, 96vw); }
.sheet.slim { width: min(460px, 92vw); }
.sticky-actions { position: sticky; bottom: 0; padding-top: 12px; margin-top: 16px; background: var(--paper); }

#toast-host {
  position: fixed; right: 22px; bottom: 64px; z-index: 80;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  min-width: 240px; max-width: 380px;
  background: #013056; border: 1px solid var(--cyan); padding: 11px 14px; font-size: 13px; color: #fff;
}
.toast.ok { border-color: var(--lime); }
.toast.err { border-color: var(--ng); color: #ffd0d4; }

.loading {
  position: fixed; inset: 0; z-index: 70;
  display: none; place-items: center; gap: 10px;
  background: rgba(0, 33, 71, 0.55); color: #fff; font-size: 13px;
  pointer-events: none;
}
.loading:not(.hidden) { display: grid; }
.spinner {
  width: 220px; height: 14px; border: 1px solid rgba(255,255,255,0.75);
  background: #1a2834; position: relative; overflow: hidden;
}
.spinner::after {
  content: ""; position: absolute; inset: 1px auto 1px 1px; width: 40%;
  background: linear-gradient(180deg, var(--lime-hi), var(--lime) 46%, var(--lime-lo));
  animation: loadbar 1s linear infinite;
}
@keyframes loadbar { from { left: -40%; } to { left: 100%; } }

.empty { text-align: center; color: var(--muted); padding: 36px 12px; }
.empty b { display: block; color: var(--navy); margin-bottom: 6px; }

html.embed #splash { display: none !important; pointer-events: none !important; }
html.embed #web-login { display: none !important; pointer-events: none !important; }
html.web-gate .app { visibility: hidden; }
html.web-gate #web-login,
html.web-gate #web-login.hidden {
  display: grid !important;
  pointer-events: auto !important;
}
.web-login {
  position: fixed; inset: 0; z-index: 90;
  background:
    radial-gradient(880px 360px at 50% 0%, rgba(30, 200, 212, 0.16), transparent 62%),
    linear-gradient(180deg, #013056 0%, #001526 100%);
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: auto;
}
.web-login.hidden { display: none !important; pointer-events: none !important; }
.web-login-stage {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100dvh - 32px);
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(16px, 3vh, 36px) clamp(16px, 3vw, 36px) 48px;
  box-sizing: border-box;
  overflow: auto;
  background: linear-gradient(180deg, rgba(1, 48, 86, 0.96), #002147 42%);
  border: 1px solid rgba(30, 200, 212, 0.38);
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  color: #fff;
}
.web-login-stage h1 {
  width: 100%;
  margin: 0;
  text-align: center;
  color: #fff;
  font-size: 36px;
  font-weight: 600;
  letter-spacing: 2px;
  line-height: 1.25;
}
.web-login-stage h1 span {
  display: inline;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #fff;
}
.web-login-stage h1 .ver {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
  margin-left: 10px;
  color: #b6f36a;
}
.web-login-stage h1 .en {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  color: #c5cdd3;
}
.web-login-sub {
  margin: 14px 0 0;
  max-width: 460px;
  color: #d5eef2;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}
.biz-pick {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: min(440px, 100%);
  margin: 8px auto 4px;
}
.biz {
  min-width: 76px;
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 21px;
  color: #fff;
  font: inherit;
  font-weight: 700;
  letter-spacing: .08em;
  cursor: pointer;
  background: #1a6ea8;
}
.biz[data-system="production"] { background: #0a7a8a; }
.biz[data-system="quality"] { background: #2f9a08; }
.biz[data-system="equipment"] { background: #1a5fd0; }
.biz[data-system="engineering"] { background: #6a56b0; }
.biz[data-system="plan"] { background: #b86a12; }
.biz.on { outline: 3px solid #fff; outline-offset: 2px; }
.biz:disabled, .biz.off { opacity: .35; cursor: default; }
.clover {
  position: relative;
  width: 320px;
  height: 320px;
  margin: 18px 0 6px;
}
.leaf {
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  display: grid;
  place-items: center;
  text-align: center;
  line-height: 1.25;
}
.leaf-n { left: 85px; top: 0; padding-bottom: 36px; background: radial-gradient(circle at 50% 32%, #9aef62, #2f9a08 74%); }
.leaf-w { left: 0; top: 85px; padding-right: 28px; background: radial-gradient(circle at 32% 50%, #6ee4ee, #0a7a8a 74%); }
.leaf-e { right: 0; top: 85px; padding-left: 28px; background: radial-gradient(circle at 68% 50%, #8cbcf4, #1a5fd0 74%); }
.leaf-s { left: 85px; bottom: 0; padding-top: 36px; background: radial-gradient(circle at 50% 68%, #e4d4ff, #6a56b0 74%); }
.leaf-core {
  left: 50%; top: 50%;
  width: 112px; height: 112px;
  transform: translate(-50%, -50%);
  z-index: 5;
  padding: 0 6px;
  font-size: 15px;
  letter-spacing: 0.04em;
  line-height: 1.15;
  color: #1a1400;
  background: radial-gradient(circle at 40% 34%, #ffe7a0, #e2aa22 58%, #a07810);
  border: 3px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}
.leaf:hover:not(.off):not(:disabled):not(.leaf-core) { filter: brightness(1.06); }
.leaf.on { box-shadow: 0 0 0 3px #fff, 0 0 16px rgba(255, 255, 255, 0.35); z-index: 4; }
.leaf-core.on { z-index: 6; }
.leaf.off { filter: grayscale(0.65); opacity: 0.4; cursor: not-allowed; }
.web-login-form { width: min(420px, 100%); display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.web-login-form label { font-size: 13px; color: #d7eef2; }
.web-login-form input {
  display: block; width: 100%; margin-top: 6px; height: 40px;
  border: 1px solid rgba(155, 184, 196, 0.85); border-radius: 6px;
  background: #f7fbfc; color: #102033; padding: 0 12px;
}
.web-login-form input:focus { outline: 2px solid #1ec8d4; border-color: #1ec8d4; }
.web-login-form .btn {
  height: 40px; margin-top: 4px; justify-content: center; border-radius: 6px;
  background: linear-gradient(180deg, #c8f56a, #49d00a 48%, #2f9a08);
  color: #062400; border: 1px solid #2f9a08; font-weight: 700; letter-spacing: 0.12em;
}
.web-login-form .hint { min-height: 18px; margin: 0; color: #ffb4bc; text-align: center; }
.web-login-copy {
  position: absolute; bottom: 16px; left: 0; right: 0;
  text-align: center; color: #9fb0b8; font-size: 12px;
}
@media (max-height: 900px), (max-width: 820px) {
  .web-login-stage h1 { font-size: 28px; }
  .web-login-stage h1 span { font-size: 18px; }
  .web-login-stage h1 .en { font-size: 12px; }
  .web-login-sub { margin-top: 8px; }
  .clover { transform: scale(0.72); transform-origin: center top; height: 236px; margin: 4px 0 0; }
  .web-login-form { margin-top: 8px; gap: 8px; }
}
@media (max-height: 700px) {
  .web-login-stage h1 .en { display: none; }
  .web-login-stage { padding-top: 12px; padding-bottom: 40px; }
  .clover { transform: scale(0.56); height: 188px; }
  .web-login-form input, .web-login-form .btn { height: 34px; }
}
@media (max-width: 640px) {
  .web-login-stage { padding: 16px 12px 44px; }
}
@media (max-width: 640px) and (min-height: 701px) {
  .clover { transform: scale(0.78); transform-origin: center top; height: 250px; margin: 8px 0 0; }
}
.splash {
  position: fixed; inset: 0; z-index: 100;
  background: #001526;
  display: grid; place-items: center;
  transition: opacity .35s ease;
}
.splash.hidden, .splash.hide { display: none !important; opacity: 0; pointer-events: none !important; }
.splash-stage {
  position: relative;
  width: min(920px, 92vw);
  height: min(520px, 86vh);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 56px 48px 72px;
  box-sizing: border-box;
  background: #002147;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
}
.splash-stage h1 {
  position: static;
  width: 100%;
  margin: 0 0 36px;
  text-align: center; color: #fff;
  font-size: 36px; font-weight: 600; letter-spacing: 2px;
}
.splash-stage h1 span { font-size: 24px; font-weight: 600; letter-spacing: 1px; }
.splash-icon { display: none; }
.splash-load {
  position: static;
  width: min(640px, 100%);
  text-align: center;
}
.splash-load .lbl { color: #c8d0d6; font-size: 14px; margin-bottom: 10px; }
.splash-row { display: flex; align-items: center; gap: 12px; }
.splash-track {
  flex: 1; height: 16px; background: #7a7a7a; border: 1px solid #fff;
  overflow: hidden;
}
.splash-fill {
  height: 100%; width: 0%;
  background: linear-gradient(180deg, #c8f56a 0%, #49d00a 42%, #2f9a08 100%);
  box-shadow: inset 0 4px 0 rgba(255,255,255,0.38), inset 0 -3px 0 rgba(0,0,0,0.18);
}
.splash-pct { width: 56px; color: #fff; font-size: 14px; font-variant-numeric: tabular-nums; }
.splash-status { margin-top: 10px; color: #1ec8d4; font-size: 14px; text-align: center; }
.splash-copy {
  position: absolute; bottom: 28px; left: 0; right: 0;
  text-align: center; color: #c5cdd3; font-size: 13px;
}

.pack-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; width: 100%; }
.pack-toolbar .prod-pick input, .pack-toolbar .prod-pick select { min-width: 160px; }
.pack-q-wrap { flex: 1 1 280px; min-width: 240px; }
.pack-q-wrap input { width: 100%; }
.pack-board { display: grid; gap: 14px; margin-top: 4px; }
.pack-view-card, .pack-report-card { margin-top: 0; }
.pack-view-card .card-h, .pack-report-card .card-h {
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(30, 200, 212, 0.18);
  margin-bottom: 10px;
}
.pack-stage {
  min-height: 340px; padding: 18px 16px 22px; overflow: hidden;
  user-select: none;
  border: 1px solid #c5d5dc;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(30, 200, 212, 0.1), transparent 52%),
    linear-gradient(180deg, #f7fbfc, #e4ecef);
}
.pack-scene { min-height: 260px; }
.kraft, .pk-face, .pk-lid, .pack-flat-box, .pack-tray, .pack-cell {
  background-color: #c9a36a;
  background-image:
    repeating-linear-gradient(90deg, rgba(255, 236, 200, .14) 0 2px, transparent 2px 5px),
    repeating-linear-gradient(0deg, rgba(90, 50, 16, .07) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #d8b07c 0%, #c19658 52%, #b07f42 100%);
}
.pk-label {
  position: absolute; left: 16px; top: 16%;
  width: 176px; padding: 6px 7px 7px;
  background: #fff; color: #111;
  border: 1px solid #c8c4bc;
  box-shadow: 0 1px 0 #fff inset, 0 2px 6px rgba(0,0,0,.18);
  display: grid; gap: 3px; z-index: 3;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
}
.pk-lab-part {
  display: grid; grid-template-columns: 62px 1fr; gap: 4px; align-items: center;
  border-bottom: 1px solid #e6e2da; padding-bottom: 3px;
}
.pk-lab-part span, .pk-lab-row span, .pk-lab-lot span, .pk-lab-pair span {
  font-size: 7px; line-height: 1.15; color: #6a655c; font-style: normal;
}
.pk-lab-part b {
  font-size: 13px; letter-spacing: .02em; font-weight: 800; color: #111;
}
.pk-lab-row {
  display: grid; grid-template-columns: 62px 1fr; gap: 4px; align-items: center;
}
.pk-lab-row b, .pk-lab-lot b, .pk-lab-pair b {
  font-size: 10px; font-weight: 800; color: #161616; letter-spacing: .01em;
}
.pk-lab-lot {
  display: grid; grid-template-columns: 1fr 36px; gap: 4px; align-items: center;
}
.pk-lab-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.pk-lab-pair > div { display: grid; gap: 1px; }
.pk-qr {
  width: 36px; height: 36px; flex: none;
  background:
    repeating-conic-gradient(#111 0% 25%, #f4f4f4 0% 50%) 0 0 / 5px 5px,
    repeating-linear-gradient(90deg, #111 0 2px, transparent 2px 4px),
    #111;
  border: 1px solid #111;
  box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px #111;
}
.pk-stamp {
  position: absolute; right: 16px; bottom: 14px;
  width: 72px; height: 72px; border-radius: 50%;
  border: 2px solid rgba(70, 42, 16, .55);
  color: rgba(70, 42, 16, .72);
  display: grid; place-items: center; text-align: center;
  font-size: 7px; letter-spacing: .08em; line-height: 1.2;
  transform: rotate(-8deg);
}
.pk-stamp b { font-size: 8px; }
.pk-size {
  position: absolute; left: 18px; top: 42%;
  font-size: 15px; font-weight: 800; letter-spacing: .04em;
  color: rgba(40, 24, 8, .78);
}
.pk-L {
  position: absolute; width: 16px; height: 16px;
  border: 2px solid rgba(40, 24, 8, .7);
}
.pk-L.tl { left: 8px; top: 8px; border-right: 0; border-bottom: 0; }
.pk-L.tr { right: 8px; top: 8px; border-left: 0; border-bottom: 0; }
.pk-L.bl { left: 8px; bottom: 8px; border-right: 0; border-top: 0; }
.pk-L.br { right: 8px; bottom: 8px; border-left: 0; border-top: 0; }
.pk-handle {
  position: absolute; left: 50%; top: 28%;
  width: 78px; height: 22px; transform: translateX(-50%);
  border: 2px solid rgba(60, 36, 12, .45);
  border-radius: 40px;
  background: radial-gradient(ellipse at 50% 40%, #8f6a38, #5c401c 70%);
  box-shadow: inset 0 4px 6px rgba(0,0,0,.35);
}
.pk-marks {
  position: absolute; left: 10px; right: 10px; bottom: 10px;
  display: flex; gap: 6px; justify-content: center;
}
.pk-ico { display: grid; justify-items: center; gap: 2px; width: 48px; color: #2a1a08; }
.pk-ico small { font-size: 7px; letter-spacing: 0; }
.pk-ico i { width: 28px; height: 28px; border: 1.5px solid #2a1a08; display: grid; place-items: center; }
.ico-up {
  background:
    linear-gradient(#2a1a08, #2a1a08) 50% 18% / 3px 10px no-repeat,
    linear-gradient(#2a1a08, #2a1a08) 50% 55% / 3px 10px no-repeat;
}
.ico-up::before, .ico-up::after {
  content: ""; width: 0; height: 0;
  border-left: 6px solid transparent; border-right: 6px solid transparent;
  border-bottom: 8px solid #2a1a08;
}
.ico-stack { font-style: normal; font-weight: 800; font-size: 16px; }
.ico-glass {
  background: linear-gradient(#2a1a08, #2a1a08) 50% 70% / 2px 8px no-repeat;
}
.ico-glass::before {
  content: ""; width: 12px; height: 10px;
  border: 1.5px solid #2a1a08; border-top: 0; border-radius: 0 0 8px 8px;
}
.ico-rain {
  background: radial-gradient(circle at 50% 42%, transparent 5px, #2a1a08 5.5px, #2a1a08 7px, transparent 7.5px);
}
.pack-layer-lab {
  font-size: 11px; font-weight: 800; letter-spacing: .08em;
  color: #6a4a24; margin: 0 0 8px;
}
.pack-row {
  display: grid;
  grid-template-columns: repeat(var(--cols, 8), minmax(0, 1fr));
  gap: 4px; margin-top: 4px;
}
.pack-cell {
  position: relative;
  min-height: 96px; border: 0; padding: 0;
  color: #3a2a14; cursor: pointer;
  overflow: visible;
  box-shadow:
    inset 0 0 0 1px rgba(70, 42, 12, .42),
    inset 0 10px 18px rgba(80, 40, 0, .12);
}
.pack-cell::after {
  content: "";
  position: absolute; inset: 4px 4px 18px 8px;
  border: 1px solid rgba(90, 50, 16, .16);
  pointer-events: none;
}
.pack-cell .pk-flap {
  position: absolute; inset: 0 auto 0 0; width: 5px;
  background: repeating-linear-gradient(180deg, #c9a36a 0 3px, #e4cc9a 3px 5px, #a87a3c 5px 6px);
  box-shadow: 1px 0 0 rgba(0,0,0,.15);
}
.pk-slot {
  display: block; height: 58px;
  margin: 8px 8px 0 12px;
  border: 1px dashed rgba(90, 60, 20, .28);
  background:
    repeating-linear-gradient(90deg, rgba(90,50,16,.08) 0 3px, transparent 3px 6px),
    rgba(90, 50, 16, .08);
}
.pk-sensor {
  position: relative; display: block; height: 62px;
  margin: 8px 8px 0 12px;
  transform-style: preserve-3d;
}
.sn-iso {
  position: relative; display: block; width: 100%; height: 100%;
  transform-style: preserve-3d;
}
.sn-brkt {
  position: absolute; left: 4%; bottom: 8%;
  width: 58%; height: 62%;
  background:
    linear-gradient(#d5dde4, #d5dde4) 0 72% / 100% 28% no-repeat,
    linear-gradient(90deg, #eef2f6, #8a929c 40%, #c5ccd3) 0 0 / 30% 100% no-repeat;
  filter: drop-shadow(1px 2px 1px rgba(0,0,0,.35));
  clip-path: polygon(0 0, 30% 0, 30% 70%, 100% 70%, 100% 100%, 0 100%);
}
.sn-arm {
  position: absolute; left: 16%; top: 20%;
  width: 48%; height: 9px;
  background: linear-gradient(180deg, #eef2f6, #8d949c 55%, #5c636b);
  border-radius: 1px; transform: rotate(-16deg) translateZ(4px);
  box-shadow: 0 1px 0 rgba(255,255,255,.45), 0 2px 2px rgba(0,0,0,.25);
}
.sn-plate {
  position: absolute; left: 6%; top: 42%;
  width: 40%; height: 24px;
  background: linear-gradient(180deg, #d8dee4, #7d858e);
  clip-path: polygon(0 28%, 72% 0, 100% 18%, 88% 100%, 6% 100%);
  box-shadow: 1px 2px 2px rgba(0,0,0,.28);
  transform: translateZ(3px);
}
.sn-body {
  position: absolute; right: 6%; top: 12%;
  width: 46%; height: 58%;
  background: linear-gradient(145deg, #4a4a50 0%, #1a1a1e 42%, #050505 100%);
  border-radius: 3px 3px 2px 2px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.22),
    inset -5px 0 8px rgba(0,0,0,.45),
    3px 4px 0 #1a1a1a,
    4px 6px 10px rgba(0,0,0,.38);
  transform: translateZ(10px);
}
.sn-body em, .sn-body u { display: block; position: absolute; text-decoration: none; }
.sn-body em {
  left: 10%; right: 10%; top: 8%; height: 18%;
  background: linear-gradient(180deg, rgba(255,255,255,.22), transparent);
  border-radius: 2px;
}
.sn-body u {
  left: 16%; right: 16%; bottom: 12%; height: 26%;
  background: #090909;
  border: 1px solid #4a4a50;
  box-shadow: inset 0 0 4px #000;
}
.sn-port {
  position: absolute; right: 12%; bottom: 6%;
  width: 24%; height: 14%;
  background: #0a0a0a; border-radius: 1px;
  box-shadow: inset 0 0 0 1px #555, 0 2px 0 #000;
  transform: translateZ(8px);
}
.pk-no {
  position: absolute; left: 8px; right: 6px; bottom: 3px;
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 10px; line-height: 1;
}
.pk-no b { font-size: 11px; font-weight: 800; }
.pk-no em { font-style: normal; font-size: 9px; }
.pack-cell.ok { box-shadow: inset 0 0 0 1px rgba(47, 154, 8, .45), inset 0 10px 18px rgba(80, 40, 0, .12); }
.pack-cell.ok .sn-body { box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 0 0 1px rgba(47, 154, 8, .45); }
.pack-cell.ng { box-shadow: inset 0 0 0 2px #c01828; }
.pack-cell.ng .sn-body { background: linear-gradient(180deg, #5a2024, #2a0004); }
.pack-cell.ng .pk-no em { color: #a01020; font-weight: 800; }
.pack-cell.ok .pk-no em { color: #2f9a08; font-weight: 800; }
.pack-cell.on { outline: 2px solid #1ec8d4; outline-offset: -2px; z-index: 2; }
.pack-flat .pack-scene { perspective: none; padding: 4px 0 8px; }
.pack-flat .pack-orbit { transform: none !important; }
.pack-flat .pack-carton, .pack-flat .pack-pallet, .pack-flat .pk-lid,
.pack-flat .pk-face, .pack-flat .pk-liner { display: none; }
.pack-flat-box {
  padding: 14px 14px 12px;
  border: 2px solid #7a5428;
  border-radius: 2px;
  box-shadow:
    inset 0 0 0 7px #c19658,
    inset 0 0 0 9px #8a6230,
    0 12px 0 #7a5428,
    0 18px 28px rgba(0,0,0,.22);
  position: relative;
  background-image:
    repeating-linear-gradient(90deg, rgba(255, 236, 200, .12) 0 2px, transparent 2px 5px),
    repeating-linear-gradient(0deg, rgba(90, 50, 16, .07) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #d8b07c 0%, #c19658 52%, #b07f42 100%);
}
.pack-flat-box::before {
  content: "";
  position: absolute; left: 10px; right: 10px; top: 8px; height: 8px;
  background: repeating-linear-gradient(90deg, #a87a3c 0 10px, #d2ae78 10px 12px);
  opacity: .55;
  pointer-events: none;
}
.pack-flat-box > .pk-label {
  position: relative; left: auto; top: auto;
  width: min(340px, 100%);
  margin: 0 0 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.16);
}
.pack-flat .pack-stack { display: flex; flex-direction: column; gap: 16px; }
.pack-flat .pack-layer { transform: none !important; position: relative; }
.pack-flat .pack-tray {
  padding: 8px;
  border: 2px solid #7a5428;
  box-shadow: inset 0 0 0 4px #d2ae78, inset 0 10px 18px rgba(80, 40, 0, .2);
  background-image:
    repeating-linear-gradient(90deg, rgba(90, 50, 16, .1) 0 2px, transparent 2px calc(100% / var(--cols, 8)));
}
.pack-flat .pack-cell {
  min-height: 104px;
  overflow: hidden;
  background-image:
    repeating-linear-gradient(90deg, rgba(255,236,200,.1) 0 2px, transparent 2px 4px),
    linear-gradient(180deg, #e2c48a, #c19658 70%, #a87a3c);
  box-shadow:
    inset 0 0 0 2px #8a6230,
    inset 0 0 0 5px #d8b07c,
    inset 0 12px 16px rgba(80,40,0,.16);
}
.pack-flat .pk-sensor { height: 72px; }
.pack-3d {
  position: relative;
  perspective: 1800px;
  min-height: 640px;
  overflow: visible;
  cursor: grab;
  background:
    radial-gradient(ellipse at 50% 18%, rgba(90, 200, 220, .12), transparent 42%),
    radial-gradient(ellipse at 50% 88%, rgba(0, 0, 0, .38), transparent 50%),
    radial-gradient(ellipse at 72% 40%, rgba(255, 220, 160, .08), transparent 36%),
    linear-gradient(180deg, #0a1c28 0%, #173444 36%, #4e564c 72%, #6a7064 100%);
}
.pack-3d::after {
  content: "";
  position: absolute; left: 12%; right: 12%; bottom: 48px; height: 28px;
  background: radial-gradient(ellipse at 50% 50%, rgba(0,0,0,.42), transparent 68%);
  pointer-events: none;
}
.pack-3d .pk-front {
  background-image:
    linear-gradient(180deg, rgba(255,255,255,.16), transparent 30%),
    repeating-linear-gradient(90deg, rgba(255, 236, 200, .14) 0 2px, transparent 2px 5px),
    repeating-linear-gradient(0deg, rgba(90, 50, 16, .07) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #d8b07c 0%, #c19658 52%, #b07f42 100%);
  filter: brightness(1.06);
}
.pack-3d .pk-right { filter: brightness(.94); }
.pack-3d .pk-left { filter: brightness(.76); }
.pack-3d .pk-back { filter: brightness(.68); }
.pack-3d .pk-bottom { filter: brightness(.62); }
.pack-3d.orbiting { cursor: grabbing; }
.pack-3d .pack-scene {
  min-height: 580px; display: grid; place-items: center;
  perspective: inherit;
  position: relative;
}
.pack-3d .pack-cell::after { display: none; }
.pack-3d .pack-orbit {
  --bw: 462px; --bd: 294px; --bh: 193px;
  transform-style: preserve-3d;
  transform-origin: center center;
  will-change: transform;
  position: relative;
  width: var(--bw);
  height: var(--bh);
}
.pack-3d .pack-carton, .pack-3d .pack-stack, .pack-3d .pack-layer,
.pack-3d .pack-tray, .pack-3d .pack-row, .pack-3d .pack-cell, .pack-3d .pk-lid,
.pack-3d .pk-lid-cap, .pack-3d .pk-sensor, .pack-3d .sn-iso, .pack-3d .sn-body {
  transform-style: preserve-3d;
}
.pack-3d .pack-pallet {
  display: block;
  position: absolute;
  left: -22px;
  top: calc((var(--bh) - var(--bd)) / 2);
  width: calc(var(--bw) + 44px);
  height: calc(var(--bd) + 28px);
  background: repeating-linear-gradient(90deg, #c7a36a 0 26px, #8a5a32 26px 30px, #d8b07a 30px 56px, #6e4526 56px 60px);
  border: 2px solid #4a2c16;
  transform: rotateX(-90deg) translateZ(calc(var(--bh) / 2 + 18px));
  box-shadow: 0 26px 32px rgba(0,0,0,.42);
}
.pack-3d .pack-pallet i, .pack-3d .pack-pallet b {
  position: absolute; background: #5a3818; display: block;
}
.pack-3d .pack-pallet b {
  height: 14px; left: 8px; right: 8px;
}
.pack-3d .pack-pallet b:nth-of-type(1) { top: 8px; }
.pack-3d .pack-pallet b:nth-of-type(2) { top: 50%; margin-top: -7px; }
.pack-3d .pack-pallet b:nth-of-type(3) { bottom: 8px; }
.pack-3d .pack-pallet i {
  width: 18px; top: 4px; bottom: 4px;
  background: linear-gradient(90deg, #4a2c14, #7a5230 40%, #3a220e);
}
.pack-3d .pack-pallet i:nth-of-type(1) { left: 6%; }
.pack-3d .pack-pallet i:nth-of-type(2) { left: 27%; }
.pack-3d .pack-pallet i:nth-of-type(3) { left: 48%; }
.pack-3d .pack-pallet i:nth-of-type(4) { left: 69%; }
.pack-3d .pack-pallet i:nth-of-type(5) { left: 88%; }
.pack-3d .pack-carton {
  position: relative;
  width: var(--bw); height: var(--bh);
  transform-style: preserve-3d;
}
.pack-3d .pk-face {
  position: absolute; left: 0; top: 0;
  box-shadow: inset 0 0 40px rgba(80, 40, 0, .18);
  backface-visibility: visible;
}
.pack-3d .pk-front, .pack-3d .pk-back { width: var(--bw); height: var(--bh); }
.pack-3d .pk-front { transform: translateZ(calc(var(--bd) / 2)); }
.pack-3d .pk-back { transform: rotateY(180deg) translateZ(calc(var(--bd) / 2)); }
.pack-3d .pk-left, .pack-3d .pk-right {
  width: var(--bd); height: var(--bh);
  left: calc((var(--bw) - var(--bd)) / 2);
}
.pack-3d .pk-left { transform: rotateY(-90deg) translateZ(calc(var(--bw) / 2)); }
.pack-3d .pk-right { transform: rotateY(90deg) translateZ(calc(var(--bw) / 2)); }
.pack-3d .pk-bottom {
  width: var(--bw); height: var(--bd);
  top: calc((var(--bh) - var(--bd)) / 2);
  transform: rotateX(-90deg) translateZ(calc(var(--bh) / 2));
  backface-visibility: visible;
}
.pack-3d .pk-lid {
  position: absolute;
  left: -10px;
  width: calc(var(--bw) + 20px);
  height: calc(var(--bd) + 20px);
  top: calc((var(--bh) - var(--bd)) / 2 - 10px);
  transform-origin: center center;
  transform: rotateX(90deg) translateZ(calc(var(--bh) / 2 + 3px));
  transition: transform .7s cubic-bezier(.22,.72,.2,1);
  z-index: 6;
}
.pack-3d.is-open .pk-lid {
  transform: rotateX(90deg) translateZ(calc(var(--bh) / 2 + 156px)) translateY(-46%);
}
.pack-3d .pk-lid-cap {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,.14), transparent 26%),
    repeating-linear-gradient(90deg, rgba(255, 236, 200, .12) 0 2px, transparent 2px 5px),
    linear-gradient(180deg, #e0c08a, #c19658 55%, #b07f42);
  border: 2px solid #8a6230;
  box-shadow: 0 10px 18px rgba(0,0,0,.28), inset 0 0 18px rgba(80,40,0,.12);
}
.pack-3d .pk-lid-cap i {
  position: absolute; width: 10px; height: 5px;
  border-radius: 1px;
  background: #6a4520;
  box-shadow: inset 0 1px 2px #3a220e;
}
.pack-3d .pk-lid-cap i:nth-child(1) { left: 18%; top: 7px; }
.pack-3d .pk-lid-cap i:nth-child(2) { right: 18%; top: 7px; }
.pack-3d .pk-lid-cap i:nth-child(3) { left: 18%; bottom: 7px; }
.pack-3d .pk-lid-cap i:nth-child(4) { right: 18%; bottom: 7px; }
.pack-3d .pk-lid-f, .pack-3d .pk-lid-b, .pack-3d .pk-lid-l, .pack-3d .pk-lid-r {
  position: absolute;
  background: linear-gradient(180deg, #d2ae78, #a87a3c);
  border: 1px solid #8a6230;
}
.pack-3d .pk-lid-f, .pack-3d .pk-lid-b {
  left: 0; width: 100%; height: 22px;
}
.pack-3d .pk-lid-f {
  bottom: 0; transform-origin: top; transform: rotateX(-90deg);
  filter: brightness(1.04);
}
.pack-3d .pk-lid-b {
  top: 0; transform-origin: bottom; transform: rotateX(90deg);
  filter: brightness(.82);
}
.pack-3d .pk-lid-l, .pack-3d .pk-lid-r {
  top: 0; height: 100%; width: 22px;
}
.pack-3d .pk-lid-l {
  left: 0; transform-origin: right; transform: rotateY(90deg);
  filter: brightness(.74);
}
.pack-3d .pk-lid-r {
  right: 0; transform-origin: left; transform: rotateY(-90deg);
  filter: brightness(.9);
}
.pack-3d .pk-liner { display: none; }
.pack-3d .pack-flat-box { display: contents; }
.pack-3d .pack-stack {
  position: absolute;
  width: calc(var(--bw) - 18px);
  height: calc(var(--bd) - 18px);
  left: 9px;
  top: calc((var(--bh) - var(--bd)) / 2 + 9px);
  transform: rotateX(-90deg) translateZ(calc(var(--bh) / 2 - 8px));
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
  backface-visibility: hidden;
}
.pack-3d.is-open .pack-stack {
  opacity: 1;
  pointer-events: auto;
}
.pack-3d .pack-layer-lab { display: none; }
.pack-3d .pack-tray {
  background: none; border: 0; box-shadow: none; padding: 0;
  height: 100%;
  display: flex; flex-direction: column; justify-content: space-between;
}
.pack-3d .pack-layer {
  position: absolute; inset: 0;
  transform: translateZ(calc(var(--lv) * 44px + 14px));
}
.pack-3d.is-open .pack-layer {
  pointer-events: auto;
}
.pack-3d.is-open .pack-cell.empty {
  opacity: 0.32;
}
.pack-3d.is-open .pack-tray {
  background: transparent;
}
.pack-3d .pack-row { gap: 3px; margin: 0; flex: 1; }
.pack-3d .pack-cell {
  min-height: 0;
  height: calc((var(--bd) - 28px) / var(--rows, 2) - 4px);
  overflow: visible;
  background-image:
    repeating-linear-gradient(90deg, rgba(255,236,200,.1) 0 2px, transparent 2px 4px),
    linear-gradient(180deg, #d8b07c, #b88848);
  box-shadow: inset 0 0 0 2px rgba(90,50,16,.45), inset 0 8px 10px rgba(60,30,0,.2);
}
.pack-3d .pack-cell .pk-sensor, .pack-3d .pack-cell .pk-slot {
  height: 78%; margin: 4px 4px 0 8px;
}
.pack-3d .sn-body {
  transform: translateZ(16px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.22),
    8px 0 0 -1px #121214,
    0 -7px 0 -1px #2c2c32,
    4px 6px 10px rgba(0,0,0,.4);
}
.pack-3d .sn-body::before, .pack-3d .sn-body::after {
  content: ""; position: absolute;
}
.pack-3d .sn-body::before {
  top: 0; bottom: 0; left: 100%; width: 10px;
  background: linear-gradient(180deg, #2a2a30, #050506);
  transform-origin: left center;
  transform: rotateY(90deg);
}
.pack-3d .sn-body::after {
  left: 0; right: 0; bottom: 100%; height: 9px;
  background: linear-gradient(90deg, #4a4a52, #1c1c20);
  transform-origin: bottom center;
  transform: rotateX(90deg);
}
.pack-3d .sn-brkt { transform: translateZ(6px); }
.pack-3d .sn-plate { transform: translateZ(8px); }
.pack-3d .hint { color: #e8d7b0; }
.pack-sheet-wrap {
  max-height: 520px; overflow: auto;
  border: 1px solid #6e6e6e; background: #fff;
}
.pack-sheet { width: 100%; min-width: 1380px; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.pack-sheet col.pk-idx { width: 3.6%; }
.pack-sheet col.pk-c1 { width: 12.8%; }
.pack-sheet col.pk-gap { width: 5.2%; }
.pack-sheet col.pk-c2 { width: 16.8%; }
.pack-sheet col.pk-c3 { width: 17.8%; }
.pack-sheet col.pk-mid { width: 5.8%; }
.pack-sheet col.pk-uid { width: 7%; }
.pack-sheet col.pk-pid { width: 5.6%; }
.pack-sheet col.pk-w { width: 4.2%; }
.pack-sheet col.pk-t { width: 10.4%; }
.pack-sheet col.pk-st { width: 5.6%; }
.pack-sheet col.pk-r { width: 5.2%; }
.pack-sheet th {
  background: linear-gradient(180deg, #d8d8d8, #b4b4b4);
  color: #1a1a1a; border: 1px solid #7a7a7a;
  font-weight: 700; padding: 4px 3px; text-align: center;
  position: sticky; top: 0; z-index: 1;
  font-size: 12px;
}
.pack-sheet td {
  border: 1px solid #9a9a9a; background: #fff; padding: 2px 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  height: 22px;
}
.pack-sheet td.code { font-family: Consolas, "Courier New", monospace; font-size: 11px; }
.pack-sheet td.pk-bc { padding: 1px 3px; vertical-align: middle; }
.pack-sheet .pk-bc-svg { display: block; width: 100%; height: 16px; }
.pack-sheet tbody td:nth-child(1),
.pack-sheet tbody td:nth-child(6),
.pack-sheet tbody td:nth-child(7),
.pack-sheet tbody td:nth-child(8),
.pack-sheet tbody td:nth-child(9),
.pack-sheet tbody td:nth-child(11),
.pack-sheet tbody td:nth-child(12) { text-align: center; }
.pack-sheet td.pk-res { font-weight: 800; letter-spacing: 0.04em; }
.pack-sheet td.res-ok,
.pack-sheet tr.on td.res-ok,
.pack-sheet tr.on:hover td.res-ok,
.pack-sheet tbody tr:hover td.res-ok {
  background: #c6ef9a !important;
  color: #176206 !important;
}
.pack-sheet td.res-ng,
.pack-sheet tr.on td.res-ng,
.pack-sheet tr.on:hover td.res-ng,
.pack-sheet tbody tr:hover td.res-ng {
  background: #e23b3b !important;
  color: #fff !important;
}
.pack-sheet tr.empty td { background: #fff; height: 20px; }
.pack-sheet tr.empty:hover td { background: #fff; }
.pack-sheet tr.on td { background: #d6f4f8; }
.pack-sheet tbody tr:hover td { background: #f3f8fa; }
.pack-sheet tr.on:hover td { background: #c5eef4; }
.pack-sheet tbody tr { cursor: pointer; }
.pack-sheet tr.empty { cursor: default; }
#tbl-trace tr.on td { background: #d6f4f8; }
#tbl-trace tr.on:hover td { background: #c5eef4; }
.kpi.warn strong { color: #b42318; }
.unit-tabs { margin: 8px 0 10px; }
.hist-station { margin-top: 10px; }
.hist-visit { border: 1px solid var(--line, #c5d8e0); border-left: 4px solid #1ec8d4; border-radius: 8px; padding: 10px 12px; margin: 8px 0; background: #f7fbfd; }
.hist-visit.rework { border-left-color: #ff5a6a; background: #fff6f6; }
.hist-visit-h { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; }
.hist-codes { display: flex; flex-wrap: wrap; gap: 12px; color: #4a6573; font-size: 12px; margin-bottom: 8px; }
.hist-tag { background: #ff5a6a; color: #fff; font-style: normal; font-size: 12px; padding: 1px 6px; border-radius: 4px; }
.unit-flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.unit-op { background: #f3f8fa; border: 1px solid #c5d8e0; border-radius: 10px; padding: 10px; display: grid; gap: 4px; }
.unit-op b { font-size: 16px; }
.unit-op.rework { border-color: #ff5a6a; background: #fff1f2; }
.unit-op.miss { opacity: .55; border-style: dashed; }
.unit-notes { margin: 8px 16px 12px; line-height: 1.7; }
.process-table tr.on td { background: #e7f8ea; }
@media (max-width: 1400px) {
  .unit-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exception-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.dash-evidence {
  margin: 0 0 8px;
  font-size: 12px;
  color: #4a6573;
  letter-spacing: 0.02em;
}
.gene {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 8px 0 14px;
}
.gene-node {
  flex: 1;
  min-width: 0;
  border: 1px solid #9bb8c4;
  background: #f4fafb;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}
.gene-node:first-child { border-radius: 8px 0 0 8px; }
.gene-node:last-of-type { border-radius: 0 8px 8px 0; }
.gene-node.on { border-color: #013056; background: #e8f4f7; }
.gene-node span { font-size: 11px; color: #4a6573; letter-spacing: 0.08em; }
.gene-node strong {
  font-size: 13px;
  color: #013056;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gene-node small { font-size: 11px; color: #6a808c; }
.gene-arrow {
  width: 18px;
  flex: 0 0 18px;
  position: relative;
}
.gene-arrow::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 2px;
  right: 2px;
  height: 2px;
  background: #013056;
}
.gene-arrow::after {
  content: "";
  position: absolute;
  top: calc(50% - 4px);
  right: 1px;
  border: 5px solid transparent;
  border-left-color: #013056;
}
.q-react {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0 10px;
  padding: 8px 10px;
  border: 1px solid #9bb8c4;
  background: #f4fafb;
}
.q-react.need { border-color: #c45a18; background: #fff6ee; }
.q-react b { display: block; font-size: 12px; color: #013056; }
.q-react small { display: block; margin-top: 2px; font-size: 11px; color: #6a808c; }
.q-react p { margin: 4px 0 0; font-size: 12px; color: #3a5a6a; line-height: 1.45; }
.q-react .btn { flex: 0 0 auto; }
.contain-sheet { max-width: 1180px; }
.contain-table { max-height: 420px; margin-top: 8px; }
.alert-act { white-space: nowrap; }
.alert-act .btn { margin-left: 4px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #3a6a80; }
::-webkit-scrollbar-track { background: #d5e4ea; }

@media (max-width: 1600px) {
  .top-title strong { font-size: 26px; }
  .top-title .zh-title { letter-spacing: 0.18em; margin-right: -0.18em; }
  .top-title small, #en-banner { font-size: 16px; }
}
@media (max-width: 1400px) {
  .app {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
  }
  .work, .topbar-frame, .dock { grid-template-columns: 1fr; }
  .work { min-height: 0; overflow: hidden; }
  .rail { max-height: 168px; overflow: auto; }
  .stage, .stage-main { min-height: 0; overflow: auto; }
  .top-title strong { font-size: 22px; }
  .top-title .zh-title { letter-spacing: 0.08em; margin-right: 0; }
  .top-title small, #en-banner { font-size: 14px; }
  .hero-actions { flex-wrap: wrap; }
  .filters, .kpis { grid-template-columns: repeat(3, 1fr); }
  .kpi-8, #dash-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #cast-kpis { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  #cast-over-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .page-query { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #product-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid-2, .grid-3, .grid-eq2, .compare, .shifts, .field-grid, .edit-grid, .entry-scan .edit-grid, .maintain-grid, .scada-flow, .scada-ticker, .q-metrics { grid-template-columns: 1fr; }
  .q-curve-method .edit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-cast .grid-2,
  .dash-cast .grid-eq2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .suspect-form { grid-template-columns: 1fr 1fr; }
  .q-methods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scada-join { display: none; }
  .stage-row { grid-template-columns: 1fr; }
  .vtabs { flex-direction: row; height: auto; border-radius: 10px 10px 0 0; padding: 0; }
  .vtab { writing-mode: horizontal-tb; text-orientation: mixed; transform: none; letter-spacing: 2px; max-height: none; border-radius: 8px 8px 0 0; padding: 8px 14px; }
}
@media print {
  .topbar, .rail, .filters, .hero-actions, .dock, #toast-host, #loading, #splash, .vtabs { display: none !important; }
  .app, .work { display: block; height: auto; }
  .stage-main { background: #fff; }
}
#page-workorder tr.picked td, #page-equipment tr.picked td, #page-person tr.picked td { background: rgba(10, 110, 120, 0.08); }

.splash-stage h1 .en { display: block; margin-top: 8px; font-size: 14px; font-weight: 500; letter-spacing: 0; }

.splash-stage h1 .ver {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
  margin-left: 10px;
  vertical-align: baseline;
}


