/* ==========================================================================
   DeepGPT ERP 路 Liquid Glass Design System
   Edge-to-edge alignment 路 generous breathing room 路 every corner rounded
   ========================================================================== */
:root {
  --bg-0: #040812;
  --bg-1: #071120;
  --bg-2: #0b1729;
  --ink: #f4f8ff;
  --ink-2: #d8e4f5;
  --muted: #91a6c4;
  --muted-2: #6f86a6;
  --faint: #526883;

  --glass: rgba(15, 29, 49, 0.56);
  --glass-deep: rgba(8, 18, 33, 0.72);
  --glass-soft: rgba(24, 42, 68, 0.34);
  --glass-hi: rgba(255, 255, 255, 0.075);
  --stroke: rgba(255, 255, 255, 0.095);
  --stroke-strong: rgba(255, 255, 255, 0.17);
  --hairline: rgba(146, 178, 220, 0.13);

  --blue: #5b8cff;
  --blue-2: #7aa8ff;
  --cyan: #54e6d3;
  --mint: #34d9a8;
  --green: #39d98a;
  --amber: #f6c35b;
  --orange: #ff9f66;
  --red: #ff7188;
  --violet: #a98bff;

  --grad-blue: linear-gradient(135deg, #7eb7ff 0%, #4f7dff 52%, #3458f0 100%);
  --grad-mint: linear-gradient(135deg, #8dffe1 0%, #34dfb4 50%, #0dac87 100%);
  --grad-amber: linear-gradient(135deg, #ffe6a3 0%, #f6c35b 55%, #e79a3c 100%);
  --grad-rose: linear-gradient(135deg, #ffb3c0 0%, #ff7188 55%, #e54b68 100%);

  --radius-2xl: 28px;
  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 18px;
  --space-5: 22px;
  --space-6: 28px;
  --space-7: 36px;

  --font: "HarmonyOS Sans SC", "Microsoft YaHei UI", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  /* One numeric face for every digit in the product: Latin/digits render in
     Bahnschrift, CJK falls through to the UI font at the end of the stack. */
  --font-num: "HarmonyOS Sans SC", "Bahnschrift", "Segoe UI", var(--font);
  --font-code: "HarmonyOS Sans SC", "Cascadia Code", Consolas, monospace;
  --shadow-card: 0 22px 60px -24px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.24);
  --shadow-float: 0 34px 90px -26px rgba(0, 0, 0, 0.82), 0 4px 14px rgba(0, 0, 0, 0.28);
  --inner-light: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Layout geometry. The app shell grid and the dialog layer both read these,
     so a dialog can never be laid out outside the content column (i.e. never
     slide under the sticky sidebar) on any viewport width. */
  --shell-pad: 18px;
  --shell-gap: 18px;
  --sidebar-w: 246px;
  --content-left: calc(var(--shell-pad) + var(--sidebar-w) + var(--shell-gap));
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { color-scheme: dark; }
body {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  background: var(--bg-0);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.65;
  letter-spacing: 0.012em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; appearance: none; -webkit-appearance: none; background: transparent; }
button:not(.btn):not(.icon-btn):not(.nav-item):not(.tab):not(.pager button) { font: inherit; }
a { color: var(--blue-2); text-decoration: none; }
a:hover { color: #a9c9ff; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { letter-spacing: -0.02em; line-height: 1.3; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: rgba(94, 146, 255, 0.42); color: #fff; }
:focus-visible { outline: 2px solid rgba(110, 168, 255, 0.8); outline-offset: 2px; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(148, 178, 220, 0.22) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(148, 178, 220, 0.2); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(148, 178, 220, 0.36); border: 2px solid transparent; background-clip: padding-box; }

/* ==========================================================================
   Ambient background
   ========================================================================== */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background:
    radial-gradient(1200px 780px at 78% -18%, rgba(44, 86, 190, 0.22), transparent 62%),
    radial-gradient(960px 760px at 8% 12%, rgba(26, 143, 137, 0.12), transparent 66%),
    radial-gradient(840px 620px at 56% 108%, rgba(76, 62, 180, 0.14), transparent 70%),
    linear-gradient(155deg, #060c17 0%, #071120 42%, #050a13 100%);
}
.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.32;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  pointer-events: none;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
}
.orb.one { width: 520px; height: 520px; top: -180px; right: 4%; background: radial-gradient(circle, rgba(77, 122, 255, 0.54), transparent 64%); }
.orb.two { width: 460px; height: 460px; bottom: -190px; left: 6%; background: radial-gradient(circle, rgba(42, 213, 177, 0.3), transparent 66%); }
.orb.three { width: 380px; height: 380px; top: 42%; left: 44%; background: radial-gradient(circle, rgba(142, 94, 255, 0.22), transparent 66%); }
.grid-glow {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(133, 170, 230, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(133, 170, 230, 0.032) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 20%, #000 20%, transparent 78%);
}
/* Very low-contrast diagonal flow lines over the grid; kept behind all glass
   panels so reading contrast is unchanged. */
.flow-lines {
  position: absolute;
  inset: -18%;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    repeating-linear-gradient(112deg, rgba(126, 170, 238, 0.055) 0 1px, transparent 1px 144px),
    repeating-linear-gradient(112deg, rgba(86, 206, 196, 0.028) 0 1px, transparent 1px 288px);
  mask-image: radial-gradient(ellipse 88% 78% at 58% 26%, #000 8%, transparent 76%);
  animation: flowDrift 42s linear infinite;
}
@keyframes flowDrift {
  0% { transform: translate3d(-1.2%, 0, 0); }
  100% { transform: translate3d(1.2%, -1.4%, 0); }
}
@keyframes orbFloat {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(38px, 44px, 0) scale(1.12); }
}

/* ==========================================================================
   Glass primitives
   ========================================================================== */
.glass {
  position: relative;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.085) 0%, rgba(255, 255, 255, 0.025) 34%, rgba(75, 126, 205, 0.035) 100%),
    var(--glass);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-card), var(--inner-light);
}
.glass.keep-blur,
.sidebar.glass,
.topbar.glass,
.modal.glass,
.drawer.glass,
.palette.glass {
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(118deg, rgba(255, 255, 255, 0.12) 0%, transparent 26%, transparent 74%, rgba(116, 165, 255, 0.055) 100%);
  opacity: 0.72;
}
.glass > * { position: relative; z-index: 1; }
.panel {
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.panel-pad { padding: var(--space-5); }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 20px 22px 0;
}
.panel-title { font-size: 15px; font-weight: 700; letter-spacing: 0.01em; display: flex; align-items: center; gap: 9px; }
.panel-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.divider { height: 1px; background: var(--hairline); margin: 16px 0; border: 0; }

/* ==========================================================================
   App shell / sidebar
   ========================================================================== */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: var(--shell-gap);
  padding: var(--shell-pad);
  min-height: 100vh;
  align-items: start;
}
.sidebar {
  position: sticky;
  top: var(--shell-pad);
  height: calc(100vh - var(--shell-pad) * 2);
  border-radius: var(--radius-2xl);
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  z-index: 220;
  overflow: hidden;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 14px;
}
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(68, 111, 210, 0.14));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 10px 26px -12px rgba(66, 116, 255, 0.65);
  flex: 0 0 auto;
}
.brand-mark img { width: 100%; height: 100%; display: block; }
.brand-text { min-width: 0; }
.brand-name { font-size: 16px; font-weight: 800; letter-spacing: 0.02em; white-space: nowrap; }
.brand-name em { font-style: normal; color: var(--blue-2); }
.brand-sub { font-size: 10px; color: var(--muted-2); letter-spacing: 0.18em; text-transform: uppercase; margin-top: 1px; }
.nav-scroll { overflow-y: auto; overflow-x: hidden; flex: 1; padding-right: 2px; margin-right: -2px; }
.nav-group { margin: 15px 0 6px; }
.nav-group-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--faint);
  padding: 0 12px;
  margin-bottom: 7px;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 41px;
  padding: 0 12px;
  border-radius: 13px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  transition: all 0.22s var(--ease);
  position: relative;
  white-space: nowrap;
  cursor: pointer;
}
.nav-item + .nav-item { margin-top: 3px; }
.nav-item .ico { flex: 0 0 auto; opacity: 0.78; transition: opacity 0.2s; }
.nav-item:hover { color: var(--ink); background: rgba(255, 255, 255, 0.055); }
.nav-item.active {
  color: #fff;
  background: linear-gradient(120deg, rgba(91, 140, 255, 0.26), rgba(82, 226, 195, 0.08));
  border-color: rgba(125, 170, 255, 0.26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 8px 22px -14px rgba(81, 138, 255, 0.8);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  translate: 0 -50%;
  width: 3px;
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(var(--blue-2), var(--cyan));
  box-shadow: 0 0 14px rgba(90, 180, 255, 0.8);
}
.nav-item.active .ico { opacity: 1; }
.nav-badge {
  margin-left: auto;
  min-width: 19px;
  height: 19px;
  border-radius: 99px;
  padding: 0 6px;
  font-size: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 122, 145, 0.18);
  color: #ffb3c0;
  border: 1px solid rgba(255, 122, 145, 0.26);
  font-family: var(--font-num);
}
.sidebar-foot {
  margin-top: 10px;
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(68, 112, 208, 0.16), rgba(37, 197, 168, 0.06));
  border: 1px solid var(--stroke);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.55;
}
.sidebar-foot b { color: var(--ink-2); font-weight: 600; }

/* ==========================================================================
   Main / topbar
   ========================================================================== */
