:root {
  --bg: #f2f5f9;
  --card: #ffffff;
  --line: #dde4ee;
  --ink: #111f33;
  --muted: #56627a;
  --brand: #1156d9;
  --brand-strong: #0f4fbf;
  --brand-softest: #f3f7ff;
  --brand-soft: #dbe8ff;
  --danger: #c23636;
  --danger-soft: #ffe9e9;
  --ok: #1f9d61;
  --warn: #cc7a00;
  --bad: #cc2f2f;
  --radius: 14px;
  --sidebar-width: 230px;
  --focus-ring: 0 0 0 3px rgba(17, 86, 217, 0.18);
  --shadow-card: 0 6px 20px rgba(17, 43, 88, 0.06);
  --shadow-card-hover: 0 14px 34px rgba(17, 43, 88, 0.13);
  --trans-fast: 0.16s ease;
  --trans-base: 0.24s ease;
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 0%, #f9fbff 0%, var(--bg) 46%),
    radial-gradient(circle at 92% 12%, #edf4ff 0%, rgba(237, 244, 255, 0) 34%);
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

body.auth-locked {
  overflow: hidden;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  background: linear-gradient(180deg, #0f2f74 0%, #113a8f 100%);
  color: #fff;
  padding: 16px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.14), 8px 0 24px rgba(7, 22, 58, 0.2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #ffffff;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.logo.logo-text {
  background: linear-gradient(135deg, #8bc1ff, #d8ecff);
  color: #0b3f98;
  font-weight: 700;
  font-size: 14px;
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.system-icon-preview-wrap {
  display: flex;
  align-items: center;
}

.system-icon-preview-box {
  width: 76px;
  height: 76px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #f7faff;
  display: grid;
  place-items: center;
  padding: 8px;
  text-align: center;
}

.system-icon-preview-box img {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: cover;
  display: none;
}

.system-icon-preview-box.has-image img {
  display: block;
}

#globalSystemIconPreviewText {
  font-size: 12px;
  line-height: 1.2;
  color: var(--muted);
}

.system-icon-preview-box.has-image #globalSystemIconPreviewText {
  display: none;
}

.brand h1 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.3px;
}

.brand p {
  margin: 2px 0 0;
  font-size: 12px;
  opacity: 0.8;
}

.nav {
  display: grid;
  gap: 4px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  align-content: start;
  grid-auto-rows: max-content;
}

.nav-item {
  border: none;
  text-align: left;
  padding: 0 12px;
  border-radius: 10px;
  background: transparent;
  color: #e5ecff;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
  line-height: 1;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  display: flex;
  align-items: center;
  position: relative;
  transition: background var(--trans-fast), transform var(--trans-fast), color var(--trans-fast);
}

.nav-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 3px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  opacity: 0;
  transform: scaleY(0.6);
  transition: opacity var(--trans-fast), transform var(--trans-fast);
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.15);
  transform: translateX(2px);
}

.nav-item:hover::before,
.nav-item.active::before {
  opacity: 1;
  transform: scaleY(1);
}

.nav-item.hidden-by-role {
  display: none;
}

.nav-group {
  display: grid;
  gap: 4px;
  align-content: start;
}

.nav-group.hidden-by-role {
  display: none;
}

.nav-group-toggle {
  position: relative;
  padding-right: 30px;
}

.nav-group-toggle::after {
  content: "▸";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  opacity: 0.85;
  transition: transform 0.2s ease;
}

.nav-group.open .nav-group-toggle::after {
  transform: translateY(-50%) rotate(90deg);
}

.nav-submenu {
  display: none;
  gap: 4px;
  padding-left: 6px;
  align-content: start;
}

.nav-group.open .nav-submenu {
  display: grid;
}

.nav-subitem {
  font-size: 13px;
  padding-left: 18px;
  background: rgba(255, 255, 255, 0.05);
  height: 42px;
  min-height: 42px;
  max-height: 42px;
}

#inventorySubnav .finance-subnav-btn.hidden-by-role,
#payPlatformSubnav .finance-subnav-btn.hidden-by-role {
  display: none;
}

.nav-subitem:hover,
.nav-subitem.active {
  background: rgba(255, 255, 255, 0.2);
}

.sidebar-footer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  display: grid;
  gap: 8px;
}

.sidebar-version {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: #e5ecff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-footer-link {
  width: 100%;
}

.main {
  padding: 20px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  border: 1px solid #e3ebf6;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 20px rgba(17, 43, 88, 0.08);
  backdrop-filter: blur(8px);
  padding: 10px 12px;
}

.top-tabs-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -4px 0 14px;
  padding: 6px 8px;
  border: 1px solid #e4ebf7;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(17, 43, 88, 0.06);
}

.top-tabs-scroller {
  min-width: 0;
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.top-tabs-list {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 100%;
  padding: 1px 0;
}

.top-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  border: 1px solid #d8e4f5;
  border-radius: 8px;
  background: #fff;
  color: #2a3b56;
  padding: 0 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--trans-fast);
  font-size: 13px;
}

.top-tab:hover {
  border-color: #a8c2ee;
  color: #0f4fbf;
  background: #f7faff;
}

.top-tab.active {
  border-color: #2c6ee7;
  color: #0f4fbf;
  background: #edf4ff;
  box-shadow: inset 0 0 0 1px rgba(44, 110, 231, 0.15);
}

.top-tab-text {
  display: inline-block;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-tab-close {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
  color: #8393ad;
}

.top-tab:hover .top-tab-close {
  background: #e8eef9;
  color: #415878;
}

.top-tab.active .top-tab-close {
  color: #265fcb;
}

.top-tabs-nav-btn {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid #d8e4f5;
  background: #fff;
  color: #425a7b;
  cursor: pointer;
  transition: all var(--trans-fast);
}

.top-tabs-nav-btn:hover {
  border-color: #b7ccf0;
  color: #0f4fbf;
  background: #f5f9ff;
}

.menu-btn {
  display: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
  cursor: pointer;
  transition: all var(--trans-fast);
}

.menu-btn:hover {
  border-color: #c5d7f7;
  box-shadow: 0 6px 16px rgba(17, 86, 217, 0.16);
}

.topbar-title h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.2px;
}

.topbar-title p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#currentUserLabel {
  font-weight: 600;
  color: #233f72;
}

#logoutBtn {
  display: none;
}

body.auth-ready #logoutBtn {
  display: inline-block;
}

.login-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 120;
  padding: 20px;
  overflow: hidden;
  background:
    radial-gradient(1200px 760px at 12% 18%, rgba(64, 129, 236, 0.24), rgba(64, 129, 236, 0) 58%),
    radial-gradient(920px 620px at 84% 82%, rgba(20, 149, 224, 0.16), rgba(20, 149, 224, 0) 56%),
    linear-gradient(145deg, #020612 0%, #041838 44%, #062a52 100%);
}

.login-backdrop::before,
.login-backdrop::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.login-backdrop::before {
  inset: -14%;
  background-image:
    linear-gradient(rgba(96, 153, 230, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 153, 230, 0.13) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.34;
  transform: perspective(840px) rotateX(52deg) translateY(12%);
  animation: loginGridFlow 18s linear infinite;
}

.login-backdrop::after {
  width: 720px;
  height: 720px;
  right: -220px;
  top: -260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(66, 143, 232, 0.34) 0%, rgba(66, 143, 232, 0) 66%);
  filter: blur(6px);
  opacity: 0.7;
}

@keyframes loginGridFlow {
  from {
    transform: perspective(840px) rotateX(52deg) translateY(12%) translateX(0);
  }
  to {
    transform: perspective(840px) rotateX(52deg) translateY(12%) translateX(34px);
  }
}

.login-backdrop.hidden {
  display: none;
}

.login-card {
  width: min(468px, calc(100vw - 24px));
  position: relative;
  border-radius: 22px;
  border: 1px solid rgba(99, 156, 226, 0.44);
  background:
    linear-gradient(150deg, rgba(5, 16, 41, 0.9), rgba(7, 29, 67, 0.86)),
    linear-gradient(180deg, rgba(156, 200, 255, 0.06), rgba(156, 200, 255, 0.01));
  backdrop-filter: blur(20px) saturate(132%);
  -webkit-backdrop-filter: blur(20px) saturate(132%);
  box-shadow:
    0 34px 84px rgba(1, 8, 24, 0.66),
    inset 0 1px 0 rgba(160, 201, 255, 0.2),
    inset 0 -1px 0 rgba(105, 153, 216, 0.14);
  padding: 28px 24px 24px;
  isolation: isolate;
}

.login-card::before {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(96, 163, 230, 0), rgba(96, 163, 230, 0.72), rgba(96, 163, 230, 0));
}

.login-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(520px 220px at 50% -34px, rgba(73, 145, 224, 0.2), rgba(73, 145, 224, 0));
}

.login-card h2 {
  margin: 0;
  font-size: 33px;
  letter-spacing: 1.1px;
  color: #dfedff;
  text-shadow: 0 0 16px rgba(73, 145, 224, 0.28);
  text-align: center;
  line-height: 1.2;
}

.login-card p {
  margin: 16px 0 0;
  color: rgba(176, 205, 238, 0.9);
  font-size: 14px;
  line-height: 1.8;
  text-align: center;
}

.login-form {
  margin-top: 22px;
  display: grid;
  gap: 18px;
  padding-bottom: 54px;
  position: relative;
}

#loginPasswordFields {
  display: grid;
  gap: 22px;
}

#loginMobileFields {
  display: grid;
  gap: 22px;
}

.login-form .field > span {
  margin-bottom: 9px;
  color: rgba(186, 213, 245, 0.94);
  font-weight: 600;
  letter-spacing: 0.3px;
}

.login-form .field input {
  min-height: 44px;
  background: rgba(4, 15, 38, 0.84);
  border-color: rgba(91, 141, 204, 0.6);
  color: #d8e8fb;
  box-shadow: inset 0 1px 0 rgba(161, 200, 247, 0.14);
}

.login-form .field input::placeholder {
  color: rgba(142, 173, 210, 0.8);
}

.login-skip-captcha-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -2px;
  color: rgba(183, 211, 245, 0.92);
  font-size: 12px;
  line-height: 1.4;
  user-select: none;
}

.login-skip-captcha-toggle input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: #5f9be8;
  cursor: pointer;
}

.login-skip-captcha-toggle span {
  cursor: pointer;
}

.login-form .field input:focus {
  border-color: rgba(106, 166, 235, 0.96);
  box-shadow:
    0 0 0 3px rgba(64, 130, 204, 0.24),
    inset 0 1px 0 rgba(161, 200, 247, 0.28);
  background: rgba(6, 20, 50, 0.9);
}

.hidden {
  display: none !important;
}

.login-mode-tabs {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(93, 149, 214, 0.44);
  background: rgba(4, 16, 41, 0.52);
}

.login-mode-tab {
  border: 1px solid transparent;
  background: transparent;
  color: rgba(173, 200, 234, 0.84);
  border-radius: 10px;
  min-height: 40px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--trans-fast);
}

.login-mode-tab.active {
  border-color: rgba(99, 156, 226, 0.72);
  background: rgba(25, 74, 156, 0.44);
  color: #eef6ff;
  box-shadow: 0 8px 20px rgba(21, 74, 160, 0.36);
}

#loginSubmitBtn {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(101, 162, 228, 0.82);
  background: #1551bd;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow:
    0 16px 34px rgba(12, 61, 145, 0.54),
    inset 0 1px 0 rgba(173, 212, 255, 0.34);
}

