* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: #a5b2c2 transparent;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: #a5b2c2;
  border-radius: 999px;
}

html,
body {
  margin: 0;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--page-bg);
  color: var(--text-main);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-width: 1360px;
  height: 100vh;
  min-height: 100vh;
  display: flex;
}

.side-bar {
  width: 82px;
  height: 100vh;
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar) 72%, var(--sidebar-deep) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.03);
  position: sticky;
  top: 0;
  z-index: 5;
  flex: none;
}

.logo-box {
  width: 100%;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-item {
  width: 100%;
  padding: 16px 0 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  position: relative;
  user-select: none;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-item.active {
  background: rgba(90, 116, 239, 0.18);
  color: #fff;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: #84a2ff;
}

.nav-item i {
  margin-right: 0;
  font-size: 20px;
  line-height: 1;
  opacity: 0.95;
}

.nav-item span {
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
  white-space: nowrap;
}

.side-version {
  margin-top: auto;
  margin-bottom: 10px;
  width: 100%;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.92;
}

.page-shell {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--page-bg);
}

.header-meta {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: #f5f6f8;
  color: #526173;
  font-size: 12px;
}

.header-meta i {
  font-size: 13px;
  color: #7d8ea3;
}

.header-tabs {
  height: 40px;
  display: flex;
  align-items: flex-end;
  gap: 1px;
  padding: 0 12px;
  background: #f4f6f8;
  border-bottom: 1px solid var(--line);
}

.header-tabs.header-tabs-composed {
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
}

.header-tabs-main {
  min-width: 0;
  display: flex;
  align-items: flex-end;
  gap: 1px;
  overflow-x: auto;
  scrollbar-width: none;
}

.header-tabs-main::-webkit-scrollbar {
  display: none;
}

.header-tabs-actions {
  flex: none;
  display: flex;
  align-items: center;
  padding-bottom: 3px;
}

.tab-chip {
  height: 31px;
  min-width: 94px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-bottom: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #4b5d70;
  background: #f3f5f7;
  border-radius: 2px 2px 0 0;
}

.tab-chip.primary {
  background: var(--brand-light);
  color: var(--brand);
  border-color: #cfe0ff;
}

.tab-chip i {
  font-size: 13px;
}

.close-mark {
  margin-left: 6px;
  font-size: 12px;
  color: #7ea1f2;
}

.content-wrap {
  flex: 1;
  min-height: 0;
  padding: 10px 10px 14px;
  position: relative;
  overflow: hidden;
}

.page-card {
  height: 100%;
  min-height: 0;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.page-card-head {
  min-height: 56px;
  padding: 0 18px 0 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #fff;
  position: relative;
  z-index: 3;
}

.page-head-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.page-title {
  font-size: 18px;
  font-weight: 700;
  color: #244b87;
  line-height: 1;
}

.page-title-sub {
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-sub);
  white-space: nowrap;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.icon-btn,
.btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 3px;
  border: 1px solid transparent;
  background: #fff;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  white-space: nowrap;
}

.icon-btn {
  width: 34px;
  padding: 0;
  border-color: var(--line-deep);
}

.icon-btn:hover,
.btn-default:hover,
.btn-secondary:hover,
.warehouse-selector:hover {
  border-color: #90adff;
  color: var(--brand);
}

.btn:active,
.icon-btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
}

.btn-default,
.btn-secondary {
  background: #fff;
  border-color: var(--line-deep);
  color: #30445d;
}

.warehouse-selector {
  min-width: 148px;
  justify-content: space-between;
  border-color: var(--line-deep);
}

.link-btn {
  text-decoration: none;
}

.sdms-top-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sdms-prd-entry,
.sdms-tool-btn,
.sdms-tool-user {
  position: relative;
  height: 26px;
  border: 1px solid #d7e0eb;
  border-radius: 999px;
  background: #fbfcfe;
  color: #5d6d81;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: none;
}

.sdms-prd-entry {
  padding: 0 10px;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  background: #f5f9ff;
  border-color: #cfe0ff;
}

.sdms-tool-btn {
  width: 26px;
  padding: 0;
}

.sdms-prd-entry i,
.sdms-tool-btn i,
.sdms-tool-user i {
  font-size: 13px;
}

.sdms-prd-entry:hover,
.sdms-tool-btn:hover,
.sdms-tool-user:hover {
  border-color: #90adff;
  color: var(--brand);
  background: #f5f9ff;
}

.sdms-tool-badge {
  position: absolute;
  top: -5px;
  right: -6px;
  min-width: 20px;
  height: 14px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
  border: 1px solid #f4f6f8;
  box-shadow: 0 2px 6px rgba(255, 90, 95, 0.18);
}

.sdms-tool-user {
  padding: 0 8px 0 4px;
}

.sdms-tool-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4d77ea 0%, #7d67ff 100%);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.sdms-tool-user-name {
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  color: var(--text-main);
}

.sdms-tool-user .ri-arrow-down-s-line {
  font-size: 12px;
  color: #7d8ea3;
}

@media (max-width: 1440px) {
  .page-title-sub {
    white-space: normal;
  }

  .sdms-top-tools {
    gap: 6px;
  }

  .sdms-tool-user-name {
    display: none;
  }

  .header-tabs.header-tabs-composed {
    gap: 8px;
  }
}