.main { min-width: 0; padding: 2px 4px 42px 0; }
.topbar {
  height: 62px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 6px;
  margin-bottom: 20px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mobile-nav-btn { display: none !important; }
.crumb { font-size: 12px; color: var(--muted-2); letter-spacing: 0.02em; }
.crumb b { color: var(--ink-2); font-weight: 600; }
.crumb-link { border: 0; background: transparent; color: var(--muted-2); font: inherit; cursor: pointer; padding: 2px 0; }
.crumb-link:hover { color: var(--blue-2); }
.command {
  margin-left: auto;
  width: min(360px, 32vw);
  height: 39px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 13px;
  padding: 0 13px;
  color: var(--muted-2);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--stroke);
  transition: all 0.2s;
  cursor: pointer;
}
.command:hover { background: rgba(255, 255, 255, 0.07); border-color: var(--stroke-strong); color: var(--muted); }
.command span { font-size: 12px; }
.command kbd {
  margin-left: auto;
  font-family: var(--font-num);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted-2);
}
.top-actions { display: flex; align-items: center; gap: 9px; }
.icon-btn {
  width: 39px;
  height: 39px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--stroke);
  transition: all 0.2s var(--ease);
  position: relative;
}
.icon-btn:hover { color: var(--ink); background: rgba(255, 255, 255, 0.085); transform: translateY(-1px); }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); box-shadow: 0 0 9px var(--red); }
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 43px;
  padding: 0 12px 0 6px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  transition: all 0.2s;
}
.user-chip:hover { background: rgba(255, 255, 255, 0.075); }
.avatar {
  width: 31px;
  height: 31px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #07101f;
  background: linear-gradient(140deg, #9dccff, #5f8cff 55%, #8cffe1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.user-meta { line-height: 1.25; }
.user-meta b { display: block; font-size: 12px; font-weight: 600; }
.user-meta small { color: var(--muted-2); font-size: 10px; }
.main-body { animation: fadeUp 0.45s var(--ease) both; }

/* page header */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 4px 2px 22px;
  flex-wrap: wrap;
}
/* Align the dashboard greeting lines with the hero title inside the glass card. */
.dashboard-head {
  margin-left: 0;
  margin-right: 0;
  padding: 0 27px;
}
.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 7px;
}
.page-kicker::before { content: ""; width: 16px; height: 1px; background: var(--cyan); opacity: 0.6; }
.page-title { font-size: clamp(23px, 2.2vw, 30px); font-weight: 800; letter-spacing: -0.03em; }
.page-sub { color: var(--muted); font-size: 12.5px; margin-top: 7px; max-width: 700px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  --btn-bg: rgba(255, 255, 255, 0.06);
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--btn-bg);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
  user-select: none;
}
.btn:hover { color: #fff; border-color: var(--stroke-strong); background: rgba(255, 255, 255, 0.095); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.985); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; transform: none; }
.btn.primary {
  color: #fff;
  border-color: rgba(137, 176, 255, 0.45);
  background: linear-gradient(135deg, rgba(116, 164, 255, 0.98), rgba(73, 111, 245, 0.96));
  box-shadow: 0 12px 28px -14px rgba(89, 138, 255, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn.primary:hover { background: linear-gradient(135deg, #8ab8ff, #557cf8); box-shadow: 0 16px 34px -14px rgba(89, 138, 255, 0.95); }
.btn.mint {
  color: #04241e;
  border-color: rgba(146, 255, 229, 0.55);
  background: linear-gradient(135deg, #8dffe1, #3fe0b8);
  box-shadow: 0 12px 28px -16px rgba(51, 229, 184, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn.mint:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.subtle { background: rgba(255, 255, 255, 0.035); color: var(--muted); }
.btn.danger { color: #ffc2cc; border-color: rgba(255, 113, 136, 0.26); background: rgba(255, 113, 136, 0.11); }
.btn.danger:hover { background: rgba(255, 113, 136, 0.18); border-color: rgba(255, 113, 136, 0.4); }
.btn.sm { height: 31px; padding: 0 11px; font-size: 11.5px; border-radius: 9px; gap: 6px; }
.btn.lg { height: 46px; padding: 0 22px; border-radius: 14px; font-size: 13.5px; }
.btn.block { width: 100%; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--blue-2);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.link-btn:hover { color: #c6ddff; }
.link-btn.danger { color: var(--red); }
.link-btn:disabled { color: var(--faint); cursor: not-allowed; }

/* ==========================================================================
   Forms
   ========================================================================== */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.label { font-size: 11.5px; color: var(--muted); letter-spacing: 0.03em; display: flex; align-items: center; gap: 6px; }
.label .req { color: var(--red); }
.hint { font-size: 11px; color: var(--faint); line-height: 1.55; }
.input, .select, .textarea {
  width: 100%;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(4, 12, 24, 0.36);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent);
  color: var(--ink);
  padding: 0 13px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  font-size: 12.5px;
}
.textarea { height: auto; min-height: 86px; padding: 11px 13px; resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: rgba(255, 255, 255, 0.16); }
.input:focus, .select:focus, .textarea:focus {
  border-color: rgba(106, 158, 255, 0.62);
  box-shadow: 0 0 0 3px rgba(79, 127, 255, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  background: rgba(5, 15, 30, 0.55);
}
.select {
  appearance: none;
  cursor: pointer;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%238fa6c6' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}
.select option { background: #0c1929; color: var(--ink); }
.input-group { display: flex; gap: 10px; align-items: center; }
.input-icon { position: relative; flex: 1; min-width: 0; }
.input-icon .ico { position: absolute; left: 13px; top: 50%; translate: 0 -50%; color: var(--faint); pointer-events: none; }
.input-icon .input { padding-left: 39px; }
.input-affix { position: relative; display: flex; align-items: center; }
.input-affix .input { padding-right: 64px; }
.affix-btn {
  position: absolute; right: 4px; top: 4px; bottom: 4px; min-width: 52px; padding: 0 9px;
  border: 0; border-radius: 9px; background: linear-gradient(145deg, rgba(95,140,255,.32), rgba(74,220,199,.18));
  color: var(--ink); font: inherit; font-size: 11px; font-weight: 700; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16);
}
.affix-btn:hover { background: linear-gradient(145deg, rgba(95,140,255,.5), rgba(74,220,199,.28)); }
.affix-btn:disabled { opacity: .6; cursor: wait; }
.input-affix .affix-btn { right: 4px; }
.supplier-combobox { position: relative; }
.supplier-combo-input { position: relative; display: flex; align-items: center; }
.supplier-combo-input .input { padding-right: 104px; }
.supplier-combo-input .affix-btn { right: 38px; min-width: 54px; }
.combo-chevron {
  position: absolute; right: 4px; top: 4px; bottom: 4px; width: 30px; border: 0; border-radius: 9px;
  background: transparent; color: var(--faint); display: grid; place-items: center; cursor: pointer;
}
.combo-chevron:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.supplier-menu {
  position: absolute; z-index: 120; left: 0; right: 0; top: calc(100% + 6px); max-height: 246px; overflow: auto;
  padding: 6px; border-radius: 13px; border: 1px solid var(--stroke-strong);
  background: rgba(9, 20, 34, .98); box-shadow: var(--shadow-float);
}
.supplier-option {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2);
  font: inherit; font-size: 12px; text-align: left; cursor: pointer;
}
.supplier-option:hover { background: rgba(95,140,255,.14); color: var(--ink); }
.supplier-option small { color: var(--faint); font-family: var(--font-num); font-size: 10px; }
.supplier-empty { padding: 12px 10px; color: var(--faint); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section { padding: 4px 0 18px; }
.form-section + .form-section { border-top: 1px solid var(--hairline); padding-top: 20px; }
.form-section-title { font-size: 12px; color: var(--ink-2); font-weight: 700; margin-bottom: 13px; display: flex; align-items: center; gap: 8px; }
.form-section-title::before { content: ""; width: 3px; height: 13px; border-radius: 3px; background: linear-gradient(var(--blue-2), var(--cyan)); }
.checkline { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
input[type="checkbox"], input[type="radio"] { accent-color: #5f8cff; width: 15px; height: 15px; }
.searchbar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--stroke);
}
.searchbar .field { flex: 1 1 150px; }
.searchbar .field.wide { flex: 2 1 240px; }
.searchbar .actions { display: flex; gap: 8px; align-items: center; }
.field-inline { display: flex; align-items: center; gap: 9px; height: 38px; }

/* ==========================================================================
   Layout grids & cards
   ========================================================================== */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-dash { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); }
.grid-dash-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; } .mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .ink2 { color: var(--ink-2); }
.small { font-size: 11.5px; } .tiny { font-size: 10.5px; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.mono { font-family: var(--font-code); font-size: 11.5px; letter-spacing: 0.01em; }
.nowrap { white-space: nowrap; } .ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-right { text-align: right; } .text-center { text-align: center; }

.kpi-card {
  border-radius: var(--radius-xl);
  padding: 19px 19px 17px;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  transition: transform 0.28s var(--ease), border-color 0.28s, box-shadow 0.28s;
}
.kpi-card:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, 0.17); box-shadow: var(--shadow-float); }
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.kpi-label { font-size: 11.5px; color: var(--muted); letter-spacing: 0.04em; display: flex; align-items: center; gap: 7px; }
.kpi-icon {
  width: 33px;
  height: 33px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
  color: var(--blue-2);
  flex: 0 0 auto;
}
.kpi-value { font-family: var(--font-num); font-size: clamp(23px, 2.1vw, 30px); font-weight: 600; line-height: 1.15; margin-top: 13px; letter-spacing: -0.02em; }
.kpi-value .unit { font-family: var(--font); font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 5px; letter-spacing: 0; }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 10.5px; color: var(--faint); }
.kpi-method { margin-top: 12px; font-size: 10px; line-height: 1.3; color: var(--mint); letter-spacing: 0.06em; }
.trend { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-num); font-size: 10.5px; }
.trend.up { color: var(--mint); } .trend.down { color: var(--red); } .trend.flat { color: var(--muted-2); }
.kpi-card.accent-blue { background: linear-gradient(150deg, rgba(82, 132, 255, 0.2), rgba(22, 41, 74, 0.42) 58%, rgba(255, 255, 255, 0.02)), var(--glass); }
.kpi-card.accent-mint { background: linear-gradient(150deg, rgba(48, 219, 176, 0.15), rgba(19, 54, 57, 0.38) 58%, rgba(255, 255, 255, 0.02)), var(--glass); }
.kpi-card.accent-amber { background: linear-gradient(150deg, rgba(246, 195, 91, 0.13), rgba(60, 46, 26, 0.34) 60%, rgba(255, 255, 255, 0.02)), var(--glass); }
.kpi-card.accent-rose { background: linear-gradient(150deg, rgba(255, 113, 136, 0.13), rgba(60, 28, 42, 0.34) 60%, rgba(255, 255, 255, 0.02)), var(--glass); }
.kpi-card.accent-violet { background: linear-gradient(150deg, rgba(169, 139, 255, 0.15), rgba(42, 33, 70, 0.38) 60%, rgba(255, 255, 255, 0.02)), var(--glass); }
.kpi-card .sparkline { position: absolute; right: 18px; bottom: 10px; width: 52%; height: 42%; opacity: 0.5; pointer-events: none; overflow: hidden; }
.kpi-card .sparkline svg { width: 100%; height: 100%; display: block; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 28px 2px 14px; }
.section-title { font-size: 16px; font-weight: 750; display: flex; align-items: center; gap: 9px; }
.section-title .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.section-sub { font-size: 11.5px; color: var(--muted-2); margin-top: 3px; }

/* ==========================================================================
   Charts
   ========================================================================== */
.chart-wrap { width: 100%; position: relative; }
.chart-wrap svg { width: 100%; height: auto; overflow: visible; display: block; }
.chart-legend { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.chart-tooltip {
  position: absolute;
  pointer-events: none;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 10.5px;
  background: rgba(5, 14, 26, 0.92);
  border: 1px solid var(--stroke-strong);
  box-shadow: var(--shadow-card);
  color: var(--ink-2);
  transform: translate(-50%, -110%);
  z-index: 8;
  white-space: nowrap;
  line-height: 1.6;
}
.chart-tooltip b { color: #fff; font-family: var(--font-num); }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.donut-center b { font-family: var(--font-num); font-size: 23px; font-weight: 600; display: block; line-height: 1.1; }
.donut-center span { font-size: 10px; color: var(--muted-2); letter-spacing: 0.12em; }
.donut-layout { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut-legend { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 130px; }
.donut-legend-row { display: flex; align-items: center; gap: 9px; font-size: 11.5px; color: var(--muted); }
.donut-legend-row b { margin-left: auto; font-family: var(--font-num); color: var(--ink-2); font-weight: 600; }
.donut-legend-row .sw { width: 8px; height: 8px; border-radius: 3px; }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-card { border-radius: var(--radius-xl); overflow: hidden; }
.table-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 16px 18px; border-bottom: 1px solid var(--hairline); }
.table-toolbar .grow { flex: 1; }
.table-wrap { overflow: auto; max-height: calc(100vh - 330px); min-height: 160px; position: relative; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 760px; }
.data-table th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(10, 21, 37, 0.98);
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: left;
  padding: 11px 13px;
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
  user-select: none;
}
.data-table td {
  padding: 12px 13px;
  border-bottom: 1px solid rgba(146, 178, 220, 0.075);
  font-size: 12px;
  color: var(--ink-2);
  vertical-align: middle;
  white-space: nowrap;
}
.data-table tbody tr { transition: background 0.16s; cursor: default; }
.data-table tbody tr:hover { background: rgba(118, 163, 255, 0.045); }
.data-table tbody tr.selected { background: rgba(82, 132, 255, 0.09); }
.data-table tbody tr.disabled { opacity: 0.42; filter: grayscale(1); cursor: default; }
.data-table tbody tr.disabled:hover { background: transparent; }
.data-table tbody tr.disabled input[type="checkbox"] { cursor: not-allowed; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .cell-main { color: var(--ink); font-weight: 550; }
.data-table .cell-sub { display: block; font-size: 10px; color: var(--faint); margin-top: 2px; }
.data-table .code { font-family: var(--font-code); font-size: 10.5px; letter-spacing: 0.02em; color: #c2d6f5; }
.data-table .num { text-align: right; }
.data-table th.num { text-align: right; }
.data-table .actions-cell { text-align: right; }
.data-table th.actions-col, .data-table td.actions-col {
  position: sticky;
  right: 0;
  background: rgba(9, 20, 35, 0.97);
  box-shadow: -14px 0 20px -22px rgba(0, 0, 0, 0.95);
  z-index: 4;
}
.data-table th.actions-col { z-index: 7; background: rgba(10, 21, 37, 0.98); }
.data-table tbody tr:hover td.actions-col { background: rgba(13, 27, 46, 0.98); }
.data-table .row-check { width: 36px; }
.col-resizer { position: absolute; right: 0; top: 0; bottom: 0; width: 5px; cursor: col-resize; }
.col-resizer:hover { background: rgba(95, 140, 255, 0.4); }
thead th { position: sticky; }
.th-inner { position: relative; display: flex; align-items: center; gap: 5px; padding-right: 4px; }
th.resizable .col-resizer { display: block; }
.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 18px;
  border-top: 1px solid var(--hairline);
  color: var(--muted-2);
  font-size: 11px;
  flex-wrap: wrap;
}
.pager { display: flex; align-items: center; gap: 7px; }
.pager button {
  min-width: 29px;
  height: 29px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 11px;
  display: grid;
  place-items: center;
}
.pager button:hover:not(:disabled) { color: #fff; background: rgba(255, 255, 255, 0.075); }
.pager button.on { color: #fff; background: rgba(87, 134, 255, 0.2); border-color: rgba(119, 162, 255, 0.4); }
.pager button:disabled { opacity: 0.3; cursor: not-allowed; }
.table-actions { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }

/* Bulk selection bar (shared by products / purchases / scan lists) */
.bulk-bar {
  position: fixed;
  left: calc(50% + (var(--content-left) - var(--shell-pad)) / 2);
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 42px);
  padding: 9px 12px 9px 16px;
  border-radius: 16px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015)), rgba(9, 20, 36, 0.97);
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(18px) saturate(140%);
  animation: bulkIn 0.22s var(--ease);
}
.bulk-bar .bulk-count { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.bulk-bar .bulk-count b { font-size: 13px; color: var(--ink); margin: 0 1px; }
.bulk-bar .bulk-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.bulk-bar .bulk-clear { color: var(--faint); }
.bulk-bar .btn.sm { height: 30px; }
@keyframes bulkIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
.bulk-leave-active { transition: opacity 0.16s ease, transform 0.16s ease; }
.bulk-leave-to { opacity: 0; transform: translate(-50%, 8px); }
.batch-check { flex: 0 0 auto; padding: 2px; }
.batch-check input { margin: 0; }
.alert-row.selected { border-color: rgba(111, 158, 255, 0.42); background: rgba(82, 132, 255, 0.12); }

.product-cell { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.thumb {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  background: linear-gradient(145deg, rgba(105, 157, 255, 0.24), rgba(56, 216, 181, 0.13));
  border: 1px solid var(--stroke);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-family: var(--font-num);
  font-size: 11px;
  color: #cfe2ff;
  text-transform: uppercase;
}
.thumb.lg { width: 76px; height: 76px; border-radius: 17px; font-size: 20px; }
.thumb.sm { width: 28px; height: 28px; border-radius: 8px; font-size: 9px; }
.stock-pill { font-family: var(--font-num); font-size: 12px; font-weight: 600; }
.stock-pill.zero { color: var(--faint); font-weight: 400; }
.stock-pill.low { color: var(--amber); }
.virtual-cell { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 1px; line-height: 1.35; }
.virtual-cell > span:first-child { font-family: var(--font-num); font-weight: 600; }
.virtual-sub { font-size: 9.5px; color: var(--muted-2); font-weight: 400; white-space: nowrap; letter-spacing: 0; }

/* status chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 23px;
  padding: 0 9px;
  border-radius: 99px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--stroke);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  white-space: nowrap;
}
.chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.chip.no-dot::before { display: none; }
.chip.blue { color: #9dc2ff; background: rgba(91, 140, 255, 0.13); border-color: rgba(120, 164, 255, 0.24); }
.chip.mint, .chip.green { color: #93f5da; background: rgba(52, 217, 168, 0.11); border-color: rgba(76, 230, 190, 0.22); }
.chip.amber { color: #ffdb94; background: rgba(246, 195, 91, 0.11); border-color: rgba(246, 195, 91, 0.22); }
.chip.rose, .chip.red { color: #ffb0bf; background: rgba(255, 113, 136, 0.11); border-color: rgba(255, 113, 136, 0.22); }
.chip.violet { color: #cfbfff; background: rgba(169, 139, 255, 0.11); border-color: rgba(169, 139, 255, 0.22); }
.chip.slate { color: var(--muted); background: rgba(255, 255, 255, 0.04); }
.chip.tiny { height: 20px; font-size: 9.5px; padding: 0 8px; }

/* empty / loading */
.empty-state { padding: 54px 24px; text-align: center; color: var(--muted-2); }
.empty-art {
  width: 58px;
  height: 58px;
  border-radius: 19px;
  margin: 0 auto 15px;
  display: grid;
  place-items: center;
  color: rgba(143, 172, 215, 0.55);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--stroke);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.empty-title { color: var(--ink-2); font-weight: 600; font-size: 13px; margin-bottom: 5px; }
.empty-sub { font-size: 11.5px; max-width: 340px; margin: 0 auto; line-height: 1.7; }
.skeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.09) 50%, rgba(255, 255, 255, 0.04) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  height: 13px;
}
.spinner {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--blue-2);
  animation: spin 0.8s linear infinite;
}
.loading-block { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 60px 20px; color: var(--muted); font-size: 12px; }

/* ==========================================================================
   Dashboard extras
   ========================================================================== */
.hero {
  border-radius: var(--radius-2xl);
  padding: 24px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  position: relative;
}
.hero::after {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  right: -90px;
  top: -160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(89, 138, 255, 0.32), transparent 65%);
  filter: blur(20px);
  pointer-events: none;
}
.hero-main { position: relative; z-index: 2; }
.hero-greet { font-size: 11px; letter-spacing: 0.15em; color: var(--cyan); text-transform: uppercase; }
.hero-title { font-size: clamp(24px, 2.6vw, 34px); font-weight: 800; letter-spacing: -0.035em; margin-top: 6px; }
.hero-title span { background: linear-gradient(100deg, #e9f3ff, #8fc0ff 48%, #7fffe1); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { color: var(--muted); font-size: 12px; margin-top: 8px; max-width: 540px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 2; }
.hero-meta { display: flex; gap: 18px; margin-top: 20px; flex-wrap: wrap; }
.hero-meta div { font-size: 10.5px; color: var(--faint); }
.hero-meta b { display: block; font-family: var(--font-num); font-size: 15px; color: var(--ink-2); font-weight: 600; margin-top: 2px; }
.alert-list { display: flex; flex-direction: column; gap: 10px; }
.alert-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border-radius: 13px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.025);
  transition: all 0.2s;
  cursor: pointer;
}
.alert-row:hover { background: rgba(255, 255, 255, 0.05); border-color: var(--stroke); transform: translateX(2px); }
.alert-icon { width: 31px; height: 31px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; }
.alert-icon.amber { color: var(--amber); background: rgba(246, 195, 91, 0.1); }
.alert-icon.rose { color: var(--red); background: rgba(255, 113, 136, 0.1); }
.alert-icon.blue { color: var(--blue-2); background: rgba(91, 140, 255, 0.1); }
.alert-icon.mint { color: var(--mint); background: rgba(52, 217, 168, 0.1); }
.alert-body { min-width: 0; flex: 1; }
.alert-body b { font-size: 12px; font-weight: 600; display: block; }
.alert-body span { font-size: 10.5px; color: var(--muted-2); }
.alert-value { font-family: var(--font-num); font-size: 15px; color: var(--ink); }
.alert-value small { display: block; font-family: var(--font); font-size: 9px; color: var(--faint); text-align: right; }

.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 5px; bottom: 6px; width: 1px; background: linear-gradient(var(--stroke-strong), transparent); }
.timeline-item { position: relative; padding: 0 0 16px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: -17.5px; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--blue-2); box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.12); }
.timeline-item.ok::before { background: var(--mint); box-shadow: 0 0 0 3px rgba(52, 217, 168, 0.1); }
.timeline-item.warn::before { background: var(--amber); box-shadow: 0 0 0 3px rgba(246, 195, 91, 0.1); }
.timeline-item.danger::before { background: var(--red); box-shadow: 0 0 0 3px rgba(255, 113, 136, 0.1); }
.timeline-time { font-size: 9.5px; color: var(--faint); font-family: var(--font-num); }
.timeline-title { font-size: 11.5px; font-weight: 600; color: var(--ink-2); margin-top: 2px; }
.timeline-sub { font-size: 10.5px; color: var(--muted-2); margin-top: 1px; }

.rank-list { display: flex; flex-direction: column; gap: 11px; }
.rank-row { display: flex; align-items: center; gap: 11px; }
.rank-no { font-family: var(--font-num); font-size: 10px; color: var(--faint); width: 16px; }
.rank-bar { flex: 1; min-width: 0; }
.rank-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.rank-label b { color: var(--ink-2); font-weight: 500; max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-label span { font-family: var(--font-num); font-size: 10px; color: var(--muted-2); }
.rank-track { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.05); overflow: hidden; }
.rank-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, rgba(91, 140, 255, 0.8), rgba(84, 230, 211, 0.85)); }