#loginSubmitBtn:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #1246a5;
  box-shadow:
    0 20px 38px rgba(9, 47, 115, 0.62),
    inset 0 1px 0 rgba(173, 212, 255, 0.42);
}

#loginSubmitBtn:active:not(:disabled) {
  transform: translateY(0);
}

.login-code-row,
.login-captcha-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.login-code-btn {
  min-width: 116px;
  white-space: nowrap;
  min-height: 42px;
  border: 1px solid rgba(88, 142, 206, 0.72);
  background: rgba(5, 18, 46, 0.82);
  color: #b0d2f9;
  box-shadow: inset 0 1px 0 rgba(160, 200, 247, 0.2);
}

.login-code-btn:hover:not(:disabled) {
  background: rgba(7, 24, 60, 0.9);
  border-color: rgba(106, 166, 235, 0.86);
  color: #deeeff;
}

.login-captcha-image-btn {
  padding: 0;
  margin: 0;
  border: 1px solid rgba(94, 151, 219, 0.72);
  border-radius: 10px;
  background: rgba(4, 16, 41, 0.74);
  height: 44px;
  width: 132px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(161, 200, 247, 0.2);
}

.login-captcha-image-btn img {
  display: block;
  width: 120px;
  height: 34px;
  object-fit: fill;
  filter: none;
  image-rendering: auto;
}

#loginMessage {
  min-height: 20px;
  margin-top: 4px;
  color: #ffc7c7;
  font-size: 12px;
  letter-spacing: 0.2px;
  text-align: center;
}

.login-brand-chip {
  margin: 0;
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  width: fit-content;
  max-width: 100%;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(103, 160, 228, 0.5);
  background: rgba(4, 16, 41, 0.58);
  color: rgba(173, 205, 241, 0.92);
  font-size: 11px;
  letter-spacing: 0.4px;
  line-height: 1.2;
  text-align: center;
  text-transform: none;
  box-shadow:
    0 8px 18px rgba(3, 15, 38, 0.38),
    inset 0 1px 0 rgba(168, 208, 255, 0.2);
  animation: loginChipGlow 2.8s ease-in-out infinite;
}

@keyframes loginChipGlow {
  0%,
  100% {
    box-shadow:
      0 8px 18px rgba(3, 15, 38, 0.3),
      inset 0 1px 0 rgba(168, 208, 255, 0.15);
    border-color: rgba(103, 160, 228, 0.44);
    color: rgba(173, 205, 241, 0.84);
  }
  50% {
    box-shadow:
      0 10px 24px rgba(17, 62, 140, 0.46),
      0 0 16px rgba(80, 147, 233, 0.34),
      inset 0 1px 0 rgba(168, 208, 255, 0.3);
    border-color: rgba(129, 186, 249, 0.72);
    color: rgba(214, 235, 255, 0.95);
  }
}

@media (max-width: 560px) {
  .login-form {
    padding-bottom: 50px;
  }

  .login-card {
    width: min(468px, calc(100vw - 18px));
    padding: 22px 16px 18px;
    border-radius: 18px;
  }

  .login-card h2 {
    font-size: 27px;
  }

  .login-mode-tab {
    min-height: 38px;
    font-size: 13px;
  }

  .login-code-row,
  .login-captcha-row {
    grid-template-columns: 1fr;
  }

  .login-code-btn,
  .login-captcha-image-btn {
    width: 100%;
  }
}

.primary-btn,
.ghost-btn {
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: transform var(--trans-fast), box-shadow var(--trans-fast), background var(--trans-fast), color var(--trans-fast), border-color var(--trans-fast);
  will-change: transform;
}

.primary-btn {
  background: linear-gradient(135deg, #1f63d8, #0f4fbf);
  color: #fff;
  box-shadow: 0 8px 20px rgba(17, 86, 217, 0.3);
}

.primary-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.ghost-btn {
  background: #edf3ff;
  color: var(--brand-strong);
  border: 1px solid #d5e3fc;
}

.primary-btn:hover:not(:disabled),
.ghost-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.primary-btn:hover:not(:disabled) {
  box-shadow: 0 12px 24px rgba(17, 86, 217, 0.34);
}

.ghost-btn:hover:not(:disabled) {
  box-shadow: 0 8px 18px rgba(17, 86, 217, 0.16);
  background: #e3edff;
}

.primary-btn:active:not(:disabled),
.ghost-btn:active:not(:disabled) {
  transform: translateY(0);
}

#topCreateDocBtn {
  background: linear-gradient(135deg, #1f63d8, #1149a9);
  box-shadow: 0 10px 22px rgba(17, 86, 217, 0.35);
}

.page {
  display: none;
}

.page.active {
  display: block;
  animation: fade 0.25s ease;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

#financeKpiGrid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-card);
  transition: transform var(--trans-base), box-shadow var(--trans-base), border-color var(--trans-fast);
}

.kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: #cbdcf7;
}

.kpi h4 {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.kpi strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.kpi span {
  font-size: 12px;
}

.up {
  color: var(--ok);
}

.down {
  color: var(--bad);
}

.panel-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.two-col {
  grid-template-columns: 1fr 1fr;
}

.monitor-grid {
  align-items: start;
}

.monitor-subsection {
  display: none;
}

.monitor-subsection.active {
  display: block;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-card);
  transition: border-color var(--trans-fast), box-shadow var(--trans-base), transform var(--trans-base);
}

.panel:hover {
  border-color: #cfddf3;
  box-shadow: 0 10px 28px rgba(17, 43, 88, 0.1);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
}

.panel-head h3 {
  margin: 0;
  font-size: 15px;
  position: relative;
  padding-left: 10px;
  line-height: 1.2;
}

.panel-head h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  width: 3px;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, #5a90ef, #1f63d8);
}

.bigscreen-panel .panel-head h3::before {
  background: rgba(255, 255, 255, 0.88);
}

.profile-panel {
  max-width: 760px;
}

.bigscreen-panel {
  background: linear-gradient(160deg, #0b2b73 0%, #0f3f9a 42%, #1558c0 100%);
  color: #eef5ff;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.bigscreen-panel .panel-head h3 {
  color: #ffffff;
}

.bigscreen-panel .table-note-inline {
  color: rgba(236, 245, 255, 0.85);
}

.bigscreen-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.bigscreen-kpi-item {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.09);
  padding: 12px;
  display: grid;
  gap: 8px;
  transition: transform var(--trans-fast), box-shadow var(--trans-fast), border-color var(--trans-fast);
}

.bigscreen-kpi-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(8, 26, 67, 0.26);
  border-color: rgba(255, 255, 255, 0.34);
}

.bigscreen-kpi-item span {
  font-size: 12px;
  color: rgba(236, 245, 255, 0.86);
}

.bigscreen-kpi-item strong {
  font-size: 24px;
  line-height: 1.1;
  color: #ffffff;
  white-space: nowrap;
}

.bigscreen-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 12px;
}

.bigscreen-grid .panel {
  background: rgba(6, 24, 64, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #eef5ff;
}

.bigscreen-grid .panel h3 {
  color: #ffffff;
}

.bigscreen-map-panel {
  min-height: 380px;
}

.bigscreen-map-canvas {
  width: 100%;
  min-height: 320px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: radial-gradient(circle at 30% 20%, #1b4fb2, #0c2d79 68%);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.bigscreen-map-svg {
  width: 100%;
  height: 100%;
}

.bigscreen-map-bg {
  fill: transparent;
}

.bigscreen-map-guide {
  fill: rgba(168, 211, 255, 0.13);
  stroke: rgba(168, 211, 255, 0.28);
  stroke-width: 1.4;
}

.bigscreen-map-dot {
  fill: rgba(255, 209, 102, 0.95);
  stroke: rgba(255, 255, 255, 0.95);
  stroke-width: 1.2;
}

.bigscreen-map-empty {
  color: rgba(236, 245, 255, 0.9);
  font-size: 13px;
}

#bigscreenCityTable table th,
#bigscreenCityTable table td {
  color: #eef5ff;
  border-color: rgba(255, 255, 255, 0.18);
}

#bigscreenCityTable table th {
  background: rgba(255, 255, 255, 0.08);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.profile-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.profile-item span {
  font-size: 12px;
  color: var(--muted);
}

.profile-item strong {
  font-size: 16px;
  color: #1a355f;
}

.bars {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 88px 1fr 56px;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.bar-track {
  width: 100%;
  height: 10px;
  background: #edf2fa;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4d8ef7, #1f63d8);
}

.forecast {
  display: grid;
  gap: 8px;
  font-size: 13px;
}

.forecast .line {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 6px;
}

.forecast .line:last-child {
  border-bottom: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  background: #f7faff;
}

.panel > div[id$="Table"] {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.table-column-setting-btn {
  min-width: 78px;
}

table.data-table th.table-settings-th {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  text-align: center;
  padding: 6px 4px;
}

.table-settings-icon-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #c8d8ef;
  border-radius: 8px;
  background: #f8fbff;
  color: #2d507f;
  cursor: pointer;
  transition: border-color var(--trans-fast), box-shadow var(--trans-fast), background var(--trans-fast), color var(--trans-fast),
    transform var(--trans-fast);
}

.table-settings-icon-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.table-settings-icon-btn:hover {
  border-color: #95b2e5;
  background: #edf4ff;
  color: #1a4ea8;
  box-shadow: 0 6px 14px rgba(17, 86, 217, 0.16);
  transform: translateY(-1px);
}

.table-settings-icon-btn:focus-visible {
  outline: none;
  border-color: #8eb1ef;
  box-shadow: var(--focus-ring);
}

td.table-settings-cell {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  padding: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

table.data-table th.col-fixed-left,
table.data-table td.col-fixed-left,
table.data-table th.col-fixed-right,
table.data-table td.col-fixed-right {
  position: sticky;
  z-index: 3;
}

table.data-table th.col-fixed-left,
table.data-table th.col-fixed-right {
  z-index: 6;
  top: 0;
}

table.data-table th.col-fixed-left,
table.data-table td.col-fixed-left {
  box-shadow: 1px 0 0 #e7edf9;
}

table.data-table th.col-fixed-right,
table.data-table td.col-fixed-right {
  box-shadow: -1px 0 0 #e7edf9;
}

table.data-table th.draggable-th {
  position: relative;
  white-space: nowrap;
  user-select: none;
  cursor: grab;
  transition: background-color var(--trans-fast), box-shadow var(--trans-fast), opacity var(--trans-fast);
}

table.data-table th.draggable-th.col-fixed-left,
table.data-table th.draggable-th.col-fixed-right {
  position: sticky;
}

table.data-table th.draggable-th.th-fixed {
  cursor: default;
}

table.data-table th.draggable-th.th-fixed::after {
  content: "";
  margin-left: 0;
}

table.data-table th.draggable-th .th-label {
  display: inline-block;
  max-width: calc(100% - 18px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

table.data-table th.draggable-th .th-resize-handle {
  position: absolute;
  top: 0;
  right: -7px;
  width: 14px;
  height: 100%;
  cursor: col-resize;
  z-index: 12;
  touch-action: none;
}

table.data-table th.draggable-th .th-resize-handle::after {
  content: "";
  position: absolute;
  top: 16%;
  left: 50%;
  width: 2px;
  height: 68%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #8ea8d8;
  opacity: 0;
  transition: opacity var(--trans-fast), background-color var(--trans-fast);
}

table.data-table th.draggable-th:hover .th-resize-handle::after {
  opacity: 1;
}

table.data-table th.draggable-th .th-resize-handle:hover::after {
  opacity: 1;
  background: #3e6cc1;
}

table.data-table th.draggable-th::after {
  content: "⋮⋮";
  margin-left: 6px;
  font-size: 11px;
  color: #91a3c8;
  letter-spacing: -1px;
  vertical-align: middle;
}

table.data-table th.draggable-th:active {
  cursor: grabbing;
}

table.data-table th.draggable-th.th-fixed:active {
  cursor: default;
}

table.data-table th.draggable-th.dragging {
  opacity: 0.55;
  background: #e9f2ff;
}

table.data-table th.draggable-th.drag-over {
  background: #edf4ff;
  box-shadow: inset 0 -2px 0 #4f7fda;
}

body.col-resizing,
body.col-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

#staffTable table.data-table th,
#staffTable table.data-table td {
  white-space: nowrap;
}

#customerTable table.data-table th,
#customerTable table.data-table td {
  white-space: nowrap;
}

th,
td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 10px 8px;
  transition: background-color var(--trans-fast);
}

tbody tr:hover td {
  background: #f6f9ff;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
}

.pill.ok {
  background: #e4f7ed;
  color: #1d8a56;
}

.pill.warn {
  background: #fff0da;
  color: #9c5d00;
}

.pill.bad {
  background: #ffe4e4;
  color: #b02323;
}

.status-edit-btn {
  border: 0;
  cursor: pointer;
  transition: filter var(--trans-fast), transform var(--trans-fast);
  border-radius: 999px;
}

.status-edit-btn:hover {
  filter: brightness(0.97);
  transform: translateY(-1px);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    width: var(--sidebar-width);
    z-index: 90;
    box-shadow: 0 14px 38px rgba(8, 26, 67, 0.45);
    transform: translateX(calc(-1 * var(--sidebar-width) - 10px));
    transition: transform 0.22s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .topbar {
    align-items: flex-start;
    padding: 10px;
  }

  .topbar-title h2 {
    font-size: 20px;
  }

  .topbar-meta {
    width: 100%;
    justify-content: flex-start;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #financeKpiGrid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .entry-form,
  .huifu-config-grid,
  .huifu-call-form,
  .lakala-config-grid,
  .lakala-call-form,
  .huilaimi-config-grid,
  .huilaimi-call-form {
    grid-template-columns: 1fr;
  }

  .panel table {
    min-width: 640px;
  }
}

.order-row {
  cursor: pointer;
}

.order-row td {
  transition: background-color 0.15s ease;
}

.order-row:hover td {
  background: #f5f9ff;
}

.order-row.active td {
  background: #e9f2ff;
}

.link-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 9px;
  background: #eef4ff;
  color: #1d57c5;
  font-size: 12px;
  font-weight: 600;
}

.table-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.column-setting-modal {
  display: grid;
  gap: 10px;
}

.column-setting-head,
.column-setting-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 112px 132px 136px;
  gap: 10px;
  align-items: center;
}

.column-setting-head {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  padding: 0 4px;
}

.column-setting-list {
  max-height: 48vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: #fbfdff;
}

.column-setting-row {
  padding: 8px;
  border: 1px solid #e9eef8;
  border-radius: 8px;
  background: #fff;
}

.column-setting-row.is-fixed {
  background: #f6f9ff;
}

.column-setting-name {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  font-size: 13px;
}

.column-setting-name span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.column-setting-width,
.column-setting-fixed {
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 6px 10px;
  background: #fff;
  color: var(--text);
}

.column-setting-move {
  display: flex;
  gap: 6px;
}

.colset-move-btn {
  min-width: 56px;
}

.colset-move-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Bigscreen style rollback (scoped) */
#page-bigscreen .panel {
  padding: 14px;
  border-radius: var(--radius);
}

