:root {
  --bg: #f3f6f8;
  --sidebar: #17212b;
  --sidebar-deep: #101820;
  --sidebar-hover: #24313d;
  --primary: #087f6f;
  --primary-dark: #06695d;
  --primary-soft: #e7f5f2;
  --blue: #2f6fed;
  --blue-soft: #edf3ff;
  --amber: #b66b08;
  --amber-soft: #fff5df;
  --red: #c23b3b;
  --red-soft: #fff0f0;
  --green: #18864b;
  --green-soft: #eaf7ef;
  --text: #17212b;
  --muted: #64717d;
  --line: #dce3e8;
  --line-soft: #edf1f3;
  --panel: #fff;
  --shadow: 0 8px 24px rgba(24, 41, 55, .06);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "HarmonyOS Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 14px;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  min-width: 0;
  padding: 16px 12px 14px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  color: #cad2d9;
  background: var(--sidebar);
  border-right: 1px solid #0f1820;
}
.sidebar-mask { display: none; }

.brand {
  min-height: 54px;
  padding: 4px 8px 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand img { width: 40px; height: 40px; flex: 0 0 auto; }
.brand strong, .brand span { display: block; }
.brand strong { color: #fff; font-size: 15px; line-height: 1.4; }
.brand span { margin-top: 3px; color: #8997a3; font-size: 11px; }

.side-menu {
  min-height: 0;
  padding: 0 2px 12px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #44515d transparent;
}

.menu-group { margin: 0 0 8px; }

.menu-group summary {
  min-height: 32px;
  padding: 7px 8px;
  display: flex;
  align-items: center;
  color: #7f8d99;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.menu-group summary::-webkit-details-marker { display: none; }
.menu-group summary::after { content: "+"; margin-left: auto; color: #64737f; font-size: 15px; }
.menu-group[open] summary::after { content: "−"; }

.menu-item {
  width: 100%;
  min-height: 38px;
  margin: 2px 0;
  padding: 0 10px;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 6px;
  color: #c7d0d7;
  background: transparent;
  text-align: left;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}

.menu-item i {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 5px;
  color: #93a2ae;
  font-size: 11px;
  font-style: normal;
}

.menu-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item b { color: #7e8c97; font-size: 12px; font-weight: 400; }
.menu-item:hover { color: #fff; background: var(--sidebar-hover); }
.menu-item.active { color: #fff; background: var(--primary); font-weight: 700; box-shadow: inset 3px 0 0 #68d4c5; }
.menu-item.active i { color: #fff; border-color: rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .08); }

.sidebar-foot {
  padding: 11px 9px 6px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 9px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-foot strong, .sidebar-foot small { display: block; }
.sidebar-foot strong { color: #e4e9ed; font-size: 12px; }
.sidebar-foot small { margin-top: 3px; color: #7f8d98; font-size: 10px; }
.demo-dot { width: 8px; height: 8px; border-radius: 50%; background: #52d89b; box-shadow: 0 0 0 4px rgba(82, 216, 155, .1); }

.admin-main { min-width: 0; }

.admin-topbar {
  min-height: 84px;
  padding: 14px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.breadcrumb { margin-bottom: 5px; color: #8a96a0; font-size: 11px; }
.breadcrumb span { color: var(--primary); }
.page-heading h1 { margin: 0; font-size: 21px; line-height: 1.3; letter-spacing: 0; }
.page-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }

.top-actions, .table-actions, .form-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.top-actions { justify-content: flex-end; }

.demo-badge {
  min-height: 28px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #f0d5a9;
  border-radius: 5px;
  color: #8d570b;
  background: #fff8ea;
  font-size: 11px;
  font-weight: 700;
}

.account-menu { position: relative; flex: 0 0 auto; }

.account-chip {
  min-width: 146px;
  min-height: 44px;
  padding: 5px 8px 5px 12px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 8px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.account-chip > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--blue); font-size: 12px; }
.account-chip strong, .account-chip small { display: block; white-space: nowrap; }
.account-chip strong { font-size: 12px; }
.account-chip small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.account-chip:hover, .account-chip[aria-expanded="true"] { background: #f3f7f5; }
.account-chip:focus-visible { outline: 2px solid rgba(8, 127, 111, .3); outline-offset: 2px; }
.account-chevron { color: #7d8c84; font-size: 14px; font-style: normal; transition: transform .16s ease; }
.account-chip[aria-expanded="true"] .account-chevron { transform: rotate(180deg); }

.account-popover {
  position: absolute;
  z-index: 1200;
  top: calc(100% + 8px);
  right: 0;
  width: 282px;
  overflow: hidden;
  border: 1px solid #d7e1dc;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(19, 47, 35, .18);
}
.account-popover[hidden] { display: none; }
.account-popover > header { padding: 14px; display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 10px; border-bottom: 1px solid var(--line-soft); background: #f7faf8; }
.account-popover > header > span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--blue); font-size: 14px; font-weight: 700; }
.account-popover > header strong, .account-popover > header small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-popover > header strong { font-size: 13px; }
.account-popover > header small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.account-menu-actions { padding: 6px; }
.account-menu-actions button, .account-logout { width: 100%; min-height: 48px; padding: 7px 9px; display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: center; gap: 9px; border: 0; border-radius: 4px; color: var(--text); background: transparent; text-align: left; cursor: pointer; }
.account-menu-actions button:hover, .account-menu-actions button:focus-visible { background: #edf6f2; outline: none; }
.account-menu-actions i, .account-logout i { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 4px; color: var(--primary); background: #e5f3ee; font-size: 11px; font-style: normal; font-weight: 700; }
.account-menu-actions span, .account-menu-actions strong, .account-menu-actions small { display: block; min-width: 0; }
.account-menu-actions strong { font-size: 12px; }
.account-menu-actions small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.account-logout { min-height: 40px; border-top: 1px solid var(--line-soft); border-radius: 0; color: #9a3d37; }
.account-logout:hover, .account-logout:focus-visible { background: #fff3f2; outline: none; }
.account-logout i { color: #a34740; background: #fbe9e7; }

.workspace { padding: 18px 20px 30px; }
.module-view { display: none; }
.module-view.active { display: block; animation: view-in .16s ease-out; }
.screen-module.active { height: auto; min-height: 0; }
.legacy-screen-module.active { height: max(720px, calc(100dvh - 136px)); min-height: 720px; overflow: hidden; border-radius: 6px; background: #061521; }
.legacy-screen-frame { width: 100%; height: 100%; display: block; border: 0; background: #061521; }
.leadership-screen { padding: 16px; border: 1px solid #dfe8e3; border-top: 3px solid var(--primary); border-radius: 6px; background: #fbfdfc; }
.leadership-screen-head { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(610px, 2fr); gap: 16px; align-items: end; padding-bottom: 14px; border-bottom: 1px solid #e3ebe7; }
.leadership-screen-title > span { color: var(--primary); font-size: 11px; font-weight: 700; }
.leadership-screen-title h2 { margin: 4px 0 5px; color: #20443a; font-size: 20px; line-height: 1.25; }
.leadership-screen-title p, .leadership-screen-head > small { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.leadership-screen-head > small { grid-column: 1 / -1; margin-top: -6px; }
.screen-filter-bar { display: grid; grid-template-columns: repeat(4, minmax(126px, 1fr)) auto; gap: 8px; align-items: end; }
.screen-filter-bar label { min-width: 0; }
.screen-filter-actions { display: flex; align-items: end; gap: 7px; white-space: nowrap; }
.screen-filter-actions button { min-height: 34px; }
.leadership-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid #e1e9e5; border-top: 0; background: #fff; }
.leadership-kpi { min-width: 0; min-height: 104px; padding: 13px 14px; border-right: 1px solid #e7eeea; }
.leadership-kpi:last-child { border-right: 0; }
.leadership-kpi span, .leadership-kpi strong, .leadership-kpi small { display: block; }
.leadership-kpi span { color: #68786f; font-size: 11px; }
.leadership-kpi strong { margin-top: 9px; color: #1e4f42; font-size: 23px; line-height: 1; white-space: nowrap; }
.leadership-kpi small { margin-top: 8px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.leadership-kpi.money strong { color: #2d6c5a; }
.leadership-kpi.warning strong { color: #a05720; }
.leadership-kpi.return strong { color: #596098; }
.leadership-kpi.responsibility strong { color: #7f5a2b; }
.leadership-board { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.leadership-panel { min-width: 0; padding: 13px; border: 1px solid #e1e8e4; border-radius: 5px; background: #fff; }
.leadership-panel > header { min-height: 34px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.leadership-panel > header strong, .leadership-panel > header span { display: block; }
.leadership-panel > header strong { color: #274a40; font-size: 13px; }
.leadership-panel > header span { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.leadership-panel > header > div:last-child { display: flex; flex: 0 0 auto; gap: 6px; }
.leadership-panel .text-btn { min-height: 25px; padding: 0 2px; font-size: 11px; }
.leadership-trend-panel { grid-column: span 7; }
.leadership-risk-panel { grid-column: span 5; }
.leadership-unit-panel, .leadership-return-panel, .leadership-warehouse-panel { grid-column: span 4; }
.leadership-recent-panel { grid-column: 1 / -1; }
.screen-legend { display: flex; align-items: center; gap: 8px; color: #6a786f; font-size: 10px; white-space: nowrap; }
.screen-legend span::before { content: ""; width: 6px; height: 6px; display: inline-block; margin-right: 4px; border-radius: 50%; background: #8ba098; }
.screen-legend .in::before { background: #49956d; }
.screen-legend .out::before { background: #d47a3f; }
.screen-legend .move::before { background: #4e8daf; }
.screen-legend .back::before { background: #7c6aa5; }
.screen-trend { height: 174px; display: flex; align-items: end; gap: 5px; padding: 7px 3px 0; border-bottom: 1px solid #e6ede9; }
.screen-trend-column { height: 100%; min-width: 0; flex: 1; display: grid; grid-template-rows: minmax(0, 1fr) auto auto; align-items: end; gap: 3px; text-align: center; }
.screen-trend-stack { min-height: 4px; width: 100%; display: flex; flex-direction: column-reverse; overflow: hidden; border-radius: 2px 2px 0 0; background: #eff4f1; }
.screen-trend-stack i { min-height: 2px; display: block; }
.screen-trend-stack .inbound { background: #4b9a70; }
.screen-trend-stack .outbound { background: #d88950; }
.screen-trend-stack .transfer { background: #4e91af; }
.screen-trend-stack .return { background: #8270a9; }
.screen-trend-stack .stocktake { background: #a79145; }
.screen-trend-stack .empty { height: 100%; background: #eff4f1; }
.screen-trend-column small { color: #7a887f; font-size: 9px; white-space: nowrap; }
.screen-trend-column b { color: #4a5d54; font-size: 10px; font-weight: 600; }
.screen-operation-counts { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding-top: 10px; color: #6d7c73; font-size: 10px; }
.screen-operation-counts span { display: inline-flex; align-items: baseline; gap: 4px; }
.screen-operation-counts b { color: #2c5547; font-size: 15px; }
.screen-operation-counts .outbound b { color: #a86635; }
.screen-operation-counts .transfer b { color: #367793; }
.screen-operation-counts .return b { color: #655689; }
.screen-risk-list, .screen-return-list, .screen-warehouse-list { display: grid; gap: 7px; }
.screen-risk-row, .screen-return-row, .screen-warehouse-row { width: 100%; min-width: 0; display: grid; align-items: start; gap: 8px; padding: 9px; border: 1px solid #e2e9e5; border-radius: 4px; background: #fcfdfc; color: inherit; text-align: left; }
.screen-risk-row { grid-template-columns: auto minmax(0, 1fr); }
.screen-risk-row:hover, .screen-return-row:hover, .screen-warehouse-row:hover { border-color: #b9d6c4; background: #f5faf6; }
.screen-risk-row > span, .screen-return-row > span { min-width: 48px; padding: 3px 5px; border-radius: 3px; color: #8a572e; background: #fff2e7; font-size: 10px; text-align: center; }
.screen-risk-row.critical > span { color: #b53d3d; background: #fdebea; }
.screen-risk-row strong, .screen-risk-row small, .screen-risk-row em, .screen-return-row strong, .screen-return-row small, .screen-warehouse-row strong, .screen-warehouse-row span, .screen-warehouse-row small { display: block; }
.screen-risk-row strong, .screen-return-row strong, .screen-warehouse-row strong { overflow: hidden; color: #334d43; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.screen-risk-row small, .screen-return-row small, .screen-warehouse-row span { margin-top: 3px; overflow: hidden; color: #64746b; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.screen-risk-row em, .screen-warehouse-row small { margin-top: 4px; color: #88958e; font-size: 9px; font-style: normal; }
.screen-unit-list { display: grid; gap: 7px; }
.screen-unit-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 2px; border-bottom: 1px solid #edf1ef; }
.screen-unit-row:last-child { border-bottom: 0; }
.screen-unit-row strong, .screen-unit-row span { display: block; }
.screen-unit-row strong { color: #2b5a4b; font-size: 16px; }
.screen-unit-row span { margin-top: 3px; color: #75847b; font-size: 10px; }
.screen-unit-row > b { flex: 0 0 auto; padding: 3px 6px; border-radius: 3px; color: #547369; background: #edf5f1; font-size: 10px; font-weight: 600; }
.screen-return-row { grid-template-columns: auto minmax(0, 1fr); }
.screen-return-row.danger > span { color: #b53d3d; background: #fdebea; }
.screen-return-row.warning > span { color: #98591f; background: #fff5de; }
.screen-return-row.kit > span { color: #546187; background: #eef0fb; }
.screen-warehouse-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.screen-warehouse-row b { min-width: 48px; padding: 4px 5px; border-radius: 3px; color: #4d7b60; background: #edf7f0; font-size: 10px; font-weight: 600; text-align: center; }
.screen-warehouse-row b.warning { color: #98591f; background: #fff5de; }
.screen-warehouse-row b.critical { color: #b53d3d; background: #fdebea; }
.screen-recent-table { max-height: 350px; }
.screen-recent-table td small { display: block; margin-top: 3px; color: #7b8a81; font-size: 10px; }
.screen-recent-table td b { margin: 0 5px; color: #93a298; font-weight: 400; }
.screen-empty { min-height: 78px; display: grid; place-items: center; padding: 12px; color: #7a8a80; border: 1px dashed #d9e4df; border-radius: 4px; font-size: 11px; text-align: center; }
.screen-empty.success { color: #478161; border-color: #bedbc7; background: #f5faf6; }

@keyframes view-in { from { opacity: .35; transform: translateY(3px); } to { opacity: 1; transform: none; } }

.summary-grid { margin-bottom: 16px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.summary-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.summary-card, .admin-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow);
}

.summary-card { min-height: 108px; padding: 17px 18px; position: relative; overflow: hidden; }
.summary-card::after { content: ""; position: absolute; right: 0; top: 18px; width: 3px; height: 54px; background: var(--primary); }
.summary-card:nth-child(2)::after { background: var(--blue); }
.summary-card:nth-child(3)::after { background: #7b5bb5; }
.summary-card.warn::after { background: var(--red); }
.summary-card span, .summary-card small { display: block; color: var(--muted); font-size: 12px; }
.summary-card strong { display: block; margin: 10px 0 4px; color: var(--text); font-size: 28px; line-height: 1; letter-spacing: 0; }
.summary-card.warn strong { color: var(--red); }

.content-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.workbench-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-two { grid-column: 1 / -1; }

.admin-panel { min-width: 0; padding: 16px; margin-bottom: 15px; }
.panel-head { min-height: 36px; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.panel-head h2 { margin: 0; font-size: 16px; letter-spacing: 0; }
.panel-head span, .panel-head div > span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }

.quick-actions { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.quick-actions button, .quick-actions a {
  min-height: 74px;
  padding: 10px;
  display: grid;
  place-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #fbfcfd;
  text-decoration: none;
}
.quick-actions button:hover, .quick-actions a:hover { border-color: #8ccfc5; color: var(--primary); background: var(--primary-soft); }
.quick-actions i { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 5px; color: #fff; background: var(--primary); font-size: 12px; font-style: normal; }
.quick-actions span { font-size: 12px; }

.query-bar { margin-bottom: 14px; display: grid; grid-template-columns: 190px 190px minmax(260px, 1fr); gap: 11px; align-items: end; }
.query-bar.single { grid-template-columns: minmax(280px, 520px); }
.query-search { min-width: 0; }

label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
input, select, textarea {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid #cfd8de;
  border-radius: 5px;
  outline: none;
  color: var(--text);
  background: #fff;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(8, 127, 111, .1); }

.biz-form { padding: 4px 2px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.master-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: end; }
.inline-create { padding: 14px; border: 1px solid var(--line-soft); border-radius: 6px; background: #f9fbfc; }
.field-wide { grid-column: span 2; }
.form-actions { grid-column: 1 / -1; justify-content: flex-end; margin-top: 4px; }

.primary-btn, .ghost-btn, .text-btn, .row-btn, .icon-btn {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
  background: #fff;
}
.primary-btn { border-color: var(--primary); color: #fff; background: var(--primary); font-weight: 700; }
.primary-btn:hover { border-color: var(--primary-dark); background: var(--primary-dark); }
.ghost-btn:hover, .row-btn:hover { border-color: #79bdb4; color: var(--primary); }
.ghost-btn.active { color: #fff; border-color: var(--amber); background: var(--amber); }
.ghost-btn.danger { color: var(--red); border-color: #efcaca; }
.ghost-btn.danger:hover { background: var(--red-soft); }
.text-btn { min-height: 28px; padding: 0 5px; border: 0; color: var(--primary); background: transparent; }
.row-btn { min-height: 27px; padding: 0 9px; font-size: 11px; }
.row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.row-btn.danger { color: var(--red); border-color: #efcaca; background: #fffafa; }
.row-btn.danger:hover { color: #9c2d2d; border-color: #d99b9b; background: var(--red-soft); }

.inventory-operation-guide { margin-bottom: 13px; padding: 9px 11px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; border: 1px solid var(--line); border-left: 3px solid var(--primary); background: #f7faf9; }
.inventory-operation-guide > span { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.inventory-operation-guide i { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 3px; color: #fff; background: #347c6b; font-style: normal; font-size: 10px; font-weight: 800; }
.inventory-operation-guide i.out { background: #b46a32; }
.inventory-operation-guide i.move { background: #397692; }
.inventory-operation-guide i.back { background: #726289; }
.inventory-operation-guide i.check { background: #6f6b35; }
.inventory-table-wrap table { min-width: 1130px; }
.inventory-table-wrap th:first-child, .inventory-table-wrap td:first-child { min-width: 125px; }
.inventory-table-wrap th:nth-child(2), .inventory-table-wrap td:nth-child(2) { min-width: 150px; }
.inventory-actions-head { min-width: 255px; }
.stock-row-actions { display: grid; grid-template-columns: repeat(5, minmax(42px, 1fr)); gap: 4px; }
.stock-op-btn { min-height: 28px; padding: 0 7px; border: 1px solid #b8d2cb; border-radius: 3px; color: #256858; background: #f1f8f6; cursor: pointer; font-size: 10px; font-weight: 700; white-space: nowrap; }
.stock-op-btn.outbound { color: #8d501f; border-color: #e1c5af; background: #fff7f0; }
.stock-op-btn.transfer { color: #27637e; border-color: #b9d2df; background: #f1f8fb; }
.stock-op-btn.return { color: #64517a; border-color: #d1c6dd; background: #f8f5fa; }
.stock-op-btn.stocktake { color: #625d24; border-color: #d7d09a; background: #fbfaef; }
.stock-op-btn:hover { filter: brightness(.97); box-shadow: inset 0 0 0 1px currentColor; }
.stock-op-btn:disabled { opacity: .38; cursor: not-allowed; box-shadow: none; }
.stock-register-panel { margin: 0 0 13px; padding: 13px; border: 1px solid #cfe0dc; border-left: 3px solid var(--primary); border-radius: 5px; background: #fbfdfc; }
.stock-register-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.stock-register-head strong, .stock-register-head span { display: block; }
.stock-register-head strong { color: #1b534a; font-size: 14px; }
.stock-register-head span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.stock-register-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.stock-register-query { display: grid; grid-template-columns: repeat(5, minmax(148px, 1fr)); gap: 10px; padding: 11px; border: 1px solid #e3ece8; border-radius: 4px; background: #f6faf8; }
.stock-register-preview { margin-top: 12px; border: 1px solid #dbe7e2; border-radius: 4px; overflow: hidden; background: #fff; }
.stock-register-preview-head { min-height: 48px; padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid #e3ece8; background: #f9fbfa; }
.stock-register-preview-head strong, .stock-register-preview-head span, .stock-register-preview-head small { display: block; }
.stock-register-preview-head strong { color: #284d45; font-size: 12px; }
.stock-register-preview-head span, .stock-register-preview-head small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.stock-register-preview-head small { margin-top: 0; text-align: right; }
.stock-register-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-bottom: 1px solid #e3ece8; }
.stock-register-stats > div { min-width: 0; padding: 10px 12px; border-right: 1px solid #e3ece8; }
.stock-register-stats > div:last-child { border-right: 0; }
.stock-register-stats span, .stock-register-stats strong, .stock-register-stats small { display: inline-block; }
.stock-register-stats span { width: 100%; color: var(--muted); font-size: 10px; }
.stock-register-stats strong { margin-top: 5px; color: #1f5b50; font-size: 18px; line-height: 1; }
.stock-register-stats small { margin-left: 4px; color: var(--muted); font-size: 10px; }
.stock-register-insights { display: grid; grid-template-columns: minmax(240px, .9fr) minmax(360px, 1.4fr); border-bottom: 1px solid #e3ece8; background: #fbfdfc; }
.stock-register-insights > section { min-width: 0; padding: 11px 12px; }
.stock-register-insights > section + section { border-left: 1px solid #e3ece8; }
.stock-register-insights header { min-height: 22px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.stock-register-insights header strong, .stock-register-insights header span { display: block; }
.stock-register-insights header strong { color: #345649; font-size: 11px; }
.stock-register-insights header span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.stock-register-insights header > div:last-child { display: flex; gap: 8px; }
.stock-register-insights .text-btn { min-height: 23px; padding: 0; font-size: 10px; }
.stock-register-unit-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 6px; }
.stock-register-unit { min-width: 0; padding: 7px 8px; border-left: 2px solid #72a38d; background: #f4f9f6; }
.stock-register-unit strong, .stock-register-unit span { display: block; }
.stock-register-unit strong { color: #275c49; font-size: 14px; }
.stock-register-unit span { margin-top: 4px; overflow: hidden; color: #6f8177; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.stock-register-risk-list { display: grid; gap: 5px; }
.stock-register-risk { min-width: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; padding: 7px 8px; border-left: 2px solid #dda36b; background: #fffaf4; }
.stock-register-risk.critical { border-left-color: #d97070; background: #fff7f7; }
.stock-register-risk strong, .stock-register-risk span, .stock-register-risk small { display: block; }
.stock-register-risk strong { overflow: hidden; color: #534334; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.stock-register-risk span, .stock-register-risk small { margin-top: 3px; overflow: hidden; color: #7c7469; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.stock-register-risk b { flex: 0 0 auto; color: #9a6433; font-size: 9px; font-weight: 600; white-space: nowrap; }
.stock-register-risk.critical b { color: #b04c4c; }
.stock-register-empty-note { padding: 8px; color: #7e8e85; background: #f7faf8; font-size: 10px; }
.stock-register-table { border: 0; border-radius: 0; }
.stock-register-table table { min-width: 1050px; }
.stock-register-table td small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.entity-dialog.stock-operation-dialog { width: min(820px, calc(100vw - 32px)); }
.stock-operation-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stock-dialog-context { min-height: 78px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: #f7f9f9; }
.stock-dialog-context > div { padding: 11px 13px; border-right: 1px solid var(--line); }
.stock-dialog-context > div:last-child { border-right: 0; }
.stock-dialog-context span, .stock-dialog-context strong, .stock-dialog-context small { display: block; }
.stock-dialog-context span { color: var(--muted); font-size: 9px; }
.stock-dialog-context strong { margin-top: 5px; font-size: 12px; }
.stock-dialog-context small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.icon-btn { width: 32px; min-height: 32px; padding: 0; display: grid; place-items: center; font-size: 21px; line-height: 1; }

.table-wrap { width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.table-wrap.compact { max-height: 340px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { min-height: 40px; padding: 10px 11px; border-bottom: 1px solid var(--line-soft); text-align: left; white-space: nowrap; vertical-align: middle; }
th { position: sticky; top: 0; z-index: 1; color: #56636e; background: #f6f8f9; font-weight: 700; }
td { color: #2c3740; }
tbody tr:hover td { background: #f9fcfb; }
tbody tr:last-child td { border-bottom: 0; }

.status-tag { min-height: 22px; padding: 2px 7px; display: inline-flex; align-items: center; border-radius: 4px; color: var(--green); background: var(--green-soft); font-size: 10px; font-weight: 700; }
.status-tag.warning { color: var(--amber); background: var(--amber-soft); }
.row-btn.warning { color: #8a5d0c; border-color: #e7c36a; background: #fff7df; }
.row-btn.warning:hover { color: #6f4700; border-color: #d3a83d; background: #ffefbd; }
.status-tag.danger { color: var(--red); background: var(--red-soft); }

.alert-list { display: grid; gap: 8px; }
.alert-item { min-height: 56px; padding: 9px 10px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; border: 1px solid var(--line-soft); border-radius: 6px; background: #fbfcfd; }
.alert-level { width: 27px; height: 23px; display: grid; place-items: center; border-radius: 4px; color: #fff; background: var(--red); font-size: 10px; font-weight: 700; }
.alert-item strong, .alert-item span { display: block; }
.alert-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.alert-item div span { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.empty-state { min-height: 92px; display: grid; place-items: center; color: #98a2aa; font-size: 12px; }

.stat-bars { display: grid; gap: 16px; padding: 5px 2px 8px; }
.stat-bar > div { margin-bottom: 7px; display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.stat-bar > div strong { color: var(--muted); font-size: 11px; }
.stat-bar > i { height: 8px; display: block; overflow: hidden; border-radius: 4px; background: #e9eef1; }
.stat-bar > i b { height: 100%; display: block; border-radius: inherit; background: var(--primary); }
.stat-bar:nth-child(2n) > i b { background: var(--blue); }
.stat-bar:nth-child(3n) > i b { background: #bb7a17; }

.scope-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.scope-card { padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: #fbfcfd; }
.scope-card header { margin-bottom: 12px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; }
.scope-card header > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--blue); }
.scope-card strong, .scope-card small { display: block; }
.scope-card small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.scope-card > div { display: flex; flex-wrap: wrap; gap: 6px; }
.scope-card > div span { padding: 4px 7px; border: 1px solid #d8e5e2; border-radius: 4px; color: #2c635c; background: #f0f8f6; font-size: 10px; }

.insight-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.insight-item { min-height: 76px; padding: 12px; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 6px; background: #fbfcfd; }
.insight-item > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 5px; color: #fff; background: var(--blue); font-size: 12px; }
.insight-item strong { font-size: 12px; }
.insight-item p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.insight-item > b { color: var(--blue); font-size: 11px; }
.insight-item.warning { border-left-color: var(--amber); }
.insight-item.warning > span { background: var(--amber); }
.insight-item.warning > b { color: var(--amber); }
.insight-item.danger { border-left-color: var(--red); }
.insight-item.danger > span { background: var(--red); }
.insight-item.danger > b { color: var(--red); }
.insight-item.success { border-left-color: var(--green); }
.insight-item.success > span { background: var(--green); }
.insight-item.success > b { color: var(--green); }

.report-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.report-card { padding: 15px; border: 1px solid var(--line); border-radius: 6px; background: #fbfcfd; }
.report-card header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.report-card header > div { display: flex; align-items: center; gap: 9px; }
.report-card header > div > span { min-width: 42px; height: 26px; display: grid; place-items: center; border-radius: 4px; color: #fff; background: var(--primary); font-size: 11px; font-weight: 700; }
.report-card h3 { margin: 15px 0 12px; font-size: 14px; }
.report-progress { display: grid; grid-template-columns: minmax(0, 1fr) 42px; align-items: center; gap: 10px; }
.report-progress i, .coverage-cell i { height: 8px; display: block; overflow: hidden; border-radius: 4px; background: #e6ecef; }
.report-progress i b, .coverage-cell i b { height: 100%; display: block; border-radius: inherit; background: var(--primary); }
.report-progress span { color: var(--primary); font-size: 11px; font-weight: 700; text-align: right; }
.report-card footer { margin-top: 14px; padding-top: 11px; display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 8px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 10px; }

.coverage-cell { min-width: 150px; display: grid; grid-template-columns: minmax(80px, 1fr) 38px; align-items: center; gap: 8px; }
.coverage-cell span { color: var(--muted); font-size: 10px; }
code { padding: 2px 5px; border-radius: 3px; color: #285c75; background: #edf5f8; font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; }

.menu-tree-table { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.tree-group + .tree-group { border-top: 1px solid var(--line); }
.tree-group > div, .tree-child { min-height: 42px; padding: 7px 11px; display: grid; grid-template-columns: 24px minmax(180px, 1fr) 90px 50px auto; align-items: center; gap: 8px; }
.tree-group > div:first-child { background: #f6f8f9; }
.tree-child { padding-left: 35px; border-top: 1px solid var(--line-soft); }
.tree-toggle { width: 19px; height: 19px; display: grid; place-items: center; border: 1px solid #cbd5db; border-radius: 3px; color: var(--muted); }
.tree-group small { color: var(--muted); }
.tree-group em { color: var(--muted); font-style: normal; }

.settings-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.settings-form button { justify-self: start; }
.info-list { margin: 0; }
.info-list > div { min-height: 45px; padding: 10px 0; display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: center; border-bottom: 1px solid var(--line-soft); }
.info-list > div:last-child { border-bottom: 0; }
.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; font-weight: 700; }

.entity-dialog { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; overflow: visible; border: 0; border-radius: 7px; color: var(--text); background: #fff; box-shadow: 0 22px 70px rgba(9, 24, 35, .28); }
.entity-dialog.wide { width: min(1040px, calc(100vw - 32px)); }
.entity-dialog::backdrop { background: rgba(12, 23, 31, .52); }
.dialog-shell > header { min-height: 72px; padding: 15px 18px; display: flex; justify-content: space-between; align-items: center; gap: 15px; border-bottom: 1px solid var(--line); }
.dialog-shell h2 { margin: 0; font-size: 17px; }
.dialog-shell p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.dialog-body { padding: 18px; max-height: calc(100vh - 130px); overflow: auto; }
.select-picker-menu {
  position: fixed;
  z-index: 2147483647;
  pointer-events: auto;
  max-width: min(420px, calc(100vw - 16px));
  max-height: min(300px, calc(100dvh - 16px));
  overflow: hidden;
  border: 1px solid #bfcbd3;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(16, 39, 49, .18);
}
.select-picker-search { display: block; padding: 8px; border-bottom: 1px solid var(--line-soft); background: #f7f9fa; }
.select-picker-search input { width: 100%; min-height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 3px; outline: none; background: #fff; }
.select-picker-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(8, 127, 111, .12); }
.select-picker-options { max-height: 250px; overflow: auto; padding: 4px; }
.select-picker-options button { width: 100%; min-height: 34px; padding: 6px 9px; border: 0; border-radius: 3px; color: var(--text); background: transparent; text-align: left; }
.select-picker-options button:hover, .select-picker-options button[aria-selected="true"] { color: #075f53; background: #e8f5f1; }
.select-picker-empty { margin: 0; padding: 12px 9px; color: var(--muted); font-size: 12px; }
.select-empty-guidance { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; margin-top: 7px; padding: 9px 10px; border: 1px solid #d8c27e; border-radius: 4px; color: #68551b; background: #fff9e3; }
.select-empty-guidance-copy { min-width: 0; }
.select-empty-guidance strong { display: block; font-size: 12px; }
.select-empty-guidance-copy > span { display: block; margin-top: 3px; color: #786936; font-size: 11px; line-height: 1.5; }
.select-empty-guidance button { min-height: 30px; padding: 5px 9px; border: 1px solid #b99124; border-radius: 3px; color: #735510; background: #fff; white-space: nowrap; }
.select-empty-guidance button:hover { background: #fff2bd; }
.dialog-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.dialog-password-control { position: relative; }
.dialog-password-control input { width: 100%; padding-right: 54px; }
.dialog-password-control button { position: absolute; top: 3px; right: 3px; min-width: 44px; height: 30px; padding: 0 8px; border: 0; border-left: 1px solid var(--line-soft); border-radius: 3px; color: var(--primary); background: #fff; font-size: 10px; }
.dialog-password-control button:hover { background: #eef7f3; }
.controlled-multiselect { min-height: 112px; padding: 5px; }
.controlled-multiselect option { padding: 7px 8px; border-radius: 3px; }
.controlled-multiselect option:checked { color: #fff; background: var(--primary); }
.material-form-rows { margin: 0; padding: 13px; border: 1px solid var(--line); border-radius: 5px; background: #f8fafb; }
.material-form-rows legend { padding: 0 6px; color: var(--text); font-size: 12px; font-weight: 700; }
.material-form-rows > .ghost-btn { margin-top: 10px; }
.material-form-row { position: relative; display: grid; grid-template-columns: minmax(190px, 1.6fr) minmax(190px, 1.5fr) minmax(80px, .65fr) minmax(120px, .9fr) minmax(80px, .65fr) 30px; gap: 9px; align-items: end; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.material-form-row:last-child { border-bottom: 0; }
.material-form-row label { min-width: 0; }
.icon-row-remove { width: 30px; height: 36px; padding: 0; border: 1px solid #e1b9b5; border-radius: 4px; color: #9b3931; background: #fff; font-size: 17px; }
.inline-check { min-height: 36px; padding: 0 12px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 5px; background: #f9fbfb; }
.inline-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.inline-check b { font-size: 12px; font-weight: 700; color: var(--text); }
.detail-grid { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--line); }
.detail-grid > div { min-height: 68px; padding: 12px; background: #fff; }
.detail-grid dt { margin-bottom: 7px; color: var(--muted); font-size: 11px; }
.detail-grid dd { margin: 0; font-weight: 700; }
.detail-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.detail-tabs button { min-height: 38px; padding: 0 13px; display: flex; align-items: center; gap: 6px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; white-space: nowrap; }
.detail-tabs button span { min-width: 20px; height: 18px; display: grid; place-items: center; border-radius: 3px; color: #65727d; background: #eef2f4; font-size: 9px; }
.detail-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }
.editable-detail-notice { margin-bottom: 12px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; border-left: 3px solid var(--primary); color: #315149; background: #f0f7f5; }
.editable-detail-notice strong { flex: 0 0 auto; font-size: 12px; }
.editable-detail-notice span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.detail-section { display: none; padding: 16px 2px 4px; }
.detail-section.active { display: block; }
.field-display-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.field-display-grid > div { min-height: 72px; padding: 11px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.field-display-grid span, .field-display-grid strong { display: block; }
.field-display-grid span { margin-bottom: 8px; color: var(--muted); font-size: 10px; }
.field-display-grid strong { font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.editable-field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.editable-field-grid label { min-width: 0; }
.editable-field-grid input { min-width: 0; }
.detail-footer { margin-top: 16px; padding-top: 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid var(--line); }
.detail-footer > span { color: var(--muted); font-size: 10px; }

.toast { position: fixed; right: 22px; bottom: 22px; z-index: 99; max-width: min(420px, calc(100vw - 32px)); padding: 11px 15px; border-radius: 5px; color: #fff; background: #173f38; box-shadow: 0 12px 28px rgba(0, 0, 0, .18); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .18s ease; }
.toast.error { background: #8e2f2f; }
.toast.show { opacity: 1; transform: none; }

/* Customer requirement demonstration modules */
.requirement-view > div { display: grid; gap: 13px; }
.req-summary { border-top: 3px solid #307365; }
.req-summary:nth-child(2) { border-top-color: #c28a24; }
.req-summary:nth-child(3) { border-top-color: #39718f; }
.req-action, .req-secondary, .req-link { border: 0; cursor: pointer; font: inherit; }
.req-action, .req-secondary { min-height: 34px; padding: 0 13px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.req-action { color: #fff; background: var(--primary); }
.req-action:disabled { opacity: .45; cursor: not-allowed; }
.req-secondary { color: var(--primary); border: 1px solid #aac5bf; background: #f7fbfa; }
.req-link { padding: 4px 5px; color: #24617d; background: transparent; white-space: nowrap; }
.success-text { color: #24725e; }
.req-badge, .req-tag { display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
.req-badge { min-height: 23px; padding: 0 7px; border-radius: 3px; color: #59666e; background: #edf1f2; font-size: 10px; font-weight: 700; }
.req-badge.success { color: #1d6c57; background: #e4f3ed; }
.req-badge.warning { color: #8a5d0c; background: #fff0cc; }
.req-badge.danger { color: #9b3333; background: #fbe3e1; }
.req-badge.info { color: #275f79; background: #e5f1f6; }
.req-tag { margin: 2px 3px 2px 0; padding: 3px 6px; border: 1px solid #d8e3e7; border-radius: 3px; color: #4e626d; background: #f7f9fa; font-size: 9px; }
.cell-note { margin-top: 4px; display: block; color: var(--muted); font-size: 9px; }

.req-segments { margin: 0 0 13px; display: inline-flex; align-self: start; overflow-x: auto; border: 1px solid var(--line); border-radius: 5px; background: #f5f7f8; }
.req-segments button { min-height: 34px; padding: 0 13px; border: 0; border-right: 1px solid var(--line); color: var(--muted); background: transparent; white-space: nowrap; cursor: pointer; }
.req-segments button:last-child { border-right: 0; }
.req-segments button.active { color: #fff; background: var(--primary); font-weight: 700; }

.kit-layout { display: grid; grid-template-columns: minmax(260px, .72fr) minmax(620px, 2fr); gap: 13px; }
.kit-list, .kit-detail { min-width: 0; }
.kit-row { width: 100%; min-height: 70px; padding: 10px 4px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 9px; border: 0; border-bottom: 1px solid var(--line-soft); color: var(--text); background: transparent; text-align: left; cursor: pointer; }
.kit-row:last-child { border-bottom: 0; }
.kit-row.active { padding-left: 10px; border-left: 3px solid var(--primary); background: #f1f7f5; }
.kit-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 5px; color: #fff; background: #326e62; font-size: 12px; font-weight: 800; }
.kit-row strong, .kit-row small { display: block; }
.kit-row small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.kit-status-strip { margin-bottom: 13px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 5px; background: #f8fafb; }
.kit-status-strip > div { padding: 10px 12px; border-right: 1px solid var(--line); }
.kit-status-strip > div:last-child { border-right: 0; }
.kit-status-strip span, .kit-status-strip strong { display: block; }
.kit-status-strip span { color: var(--muted); font-size: 9px; }
.kit-status-strip strong { margin-top: 5px; font-size: 12px; }
.stepper { width: 92px; height: 30px; display: grid; grid-template-columns: 28px 1fr 28px; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; }
.stepper button { height: 100%; border: 0; color: var(--primary); background: #edf5f2; cursor: pointer; }
.stepper strong { text-align: center; }
.replenish-bar { margin-top: 13px; padding: 12px 13px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-left: 3px solid var(--amber); background: #fff9eb; }
.replenish-bar span, .replenish-bar strong { display: block; }
.replenish-bar span { color: #8a681f; font-size: 9px; }
.replenish-bar strong { margin-top: 5px; font-size: 11px; line-height: 1.5; }
.kit-return-history { margin-top: 14px; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.kit-return-history > header { padding: 10px 12px; border-bottom: 1px solid var(--line); background: #f7f9fa; }
.kit-return-history > header span, .kit-return-history > header strong { display: block; }
.kit-return-history > header span { color: var(--text); font-size: 11px; font-weight: 700; }
.kit-return-history > header strong { margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 400; }
.kit-return-history table { min-width: 720px; }
.kit-return-history .readonly-label { white-space: nowrap; }

.location-map { min-height: 230px; padding: 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; background: #edf1f2; }
.zone { padding: 12px; border: 1px solid #cbd8dc; border-top: 4px solid #2f7567; background: #fff; }
.zone-1 { border-top-color: #377b9b; }
.zone-2 { border-top-color: #b7862d; }
.zone-3 { border-top-color: #7b678c; }
.zone header { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; }
.zone header span { color: var(--muted); }
.zone > div { margin-top: 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.zone > div span { min-height: 42px; display: grid; place-items: center; border: 1px solid var(--line); color: #617078; background: #f6f8f9; font-size: 9px; }
.scenario-cloud { min-height: 124px; align-content: start; display: flex; flex-wrap: wrap; gap: 5px; }
.scenario-cloud .req-tag { padding: 7px 9px; border-color: #bcd1ca; color: #356a5f; background: #f2f8f6; font-size: 10px; }
.location-example { margin-top: 12px; padding: 12px; display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; border: 1px solid var(--line); border-left: 3px solid var(--primary); background: #f8faf9; }
.location-example span { color: var(--muted); font-size: 9px; }
.location-example strong { grid-row: 2; }
.location-example code { grid-row: 1 / 3; grid-column: 2; align-self: center; font-size: 12px; }

.tag-search-box { height: 48px; display: grid; grid-template-columns: 42px minmax(0, 1fr) 38px; align-items: center; overflow: hidden; border: 1px solid #9fbbb4; border-radius: 5px; box-shadow: 0 3px 10px rgba(31, 80, 69, .08); }
.tag-search-box > span { height: 100%; display: grid; place-items: center; color: #fff; background: var(--primary); font-weight: 800; }
.tag-search-box input { height: 100%; padding: 0 13px; border: 0; outline: 0; font-size: 13px; }
.tag-search-box button { height: 100%; border: 0; color: var(--muted); background: #fff; cursor: pointer; font-size: 18px; }
.quick-tags { margin-top: 11px; display: flex; flex-wrap: wrap; gap: 6px; }
.quick-tags button { min-height: 29px; padding: 0 9px; border: 1px solid var(--line); border-radius: 4px; color: #53636b; background: #f7f9fa; cursor: pointer; font-size: 10px; }
.quick-tags button.active { color: #fff; border-color: var(--primary); background: var(--primary); }
.tag-chip-board { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 7px; }
.tag-chip-board button { min-height: 50px; padding: 8px 10px; display: grid; align-content: center; border-color: #cbded9; text-align: left; }
.tag-chip-board button strong, .tag-chip-board button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-chip-board button strong { font-size: 11px; }
.tag-chip-board button small { margin-top: 4px; color: #728088; font-size: 9px; }
.tag-chip-board button.active small { color: rgba(255,255,255,.84); }
.tag-content-grid { grid-template-columns: minmax(0, 1.22fr) minmax(320px, .78fr); }
.tag-library-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tag-library-card {
  min-width: 0;
  min-height: 94px;
  padding: 10px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: start;
  gap: 7px 10px;
  border: 1px solid var(--line);
  border-left: 3px solid #357b6b;
  border-radius: 5px;
  color: var(--text);
  background: #fbfcfc;
  text-align: left;
  cursor: pointer;
}
.tag-library-card:hover, .tag-library-card.active { border-color: #75b8ab; background: #f0f8f6; }
.tag-library-card > span { width: 30px; height: 26px; display: grid; place-items: center; border-radius: 4px; color: #fff; background: #377b6c; font-size: 10px; font-weight: 800; }
.tag-library-card strong, .tag-library-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-library-card strong { font-size: 12px; }
.tag-library-card small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.tag-library-card em { justify-self: end; color: #356b60; font-size: 10px; font-style: normal; font-weight: 800; white-space: nowrap; }
.tag-library-card p { grid-column: 2 / 4; margin: 0; color: #607079; font-size: 9px; line-height: 1.45; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tag-library-card i { grid-column: 2 / 4; justify-self: start; min-height: 20px; padding: 2px 6px; display: inline-flex; align-items: center; border: 1px solid #d5e5e1; border-radius: 3px; color: #35695f; background: #f4faf8; font-size: 9px; font-style: normal; }
.tag-rule-list { display: grid; gap: 8px; }
.tag-rule-list > div { min-height: 62px; padding: 10px 11px; display: grid; gap: 5px; border: 1px solid var(--line); border-left: 3px solid #397692; border-radius: 5px; background: #f8fafb; }
.tag-rule-list b { font-size: 11px; }
.tag-rule-list span { color: var(--muted); font-size: 10px; line-height: 1.5; }
.search-results { display: grid; gap: 8px; }
.search-result { min-height: 92px; display: grid; grid-template-columns: 40px minmax(0, 1fr) 110px; align-items: stretch; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.result-level { display: grid; place-items: center; color: #fff; background: #35816e; font-size: 15px; font-weight: 800; }
.result-level.level-B { background: #c28a24; }
.result-level.level-C { background: #b94842; }
.result-main { padding: 11px 13px; }
.result-main header { display: flex; align-items: center; gap: 8px; }
.result-main p { margin: 6px 0 4px; }
.result-main small { color: var(--muted); font-size: 9px; }
.result-stock { padding: 10px; display: grid; align-content: center; text-align: right; border-left: 1px solid var(--line); background: #f7f9f9; }
.result-stock span { color: var(--muted); font-size: 9px; }
.result-stock strong { margin: 4px 0 7px; font-size: 15px; }
.result-stock div { display: grid; justify-items: end; gap: 4px; }
.result-stock button { justify-self: end; border: 0; color: #276d5e; background: transparent; cursor: pointer; font-size: 10px; }

.code-formula { margin-bottom: 14px; padding: 13px; display: flex; align-items: center; justify-content: center; gap: 8px; overflow-x: auto; border: 1px solid #c8d8d4; border-left: 3px solid var(--primary); background: #f6faf9; }
.code-formula > span { min-width: 82px; min-height: 54px; padding: 7px 9px; display: grid; place-items: center; border: 1px solid #bfd2cd; border-radius: 4px; background: #fff; }
.code-formula > span.optional { border-style: dashed; background: #fbfcfc; }
.code-formula b, .code-formula small { display: block; text-align: center; }
.code-formula b { color: #245f53; font-family: "SFMono-Regular", Consolas, monospace; font-size: 14px; }
.code-formula small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.code-formula > i { color: #839198; font-style: normal; font-weight: 800; }
.serial-generator { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; gap: 10px; }
.serial-generator .req-action { min-height: 36px; }
.code-preview { margin-top: 13px; padding: 12px 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 16px; border: 1px solid #a9c8c0; border-radius: 5px; background: #eff7f5; }
.code-preview span, .code-preview strong { display: block; }
.code-preview span { color: #4a6b64; font-size: 9px; }
.code-preview strong { margin-top: 5px; color: #174f44; font-family: "SFMono-Regular", Consolas, monospace; font-size: 17px; overflow-wrap: anywhere; }
.code-preview small { color: #4e6a64; font-family: "SFMono-Regular", Consolas, monospace; font-size: 9px; text-align: right; overflow-wrap: anywhere; }
.code-rule-notes { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 9px; }
.code-rule-notes span { display: inline-flex; align-items: center; gap: 4px; }
.coding-content-grid { grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); }
.dictionary-summary { margin-bottom: 10px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.dictionary-summary > div { min-height: 76px; padding: 10px 11px; border: 1px solid var(--line); border-top: 3px solid #347a69; border-radius: 5px; background: #fbfcfc; }
.dictionary-summary > div:nth-child(2) { border-top-color: #397692; }
.dictionary-summary > div:nth-child(3) { border-top-color: #b17831; }
.dictionary-summary > div:nth-child(4) { border-top-color: #745f87; }
.dictionary-summary > div:nth-child(5) { border-top-color: #4f6975; }
.dictionary-summary span, .dictionary-summary small { display: block; color: var(--muted); font-size: 9px; }
.dictionary-summary strong { display: block; margin: 7px 0 5px; color: var(--text); font-size: 20px; line-height: 1; }
.code-dictionary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.code-dictionary-grid section { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-top: 3px solid #3d7b6d; border-radius: 5px; background: #f8faf9; }
.code-dictionary-grid section:nth-child(2) { border-top-color: #397692; }
.code-dictionary-grid section:nth-child(3) { border-top-color: #b17831; }
.code-dictionary-grid section:nth-child(4) { border-top-color: #745f87; }
.code-dictionary-grid section:nth-child(5) { border-top-color: #4f6975; }
.code-dictionary-grid h3 { margin: 0; min-height: 36px; padding: 8px 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); font-size: 10px; }
.code-dictionary-grid h3 button { min-height: 24px; padding: 0 7px; border: 1px solid #b8d3cc; border-radius: 3px; color: #28695b; background: #fff; font-size: 9px; }
.dictionary-row { display: grid; grid-template-columns: minmax(0, 1fr) 30px; align-items: stretch; border-bottom: 1px solid var(--line-soft); }
.dictionary-row:last-child { border-bottom: 0; }
.dictionary-row > button:first-child { width: 100%; min-height: 48px; padding: 7px 8px; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 7px; border: 0; color: var(--text); background: transparent; text-align: left; cursor: pointer; }
.dictionary-row > button:first-child:hover { background: #eef7f4; }
.dictionary-delete { border: 0; border-left: 1px solid var(--line-soft); color: #9a3f3f; background: transparent; cursor: pointer; font-size: 16px; }
.dictionary-delete:hover { color: #fff; background: #a44747; }
.code-dictionary-grid code { padding: 3px 4px; text-align: center; }
.code-dictionary-grid span, .code-dictionary-grid b, .code-dictionary-grid small { min-width: 0; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-dictionary-grid b { color: #2e3a40; font-size: 10px; }
.code-dictionary-grid small { margin-top: 3px; color: #6b7b84; font-size: 8px; }
.code-dictionary-grid em { color: #28705e; font-size: 9px; font-style: normal; white-space: nowrap; }
.dictionary-foot { margin-top: 10px; padding: 10px 11px; display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; border: 1px solid #cbded8; border-left: 3px solid var(--primary); border-radius: 5px; background: #f6faf9; }
.dictionary-foot strong { font-size: 10px; }
.dictionary-foot span { color: #53656d; font-size: 10px; line-height: 1.5; }
.physical-note { margin-top: 13px; padding: 11px; display: grid; gap: 4px; border-left: 3px solid #377b9b; color: #49616c; background: #edf6fa; }
.physical-note strong { font-size: 10px; }
.physical-note span { font-size: 9px; line-height: 1.5; }
.scan-box { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.trace-card { margin-top: 12px; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.trace-card > header { padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #f5f8f8; }
.trace-card header span, .trace-card header strong { display: block; }
.trace-card header span { color: var(--muted); font-size: 9px; }
.trace-card header strong { margin-top: 3px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; overflow-wrap: anywhere; }
.trace-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.trace-grid div { padding: 9px 11px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.trace-grid span, .trace-grid strong { display: block; }
.trace-grid span { color: var(--muted); font-size: 9px; }
.trace-grid strong { margin-top: 4px; font-size: 10px; }
.trace-timeline { margin: 0; padding: 12px 12px 12px 31px; list-style: none; }
.trace-timeline li { position: relative; min-height: 38px; padding-left: 12px; border-left: 1px solid #c8d5d9; }
.trace-timeline li::before { position: absolute; top: 0; left: -5px; width: 9px; height: 9px; border-radius: 50%; content: ""; background: #bac6ca; }
.trace-timeline li.done::before { background: #31806c; }
.trace-timeline li.current::before { background: #c48a22; box-shadow: 0 0 0 4px #fff0ce; }
.trace-timeline b, .trace-timeline span { display: block; font-size: 9px; }
.trace-timeline span { margin-top: 3px; color: var(--muted); }
.label-toolbar { margin-bottom: 10px; padding: 9px 10px; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; border: 1px solid var(--line); border-radius: 5px; background: #f7faf9; }
.label-toolbar > div { margin-right: auto; min-height: 31px; display: grid; grid-template-columns: auto auto; align-items: end; gap: 5px; color: var(--muted); }
.label-toolbar strong { color: var(--primary); font-size: 22px; line-height: .95; }
.label-toolbar span { padding-bottom: 2px; font-size: 10px; }
.qr-label-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.qr-label-card { position: relative; min-width: 0; border: 1px solid var(--line); border-radius: 5px; background: #fff; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.qr-label-card:hover, .qr-label-card.active { border-color: #4a887a; box-shadow: inset 0 0 0 1px #4a887a; background: #f4faf8; }
.label-check { position: absolute; top: 8px; right: 8px; z-index: 2; width: 22px; height: 22px; display: block; }
.label-check input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.label-check span { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid #b8c8ce; border-radius: 4px; background: #fff; box-shadow: 0 1px 4px rgba(12, 28, 38, .08); }
.label-check span::after { content: ""; width: 10px; height: 6px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.label-check input:checked + span { border-color: var(--primary); background: var(--primary); }
.label-check input:checked + span::after { opacity: 1; }
.qr-label { width: 100%; min-width: 0; min-height: 112px; padding: 11px 38px 11px 11px; display: grid; grid-template-columns: 74px minmax(0, 1fr); align-items: center; gap: 10px; border: 0; color: var(--text); background: transparent; text-align: left; cursor: pointer; }
.qr-svg { width: 70px; height: 70px; display: block; padding: 3px; border: 1px solid #1a2328; background: #fff; shape-rendering: crispEdges; }
.qr-fallback { width: 70px; min-height: 70px; padding: 7px; display: grid; place-items: center; border: 1px solid #1a2328; color: #111; background: #fff; font-family: "SFMono-Regular", Consolas, monospace; font-size: 8px; overflow-wrap: anywhere; text-align: center; }
.qr-label strong, .qr-label code, .qr-label small, .qr-label em, .qr-label i { max-width: 100%; display: block; overflow: hidden; text-overflow: ellipsis; }
.qr-label strong { padding-right: 8px; font-size: 12px; }
.qr-label code { margin: 5px 0 4px; padding: 0; color: #153f36; background: transparent; white-space: normal; overflow-wrap: anywhere; font-size: 10px; }
.qr-label small { color: var(--muted); font-size: 9px; white-space: nowrap; }
.qr-label em { margin-top: 4px; color: #2d6d5f; font-size: 9px; font-style: normal; white-space: normal; overflow-wrap: anywhere; }
.qr-label i { margin-top: 4px; color: #6b7980; font-size: 8px; font-style: normal; white-space: nowrap; }
.print-sheet { display: none; }
.print-sheet header { margin: 0 0 4mm; }
.print-sheet h1 { margin: 0 0 1.5mm; font-size: 13pt; }
.print-sheet p { margin: 0; color: #333; font-size: 8pt; }
.print-label-grid { display: grid; grid-template-columns: repeat(3, 40mm); gap: 3mm; }
.print-label-card { width: 40mm; height: 25mm; padding: 2mm; display: grid; grid-template-columns: 18mm minmax(0, 1fr); gap: 2mm; overflow: hidden; border: .25mm solid #111; background: #fff; color: #111; break-inside: avoid; page-break-inside: avoid; }
.print-label-card .qr-svg { width: 18mm; height: 18mm; padding: .8mm; border: .25mm solid #111; }
.print-label-card section { min-width: 0; display: grid; align-content: start; gap: 1mm; }
.print-label-card header { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 1mm; }
.print-label-card strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 7pt; }
.print-label-card span { padding: .5mm 1mm; border: .25mm solid #111; font-size: 5pt; white-space: nowrap; }
.print-label-card code { padding: 0; color: #111; background: transparent; font-size: 5.4pt; overflow-wrap: anywhere; }
.print-label-card p { margin: 0; font-size: 5.2pt; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.print-label-card footer { display: flex; flex-wrap: wrap; gap: .8mm; }
.print-label-card b { padding: .4mm .8mm; border: .25mm solid #333; font-size: 4.8pt; line-height: 1; white-space: nowrap; }

.alert-flow { margin-bottom: 13px; padding: 10px; display: grid; grid-template-columns: auto 1fr auto 1fr auto 1fr auto; align-items: center; gap: 8px; border: 1px solid var(--line); background: #f8fafb; }
.alert-flow span { min-height: 29px; padding: 0 8px; display: grid; place-items: center; border-radius: 3px; color: #48616c; background: #e6eef1; font-size: 9px; font-weight: 700; white-space: nowrap; }
.alert-flow span.warn { color: #805d18; background: #fff0cc; }
.alert-flow span.due { color: #8c4d19; background: #fde5cf; }
.alert-flow span.danger { color: #943637; background: #f9dfde; }
.alert-flow i { height: 1px; background: #c5d1d5; }
.remark-cell { max-width: 240px; color: #56666d; font-size: 10px; line-height: 1.45; }

.warning-legend { margin-bottom: 13px; display: flex; flex-wrap: wrap; gap: 14px; }
.warning-legend > span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.warning-rule-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.warning-rule { padding: 12px; border: 1px solid var(--line); border-radius: 5px; background: #fbfcfc; }
.warning-rule header { display: flex; justify-content: space-between; align-items: center; gap: 9px; }
.warning-rule header strong, .warning-rule header span { display: block; }
.warning-rule header span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.stock-meter { position: relative; height: 13px; margin: 12px 0; overflow: hidden; border-radius: 3px; background: #e5ebed; }
.stock-meter i { height: 100%; display: block; background: #34816d; }
.stock-meter i.level-B { background: #c18a26; }
.stock-meter i.level-C { background: #b84943; }
.stock-meter span { position: absolute; inset: 0 5px 0 auto; color: #2e393d; font-size: 8px; line-height: 13px; }
.threshold-fields { display: grid; grid-template-columns: 90px 90px minmax(0, 1fr); align-items: end; gap: 8px; }
.threshold-fields label span { font-size: 9px; }
.threshold-fields input { min-height: 31px; }
.threshold-fields small { align-self: center; color: var(--muted); font-size: 9px; line-height: 1.45; }

.region-code { width: 34px; height: 28px; display: grid; place-items: center; border-radius: 3px; color: #fff; background: #356f63; font-weight: 800; }
.permission-wrap { overflow: auto; border: 1px solid var(--line); }
.permission-table { min-width: 1050px; border: 0; }
.permission-table th, .permission-table td { min-width: 76px; text-align: center; }
.permission-table .sticky-col { position: sticky; left: 0; z-index: 2; min-width: 160px; text-align: left; background: #fff; box-shadow: 1px 0 0 var(--line); }
.permission-table thead .sticky-col { background: #f2f5f6; }
.permission-table .sticky-col strong, .permission-table .sticky-col small { display: block; }
.permission-table .sticky-col small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.permission-check { width: 32px; height: 22px; position: relative; display: inline-block; cursor: pointer; }
.permission-check input { position: absolute; opacity: 0; }
.permission-check span { position: absolute; inset: 0; border-radius: 11px; background: #cbd4d7; transition: .15s ease; }
.permission-check span::after { width: 16px; height: 16px; position: absolute; top: 3px; left: 3px; border-radius: 50%; content: ""; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .15s ease; }
.permission-check input:checked + span { background: #347a69; }
.permission-check input:checked + span::after { transform: translateX(10px); }

@media (max-width: 1180px) {
  .admin-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .quick-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .master-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .scope-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-display-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-badge, .account-chip { display: none; }
  .kit-layout { grid-template-columns: 1fr; }
  .qr-label-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .serial-generator { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .coding-content-grid { grid-template-columns: 1fr; }
  .tag-content-grid { grid-template-columns: 1fr; }
  .tag-chip-board { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
  .dictionary-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .admin-shell { display: block; }
  .admin-sidebar { position: static; height: auto; grid-template-rows: auto auto; }
  .side-menu { max-height: 320px; }
  .sidebar-foot { display: none; }
  .admin-topbar { align-items: flex-start; flex-direction: column; }
  .top-actions { width: 100%; justify-content: flex-start; }
  .summary-grid, .summary-grid.three, .content-grid, .workbench-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .biz-form, .master-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .query-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .query-search { grid-column: 1 / -1; }
  .warning-rule-list { grid-template-columns: 1fr; }
  .tag-library-grid { grid-template-columns: 1fr; }
  .code-dictionary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .workspace { padding: 13px 10px 24px; }
  .admin-topbar { padding: 13px 12px; }
  .summary-grid, .summary-grid.three, .content-grid, .workbench-grid, .scope-grid { grid-template-columns: 1fr; }
  .insight-grid, .report-board, .field-display-grid, .editable-field-grid { grid-template-columns: 1fr; }
  .summary-card { min-height: 94px; }
  .span-two { grid-column: auto; }
  .quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .biz-form, .master-form, .dialog-form, .detail-grid, .settings-form { grid-template-columns: 1fr; }
  .material-form-row { grid-template-columns: 1fr 1fr; padding-right: 38px; }
  .material-form-row > label:first-child { grid-column: 1 / -1; }
  .material-form-row > label:nth-child(2) { grid-column: 1 / -1; }
.material-form-row .icon-row-remove { position: absolute; top: 38px; right: 0; }
  .kit-return-rows { min-width: 0; overflow: hidden; }
  .kit-return-rows .table-wrap { margin: 0 -2px; border: 0; overflow-x: auto; }
  .kit-return-rows table { min-width: 650px; }
  .kit-return-rows th, .kit-return-rows td { padding: 8px 6px; }
  .kit-return-rows input[type=number] { min-width: 78px; }
  .field-wide { grid-column: auto; }
  .query-bar, .query-bar.single { grid-template-columns: 1fr; }
  .query-search { grid-column: auto; }
  .top-actions .ghost-btn { flex: 1; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .table-actions { width: 100%; }
  .tree-group > div, .tree-child { grid-template-columns: 22px minmax(130px, 1fr) auto; }
  .tree-group small, .tree-group em { display: none; }
  .report-card footer { grid-template-columns: 1fr; }
  .detail-footer { align-items: stretch; flex-direction: column; }
  .editable-detail-notice { align-items: flex-start; flex-direction: column; gap: 4px; }
  .kit-status-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kit-status-strip > div:nth-child(2) { border-right: 0; }
  .kit-status-strip > div { border-bottom: 1px solid var(--line); }
  .replenish-bar { align-items: stretch; flex-direction: column; }
  .location-map, .qr-label-grid, .trace-grid { grid-template-columns: 1fr; }
  .tag-chip-board, .dictionary-summary { grid-template-columns: 1fr; }
  .tag-library-card { grid-template-columns: 34px minmax(0, 1fr); }
  .tag-library-card em { grid-column: 2; justify-self: start; }
  .tag-library-card p, .tag-library-card i { grid-column: 2; }
  .search-result { grid-template-columns: 34px minmax(0, 1fr); }
  .result-stock { grid-column: 2; grid-template-columns: 1fr auto; align-items: center; border-top: 1px solid var(--line); border-left: 0; text-align: left; }
  .result-stock strong { margin: 2px 0; }
  .result-stock span { grid-column: 1; }
  .result-stock div { grid-row: 1 / 3; grid-column: 2; }
  .result-stock button { grid-row: auto; grid-column: auto; }
  .serial-generator, .threshold-fields { grid-template-columns: 1fr; }
  .code-formula { justify-content: flex-start; }
  .code-formula > span { min-width: 72px; }
  .code-preview { grid-template-columns: 1fr; }
  .code-preview small { text-align: left; }
  .code-rule-notes { display: grid; }
  .code-dictionary-grid { grid-template-columns: 1fr; }
  .dictionary-foot { grid-template-columns: 1fr; }
  .label-toolbar { justify-content: stretch; }
  .label-toolbar > div { width: 100%; margin-right: 0; }
  .label-toolbar button { flex: 1; }
  .qr-label { grid-template-columns: 78px minmax(0, 1fr); }
  .alert-flow { grid-template-columns: 1fr; }
  .alert-flow i { width: 1px; height: 10px; justify-self: center; }
  .inventory-operation-guide { align-items: stretch; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stock-operation-form, .stock-dialog-context { grid-template-columns: 1fr; }
  .stock-dialog-context > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .stock-dialog-context > div:last-child { border-bottom: 0; }
}

@media print {
  @page { size: A4; margin: 8mm; }
  body { background: #fff !important; }
  body * { visibility: hidden !important; }
  #qrPrintSheet, #qrPrintSheet * { visibility: visible !important; }
  #qrPrintSheet {
    display: block !important;
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    padding: 0;
    color: #111;
    background: #fff;
  }
  .toast { display: none !important; }
}

/* Cool Admin aligned application shell and CRUD interaction language */
:root {
  --bg: #f2f4f7;
  --sidebar: #f7fbf8;
  --sidebar-deep: #edf8f2;
  --sidebar-hover: #eef8f2;
  --primary: #168447;
  --primary-dark: #0f7039;
  --primary-soft: #e5f5eb;
  --blue: #337ecc;
  --blue-soft: #ecf5ff;
  --text: #25352d;
  --muted: #6a7971;
  --line: #dfe7e2;
  --line-soft: #edf1ee;
  --shadow: 0 1px 2px rgba(38, 69, 51, .04);
}

html, body { height: 100%; overflow: hidden; }
body { color: var(--text); background: var(--bg); font-size: 13px; }

.admin-shell {
  width: 100%;
  height: 100vh;
  min-height: 0;
  grid-template-columns: 255px minmax(0, 1fr);
  overflow: hidden;
  transition: grid-template-columns .2s ease-in-out;
}

.admin-sidebar {
  position: relative;
  height: 100vh;
  padding: 0;
  gap: 0;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  color: #315241;
  background: var(--sidebar);
  border-right: 1px solid #dbeee3;
  transition: width .2s ease-in-out, transform .25s ease;
}

.brand {
  min-height: 67px;
  margin: 14px 12px 8px;
  padding: 9px 10px;
  gap: 9px;
  overflow: hidden;
  border: 1px solid rgba(34, 197, 94, .2);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(22, 163, 74, .12), rgba(14, 165, 166, .08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
}
.brand img { width: 37px; height: 37px; }
.brand > div { min-width: 0; }
.brand strong { color: #224332; font-size: 15px; white-space: nowrap; }
.brand span { color: #62786b; white-space: nowrap; }

.sidebar-search {
  height: 36px;
  margin: 0 10px 10px;
  padding: 0 11px;
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  border: 1px solid #cfebdb;
  border-radius: 6px;
  color: #557063;
  background: #edf8f2;
}
.sidebar-search span {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  position: relative;
}
.sidebar-search span::after { content: ""; width: 5px; height: 1.5px; position: absolute; right: -4px; bottom: -2px; background: currentColor; transform: rotate(45deg); }
.sidebar-search input { min-height: 30px; padding: 0; border: 0; color: #315241; background: transparent; box-shadow: none; }
.sidebar-search input:focus { border: 0; box-shadow: none; }

.side-menu { padding: 0 8px 12px; scrollbar-color: #bdd8c8 transparent; }
.menu-group { margin-bottom: 3px; }
.menu-group summary { min-height: 30px; padding: 6px 14px; color: #71877a; font-size: 11px; }
.menu-group summary::after { color: #789181; }
.menu-item {
  min-height: 44px;
  margin: 1px 0;
  padding: 0 14px;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 10px;
  border-radius: 6px;
  color: #315241;
}
.menu-item i { width: 23px; height: 23px; border-color: #cfe3d6; color: #527360; background: rgba(255, 255, 255, .6); }
.menu-item:hover { color: #0f7a3a; background: var(--sidebar-hover); }
.menu-item.active { color: #0f7a3a; background: #dcf4e6; box-shadow: inset 3px 0 0 var(--primary); }
.menu-item.active i { color: #0f7a3a; border-color: #a8d8b9; background: rgba(255, 255, 255, .72); }
.sidebar-foot { margin: 0 10px; border-color: #dbeee3; }
.sidebar-foot strong { color: #315241; }
.sidebar-foot small { color: #708679; }

.admin-main { height: 100vh; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.admin-topbar {
  min-height: 56px;
  padding: 0 14px;
  justify-content: flex-start;
  gap: 12px;
  flex: 0 0 auto;
  border-bottom-color: var(--line-soft);
}
.topbar-icon, .view-tab-tools button, .view-tab-full {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 4px;
  color: #65736b;
  background: transparent;
  font-size: 18px;
}
.topbar-icon:hover, .view-tab-tools button:hover, .view-tab-full:hover { color: var(--primary); background: #f0f6f2; }
.topbar-icon span, .topbar-icon span::before, .topbar-icon span::after { width: 16px; height: 1.5px; display: block; position: relative; background: currentColor; }
.topbar-icon span::before, .topbar-icon span::after { content: ""; position: absolute; left: 0; }
.topbar-icon span::before { top: -5px; }
.topbar-icon span::after { top: 5px; }
.page-heading { min-width: 0; flex: 1; }
.breadcrumb { margin: 0 0 2px; font-size: 10px; }
.page-heading h1 { font-size: 15px; font-weight: 700; }
.page-heading p { display: none; }
.top-actions { flex: 0 0 auto; flex-wrap: nowrap; }
.top-actions .ghost-btn { min-height: 32px; }
.demo-badge { min-height: 25px; }
.account-chip { min-width: 140px; }

.notification-center { position: relative; flex: 0 0 auto; }
.notification-trigger {
  min-width: 70px;
  height: 32px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #dce8e0;
  border-radius: 4px;
  color: #405249;
  background: #fff;
  cursor: pointer;
}
.notification-trigger:hover, .notification-trigger[aria-expanded="true"] { color: var(--primary); border-color: #a9d7b8; background: #f0f9f3; }
.notification-trigger > span { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #d88722; font-size: 11px; font-weight: 800; }
.notification-trigger em { font-style: normal; font-size: 12px; }
.notification-trigger b { min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: #c54444; font-size: 10px; }
.notification-trigger b:empty, .notification-trigger b[data-count="0"] { display: none; }
.notification-panel {
  width: min(390px, calc(100vw - 24px));
  position: absolute;
  z-index: 80;
  top: 40px;
  right: 0;
  border: 1px solid #dce8e0;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(26, 55, 38, .16);
  overflow: hidden;
}
.notification-panel header, .notification-panel footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.notification-panel header { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.notification-panel header strong, .notification-panel header small { display: block; }
.notification-panel header strong { font-size: 14px; }
.notification-panel header small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.notification-panel header button { width: 28px; height: 28px; border: 0; border-radius: 4px; color: #64756b; background: transparent; font-size: 18px; cursor: pointer; }
.notification-panel header button:hover { color: var(--primary); background: #f0f6f2; }
.notification-list { max-height: 360px; padding: 5px 0; overflow-y: auto; }
.notification-item { width: 100%; padding: 10px 14px; display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 10px; border: 0; border-bottom: 1px solid #f0f3f1; color: #30433a; background: #fff; text-align: left; cursor: pointer; }
.notification-item:hover { background: #f6faf7; }
.notification-item > i { width: 8px; height: 8px; border-radius: 50%; background: #d88722; }
.notification-item.danger > i { background: #c54444; }
.notification-item.info > i { background: #307cab; }
.notification-item strong, .notification-item small { display: block; }
.notification-item strong { font-size: 12px; }
.notification-item small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.notification-item > span { color: var(--primary); font-size: 11px; }
.notification-empty { padding: 28px 14px; color: var(--muted); text-align: center; font-size: 12px; }
.notification-panel footer { padding: 9px 12px; border-top: 1px solid var(--line-soft); background: #fafcfb; justify-content: flex-end; }
.notification-panel footer button { min-height: 28px; padding: 0 9px; border: 1px solid #dce8e0; border-radius: 4px; color: #486154; background: #fff; cursor: pointer; }
.notification-panel footer button:hover { color: var(--primary); border-color: #a9d7b8; }

.view-tabs {
  min-height: 43px;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  overflow: hidden;
  background: #fff;
  border-bottom: 1px solid var(--line-soft);
}
.view-tab-tools { display: flex; gap: 3px; flex: 0 0 auto; }
.view-tab-list { min-width: 0; display: flex; align-items: center; gap: 5px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.view-tab-list::-webkit-scrollbar { display: none; }
.view-tab {
  height: 28px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  border: 1px solid #dfe5e1;
  border-radius: 4px;
  color: #65736b;
  background: #fff;
  font-size: 12px;
}
.view-tab:hover { background: #f5f8f6; }
.view-tab.active { color: #0f7a3a; border-color: #b8dec5; background: #e8f6ed; }
.view-tab i { width: 15px; height: 15px; display: grid; place-items: center; border-radius: 3px; font-size: 14px; font-style: normal; line-height: 1; }
.view-tab i:hover { color: #fff; background: #df6262; }
.view-tab-full { flex: 0 0 auto; }

.workspace {
  width: calc(100% - 20px);
  min-height: 0;
  margin: 0 10px 10px;
  padding: 10px;
  flex: 1;
  overflow: auto;
  border-radius: 6px;
  background: #fff;
}
.module-view.active { animation: view-in .12s ease-out; }
.screen-module.active { height: auto; min-height: 0; }

.summary-grid { margin-bottom: 12px; gap: 10px; }
.summary-card, .admin-panel { border-radius: 6px; box-shadow: none; }
.summary-card { min-height: 94px; padding: 14px 16px; }
.summary-card strong { font-size: 25px; }
.admin-panel { padding: 14px; margin-bottom: 12px; border-color: #e4e9e6; }
.panel-head { min-height: 32px; margin-bottom: 12px; }
.panel-head h2 { font-size: 15px; }
.panel-head span, .panel-head div > span { font-size: 11px; }

.query-bar, .query-bar.single {
  margin-bottom: 10px;
  padding: 12px;
  grid-template-columns: repeat(3, minmax(150px, 220px)) minmax(150px, 1fr);
  gap: 10px;
  border: 1px solid #e5ebe7;
  border-radius: 6px;
  background: #f8faf9;
}
.query-actions { min-width: 150px; display: flex; justify-content: flex-end; align-items: end; gap: 8px; }
.query-actions button { min-height: 34px; }
.query-submit-btn { padding: 0 13px; border: 1px solid var(--primary); border-radius: 4px; color: #fff; background: var(--primary); font-weight: 600; }
.query-submit-btn:hover { border-color: var(--primary-dark); background: var(--primary-dark); }
label { gap: 5px; }
input, select, textarea { min-height: 34px; border-color: #d8dfdb; border-radius: 4px; }
input:hover, select:hover, textarea:hover { border-color: #a9b8b0; }
input:focus, select:focus, textarea:focus { border-color: #4eac73; box-shadow: 0 0 0 2px rgba(22, 132, 71, .1); }

.crud-toolbar {
  min-height: 46px;
  padding: 5px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.crud-toolbar-main, .crud-toolbar-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crud-toolbar-tools { margin-left: auto; flex-wrap: nowrap; }
.crud-toolbar-tools button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid #dfe5e1;
  border-radius: 4px;
  color: #5e6c64;
  background: #fff;
  font-size: 12px;
}
.crud-toolbar-tools button:hover { color: var(--primary); border-color: #aed3ba; background: #f2f9f4; }
.crud-result-count { color: var(--muted); font-size: 12px; }

.primary-btn, .ghost-btn, .text-btn, .row-btn, .icon-btn { min-height: 32px; border-radius: 4px; font-weight: 400; }
.primary-btn { font-weight: 600; }
.row-actions { gap: 2px; flex-wrap: nowrap; }
.row-btn { min-height: 26px; padding: 0 6px; border-color: transparent; color: #337ecc; background: transparent; font-size: 11px; }
.row-btn:hover { color: #1f69b3; border-color: transparent; background: #ecf5ff; }
.row-btn.danger { color: #d34b4b; border-color: transparent; background: transparent; }
.row-btn.danger:hover { color: #b53535; border-color: transparent; background: #fef0f0; }

.table-wrap { border-radius: 4px; border-color: #e1e7e3; }
table { font-size: 12px; }
th, td { height: 44px; min-height: 44px; padding: 9px 10px; }
th { color: #56665d; background: #f5f7f6; }
tbody tr:nth-child(even) td { background: #fcfdfc; }
tbody tr:hover td { background: #f2f8f4; }
.compact-table th, .compact-table td { height: 34px; min-height: 34px; padding-top: 5px; padding-bottom: 5px; }

.crud-pagination {
  min-height: 48px;
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}
.crud-pagination > div { display: flex; align-items: center; gap: 5px; }
.crud-pagination select { width: auto; min-height: 30px; padding: 4px 28px 4px 8px; }
.crud-pagination button, .crud-pagination b {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  display: grid;
  place-items: center;
  border: 1px solid #dfe5e1;
  border-radius: 4px;
  color: #56665d;
  background: #fff;
  font-weight: 400;
}
.crud-pagination button:hover:not(:disabled) { color: var(--primary); border-color: #a9d0b6; }
.crud-pagination button:disabled { opacity: .45; cursor: not-allowed; }
.crud-pagination b { color: #fff; border-color: var(--primary); background: var(--primary); }
.crud-pagination em { font-style: normal; }

.inventory-operation-guide { border-radius: 4px; }
.stock-row-actions { grid-template-columns: repeat(5, minmax(40px, 1fr)); }
.stock-op-btn { min-height: 26px; border-radius: 3px; }
.status-tag, .req-badge, .req-tag { border-radius: 3px; }

.entity-dialog { border-radius: 6px; box-shadow: 0 18px 50px rgba(20, 38, 28, .24); }
.entity-dialog::backdrop { background: rgba(25, 40, 31, .46); }
.dialog-shell > header { min-height: 60px; padding: 12px 16px; }
.dialog-shell h2 { font-size: 16px; }
.dialog-body { padding: 16px; }
.dialog-form > .form-actions, .detail-footer {
  position: sticky;
  bottom: -16px;
  z-index: 3;
  margin: 12px -16px -16px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 -5px 14px rgba(27, 54, 39, .05);
}
.dialog-form > .form-actions {
  margin-right: 0;
  margin-left: 0;
  padding-right: 0;
  padding-left: 0;
}
.toast {
  right: 22px;
  top: 70px;
  bottom: auto;
  padding: 11px 15px 11px 38px;
  color: #315241;
  border: 1px solid #b8dec5;
  background: #f0f9f3;
  box-shadow: 0 8px 24px rgba(24, 72, 43, .12);
}
.toast::before { content: "✓"; position: absolute; left: 14px; color: var(--primary); font-weight: 700; }
.toast.error { color: #8e3636; border-color: #ecc0c0; background: #fef0f0; }
.toast.error::before { content: "!"; color: #c23b3b; }
.dialog-toast { position: fixed; z-index: 2147483647; top: 20px; right: 20px; max-width: min(420px, calc(100vw - 32px)); padding: 11px 15px 11px 38px; border: 1px solid #b8dec5; border-radius: 5px; color: #315241; background: #f0f9f3; box-shadow: 0 8px 24px rgba(24, 72, 43, .18); opacity: 0; transform: translateY(-10px); pointer-events: none; transition: .18s ease; }
.dialog-toast::before { content: "✓"; position: absolute; left: 14px; color: var(--primary); font-weight: 700; }
.dialog-toast.error { color: #8e3636; border-color: #ecc0c0; background: #fef0f0; }
.dialog-toast.error::before { content: "!"; color: #c23b3b; }
.dialog-toast.show { opacity: 1; transform: none; }

body.sidebar-collapsed .admin-shell { grid-template-columns: 67px minmax(0, 1fr); }
body.sidebar-collapsed .brand { min-height: 0; height: 0; margin: 0; padding: 0; border: 0; opacity: 0; }
body.sidebar-collapsed .sidebar-search { margin-top: 10px; justify-content: center; }
body.sidebar-collapsed .sidebar-search input { width: 0; opacity: 0; pointer-events: none; }
body.sidebar-collapsed .menu-group { margin: 0; }
body.sidebar-collapsed .menu-group summary { display: none; }
body.sidebar-collapsed .menu-group .menu-item:not([hidden]) { display: grid !important; padding: 0 13px; grid-template-columns: 24px; justify-content: center; }
body.sidebar-collapsed .menu-item span, body.sidebar-collapsed .menu-item b { display: none; }
body.sidebar-collapsed .sidebar-foot { display: none; }

body.workspace-full .admin-shell { grid-template-columns: minmax(0, 1fr); }
body.workspace-full .admin-sidebar, body.workspace-full .admin-topbar { display: none; }

@media (max-width: 1100px) {
  .top-actions > .ghost-btn, .demo-badge { display: none; }
  .query-bar, .query-bar.single { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
  .query-actions { justify-content: flex-start; }
}

@media (max-width: 768px) {
  .admin-shell, body.sidebar-collapsed .admin-shell { display: grid; grid-template-columns: minmax(0, 1fr); }
  .admin-sidebar {
    width: 255px;
    height: 100vh;
    height: 100dvh;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    overflow: hidden;
    transform: translate3d(0, 0, 0);
    box-shadow: 12px 0 30px rgba(20, 50, 31, .16);
    will-change: transform;
    backface-visibility: hidden;
    transition: transform .28s cubic-bezier(.25, .1, .25, 1), box-shadow .28s ease;
  }
  .side-menu { max-height: none; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .sidebar-foot { display: grid; flex: 0 0 auto; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  body.sidebar-collapsed .admin-sidebar {
    transform: translate3d(-100%, 0, 0);
    box-shadow: none;
    transition: transform .24s cubic-bezier(.4, 0, 1, 1), box-shadow .24s ease;
  }
  .sidebar-mask {
    display: block;
    position: fixed;
    inset: 0 0 0 255px;
    z-index: 49;
    border: 0;
    background: transparent;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: none;
  }
  body.sidebar-collapsed .sidebar-mask {
    display: block;
    opacity: 1;
    visibility: hidden;
    pointer-events: none;
    transition: none;
  }
  body.sidebar-collapsed .brand { min-height: 67px; height: auto; margin: 14px 12px 8px; padding: 9px 10px; border: 1px solid rgba(34, 197, 94, .2); opacity: 1; }
  body.sidebar-collapsed .sidebar-search { margin: 0 10px 10px; justify-content: flex-start; }
  body.sidebar-collapsed .sidebar-search input { width: 100%; opacity: 1; pointer-events: auto; }
  body.sidebar-collapsed .menu-group summary { display: flex; }
  body.sidebar-collapsed .menu-group .menu-item:not([hidden]) { padding: 0 14px; grid-template-columns: 24px minmax(0, 1fr) auto; justify-content: stretch; }
  body.sidebar-collapsed .menu-item span { display: block; }
  body.sidebar-collapsed .sidebar-foot { display: grid; }
  .admin-topbar {
    height: 56px;
    min-height: 56px;
    max-height: 56px;
    flex-direction: row;
    align-items: center;
    padding: 0 10px;
    overflow: hidden;
  }
  .topbar-icon { flex: 0 0 32px; }
  .page-heading { width: calc(100% - 44px); min-width: 0; flex: 1 1 auto; overflow: hidden; }
  .breadcrumb, .page-heading h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page-heading h1 { line-height: 20px; }
  .top-actions { display: flex !important; width: auto; flex: 0 0 auto; }
  .top-actions > :not(.account-menu) { display: none !important; }
  .notification-trigger { min-width: 32px; width: 32px; padding: 0; }
  .notification-trigger em { display: none; }
  .notification-trigger b { position: absolute; top: -5px; right: -7px; }
  .notification-panel { position: fixed; top: 62px; right: 8px; left: 8px; width: auto; max-height: calc(100dvh - 76px); }
  .notification-list { max-height: calc(100dvh - 190px); }
  .account-chip { min-width: 44px; padding: 5px 4px; display: grid; grid-template-columns: 34px; border-left: 0; }
  .account-chip > div { display: none; }
  .account-chevron { display: none; }
  .account-popover { position: fixed; top: 62px; right: 8px; left: 8px; width: auto; }
  .view-tab-tools button:first-child { display: none; }
  .workspace { width: calc(100% - 12px); margin: 0 6px 6px; padding: 7px; }
  .query-bar, .query-bar.single { grid-template-columns: 1fr; padding: 10px; }
  .query-actions { min-width: 0; }
  .crud-toolbar { align-items: flex-start; }
  .crud-toolbar-tools button span { display: none; }
  .crud-pagination { align-items: flex-start; flex-direction: column; }
  .crud-pagination > div { width: 100%; overflow-x: auto; }
  .summary-grid, .summary-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-card { min-height: 86px; }
  .entity-dialog {
    width: calc(100vw - 32px);
    height: calc(100dvh - 32px);
    max-height: calc(100dvh - 32px);
    overflow: visible;
  }
  .dialog-shell {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }
  .dialog-body {
    min-height: 0;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .detail-tabs {
    width: 100%;
    padding-bottom: 2px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }
  .detail-tabs button { flex: 0 0 auto; }
  .editable-field-grid input[readonly] { color: #53645b; background: #f7f9f8; }
  .detail-footer {
    position: static;
    bottom: auto;
    margin: 16px -16px -16px;
  }
  .select-empty-guidance { grid-template-columns: 1fr; }
  .select-empty-guidance button { width: 100%; }
  .dialog-toast { top: 12px; right: 12px; left: 12px; max-width: none; }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  .admin-sidebar, body.sidebar-collapsed .admin-sidebar, .sidebar-mask, body.sidebar-collapsed .sidebar-mask { transition-duration: .01ms; }
}

@media (max-width: 1180px) {
  .stock-register-query { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
  .leadership-screen-head { grid-template-columns: 1fr; }
  .screen-filter-bar { grid-template-columns: repeat(4, minmax(132px, 1fr)); }
  .screen-filter-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .leadership-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .leadership-kpi:nth-child(3n) { border-right: 0; }
  .leadership-kpi:nth-child(-n+3) { border-bottom: 1px solid #e7eeea; }
  .leadership-trend-panel, .leadership-risk-panel { grid-column: span 6; }
  .leadership-unit-panel, .leadership-return-panel, .leadership-warehouse-panel { grid-column: span 6; }
  .stock-register-insights { grid-template-columns: 1fr; }
  .stock-register-insights > section + section { border-top: 1px solid #e3ece8; border-left: 0; }
}

@media (max-width: 768px) {
  .legacy-screen-module.active { height: calc(100dvh - 111px); min-height: 600px; border-radius: 4px; }
  .stock-register-head { align-items: flex-start; flex-direction: column; }
  .stock-register-actions { width: 100%; }
  .stock-register-actions button { flex: 1; }
  .stock-register-query { grid-template-columns: 1fr; }
  .stock-register-preview-head { align-items: flex-start; flex-direction: column; }
  .stock-register-preview-head small { text-align: left; }
  .stock-register-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stock-register-stats > div:nth-child(2n) { border-right: 0; }
  .stock-register-stats > div { border-bottom: 1px solid #e3ece8; }
  .stock-register-stats > div:last-child { grid-column: auto; border-bottom: 0; }
  .leadership-screen { padding: 11px; }
  .leadership-screen-title h2 { font-size: 17px; }
  .screen-filter-bar { grid-template-columns: 1fr; }
  .screen-filter-actions { grid-column: auto; width: 100%; justify-content: stretch; }
  .screen-filter-actions button { flex: 1; }
  .leadership-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .leadership-kpi { min-height: 91px; padding: 11px; border-bottom: 1px solid #e7eeea; }
  .leadership-kpi:nth-child(3n) { border-right: 1px solid #e7eeea; }
  .leadership-kpi:nth-child(2n) { border-right: 0; }
  .leadership-kpi:nth-last-child(-n+2) { border-bottom: 0; }
  .leadership-kpi strong { font-size: 20px; }
  .leadership-board { grid-template-columns: 1fr; gap: 9px; margin-top: 9px; }
  .leadership-trend-panel, .leadership-risk-panel, .leadership-unit-panel, .leadership-return-panel, .leadership-warehouse-panel, .leadership-recent-panel { grid-column: 1; }
  .leadership-panel { padding: 11px; }
  .leadership-panel > header { gap: 7px; }
  .screen-legend { display: none; }
  .screen-trend { height: 155px; gap: 3px; }
  .screen-trend-column small { transform: rotate(-35deg); transform-origin: top right; font-size: 8px; }
  .screen-operation-counts { gap: 8px; }
  .screen-operation-counts span { width: calc(50% - 4px); }
  .screen-operation-counts b { font-size: 13px; }
  .screen-recent-table table { min-width: 720px; }
  .stock-register-insights > section { padding: 10px; }
  .stock-register-unit-list { grid-template-columns: 1fr; }
}

[hidden] { display: none !important; }

.panel-actions, .initialization-actions, .initialization-confirm { display: flex; align-items: center; gap: 8px; }
.initialization-status { min-height: 66px; padding: 12px 14px; display: flex; align-items: center; gap: 11px; border: 1px solid #d8e4df; border-left: 4px solid #3b7c68; background: #f8fbf9; }
.initialization-status > span { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #3b7c68; font-size: 13px; font-weight: 800; }
.initialization-status strong, .initialization-status small { display: block; }
.initialization-status strong { color: #244b40; font-size: 13px; }
.initialization-status small { margin-top: 4px; color: #6e7f77; font-size: 11px; }
.initialization-status.warning { border-left-color: #b7791f; background: #fffaf0; }
.initialization-status.warning > span { background: #b7791f; }
.initialization-status.warning strong { color: #7c4b14; }
.initialization-status.danger { border-left-color: #b93e42; background: #fff7f7; }
.initialization-status.danger > span { background: #b93e42; }
.initialization-status.danger strong { color: #8c2f33; }

.initialization-counts { margin-top: 12px; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); border: 1px solid #e1e8e5; background: #fff; }
.initialization-counts article { min-width: 0; padding: 11px 9px; border-right: 1px solid #e1e8e5; text-align: center; }
.initialization-counts article:last-child { border-right: 0; }
.initialization-counts span, .initialization-counts small { display: block; color: #77857e; font-size: 10px; }
.initialization-counts strong { display: inline-block; margin: 5px 3px 1px 0; color: #243c35; font-size: 19px; letter-spacing: 0; }
.initialization-counts small { display: inline; }

.initialization-checks { margin-top: 10px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid #e2e8e5; background: #fafcfb; }
.initialization-checks article { min-height: 54px; padding: 9px 11px; display: flex; align-items: center; gap: 8px; border-right: 1px solid #e2e8e5; border-bottom: 1px solid #e2e8e5; }
.initialization-checks article:nth-child(4n) { border-right: 0; }
.initialization-checks article:nth-child(n+5) { border-bottom: 0; }
.initialization-checks article > span { width: 20px; height: 20px; flex: 0 0 20px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #4c866d; font-size: 10px; font-weight: 800; }
.initialization-checks article.pending > span { color: #8a5b18; background: #f7dfae; }
.initialization-checks article.danger > span { background: #bd4a4e; }
.initialization-checks strong, .initialization-checks small { display: block; }
.initialization-checks strong { color: #354b42; font-size: 11px; }
.initialization-checks small { margin-top: 3px; color: #7d8983; font-size: 10px; }

.initialization-steps { min-height: 44px; margin-bottom: 12px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid #dce5e1; background: #f8faf9; }
.initialization-steps span { position: relative; min-width: 0; padding: 10px 10px; display: flex; align-items: center; justify-content: center; gap: 7px; color: #76837d; border-right: 1px solid #dce5e1; font-size: 11px; }
.initialization-steps span:last-child { border-right: 0; }
.initialization-steps i { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; color: #64736b; background: #e6ece9; font-size: 10px; font-style: normal; font-weight: 700; }
.initialization-steps span.active { color: #285c4d; background: #eef7f3; font-weight: 700; }
.initialization-steps span.active i { color: #fff; background: #2f7962; }
.initialization-steps span.complete { color: #4d735f; }
.initialization-steps span.complete i { color: transparent; background: #5c9477; }
.initialization-steps span.complete i::after { content: "✓"; color: #fff; }

.initialization-upload { min-height: 118px; padding: 20px; display: grid; place-items: center; align-content: center; gap: 5px; border: 1px dashed #9dbbb0; color: #566a61; background: #f9fcfa; cursor: pointer; text-align: center; }
.initialization-upload:hover { border-color: #3a8069; background: #f2f8f5; }
.initialization-upload input { display: none; }
.initialization-upload > span { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #367963; font-size: 16px; }
.initialization-upload strong { max-width: 100%; overflow-wrap: anywhere; color: #31574b; font-size: 12px; }
.initialization-upload small { color: #839088; font-size: 10px; }
.initialization-actions { margin-top: 10px; justify-content: flex-end; }
.initialization-actions > span { color: #77847e; font-size: 10px; }
.primary-btn.is-loading, .ghost-btn.is-loading { cursor: progress; opacity: .72; }

.initialization-preview { margin-top: 14px; border: 1px solid #dce5e1; background: #fff; }
.initialization-preview > header { min-height: 58px; padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #e2e9e6; background: #f8faf9; }
.initialization-preview > header strong, .initialization-preview > header small { display: block; }
.initialization-preview > header strong { color: #2a463d; font-size: 13px; }
.initialization-preview > header small { margin-top: 4px; color: #7b8881; font-size: 10px; }
.initialization-result-status, .initialization-run-status { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border: 1px solid #d9b977; border-radius: 3px; color: #825716; background: #fff8e9; font-size: 10px; font-weight: 700; white-space: nowrap; }
.initialization-result-status.success, .initialization-run-status.success { color: #376e53; border-color: #a9cbb9; background: #f2f8f4; }
.initialization-result-status.danger, .initialization-run-status.danger { color: #9c3438; border-color: #e0a5a7; background: #fff4f4; }

.initialization-sheet-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid #e2e9e6; }
.initialization-sheet-summary article { min-width: 0; padding: 10px 12px; border-right: 1px solid #e2e9e6; border-bottom: 1px solid #e2e9e6; }
.initialization-sheet-summary article:nth-child(4n) { border-right: 0; }
.initialization-sheet-summary strong, .initialization-sheet-summary span, .initialization-sheet-summary small { display: block; }
.initialization-sheet-summary strong { overflow: hidden; color: #344c43; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.initialization-sheet-summary span { margin-top: 5px; color: #2c755e; font-size: 14px; font-weight: 700; }
.initialization-sheet-summary small { margin-top: 2px; color: #7c8882; font-size: 9px; }
.initialization-empty { grid-column: 1 / -1; min-height: 58px; display: grid; place-items: center; color: #7b8881; font-size: 11px; }

.initialization-errors { padding: 12px; }
.initialization-error-head { margin-bottom: 8px; display: flex; justify-content: space-between; gap: 12px; }
.initialization-error-head strong { color: #9a3438; font-size: 11px; }
.initialization-error-head span { color: #7e8984; font-size: 10px; }
.initialization-error-table { max-height: 330px; overflow: auto; border: 1px solid #ead2d3; }
.initialization-error-table table { min-width: 680px; }
.initialization-error-table th { color: #74474a; background: #fff5f5; }
.initialization-error-table td:last-child { color: #863a3e; white-space: normal; }
.initialization-success-note, .initialization-running-note { min-height: 58px; padding: 11px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-left: 3px solid #468568; background: #f4f9f6; }
.initialization-running-note { border-left-color: #b17824; background: #fff9ee; }
.initialization-success-note strong, .initialization-running-note strong { color: #366650; font-size: 11px; }
.initialization-running-note strong { color: #81561c; }
.initialization-success-note span, .initialization-running-note span { color: #6f7e76; font-size: 10px; text-align: right; }
.initialization-confirm { padding: 12px; justify-content: flex-end; border-top: 1px solid #e2e9e6; background: #fafcfb; }
.initialization-confirm label { width: min(390px, 100%); }
.initialization-confirm button { align-self: end; white-space: nowrap; }

.initialization-run-summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid #dfe7e3; }
.initialization-run-summary article { min-width: 0; padding: 11px; border-right: 1px solid #dfe7e3; text-align: center; }
.initialization-run-summary article:last-child { border-right: 0; }
.initialization-run-summary span, .initialization-run-summary strong { display: block; }
.initialization-run-summary span { color: #79867f; font-size: 10px; }
.initialization-run-summary strong { margin-top: 5px; color: #2e4d42; font-size: 15px; }
.initialization-run-summary strong.success { color: #3b7658; }
.initialization-run-summary strong.warning { color: #97651d; }
.initialization-run-summary strong.danger { color: #a13b3f; }
.initialization-run-section { margin-top: 15px; }
.initialization-run-section h3 { margin: 0 0 8px; color: #3d5149; font-size: 12px; }
.initialization-run-section .initialization-sheet-summary { border: 1px solid #e2e9e6; }

@media (max-width: 1180px) {
  .initialization-counts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .initialization-counts article:nth-child(4n) { border-right: 0; }
  .initialization-counts article:nth-child(-n+4) { border-bottom: 1px solid #e1e8e5; }
  .initialization-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .initialization-checks article:nth-child(2n) { border-right: 0; }
  .initialization-checks article:nth-child(n+7) { border-bottom: 0; }
}

@media (max-width: 768px) {
  .initialization-overview .panel-head, .initialization-import .panel-head { align-items: flex-start; flex-direction: column; }
  .initialization-overview .panel-actions { width: 100%; }
  .initialization-overview .panel-actions button { min-width: 0; flex: 1; padding: 0 8px; }
  .initialization-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .initialization-counts article:nth-child(2n) { border-right: 0; }
  .initialization-counts article:nth-child(-n+6) { border-bottom: 1px solid #e1e8e5; }
  .initialization-checks { grid-template-columns: 1fr; }
  .initialization-checks article, .initialization-checks article:nth-child(2n) { border-right: 0; border-bottom: 1px solid #e2e8e5; }
  .initialization-checks article:last-child { border-bottom: 0; }
  .initialization-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .initialization-steps span:nth-child(2) { border-right: 0; }
  .initialization-steps span:nth-child(-n+2) { border-bottom: 1px solid #dce5e1; }
  .initialization-actions { align-items: stretch; flex-direction: column; }
  .initialization-actions button { width: 100%; }
  .initialization-actions > span { text-align: center; }
  .initialization-preview > header { align-items: flex-start; }
  .initialization-sheet-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .initialization-sheet-summary article:nth-child(2n) { border-right: 0; }
  .initialization-error-head, .initialization-success-note, .initialization-running-note { align-items: flex-start; flex-direction: column; }
  .initialization-success-note span, .initialization-running-note span { text-align: left; }
  .initialization-confirm { align-items: stretch; flex-direction: column; }
  .initialization-confirm label { width: 100%; }
  .initialization-run-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .initialization-run-summary article:nth-child(3n) { border-right: 0; }
  .initialization-run-summary article:nth-child(-n+3) { border-bottom: 1px solid #dfe7e3; }
}