/* ==========================================================================
   Login
   ========================================================================== */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(430px, 0.9fr);
  padding: 22px;
  gap: 22px;
}
.login-visual {
  border-radius: var(--radius-2xl);
  padding: clamp(28px, 4vw, 58px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
  min-height: calc(100vh - 44px);
}
.login-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 420px at 72% 58%, rgba(86, 137, 255, 0.28), transparent 65%),
    radial-gradient(460px 380px at 30% 80%, rgba(55, 223, 185, 0.14), transparent 70%);
  pointer-events: none;
}
.login-brand { display: flex; align-items: center; gap: 14px; position: relative; z-index: 2; }
.login-brand .brand-mark { width: 54px; height: 54px; border-radius: 18px; }
.login-brand .brand-name { font-size: 18px; }
.login-brand .brand-sub { font-size: 9px; }
.login-hero { position: relative; z-index: 2; margin: 7vh 0; }
.login-hero .eyebrow { color: var(--cyan); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; }
.login-hero h1 { font-size: clamp(36px, 4.8vw, 68px); font-weight: 800; line-height: 1.08; letter-spacing: -0.06em; margin: 16px 0 18px; }
.login-hero h1 span { display: block; background: linear-gradient(102deg, #f4f9ff 0%, #9dc6ff 48%, #80ffe0 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-hero p { color: var(--muted); font-size: 13px; max-width: 500px; line-height: 1.85; }
.login-features { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.login-feature { display: inline-flex; align-items: center; gap: 7px; font-size: 10.5px; color: var(--muted); border: 1px solid var(--stroke); background: rgba(255, 255, 255, 0.035); border-radius: 99px; padding: 7px 12px; }
.login-foot { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 10px; color: var(--faint); flex-wrap: wrap; }
.login-form-side { display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card {
  width: 100%;
  max-width: 428px;
  border-radius: var(--radius-2xl);
  padding: clamp(28px, 3.4vw, 42px);
  position: relative;
  overflow: hidden;
}
.login-card::after { content: ""; position: absolute; width: 280px; height: 280px; right: -140px; top: -150px; border-radius: 50%; background: radial-gradient(circle, rgba(84, 230, 211, 0.16), transparent 65%); pointer-events: none; }
.login-card h2 { font-size: 25px; font-weight: 800; letter-spacing: -0.035em; }
.login-card .sub { color: var(--muted); font-size: 12px; margin: 8px 0 28px; line-height: 1.7; }
.login-card .field + .field { margin-top: 16px; }
.login-card .input { height: 47px; border-radius: 14px; font-size: 13px; background: rgba(3, 10, 20, 0.4); }
.login-card .btn.lg { margin-top: 22px; height: 47px; }
.login-hint { margin-top: 20px; padding: 12px 14px; border-radius: 13px; background: rgba(91, 140, 255, 0.07); border: 1px solid rgba(91, 140, 255, 0.16); font-size: 10.5px; color: var(--muted); line-height: 1.7; }
.login-hint b { color: var(--ink-2); font-family: var(--font-num); }
.login-legal { margin-top: 22px; text-align: center; font-size: 9.5px; color: var(--faint); line-height: 1.8; }
.login-error { margin-top: 14px; padding: 10px 12px; border-radius: 11px; font-size: 11px; color: #ffc0ca; background: rgba(255, 113, 136, 0.1); border: 1px solid rgba(255, 113, 136, 0.2); }
.login-logo-float { position: absolute; right: 8%; bottom: 15%; width: 200px; opacity: 0.85; filter: drop-shadow(0 30px 60px rgba(49, 98, 255, 0.4)); }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-14px) rotate(2deg); } }

/* Low-power renderer mode: used automatically on AMD Radeon iGPU (e.g. 880M),
   where large backdrop-filter surfaces can push Windows GPU usage to ~99%.
   Layout, colours and information hierarchy stay identical; only the expensive
   blur / glow / animation layers are removed. */
.performance-lite .ambient,
.performance-lite .ambient::before,
.performance-lite .ambient::after,
.performance-lite .grid-glow,
.performance-lite .flow-lines { display: none !important; }
.performance-lite *,
.performance-lite *::before,
.performance-lite *::after {
  animation-duration: 0.001ms !important;
  animation-delay: 0ms !important;
  transition-duration: 0.001ms !important;
}
.performance-lite .glass,
.performance-lite .sidebar,
.performance-lite .topbar,
.performance-lite .main,
.performance-lite .modal,
.performance-lite .drawer {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
}
.performance-lite .login-logo-float,
.performance-lite .kpi-icon,
.performance-lite .scan-product,
.performance-lite .hero,
.performance-lite .warehouse-card {
  filter: none !important;
  box-shadow: none !important;
  animation: none !important;
}
.performance-lite .sidebar { background: rgba(8, 18, 31, 0.96); }
.performance-lite .topbar { background: rgba(8, 18, 31, 0.9); }
.performance-lite .glass { background: rgba(11, 24, 40, 0.88); }

/* ==========================================================================
   Modals / drawers / toasts
   ========================================================================== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(2, 7, 14, 0.62);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}
.overlay.confirm-overlay { z-index: 260; }
/* Every dialog (modal / drawer / confirm / command palette) is laid out inside
   the content column, not centred on the whole viewport. Centring on the
   viewport pushed a wide dialog's left edge beneath the sticky sidebar on
   laptop widths (<=1440px), clipping its header and top-left corner. */
.overlay.dialog-overlay {
  padding-left: var(--content-left);
  padding-right: var(--shell-pad);
}
.modal {
  width: min(680px, 100%);
  max-height: calc(100vh - 44px);
  border-radius: var(--radius-2xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn 0.3s var(--ease);
}
.modal.wide { width: min(980px, 100%); }
.modal.narrow { width: min(480px, 100%); }
.modal-head { display: flex; align-items: flex-start; gap: 16px; padding: 22px 24px 16px; border-bottom: 1px solid var(--hairline); }
.modal-head h3 { font-size: 17px; font-weight: 750; }
.modal-head .sub { font-size: 11px; color: var(--muted-2); margin-top: 4px; }
.modal-close { margin-left: auto; flex: 0 0 auto; }
.modal-body { padding: 22px 24px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 16px 24px 20px; border-top: 1px solid var(--hairline); }
.modal-foot .left { margin-right: auto; }
.drawer-overlay { justify-content: flex-end; align-items: stretch; padding: 0; }
.overlay.drawer-overlay { padding: 0 0 0 var(--content-left); }
.drawer {
  width: min(640px, 94vw);
  max-width: 100%;
  height: 100%;
  border-radius: 26px 0 0 26px;
  display: flex;
  flex-direction: column;
  animation: drawerIn 0.34s var(--ease);
}
.drawer.wide { width: min(880px, 96vw); }
.drawer-head { padding: 22px 24px 16px; border-bottom: 1px solid var(--hairline); display: flex; align-items: flex-start; gap: 12px; }
.drawer-body { padding: 22px 24px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 16px 24px 20px; border-top: 1px solid var(--hairline); display: flex; justify-content: flex-end; gap: 10px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(0.975); } to { opacity: 1; transform: none; } }
@keyframes drawerIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }

.toast-stack { position: fixed; right: 24px; bottom: 24px; z-index: 300; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-2);
  background: rgba(8, 20, 35, 0.9);
  border: 1px solid var(--stroke-strong);
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(20px);
  animation: toastIn 0.3s var(--ease);
}
.toast .toast-ico { flex: 0 0 auto; margin-top: 1px; }
.toast.success { border-color: rgba(52, 217, 168, 0.3); }
.toast.success .toast-ico { color: var(--mint); }
.toast.error { border-color: rgba(255, 113, 136, 0.32); }
.toast.error .toast-ico { color: var(--red); }
.toast.info .toast-ico { color: var(--blue-2); }
.toast.warning .toast-ico { color: var(--amber); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }

.confirm-text { font-size: 13px; color: var(--muted); line-height: 1.75; }
.confirm-text b { color: var(--ink-2); }

/* ==========================================================================
   Detail layouts, tabs, misc
   ========================================================================== */
.tabs { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(255, 255, 255, 0.035); border: 1px solid var(--stroke); }
.tab { height: 30px; padding: 0 13px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); font-size: 11.5px; font-weight: 550; display: flex; align-items: center; gap: 6px; }
.tab:hover { color: var(--ink-2); }
.tab.on { color: #fff; background: rgba(91, 140, 255, 0.16); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
.info-item { padding: 4px 0; min-width: 0; }
.info-item label { display: block; font-size: 9.5px; color: var(--faint); letter-spacing: 0.06em; margin-bottom: 3px; }
.info-item div { font-size: 12px; color: var(--ink-2); }
.info-item .mono { font-size: 11px; }
.detail-hero { display: flex; gap: 18px; align-items: center; padding: 20px; border-radius: var(--radius-lg); background: rgba(255, 255, 255, 0.03); border: 1px solid var(--stroke); }
.detail-hero .meta { min-width: 0; flex: 1; }
.detail-hero h2 { font-size: 18px; letter-spacing: -0.02em; }
.detail-hero .codes { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.copy-code {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-code);
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--stroke);
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.2s;
}
.copy-code:hover { background: rgba(91, 140, 255, 0.12); border-color: rgba(91, 140, 255, 0.3); color: #fff; }
.copy-code .ico { opacity: 0.5; }
.formula {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(82, 132, 255, 0.06);
  border: 1px dashed rgba(111, 158, 255, 0.24);
  font-family: var(--font-num);
  letter-spacing: 0.03em;
  color: #bcd4f8;
  font-size: 12px;
}
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: 13px; font-size: 11.5px; line-height: 1.7; color: var(--muted); background: rgba(255, 255, 255, 0.03); border: 1px solid var(--stroke); }
.notice .ico { flex: 0 0 auto; margin-top: 1px; color: var(--blue-2); }
.notice.warn { background: rgba(246, 195, 91, 0.055); border-color: rgba(246, 195, 91, 0.16); }
.notice.warn .ico { color: var(--amber); }
.notice.danger { background: rgba(255, 113, 136, 0.06); border-color: rgba(255, 113, 136, 0.18); }
.notice.danger .ico { color: var(--red); }
.notice.success { background: rgba(52, 217, 168, 0.055); border-color: rgba(52, 217, 168, 0.16); }
.notice.success .ico { color: var(--mint); }
.stat-inline { display: flex; gap: 26px; flex-wrap: wrap; }
.stat-inline > div { min-width: 88px; }
.stat-inline label { display: block; font-size: 9.5px; color: var(--faint); letter-spacing: 0.07em; }
.stat-inline b { display: block; font-family: var(--font-num); font-size: 19px; font-weight: 600; margin-top: 3px; }
.stat-inline b small { font-family: var(--font); font-size: 10px; color: var(--muted); margin-left: 3px; font-weight: 400; }
.amount { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.amount.pos { color: var(--mint); } .amount.neg { color: var(--red); }
.toolbar-tight { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.segmented { display: inline-flex; gap: 3px; background: rgba(255, 255, 255, 0.035); border: 1px solid var(--stroke); padding: 3px; border-radius: 10px; }
.segmented button { height: 27px; padding: 0 11px; border: 0; border-radius: 7px; background: transparent; color: var(--muted-2); font-size: 10.5px; font-weight: 600; }
.segmented button.on { background: rgba(255, 255, 255, 0.09); color: var(--ink); }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.perm-group { border: 1px solid var(--hairline); border-radius: 14px; padding: 14px; }
.perm-group h4 { font-size: 11px; color: var(--cyan); margin-bottom: 10px; letter-spacing: 0.06em; }
.perm-item { display: flex; align-items: flex-start; gap: 9px; padding: 5px 0; font-size: 11.5px; color: var(--muted); cursor: pointer; line-height: 1.45; }
.perm-item input { margin-top: 2px; }

/* scan */
.scan-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr); gap: 18px; align-items: start; }
.scan-stage { border-radius: var(--radius-2xl); padding: 22px; overflow: hidden; position: relative; }
.scan-mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.scan-mode {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 11px 10px;
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}
.scan-mode .mode-ico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.05); color: var(--muted); flex: 0 0 auto; }
.scan-mode:hover { border-color: var(--stroke-strong); color: var(--ink-2); }
.scan-mode.on { background: linear-gradient(135deg, rgba(91, 140, 255, 0.2), rgba(84, 230, 211, 0.08)); border-color: rgba(114, 161, 255, 0.35); color: #fff; }
.scan-mode.on .mode-ico { background: rgba(91, 140, 255, 0.2); color: #cfe2ff; }
.scan-input-row { display: flex; gap: 9px; margin-top: 18px; }
.scan-input {
  flex: 1;
  height: 54px;
  border-radius: 15px;
  background: rgba(3, 10, 20, 0.62);
  border: 1px solid rgba(116, 163, 255, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 3px rgba(82, 132, 255, 0.06);
  color: var(--ink);
  padding: 0 17px;
  font-family: var(--font-code);
  font-size: 17px;
  letter-spacing: 0.06em;
  outline: none;
  transition: all 0.2s;
}
.scan-input::placeholder { color: var(--faint); font-size: 12px; letter-spacing: 0.02em; font-family: var(--font); }
.scan-input:focus { border-color: rgba(116, 183, 255, 0.7); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 4px rgba(82, 132, 255, 0.1); }
.device-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 13px; font-size: 10.5px; color: var(--muted-2); }
.device-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); }
.device-dot.on { background: var(--mint); box-shadow: 0 0 8px rgba(52, 217, 168, 0.8); }
.device-dot.err { background: var(--red); box-shadow: 0 0 8px rgba(255, 113, 136, 0.8); }
.scan-feedback { margin-top: 14px; border-radius: 12px; padding: 10px 13px; font-size: 11.5px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--stroke); background: rgba(255, 255, 255, 0.03); color: var(--muted); }
.scan-feedback.ok { color: #9df7dd; border-color: rgba(52, 217, 168, 0.25); background: rgba(52, 217, 168, 0.07); }
.scan-feedback.warn { color: #ffd28e; border-color: rgba(246, 195, 91, 0.24); background: rgba(246, 195, 91, 0.07); }
.scan-feedback.err { color: #ffb4c1; border-color: rgba(255, 113, 136, 0.26); background: rgba(255, 113, 136, 0.07); }
.scan-product {
  margin-top: 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
  gap: 19px;
  padding: 19px;
  border-radius: 17px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(82, 132, 255, 0.05));
  border: 1px solid var(--stroke);
  animation: fadeUp 0.3s var(--ease);
}
.scan-product .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
/* Thumbnail keeps its aspect ratio and grows to the card's inner height; the
   19px top padding, 19px flex gap and 19px bottom padding are all identical,
   so the image is inset evenly on the top, left and bottom edges. */
.scan-product .thumb.lg {
  width: auto;
  height: 100%;
  min-height: 152px;
  aspect-ratio: 1 / 1;
  border-radius: 24px;
  font-size: 34px;
  object-fit: cover;
}
.scan-product h3 { font-size: 19px; margin-bottom: 4px; letter-spacing: -0.01em; }
.scan-product .codes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 2px; }
.scan-product .codes .copy-code { font-size: 13px; }
.scan-product .codes .chip { font-size: 11.5px; }
.scan-product .spec-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 26px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
}
.scan-product .spec-grid label { display: block; font-size: 10.5px; color: var(--faint); letter-spacing: 0.04em; margin-bottom: 2px; }
.scan-product .spec-grid div { font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.scan-product .spec-grid .mono { font-size: 13.5px; }
.scan-product .spec-grid b.num { font-size: 16px; }
.scan-lines { border-radius: var(--radius-xl); overflow: hidden; }
.scan-line { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid rgba(146, 178, 220, 0.07); }
.scan-line:last-child { border-bottom: 0; }
.scan-line .thumb { width: 32px; height: 32px; }
.scan-line .info { flex: 1; min-width: 0; }
.scan-line .info b { font-size: 11.5px; font-weight: 550; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-line .info span { font-size: 9.5px; color: var(--faint); font-family: var(--font-num); }
.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--stroke); border-radius: 8px; overflow: hidden; }
.qty-stepper button { width: 25px; height: 25px; border: 0; background: rgba(255, 255, 255, 0.04); color: var(--muted); display: grid; place-items: center; font-size: 13px; }
.qty-stepper button:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.qty-stepper span { width: 32px; text-align: center; font-family: var(--font-num); font-size: 11.5px; }
.scan-summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; flex-wrap: wrap; }
.scan-summary .total { font-family: var(--font-num); font-size: 24px; font-weight: 600; }
.scan-summary .total small { font-family: var(--font); font-size: 10px; color: var(--muted); margin-left: 4px; }
.scan-history { max-height: 190px; overflow-y: auto; }
.scan-event { display: flex; align-items: center; gap: 9px; font-size: 10px; padding: 6px 0; color: var(--muted-2); border-bottom: 1px dashed rgba(146, 178, 220, 0.07); }
.scan-event:last-child { border-bottom: 0; }
.scan-event .seq { font-family: var(--font-num); color: var(--faint); width: 20px; }
.scan-event .code { font-family: var(--font-code); flex: 1; overflow: hidden; text-overflow: ellipsis; }
.scan-event .res { font-size: 9px; color: var(--faint); }
.scan-event.ok .res { color: var(--mint); } .scan-event.warn .res { color: var(--amber); } .scan-event.err .res { color: var(--red); }