#page-bigscreen .panel-head {
  margin-bottom: 10px;
  min-height: 0;
  align-items: center;
}

#page-bigscreen .panel-head h3 {
  font-size: 15px;
}

#page-bigscreen .panel-head h3::before {
  top: 1px;
  height: 16px;
}

#page-bigscreen table.data-table {
  border-collapse: collapse;
  border-spacing: 0;
}

#page-bigscreen table.data-table thead th {
  position: static;
  top: auto;
}

#bigscreenCityTable table.data-table tbody tr:nth-child(even) td {
  background: transparent;
}

#bigscreenCityTable table.data-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.06);
}

.json-inline {
  margin: 0;
  max-width: 420px;
  max-height: 140px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 11px;
  color: #334866;
}

.table-pagination {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.page-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 8px;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  font-size: 12px;
  cursor: pointer;
}

.page-btn.active {
  border-color: #c4d7fb;
  background: #eaf1ff;
  color: #0f4fbf;
  font-weight: 700;
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-meta {
  color: var(--muted);
  font-size: 12px;
}

.page-jump-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-jump-input {
  width: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  height: 30px;
  font-size: 12px;
}

.text-btn {
  border: 1px solid transparent;
  background: rgba(17, 86, 217, 0.08);
  color: #1d57c5;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: color var(--trans-fast), text-shadow var(--trans-fast), transform var(--trans-fast);
}

.text-btn:hover {
  color: #0f4fbf;
  text-shadow: 0 0 10px rgba(17, 86, 217, 0.18);
  transform: translateY(-1px);
  border-color: #c9daf9;
  background: rgba(17, 86, 217, 0.14);
}

.text-btn-disabled,
.text-btn-disabled:hover {
  color: #7f8ca3;
  background: #f3f5f9;
  border-color: #d8deea;
  cursor: not-allowed;
  text-shadow: none;
  transform: none;
}

.row-delete-btn,
.access-role-delete-btn {
  color: var(--danger);
  background: rgba(194, 54, 54, 0.09);
}

.row-delete-btn:hover,
.access-role-delete-btn:hover {
  color: #9f1f1f;
  border-color: rgba(194, 54, 54, 0.28);
  background: rgba(194, 54, 54, 0.16);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.field {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.field > span {
  font-weight: 600;
  color: #39537a;
}

.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  transition: border-color var(--trans-fast), box-shadow var(--trans-fast), background var(--trans-fast);
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  transition: border-color var(--trans-fast), box-shadow var(--trans-fast), background var(--trans-fast);
}

.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  resize: vertical;
  font-family: inherit;
  transition: border-color var(--trans-fast), box-shadow var(--trans-fast), background var(--trans-fast);
}

.inline-select,
.inline-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  transition: border-color var(--trans-fast), box-shadow var(--trans-fast), background var(--trans-fast);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.inline-select:focus,
.inline-input:focus,
.menu-btn:focus-visible,
.primary-btn:focus-visible,
.ghost-btn:focus-visible,
.text-btn:focus-visible,
.nav-item:focus-visible,
.finance-subnav-btn:focus-visible,
.status-edit-btn:focus-visible,
.page-btn:focus-visible {
  outline: none;
  border-color: #8eb1ef;
  box-shadow: var(--focus-ring);
  background: #fff;
}

.table-note-inline {
  margin-left: 6px;
  color: var(--muted);
  font-size: 11px;
}

.commission-confirm-btn.is-ready {
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(17, 86, 217, 0.18) inset;
}

.filter-actions {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}

.stock-toggle-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  min-height: 36px;
  cursor: pointer;
  user-select: none;
}

.stock-toggle-inline input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.stock-toggle-switch {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #d4dfef;
  border: 1px solid #c1cfe5;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(19, 48, 95, 0.12);
  transition: background var(--trans-fast), border-color var(--trans-fast), box-shadow var(--trans-fast);
}

.stock-toggle-switch::after {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  position: absolute;
  top: 2px;
  left: 2px;
  box-shadow: 0 1px 3px rgba(18, 44, 86, 0.2);
  transition: transform var(--trans-fast);
}

.stock-toggle-text {
  color: #39537a;
  font-weight: 600;
}

.stock-toggle-inline input:checked + .stock-toggle-switch {
  background: linear-gradient(135deg, #3a78f0, #1d56c6);
  border-color: #1d56c6;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 4px 12px rgba(29, 86, 198, 0.25);
}

.stock-toggle-inline input:checked + .stock-toggle-switch::after {
  transform: translateX(16px);
}

.stock-toggle-inline input:focus-visible + .stock-toggle-switch {
  outline: none;
  box-shadow: var(--focus-ring);
}

.mini-tag {
  display: inline-block;
  padding: 2px 8px;
  margin-right: 6px;
  margin-bottom: 4px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.4;
  color: #1769aa;
  background: rgba(23, 105, 170, 0.12);
}

.order-approval-meta {
  margin-top: 4px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

.order-status-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  min-width: 190px;
  gap: 6px;
  white-space: normal;
}

.order-status-stack .status-edit-btn {
  min-height: 32px;
  height: 32px;
  min-width: 190px;
  padding: 4px 12px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  justify-content: flex-start;
  display: inline-flex;
  align-items: center;
}

.order-approval-tag {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  border-radius: 999px;
  min-height: 32px;
  height: 32px;
  min-width: 190px;
  padding: 2px 9px;
  font-size: 13px;
  line-height: 1.35;
  border: 1px solid transparent;
  white-space: nowrap;
  box-sizing: border-box;
}

.order-status-stack--three .order-approval-meta {
  display: contents;
}

.order-approval-tag--off {
  color: #5f6b7c;
  background: #f0f3f7;
  border-color: #d4dbe6;
}

.order-approval-tag--pending {
  color: #8a5d00;
  background: #fff4dd;
  border-color: #ffd78a;
}

.order-approval-tag--processing {
  color: #0f4ea3;
  background: #eaf2ff;
  border-color: #b7d0ff;
}

.order-approval-tag--passed {
  color: #1f6b2f;
  background: #e9f8ec;
  border-color: #b9e5c1;
}

.order-approval-tag--rejected {
  color: #a11919;
  background: #ffeaea;
  border-color: #ffc8c8;
}

.order-approval-tag--action-ok {
  color: #1f6b2f;
  background: #eef8f0;
  border-color: #c6e7cd;
}

.order-approval-tag--action-blocked {
  color: #8c5a00;
  background: #fff5e4;
  border-color: #ffd79a;
}

.finance-filter-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.action-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stock-log-filter-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.stock-log-filter-actions {
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
}

#page-stock .stock-query-panel {
  padding: 16px;
  border-radius: 14px;
  border-color: #d4e2f6;
  box-shadow: 0 12px 30px rgba(17, 43, 88, 0.08);
}

#page-stock .stock-filter-grid {
  grid-template-columns: minmax(220px, 1.1fr) minmax(260px, 1.5fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 10px;
}

#page-stock .stock-filter-grid .field {
  gap: 8px;
}

#page-stock .stock-filter-grid .field > span {
  color: #304e7e;
  font-size: 12px;
}

#page-stock .stock-filter-grid .field select {
  height: 40px;
  border-color: #cddcf2;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

#page-stock .stock-filter-grid .field select:focus {
  border-color: #8eb1ef;
  background: #fff;
}

#page-stock .filter-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

#page-stock #stockExportBtn,
#page-stock #stockFilterResetBtn {
  height: 40px;
  min-width: 108px;
  white-space: nowrap;
}

#page-stock .stock-toggle-inline {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid #cddcf2;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
}

#page-stock #stockSummary {
  margin-top: 4px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px dashed #d3e0f4;
  border-radius: 10px;
  background: #f8fbff;
}

#page-stock #stockTable {
  border: 1px solid #d8e4f6;
  border-radius: 12px;
  padding: 8px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.stock-log-direction-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stock-log-dir-btn.active {
  border-color: #c4d7fb;
  background: #eaf1ff;
  color: #0f4fbf;
  font-weight: 700;
}

.sn-head-actions {
  margin-left: auto;
  justify-content: flex-end;
  gap: 4px;
}

.finance-subnav-panel {
  padding-top: 10px;
  padding-bottom: 10px;
}

.finance-subnav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.finance-subnav-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--trans-fast);
}

.finance-subnav-btn:hover {
  border-color: #c5d7f7;
  color: #1a4cae;
  transform: translateY(-1px);
}

.finance-subnav-btn.active {
  border-color: #c4d7fb;
  background: #eaf1ff;
  color: #0f4fbf;
  box-shadow: 0 6px 16px rgba(17, 86, 217, 0.15);
}

.finance-subsection {
  display: none;
}

.finance-subsection.active {
  display: block;
}

.customer-subsection {
  display: none;
}

.customer-subsection.active {
  display: block;
}

.staff-subsection {
  display: none;
}

.staff-subsection.active {
  display: block;
}

.inventory-subsection,
.pay-platform-subsection {
  display: none;
}

.inventory-subsection.active,
.pay-platform-subsection.active {
  display: block;
}

.pay-key-grid {
  margin-top: 12px;
}

.pay-key-card {
  margin: 0;
}

.pay-key-form {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.pay-key-field-wide {
  grid-column: 1 / -1;
}

.pay-key-alias-actions {
  grid-column: 1 / -1;
  justify-content: flex-start;
  gap: 8px;
  margin-top: -2px;
}

.huifu-subsection {
  display: none;
}

.huifu-subsection.active {
  display: block;
}

.huilaimi-subnav {
  flex: 1;
}

.huilaimi-subsection {
  display: none;
}

.huilaimi-subsection.active {
  display: block;
}

.huilaimi-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.huilaimi-field-wide {
  grid-column: 1 / -1;
}

.huilaimi-call-form {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.huilaimi-code {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.huilaimi-inner-panel {
  margin-top: 12px;
  padding: 12px;
}

.lakala-subsection {
  display: none;
}

.lakala-subsection.active {
  display: block;
}

.lakala-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.lakala-field-wide {
  grid-column: 1 / -1;
}

.lakala-call-form {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.lakala-code {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.lakala-inner-panel {
  margin-top: 12px;
  padding: 12px;
}

.alipay-subsection {
  display: none;
}

.alipay-subsection.active {
  display: block;
}

.alipay-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.alipay-field-wide {
  grid-column: 1 / -1;
}

.alipay-call-form {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.alipay-report-filter-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.alipay-date-range {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}

.alipay-date-sep {
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
}

.accounting-multi-date-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.accounting-date-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.accounting-date-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #c9daf9;
  background: #edf3ff;
  color: #0f4fbf;
  font-size: 12px;
}

.accounting-date-chip .remove-date-btn {
  border: none;
  background: transparent;
  color: #0f4fbf;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  font-size: 14px;
}

.accounting-date-chip .remove-date-btn:hover {
  color: #073a92;
}

#alipayCacheSyncTable table {
  width: 100%;
}

#alipayCacheSyncTable .status-ok {
  color: #14853b;
  font-weight: 600;
}

#alipayCacheSyncTable .status-running {
  color: #a16400;
  font-weight: 600;
}

#alipayCacheSyncTable .status-retrying {
  color: #005ec4;
  font-weight: 600;
}

#alipayCacheSyncTable .status-failed {
  color: #bb2323;
  font-weight: 600;
}

.alipay-code {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.alipay-inner-panel {
  margin-top: 12px;
  padding: 12px;
}

.huilaimi-quick-card {
  grid-column: span 1;
  margin-top: 0;
}

.huilaimi-step-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.huilaimi-step-card {
  position: relative;
  border-color: #d7e2f1;
  box-shadow: 0 8px 20px rgba(17, 43, 88, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.huilaimi-step-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(17, 43, 88, 0.1);
}

.huilaimi-step-head {
  align-items: center;
}

.huilaimi-step-tag {
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #0f4fbf;
  background: #eaf1ff;
  border: 1px solid #c9daf9;
}

.huilaimi-step-desc {
  margin: 0 0 10px;
  min-height: 34px;
  line-height: 1.4;
}

.huilaimi-channel-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.huilaimi-channel-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.huilaimi-template-box {
  border: 1px dashed #c7d6ee;
  background: #f8fbff;
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 10px;
}

.huilaimi-template-head h4 {
  margin: 0;
  font-size: 13px;
  color: #274777;
}

.huilaimi-template-topbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.huilaimi-template-topbar input,
.huilaimi-template-topbar select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.huilaimi-template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.huilaimi-template-grid input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.huilaimi-template-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.huifu-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.huifu-field-wide {
  grid-column: 1 / -1;
}

.huifu-call-form {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.huifu-code {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.huifu-inner-panel {
  margin-top: 12px;
  padding: 12px;
}

.quick-search {
  display: flex;
  gap: 8px;
  align-items: center;
}

.quick-search input {
  width: 220px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
}

.generated-wrap {
  margin-top: 16px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  position: relative;
}

.generated-wrap::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 84px;
  height: 1px;
  background: linear-gradient(90deg, #9ec0fb, rgba(158, 192, 251, 0));
}

.sub-head {
  margin-bottom: 6px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  z-index: 50;
  backdrop-filter: blur(2px);
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  width: min(460px, calc(100vw - 24px));
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 16px;
  max-height: calc(100vh - 24px);
  overflow: auto;
  box-shadow: 0 20px 54px rgba(15, 33, 74, 0.3);
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-card-wide {
  width: min(760px, calc(100vw - 24px));
}

.modal-card-wide.column-setting-modal-card {
  width: min(900px, calc(100vw - 24px));
}

.modal-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.modal-card p {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--muted);
}

.modal-actions {
  display: flex;
  justify-content: end;
  gap: 8px;
}

.entry-panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.entry-form {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.entry-form h4 {
  margin: 0;
  font-size: 14px;
}

.entry-form-head {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.entry-field-wide {
  grid-column: 1 / -1;
}

.batch-file-drop-zone {
  border: 1px dashed #8eb1ef;
  border-radius: 10px;
  padding: 10px;
  background: #f7fbff;
  cursor: pointer;
}

.batch-file-drop-zone.dragover {
  border-color: #3f74d8;
  background: #eef4ff;
  box-shadow: 0 0 0 2px rgba(63, 116, 216, 0.15);
}

.batch-file-drop-zone input[type="file"] {
  cursor: pointer;
}

.customer-entry-form {
  align-items: start;
  row-gap: 12px;
  column-gap: 12px;
}

.customer-entry-form h4 {
  grid-column: 1 / -1;
  margin-bottom: 2px;
}

.customer-entry-form .field {
  min-width: 0;
}

.customer-entry-form .entry-actions {
  margin-top: 2px;
}

.permission-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
  padding: 10px 12px;
  min-width: 0;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.permission-group h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #214172;
}

.permission-toolbar {
  display: flex;
  gap: 8px;
  margin: 4px 0 8px;
  flex-wrap: wrap;
  align-items: center;
}

.permission-search {
  display: block;
  flex: 1;
  min-width: 220px;
}

.permission-search input {
  width: 100%;
  border: 1px solid #d3e1f8;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
}

.permission-search input:focus {
  outline: 0;
  border-color: #8fb1ed;
  box-shadow: 0 0 0 3px rgba(17, 86, 217, 0.12);
}

.permission-inline-note {
  margin: 0 0 8px;
}

.permission-empty-note {
  margin: 0 0 10px;
}

.permission-group-actions {
  display: flex;
  gap: 8px;
  margin: 0 0 8px;
}

.permission-group-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.permission-tree-wrap {
  display: grid;
  gap: 10px;
}

.permission-tree-node {
  display: grid;
  gap: 8px;
}

.permission-tree-node.is-filtered-out {
  display: none;
}

.permission-tree-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.permission-tree-toggle {
  width: 28px;
  height: 28px;
  border: 1px solid #c8daf8;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  padding: 0;
}

.permission-tree-toggle::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-right: 2px solid #2f4f87;
  border-bottom: 2px solid #2f4f87;
  transform: rotate(-45deg);
  transition: transform var(--trans-fast);
}

.permission-tree-toggle.is-expanded::before {
  transform: rotate(45deg);
  top: 7px;
}

.permission-tree-toggle-spacer {
  display: block;
  width: 28px;
  height: 28px;
}

.permission-tree-title.is-branch {
  cursor: pointer;
}

.permission-tree-level-0 > .permission-tree-check-item {
  background: #eef4ff;
  border-color: #c8daf8;
}

.permission-tree-node.is-search-hit > .permission-tree-row .permission-tree-check-item {
  border-color: #86a9ea;
  box-shadow: inset 0 0 0 1px rgba(17, 86, 217, 0.2);
}

.menu-tree-item {
  width: 100%;
  padding: 8px;
}

.menu-tree-edit-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) 90px auto auto;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.menu-tree-key {
  font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}

.menu-tree-label-input,
.menu-tree-sort-input {
  border: 1px solid #d3e1f8;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
}

.menu-tree-sort-input {
  width: 100%;
}

.permission-tree-level-1 > .permission-tree-check-item {
  background: #f5f9ff;
}

.permission-tree-level-2 > .permission-tree-check-item {
  background: #fff;
}

.permission-tree-children {
  display: grid;
  gap: 8px;
  margin-left: 16px;
  padding-left: 10px;
  border-left: 2px dashed #d7e4fb;
}

.permission-tree-children[hidden] {
  display: none !important;
}

#menuManageTreeWrap {
  padding: 8px 10px;
  max-height: 460px;
  overflow: auto;
}

#menuManageTreeWrap .permission-tree-wrap {
  gap: 6px;
}

#menuManageTreeWrap .permission-tree-node {
  gap: 4px;
}

#menuManageTreeWrap .permission-tree-row {
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 6px;
}

#menuManageTreeWrap .permission-tree-toggle {
  width: 22px;
  height: 22px;
  border-radius: 5px;
}

#menuManageTreeWrap .permission-tree-toggle::before {
  left: 7px;
  top: 5px;
}

#menuManageTreeWrap .permission-tree-toggle.is-expanded::before {
  top: 4px;
}

#menuManageTreeWrap .permission-tree-toggle-spacer {
  width: 22px;
  height: 22px;
}

#menuManageTreeWrap .menu-tree-item {
  padding: 5px 6px;
  min-height: 32px;
}

#menuManageTreeWrap .menu-tree-edit-grid {
  grid-template-columns: minmax(140px, 220px) minmax(180px, 1fr) 70px auto auto;
  gap: 6px;
}

#menuManageTreeWrap .menu-tree-key {
  font-size: 11px;
  white-space: nowrap;
  word-break: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

#menuManageTreeWrap .menu-tree-label-input,
#menuManageTreeWrap .menu-tree-sort-input {
  height: 30px;
  padding: 4px 6px;
  font-size: 12px;
}

#menuManageTreeWrap .menu-tree-add-btn,
#menuManageTreeWrap .menu-tree-delete-btn {
  white-space: nowrap;
  padding: 5px 10px;
}

#menuManageTreeWrap .permission-tree-children {
  gap: 6px;
  margin-left: 12px;
  padding-left: 8px;
}

.permission-check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 10px;
  min-width: 0;
}

.permission-check-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  color: var(--ink);
  font-size: 13px;
  border: 1px solid #dbe6f6;
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff;
  min-height: 36px;
  min-width: 0;
  width: 100%;
  transition: border-color var(--trans-fast), box-shadow var(--trans-fast), transform var(--trans-fast);
}

.permission-check-item:hover {
  border-color: #c4d7fb;
  box-shadow: 0 8px 16px rgba(17, 86, 217, 0.1);
  transform: translateY(-1px);
}