/* code generator */
.code-generator { display: grid; grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.4fr); gap: 18px; align-items: start; }
.code-generator .form-grid > .field { min-width: 0; }
.code-generator .form-grid .input,
.code-generator .form-grid .select { width: 100%; height: 44px; }
.prefix-input { text-transform: uppercase; font-family: var(--font-num); font-size: 16px; letter-spacing: 0.12em; text-align: left; }
.locked-style { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid rgba(104, 255, 209, .24); border-radius: 13px; background: rgba(52, 217, 168, .07); }
.locked-style-main { display: flex; align-items: center; gap: 9px; color: var(--mint); font-size: 11px; }
.locked-style-main b { color: var(--ink); font-family: var(--font-num); font-size: 15px; letter-spacing: .06em; }
.style-pill { border-color: rgba(104, 255, 209, .35); color: var(--mint); }
.pending-entry {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 14px; border-radius: 13px; text-align: left;
  border: 1px solid rgba(246, 195, 91, 0.22);
  background: rgba(246, 195, 91, 0.055);
  transition: all 0.2s var(--ease);
}
.pending-entry:hover { border-color: rgba(246, 195, 91, 0.42); background: rgba(246, 195, 91, 0.1); }
.pending-entry-ico { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 11px; display: grid; place-items: center; color: var(--amber); background: rgba(246, 195, 91, 0.12); border: 1px solid rgba(246, 195, 91, 0.2); }
.pending-entry-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pending-entry-main b { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.pending-entry-main small { font-size: 10.5px; color: var(--muted-2); }
.pending-entry-arrow { margin-left: auto; color: var(--faint); flex: 0 0 auto; }
.pending-entry.is-empty { border-color: var(--hairline); background: rgba(255, 255, 255, 0.018); }
.pending-entry.is-empty .pending-entry-ico { color: var(--faint); background: rgba(255, 255, 255, 0.03); border-color: var(--hairline); }
.pending-groups { display: flex; flex-direction: column; gap: 12px; }
.pending-group { border: 1px solid var(--hairline); border-radius: 13px; padding: 12px 14px; background: rgba(255,255,255,.018); }
.pending-group-head { gap: 12px; flex-wrap: wrap; }
.pending-group .code-pill { cursor: default; }
.drawer-summary { display: flex; align-items: center; gap: 34px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 16px; border-radius: 14px; border: 1px solid var(--hairline); background: rgba(255, 255, 255, 0.022); }
.drawer-summary .btn { margin-left: auto; }
.code-result { display: flex; flex-wrap: wrap; gap: 8px; min-height: 80px; align-content: flex-start; }
.code-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 10px;
  font-family: var(--font-code);
  font-size: 11.5px;
  color: #cfe2ff;
  background: rgba(91, 140, 255, 0.09);
  border: 1px solid rgba(108, 157, 255, 0.2);
  cursor: pointer;
  transition: all 0.18s;
  animation: fadeUp 0.25s var(--ease) both;
}
.code-pill:hover { background: rgba(91, 140, 255, 0.17); border-color: rgba(119, 170, 255, 0.4); transform: translateY(-1px); }
.code-pill.selected { background: rgba(52, 217, 168, 0.12); border-color: rgba(52, 217, 168, 0.35); color: #b4ffe9; }
.code-pill .check { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--stroke-strong); display: grid; place-items: center; }
.code-pill.selected .check { background: var(--mint); border-color: var(--mint); color: #06251d; }
.code-layout-note { font-size: 10.5px; color: var(--faint); line-height: 1.8; }
.recycle-panel { border-radius: var(--radius-xl); padding: 18px; border: 1px solid rgba(255, 113, 136, 0.15); background: rgba(255, 113, 136, 0.035); }
.blocker-list { display: flex; flex-direction: column; gap: 7px; margin-top: 11px; }
.blocker { display: flex; align-items: center; gap: 9px; font-size: 11px; color: #ffc1cc; padding: 8px 10px; border-radius: 9px; background: rgba(255, 113, 136, 0.08); }
.blocker b { margin-left: auto; font-family: var(--font-num); }

/* stocktake */
.count-table input { width: 76px; height: 29px; text-align: right; font-family: var(--font-num); padding: 0 8px; border-radius: 7px; }
.diff-pos { color: var(--mint); } .diff-neg { color: var(--red); }
.progress-bar { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); transition: width 0.4s var(--ease); }

/* category tree */
.category-node { position: relative; }
.category-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid transparent;
  transition: all 0.18s;
}
.category-row:hover { background: rgba(255, 255, 255, 0.035); border-color: var(--hairline); }
.category-row.root { background: rgba(91, 140, 255, 0.075); border-color: rgba(114, 161, 255, 0.16); margin-bottom: 8px; }
.category-row.level2 { margin-left: 20px; background: rgba(255, 255, 255, 0.02); }
.category-row.level3 { margin-left: 48px; padding-top: 7px; padding-bottom: 7px; }
.category-children { border-left: 1px dashed rgba(146, 178, 220, 0.14); margin-left: 22px; padding-left: 6px; }
.cat-caret { color: var(--faint); display: grid; place-items: center; width: 16px; }
.cat-branch { color: var(--faint); font-family: var(--font-num); font-size: 12px; width: 16px; }
.cat-badge { font-family: var(--font-num); font-size: 8.5px; color: var(--muted-2); border: 1px solid var(--stroke); border-radius: 5px; padding: 1px 5px; }
.cat-badge.l2 { color: var(--blue-2); border-color: rgba(110, 164, 255, 0.24); }
.cat-badge.l3 { color: var(--mint); border-color: rgba(52, 217, 168, 0.22); }