.permission-check-item:has(input:checked) {
  border-color: #8fb1ed;
  background: #f3f7ff;
  box-shadow: inset 0 0 0 1px rgba(17, 86, 217, 0.1);
}

.permission-check-item input {
  margin: 0;
}

.permission-check-item input[type="checkbox"]:indeterminate {
  accent-color: #1d5fd2;
}

.permission-check-item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

#accessRoleNavPermissionChecks.permission-group-grid {
  grid-template-columns: 1fr;
}

.entry-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.policy-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

#actionModalBody table {
  margin-top: 8px;
}

#actionModalBody .table-note {
  margin-top: 0;
}

.customer-settlement-modal .table-note {
  margin-bottom: 8px;
}

#actionModalBody .entry-form {
  max-height: 68vh;
  overflow: auto;
}

#actionModalBackdrop .modal-card.modal-card-wide.terminal-modal-card {
  width: min(860px, calc(100vw - 24px));
}

#actionModalBody .quick-modal-form {
  border: 1px solid #d6e2f7;
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(180deg, #fcfdff 0%, #f6f9ff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 14px;
  row-gap: 12px;
  align-items: start;
}

#actionModalBody .quick-modal-form h4 {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 15px;
  color: #1f3f73;
  padding-bottom: 4px;
  border-bottom: 1px solid #e5edf9;
}

#actionModalBody .quick-modal-form .modal-form-tip {
  margin: -2px 0 0;
  color: #5b7298;
}

#actionModalBody .quick-modal-form .modal-form-section {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  font-size: 12px;
  color: #30538a;
  font-weight: 600;
  letter-spacing: 0.2px;
}

#actionModalBody .quick-modal-form .modal-form-section.modal-form-section-first {
  margin-top: -2px;
}

#actionModalBody .quick-modal-form .field {
  gap: 7px;
  min-width: 0;
}

#actionModalBody .quick-modal-form .field > span {
  color: #2f4f81;
  font-size: 12px;
}

#actionModalBody .quick-modal-form .field input,
#actionModalBody .quick-modal-form .field select,
#actionModalBody .quick-modal-form .field textarea {
  min-height: 40px;
  border-radius: 10px;
  padding: 9px 11px;
  border-color: #c8d8f1;
  background: #fff;
}

#actionModalBody .quick-modal-form .field textarea {
  min-height: 92px;
}

#actionModalBody .quick-modal-form .field input[readonly] {
  background: #f4f7fd;
  color: #4d6286;
}

#actionModalBody .quick-modal-form .entry-actions {
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px dashed #dce7fb;
}

#actionModalBody .quick-modal-form .entry-actions .primary-btn,
#actionModalBody .quick-modal-form .entry-actions .ghost-btn {
  min-width: 112px;
  height: 38px;
}

#actionModalBody .quick-modal-form + .table-note {
  margin-top: 8px;
}

#actionModalBody .terminal-entry-form {
  border: 1px solid #d6e2f7;
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(180deg, #fcfdff 0%, #f6f9ff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 14px;
  row-gap: 12px;
  align-items: start;
}

#actionModalBody .terminal-entry-form h4 {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 15px;
  color: #1f3f73;
  padding-bottom: 4px;
  border-bottom: 1px solid #e5edf9;
}

#actionModalBody .terminal-entry-form .field {
  gap: 7px;
  min-width: 0;
}

#actionModalBody .terminal-entry-form .field > span {
  color: #2f4f81;
  font-size: 12px;
}

#actionModalBody .terminal-entry-form .field input,
#actionModalBody .terminal-entry-form .field select,
#actionModalBody .terminal-entry-form .field textarea {
  min-height: 40px;
  border-radius: 10px;
  padding: 9px 11px;
  border-color: #c8d8f1;
  background: #fff;
}

#actionModalBody .terminal-entry-form .field textarea {
  min-height: 92px;
}

#actionModalBody .terminal-entry-form .field input[readonly] {
  background: #f4f7fd;
  color: #4d6286;
}

#actionModalBody .terminal-entry-form .batch-file-drop-zone {
  border-color: #87a9e4;
  background: #f3f8ff;
  padding: 12px;
}

#actionModalBody .terminal-entry-form .entry-actions {
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px dashed #dce7fb;
}

#actionModalBody .terminal-entry-form .entry-actions .primary-btn,
#actionModalBody .terminal-entry-form .entry-actions .ghost-btn {
  min-width: 112px;
  height: 38px;
}

#actionModalBody .terminal-entry-form + .table-note {
  margin-top: 8px;
}

.sn-trace-modal .table-wrap {
  overflow-x: auto;
}

.sn-trace-modal .table-wrap .data-table {
  min-width: 760px;
}

.sn-trace-filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 10px;
}

.sn-trace-filter-btn.active {
  border-color: #7fa5ea;
  background: #ecf3ff;
  color: #1f4f95;
}

.sn-trace-timeline {
  position: relative;
  margin: 10px 0 14px;
  padding-left: 18px;
}

.sn-trace-timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: linear-gradient(180deg, #9fc1f7 0%, #d3e3fb 100%);
}

.sn-trace-timeline-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0 0 12px;
}

.sn-trace-dot {
  width: 12px;
  height: 12px;
  margin-top: 3px;
  border-radius: 999px;
  border: 2px solid #4b7fe8;
  background: #fff;
  box-sizing: border-box;
  flex: 0 0 12px;
}

.sn-trace-content {
  min-width: 0;
  flex: 1;
  border: 1px solid #d9e5fa;
  border-radius: 10px;
  background: #f8fbff;
  padding: 8px 10px;
}

.sn-trace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.sn-trace-time {
  font-size: 12px;
  color: #3e5d8c;
}

.sn-trace-type {
  font-size: 12px;
  color: #234e93;
  background: #e7f0ff;
  border: 1px solid #c9dcff;
  border-radius: 999px;
  padding: 0 8px;
  line-height: 20px;
  white-space: nowrap;
}

.sn-trace-type.is-purchase {
  color: #1c4f96;
  background: #e7f0ff;
  border-color: #c9dcff;
}

.sn-trace-type.is-sales {
  color: #1f6a3b;
  background: #e7f8ed;
  border-color: #c5ebd3;
}

.sn-trace-type.is-log {
  color: #4e5d73;
  background: #eef2f7;
  border-color: #d5deea;
}

.sn-trace-main {
  color: #1d355a;
  font-size: 13px;
  line-height: 1.4;
}

.sn-trace-sub {
  margin-top: 2px;
  color: #5a6f93;
  font-size: 12px;
  line-height: 1.4;
  word-break: break-all;
}

@media (max-width: 768px) {
  .order-status-stack {
    min-width: 170px;
  }

  .order-status-stack .status-edit-btn {
    min-height: 30px;
    height: 30px;
    min-width: 170px;
    font-size: 13px;
  }

  .order-approval-tag {
    min-height: 30px;
    height: 30px;
    min-width: 170px;
    font-size: 12px;
  }

  .sn-trace-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 1200px) {
  .bigscreen-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bigscreen-grid {
    grid-template-columns: 1fr;
  }

  .entry-panel-grid {
    grid-template-columns: 1fr;
  }

  .permission-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .permission-check-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1200px) {
  .policy-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stock-log-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #page-stock .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #page-stock .filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .huilaimi-step-grid {
    grid-template-columns: 1fr;
  }

  .customer-entry-form {
    grid-template-columns: 1fr;
  }

  #actionModalBody .quick-modal-form {
    grid-template-columns: 1fr;
  }

  #actionModalBody .terminal-entry-form {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 640px) {
  .bigscreen-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bigscreen-kpi-item strong {
    font-size: 20px;
  }

  .main {
    padding: 14px;
  }

  .topbar-title h2 {
    font-size: 18px;
  }

  .topbar-title p {
    font-size: 12px;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  #financeKpiGrid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .filter-grid,
  .finance-filter-grid,
  .policy-form-grid {
    grid-template-columns: 1fr;
  }

  .stock-log-filter-grid {
    grid-template-columns: 1fr;
  }

  #page-stock .filter-grid {
    grid-template-columns: 1fr;
  }

  #page-stock .filter-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 8px;
    justify-content: stretch;
  }

  #page-stock #stockExportBtn,
  #page-stock #stockFilterResetBtn {
    width: 100%;
    min-width: 0;
  }

  #page-stock .stock-toggle-inline {
    grid-column: 1 / -1;
    justify-content: center;
    width: 100%;
  }

  #actionModalBackdrop .modal-card.modal-card-wide.terminal-modal-card {
    width: min(96vw, 96vw);
    padding: 14px;
  }

  #actionModalBody .terminal-entry-form {
    padding: 12px;
    row-gap: 10px;
  }

  #actionModalBody .quick-modal-form {
    padding: 12px;
    row-gap: 10px;
  }

  .stock-log-filter-actions {
    justify-content: flex-start;
  }

  .finance-subnav {
    flex-direction: column;
  }

  .huifu-subnav {
    flex-direction: column;
  }

  .huilaimi-subnav {
    flex-direction: column;
  }

  .alipay-subnav {
    flex-direction: column;
  }

  .lakala-subnav {
    flex-direction: column;
  }

  .huifu-config-grid,
  .huifu-call-form,
  .alipay-config-grid,
  .alipay-call-form,
  .alipay-report-filter-grid,
  .lakala-config-grid,
  .lakala-call-form,
  .pay-key-form,
  .huilaimi-config-grid,
  .huilaimi-call-form {
    grid-template-columns: 1fr;
  }

  .huilaimi-quick-card {
    grid-column: 1 / -1;
  }

  .huilaimi-step-grid {
    grid-template-columns: 1fr;
  }

  .huilaimi-template-grid {
    grid-template-columns: 1fr;
  }

  .huilaimi-template-topbar {
    grid-template-columns: 1fr;
  }

  .permission-group-grid {
    grid-template-columns: 1fr;
  }

  .permission-search {
    min-width: 0;
    width: 100%;
  }

  .menu-tree-edit-grid {
    grid-template-columns: 1fr;
  }

  #menuManageTreeWrap {
    max-height: none;
  }

  #menuManageTreeWrap .menu-tree-key {
    white-space: normal;
    overflow: visible;
  }

  .permission-toolbar .ghost-btn {
    flex: 1 1 calc(50% - 4px);
  }

  .permission-check-grid {
    grid-template-columns: 1fr;
  }

  .panel > div[id$="Table"] {
    overflow-x: visible;
  }

  .table-toolbar {
    justify-content: flex-start;
  }

  .column-setting-head {
    display: none;
  }

  .column-setting-row {
    grid-template-columns: 1fr;
  }

  table.data-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  table.data-table thead {
    display: none;
  }

  table.data-table tbody,
  table.data-table tr,
  table.data-table td {
    display: block;
    width: 100%;
  }

  table.data-table tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 8px 10px;
  }

  table.data-table td {
    border: none;
    padding: 6px 0;
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    column-gap: 10px;
    align-items: center;
    min-height: 32px;
  }

  table.data-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
  }

  table.data-table th.col-fixed-left,
  table.data-table td.col-fixed-left,
  table.data-table th.col-fixed-right,
  table.data-table td.col-fixed-right {
    position: static;
    box-shadow: none;
  }

  table.data-table td > * {
    min-width: 0;
  }

  table.data-table td .inline-input,
  table.data-table td .inline-select,
  table.data-table td .primary-btn,
  table.data-table td .ghost-btn {
    width: 100%;
  }

  table.data-table td .text-btn {
    text-align: left;
  }

  table.data-table th.table-settings-th {
    display: none;
  }

  table.data-table td.table-settings-cell {
    display: none;
  }

  .panel table:not(.data-table) {
    min-width: 560px;
  }
}