/* material / bundle */
.material-stat { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.028); border: 1px solid var(--stroke); }
.material-stat .ico { color: var(--blue-2); }
.material-stat b { font-family: var(--font-num); font-size: 17px; display: block; }
.material-stat span { font-size: 10px; color: var(--muted-2); }
.low-stock { color: var(--red); }
.bundle-card { padding: 18px; border-radius: var(--radius-lg); border: 1px solid var(--stroke); background: rgba(255, 255, 255, 0.028); display: flex; flex-direction: column; gap: 12px; }
.bundle-card .top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.bundle-card h3 { font-size: 15px; }
.bundle-card .code { font-family: var(--font-num); font-size: 10px; color: var(--faint); }
.bundle-components { display: flex; flex-wrap: wrap; gap: 6px; }
.bundle-component { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--hairline); background: rgba(255, 255, 255, 0.025); font-size: 10px; color: var(--muted); }
.bundle-available { font-family: var(--font-num); font-size: 25px; font-weight: 600; }

.finance-hero { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; border-radius: var(--radius-xl); overflow: hidden; border: 1px solid var(--stroke); background: var(--hairline); }
.finance-hero > div { padding: 20px 22px; background: rgba(11, 24, 41, 0.92); }
.finance-hero label { font-size: 10px; color: var(--faint); letter-spacing: 0.08em; }
.finance-hero b { display: block; font-family: var(--font-num); font-size: clamp(22px, 2.4vw, 31px); font-weight: 600; margin-top: 8px; letter-spacing: -0.02em; }
.finance-hero span { font-size: 10px; color: var(--muted-2); }
.report-section { border-top: 1px solid var(--hairline); padding-top: 18px; margin-top: 18px; }
.report-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 0; font-size: 12px; color: var(--muted); border-bottom: 1px dashed rgba(146, 178, 220, 0.08); }
.report-row:last-child { border-bottom: 0; }
.report-row b { font-family: var(--font-num); color: var(--ink-2); font-weight: 550; }
.report-row.total { color: var(--ink); font-weight: 600; border-bottom: 0; padding-top: 13px; }
.report-row.total b { color: var(--ink); font-size: 16px; }

/* warehouse */
.warehouse-card { padding: 18px; border-radius: var(--radius-lg); display: flex; flex-direction: column; gap: 14px; }
.warehouse-card .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.warehouse-card h3 { font-size: 15px; }
.warehouse-card .code { font-family: var(--font-num); font-size: 10px; color: var(--faint); }
.loc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.loc-card { padding: 13px 14px; border-radius: 13px; border: 1px solid var(--stroke); background: rgba(255, 255, 255, 0.025); transition: all 0.2s; }
.loc-card:hover { border-color: var(--stroke-strong); background: rgba(255, 255, 255, 0.045); }
.loc-card .code { font-family: var(--font-code); font-size: 11px; color: #c8dcfb; }
.loc-card .meta { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; font-size: 10px; color: var(--faint); }
.capacity { height: 4px; border-radius: 99px; background: rgba(255, 255, 255, 0.06); margin-top: 8px; overflow: hidden; }
.capacity div { height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan)); border-radius: inherit; }

/* command palette */
.palette { width: min(640px, 94vw); border-radius: 20px; overflow: hidden; animation: modalIn 0.24s var(--ease); }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--hairline); }
.palette-input input { flex: 1; border: 0; background: transparent; outline: none; font-size: 15px; color: var(--ink); }
.palette-results { max-height: 440px; overflow-y: auto; padding: 8px; }
.palette-group { font-size: 9.5px; letter-spacing: 0.15em; color: var(--faint); padding: 12px 12px 6px; text-transform: uppercase; }
.palette-item { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; font-size: 12px; color: var(--muted); cursor: pointer; background: transparent; border: 0; text-align: left; width: 100%; }
.palette-item:hover, .palette-item.active { background: rgba(91, 140, 255, 0.12); color: var(--ink); }
.palette-item .tag { margin-left: auto; font-size: 9px; color: var(--faint); border: 1px solid var(--stroke); border-radius: 5px; padding: 2px 6px; }


/* ==========================================================================
   货号抓取器   ========================================================================== */
.grabber-layout { display: grid; grid-template-columns: minmax(330px, 0.88fr) minmax(0, 1.35fr); gap: 18px; align-items: start; }
.grabber-layout { grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.6fr); }
.grabber-table table.data-table th, .grabber-table table.data-table td { padding: 9px 10px; font-size: 12px; white-space: nowrap; }
.grabber-table table.data-table td.code { font-size: 11.5px; }
.grabber-table table.data-table th { font-size: 11px; }