/* Global UI polish */
:root {
  --panel-pad-compact: 12px;
  --control-height: 36px;
  --control-radius: 9px;
}

.main {
  padding: 16px 18px;
}

.topbar {
  margin-bottom: 12px;
  padding: 8px 10px;
  border-radius: 12px;
}

.topbar-title h2 {
  font-size: 20px;
}

.topbar-title p {
  margin-top: 2px;
}

.page {
  min-width: 0;
}

.panel {
  padding: var(--panel-pad-compact);
  border-radius: 12px;
}

.panel-head {
  margin-bottom: 8px;
  min-height: 34px;
  flex-wrap: wrap;
}

.panel-head h3 {
  font-size: 14px;
}

.panel-head h3::before {
  height: 14px;
}

.action-group,
.entry-actions,
.filter-actions {
  gap: 6px;
}

.filter-grid,
.finance-filter-grid,
.policy-form-grid,
.stock-log-filter-grid {
  gap: 8px;
  margin-bottom: 10px;
}

.field {
  gap: 4px;
}

.field > span {
  line-height: 1.2;
}

.field input,
.field select,
.inline-input,
.inline-select,
.page-jump-input,
.quick-search input,
.huilaimi-template-topbar input,
.huilaimi-template-topbar select,
.huilaimi-template-grid input {
  min-height: var(--control-height);
  border-radius: var(--control-radius);
  padding: 7px 10px;
}

.field textarea {
  min-height: 88px;
  border-radius: var(--control-radius);
}

.primary-btn,
.ghost-btn,
.page-btn {
  min-height: 34px;
}

.text-btn {
  min-height: 30px;
  padding: 3px 8px;
  font-size: 12px;
}

.table-note {
  margin-top: 8px;
}

.table-pagination {
  margin-top: 8px;
  gap: 5px;
}

th,
td {
  padding: 9px 8px;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f6f9ff;
}

table.data-table thead th.col-fixed-left,
table.data-table thead th.col-fixed-right {
  top: 0;
  z-index: 6;
}

table.data-table tbody tr:nth-child(even) td {
  background: #fbfdff;
}

table.data-table tbody tr:nth-child(even) td.col-fixed-left,
table.data-table tbody tr:nth-child(even) td.col-fixed-right {
  background: #fbfdff;
}

.finance-subnav-panel {
  padding-top: 8px;
  padding-bottom: 8px;
}

.finance-subnav {
  gap: 6px;
}

.finance-subnav-btn {
  padding: 7px 12px;
  min-height: 34px;
  line-height: 1;
}

.entry-form,
.pay-key-form,
.huifu-call-form,
.huilaimi-call-form,
.lakala-call-form,
.alipay-call-form {
  padding: 10px;
  gap: 8px;
}

.permission-group {
  padding: 8px 10px;
}

.permission-toolbar {
  margin: 2px 0 6px;
  gap: 6px;
}

#menuManageTreeWrap {
  max-height: 360px;
  padding: 6px 8px;
}

#menuManageTreeWrap .menu-tree-item {
  padding: 4px 6px;
  min-height: 30px;
}

#menuManageTreeWrap .menu-tree-edit-grid {
  grid-template-columns: minmax(120px, 190px) minmax(200px, 1fr) 66px auto auto;
  gap: 5px;
}

#menuManageTreeWrap .menu-tree-add-btn,
#menuManageTreeWrap .menu-tree-delete-btn {
  min-height: 28px;
  padding: 4px 8px;
}

@media (max-width: 1200px) {
  .topbar-title h2 {
    font-size: 19px;
  }

  .panel-head {
    align-items: flex-start;
  }
}

@media (max-width: 980px) {
  .main {
    padding: 14px;
  }

  .topbar {
    margin-bottom: 10px;
  }

  .finance-subnav-btn {
    min-height: 32px;
  }

  .top-tabs-wrap {
    margin-bottom: 10px;
    padding: 6px;
  }

  .top-tab {
    height: 32px;
    font-size: 12px;
    padding: 0 8px;
  }
}

@media (max-width: 640px) {
  .panel {
    padding: 10px;
  }

  .panel-head {
    margin-bottom: 7px;
  }

  .topbar {
    padding: 8px;
  }

  .top-tabs-wrap {
    gap: 6px;
  }

  .top-tabs-nav-btn {
    width: 24px;
    height: 24px;
  }

  .top-tab-text {
    max-width: 160px;
  }

  .filter-actions,
  .entry-actions,
  .action-group {
    width: 100%;
  }

  .filter-actions .primary-btn,
  .filter-actions .ghost-btn,
  .entry-actions .primary-btn,
  .entry-actions .ghost-btn,
  .action-group .primary-btn,
  .action-group .ghost-btn {
    flex: 1 1 calc(50% - 3px);
  }

  .finance-subnav-btn {
    width: 100%;
    justify-content: center;
  }

  #menuManageTreeWrap {
    max-height: none;
  }
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  background: #cad8ec;
  border-radius: 999px;
  border: 2px solid #f5f8fd;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Executive-grade global UI refinement */
:root {
  --text: var(--ink);
  --bg: #edf2f8;
  --card: #ffffff;
  --line: #d4deec;
  --ink: #0f223d;
  --muted: #51617c;
  --brand: #1b4fb8;
  --brand-strong: #153f97;
  --brand-softest: #f2f6ff;
  --brand-soft: #dce7ff;
  --focus-ring: 0 0 0 3px rgba(27, 79, 184, 0.16);
  --shadow-card: 0 10px 26px rgba(14, 39, 82, 0.08);
  --shadow-card-hover: 0 16px 36px rgba(14, 39, 82, 0.14);
}