.grabber-status { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 12px 14px; border-radius: 13px; border: 1px solid var(--hairline); background: rgba(255, 255, 255, 0.022); }
.grabber-status .dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 10px currentColor; }
.grabber-status .grow { min-width: 0; flex: 1 1 130px; }
.grabber-status .grow b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grabber-status .grow .tiny { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grabber-kpi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; border-radius: 14px; overflow: hidden; border: 1px solid var(--stroke); background: var(--hairline); }
.grabber-kpi > div { padding: 12px 14px; background: rgba(11, 24, 41, 0.92); }
.grabber-kpi b { display: block; font-family: var(--font-num); font-size: 22px; font-weight: 600; margin-top: 3px; }
.grabber-pages { display: flex; flex-wrap: wrap; gap: 6px; }
.grabber-send { border-top: 1px solid var(--hairline); padding-top: 16px; }
.data-table .num-col { text-align: right; font-variant-numeric: tabular-nums; }
.data-table td.code { font-family: var(--font-code); letter-spacing: 0.01em; }
.data-table tbody tr.row-unmatched td { color: #ffd08a; }
.data-table tbody tr.row-unmatched td.code { color: var(--amber); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); cursor: pointer; }
.check input { accent-color: var(--blue); }
.scan-progress-bar { height: 4px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.scan-progress-bar span { display: block; height: 100%; width: 34%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); animation: grabberSlide 1.1s infinite linear; }
@keyframes grabberSlide { from { transform: translateX(-110%); } to { transform: translateX(310%); } }
@media (max-width: 1080px) {
  .grabber-layout { grid-template-columns: 1fr; }
  .grabber-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .grabber-send .form-grid { grid-template-columns: 1fr !important; }
}
/* login mobile / responsive */
@media (max-width: 1280px) {
  :root { --shell-pad: 14px; --shell-gap: 14px; --sidebar-w: 218px; }
  .grid-kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scan-layout { grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr); }
}
@media (max-width: 1080px) {
  .grid-dash, .grid-dash-3 { grid-template-columns: 1fr; }
  .grid-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-form-side { min-height: calc(100vh - 44px); }
  .code-generator { grid-template-columns: 1fr; }
  .scan-layout { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  body { font-size: 13px; }
  .scan-product { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .scan-product .thumb.lg { width: 112px; height: 112px; aspect-ratio: auto; align-self: flex-start; border-radius: 18px; font-size: 24px; }
  .scan-product .spec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
  .app-shell { grid-template-columns: 1fr; padding: 10px; gap: 10px; }
  :root { --sidebar-w: 0px; }
  .overlay.dialog-overlay { padding-left: 14px; padding-right: 14px; }
  .sidebar {
    position: fixed;
    left: 10px;
    top: 10px;
    bottom: 10px;
    width: 246px;
    height: auto;
    transform: translateX(-110%);
    transition: transform 0.3s var(--ease);
    z-index: 80;
  }
  .sidebar.open { transform: none; }
  .main { padding: 0 2px 40px; }
  .mobile-nav-btn { display: grid !important; }
  .topbar { height: 58px; margin-bottom: 14px; }
  .command { display: none; }
  .user-meta { display: none; }
  .user-chip { padding: 0 6px; }
  .page-title { font-size: 24px; }
  .grid-2, .grid-3, .grid-4, .grid-kpi { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .finance-hero { grid-template-columns: 1fr; }
  .hero { flex-direction: column; align-items: flex-start; padding: 20px; }
  .dashboard-head { padding: 0 21px; }
  .modal-body, .modal-head, .modal-foot { padding-left: 18px; padding-right: 18px; }
  .drawer { width: 100vw; border-radius: 0; }
  .toast-stack { left: 14px; right: 14px; bottom: 14px; max-width: none; }
  .bulk-bar { left: 50%; bottom: 14px; flex-wrap: wrap; justify-content: center; }
  .scan-mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top-actions .icon-btn:not(.keep) { display: none; }
}
@media (max-width: 560px) {
  .page-head { align-items: flex-start; flex-direction: column; gap: 14px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .kpi-value { font-size: 26px; }
  .table-wrap { max-height: 60vh; }
  .searchbar { padding: 14px; }
  .searchbar .field { flex: 1 1 100%; }
  .searchbar .actions { width: 100%; }
  .searchbar .actions .btn { flex: 1; }
  .scan-product { flex-direction: column; }
  .scan-product .spec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .info-grid { grid-template-columns: 1fr; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
/* ==========================================================================
   Light skin 鈥?toggled by the topbar switch, persisted in localStorage
   ========================================================================== */
html[data-theme="light"] {
  color-scheme: light;
  --bg-0: #eef2f9;
  --bg-1: #e7edf7;
  --bg-2: #ffffff;
  --ink: #101e31;
  --ink-2: #24364d;
  --muted: #55688a;
  --muted-2: #6b7f9c;
  --faint: #8595ad;
  --glass: rgba(255, 255, 255, 0.74);
  --glass-deep: rgba(255, 255, 255, 0.9);
  --glass-soft: rgba(255, 255, 255, 0.55);
  --glass-hi: rgba(255, 255, 255, 0.88);
  --stroke: rgba(20, 39, 68, 0.11);
  --stroke-strong: rgba(20, 39, 68, 0.21);
  --hairline: rgba(20, 39, 68, 0.10);
  --shadow-card: 0 18px 44px -28px rgba(19, 41, 78, 0.30), 0 1px 3px rgba(19, 41, 78, 0.06);
  --shadow-float: 0 28px 64px -30px rgba(19, 41, 78, 0.34), 0 4px 12px rgba(19, 41, 78, 0.08);
  --inner-light: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
html[data-theme="light"] body { background: var(--bg-0); }
html[data-theme="light"] .ambient {
  background:
    radial-gradient(1100px 720px at 80% -14%, rgba(110, 160, 255, 0.30), transparent 62%),
    radial-gradient(900px 700px at 6% 8%, rgba(52, 217, 168, 0.16), transparent 66%),
    radial-gradient(760px 560px at 58% 106%, rgba(140, 120, 255, 0.16), transparent 70%),
    linear-gradient(160deg, #f9fbff 0%, #eef3fb 48%, #e8eef8 100%);
}
html[data-theme="light"] .ambient::after { opacity: 0.16; mix-blend-mode: multiply; }
html[data-theme="light"] .orb { opacity: 0.26; }
html[data-theme="light"] .grid-glow {
  background-image:
    linear-gradient(rgba(38, 78, 140, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38, 78, 140, 0.05) 1px, transparent 1px);
}
html[data-theme="light"] .flow-lines {
  opacity: 0.62;
  background-image:
    repeating-linear-gradient(112deg, rgba(44, 91, 166, 0.075) 0 1px, transparent 1px 144px),
    repeating-linear-gradient(112deg, rgba(20, 143, 126, 0.04) 0 1px, transparent 1px 288px);
}
html[data-theme="light"] .glass {
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.78) 36%, rgba(236, 243, 255, 0.72) 100%),
    var(--glass);
}
html[data-theme="light"] .glass::before {
  background: linear-gradient(118deg, rgba(255, 255, 255, 0.7) 0%, transparent 28%, transparent 72%, rgba(108, 150, 255, 0.1) 100%);
  opacity: 0.55;
}
html[data-theme="light"] .performance-lite .sidebar,
html[data-theme="light"] .performance-lite .topbar { background: rgba(255, 255, 255, 0.92); }
html[data-theme="light"] .performance-lite .glass { background: rgba(255, 255, 255, 0.88); }

html[data-theme="light"] .kpi-card.accent-blue { background: linear-gradient(150deg, rgba(82, 132, 255, 0.16), rgba(255, 255, 255, 0.85) 62%), var(--glass); }
html[data-theme="light"] .kpi-card.accent-mint { background: linear-gradient(150deg, rgba(48, 219, 176, 0.16), rgba(255, 255, 255, 0.85) 62%), var(--glass); }
html[data-theme="light"] .kpi-card.accent-amber { background: linear-gradient(150deg, rgba(246, 195, 91, 0.20), rgba(255, 255, 255, 0.85) 62%), var(--glass); }
html[data-theme="light"] .kpi-card.accent-rose { background: linear-gradient(150deg, rgba(255, 113, 136, 0.16), rgba(255, 255, 255, 0.85) 62%), var(--glass); }
html[data-theme="light"] .kpi-card.accent-violet { background: linear-gradient(150deg, rgba(169, 139, 255, 0.18), rgba(255, 255, 255, 0.85) 62%), var(--glass); }
html[data-theme="light"] .kpi-card:hover { border-color: var(--stroke-strong); }
html[data-theme="light"] .kpi-icon { background: rgba(20, 39, 68, 0.05); border-color: var(--stroke); }
html[data-theme="light"] .brand-mark { background: linear-gradient(145deg, #ffffff, rgba(68, 111, 210, 0.10)); border-color: var(--stroke); }

html[data-theme="light"] .nav-item { color: var(--muted); }
html[data-theme="light"] .nav-item:hover { color: var(--ink); background: rgba(20, 39, 68, 0.05); }
html[data-theme="light"] .nav-item.active {
  color: #12335f;
  background: linear-gradient(120deg, rgba(91, 140, 255, 0.18), rgba(52, 217, 168, 0.12));
  border-color: rgba(64, 110, 210, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 20px -16px rgba(64, 110, 210, 0.55);
}
html[data-theme="light"] .command { background: rgba(255, 255, 255, 0.72); }
html[data-theme="light"] .command:hover { background: #fff; color: var(--ink-2); }
html[data-theme="light"] .command kbd { background: rgba(20, 39, 68, 0.05); color: var(--muted-2); }
html[data-theme="light"] .icon-btn { background: rgba(255, 255, 255, 0.72); color: var(--muted); }
html[data-theme="light"] .icon-btn:hover { background: #fff; color: var(--ink); }
html[data-theme="light"] .btn { color: var(--ink-2); background: rgba(255, 255, 255, 0.86); }
html[data-theme="light"] .btn:hover { color: var(--ink); background: #fff; }
html[data-theme="light"] .btn.primary { color: #fff; background: linear-gradient(135deg, #6f9dff, #3f68ef); }
html[data-theme="light"] .btn.primary:hover { background: linear-gradient(135deg, #84adff, #4d76f6); }
html[data-theme="light"] .btn.subtle { background: rgba(20, 39, 68, 0.05); color: var(--muted); }
html[data-theme="light"] .btn.danger { color: #b72a45; background: rgba(255, 113, 136, 0.12); border-color: rgba(255, 113, 136, 0.3); }
html[data-theme="light"] .btn.mint { color: #06382c; }

html[data-theme="light"] .input,
html[data-theme="light"] .select,
html[data-theme="light"] .textarea { background: rgba(255, 255, 255, 0.9); background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.6), transparent); }
html[data-theme="light"] .input:hover,
html[data-theme="light"] .select:hover,
html[data-theme="light"] .textarea:hover { border-color: rgba(20, 39, 68, 0.2); }
html[data-theme="light"] .input:focus,
html[data-theme="light"] .select:focus,
html[data-theme="light"] .textarea:focus { background: #fff; border-color: rgba(66, 118, 235, 0.6); box-shadow: 0 0 0 3px rgba(79, 127, 255, 0.14); }
html[data-theme="light"] .select option { background: #fff; color: var(--ink); }
html[data-theme="light"] .select { background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%2356688a' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }
html[data-theme="light"] .login-card .input { background: rgba(255, 255, 255, 0.9); }

html[data-theme="light"] .tabs { background: rgba(20, 39, 68, 0.05); }
html[data-theme="light"] .tab.on { color: #12335f; background: #fff; box-shadow: 0 1px 3px rgba(20, 40, 80, 0.14); }
html[data-theme="light"] .data-table th { background: rgba(246, 249, 254, 0.98); }
html[data-theme="light"] .data-table td { border-bottom-color: rgba(20, 39, 68, 0.07); }
html[data-theme="light"] .data-table tbody tr:hover { background: rgba(64, 110, 210, 0.055); }
html[data-theme="light"] .data-table tbody tr.selected { background: rgba(64, 110, 210, 0.10); }
html[data-theme="light"] .data-table .code,
html[data-theme="light"] .data-table td.code { color: #1d4b8f; }
html[data-theme="light"] .data-table th.actions-col { background: rgba(246, 249, 254, 0.99); }
html[data-theme="light"] .data-table tbody tr:hover td.actions-col { background: #eef3fb; }
html[data-theme="light"] .data-table tbody tr.row-unmatched td { color: #9a5a00; }
html[data-theme="light"] .chip.blue { color: #1d54c4; background: rgba(91, 140, 255, 0.13); border-color: rgba(91, 140, 255, 0.26); }
html[data-theme="light"] .chip.mint,
html[data-theme="light"] .chip.green { color: #0a7357; background: rgba(52, 217, 168, 0.14); border-color: rgba(52, 217, 168, 0.3); }
html[data-theme="light"] .chip.amber { color: #8a5a00; background: rgba(246, 195, 91, 0.18); border-color: rgba(230, 170, 40, 0.3); }
html[data-theme="light"] .chip.rose,
html[data-theme="light"] .chip.red { color: #b02542; background: rgba(255, 113, 136, 0.14); border-color: rgba(255, 113, 136, 0.28); }
html[data-theme="light"] .chip.violet { color: #5b3ec8; background: rgba(169, 139, 255, 0.16); border-color: rgba(169, 139, 255, 0.3); }
html[data-theme="light"] .chip.slate { color: var(--muted); background: rgba(20, 39, 68, 0.06); }
html[data-theme="light"] .notice { background: rgba(64, 110, 210, 0.06); border-color: rgba(64, 110, 210, 0.14); color: var(--ink-2); }
html[data-theme="light"] .alert-row { background: rgba(255, 255, 255, 0.62); }
html[data-theme="light"] .alert-row:hover { background: #fff; }
html[data-theme="light"] .alert-row.selected { background: rgba(91, 140, 255, 0.12); border-color: rgba(64, 110, 210, 0.30); }
html[data-theme="light"] .bulk-bar { background: linear-gradient(150deg, #ffffff, rgba(247, 250, 255, 0.98)); }
html[data-theme="light"] .virtual-sub { color: var(--muted-2); }
html[data-theme="light"] .toast { background: rgba(255, 255, 255, 0.96); color: var(--ink); }
html[data-theme="light"] .overlay { background: rgba(28, 45, 72, 0.28); }
html[data-theme="light"] .modal,
html[data-theme="light"] .drawer,
html[data-theme="light"] .palette { background: linear-gradient(160deg, #ffffff, #f4f8ff), var(--glass); }
html[data-theme="light"] .searchbar { background: rgba(255, 255, 255, 0.7); }
html[data-theme="light"] .login-page { background: linear-gradient(160deg, #f7faff, #e9f0fa 55%, #e3ebf7); }
html[data-theme="light"] .login-card::after { opacity: 0.5; }
html[data-theme="light"] .scan-input { background: rgba(255, 255, 255, 0.92); }
html[data-theme="light"] .scan-product { background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(236, 243, 255, 0.72)); }
html[data-theme="light"] .scan-line { border-bottom-color: rgba(20, 39, 68, 0.08); }
html[data-theme="light"] .qty-stepper button { background: rgba(20, 39, 68, 0.05); color: var(--muted); }
html[data-theme="light"] .code-pill { color: #1d4b8f; background: rgba(91, 140, 255, 0.12); border-color: rgba(91, 140, 255, 0.24); }
html[data-theme="light"] .grabber-status,
html[data-theme="light"] .pending-group,
html[data-theme="light"] .drawer-summary { background: rgba(255, 255, 255, 0.62); }
html[data-theme="light"] .scan-stage { background: rgba(255, 255, 255, 0.72); }

/* --- light skin 路 second pass ------------------------------------------- */
html[data-theme="light"] .select {
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: auto;
}
html[data-theme="light"] .data-table td.actions-col { background: rgba(250, 252, 255, 0.98); box-shadow: -14px 0 20px -24px rgba(20, 40, 80, 0.35); }
html[data-theme="light"] .data-table tbody tr:hover td.actions-col { background: #eef3fb; }
html[data-theme="light"] .finance-hero { background: rgba(20, 39, 68, 0.10); }
html[data-theme="light"] .finance-hero > div { background: rgba(255, 255, 255, 0.82); }
html[data-theme="light"] .grabber-kpi { background: rgba(20, 39, 68, 0.10); }
html[data-theme="light"] .grabber-kpi > div { background: rgba(255, 255, 255, 0.86); }
html[data-theme="light"] .hero::after { background: radial-gradient(circle, rgba(89, 138, 255, 0.18), transparent 65%); }
html[data-theme="light"] .hero-title span {
  background: linear-gradient(100deg, #16345f, #2f66c8 48%, #0e8f7d);
  -webkit-background-clip: text;
  background-clip: text;
}
html[data-theme="light"] .hero-greet { color: #0a8a76; }
html[data-theme="light"] .scan-mode { background: rgba(255, 255, 255, 0.7); }
html[data-theme="light"] .scan-mode .mode-ico { background: rgba(20, 39, 68, 0.05); }
html[data-theme="light"] .scan-mode.on { color: #12335f; background: linear-gradient(135deg, rgba(91, 140, 255, 0.18), rgba(84, 230, 211, 0.12)); }
html[data-theme="light"] .scan-mode.on .mode-ico { color: #1d54c4; background: rgba(91, 140, 255, 0.16); }
html[data-theme="light"] .mode-ico { color: var(--muted); }
html[data-theme="light"] .scan-input { background: rgba(255, 255, 255, 0.92); }
html[data-theme="light"] .empty-art { background: rgba(64, 110, 210, 0.08); color: #4d76d8; }
html[data-theme="light"] .chart-tooltip { background: rgba(255, 255, 255, 0.96); color: var(--ink); }
html[data-theme="light"] .chart-tooltip b { color: var(--ink); }
html[data-theme="light"] .timeline::before { background: rgba(20, 39, 68, 0.10); }
html[data-theme="light"] .toast b { color: var(--ink); }
html[data-theme="light"] .modal-head,
html[data-theme="light"] .modal-foot,
html[data-theme="light"] .drawer-head,
html[data-theme="light"] .drawer-foot { border-color: var(--hairline); }
html[data-theme="light"] .login-hero h1 span { background: linear-gradient(102deg, #16345f 0%, #2f66c8 48%, #0e8f7d 100%); -webkit-background-clip: text; background-clip: text; }

/* HarmonyOS Sans SC (bundled, OFL-style HarmonyOS Sans license) */
@font-face {
  font-family: "HarmonyOS Sans SC";
  src: url("/static/fonts/HarmonyOS_SansSC_Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "HarmonyOS Sans SC";
  src: url("/static/fonts/HarmonyOS_SansSC_Medium.woff2") format("woff2");
  font-weight: 500 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "HarmonyOS Sans SC";
  src: url("/static/fonts/HarmonyOS_SansSC_Bold.woff2") format("woff2");
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

/* ==========================================================================
   HarmonyOS Sans + unified blue copyable codes + zoom previews
   ========================================================================== */
body, button, input, select, textarea { font-family: var(--font); }
:root {
  --code-ink: #9dc2ff;
  --code-ink-strong: #cfe2ff;
  --title-tracking: clamp(0.4px, 0.09em, 10px);
}
html[data-theme="light"] {
  --code-ink: #1d54c8;
  --code-ink-strong: #1746a8;
}
[data-code], .code-link, .data-table .code, .data-table td.code, .pinfo .code, .cell-sub.code {
  color: var(--code-ink);
  cursor: pointer;
  transition: color .16s ease;
}
[data-code]:hover, .code-link:hover, .data-table .code:hover, .cell-sub.code:hover, .pinfo .code:hover {
  color: var(--code-ink-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}
/* unified title tracking: target is 10px, clamped so it never overflows */
.page-title, .hero-title, .modal-head h3, .drawer-head h3, .panel-title,
.section-title, .login-card h2, .page-kicker, .form-section-title {
  letter-spacing: var(--title-tracking);
}
.page-sub, .panel-sub, .kpi-label, .nav-group-label { letter-spacing: clamp(0.2px, 0.04em, 10px); }

/* product list: hover 250x250 zoom preview */
.thumb-zoom { position: relative; display: inline-flex; }
.thumb-zoom .zoom-big {
  position: fixed;
  right: 30px;
  top: 118px;
  z-index: 400;
  width: 250px;
  height: 250px;
  border-radius: 18px;
  border: 1px solid var(--stroke-strong);
  background: var(--glass-deep);
  box-shadow: var(--shadow-float);
  object-fit: cover;
  display: none;
  pointer-events: none;
}
.thumb-zoom:hover .zoom-big { display: block; }
.thumb-zoom .thumb { transition: transform .18s var(--ease), border-color .18s; }
.thumb-zoom:hover .thumb { transform: scale(1.06); border-color: var(--stroke-strong); }

/* scan station: locked 250x250 thumbnail with magnifier */
.scan-product .thumb-wrap {
  position: relative;
  width: 250px;
  height: 250px;
  flex: 0 0 auto;
  align-self: stretch;
}
.scan-product .thumb-wrap .thumb.lg,
.scan-product .thumb-wrap img.thumb.lg {
  width: 250px !important;
  height: 250px !important;
  aspect-ratio: auto;
  border-radius: 20px;
  object-fit: cover;
}
.scan-product .thumb-wrap .zoom-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(8, 18, 33, .72);
  border: 1px solid rgba(255, 255, 255, .28);
  backdrop-filter: blur(6px);
  cursor: zoom-in;
  transition: transform .16s ease;
}
.scan-product .thumb-wrap .zoom-badge:hover { transform: scale(1.08); }
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 420;
  display: grid;
  place-items: center;
  background: rgba(3, 8, 16, .72);
  backdrop-filter: blur(8px);
}
.image-lightbox img {
  width: 500px;
  height: 500px;
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 22px;
  border: 1px solid var(--stroke-strong);
  box-shadow: var(--shadow-float);
  background: var(--glass-deep);
}
.image-lightbox .close { position: absolute; top: 22px; right: 22px; }

/* purchase picker */
.picker-picked {
  border: 1px dashed var(--stroke-strong);
  border-radius: 14px;
  padding: 12px 14px;
  margin-top: 12px;
  background: rgba(91, 140, 255, .05);
  max-height: 132px;
  overflow: auto;
}
.picker-picked .picked-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 6px 6px 0;
  padding: 5px 9px;
  border-radius: 9px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, .04);
  font-family: var(--font-num);
  font-size: 11px;
}
.picker-picked .picked-chip button { color: var(--faint); border: 0; background: transparent; }

/* category tree expand/collapse */
.cat-caret { cursor: pointer; transition: transform .18s var(--ease); color: var(--faint); }
.cat-caret.collapsed { transform: rotate(-90deg); }

@media (max-width: 860px) {
  .scan-product .thumb-wrap { width: 150px; height: 150px; }
  .scan-product .thumb-wrap .thumb.lg,
  .scan-product .thumb-wrap img.thumb.lg { width: 150px !important; height: 150px !important; }
  .image-lightbox img { width: 92vw; height: 92vw; }
}

.orb { animation: orbFloat 26s ease-in-out infinite alternate; will-change: transform; }
.orb.two { animation-duration: 32s; animation-delay: -8s; }
.orb.three { animation-duration: 38s; animation-delay: -16s; }
.hover-preview {
  position: fixed;
  z-index: 420;
  width: 250px;
  height: 250px;
  border-radius: 18px;
  border: 1px solid var(--stroke-strong);
  background: var(--glass-deep);
  box-shadow: var(--shadow-float);
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease;
}
.hover-preview.show { opacity: 1; }
.thumb-zoom .zoom-big { display: none !important; }

/* Turn 9: light-skin totals, backup table fit, no orb float */
html[data-theme="light"] .report-row.total b,
html[data-theme="light"] .report-row.total { color: var(--ink); }
.report-row.total b { color: var(--ink); }
.backup-table { min-width: 0; table-layout: fixed; }
.backup-table td.code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backup-table td.text-right { white-space: nowrap; }
.backup-table td.text-right .link-btn { padding: 0; }
.orb, .ambient .orb { animation: none !important; }
.ambient::before { animation: none !important; }