body {
  font-family: "HarmonyOS Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(1100px 680px at 9% -12%, rgba(75, 124, 213, 0.14), rgba(75, 124, 213, 0) 58%),
    radial-gradient(900px 560px at 104% 14%, rgba(97, 161, 224, 0.12), rgba(97, 161, 224, 0) 54%),
    linear-gradient(180deg, #f4f7fc 0%, #edf2f8 100%);
}

.sidebar {
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(137, 187, 255, 0.16), rgba(137, 187, 255, 0) 42%),
    linear-gradient(186deg, #102f70 0%, #123c89 42%, #15489f 100%);
  box-shadow:
    inset -1px 0 0 rgba(255, 255, 255, 0.12),
    10px 0 28px rgba(5, 20, 56, 0.3);
}

.brand {
  margin-bottom: 16px;
}

.logo {
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    0 8px 20px rgba(4, 15, 43, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.nav-item {
  border: 1px solid transparent;
  letter-spacing: 0.2px;
}

.nav-item:hover,
.nav-item.active {
  border-color: rgba(255, 255, 255, 0.16);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
}

.sidebar-version {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.topbar {
  border: 1px solid #d8e3f1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(251, 253, 255, 0.9));
  box-shadow:
    0 10px 26px rgba(14, 39, 82, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.topbar-title h2 {
  font-weight: 700;
  letter-spacing: 0.3px;
}

.topbar-title p {
  color: #637796;
}

.top-tabs-wrap {
  border-color: #d8e3f3;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  box-shadow: 0 6px 18px rgba(14, 39, 82, 0.08);
}

.top-tab {
  border-color: #d6e1f2;
  background: #ffffff;
}

.top-tab.active {
  border-color: #2a63ce;
  background: #edf3ff;
  box-shadow:
    inset 0 0 0 1px rgba(42, 99, 206, 0.18),
    0 8px 16px rgba(42, 99, 206, 0.16);
}

.panel {
  border-color: #d8e2f0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 252, 255, 0.96));
  box-shadow:
    0 12px 28px rgba(14, 39, 82, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.panel:hover {
  border-color: #c8d8ed;
  box-shadow:
    0 16px 34px rgba(14, 39, 82, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.panel-head h3 {
  color: #16345f;
}

.panel-head h3::before {
  width: 4px;
  background: linear-gradient(180deg, #2f70dd, #174cae);
}

.kpi {
  border-color: #d9e3f2;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.kpi strong {
  color: #16345f;
}

.primary-btn {
  background: #1b4fb8;
  border: 1px solid #15439f;
  box-shadow:
    0 10px 24px rgba(27, 79, 184, 0.28),
    inset 0 1px 0 rgba(171, 204, 255, 0.4);
}

.primary-btn:hover:not(:disabled) {
  background: #173f95;
  box-shadow:
    0 12px 28px rgba(23, 63, 149, 0.32),
    inset 0 1px 0 rgba(171, 204, 255, 0.5);
}

.ghost-btn {
  background: #f3f7ff;
  border: 1px solid #d0ddf3;
  color: #1d4ba2;
}

.ghost-btn:hover:not(:disabled) {
  background: #eaf1ff;
  border-color: #bfd0ee;
}

.field > span {
  color: #2f486f;
}

.field input,
.field select,
.field textarea,
.inline-input,
.inline-select,
.quick-search input,
.page-jump-input {
  border-color: #cdd9ea;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  color: #152e52;
}

.field input::placeholder,
.field textarea::placeholder,
.quick-search input::placeholder {
  color: #8b9ab3;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.inline-input:focus,
.inline-select:focus,
.quick-search input:focus,
.page-jump-input:focus {
  border-color: #7fa3df;
  box-shadow: var(--focus-ring);
  background: #ffffff;
}

.finance-subnav-btn {
  border-color: #cfdcf0;
  background: #ffffff;
  color: #3f5578;
}

.finance-subnav-btn.active {
  border-color: #b9cff1;
  background: #edf3ff;
  color: #1b4fb8;
}

table.data-table {
  border-radius: 10px;
  overflow: hidden;
}

thead th {
  background: linear-gradient(180deg, #f9fbff 0%, #f1f6ff 100%);
  color: #2f466a;
  border-bottom: 1px solid #d8e3f2;
}

th,
td {
  border-bottom-color: #e0e8f4;
}

tbody tr:hover td {
  background: #f3f7ff;
}

table.data-table tbody tr:hover td.col-fixed-left,
table.data-table tbody tr:hover td.col-fixed-right {
  background: #f3f7ff;
}

table.data-table th.draggable-th::after {
  color: #7f97bc;
}

table.data-table th.draggable-th.drag-over {
  background: #e9f1ff;
  box-shadow: inset 0 -2px 0 #3d6fc4;
}

.table-pagination .page-btn {
  border-color: #cfdced;
  background: #fff;
  color: #50617c;
}

.table-pagination .page-btn.active {
  border-color: #b8cdee;
  background: #ebf2ff;
  color: #1b4fb8;
}

.modal-backdrop {
  background: rgba(7, 23, 56, 0.34);
  backdrop-filter: blur(4px);
}

.modal-card {
  border-color: #d9e3f2;
  box-shadow:
    0 22px 54px rgba(12, 32, 74, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

/* Slim top tabs */
.top-tabs-wrap {
  padding: 4px 6px;
  border-radius: 10px;
}

.top-tab {
  height: 30px;
  border-radius: 7px;
  padding: 0 9px;
  font-size: 12px;
}

.top-tab-close {
  width: 14px;
  height: 14px;
  font-size: 11px;
}

.top-tabs-nav-btn {
  width: 24px;
  height: 24px;
  border-radius: 7px;
}

/* Table: auto-expand columns by content without squeezing */
.panel > div[id$="Table"] {
  overflow-x: auto;
  overflow-y: visible;
}

table.data-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
  overflow: visible;
}

table.data-table thead th,
table.data-table tbody td {
  white-space: nowrap;
}

table.data-table th.draggable-th .th-label {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

@media (max-width: 640px) {
  table.data-table {
    width: 100%;
    min-width: 0;
  }

  table.data-table tbody td {
    white-space: normal;
  }
}

/* Bigscreen hard rollback to previous stable theme (scoped only) */
#page-bigscreen .bigscreen-panel {
  background: linear-gradient(160deg, #0b2b73 0%, #0f3f9a 42%, #1558c0 100%);
  color: #eef5ff;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

#page-bigscreen .bigscreen-panel .panel-head h3::before {
  background: rgba(255, 255, 255, 0.88);
}

#page-bigscreen .bigscreen-panel .panel-head h3,
#page-bigscreen .bigscreen-grid .panel h3 {
  color: #ffffff;
}

#page-bigscreen .bigscreen-panel .table-note-inline {
  color: rgba(236, 245, 255, 0.85);
}

#page-bigscreen .bigscreen-kpi-item {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.09);
}

#page-bigscreen .bigscreen-kpi-item span {
  color: rgba(236, 245, 255, 0.86);
}

#page-bigscreen .bigscreen-kpi-item strong {
  color: #ffffff;
}

#page-bigscreen .bigscreen-grid .panel {
  background: rgba(6, 24, 64, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #eef5ff;
}

#page-bigscreen .bigscreen-map-canvas {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: radial-gradient(circle at 30% 20%, #1b4fb2, #0c2d79 68%);
}

#page-bigscreen .bigscreen-map-guide {
  fill: rgba(168, 211, 255, 0.13);
  stroke: rgba(168, 211, 255, 0.28);
}

#page-bigscreen .bigscreen-map-dot {
  fill: rgba(255, 209, 102, 0.95);
  stroke: rgba(255, 255, 255, 0.95);
}

#page-bigscreen #bigscreenCityTable table th,
#page-bigscreen #bigscreenCityTable table td {
  color: #eef5ff;
  border-color: rgba(255, 255, 255, 0.18);
}

#page-bigscreen #bigscreenCityTable table th {
  background: rgba(255, 255, 255, 0.08);
}

#page-bigscreen #bigscreenCityTable table.data-table tbody tr:nth-child(even) td {
  background: transparent;
}

#page-bigscreen #bigscreenCityTable table.data-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.06);
}

/* Approval flow manager */
.switch-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.approval-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.approval-quick-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.approval-quick-banner p {
  margin: 4px 0 0;
  font-size: 12px;
  color: #4c5970;
}

.approval-quick-banner.ok {
  background: rgba(46, 160, 67, 0.08);
  border-color: rgba(46, 160, 67, 0.3);
}

.approval-quick-banner.warn {
  background: rgba(249, 168, 37, 0.1);
  border-color: rgba(217, 119, 6, 0.28);
}

.approval-step-card {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.75);
  padding: 12px;
}

.approval-step-card > header {
  margin-bottom: 8px;
  color: #2a3342;
  font-size: 13px;
}

.approval-quick-actions {
  margin-top: 10px;
  gap: 8px;
}

.approval-purchase-wecom-panel {
  margin-top: 12px;
}

.approval-purchase-wecom-form .approval-sync-status-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.approval-sync-status-item {
  padding: 4px 0;
}

.approval-flow-def-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.approval-def-item-card {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 10px;
  min-width: 280px;
  background: rgba(255, 255, 255, 0.65);
}

.approval-def-item-card.active {
  border-color: #2a63ff;
  box-shadow: 0 0 0 1px rgba(42, 99, 255, 0.2);
}

.approval-def-item-btn.active {
  border-color: #2a63ff;
  color: #2a63ff;
}

.approval-flow-editor-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.approval-node-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  margin-bottom: 10px;
}

.approval-node-row .entry-actions {
  align-self: end;
}

.approval-feature-remark-input {
  width: 100%;
  min-width: 120px;
}

@media (max-width: 900px) {
  .approval-quick-grid {
    grid-template-columns: 1fr;
  }

  .approval-node-row {
    grid-template-columns: 1fr;
  }
}

/* 2026-05-07: Reference-style global UI refinement */
:root {
  --ux-bg-top: #f6f8fc;
  --ux-bg-bottom: #edf2f8;
  --ux-card-top: #ffffff;
  --ux-card-bottom: #f9fbff;
  --ux-line-strong: #c6d3e8;
  --ux-line-soft: #dde6f3;
  --ux-title: #142f57;
  --ux-text: #1f3558;
  --ux-muted: #5b6f8d;
  --ux-brand: #1b4fb8;
  --ux-brand-dark: #163f95;
  --ux-brand-soft: #eaf1ff;
  --ux-radius-sm: 8px;
  --ux-radius-md: 12px;
  --ux-radius-lg: 14px;
  --ux-shadow-panel: 0 12px 30px rgba(10, 32, 74, 0.08);
  --ux-shadow-hover: 0 16px 34px rgba(10, 32, 74, 0.13);
}

body {
  color: var(--ux-text);
  background:
    radial-gradient(1100px 640px at 10% -16%, rgba(83, 132, 214, 0.13), rgba(83, 132, 214, 0) 60%),
    radial-gradient(900px 520px at 108% 20%, rgba(97, 160, 226, 0.1), rgba(97, 160, 226, 0) 56%),
    linear-gradient(180deg, var(--ux-bg-top) 0%, var(--ux-bg-bottom) 100%);
}

.main {
  padding: 16px 18px;
}

.sidebar {
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(138, 188, 255, 0.18), rgba(138, 188, 255, 0) 44%),
    linear-gradient(185deg, #0f2f6f 0%, #123d8b 42%, #15499f 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    inset -1px 0 0 rgba(255, 255, 255, 0.14),
    12px 0 28px rgba(5, 20, 56, 0.28);
}

.brand h1 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.brand p {
  opacity: 0.86;
}

.nav-item {
  border: 1px solid transparent;
  color: #ebf1ff;
}

.nav-item:hover,
.nav-item.active {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.19), rgba(255, 255, 255, 0.08));
  border-color: rgba(255, 255, 255, 0.16);
}

.nav-subitem {
  background: rgba(255, 255, 255, 0.08);
}

.nav-subitem:hover,
.nav-subitem.active {
  background: rgba(255, 255, 255, 0.2);
}

.topbar {
  margin-bottom: 12px;
  padding: 9px 12px;
  border: 1px solid #d7e1ef;
  border-radius: var(--ux-radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(249, 252, 255, 0.92));
  box-shadow:
    0 10px 24px rgba(11, 33, 73, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.topbar-title h2 {
  color: var(--ux-title);
  font-size: 20px;
  font-weight: 700;
}

.topbar-title p {
  color: var(--ux-muted);
}

.topbar-meta {
  color: var(--ux-muted);
}

.top-tabs-wrap {
  margin: -2px 0 12px;
  border-color: #d8e3f2;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  box-shadow: 0 6px 16px rgba(10, 32, 74, 0.08);
}

.top-tab {
  height: 30px;
  border-radius: 8px;
  border-color: #d5e1f2;
  background: #ffffff;
}

.top-tab.active {
  border-color: #2a63ce;
  background: #edf3ff;
  box-shadow:
    inset 0 0 0 1px rgba(42, 99, 206, 0.18),
    0 8px 16px rgba(42, 99, 206, 0.15);
}

.top-tabs-nav-btn {
  width: 24px;
  height: 24px;
}

.panel {
  border: 1px solid #d7e1ef;
  border-radius: var(--ux-radius-lg);
  background: linear-gradient(180deg, var(--ux-card-top) 0%, var(--ux-card-bottom) 100%);
  box-shadow:
    var(--ux-shadow-panel),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.panel:hover {
  border-color: #c7d6ea;
  box-shadow:
    var(--ux-shadow-hover),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.panel-head h3 {
  color: var(--ux-title);
  font-size: 14px;
}

.panel-head h3::before {
  width: 4px;
  height: 14px;
  background: linear-gradient(180deg, #2f70dd, #174cae);
}

.kpi {
  border-color: #d8e2f1;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.kpi h4 {
  color: var(--ux-muted);
}

.kpi strong {
  color: var(--ux-title);
}

.primary-btn,
.ghost-btn {
  border-radius: 10px;
  min-height: 34px;
  font-weight: 600;
}

.primary-btn {
  background: linear-gradient(140deg, var(--ux-brand) 0%, var(--ux-brand-dark) 100%);
  border: 1px solid #173f95;
  box-shadow:
    0 10px 22px rgba(27, 79, 184, 0.3),
    inset 0 1px 0 rgba(179, 209, 255, 0.42);
}

.primary-btn:hover:not(:disabled) {
  background: linear-gradient(140deg, #1945a3 0%, #143983 100%);
  box-shadow:
    0 12px 24px rgba(20, 57, 131, 0.35),
    inset 0 1px 0 rgba(179, 209, 255, 0.48);
}

.ghost-btn {
  background: linear-gradient(180deg, #f8fbff 0%, #edf3ff 100%);
  border: 1px solid #cfddf2;
  color: #1b4ea5;
}

.ghost-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #f1f6ff 0%, #e6efff 100%);
  border-color: #bed0eb;
}

.text-btn {
  background: rgba(27, 79, 184, 0.09);
  border-color: rgba(27, 79, 184, 0.12);
  color: #1b4ea5;
}

.field > span {
  color: #314b73;
}

.field input,
.field select,
.field textarea,
.inline-input,
.inline-select,
.quick-search input,
.page-jump-input,
.huilaimi-template-topbar input,
.huilaimi-template-topbar select,
.huilaimi-template-grid input {
  border-color: #ccd9eb;
  border-radius: 9px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  color: #173153;
}

.field input::placeholder,
.field textarea::placeholder,
.quick-search input::placeholder {
  color: #8a99b2;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.inline-select:focus,
.inline-input:focus,
.quick-search input:focus,
.page-jump-input:focus {
  border-color: #7ea2dd;
  box-shadow: 0 0 0 3px rgba(27, 79, 184, 0.13);
  background: #fff;
}

.finance-subnav-btn {
  border-color: #cfdced;
  background: #fff;
  color: #3f5578;
  border-radius: 999px;
}

.finance-subnav-btn.active {
  border-color: #b7ceef;
  background: var(--ux-brand-soft);
  color: var(--ux-brand);
  box-shadow: 0 6px 14px rgba(27, 79, 184, 0.14);
}

.table-note,
.table-note-inline,
.page-meta {
  color: var(--ux-muted);
}

.panel > div[id$="Table"] {
  overflow-x: auto;
  overflow-y: visible;
}

table.data-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
  border-radius: 10px;
  overflow: hidden;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, #f9fbff 0%, #f1f6ff 100%);
  color: #2f466a;
  border-bottom: 1px solid #d7e2f1;
}

th,
td {
  border-bottom: 1px solid #dde7f4;
  white-space: nowrap;
}

table.data-table th.draggable-th .th-label {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

table.data-table tbody tr:nth-child(even) td {
  background: #fbfdff;
}

tbody tr:hover td {
  background: #f3f7ff;
}

table.data-table th.col-fixed-left,
table.data-table td.col-fixed-left,
table.data-table th.col-fixed-right,
table.data-table td.col-fixed-right {
  background: inherit;
}

table.data-table tbody tr:hover td.col-fixed-left,
table.data-table tbody tr:hover td.col-fixed-right {
  background: #f3f7ff;
}

table.data-table tbody tr:nth-child(even) td.col-fixed-left,
table.data-table tbody tr:nth-child(even) td.col-fixed-right {
  background: #fbfdff;
}

table.data-table th.draggable-th.drag-over {
  background: #e9f1ff;
  box-shadow: inset 0 -2px 0 #3f72c7;
}

.table-settings-icon-btn {
  border-color: #c8d9ef;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
  color: #2f5485;
}

.table-settings-icon-btn:hover {
  border-color: #9bb8e7;
  background: #edf4ff;
  color: #1b4ea5;
}

.page-btn {
  border-color: #d0dced;
  color: #4e607b;
}

.page-btn.active {
  border-color: #b8ceee;
  background: #eaf1ff;
  color: #1b4fb8;
}

.modal-backdrop {
  background: rgba(7, 23, 56, 0.34);
  backdrop-filter: blur(4px);
}

.modal-card {
  border-color: #d8e2f1;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  box-shadow:
    0 22px 54px rgba(12, 32, 74, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.permission-group {
  border-color: #d7e2f2;
  background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
}

.permission-check-item {
  border-color: #d8e4f6;
  background: #ffffff;
}

.permission-check-item:has(input:checked) {
  border-color: #91b2e9;
  background: #f2f7ff;
}

@media (max-width: 980px) {
  .main {
    padding: 14px;
  }

  .topbar-title h2 {
    font-size: 19px;
  }

  .top-tabs-wrap {
    margin-bottom: 10px;
  }
}

/* ============================================
   UI 优化 - 卡片/按钮/排版统一规范
   ============================================ */

/* ── 按钮系统：统一触控区域 & 尺寸 ── */
.primary-btn,
.ghost-btn {
  padding: 10px 20px;
  min-height: 40px;
  font-size: 14px;
  border-radius: 12px;
  gap: 8px;
}

.primary-btn {
  color: #e53e3e;
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.25);
}

.primary-btn:hover:not(:disabled) {
  box-shadow: 0 12px 24px rgba(220, 38, 38, 0.32);
  background: linear-gradient(135deg, #fee2e2, #fecaca);
}

.primary-btn:hover:not(:disabled),
.ghost-btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.text-btn {
  padding: 6px 12px;
  min-height: 32px;
  font-size: 13px;
  border-radius: 8px;
}

.row-delete-btn,
.access-role-delete-btn {
  background: #fff0f0;
  border-color: #ffd4d4;
  padding: 6px 12px;
  min-height: 32px;
}

.row-delete-btn:hover,
.access-role-delete-btn:hover {
  background: #ffe4e4;
  border-color: #f3a8a8;
}

/* ── 表单字段：统一输入框高度 & 间距 ── */
.field input,
.field select {
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
}

.field textarea {
  min-height: 80px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
}

.field > span {
  font-size: 13px;
  font-weight: 600;
}

/* 表单网格间距 */
.entry-form,
.terminal-entry-form {
  gap: 14px;
}

/* ── KPI 卡片：优化比例 & 视觉层次 ── */
.kpi {
  padding: 16px 18px;
  border-radius: 16px;
}

.kpi h4 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.kpi strong {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.kpi span {
  font-size: 13px;
  margin-top: 4px;
  display: block;
}

.kpi-grid {
  gap: 14px;
}

/* ── Panel 面板：统一内间距 & 圆角 ── */
.panel {
  padding: 20px;
  border-radius: 16px;
}

/* ── Table 表格：行高 & 列间距优化 ── */
table.data-table th,
table.data-table td {
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
}

table.data-table th {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
  background: #f7f9fc;
}

table.data-table tbody tr:hover td {
  background: #f5f8ff;
}

/* 状态 pills */
.pill {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  letter-spacing: 0.2px;
}

.link-pill {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
}

/* ── Modal 弹窗：加大宽度 & 优化内间距 ── */
.modal-card {
  width: min(540px, calc(100vw - 24px));
  padding: 24px;
  border-radius: 18px;
}

.modal-card-wide {
  width: min(800px, calc(100vw - 24px));
}

.modal-card h3 {
  font-size: 20px;
  margin-bottom: 12px;
  font-weight: 700;
}

.modal-card p {
  font-size: 14px;
  margin-bottom: 18px;
}

.modal-actions {
  margin-top: 20px;
  gap: 10px;
}

/* ── 页面内容区域：统一 section 间距 ── */
.page.active > * + * {
  margin-top: 16px;
}

/* ── 分页器：加大触摸区域 ── */
.page-btn {
  min-width: 36px;
  min-height: 36px;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 8px;
}

.page-jump-input {
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 8px;
}

/* ── Topbar 优化 ── */
.topbar {
  padding: 18px 24px;
  gap: 14px;
}

.topbar-title h2 {
  font-size: 22px;
  font-weight: 700;
}

/* ============================================
   移动端响应式增强
   ============================================ */

/* 平板端 (768px) */
@media (max-width: 768px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .kpi {
    padding: 14px;
  }

  .kpi strong {
    font-size: 24px;
  }

  .panel {
    padding: 14px;
  }

  .topbar {
    padding: 12px 16px;
  }

  .topbar-title h2 {
    font-size: 19px;
  }

  .primary-btn,
  .ghost-btn {
    padding: 9px 16px;
    min-height: 38px;
    font-size: 13px;
  }
}

/* 手机端 (480px) */
@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .modal-card {
    padding: 16px;
    border-radius: 14px;
  }

  .modal-card h3 {
    font-size: 17px;
  }

  .entry-form,
  .terminal-entry-form {
    gap: 10px;
  }

  .field input,
  .field select {
    min-height: 44px;
    font-size: 16px; /* 防 iOS 缩放 */
  }

  .primary-btn,
  .ghost-btn {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
    min-height: 48px;
    font-size: 15px;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions .primary-btn,
  .modal-actions .ghost-btn {
    width: 100%;
  }
}

/* 保留原有 640px 媒体查询 */
@media (max-width: 640px) {
  .panel {
    padding: 10px;
  }

  .topbar {
    padding: 8px;
  }

  table.data-table {
    width: 100%;
    min-width: 0;
  }

  table.data-table tbody td {
    white-space: normal;
  }
}

/* ── 侧边栏微调 ── */
.brand h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.nav-item {
  border-radius: 12px;
  font-weight: 500;
  transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateX(4px);
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.22);
  font-weight: 600;
}

.nav-subitem {
  border-radius: 10px;
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  font-size: 13px;
}
/* ===== CRM 模块样式 ===== */

/* 子导航 */
.crm-subnav {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px;
  flex-wrap: wrap;
}
.crm-subnav-btn {
  padding: 7px 16px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--trans-fast);
  font-family: inherit;
}
.crm-subnav-btn:hover {
  background: var(--brand-softest);
  color: var(--ink);
}
.crm-subnav-btn.active {
  background: var(--brand);
  color: #fff;
}

/* KPI 行 */
.crm-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.crm-kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: box-shadow var(--trans-fast);
}
.crm-kpi:hover {
  box-shadow: var(--shadow-card-hover);
}
.crm-kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.crm-kpi-lbl {
  font-size: 12px;
  color: var(--muted);
}
.crm-kpi-ic {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.crm-kpi-val {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
  color: var(--ink);
}
.crm-kpi-sub {
  font-size: 11px;
}
.crm-kpi-sub.up { color: var(--ok); }
.crm-kpi-sub.down { color: var(--danger); }
.crm-kpi-sub span { color: var(--muted); }

/* 颜色标识 */
.crm-ic-blue { background: var(--brand-soft); color: var(--brand); }
.crm-ic-green { background: #e8f8f1; color: var(--ok); }
.crm-ic-purple { background: #f3f0ff; color: #8B5CF6; }
.crm-ic-orange { background: #fff6e8; color: var(--warn); }

/* 图表 */
.crm-chart {
  height: 260px;
  position: relative;
  overflow: hidden;
}
.crm-axis-label {
  font-size: 10px;
  fill: var(--muted);
  text-anchor: middle;
}

/* 动态列表 */
.crm-activity {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f4f4f4;
  align-items: flex-start;
  font-size: 13px;
}
.crm-activity:last-child { border-bottom: none; }
.crm-act-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.crm-activity small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* 饼图 */
.crm-pie-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 8px;
  flex-wrap: wrap;
}
.crm-pie-svg { width: 120px; height: 120px; flex-shrink: 0; }
.crm-pie-legend { font-size: 12px; }
.crm-legend-item {
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.crm-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
  flex-shrink: 0;
}

/* 快捷操作 */
.crm-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.crm-quick-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 12px;
  cursor: pointer;
  transition: all var(--trans-fast);
  background: none;
  text-align: left;
  font-family: inherit;
  display: block;
  width: 100%;
}
.crm-quick-item:hover {
  border-color: var(--brand);
  background: var(--brand-softest);
}
.crm-qi {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 8px;
}
.crm-qt { font-size: 13px; font-weight: 600; color: var(--ink); }
.crm-qs { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* 筛选栏 */
.crm-filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.crm-filters label {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.crm-filters select,
.crm-filters input {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  background: var(--bg);
  font-family: inherit;
  min-width: 0;
}
.crm-filters select:focus,
.crm-filters input:focus {
  border-color: var(--brand);
}

/* 指标卡片 */
.crm-metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.crm-metric {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.crm-mv {
  font-size: 22px;
  font-weight: 700;
  color: var(--brand);
}
.crm-ml {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.crm-mt {
  font-size: 11px;
  margin-top: 4px;
}
.crm-mt.up { color: var(--ok); }
.crm-mt.down { color: var(--danger); }

/* 组织架构 */
.crm-org-node {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}
.crm-org-child { margin-left: 24px; }
.crm-org-ic {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #f1f5f9;
}
.crm-org-node small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

/* 角色列表 */
.crm-role-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f4f4f4;
  font-size: 13px;
}
.crm-role-item:last-child { border-bottom: none; }
.crm-role-item span:last-child {
  color: var(--muted);
  font-size: 12px;
}

/* 企业总结 */
.crm-summ-hero {
  background: linear-gradient(135deg, #0f2f74, #1a4fad, #2463d6);
  border-radius: var(--radius);
  padding: 28px 32px;
  color: #fff;
  margin-bottom: 16px;
}
.crm-summ-hero h2 { font-size: 18px; margin-bottom: 4px; }
.crm-summ-hero p { font-size: 13px; opacity: 0.6; margin-bottom: 16px; }
.crm-summ-stats { display: flex; gap: 32px; }
.crm-summ-stat strong { display: block; font-size: 22px; }
.crm-summ-stat span { font-size: 11px; opacity: 0.6; }

.crm-summ-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.crm-summ-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.crm-summ-ic {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 10px;
}
.crm-summ-card h4 { font-size: 14px; margin-bottom: 6px; }
.crm-summ-card p { font-size: 12px; color: var(--muted); line-height: 1.6; margin-bottom: 10px; }
.crm-up { font-size: 18px; font-weight: 700; color: var(--brand); }

/* 响应式 */
@media (max-width: 768px) {
  .crm-kpi-row { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .crm-kpi { padding: 12px 14px; }
  .crm-kpi-val { font-size: 20px; }
  .crm-metric-row { grid-template-columns: repeat(2, 1fr); }
  .crm-summ-grid { grid-template-columns: 1fr; }
  .crm-summ-stats { flex-wrap: wrap; gap: 20px; }
  .crm-chart { height: 200px; }
  .crm-pie-wrap { flex-direction: column; align-items: center; }
  .crm-org-child { margin-left: 16px; }
  .crm-summ-hero { padding: 20px; }
  .crm-quick-grid { grid-template-columns: 1fr; }
}
@media (min-width: 1600px) {
  .crm-kpi-row { grid-template-columns: repeat(4, 1fr); }
  .crm-summ-grid { grid-template-columns: repeat(3, 1fr); }
}
