:root {
  --bg: #eef2f7;
  --bg-elevated: #f7f9fc;
  --panel: #ffffff;
  --panel-alt: #f7f9fc;
  --line: #d8e0ec;
  --line-strong: #b7c3d6;
  --text: #1a2233;
  --muted: #7a8799;
  --muted-strong: #56657a;
  --rail: #1a2233;
  --rail-soft: #253149;
  --primary: #4f92ff;
  --primary-deep: #2d6fdd;
  --primary-soft: #eaf3ff;
  --success: #2f9e64;
  --warning: #d38b2d;
  --danger: #d34e43;
  --shadow: 0 14px 32px rgba(15, 31, 58, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
}

a {
  color: inherit;
}

.login-body,
.erp-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(79, 146, 255, 0.05), transparent 28%),
    linear-gradient(180deg, #f7f9fc 0%, #eef2f7 42%, #edf1f6 100%);
}

.erp-body {
  --erp-rail-width: 76px;
}

.eyebrow,
.section-tag,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-deep);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.login-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 44px 0;
}

.login-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
  gap: 24px;
  min-width: 720px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.login-copy,
.login-card,
.panel,
.page-toolbar {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-copy {
  padding: 32px;
  background:
    linear-gradient(145deg, rgba(28, 39, 57, 0.98), rgba(34, 49, 76, 0.96)),
    linear-gradient(180deg, #1a2233, #253149);
  color: #f3f7fd;
  overflow: hidden;
}

.login-copy h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.login-copy p {
  margin: 0;
  color: rgba(243, 247, 253, 0.8);
  line-height: 1.75;
  font-size: 14px;
}

.login-features {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.login-features article {
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
}

.login-features strong {
  display: block;
  margin-bottom: 8px;
  font-size: 17px;
}

.login-features span {
  color: rgba(243, 247, 253, 0.76);
  font-size: 13px;
  line-height: 1.7;
}

.login-card {
  padding: 28px;
  display: grid;
  gap: 16px;
  align-content: start;
}

.login-register-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
}

.login-register-line a {
  color: var(--primary-deep);
  text-decoration: none;
  font-weight: 700;
}

.login-card-head h2 {
  margin: 10px 0 8px;
  font-size: 28px;
  line-height: 1.1;
}

.login-card-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 13px;
}

.login-body {
  background: #0a1628;
  min-height: 100vh;
}

.login-shell-split {
  width: 100%;
  min-height: 100vh;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-stage-split {
  min-height: auto;
  display: grid;
  grid-template-columns: minmax(380px, 1fr) minmax(0, 480px);
  max-width: 960px;
  width: calc(100% - 32px);
  gap: 0;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.05);
  align-items: stretch;
}

.login-copy-split,
.login-card-split {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.login-copy-split {
  display: flex;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(79, 146, 255, 0.15), transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(79, 146, 255, 0.08), transparent 50%),
    linear-gradient(160deg, #0f1f3a 0%, #0a1628 100%);
  border-right: 1px solid rgba(255,255,255,0.06);
}

.lx-role-console {
  display: grid;
  /* 2026-07-12: 侧栏改双列(部门|角色), 需要更宽 */
  grid-template-columns: clamp(360px, 30vw, 460px) minmax(0, 1fr);
  gap: 12px;
  min-height: calc(100vh - 188px);
}

.lx-role-sidebar,
.lx-role-main {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.lx-role-sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.lx-role-sidebar-head {
  display: grid;
  gap: 10px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid #eef2f6;
}

.lx-role-sidebar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lx-role-sidebar-title h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.1;
  font-weight: 700;
  color: #151d29;
}

.lx-role-create-trigger {
  min-width: 72px;
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  box-shadow: none;
}

.lx-role-search-field .lx-search-field,
.lx-role-search-field {
  width: 100%;
}

.lx-role-search-field input {
  min-height: 32px;
  padding-left: 12px;
}

.lx-role-list {
  display: grid;
  align-content: start;
  gap: 3px;
  min-height: 0;
  max-height: calc(100vh - 244px);
  overflow: auto;
  padding: 8px 8px 10px;
}

.lx-role-node {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px;
  align-items: center;
  border-radius: 6px;
  background: transparent;
  min-width: 0;
  overflow: hidden;
}

.lx-role-node.active {
  background: #edf3ff;
}

.lx-role-node-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  min-height: 32px;
  padding: 0 8px;
  border: none;
  background: transparent;
  text-align: left;
  color: #2f3948;
  overflow: hidden;
}

.lx-role-node-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.lx-role-node-tags {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.lx-role-node-tags em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  padding: 0 5px;
  border: 1px solid rgba(79, 146, 255, 0.25);
  border-radius: 4px;
  background: rgba(234, 243, 255, 0.88);
  color: #2d6fdd;
  font-size: 10px;
  font-style: normal;
}

.lx-role-node-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-right: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.lx-role-node-actions .text-btn {
  font-size: 11px;
  font-weight: 600;
}

.lx-role-node-actions .text-btn:disabled {
  color: #a8b4c4;
  cursor: not-allowed;
  opacity: 1;
  transform: none;
}

.lx-role-main {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px 14px 14px;
  min-width: 0;
}

.lx-role-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(71, 125, 228, 0.36);
  border-radius: 6px;
  background: #eef5ff;
  color: #445872;
  font-size: 12px;
  line-height: 1.6;
}

.lx-role-notice[hidden] {
  display: none;
}

.lx-role-notice-close {
  border: none;
  background: transparent;
  color: #7d8da3;
  font-size: 12px;
  line-height: 1;
}

.lx-role-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 2px 2px 0;
}

.lx-role-context-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.lx-role-context-copy strong {
  color: #253345;
  font-size: 14px;
  line-height: 1.2;
}

.lx-role-context-copy span {
  color: #7a8799;
  font-size: 12px;
  line-height: 1.4;
}

.lx-role-context-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lx-role-main-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  padding: 0 2px;
  border-bottom: 1px solid #ebf0f6;
}

.lx-role-main-tabs button {
  min-height: 31px;
  padding: 0 16px;
  margin-bottom: -1px;
  border: 1px solid #e9edf3;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: #f5f7fb;
  color: #56657a;
  font-size: 12px;
}

.lx-role-main-tabs button.active {
  border-color: #d8e3f8;
  background: #ffffff;
  color: #1d63f0;
  font-weight: 700;
}

.lx-role-data-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lx-role-data-tabs button {
  min-height: 30px;
  padding: 0 14px;
  border: 1px solid #e3e8f1;
  border-radius: 6px;
  background: #f7f9fc;
  color: #59687d;
  font-size: 12px;
}

.lx-role-data-tabs button.active {
  border-color: #6ea2ff;
  background: #f4f8ff;
  color: #1d63f0;
  font-weight: 700;
}

.lx-role-view {
  display: none;
  gap: 12px;
}

.lx-role-view.active {
  display: grid;
}

.lx-role-members-toolbar {
  min-height: 44px;
  padding: 0 2px;
  border: none;
  background: transparent;
}

.lx-role-member-search {
  min-width: 208px;
}

.lx-role-members-table {
  min-width: 620px;
}

.lx-role-card {
  display: grid;
  gap: 12px;
  padding: 12px 14px 14px;
  border: 1px solid #eef2f6;
  border-radius: 8px;
  background: #fff;
}

.lx-role-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.lx-role-card-title {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  color: #232f3e;
  font-size: 13px;
}

.lx-role-platform-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lx-role-platform-tabs button {
  min-height: 30px;
  padding: 0 14px;
  border: 1px solid #d8e3f8;
  border-radius: 6px;
  background: #eef5ff;
  color: #1d63f0;
  font-size: 12px;
  font-weight: 700;
}

.lx-function-layout {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.lx-function-nav {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 8px 0;
}

.lx-function-nav button {
  min-height: 32px;
  padding: 0 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #49576b;
  text-align: left;
  font-size: 12px;
}

.lx-function-nav button.active {
  background: #edf3ff;
  color: #1d63f0;
  font-weight: 700;
}

.lx-function-table-shell {
  min-width: 0;
}

.lx-role-matrix-table {
  min-width: 760px;
}

.lx-role-matrix-table thead th {
  background: #f0f4fa;
}

.lx-role-check-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  color: #2e3b4d;
}

.lx-role-check-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  border: 1px solid #c6d0df;
  border-radius: 2px;
  appearance: none;
  background: #fff;
}

.lx-role-check-row input[type="checkbox"]:checked {
  border-color: #3b7cff;
  background: #3b7cff;
  box-shadow: inset 0 0 0 3px #ffffff;
}

.lx-role-radio-table {
  min-width: 700px;
}

.lx-role-radio-table thead th {
  background: #f8fafc;
}

.lx-role-radio-table th,
.lx-role-radio-table td {
  text-align: center;
}

.lx-role-radio-table th:first-child,
.lx-role-radio-table td:first-child,
.lx-role-radio-table th:nth-child(2),
.lx-role-radio-table td:nth-child(2) {
  text-align: left;
}

.lx-role-dot-choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 30px;
}

.lx-role-dot-choice input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.lx-role-dot-choice span {
  width: 15px;
  height: 15px;
  border: 1px solid #c6d0df;
  border-radius: 999px;
  background: #fff;
}

.lx-role-dot-choice input[type="radio"]:checked + span {
  border-color: #3b7cff;
  box-shadow: inset 0 0 0 4px #3b7cff;
}

.lx-role-data-card {
  gap: 14px;
}

.lx-role-data-content {
  display: grid;
  gap: 12px;
}

.lx-role-data-panel {
  display: grid;
  gap: 12px;
}

.lx-role-data-bullets {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 16px;
  color: #7a8698;
  font-size: 12px;
  line-height: 1.65;
}

.lx-role-data-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #1f2c3d;
  font-size: 13px;
  font-weight: 700;
}

.lx-role-data-title span {
  width: 3px;
  height: 18px;
  border-radius: 999px;
  background: #1d63f0;
}

.lx-role-data-copy {
  display: grid;
  gap: 4px;
  margin-left: 20px;
}

.lx-role-data-copy p {
  margin: 0;
  color: #7a8698;
  font-size: 12px;
  line-height: 1.7;
}

.lx-role-scope-grid {
  display: grid;
  gap: 12px;
  max-width: 820px;
  margin-left: 20px;
}

.lx-role-inline-field {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

.lx-role-inline-field > span {
  padding-top: 8px;
  color: #5e6c80;
  font-size: 12px;
}

.lx-role-inline-field select,
.lx-role-meta-form input,
.lx-role-meta-form textarea {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #d6dfeb;
  border-radius: 6px;
  background: #fff;
  color: #2b3a4e;
  font: inherit;
}

.lx-role-meta-form textarea {
  min-height: 108px;
  padding: 10px 12px;
  resize: vertical;
}

.lx-department-picker {
  border: 1px solid #d6dfeb;
  border-radius: 6px;
  background: #fff;
}

.lx-department-picker-toolbar {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid #eef2f6;
  background: #fafbfd;
}

.lx-department-picker-toolbar .lx-search-field input {
  min-height: 28px;
}

.lx-department-chip-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 52px;
  padding: 10px 12px;
}

.lx-department-chip-list.empty {
  color: #97a4b5;
  font-size: 12px;
}

.lx-department-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid #dde5f0;
  border-radius: 4px;
  background: #f6f9fc;
  color: #344358;
  font-size: 12px;
}

.lx-department-chip strong {
  color: #8fa0b6;
  font-size: 11px;
}

.lx-department-option-list {
  display: none;
  max-height: 188px;
  overflow: auto;
  border-top: 1px solid #eef2f6;
  padding: 4px 0;
}

.lx-department-option-list.active {
  display: grid;
}

.lx-department-option,
.lx-role-transfer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  color: #344358;
  font-size: 12px;
}

.lx-department-option:hover,
.lx-role-transfer-row:hover {
  background: #f7faff;
}

.lx-department-option input,
.lx-role-transfer-row input {
  width: 15px;
  height: 15px;
  margin: 0;
}

.lx-department-option-empty,
.lx-role-transfer-empty {
  padding: 12px;
  color: #97a4b5;
  font-size: 12px;
}

.lx-role-data-table-wrap {
  max-width: 860px;
  margin-left: 20px;
}

.lx-role-data-table {
  min-width: 540px;
}

.lx-role-data-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.lx-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lx-modal-close {
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #94a0b0;
  font-size: 14px;
  line-height: 1;
}

.lx-modal-close:hover {
  background: #f5f8fc;
  color: #305fb9;
}

.lx-modal-head h3 {
  margin: 0;
  font-size: 22px;
  color: #202c3c;
}

.lx-role-meta-dialog {
  width: min(560px, calc(100vw - 40px));
  display: grid;
  gap: 16px;
}

.lx-role-meta-form {
  display: grid;
  gap: 14px;
}

.lx-role-meta-form label {
  display: grid;
  gap: 8px;
}

.lx-role-meta-form label > span {
  color: #5c6a7d;
  font-size: 12px;
  font-weight: 600;
}

.lx-role-modal-actions {
  justify-content: flex-end;
}

.lx-role-transfer-dialog {
  display: grid;
  gap: 16px;
}

.lx-role-transfer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.lx-role-transfer-pane {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
}

.lx-role-transfer-title {
  color: #344358;
  font-size: 13px;
  font-weight: 600;
}

.lx-role-transfer-list {
  min-height: 380px;
  max-height: 540px;
  overflow: auto;
  border: 1px solid #d8e1eb;
  border-radius: 6px;
  background: #fff;
}

.lx-role-transfer-actions {
  display: grid;
  align-content: center;
  gap: 10px;
}

.lx-role-transfer-actions .ghost-btn {
  min-width: 42px;
  min-height: 30px;
  padding: 0;
}

.lx-role-console .mini-btn,
.lx-role-main .primary-btn,
.lx-role-main .ghost-btn,
.lx-role-main .text-btn,
.lx-role-transfer-dialog .primary-btn,
.lx-role-transfer-dialog .ghost-btn,
.lx-role-meta-dialog .primary-btn,
.lx-role-meta-dialog .ghost-btn {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

@media (max-width: 1200px) {
  .lx-role-console {
    grid-template-columns: clamp(340px, 34vw, 400px) minmax(0, 1fr);
  }

  .lx-function-layout {
    grid-template-columns: 96px minmax(0, 1fr);
  }
}

@media (max-width: 960px) {
  .lx-role-console,
  .lx-function-layout,
  .lx-role-transfer-grid {
    grid-template-columns: 1fr;
  }

  .lx-role-list {
    max-height: none;
  }

  .lx-role-main {
    padding: 12px;
  }

  .lx-role-scope-grid,
  .lx-role-data-table-wrap,
  .lx-role-data-copy {
    margin-left: 0;
  }
}

.login-copy-split::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(79, 146, 255, 0.08), transparent 50%);
  pointer-events: none;
}

.login-brand-stack,
.login-slogan-grid,
.login-copy-lead,
.login-visual {
  position: relative;
  z-index: 1;
}

.login-brand-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-brand-logo {
  height: 48px;
  width: auto;
  filter: brightness(1.1) drop-shadow(0 2px 8px rgba(79, 146, 255, 0.3));
}

.login-brand-name {
  color: #ffffff;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.login-slogan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, max-content));
  gap: 12px 28px;
  margin-top: 48px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.04em;
}

.login-slogan-grid span {
  position: relative;
  padding-left: 12px;
}

.login-slogan-grid span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(79, 146, 255, 0.6);
}

.login-copy-lead {
  max-width: 360px;
  margin: 32px 0 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  line-height: 1.7;
}

.login-visual {
  flex: 1;
  min-height: 200px;
  margin-top: 32px;
  display: flex;
  align-items: flex-end;
}

.login-visual-floor {
  display: none;
}

.login-visual-screen-frame {
  display: none;
}

.login-visual-screen {
  position: relative;
  left: auto;
  bottom: auto;
  width: 100%;
  height: 160px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  backdrop-filter: none;
  box-shadow: none;
  transform: none;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.login-visual-screen::before {
  display: none;
}

.login-screen-bars {
  position: static;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  width: auto;
  height: 80px;
}

.login-screen-bars .bar {
  width: 16px;
  flex: none;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #5b9cf5, #3d78d8);
  box-shadow: none;
  opacity: 0.7;
}

.login-screen-bars .bar-1 { height: 40%; }
.login-screen-bars .bar-2 { height: 58%; }
.login-screen-bars .bar-3 { height: 76%; }
.login-screen-bars .bar-4 { height: 95%; }

.login-screen-pie {
  position: static;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: conic-gradient(rgba(79,146,255,0.7) 0 42%, rgba(79,146,255,0.3) 42% 68%, rgba(255,255,255,0.08) 68% 100%);
  box-shadow: none;
}

.login-screen-lines {
  position: static;
  display: grid;
  gap: 8px;
  width: 80px;
}

.login-screen-lines .line {
  display: block;
  height: 4px;
  border-radius: 999px;
  background: rgba(79, 146, 255, 0.4);
}

.login-screen-lines .line-1 { width: 100%; }
.login-screen-lines .line-2 { width: 72%; }
.login-screen-lines .line-3 { width: 88%; }

.login-visual-console {
  display: none;
}

.console-screen {
  display: none;
}

.console-screen::before {
  display: none;
}

.login-visual-accent {
  display: none;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0;
  background: #ffffff;
}

.login-card-split {
  width: 100%;
  padding: 48px 44px;
  display: grid;
  gap: 22px;
  align-content: center;
  background: #ffffff;
  border-radius: 0;
  box-shadow: none;
}

.login-card-head-split {
  display: grid;
  gap: 6px;
  text-align: left;
}

.login-card-head-split .tag {
  width: max-content;
  margin: 0 0 4px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.login-card-head-split h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: #0f1f3a;
}

.login-card-head-split p {
  margin: 4px 0 0;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.5;
}

.login-field {
  gap: 5px;
}

.login-field span {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.login-field input {
  min-height: 48px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  box-shadow: none;
  font-size: 15px;
  padding: 0 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-field input:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 146, 255, 0.1);
  outline: none;
}

.login-submit-btn {
  min-height: 48px;
  margin-top: 4px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #4f92ff, #3d78d8);
  box-shadow: 0 4px 14px rgba(79, 146, 255, 0.25);
  transition: all 0.2s;
}

.login-submit-btn:hover {
  box-shadow: 0 6px 20px rgba(79, 146, 255, 0.35);
  transform: translateY(-1px);
}

.login-inline-message {
  width: 100%;
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.login-inline-message.is-visible {
  opacity: 1;
}

.login-inline-message.success {
  color: #1d9b5c;
}

.login-inline-message.error {
  color: #df4f67;
}

.login-inline-message.info {
  color: var(--muted);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
}

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

.field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

input,
select {
  min-height: 40px;
  padding: 0 12px;
}

textarea {
  min-height: 120px;
  padding: 12px;
  resize: vertical;
}

.multi-select {
  min-height: 176px;
  padding: 8px;
}

.multi-select option {
  padding: 8px 10px;
  border-radius: 6px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(79, 146, 255, 0.82);
  box-shadow: 0 0 0 3px rgba(79, 146, 255, 0.14);
}

.primary-btn,
.ghost-btn,
.danger-btn,
.text-btn {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition:
    border-color 120ms ease,
    background 120ms ease,
    color 120ms ease,
    transform 120ms ease,
    box-shadow 120ms ease;
}

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

.primary-btn {
  background: linear-gradient(180deg, var(--primary), var(--primary-deep));
  color: #fff;
  box-shadow: 0 10px 22px rgba(79, 146, 255, 0.2);
}

.ghost-btn {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}

.danger-btn {
  color: var(--danger);
  background: rgba(211, 78, 67, 0.08);
  border-color: rgba(211, 78, 67, 0.18);
}

.text-btn {
  min-height: auto;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--primary-deep);
}

.text-btn.danger {
  color: var(--danger);
}

.wide-btn {
  width: 100%;
}

.message-box {
  flex: 1 1 360px;
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-alt);
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.message-box.success {
  color: var(--success);
  border-color: rgba(47, 158, 100, 0.2);
  background: rgba(47, 158, 100, 0.08);
}

.message-box.error {
  color: var(--danger);
  border-color: rgba(211, 78, 67, 0.2);
  background: rgba(211, 78, 67, 0.08);
}

.message-box.muted {
  color: var(--muted);
  background: #f8fafc;
}

.message-box.is-plain-status {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.message-box.is-plain-status.muted,
.message-box.is-plain-status.info {
  background: transparent;
}

.app-shell-erp {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--erp-rail-width) minmax(0, 1fr);
  align-items: stretch;
}

.side-rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0;
  padding: 10px 4px 12px;
  background:
    linear-gradient(180deg, #1a2233 0%, #253149 50%, #1a2233 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  scrollbar-width: none;
}

.side-rail::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.rail-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 50px;
  margin: 0 auto;
  border-radius: 0;
  background: transparent;
  text-decoration: none;
  box-shadow: none;
}

.rail-brand-logo {
  display: block;
  width: 62px;
  height: auto;
  max-height: 30px;
  border-radius: 0;
  object-fit: contain;
  box-shadow: none;
  transition:
    transform 120ms ease,
    opacity 120ms ease;
}

.rail-brand:hover .rail-brand-logo {
  transform: translateY(-1px);
  opacity: 0.96;
}

.rail-brand-text,
.rail-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #f7fbff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.03em;
  white-space: nowrap;
  text-shadow: 0 1px 10px rgba(79, 146, 255, 0.12);
}

.rail-brand-text {
  position: relative;
  flex-direction: column;
  gap: 4px;
}

.rail-brand-text::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -2px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.12), rgba(127, 182, 255, 0.95), rgba(255, 255, 255, 0.12));
}

.rail-brand-text span {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
}

.brand-cn {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand-ai {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  opacity: 0.92;
  transform: translateX(1px);
}

.side-menu {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 4px;
}

.side-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 60px;
  padding: 10px 2px 9px;
  border-radius: 14px;
  color: #aeb8cb;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  transition:
    background 120ms ease,
    color 120ms ease,
    transform 120ms ease;
}

.side-link:hover {
  background: transparent;
  color: #f3f7fd;
}

.side-link.active {
  color: #ffffff;
}

.side-link.muted {
  color: #94a3ba;
}

.side-icon {
  display: block;
  position: relative;
  width: 16px;
  height: 16px;
  opacity: 0.92;
}

.side-icon::before,
.side-icon::after {
  content: "";
  position: absolute;
}

.side-icon-home::before {
  inset: 6px 2px 1px;
  border: 1.8px solid currentColor;
  border-top: none;
  border-radius: 2px 2px 3px 3px;
}

.side-icon-home::after {
  left: 2px;
  top: 2px;
  width: 11px;
  height: 11px;
  border-top: 1.8px solid currentColor;
  border-left: 1.8px solid currentColor;
  transform: rotate(45deg);
}

.side-icon-store::before {
  left: 2px;
  right: 2px;
  bottom: 2px;
  height: 7px;
  border: 1.8px solid currentColor;
  border-top: none;
  border-radius: 0 0 3px 3px;
}

.side-icon-store::after {
  left: 1px;
  top: 2px;
  width: 13px;
  height: 5px;
  border: 1.8px solid currentColor;
  border-bottom: none;
  border-radius: 3px 3px 0 0;
  background:
    linear-gradient(currentColor, currentColor) center 1px / 100% 1.8px no-repeat,
    linear-gradient(currentColor, currentColor) 4px 100% / 1.8px 5px no-repeat,
    linear-gradient(currentColor, currentColor) 9px 100% / 1.8px 5px no-repeat;
}

.side-icon-company::before {
  left: 2px;
  bottom: 1px;
  width: 12px;
  height: 12px;
  border: 1.8px solid currentColor;
  border-radius: 2px;
  background:
    linear-gradient(currentColor, currentColor) 3px 3px / 2px 2px no-repeat,
    linear-gradient(currentColor, currentColor) 7px 3px / 2px 2px no-repeat,
    linear-gradient(currentColor, currentColor) 3px 7px / 2px 2px no-repeat,
    linear-gradient(currentColor, currentColor) 7px 7px / 2px 2px no-repeat;
}

.side-icon-company::after {
  left: 6px;
  bottom: 1px;
  width: 3px;
  height: 5px;
  border: 1.8px solid currentColor;
  border-bottom: none;
  border-radius: 2px 2px 0 0;
  background: #1a2233;
}

.side-icon-report::before {
  inset: 2px 1px 1px 2px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-radius: 2px;
}

.side-icon-report::after {
  left: 4px;
  bottom: 3px;
  width: 2px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  box-shadow:
    4px -2px 0 0 currentColor,
    7px -4px 0 0 currentColor;
}

.side-icon-replenishment::before {
  inset: 1px;
  border: 1.8px solid currentColor;
  border-radius: 4px;
  background:
    linear-gradient(currentColor, currentColor) center 3px / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) center 6px / 8px 2px no-repeat;
}

.side-icon-replenishment::after {
  left: 4px;
  top: 7px;
  width: 6px;
  height: 3px;
  border-left: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: rotate(-45deg);
}

.side-icon-selection::before {
  left: 2px;
  top: 2px;
  width: 11px;
  height: 11px;
  border: 1.8px solid currentColor;
  border-radius: 3px;
}

.side-icon-selection::after {
  left: 4px;
  top: 4px;
  width: 6px;
  height: 6px;
  background:
    linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat;
  transform: rotate(45deg);
}

.side-icon-brand::before {
  left: 2px;
  top: 2px;
  width: 10px;
  height: 10px;
  border: 1.8px solid currentColor;
  border-radius: 3px;
  transform: rotate(45deg);
}

.side-icon-brand::after {
  left: 6px;
  top: 6px;
  width: 3px;
  height: 3px;
  border: 1.4px solid currentColor;
  border-radius: 999px;
  background: #1a2233;
}

.side-icon-images::before {
  left: 1px;
  top: 2px;
  width: 13px;
  height: 10px;
  border: 1.8px solid currentColor;
  border-radius: 3px;
}

.side-icon-images::after {
  left: 3px;
  top: 5px;
  width: 9px;
  height: 5px;
  background:
    radial-gradient(circle at 7px 1px, currentColor 0 1.4px, transparent 1.5px),
    linear-gradient(140deg, transparent 0 28%, currentColor 29% 63%, transparent 64%),
    linear-gradient(40deg, transparent 0 18%, currentColor 19% 55%, transparent 56%);
}

.side-icon-ads::before {
  left: 2px;
  bottom: 2px;
  width: 2px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  box-shadow:
    4px -2px 0 0 currentColor,
    8px -5px 0 0 currentColor;
}

.side-icon-ads::after {
  left: 1px;
  top: 1px;
  width: 12px;
  height: 12px;
  border-left: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  border-radius: 0 0 0 3px;
}

.side-icon-finance::before {
  left: 1px;
  right: 1px;
  top: 2px;
  height: 11px;
  border: 1.8px solid currentColor;
  border-radius: 3px;
}

.side-icon-finance::after {
  left: 3px;
  right: 3px;
  top: 5px;
  height: 1.8px;
  background: currentColor;
  box-shadow: 0 4px 0 currentColor;
}

.side-icon-operations::before {
  left: 1px;
  top: 2px;
  width: 16px;
  height: 13px;
  border: 1.8px solid currentColor;
  border-radius: 3px;
}

.side-icon-operations::after {
  left: 4px;
  right: 4px;
  top: 5px;
  height: 1.8px;
  background: currentColor;
  box-shadow:
    0 4px 0 currentColor,
    0 8px 0 currentColor;
}

.side-icon-settings::before {
  inset: 3px;
  border: 1.8px solid currentColor;
  border-radius: 999px;
}

.side-icon-settings::after {
  inset: -1px;
  background:
    linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat,
    linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
  opacity: 0.72;
}

.side-label {
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
}

.side-icon-efficiency::before {
  left: 2px;
  top: 2px;
  width: 12px;
  height: 12px;
  border: 1.8px solid currentColor;
  border-radius: 3px;
  background:
    linear-gradient(currentColor, currentColor) 3px 4px / 6px 1.8px no-repeat,
    linear-gradient(currentColor, currentColor) 3px 7px / 7px 1.8px no-repeat,
    linear-gradient(currentColor, currentColor) 3px 10px / 4px 1.8px no-repeat;
}

.side-icon-efficiency::after {
  right: 0;
  top: 2px;
  width: 4px;
  height: 4px;
  border: 1.8px solid currentColor;
  border-radius: 999px;
  background: #1a2233;
}

/* ===== 二级栏目菜单 (secondary rail) — 现代化设计 v2 ===== */
.secondary-rail-overlay {
  position: fixed;
  inset: 0 auto 0 var(--erp-rail-width);
  z-index: 30;
  width: 172px;
  pointer-events: none;
}

.secondary-rail {
  position: absolute;
  top: 0;
  left: 0;
  width: 164px;
  height: 100vh;
  max-height: 100vh;
  padding: 22px 0 18px;
  background:
    linear-gradient(180deg, rgba(238, 242, 255, 0.4) 0%, #ffffff 60%);
  border-right: 1px solid #e4e8f1;
  box-shadow: 6px 0 18px rgba(99, 102, 241, 0.06);
  pointer-events: auto;
  opacity: 0;
  transform: translateX(-14px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.secondary-rail-open .secondary-rail {
  opacity: 1;
  transform: translateX(0);
}

.secondary-rail-scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 10px 20px;
  scrollbar-width: thin;
  scrollbar-color: #c7d2fe transparent;
}
.secondary-rail-scroll::-webkit-scrollbar { width: 4px; }
.secondary-rail-scroll::-webkit-scrollbar-track { background: transparent; }
.secondary-rail-scroll::-webkit-scrollbar-thumb {
  background: #c7d2fe; border-radius: 2px;
}

.secondary-group + .secondary-group {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #eef0f7;
}

.secondary-group h3 {
  margin: 0 0 8px;
  padding: 0 14px;
  color: #7d8aa5;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.secondary-links {
  display: grid;
  gap: 2px;
}

.secondary-link {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px 0 14px;
  border-radius: 7px;
  color: #4b5670;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background 130ms ease, color 130ms ease, transform 130ms ease;
}

.secondary-link::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: #6366f1;
  transition: transform 160ms ease;
}

.secondary-link span {
  display: inline-block;
  padding-left: 4px;
}

.secondary-link:hover {
  background: #f3f5fc;
  color: #2f3a4b;
  transform: translateX(1px);
}
.secondary-link:hover::before {
  transform: translateY(-50%) scaleY(0.55);
  background: #a5b4fc;
}

.secondary-link.active {
  background: linear-gradient(90deg, #eef2ff 0%, #f5f7ff 100%);
  color: #4338ca;
  font-weight: 700;
}
.secondary-link.active::before {
  transform: translateY(-50%) scaleY(1);
}
.secondary-link.active:hover {
  background: linear-gradient(90deg, #e0e7ff 0%, #eef2ff 100%);
  color: #3730a3;
}

.efficiency-stage {
  display: grid;
  gap: 16px;
}

.automation-hero-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.automation-hero-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.automation-hero-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
}

.automation-hero-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 13px;
}

.automation-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #f9fbff, #eef4fd);
}

.automation-tab-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.automation-tab-btn:hover {
  background: rgba(79, 146, 255, 0.08);
  color: var(--primary-deep);
  transform: translateY(-1px);
}

.automation-tab-btn.active {
  border-color: rgba(79, 146, 255, 0.22);
  background: linear-gradient(180deg, #ffffff, #f3f8ff);
  color: var(--primary-deep);
  box-shadow: 0 8px 18px rgba(79, 146, 255, 0.12);
}

.automation-tab-panel[hidden] {
  display: none;
}

.automation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.automation-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-deep);
  font-size: 12px;
  font-weight: 700;
}

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

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

.automation-settings-guide {
  display: grid;
  gap: 6px;
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid #b9d6ff;
  border-radius: 12px;
  background: #f3f8ff;
}

.automation-settings-guide strong {
  color: var(--primary-deep);
  font-size: 14px;
}

.automation-settings-guide p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.7;
}

.automation-settings-help {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.automation-settings-help article {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.automation-settings-help strong {
  color: var(--text);
  font-size: 13px;
}

.automation-settings-help p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.automation-advanced-settings {
  grid-column: 1 / -1;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.automation-advanced-settings summary {
  cursor: pointer;
  color: var(--primary-deep);
  font-size: 13px;
  font-weight: 800;
}

.automation-advanced-settings > .automation-form {
  margin-top: 14px;
}

.automation-inline-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.automation-inline-action .ghost-btn {
  min-height: 40px;
  white-space: nowrap;
}

.automation-token-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.automation-token-action .ghost-btn {
  min-height: 40px;
  white-space: nowrap;
}

.automation-history-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 16px;
  align-items: start;
}

.automation-feedback-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 16px;
  align-items: start;
}

.automation-history-list {
  display: grid;
  gap: 12px;
}

.automation-feedback-list {
  display: grid;
  gap: 12px;
}

.automation-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.automation-card:hover {
  border-color: var(--primary);
  box-shadow: 0 10px 22px rgba(79, 146, 255, 0.08);
}

.automation-card.active {
  border-color: var(--primary);
  box-shadow: 0 12px 24px rgba(79, 146, 255, 0.15);
  transform: translateY(-1px);
}

.automation-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.automation-card-head strong {
  display: block;
}

.automation-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}

.automation-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 10px;
  color: var(--muted-strong);
  font-size: 12px;
}

.automation-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #edf4ff;
  color: var(--primary-deep);
  font-size: 12px;
  font-weight: 700;
}

.automation-detail {
  display: grid;
  gap: 12px;
}

.automation-detail-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.automation-detail-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.automation-detail-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.automation-launch-feedback {
  display: grid;
  gap: 6px;
  margin: 12px 0 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbff, #eef5ff);
}

.automation-feedback-label {
  color: var(--primary-deep);
  font-size: 12px;
  font-weight: 700;
}

.automation-launch-feedback strong {
  font-size: 16px;
}

.automation-launch-feedback p {
  margin: 0;
  color: var(--muted-strong);
  line-height: 1.65;
  font-size: 13px;
}

.automation-code {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0f1729;
  color: #e6edf8;
  overflow: auto;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.automation-dynamic-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.automation-dynamic-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(160px, 2fr) auto;
  gap: 10px;
  align-items: center;
}

.automation-dynamic-row-wide {
  grid-template-columns: minmax(160px, 1fr) minmax(220px, 3fr) auto;
  align-items: start;
}

.automation-dynamic-row input,
.automation-dynamic-row textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  background: #fff;
}

.automation-dynamic-row textarea {
  resize: vertical;
  min-height: 56px;
}

.automation-detail-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.automation-detail-row {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.automation-detail-row strong {
  font-size: 13px;
  color: var(--text);
}

.automation-detail-row span {
  font-size: 12px;
  color: var(--muted);
  word-break: break-word;
}

.automation-detail-steps {
  margin: 8px 0 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.automation-detail-steps li strong {
  display: block;
  font-size: 13px;
  color: var(--text);
}

.automation-detail-steps li p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  white-space: pre-wrap;
}

.automation-badge-success {
  background: #e7f7ec;
  color: #16794a;
}

.automation-badge-danger {
  background: #fde7e7;
  color: #b32424;
}

.automation-badge-info {
  background: #e7f0ff;
  color: #2453d6;
}

.automation-badge-muted {
  background: #eef0f4;
  color: var(--muted);
}

.automation-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.automation-feedback-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 14px;
}

.automation-feedback-metric {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.automation-feedback-metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.automation-feedback-metric strong {
  display: block;
  margin-top: 6px;
  color: var(--primary-deep);
  font-size: 15px;
}

.automation-pager {
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
}

.efficiency-qa-stage {
  gap: 16px;
}

.qa-hero-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.qa-hero-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f7faff);
}

.qa-hero-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
}

.qa-hero-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 13px;
}

.qa-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.68fr);
  gap: 16px;
  align-items: start;
}

.qa-chat-panel,
.qa-side-panel {
  display: grid;
  gap: 14px;
}

.qa-chat-panel {
  min-height: 720px;
}

.qa-side-panel {
  align-self: stretch;
}

.qa-chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.qa-chat-header h3 {
  margin: 6px 0 6px;
}

.qa-chat-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.qa-chat-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.qa-chat-list {
  display: grid;
  gap: 12px;
  padding: 4px 2px 0;
  max-height: 520px;
  overflow: auto;
}

.qa-empty-state {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 28px;
  border: 1px dashed rgba(79, 146, 255, 0.2);
  border-radius: 16px;
  background: linear-gradient(180deg, #fafcff, #f2f7ff);
  text-align: center;
}

.qa-empty-state strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.qa-empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.qa-message {
  display: grid;
  gap: 6px;
}

.qa-message-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted-strong);
  font-size: 12px;
}

.qa-message-bubble {
  max-width: min(88%, 820px);
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  line-height: 1.8;
  white-space: normal;
  word-break: break-word;
}

.qa-message.user {
  justify-items: end;
}

.qa-message.user .qa-message-bubble {
  background: linear-gradient(180deg, #eaf2ff, #f8fbff);
  border-color: rgba(79, 146, 255, 0.18);
}

.qa-message.assistant .qa-message-bubble {
  background: #ffffff;
}

.qa-message.system .qa-message-bubble {
  background: #f8f9fc;
  color: var(--muted);
}

.qa-message-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.qa-message-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  background: #edf4ff;
  color: var(--primary-deep);
  font-size: 11px;
  font-weight: 700;
}

.qa-message-meta .watch {
  background: #fff3dc;
  color: #996200;
}

.qa-message-meta .active {
  background: #e9f8ee;
  color: #1e7a3c;
}

.qa-composer {
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.qa-composer-main {
  display: grid;
  gap: 10px;
}

.qa-composer textarea {
  width: 100%;
  min-height: 86px;
  resize: vertical;
}

.qa-composer-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.qa-context-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 12px;
  color: var(--muted-strong);
}

.qa-context-switch input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #2d6fdd;
}

.qa-context-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.qa-context-panel[hidden] {
  display: none;
}

.qa-model-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.qa-model-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-deep);
  font-size: 12px;
  font-weight: 700;
}

.qa-quick-head {
  margin-top: 4px;
}

.qa-quick-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.qa-quick-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted-strong);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.qa-quick-chip:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 18px rgba(79, 146, 255, 0.08);
  transform: translateY(-1px);
}

.qa-model-row {
  display: grid;
  gap: 8px;
}

.qa-model-field {
  min-width: 0;
}

.qa-model-field select,
.qa-input-panel textarea {
  width: 100%;
}

.qa-model-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.qa-model-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-deep);
  font-size: 12px;
  font-weight: 700;
}

.qa-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.qa-answer-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.qa-answer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.qa-answer-head strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.qa-answer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.qa-answer-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #edf4ff;
  color: var(--primary-deep);
  font-size: 12px;
  font-weight: 700;
}

.qa-answer-meta .watch {
  background: #fff3dc;
  color: #996200;
}

.qa-answer-meta .active {
  background: #e9f8ee;
  color: #1e7a3c;
}

.qa-answer-body {
  margin-top: 14px;
  line-height: 1.8;
  color: var(--text);
  white-space: normal;
}

.qa-answer-body.empty-block {
  color: var(--muted);
}

.qa-recent-list {
  display: grid;
  gap: 12px;
}

.qa-recent-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.qa-recent-card:hover {
  border-color: var(--primary);
  box-shadow: 0 10px 22px rgba(79, 146, 255, 0.08);
  transform: translateY(-1px);
}

.qa-recent-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.qa-recent-head strong {
  display: block;
  font-size: 14px;
}

.qa-recent-head span {
  color: var(--muted-strong);
  font-size: 12px;
  white-space: nowrap;
}

.qa-recent-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 13px;
}

.qa-recent-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 10px;
  color: var(--muted-strong);
  font-size: 12px;
}

.workspace-shell {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  background: var(--bg);
}

.workspace-tabbar {
  display: flex;
  align-items: flex-end;
  align-self: flex-end;
  gap: 0;
  flex: 1 1 auto;
  min-height: 40px;
  padding: 0 8px 0 14px;
  background: transparent;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  border-radius: 0;
}

.workspace-history-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  min-height: 31px;
  margin-top: 5px;
  padding: 0 20px;
  border: none;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 140ms ease;
}

.workspace-history-tab:not(.active):hover {
  background: transparent;
  color: rgba(255, 255, 255, 0.96);
}

.workspace-history-title {
  display: inline-flex;
  align-items: center;
}

.workspace-history-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #bac4d4;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, color 120ms ease;
}

.workspace-history-tab:hover .workspace-history-close,
.workspace-history-tab.active .workspace-history-close {
  opacity: 1;
  pointer-events: auto;
}

.workspace-history-close:hover {
  background: transparent;
  color: #8d98ac;
}

.workspace-history-tab.active {
  background: #ffffff;
  color: #1e2430;
  box-shadow: none;
  margin-bottom: 0;
  z-index: 3;
}

.workspace-history-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: #ffffff;
  pointer-events: none;
}

.workspace-tabbar::-webkit-scrollbar {
  display: none;
}

.workspace-history-tab.active .workspace-history-close {
  color: #b6c0d0;
}

.workspace-tabbar-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  position: relative;
  width: 42px;
  min-height: 31px;
  margin-top: 5px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: color 120ms ease;
}

.workspace-tabbar-add::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 1px;
  background: rgba(255, 255, 255, 0.18);
}

.workspace-tabbar-add:hover {
  color: #ffffff;
  background: transparent;
}

.workspace-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px 0 0;
  background: linear-gradient(135deg, #253149 0%, #1a2233 100%);
  border-bottom: none;
}

.workspace-bar::after {
  display: none;
}

.workspace-user {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: nowrap;
}

.workspace-status-message {
  flex: 0 1 220px;
  min-width: 0;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-status-message:empty {
  display: none;
}

.workspace-mini-btn {
  min-height: 28px;
  height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.workspace-mini-link {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.workspace-mini-link:hover {
  background: #f4f8fd;
  color: var(--primary-deep);
}

.workspace-mini-link.active {
  background: #edf4ff;
  color: var(--primary-deep);
}

.workspace-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #d8dee8;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 800;
}

.workspace-user-copy {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 190px;
  overflow: hidden;
}

.workspace-user-copy strong {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-user-copy small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-user-link {
  color: inherit;
}

.workspace-user-link:hover {
  color: var(--primary-deep);
}

.toolbar-logout {
  min-width: 52px;
  min-height: 28px;
  height: 28px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
  word-break: keep-all;
}

.content-shell {
  display: grid;
  gap: 0;
  padding: 0 18px 18px;
  min-width: 0;
  min-height: 0;
}

.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px;
}

.page-toolbar-copy {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.page-toolbar-copy strong {
  font-size: 19px;
  line-height: 1.1;
  white-space: nowrap;
}

.hero-description {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.utility-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-alt);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.utility-link {
  color: var(--primary-deep);
}

.page-content,
.report-stage {
  display: grid;
  gap: 16px;
  min-width: 0;
  align-content: start;
  min-height: 0;
}

.report-stage {
  gap: 10px;
  height: 100%;
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: stretch;
}

.panel {
  padding: 16px;
}

.section-head,
.dashboard-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-head h3,
.dashboard-toolbar h3 {
  margin: 4px 0 0;
  font-size: 17px;
  line-height: 1.15;
}

.section-head p,
.dashboard-toolbar p {
  margin: 0;
  max-width: 620px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.filter-grid,
.form-grid {
  display: grid;
  gap: 12px;
}

.filter-grid {
  grid-template-columns: repeat(5, minmax(112px, 1fr)) minmax(220px, 1.4fr);
}

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

.field-keyword {
  min-width: 0;
}

.filter-actions,
.connector-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.compact-report-panel {
  padding: 10px 12px;
  overflow: visible;
}

.report-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e8edf5;
  margin-bottom: 4px;
}

.report-toolbar-actions .toolbar-popover {
  margin-left: 0;
}

.report-toolbar-strip {
  display: flex;
  align-items: center;
  gap: 10px 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 0;
  -webkit-overflow-scrolling: touch;
}

.toolbar-tag {
  flex: 0 0 auto;
  margin-bottom: 0;
}

.toolbar-updated-at {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid #d6dcf6;
  border-radius: 12px;
  background: linear-gradient(180deg, #f4f6ff 0%, #eef1ff 100%);
  color: #5e6ad2;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.toolbar-updated-at.is-empty {
  border-color: #f0d8a8;
  background: linear-gradient(180deg, #fffaf0 0%, #fff4e0 100%);
  color: #b07a16;
}

.toolbar-inline-field {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid #e8edf5;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fafe 100%);
  flex-wrap: wrap;
}

.toolbar-inline-field > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.toolbar-inline-field input,
.toolbar-inline-field select {
  min-width: 136px;
  min-height: 36px;
  padding: 0 11px;
  font-size: 13px;
  border-radius: 10px;
  background: #fff;
}

.toolbar-inline-date-range {
  min-width: 0;
}

.field-date-range {
  display: grid;
  gap: 8px;
}

.date-range-picker {
  position: relative;
  display: inline-flex;
  min-width: 0;
  width: fit-content;
  max-width: 100%;
}

.date-range-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: fit-content;
  min-width: 0;
  min-height: 36px;
  padding: 0 11px 0 13px;
  border: 1px solid #9aaece;
  border-radius: 10px;
  background: #fff;
  color: #1f2f46;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
}


/* 统一所有页面日期范围筛选框尺寸，避免和普通筛选框高度/宽度不一致 */
.toolbar-inline-field .date-range-picker,
.field-date-range .date-range-picker,
.date-range-picker {
  align-items: center;
}

.date-range-trigger {
  box-sizing: border-box;
  height: 36px;
  min-height: 36px;
  line-height: 34px;
}

.toolbar-inline-field .date-range-trigger,
.toolbar-inline-date-range .date-range-trigger,
.field-date-range .date-range-trigger {
  height: 36px;
  min-height: 36px;
}

.date-range-trigger-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 400;
  font-size: 13px;
}

.date-range-trigger-caret {
  position: relative;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.date-range-trigger-caret::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 2px solid #97a7bc;
  border-radius: 4px;
}

.date-range-trigger-caret::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: 6px;
  border-top: 2px solid #97a7bc;
}

.date-range-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 1000;
  display: grid;
  align-items: start;
  grid-template-columns: 74px minmax(540px, 1fr);
  width: min(760px, calc(100vw - 20px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(21, 39, 63, 0.09);
  overflow: auto;
}

.date-range-popover[hidden],
.store-dropdown-panel[hidden],
.column-settings-panel[hidden],
.report-field-filter-section[hidden],
.secondary-rail-overlay[hidden] {
  display: none !important;
}

.date-range-shortcuts {
  display: grid;
  gap: 2px;
  align-content: start;
  padding: 6px 4px;
  background: #fff;
  border-right: 1px solid #e4edf7;
}

.date-range-shortcut {
  min-height: 28px;
  padding: 0 8px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #43566f;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}

.date-range-shortcut:hover,
.date-range-shortcut.active {
  background: #eaf3ff;
  color: var(--primary-deep);
  font-weight: 700;
}

.date-range-panel {
  display: grid;
  align-self: start;
}

.date-range-calendars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.date-range-calendar-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 4px;
  padding: 6px 8px 4px;
  border-bottom: 1px solid #eef3f9;
}

.date-range-calendar-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.date-range-title-select select {
  min-width: 68px;
  height: 28px;
  padding: 0 22px 0 8px;
  border: 1px solid #d8e3f0;
  border-radius: 7px;
  background-position: right 8px center;
  background-size: 9px;
  color: #253a59;
  font-size: 12px;
  font-weight: 700;
}

.date-range-title-select-month select {
  min-width: 56px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.date-range-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.date-range-nav-right {
  justify-content: flex-end;
}

.date-range-nav-btn,
.date-range-nav-spacer {
  width: 20px;
  height: 20px;
}

.date-range-nav-btn {
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #7b8ca3;
  font-size: 15px;
  cursor: pointer;
}

.date-range-nav-btn:hover {
  background: #edf4ff;
  color: var(--primary-deep);
}

.date-range-weekdays,
.date-range-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  padding: 0 8px;
}

.date-range-weekdays {
  padding-top: 4px;
  padding-bottom: 2px;
}

.date-range-weekdays span {
  text-align: center;
  color: #6c7f97;
  font-size: 11px;
  font-weight: 700;
}

.date-range-grid {
  padding-bottom: 6px;
}

.date-range-day {
  min-height: 32px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #263955;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.date-range-day:hover {
  background: #eef3fb;
}

.date-range-day.muted {
  color: #b0bccd;
}

.date-range-day.in-range {
  background: #eef2f8;
}

.date-range-day.is-start,
.date-range-day.is-end {
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
}

.lx-date-range-picker {
  min-width: 0;
}

.date-range-calendar + .date-range-calendar {
  border-left: 1px solid #eef3f9;
}

@media (max-width: 1100px) {
  .date-range-popover {
    grid-template-columns: 1fr;
    width: min(700px, calc(100vw - 20px));
  }

  .date-range-shortcuts {
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    border-right: none;
    border-bottom: 1px solid #e4edf7;
  }
}

.toolbar-inline-field input::placeholder {
  font-size: 13px;
}

.toolbar-inline-mini select {
  min-width: 94px;
}

.toolbar-inline-mini {
  min-width: 148px;
}

.toolbar-inline-mid select {
  min-width: 110px;
  max-width: 148px;
}

.toolbar-inline-mid {
  min-width: 166px;
}

.toolbar-inline-store {
  width: 276px;
  min-width: 276px;
}

.toolbar-inline-product input {
  min-width: 148px;
  max-width: 188px;
}

.toolbar-inline-product {
  min-width: 236px;
}

.stores-directory-toolbar {
  gap: 8px;
}

.stores-directory-toolbar .toolbar-inline-field input,
.stores-directory-toolbar .toolbar-inline-field select {
  min-width: 108px;
}

.stores-directory-toolbar .stores-toolbar-input {
  min-width: 188px;
}

.stores-directory-toolbar .stores-toolbar-input input {
  min-width: 132px;
  max-width: 188px;
}

.stores-directory-toolbar .stores-toolbar-search {
  min-width: 256px;
}

.stores-directory-toolbar .stores-toolbar-search input {
  min-width: 176px;
  max-width: 232px;
}

.stores-directory-toolbar .ghost-btn,
.stores-directory-toolbar .primary-btn {
  min-height: 36px;
}

.listing-toolbar {
  gap: 8px;
}

.listing-toolbar .toolbar-inline-field input,
.listing-toolbar .toolbar-inline-field select {
  min-width: 104px;
}

.listing-toolbar .listing-toolbar-input {
  min-width: 188px;
}

.listing-toolbar .listing-toolbar-input input {
  min-width: 128px;
  max-width: 186px;
}

.listing-toolbar .listing-toolbar-search {
  min-width: 264px;
}

.listing-toolbar .listing-toolbar-search input {
  min-width: 176px;
  max-width: 236px;
}

.listing-column-settings-shell {
  position: relative;
}

.forecast-toolbar-strip {
  gap: 8px;
}

.toolbar-inline-copy-field {
  min-width: 188px;
  max-width: 260px;
}

.toolbar-inline-copy-field .toolbar-inline-copy {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 600;
}

.forecast-toolbar-strip .toolbar-inline-store {
  width: 248px;
  min-width: 248px;
}

.forecast-toolbar-strip .toolbar-inline-mini {
  min-width: 138px;
}

.forecast-toolbar-strip .toolbar-inline-sm {
  min-width: 154px;
}

.forecast-toolbar-strip .toolbar-inline-field input,
.forecast-toolbar-strip .toolbar-inline-field select {
  min-width: 104px;
}

.forecast-toolbar-strip .toolbar-inline-product {
  min-width: 228px;
}

.forecast-toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

.dashboard-store-pill {
  min-width: 0;
  width: fit-content;
}

.dashboard-date-field {
  min-width: 0;
  width: fit-content;
}

.dashboard-date-field .date-range-picker {
  min-width: 0;
  width: fit-content;
}

.dashboard-date-field .date-range-trigger {
  min-height: 36px;
  padding: 0 11px 0 13px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 400;
}

.dashboard-date-field .date-range-trigger-value {
  font-size: 13px;
  font-weight: 400;
}

.dashboard-date-field .date-range-trigger-caret {
  width: 18px;
  height: 18px;
}

.dashboard-store-pill .toolbar-select-btn {
  width: 228px;
  min-width: 228px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 400;
}

.home-module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.module-snapshot-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid #e2e9f3;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(249, 251, 255, 0.98), rgba(245, 248, 253, 0.96));
}

.module-snapshot-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.module-snapshot-card strong {
  color: var(--text);
  font-size: 24px;
  line-height: 1.1;
}

.module-snapshot-card p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.7;
}

.home-todo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.home-todo-column {
  display: grid;
  gap: 12px;
  min-height: 280px;
  padding: 16px;
  border: 1px solid #e2e9f3;
  border-radius: 16px;
  background: #fbfdff;
}

.home-todo-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.home-todo-column header strong {
  font-size: 15px;
}

.home-todo-column header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.store-dropdown {
  position: relative;
}

.store-dropdown.is-open {
  z-index: 80;
}

.toolbar-select-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 220px;
  min-width: 220px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
}

.toolbar-inline-store .toolbar-select-btn,
.toolbar-inline-store .store-dropdown {
  width: 100%;
  min-width: 0;
}

.toolbar-inline-store .store-dropdown {
  flex: 1 1 auto;
}

.toolbar-inline-store .toolbar-select-btn {
  width: 100%;
  min-width: 0;
}

.toolbar-select-btn:hover {
  border-color: var(--line-strong);
}

.toolbar-select-btn span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
}

.toolbar-caret {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-top: -5px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 120ms ease, margin-top 120ms ease;
}

.toolbar-select-static {
  justify-content: flex-start;
  cursor: default;
}

.store-dropdown.is-open .toolbar-caret {
  margin-top: 2px;
  transform: rotate(-135deg);
}

.store-dropdown-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 260px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  z-index: 1000;
}

.store-dropdown-search input {
  min-height: 32px;
}

.store-dropdown-list {
  display: grid;
  gap: 4px;
  max-height: 248px;
  margin-top: 6px;
  overflow: auto;
}

.store-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border-radius: 8px;
  background: var(--panel-alt);
  cursor: pointer;
}

.store-option:hover {
  background: #eef5ff;
}

.store-option input {
  appearance: auto;
  -webkit-appearance: checkbox;
  display: inline-block;
  flex: 0 0 16px;
  width: 16px;
  min-width: 16px;
  max-width: 16px;
  height: 16px;
  min-height: 16px;
  max-height: 16px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  accent-color: var(--primary-deep);
  vertical-align: middle;
}

.store-option-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.store-option-copy strong {
  font-size: 11px;
  line-height: 1.25;
}

.store-option-copy small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.inventory-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-card {
  min-height: 88px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.summary-card strong {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.summary-card span {
  display: block;
  margin-top: 12px;
  font-size: 30px;
  line-height: 1;
  font-weight: 700;
  color: var(--text);
}

.summary-card-primary {
  box-shadow: inset 4px 0 0 #5b97ff, var(--shadow);
}

.summary-card-success {
  box-shadow: inset 4px 0 0 #2faa69, var(--shadow);
}

.summary-card-warning {
  box-shadow: inset 4px 0 0 #3b7cff, var(--shadow);
}

.summary-card-info {
  box-shadow: inset 4px 0 0 #31a7c8, var(--shadow);
}

.inventory-table-panel {
  gap: 8px;
}

.inventory-message-inline {
  margin-bottom: 4px;
}

.store-dropdown-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.store-dropdown-footer-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.store-confirm-btn {
  min-height: 26px;
  padding: 0 9px;
  font-size: 11px;
  box-shadow: none;
}

.store-dropdown-empty {
  padding: 14px 10px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.toolbar-action-btn {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 8px;
}

.toolbar-spacer {
  flex: 1 1 auto;
}

.toolbar-popover {
  position: relative;
  flex: 0 0 auto;
  margin-left: auto;
}

.icon-btn {
  width: 32px;
  min-width: 32px;
  padding: 0;
  font-size: 16px;
  line-height: 1;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  display: block;
  margin: 0 auto;
}

.ai-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0 12px;
  white-space: nowrap;
}

.ai-action-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 20px;
  height: 18px;
  padding: 0 4px;
  border-radius: 5px;
  background: #eaf3ff;
  color: #1d63f0;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
}

.ai-action-text {
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.column-settings-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 392px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  z-index: 1000;
}

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

.column-settings-head strong {
  font-size: 12px;
}

.column-settings-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.column-settings-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  max-height: 300px;
  overflow: auto;
}

.column-settings-section {
  display: grid;
  gap: 8px;
}

.column-settings-section + .column-settings-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.column-settings-section-head {
  display: grid;
  gap: 4px;
}

.column-settings-section-head strong {
  font-size: 12px;
}

.column-settings-section-head span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.metric-settings-list {
  max-height: 200px;
}

.column-settings-option {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 5px 6px;
  border-radius: 8px;
  background: var(--panel-alt);
  font-size: 11px;
}

.column-settings-option input {
  width: 15px;
  min-height: 15px;
  margin: 0;
}

.column-settings-option span {
  font-size: 11px;
  line-height: 1.35;
}

/* 拖拽排序手柄 */
.column-drag-handle {
  cursor: grab;
  user-select: none;
  font-size: 14px;
  line-height: 1;
  color: var(--text-muted, #999);
  padding: 0 2px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.column-drag-handle:hover {
  color: var(--text-primary, #333);
}
.column-drag-handle:active {
  cursor: grabbing;
}

/* 拖拽中的列 */
.column-settings-option.dragging {
  opacity: 0.5;
}

/* 拖拽悬停目标 */
.column-settings-option.drag-over {
  outline: 2px dashed var(--primary, #4f6ef7);
  outline-offset: -2px;
  background: var(--primary-light, rgba(79, 110, 247, 0.08));
}

.column-settings-label {
  flex: 1;
  min-width: 0;
}

.toolbar-message {
  flex: 1 0 100%;
  min-width: 0;
  margin-left: 0;
  margin-top: 4px;
  padding: 7px 10px;
  font-size: 11px;
  line-height: 1.4;
  border-radius: 10px;
}

/* 工具栏小字: 最近同步时间 + 同步范围 (SC 经营报表 / FBA V2 / SKU V2 都用) */
.sync-info-text {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  color: #94a3b8;
  white-space: nowrap;
  padding: 0 6px;
  line-height: 1.4;
}
.sync-info-text:empty {
  display: none;
}

.report-field-filter-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #edf2f7;
}

.field-filter-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
}

.field-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.field-filter-head strong {
  font-size: 13px;
}

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

.field-filter-item {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 6px;
  border: 1px solid #e7edf6;
  border-radius: 10px;
  background: linear-gradient(180deg, #fbfdff 0%, #f5f8fc 100%);
}

.field-filter-item span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.field-filter-item input {
  min-height: 28px;
  padding: 0 8px;
  font-size: 11px;
  border-radius: 8px;
}


.report-toolbar-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.dashboard-hero-grid,
.dashboard-main-grid,
.dashboard-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.95fr);
  gap: 12px;
}

.dashboard-hero-grid-single,
.dashboard-main-grid-single {
  grid-template-columns: 1fr;
}

.dashboard-side-stack {
  display: grid;
  gap: 12px;
}

.dashboard-hero-card {
  position: relative;
  overflow: hidden;
}

.dashboard-overview-card {
  background:
    radial-gradient(circle at top right, rgba(69, 122, 255, 0.16), transparent 26%),
    linear-gradient(180deg, #fbfdff 0%, #f5f8ff 100%);
}

.dashboard-ai-card {
  background:
    radial-gradient(circle at top left, rgba(22, 163, 74, 0.14), transparent 24%),
    linear-gradient(180deg, #fbfefb 0%, #f4fbf6 100%);
}

.dashboard-hero-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.dashboard-hero-head h2 {
  margin: 6px 0 0;
  font-size: 21px;
  line-height: 1.08;
}

.dashboard-scope-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #d7e5fb;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #45607f;
  font-size: 12px;
  font-weight: 700;
}

.dashboard-executive-summary,
.dashboard-ai-brief,
.dashboard-signal-list,
.dashboard-action-list {
  display: grid;
  gap: 10px;
}

.dashboard-summary-copy strong,
.dashboard-ai-brief-main strong {
  display: block;
  font-size: 17px;
  line-height: 1.25;
}

.dashboard-summary-copy p,
.dashboard-ai-brief-main p {
  margin: 8px 0 0;
  color: var(--muted-strong);
  font-size: 11.5px;
  line-height: 1.5;
}

.dashboard-summary-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(134px, 1fr));
  gap: 8px;
}

.dashboard-mini-metric {
  padding: 10px 12px;
  border: 1px solid #dce7f6;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
}

.dashboard-mini-metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-mini-metric strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
  line-height: 1;
}

.dashboard-ai-points {
  display: grid;
  gap: 10px;
}

.dashboard-ai-point,
.dashboard-signal-card {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
}

.dashboard-ai-point span,
.dashboard-signal-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-ai-point strong,
.dashboard-signal-head strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  line-height: 1.45;
}

.dashboard-ai-point.good,
.dashboard-signal-card.good {
  border-color: rgba(22, 163, 74, 0.24);
  background: linear-gradient(180deg, rgba(240, 253, 244, 0.96), rgba(255, 255, 255, 0.96));
}

.dashboard-ai-point.warn,
.dashboard-signal-card.warn {
  border-color: rgba(217, 119, 6, 0.22);
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.96), rgba(255, 255, 255, 0.96));
}

.dashboard-ai-point.danger,
.dashboard-signal-card.danger {
  border-color: rgba(220, 38, 38, 0.18);
  background: linear-gradient(180deg, rgba(254, 242, 242, 0.96), rgba(255, 255, 255, 0.96));
}

.dashboard-signal-card p {
  margin: 8px 0 0;
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.7;
}

.dashboard-action-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #d7e5fb;
  background: linear-gradient(180deg, #f9fbff, #f4f8ff);
}

.dashboard-action-box-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.dashboard-action-box-head strong {
  font-size: 14px;
}

.dashboard-action-box-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-action-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.dashboard-action-item span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #e8f0ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-action-item p {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 11.5px;
  line-height: 1.45;
}

.dashboard-bi-hero-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.9fr);
}

.dashboard-decision-card {
  background:
    radial-gradient(circle at top right, rgba(244, 166, 42, 0.16), transparent 28%),
    linear-gradient(180deg, #fffdf8 0%, #fff8ed 100%);
}

.dashboard-decision-list,
.dashboard-risk-list,
.dashboard-ranked-list {
  display: grid;
  gap: 8px;
}

.dashboard-decision-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
}

.dashboard-decision-item > span,
.dashboard-ranked-index {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #e8f0ff;
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
}

.dashboard-decision-item strong {
  display: block;
  font-size: 13px;
  line-height: 1.3;
}

.dashboard-decision-item p {
  margin: 4px 0 0;
  color: var(--muted-strong);
  font-size: 11.5px;
  line-height: 1.45;
}

.dashboard-decision-item b {
  align-self: start;
  padding: 5px 8px;
  border-radius: 999px;
  background: #f1f5fb;
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
}

.dashboard-decision-item.good,
.dashboard-risk-card.good,
.dashboard-insight-card.good {
  border-color: rgba(22, 163, 74, 0.22);
  background: linear-gradient(180deg, rgba(240, 253, 244, 0.96), rgba(255, 255, 255, 0.96));
}

.dashboard-decision-item.warn,
.dashboard-risk-card.warn,
.dashboard-insight-card.warn {
  border-color: rgba(217, 119, 6, 0.22);
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.96), rgba(255, 255, 255, 0.96));
}

.dashboard-decision-item.danger,
.dashboard-risk-card.danger,
.dashboard-insight-card.danger {
  border-color: rgba(220, 38, 38, 0.2);
  background: linear-gradient(180deg, rgba(254, 242, 242, 0.96), rgba(255, 255, 255, 0.96));
}

.dashboard-insight-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-insight-card {
  min-height: 128px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.dashboard-insight-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-insight-card strong {
  display: block;
  margin: 8px 0 6px;
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.dashboard-insight-card p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 11px;
  line-height: 1.4;
}

.dashboard-risk-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-alt);
}

.dashboard-risk-card div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.dashboard-risk-card strong {
  font-size: 13px;
}

.dashboard-risk-card span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-risk-card p {
  margin: 8px 0 0;
  color: var(--muted-strong);
  font-size: 11.5px;
  line-height: 1.45;
}

.dashboard-ranked-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) minmax(210px, 0.9fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-alt);
}

.dashboard-ranked-copy strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-ranked-copy p {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-ranked-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.dashboard-ranked-metrics span {
  padding: 3px 6px;
  border-radius: 999px;
  background: #fff;
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 700;
}

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

.dashboard-todo-grid {
  grid-template-columns: 1fr;
}

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

.report-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  align-items: start;
}

.report-ai-summary-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  background:
    radial-gradient(circle at top right, rgba(79, 146, 255, 0.12), transparent 24%),
    linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
}

.report-ai-summary-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.report-ai-summary-head strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
  line-height: 1.1;
}

.report-ai-summary-head p {
  margin: 0;
  max-width: 480px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  text-align: right;
}

.report-ai-summary-content {
  display: grid;
  gap: 12px;
}

.report-ai-summary-meta {
  display: block;
}

.ai-scope-shell {
  display: grid;
  gap: 12px;
}

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

.ai-scope-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(201, 212, 225, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}

.ai-scope-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.ai-scope-card strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.report-ai-drawer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(72vw, calc(100vw - 24px));
}

.report-ai-drawer[hidden] {
  display: none;
}

.report-ai-drawer-backdrop {
  background: rgba(19, 31, 49, 0.18);
}

.report-ai-drawer-panel {
  height: 100vh;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 24px 26px 32px;
  border-left: 1px solid rgba(205, 216, 230, 0.92);
  background:
    radial-gradient(circle at top right, rgba(79, 146, 255, 0.12), transparent 24%),
    linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
  box-shadow: -20px 0 50px rgba(17, 31, 54, 0.16);
}

.report-ai-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.report-ai-drawer-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.report-ai-drawer-head strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
  line-height: 1.1;
}

.report-ai-drawer-intro {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.ai-analysis-meta-line {
  margin: -4px 0 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.ai-analysis-meta-line span {
  display: block;
}

.ai-analysis-meta-line.is-warning {
  color: #4f92ff;
}

.ai-analysis-meta-line.is-error {
  color: #b64b42;
}

.ai-analysis-empty {
  display: grid;
  gap: 10px;
  padding: 22px 24px;
  border-radius: 18px;
  border: 1px solid rgba(220, 104, 92, 0.18);
  background: linear-gradient(180deg, #fffefe 0%, #fff8f7 100%);
}

.ai-analysis-empty strong {
  font-size: 22px;
  line-height: 1.25;
  color: #24364e;
}

.ai-analysis-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.ai-report-hero-panel {
  gap: 18px;
}

.ai-report-hero-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.ai-report-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(0, 1.18fr);
  gap: 18px;
  align-items: start;
}

.ai-report-form-panel,
.ai-report-output-panel {
  display: grid;
  gap: 18px;
}

.ai-report-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-report-output-block {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.ai-report-output-block > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.ai-report-output-block > header strong {
  font-size: 15px;
}

.ai-report-output-block > header span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ai-report-summary-card {
  padding: 14px 16px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(79, 146, 255, 0.16);
}

.ai-report-summary-card p,
.ai-report-signal-card p,
.ai-report-action-card p {
  margin: 0;
  color: #425268;
  line-height: 1.7;
}

.ai-report-chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.ai-report-signal-card,
.ai-report-action-card {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.ai-report-action-list {
  display: grid;
  gap: 12px;
}

.ai-report-action-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-report-action-head strong {
  font-size: 14px;
  line-height: 1.5;
}

.ai-report-action-head span,
.ai-report-action-card small,
.ai-report-board-card p {
  color: var(--muted);
}

.ai-report-board-card {
  gap: 8px;
}

.ai-report-board-card b {
  font-size: 22px;
  color: #183153;
  line-height: 1.1;
}

.ai-summary-status {
  display: inline-grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
}

.ai-summary-status strong {
  font-size: 12px;
  line-height: 1.4;
}

.ai-summary-status span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.ai-summary-status.is-pending {
  border-color: rgba(79, 146, 255, 0.26);
}

.ai-summary-status.is-model {
  border-color: rgba(47, 158, 100, 0.24);
}

.ai-summary-status.is-fallback {
  border-color: rgba(211, 139, 45, 0.26);
}

.ai-summary-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 12px;
  padding: 22px 24px;
  border-radius: 20px;
  border: 1px solid rgba(45, 111, 221, 0.14);
  background:
    linear-gradient(135deg, rgba(22, 50, 92, 0.98), rgba(34, 73, 129, 0.95)),
    linear-gradient(180deg, #213a63, #2b548d);
  color: #f4f8ff;
}

.ai-summary-hero.is-pending {
  border-color: rgba(90, 153, 255, 0.28);
}

.ai-summary-pending-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ai-summary-pending-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.95);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.ai-summary-pending-badge i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8bd0ff;
  box-shadow: 0 0 0 rgba(139, 208, 255, 0.6);
  animation: aiPulse 1.6s ease-in-out infinite;
}

.ai-summary-pending-clock {
  color: rgba(244, 248, 255, 0.8);
  font-size: 13px;
  line-height: 1.6;
}

.ai-summary-pending-clock b {
  color: #ffffff;
  font-size: 15px;
}

.ai-summary-pending-steps {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ai-summary-pending-steps span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-weight: 700;
}

.ai-summary-pending-steps span.is-active {
  background: rgba(139, 208, 255, 0.16);
  border: 1px solid rgba(139, 208, 255, 0.22);
}

.ai-summary-hero::after {
  content: "";
  position: absolute;
  inset: auto -40px -50px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 68%);
  pointer-events: none;
}

.ai-summary-eyebrow {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  padding: 0 10px;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ai-summary-hero strong {
  position: relative;
  z-index: 1;
  font-size: clamp(24px, 2.4vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ai-summary-hero p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(244, 248, 255, 0.72);
  font-size: 15px;
  line-height: 1.7;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

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

.ai-summary-card {
  display: grid;
  gap: 10px;
  min-height: 100%;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.ai-summary-card-head span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--panel-alt);
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.ai-summary-card ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.ai-summary-card li,
.ai-summary-card p {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.8;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ai-summary-card.navy {
  border-color: rgba(79, 146, 255, 0.22);
}

.ai-summary-card.green {
  border-color: rgba(47, 158, 100, 0.22);
}

.ai-summary-card.amber {
  border-color: rgba(211, 139, 45, 0.26);
}

.ai-summary-card.rose {
  border-color: rgba(211, 78, 67, 0.2);
}

.report-ai-diagnostics,
.report-ai-rankings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.ai-diagnostic-panel,
.ai-ranking-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  align-content: start;
  align-self: start;
  min-width: 0;
}

.ai-diagnostic-list,
.ai-ranking-list {
  display: grid;
  gap: 10px;
  align-content: start;
}

.ai-diagnostic-item,
.ai-ranking-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: var(--panel-alt);
  border: 1px solid rgba(201, 212, 225, 0.7);
  min-width: 0;
}

.ai-diagnostic-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.ai-diagnostic-main strong,
.ai-ranking-head strong {
  font-size: 16px;
  line-height: 1.5;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ai-ranking-copy strong {
  display: -webkit-box;
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.ai-diagnostic-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.ai-diagnostic-item p,
.ai-ranking-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}

.ai-ranking-copy p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ai-diagnostic-metrics,
.ai-ranking-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.ai-diagnostic-metrics span,
.ai-ranking-metrics span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #fff;
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 700;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  line-height: 1.45;
  text-align: left;
}

.ai-ranking-item {
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-areas:
    "index copy"
    ". metrics";
  column-gap: 12px;
  row-gap: 10px;
  align-items: start;
}

.ai-ranking-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
  grid-area: index;
  flex-shrink: 0;
}

@keyframes aiPulse {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(139, 208, 255, 0.55);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(139, 208, 255, 0);
  }
  100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(139, 208, 255, 0);
  }
}

.ai-ranking-copy {
  display: grid;
  gap: 6px;
  grid-area: copy;
  min-width: 0;
}

.ai-ranking-metrics {
  grid-area: metrics;
}

.ai-ranking-head,
.ai-diagnostic-head {
  min-width: 0;
}

.ai-ranking-panel.navy {
  border-color: rgba(79, 146, 255, 0.22);
}

.ai-ranking-panel.green {
  border-color: rgba(47, 158, 100, 0.22);
}

.ai-ranking-panel.amber {
  border-color: rgba(211, 139, 45, 0.26);
}

.ai-ranking-panel.rose {
  border-color: rgba(211, 78, 67, 0.2);
}

.kpi-grid {
  display: grid;
  gap: 6px;
}

.kpi-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 98px;
  padding: 12px 11px 12px 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  align-self: start;
}

.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--card-accent, var(--primary));
}

.kpi-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.kpi-card strong {
  display: block;
  margin: 8px 0 0;
  font-size: clamp(16px, 1.45vw, 22px);
  line-height: 1;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.asin-link {
  display: inline-block;
  max-width: 100%;
  color: var(--primary-deep);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.asin-link:hover {
  text-decoration: underline;
}

.kpi-card.navy {
  --card-accent: #4f92ff;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.kpi-card.green {
  --card-accent: #2f9e64;
  background: linear-gradient(180deg, #ffffff 0%, #f5fcf8 100%);
}

.kpi-card.amber {
  --card-accent: #d38b2d;
  background: linear-gradient(180deg, #ffffff 0%, #fff9f1 100%);
}

.kpi-card.rose {
  --card-accent: #d66a7f;
  background: linear-gradient(180deg, #ffffff 0%, #fff6f8 100%);
}

.kpi-card.teal {
  --card-accent: #2c9fb0;
  background: linear-gradient(180deg, #ffffff 0%, #f4fbfc 100%);
}

.kpi-card.slate {
  --card-accent: #7a8da8;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
}

.trend-panel {
  display: grid;
  gap: 14px;
}

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

.trend-stat-card {
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-alt);
}

.trend-stat-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.trend-stat-card strong {
  display: block;
  margin: 8px 0 6px;
  font-size: clamp(24px, 2.3vw, 32px);
  line-height: 1;
  letter-spacing: -0.03em;
}

.trend-stat-card p,
.metric-caption {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.metric-delta {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  margin-top: 8px;
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.metric-delta.positive {
  color: var(--success);
}

.metric-delta.negative {
  color: var(--danger);
}

.metric-delta.neutral {
  color: var(--muted);
}

.trend-chart {
  min-height: 360px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(79, 146, 255, 0.03), rgba(79, 146, 255, 0) 36%),
    #fff;
}

.trend-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.trend-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
}

.trend-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.92);
}

.trend-chart-shell {
  display: grid;
  gap: 10px;
}

.chart-svg {
  width: 100%;
  height: 320px;
  display: block;
}

.chart-caption-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 8px;
}

.chart-caption {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  font-weight: 700;
}

.chart-empty {
  display: grid;
  place-items: center;
  min-height: 280px;
  border-radius: 10px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 13px;
  background: #fbfdff;
}

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

.dimension-panel,
.status-card,
.mapping-hint,
.empty-block,
.batch-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-alt);
}

.dimension-panel {
  padding: 14px;
}

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

.dimension-panel h4 {
  margin: 0;
  font-size: 16px;
}

.dimension-panel header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dimension-list {
  display: grid;
  gap: 10px;
}

.dimension-row {
  display: grid;
  gap: 6px;
}

.dimension-row-head,
.dimension-row-meta,
.status-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.dimension-row-head strong {
  font-size: 13px;
  line-height: 1.45;
}

.dimension-row-head span,
.dimension-row-meta span,
.status-line span {
  color: var(--muted);
  font-size: 12px;
}

.dimension-row-meta strong,
.status-line strong {
  font-size: 12px;
  font-weight: 700;
}

.dimension-bar {
  height: 8px;
  border-radius: 999px;
  background: #e9eff6;
  overflow: hidden;
}

.dimension-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f92ff, #78b0ff);
}

.report-tip-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.report-tip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f4f8fd;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 600;
}

.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.check-pill input {
  width: 16px;
  min-height: 16px;
  margin: 0;
}

.connector-form {
  display: grid;
  gap: 14px;
}

.status-card {
  margin-top: 14px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.status-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.mapping-hint {
  padding: 14px 16px;
}

.mapping-hint summary {
  cursor: pointer;
  font-weight: 700;
}

.mapping-hint p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.batch-list {
  display: grid;
  gap: 12px;
}

.batch-card {
  padding: 14px;
}

.batch-main strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
}

.batch-main span,
.batch-meta span {
  color: var(--muted);
  font-size: 12px;
}

.batch-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 10px 0 14px;
}

.batch-actions {
  display: flex;
  justify-content: flex-end;
}

.table-wrap {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.data-table {
  width: max(100%, 1200px);
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  line-height: 1.55;
  white-space: nowrap;
  background: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f7fafc;
  color: var(--muted-strong);
  font-weight: 700;
}

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

.data-table tbody tr.summary-row td {
  background: #f6faff;
  font-weight: 700;
}

.ranking-table {
  width: max(100%, 1020px);
}

.replenishment-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 16px;
}

.replenishment-ai-grid {
  align-items: start;
}

.replenishment-row-ai-panel {
  min-height: 100%;
}

.replenishment-row-ai-shell {
  display: grid;
  gap: 14px;
}

.replenishment-module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.module-hero-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.module-hero-card strong {
  display: block;
  font-size: 16px;
}

.module-hero-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.toolbar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.import-inline-form input[type="text"],
.import-inline-form select {
  min-height: 38px;
}

.table-input {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  color: inherit;
}

.table-textarea {
  min-height: 62px;
  resize: vertical;
}

.check-cell {
  text-align: center;
}

.check-cell input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.import-preview {
  max-width: 420px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.6;
}

.table-empty-cell {
  padding: 28px 14px !important;
  text-align: center !important;
  color: var(--muted);
}

.logistics-import-form,
.carrier-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.logistics-import-form {
  margin-bottom: 14px;
}

.logistics-toolbar-panel {
  overflow: visible;
}

.logistics-modal-meta {
  margin-bottom: 16px;
}

.logistics-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.logistics-overview-card {
  padding: 18px;
  border: 1px solid #d8e5f5;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
}

.logistics-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.logistics-card-head h3 {
  margin: 4px 0 0;
  font-size: 18px;
}

.logistics-import-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 0;
}

.logistics-import-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.logistics-selected-file {
  min-height: 42px;
  padding: 11px 14px;
  border: 1px dashed #cdd9ee;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.4;
  word-break: break-all;
}

.logistics-rules-entry-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.logistics-rules-entry-btn {
  min-width: 120px;
}

.logistics-head.compact {
  margin-bottom: 12px;
}

.compact-meta {
  color: var(--muted);
  font-size: 13px;
}

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

.logistics-summary-card {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.logistics-summary-card span,
.logistics-summary-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.logistics-summary-card strong {
  font-size: 28px;
  line-height: 1;
  color: #184986;
}

.logistics-filter-bar {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid #e8edf5;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fafe 100%);
}

.logistics-filter-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) repeat(4, minmax(112px, 1fr));
  gap: 6px;
}

.logistics-search-field input {
  min-width: 0;
}

.logistics-filter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.logistics-inline-check {
  min-height: 32px;
}

.logistics-rule-summary {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.logistics-rule-summary-modal {
  margin-bottom: 18px;
}

.logistics-channel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.logistics-channel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.logistics-channel-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.logistics-channel-tab {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #d7e3f5;
  border-radius: 999px;
  background: #fff;
  color: var(--muted-strong);
  cursor: pointer;
}

.logistics-channel-tab.active {
  border-color: #7fa9df;
  background: #eaf3ff;
  color: #174a8b;
}

.logistics-total-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100%;
  padding: 18px;
  border: 1px solid #d8e5f5;
  border-radius: 16px;
  background: linear-gradient(180deg, #fafcff 0%, #f3f8ff 100%);
}

.logistics-total-card strong {
  font-size: 28px;
  color: #174a8b;
  line-height: 1;
}

.logistics-total-card small {
  color: var(--muted);
  line-height: 1.6;
}

.logistics-stage-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.logistics-stage-chip {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 220px;
  padding: 14px;
  border: 1px solid #d7e3f5;
  border-radius: 16px;
  background: #fbfdff;
}

.logistics-stage-chip-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.logistics-stage-chip-input {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.logistics-stage-chip-input em {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.logistics-stage-chip-input input {
  width: 100%;
}

.logistics-stage-chip-input input {
  max-width: 100px;
}

.logistics-stage-chip-tip {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.logistics-table-wrap {
  max-height: calc(100vh - 430px);
}

.logistics-data-table {
  width: max(100%, 2050px);
}

.logistics-data-table td,
.logistics-data-table th {
  max-width: none;
  vertical-align: top;
}

.logistics-data-table th:nth-child(1),
.logistics-data-table td:nth-child(1) {
  min-width: 150px;
}

.logistics-data-table th:nth-child(2),
.logistics-data-table td:nth-child(2),
.logistics-data-table th:nth-child(3),
.logistics-data-table td:nth-child(3),
.logistics-data-table th:nth-child(4),
.logistics-data-table td:nth-child(4),
.logistics-data-table th:nth-child(5),
.logistics-data-table td:nth-child(5),
.logistics-data-table th:nth-child(6),
.logistics-data-table td:nth-child(6),
.logistics-data-table th:nth-child(7),
.logistics-data-table td:nth-child(7) {
  min-width: 220px;
}

.logistics-data-table th:nth-child(8),
.logistics-data-table td:nth-child(8),
.logistics-data-table th:nth-child(9),
.logistics-data-table td:nth-child(9) {
  min-width: 170px;
}

.logistics-data-table th:nth-child(10),
.logistics-data-table td:nth-child(10) {
  min-width: 290px;
}

.logistics-data-row.is-exception td {
  background: rgba(255, 248, 244, 0.88);
}

.logistics-data-row.is-signed td {
  background: rgba(247, 251, 255, 0.72);
}

.logistics-cell-stack {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.logistics-cell-stack strong,
.logistics-cell-stack p,
.logistics-followup-cell small {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.logistics-cell-stack strong {
  font-size: 14px;
  line-height: 1.55;
}

.logistics-cell-stack p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.logistics-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.logistics-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  padding: 0 8px;
  border-radius: 999px;
  background: #fff;
  color: var(--muted-strong);
  border: 1px solid rgba(205, 217, 236, 0.9);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.logistics-chip.info {
  background: rgba(79, 146, 255, 0.1);
  color: #215ea7;
  border-color: rgba(79, 146, 255, 0.16);
}

.logistics-chip.warning {
  background: rgba(233, 169, 57, 0.12);
  color: #4f92ff;
  border-color: rgba(233, 169, 57, 0.16);
}

.logistics-chip.danger {
  background: rgba(219, 95, 82, 0.1);
  color: #b45146;
  border-color: rgba(219, 95, 82, 0.16);
}

.logistics-chip.success {
  background: rgba(47, 158, 100, 0.1);
  color: #1f8b58;
  border-color: rgba(47, 158, 100, 0.16);
}

.logistics-chip.slate {
  background: rgba(111, 129, 151, 0.1);
  color: #5b6d84;
  border-color: rgba(111, 129, 151, 0.16);
}

.logistics-inline-select {
  width: 100%;
  min-height: 40px;
  padding-right: 34px;
}

.logistics-followup-cell {
  display: grid;
  gap: 8px;
}

.logistics-followup-note {
  min-height: 92px;
  resize: vertical;
}

.logistics-followup-cell small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.carrier-toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-select,
.filter-input {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  color: inherit;
  font-size: 12px;
}

.filter-input {
  min-width: 180px;
}

.carrier-summary-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.carrier-summary-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.carrier-summary-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.carrier-summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  color: var(--text);
}

.carrier-table-wrap {
  max-height: calc(100vh - 360px);
}

.carrier-data-table {
  width: max(100%, 1440px);
}

.carrier-action-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.text-btn-danger,
.ghost-btn-danger {
  color: #c94f4f;
}

.is-row-deleting td {
  background: #fff7f8 !important;
  color: #9f5d69;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.replenishment-status-board {
  display: grid;
  gap: 10px;
}

.replenishment-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.replenishment-status-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.replenishment-status-card strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  line-height: 1;
}

.replenishment-status-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.replenishment-status-card.critical {
  background: linear-gradient(180deg, #fff7f8 0%, #fff 100%);
}

.replenishment-status-card.urgent {
  background: linear-gradient(180deg, #fff9f1 0%, #fff 100%);
}

.replenishment-status-card.watch {
  background: linear-gradient(180deg, #f7fbff 0%, #fff 100%);
}

.replenishment-status-card.healthy {
  background: linear-gradient(180deg, #f5fcf8 0%, #fff 100%);
}

.replenishment-table-wrap {
  height: calc(100vh - 386px);
}

.replenishment-table {
  width: max(100%, 1460px);
}

.replenishment-table tr.is-active td {
  background: rgba(79, 146, 255, 0.05);
}

.replenishment-qty-cell {
  color: var(--primary-deep);
  font-weight: 700;
}

.replenishment-ai-row-btn {
  white-space: nowrap;
}

/* ---------- 补货建议 v2 (重写) ---------- */
.replenishment-stage-v2 .replenishment-grid-v2 {
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
}

.replenishment-action-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.replenishment-action-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  position: relative;
  overflow: hidden;
}

.replenishment-action-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: rgba(120, 130, 150, 0.35);
}

.replenishment-action-card.critical::before { background: #ef5b6b; }
.replenishment-action-card.urgent::before { background: #f0a23a; }
.replenishment-action-card.watch::before { background: #4f92ff; }
.replenishment-action-card.healthy::before { background: #2faa6a; }

.replenishment-action-card.critical { background: linear-gradient(180deg, #fff7f8 0%, #fff 80%); }
.replenishment-action-card.urgent { background: linear-gradient(180deg, #fff9f1 0%, #fff 80%); }

.replenishment-action-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.replenishment-action-head strong {
  font-size: 14px;
  line-height: 1.35;
  color: var(--ink);
}

.replenishment-action-head small {
  color: var(--muted);
  font-size: 12px;
}

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

.replenishment-action-grid div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.replenishment-action-grid dt {
  font-size: 11px;
  color: var(--muted);
}

.replenishment-action-grid dd {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.replenishment-action-foot {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}

.replenishment-strategy-compare-grid {
  display: grid;
  gap: 10px;
}

.strategy-compare-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.strategy-compare-card:hover {
  border-color: rgba(79, 146, 255, 0.5);
  box-shadow: 0 4px 14px rgba(79, 146, 255, 0.12);
}

.strategy-compare-card.is-active {
  border-color: var(--primary);
  background: linear-gradient(180deg, #eef6ff 0%, #fff 100%);
  box-shadow: 0 6px 20px rgba(79, 146, 255, 0.18);
}

.strategy-compare-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.strategy-compare-card header span {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.strategy-active-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
}

.strategy-compare-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 8px;
}

.strategy-compare-card dl div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.strategy-compare-card dl dt {
  font-size: 11px;
  color: var(--muted);
}

.strategy-compare-card dl dd {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.strategy-compare-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.replenishment-status-board-v2,
.replenishment-site-pressure {
  display: grid;
  gap: 10px;
}

.status-distribution-row,
.site-pressure-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  display: grid;
  gap: 6px;
}

.status-distribution-row header,
.site-pressure-row header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.status-distribution-row strong,
.site-pressure-row strong {
  font-size: 14px;
  color: var(--ink);
}

.status-distribution-row span,
.site-pressure-row header span {
  font-size: 12px;
  color: var(--muted);
}

.status-distribution-row small {
  color: var(--muted);
  font-size: 12px;
}

.site-pressure-row footer {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.distribution-bar {
  height: 6px;
  background: rgba(120, 130, 150, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.distribution-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f92ff 0%, #76b4ff 100%);
  transition: width 0.4s ease;
}

.status-distribution-row.critical .distribution-bar span { background: linear-gradient(90deg, #ef5b6b 0%, #f37b88 100%); }
.status-distribution-row.urgent .distribution-bar span { background: linear-gradient(90deg, #f0a23a 0%, #f5be6c 100%); }
.status-distribution-row.watch .distribution-bar span { background: linear-gradient(90deg, #4f92ff 0%, #76b4ff 100%); }
.status-distribution-row.healthy .distribution-bar span { background: linear-gradient(90deg, #2faa6a 0%, #5ec48d 100%); }

.distribution-bar.amber span { background: linear-gradient(90deg, #f0a23a 0%, #f5be6c 100%); }

@media (max-width: 768px) {
  .replenishment-stage-v2 .replenishment-grid-v2 {
    grid-template-columns: 1fr;
  }
  .replenishment-action-list {
    grid-template-columns: 1fr;
  }
  .strategy-compare-card dl {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.critical {
  background: #fff1f4;
  color: #c94b68;
}

.status-pill.urgent {
  background: #fff5e6;
  color: #2d6fdd;
}

.status-pill.watch {
  background: #edf5ff;
  color: #3e7bcb;
}

.status-pill.healthy {
  background: #edf9f1;
  color: #278455;
}

.status-pill.is-add {
  background: #eaf3ff;
  color: #2c6bd9;
}

.status-pill.is-edit {
  background: #fff5e6;
  color: #2d6fdd;
}

.status-pill.is-delete {
  background: #fff1f4;
  color: #c94b68;
}

.status-pill.is-confirm {
  background: #edf9f1;
  color: #278455;
}

.report-panel,
.report-table-shell,
.report-table-wrap {
  min-width: 0;
}

.report-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 8px;
}

.report-table-shell {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #fafcff 0%, #f4f8fd 100%);
}

.report-table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
}

.report-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px 5px;
  border-top: 1px solid rgba(207, 215, 230, 0.75);
}

.report-pager-summary,
.report-pager-state {
  color: #6d7a90;
  font-size: 12px;
  white-space: nowrap;
}

.report-pager-controls,
.report-page-size-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-page-size-field {
  color: #6d7a90;
  font-size: 12px;
}

.report-page-size-field input {
  width: 72px;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid #cfd7e6;
  border-radius: 8px;
  background: #fff;
  color: #1f2f46;
  font-size: 12px;
}

@media (max-width: 900px) {
  .report-pager,
  .report-pager-controls {
    align-items: flex-start;
    flex-direction: column;
  }
}

.report-table th:first-child,
.report-table td:first-child {
  position: sticky;
  left: 0;
}

.report-table thead th:first-child {
  z-index: 5;
}

.report-table tbody td:first-child {
  z-index: 2;
  background: #fbfdff;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .logistics-overview-grid {
    grid-template-columns: 1fr;
  }

  .logistics-rule-summary {
    grid-template-columns: 1fr;
  }
}

.report-table-wrap {
  position: relative;
  flex: 1 1 auto;
  max-width: 100%;
  height: calc(100vh - 274px);
  min-height: 520px;
  max-height: none;
  overflow: auto;
  border: none;
  padding-bottom: 6px;
  scrollbar-gutter: stable both-edges;
}

/* 2026-05-14 数据表横/竖滚动条加粗 — 用户反馈细滚动条难看到, 全局拉粗到 16px,
   thumb 用更深的稳重色 + 边框 1px (而不是 3px), 视觉上不会"消失". 同时覆盖
   .table-wrap / .data-page-table-shell / .compact-table-wrap 等其它常见容器. */
.report-table-wrap,
.table-wrap,
.data-page-table-shell,
.compact-table-wrap {
  scrollbar-width: auto;                         /* Firefox: 用宽款滚动条 */
  scrollbar-color: #64748b #e2e8f0;              /* Firefox: thumb / track */
}
.report-table-wrap::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.data-page-table-shell::-webkit-scrollbar,
.compact-table-wrap::-webkit-scrollbar {
  width: 16px;
  height: 16px;
}
.report-table-wrap::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
.data-page-table-shell::-webkit-scrollbar-thumb,
.compact-table-wrap::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #94a3b8;                            /* slate-400, 比之前 rgba 50% 透明深 */
  border: 1px solid transparent;
  background-clip: padding-box;
  min-height: 40px;                               /* 滚动 thumb 不至于短到点不中 */
  min-width: 40px;
}
.report-table-wrap::-webkit-scrollbar-thumb:hover,
.table-wrap::-webkit-scrollbar-thumb:hover,
.data-page-table-shell::-webkit-scrollbar-thumb:hover,
.compact-table-wrap::-webkit-scrollbar-thumb:hover {
  background: #475569;                            /* slate-600, 悬停更深 */
}
.report-table-wrap::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track,
.data-page-table-shell::-webkit-scrollbar-track,
.compact-table-wrap::-webkit-scrollbar-track {
  background: #e2e8f0;                            /* slate-200, 比之前 rgba 60% 透明深 */
  border-radius: 4px;
}

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

.stores-overview-main {
  grid-column: 1 / -1;
}

.store-company-principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.store-company-principle {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.store-company-principle span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #ecf4ff;
  color: #2f5f9e;
  font-size: 11px;
  font-weight: 700;
}

.store-company-principle h3 {
  margin: 14px 0 8px;
  font-size: 20px;
}

.store-company-principle p {
  margin: 0;
  color: var(--muted-strong);
  line-height: 1.7;
}

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

.brands-overview-main {
  grid-column: 1 / -1;
}

.brand-compliance-overview-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.brand-compliance-overview-main {
  grid-column: 1 / -1;
}

.stores-directory-table .table-input,
.stores-groups-table .table-input {
  min-width: 88px;
}

.brands-directory-table .table-input,
.companies-directory-table .table-input,
.companies-tax-table .table-input,
.companies-erp-table .table-input,
.brands-matrix-table .table-input,
.brands-coverage-table .table-input,
.brands-health-table .table-input,
.brand-compliance-records-table .table-input {
  min-width: 92px;
}

.stores-ownership-table .table-input,
.stores-health-table .table-input {
  min-width: 88px;
}

.stores-ownership-editor-panel .report-toolbar-strip {
  align-items: center;
}

.stores-ownership-editor-table .check-cell {
  width: 54px;
  text-align: center;
}

.stores-ownership-editor-table tbody tr.is-selected-row td {
  background: #f5faff;
}

.stores-ownership-editor-table tbody tr.is-selected-row td:first-child {
  background: #eef6ff;
}

.stores-directory-table .table-textarea {
  min-width: 180px;
  min-height: 34px;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eff5fb;
  color: #46607d;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.store-badge.is-active {
  background: #edf9f1;
  color: #278455;
}

.store-badge.is-key {
  background: #fff4df;
  color: #2d6fdd;
}

.store-badge.is-warn {
  background: #fff6e8;
  color: #2d6fdd;
}

.store-badge.is-alert {
  background: #ffedf0;
  color: #c33d55;
}

.store-badge.is-muted {
  background: #f3f6fa;
  color: #7b8ca3;
}

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

.store-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 150px;
}

.store-stack.compact {
  min-width: 120px;
}

.store-stack span {
  color: #6a7a91;
  font-size: 12px;
  line-height: 1.45;
}

.store-stack strong {
  color: #22354b;
  font-weight: 700;
}

.stores-ownership-table th,
.stores-ownership-table td,
.stores-ownership-editor-table th,
.stores-ownership-editor-table td,
.stores-ownership-issues-table th,
.stores-ownership-issues-table td,
.companies-directory-table th,
.companies-directory-table td,
.companies-tax-table th,
.companies-tax-table td,
.companies-erp-table th,
.companies-erp-table td,
.store-company-matrix-table th,
.store-company-matrix-table td,
.operating-company-table th,
.operating-company-table td,
.store-company-directory-table th,
.store-company-directory-table td,
.stores-health-table th,
.stores-health-table td,
.listing-management-table th,
.listing-management-table td,
.brand-compliance-overview-table th,
.brand-compliance-overview-table td,
.brand-compliance-records-table th,
.brand-compliance-records-table td {
  max-width: 220px;
}

.listing-management-table td {
  vertical-align: top;
}

.listing-thumb {
  width: 38px;
  height: 38px;
  border: 1px solid #d9e5f2;
  border-radius: 8px;
  object-fit: cover;
  background: #fff;
}

.stores-ownership-editor-table td:nth-child(2) {
  min-width: 180px;
}

.stores-health-table td:nth-child(5),
.stores-health-table td:nth-child(6),
.companies-directory-table td:nth-child(9),
.companies-directory-table td:nth-child(12),
.companies-tax-table td:nth-child(2),
.companies-tax-table td:nth-child(10),
.companies-erp-table td:nth-child(10),
.companies-erp-table td:nth-child(12),
.store-company-matrix-table td:nth-child(5),
.store-company-matrix-table td:nth-child(6),
.store-company-matrix-table td:nth-child(7),
.operating-company-table td:nth-child(5),
.operating-company-table td:nth-child(6),
.operating-company-table td:nth-child(7),
.store-company-directory-table td:nth-child(5),
.store-company-directory-table td:nth-child(6),
.store-company-directory-table td:nth-child(7),
.stores-ownership-table td:last-child {
  min-width: 170px;
}

.brands-coverage-table td:nth-child(2),
.brands-health-table td:nth-child(3),
.brands-health-table td:nth-child(5),
.brand-compliance-overview-table td:nth-child(2),
.brand-compliance-overview-table td:nth-child(8),
.brand-compliance-records-table td:nth-child(2) {
  min-width: 170px;
}

.brands-monitoring-table th,
.brands-monitoring-table td {
  max-width: 260px;
  vertical-align: top;
}

.brands-monitoring-table td:nth-child(4),
.brands-monitoring-table td:nth-child(5),
.brands-monitoring-table td:nth-child(6),
.brands-monitoring-table td:nth-child(7) {
  min-width: 220px;
}

.brands-monitoring-table .store-stack .table-input {
  min-width: 180px;
}

.report-table tbody tr.summary-row td {
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: #eef5ff;
  border-top: 1px solid #d9e5f3;
  box-shadow: none;
}

.report-table tbody tr.summary-row td:first-child {
  z-index: 6;
  background: #e8f1ff;
  border-top: 1px solid #d9e5f3;
}

.report-table tbody tr.summary-row:hover td {
  background: #eef5ff;
}

.report-table tbody tr.summary-row:hover td:first-child {
  background: #e8f1ff;
}

.inventory-table-wrap {
  height: calc(100vh - 264px);
  min-height: 620px;
}

.inventory-table {
  width: max-content;
  min-width: 100%;
}

.inventory-table th,
.inventory-table td {
  max-width: 168px;
}

.empty-row {
  padding: 48px 16px !important;
  color: var(--muted);
  text-align: center !important;
}

.summary-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.transit-loss-stage {
  gap: 16px;
}

.transit-loss-head.compact h3,
.transit-loss-head h3 {
  margin-bottom: 0;
}

.transit-loss-hero {
  padding-bottom: 18px;
}

.transit-loss-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.risk-tree-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.risk-tree-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.risk-tree-card-wide {
  grid-column: span 1;
}

.risk-tree-card h4 {
  margin: 0 0 12px;
  font-size: 18px;
}

.risk-tree-card ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--muted-strong);
  line-height: 1.6;
}

.risk-tree-card li span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.stocktake-tree-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.transit-loss-table-wrap {
  max-width: 100%;
  overflow: auto;
}

.transit-loss-table {
  width: max(100%, 1180px);
}

.transit-loss-table .section-header td {
  background: #f0f5ff;
  color: #1a3a6b;
  font-size: 14px;
  padding: 10px 12px;
  border-bottom: 2px solid #d0dff5;
}

.transit-loss-table .total-row td {
  background: #e8f5e9;
  font-size: 14px;
  font-weight: 600;
  border-top: 2px solid #a5d6a7;
  padding: 12px;
}

.transit-loss-table .total-row td div {
  margin: 2px 0;
  font-weight: 500;
  font-size: 13px;
}

.cell-yes {
  color: #2e7d32;
  font-weight: 600;
  text-align: center;
  background: #e8f5e9;
}

.cell-no {
  color: #c62828;
  font-weight: 600;
  text-align: center;
  background: #ffebee;
}

.cell-partial {
  color: #4f92ff;
  font-weight: 600;
  text-align: center;
  background: #eaf3ff;
}

.cell-conditional {
  color: #6a1b9a;
  font-weight: 600;
  text-align: center;
  background: #f3e5f5;
}

.cell-summary {
  text-align: left;
  vertical-align: top;
}

.cell-summary div {
  margin: 2px 0;
  font-size: 13px;
  font-weight: 500;
}

.transit-loss-source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.image-requests-stage {
  gap: 16px;
}

.image-request-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.form-field textarea {
  min-height: 110px;
  resize: vertical;
}

.form-field-wide {
  grid-column: span 3;
}

.compact-head {
  margin-bottom: 14px;
}

.image-request-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.88fr) minmax(320px, 0.72fr);
  gap: 16px;
  align-items: start;
}

.image-request-list,
.image-request-detail {
  min-width: 0;
}

.image-request-list {
  display: grid;
  gap: 12px;
}

.request-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.request-card:hover,
.request-card.active {
  border-color: #c6d8f3;
  box-shadow: 0 12px 28px rgba(21, 39, 63, 0.06);
  transform: translateY(-1px);
}

.request-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.request-card-head strong {
  font-size: 16px;
  line-height: 1.4;
}

.request-status-text {
  flex: 0 0 auto;
  color: #4b5f7a;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.request-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.request-card p {
  margin: 12px 0 0;
  color: var(--muted-strong);
  line-height: 1.7;
}

.image-request-detail {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.detail-head {
  margin-bottom: 12px;
}

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

.danger-ghost,
.danger-text {
  color: var(--danger);
}

.attachment-list {
  display: grid;
  gap: 10px;
}

.attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.attachment-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.attachment-copy a {
  color: var(--primary-deep);
  font-weight: 700;
  text-decoration: none;
}

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

.landing-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.landing-column {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.landing-column h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.selection-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.selection-summary-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.selection-summary-card span {
  color: var(--muted);
  font-size: 12px;
}

.selection-summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  color: var(--primary-deep);
}

.selection-summary-card p {
  margin: 8px 0 0;
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.6;
}

.selection-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 6px;
  margin-bottom: 10px;
  align-items: end;
  padding: 8px;
  border: 1px solid #e8edf5;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fafe 100%);
}

.selection-toolbar .form-field span {
  font-size: 10px;
}

.selection-toolbar .form-field input,
.selection-toolbar .form-field select {
  min-height: 30px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 12px;
}

.selection-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 16px;
}

.selection-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.selection-detail-block {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.selection-detail-block h5 {
  margin: 0 0 12px;
  font-size: 14px;
}

.selection-detail-metric {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.selection-detail-metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.selection-detail-metric strong {
  display: block;
  margin-top: 6px;
  font-size: 16px;
}

.selection-keyvals {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 12px;
  align-items: start;
}

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

.selection-keyvals strong {
  text-align: right;
  font-size: 13px;
  line-height: 1.6;
}

.selection-action-row {
  margin-top: 16px;
}

.selection-events {
  display: grid;
  gap: 12px;
}

.selection-event-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.selection-event-item div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.selection-event-item strong {
  text-transform: capitalize;
}

.selection-event-item span,
.selection-event-item time {
  color: var(--muted);
  font-size: 12px;
}

.selection-event-item p {
  margin: 8px 0;
  color: var(--muted-strong);
  line-height: 1.6;
}

.data-table tr.is-active {
  background: rgba(45, 111, 221, 0.06);
}

@media (max-width: 1200px) {
  .selection-summary-grid,
  .selection-toolbar,
  .landing-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .selection-detail-layout,
  .selection-detail-grid {
    grid-template-columns: 1fr;
  }
}

.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.sort-btn.is-active {
  color: var(--primary-deep);
}

.sort-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  height: 14px;
  position: relative;
}

.sort-indicator::before,
.sort-indicator::after {
  content: "";
  position: absolute;
  left: 1px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
}

.sort-indicator::before {
  top: 0;
  border-bottom: 5px solid #b8c3d1;
}

.sort-indicator::after {
  bottom: 0;
  border-top: 5px solid #b8c3d1;
}

.sort-btn.is-active.asc .sort-indicator::before {
  border-bottom-color: var(--primary-deep);
}

.sort-btn.is-active.desc .sort-indicator::after {
  border-top-color: var(--primary-deep);
}

.report-table [data-column-key="department"] {
  width: 110px;
  min-width: 110px;
  max-width: 110px;
}

.report-table [data-column-key="site"] {
  width: 90px;
  min-width: 90px;
  max-width: 90px;
}

.report-table [data-column-key="brand"] {
  width: 110px;
  min-width: 110px;
  max-width: 110px;
}

.report-table [data-column-key="parent_asin"],
.report-table [data-column-key="asin"] {
  width: 138px;
  min-width: 138px;
  max-width: 138px;
}

.report-table [data-column-key="product_name"] {
  width: 210px;
  min-width: 210px;
  max-width: 210px;
}

.report-table [data-column-key="model"] {
  width: 145px;
  min-width: 145px;
  max-width: 145px;
}

.report-table [data-column-key="sales_amount"],
.report-table [data-column-key="ad_spend"],
.report-table [data-column-key="gross_profit"],
.report-table [data-column-key="avg_price"],
.report-table [data-column-key="total_inventory_value"] {
  width: 108px;
  min-width: 108px;
  max-width: 108px;
}

.report-table [data-column-key="sales_units"],
.report-table [data-column-key="avg_daily_sales"],
.report-table [data-column-key="ad_cost_ratio"],
.report-table [data-column-key="gross_margin"],
.report-table [data-column-key="total_inventory"],
.report-table [data-column-key="turnover_days"],
.report-table [data-column-key="roi"],
.report-table [data-column-key="row_count"] {
  width: 96px;
  min-width: 96px;
  max-width: 96px;
}

.report-table .truncate-cell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-stage {
  display: grid;
  gap: 16px;
}

.settings-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.settings-subnav {
  display: grid;
  gap: 10px;
  position: sticky;
  top: 12px;
}

.settings-subnav-link {
  display: grid;
  gap: 4px;
  padding: 14px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  text-decoration: none;
  color: var(--muted-strong);
  transition: 180ms ease;
}

.settings-subnav-link strong {
  font-size: 14px;
}

.settings-subnav-link span {
  font-size: 12px;
  color: var(--muted);
}

.settings-subnav-link:hover {
  border-color: rgba(45, 111, 221, 0.25);
  background: #f7faff;
}

.settings-subnav-link.active {
  border-color: rgba(45, 111, 221, 0.28);
  background: linear-gradient(180deg, #eaf3ff 0%, #f8fbff 100%);
  box-shadow: inset 3px 0 0 var(--primary);
}

.settings-detail {
  display: grid;
  gap: 16px;
}

.settings-shell-single {
  grid-template-columns: 1fr;
}

.settings-stage .settings-shell {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.settings-stage .settings-detail {
  padding: 0;
}

.lx-user-shell {
  display: grid;
  gap: 0;
  min-height: calc(100vh - 250px);
  background: #f4f6fa;
  border: 1px solid #e3e7ef;
  border-radius: 12px;
  overflow: hidden;
}

.lx-user-view {
  display: none;
}

.lx-user-view.active {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
}

.lx-filter-bar,
.lx-action-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fafe 100%);
  border: 1px solid #e6ebf2;
  border-radius: 12px;
}

.lx-filter-group,
.lx-filter-actions,
.lx-action-left,
.lx-action-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
}

.lx-filter-group,
.lx-action-left,
.lx-action-right {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  white-space: nowrap;
}

.lx-filter-group .lx-inline-check {
  gap: 5px;
  margin-left: 2px;
}

.lx-filter-group select,
.lx-filter-group input,
.lx-search-field,
.lx-action-bar .ghost-btn,
.lx-action-bar .primary-btn {
  min-height: 26px;
}

.lx-filter-group select,
.lx-filter-group input,
.lx-search-field input,
.lx-user-form input,
.lx-user-form select,
.lx-category-box textarea {
  padding: 0 10px;
  border: 1px solid #cfd7e6;
  border-radius: 6px;
  background: #fff;
  color: #1f2f46;
  font-size: 11px;
}

.lx-filter-group select,
.lx-filter-group input {
  flex: 0 0 auto;
  width: 92px;
  min-width: 92px;
}

.lx-search-field {
  display: inline-flex;
  align-items: stretch;
  flex: 0 0 auto;
  width: 188px;
  min-width: 188px;
  border: 1px solid #cfd7e6;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.lx-search-field input {
  flex: 1;
  min-width: 0;
  border: none;
  border-radius: 0;
}

.lx-search-field .ghost-btn {
  border: none;
  border-left: 1px solid #e4e8f0;
  border-radius: 0;
}

.lx-more-filters {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 12px;
  background: #fff;
  border-bottom: 1px solid #e6ebf2;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
}

.lx-selected-summary {
  color: #8a97ab;
  font-size: 12px;
}

.lx-user-view > .message-box {
  flex: 0 0 auto;
  min-height: 28px;
  margin: 0 8px 8px;
  padding: 6px 10px;
  font-size: 12px;
}

.lx-table-shell {
  padding: 0 8px 8px;
}

.lx-user-table {
  width: max(100%, 1560px);
  background: #fff;
}

.lx-user-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
}

.lx-user-table th,
.lx-user-table td {
  height: 38px;
  padding: 0 8px;
  border-bottom: 1px solid #e9edf4;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.2;
  vertical-align: middle;
}

.lx-user-table tbody tr.selected {
  background: #edf4ff;
}

.lx-check-col {
  width: 30px;
  min-width: 30px;
  text-align: center;
  padding-left: 4px !important;
  padding-right: 4px !important;
}

.lx-check-col input,
#lxSelectAll,
[data-select-user] {
  appearance: none;
  -webkit-appearance: none;
  display: inline-block;
  width: 12px;
  height: 12px;
  min-width: 12px;
  min-height: 12px;
  margin: 0;
  padding: 0;
  vertical-align: middle;
  border: 1px solid #b7c3d6;
  border-radius: 2px;
  background: #fff;
  position: relative;
  cursor: pointer;
  flex: 0 0 12px;
  box-shadow: none;
}

.lx-check-col input:checked,
#lxSelectAll:checked,
[data-select-user]:checked {
  border-color: #2d6fdd;
  background: #2d6fdd;
}

.lx-check-col input:checked::after,
#lxSelectAll:checked::after,
[data-select-user]:checked::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 0;
  width: 4px;
  height: 7px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.lx-operation-col,
.lx-operation-cell {
  width: 118px;
  min-width: 118px;
}

.lx-operation-cell {
  overflow: visible !important;
}

.lx-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  min-height: 38px;
}

.lx-dropdown.row {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.lx-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid #d8e1ee;
  border-radius: 6px;
  background: #f7f9fd;
  font-size: 12px;
  font-weight: 600;
}

.lx-status-pill.active {
  border-color: #7bd38d;
  color: #22a146;
  background: #f7fff8;
}

.lx-status-pill.inactive {
  border-color: #cfd6e4;
  color: #45546b;
  background: #f7f9fc;
}

.lx-status-pill.pending {
  border-color: #78b0ff;
  color: #2d6fdd;
  background: #fff9ef;
}

.lx-dropdown {
  position: relative;
}

.lx-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 112px;
  padding: 6px 0;
  border: 1px solid #dfe5ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 28px rgba(21, 39, 63, 0.08);
  z-index: 30;
}

.lx-dropdown-menu button {
  display: block;
  width: 100%;
  min-height: 28px;
  padding: 0 10px;
  border: none;
  background: transparent;
  color: #24364c;
  text-align: left;
  font-size: 12px;
}

.lx-filter-actions .ghost-btn,
.lx-filter-actions .primary-btn,
.lx-action-right .ghost-btn,
.lx-action-right .primary-btn,
.lx-editor-actions .ghost-btn,
.lx-editor-actions .primary-btn {
  min-height: 28px;
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
}

.lx-dropdown-menu button:hover {
  background: #f5f8fd;
}

.lx-row-menu {
  left: auto;
  right: 0;
  min-width: 132px;
}

.lx-dropdown-menu[hidden],
.lx-row-menu[hidden] {
  display: none !important;
}

.lx-editor-head {
  padding: 8px 14px;
  border-bottom: 1px solid #e6ebf2;
  background: #fff;
}

.lx-editor-head h3 {
  margin: 0;
  font-size: 15px;
}

.lx-editor-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px;
  min-height: 480px;
}

.lx-editor-sidebar,
.lx-editor-main {
  min-width: 0;
}

.lx-editor-card,
.lx-editor-main {
  border: 1px solid #e4e9f1;
  background: #fff;
}

.lx-editor-card {
  padding: 16px;
}

.lx-editor-sidebar {
  overflow-y: auto;
}

.lx-editor-main {
  overflow-y: auto;
}

.lx-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.lx-section-title span {
  width: 2px;
  height: 18px;
  background: #2d6fdd;
  border-radius: 999px;
}

.lx-section-title strong {
  font-size: 14px;
}

.lx-section-title-sub {
  margin-top: 18px;
}

.lx-user-form {
  display: grid;
  gap: 10px;
}

.lx-user-form label {
  display: grid;
  gap: 6px;
}

.lx-user-form label > span,
.lx-radio-group > span,
.lx-category-box label > span {
  color: #4e5f76;
  font-size: 12px;
}

.lx-user-form em,
.lx-radio-group em {
  color: #d34e43;
  font-style: normal;
}

.lx-user-form input,
.lx-user-form select {
  min-height: 28px;
}

.lx-radio-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lx-radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.lx-radio-group input[type="radio"] {
  width: 12px;
  height: 12px;
  margin: 0;
}

.lx-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #5d6f86;
  font-size: 12px;
  line-height: 1;
  flex: 0 0 auto;
}

.lx-inline-check input[type="checkbox"],
.lx-inline-check input[type="radio"],
.lx-role-item input,
.lx-module-item input {
  appearance: none;
  -webkit-appearance: none;
  display: inline-block;
  width: 12px;
  height: 12px;
  min-width: 12px;
  min-height: 12px;
  margin: 0;
  padding: 0;
  flex: 0 0 12px;
  box-shadow: none;
}

.lx-inline-check input[type="checkbox"] {
  border: 1px solid #b7c3d6;
  border-radius: 2px;
  background: #fff;
  position: relative;
  cursor: pointer;
}

.lx-inline-check input[type="checkbox"]:checked {
  border-color: #2d6fdd;
  background: #2d6fdd;
}

.lx-inline-check input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 0;
  width: 4px;
  height: 7px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* 额外权限面板里把 checkbox 单独放大 (15px), 其它地方维持原 12px */
[data-user-panel="extra-perms"] .lx-inline-check input[type="checkbox"] {
  width: 15px;
  height: 15px;
  min-width: 15px;
  min-height: 15px;
  flex: 0 0 15px;
}
[data-user-panel="extra-perms"] .lx-inline-check input[type="checkbox"]:checked::after {
  left: 3px;
  top: 1px;
  width: 5px;
  height: 9px;
}

.lx-inline-check input[type="radio"],
.lx-role-item input,
.lx-module-item input {
  border: 1px solid #b7c3d6;
  border-radius: 999px;
  background: #fff;
  position: relative;
  cursor: pointer;
}

.lx-inline-check input[type="radio"]:checked,
.lx-role-item input:checked,
.lx-module-item input:checked {
  border-color: #2d6fdd;
}

.lx-inline-check input[type="radio"]:checked::after,
.lx-role-item input:checked::after,
.lx-module-item input:checked::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 999px;
  background: #2d6fdd;
}

.lx-role-tabs {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 12px;
  height: 32px;
  border-bottom: 1px solid #e8edf4;
  background: #fff;
}

.lx-role-tabs button {
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  color: #2a3c54;
  font-size: 12px;
}

.lx-role-tabs button.active {
  color: #2563eb;
  font-weight: 700;
}

.lx-role-panel {
  display: none;
  padding: 12px;
}

.lx-role-panel.active {
  display: block;
}

.lx-role-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.lx-role-hint {
  color: #8a97ab;
  font-size: 12px;
  line-height: 1.4;
}

.lx-role-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px 14px;
  align-content: start;
}

.lx-role-item,
.lx-module-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #2b3b52;
  font-size: 12px;
  line-height: 1.2;
}

.lx-role-item em {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 6px;
  border-radius: 4px;
  background: #fff4e5;
  color: #4f92ff;
  font-size: 11px;
  font-style: normal;
}

.lx-module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.lx-category-box textarea {
  width: 100%;
  min-height: 120px;
  padding: 10px 12px;
  resize: vertical;
}

.lx-editor-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-top: 1px solid #e4e9f1;
  background: #fff;
}

.lx-editor-footer .message-box {
  flex: 1;
}

.lx-editor-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lx-dept-shell {
  display: grid;
  min-height: calc(100vh - 250px);
  background: #f4f6fa;
  border: 1px solid #e3e7ef;
  border-radius: 12px;
  overflow: hidden;
}

.lx-dept-view {
  display: none;
}

.lx-dept-view.active {
  display: grid;
  align-content: start;
}

.lx-dept-list-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: calc(100vh - 250px);
}

.lx-dept-tree-pane {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 10px;
  border-right: 1px solid #e5eaf2;
  background: #fff;
}

.lx-dept-main-pane {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  background: #f4f6fa;
}

.lx-dept-tree-head,
.lx-dept-main-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lx-dept-tree-head {
  padding: 2px 2px 0;
}

.lx-dept-tree-head h3,
.lx-dept-main-head h3 {
  margin: 0;
  font-size: 15px;
}

.lx-dept-tree-head p,
.lx-dept-main-head p,
.lx-resource-note {
  margin: 4px 0 0;
  color: #7f8ca1;
  font-size: 12px;
  line-height: 1.5;
}

.lx-dept-tree-tools {
  display: grid;
  gap: 8px;
}

.lx-dept-tree-search {
  width: 100%;
  min-width: 0;
}

.lx-dept-tree-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #7e8aa0;
  font-size: 12px;
}

.lx-dept-tree-list {
  display: grid;
  gap: 4px;
  align-content: start;
  max-height: calc(100vh - 340px);
  overflow: auto;
}

.lx-dept-node {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px 8px calc(10px + var(--dept-depth, 0) * 18px);
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #24364c;
  text-align: left;
}

.lx-dept-node:hover {
  background: #f6f9ff;
}

.lx-dept-node.active {
  border-color: #c8dafd;
  background: #eaf3ff;
}

.lx-dept-node-main,
.lx-dept-node-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.lx-dept-node-main strong,
.lx-dept-node-main small,
.lx-dept-node-meta small,
.lx-dept-node-meta strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lx-dept-node-main small,
.lx-dept-node-meta small {
  color: #7f8ca1;
  font-size: 11px;
}

.lx-dept-node-meta {
  justify-items: end;
}

.lx-dept-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 0 8px;
}

.lx-dept-kpi {
  display: grid;
  gap: 6px;
  min-height: 88px;
  padding: 12px 14px;
  border: 1px solid #e3e9f2;
  border-radius: 10px;
  background: #fff;
}

.lx-dept-kpi span {
  color: #6e7c92;
  font-size: 12px;
}

.lx-dept-kpi strong {
  color: #23344c;
  font-size: 22px;
  line-height: 1;
}

.lx-dept-kpi small {
  color: #8a97ab;
  font-size: 12px;
  line-height: 1.45;
}

.lx-dept-main-head,
.lx-filter-bar,
.lx-pager {
  padding-left: 8px;
  padding-right: 8px;
}

.lx-dept-main-head {
  padding-top: 10px;
}

.lx-dept-main-actions,
.lx-dept-editor-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lx-dept-member-table {
  width: max(100%, 1440px);
}

.lx-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
}

.lx-pager-summary,
.lx-pager-state {
  color: #6d7a90;
  font-size: 12px;
}

.lx-pager-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lx-pager-controls select {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #cfd7e6;
  border-radius: 6px;
  background: #fff;
  color: #1f2f46;
  font-size: 12px;
}

.lx-dept-editor-head {
  align-items: center;
}

.lx-dept-editor-body {
  min-height: 560px;
}

.lx-dept-editor-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.lx-resource-tabs {
  border-bottom: 1px solid #e8edf4;
}

.lx-resource-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 470px;
}

.lx-resource-groups {
  border-right: 1px solid #e8edf4;
  background: #fbfcff;
}

.lx-resource-group-head {
  padding: 12px 14px 8px;
  color: #4f5f76;
  font-size: 12px;
  font-weight: 600;
}

.lx-resource-group-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: none;
  border-top: 1px solid #eef2f8;
  background: transparent;
  color: #283b52;
  font-size: 12px;
}

.lx-resource-group-item.active {
  background: #eaf3ff;
  color: #2259c0;
  font-weight: 700;
}

.lx-resource-content {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px 14px;
  min-width: 0;
}

.lx-resource-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-bottom: 1px solid #e8edf4;
  background: #fff;
}

.lx-resource-sections {
  display: grid;
  gap: 12px;
  align-content: start;
  max-height: 380px;
  overflow: auto;
  padding-right: 4px;
}

.lx-resource-section {
  border: 1px solid #e7edf5;
  border-radius: 10px;
  background: #fff;
}

.lx-resource-section header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #eef2f8;
}

.lx-resource-section header strong {
  font-size: 13px;
}

.lx-resource-check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 18px;
  padding: 12px;
}

.lx-resource-check {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  color: #24364c;
  font-size: 12px;
}

.lx-resource-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  min-width: 12px;
  margin: 2px 0 0;
  border: 1px solid #b7c3d6;
  border-radius: 2px;
  background: #fff;
  position: relative;
}

.lx-resource-check input[type="checkbox"]:checked {
  border-color: #2d6fdd;
  background: #2d6fdd;
}

.lx-resource-check input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 0;
  width: 4px;
  height: 7px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.lx-resource-check-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.lx-resource-check-copy strong,
.lx-resource-check-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lx-resource-check-copy small {
  color: #8a97ab;
}

.lx-dept-assign-dialog {
  width: min(1260px, calc(100vw - 48px));
}

.lx-modal-pager {
  padding-top: 10px;
  padding-bottom: 0;
}

@media (max-width: 1380px) {
  .lx-dept-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 1120px) {
  .lx-dept-list-layout,
  .lx-resource-layout,
  .lx-editor-body,
  .lx-dept-editor-body {
    grid-template-columns: 1fr;
  }

  .lx-dept-tree-pane {
    border-right: none;
    border-bottom: 1px solid #e5eaf2;
  }

  .lx-resource-groups {
    border-right: none;
    border-bottom: 1px solid #e8edf4;
  }

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

@media (max-width: 720px) {
  .lx-dept-summary,
  .lx-resource-check-grid {
    grid-template-columns: 1fr;
  }

  .lx-pager,
  .lx-editor-footer,
  .lx-dept-main-head,
  .lx-dept-tree-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .lx-dept-main-actions,
  .lx-dept-editor-head-actions,
  .lx-pager-controls {
    width: 100%;
    flex-wrap: wrap;
  }
}

.admin-console-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  min-height: calc(100vh - 220px);
}

.admin-console-shell-compact {
  gap: 14px;
}

.admin-console-shell-wide {
  grid-template-columns: minmax(0, 1.55fr) 360px;
}

.admin-console-shell-users {
  grid-template-columns: 1fr;
}

.admin-side-pane,
.admin-main-panel,
.admin-editor-pane,
.admin-main-pane {
  min-width: 0;
}

.admin-side-pane,
.admin-editor-pane {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.admin-side-pane-compact {
  gap: 12px;
  padding: 14px;
}

.admin-main-pane {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

.admin-main-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.admin-side-head,
.admin-role-head,
.admin-panel-head,
.admin-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-side-head h3,
.admin-role-head h3 {
  margin: 6px 0 0;
  font-size: 20px;
  line-height: 1.15;
}

.admin-role-head p,
.admin-panel-head span {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.admin-search-field {
  margin: 0;
}

.admin-metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.admin-side-list,
.department-tree {
  display: grid;
  gap: 6px;
  align-content: start;
  max-height: calc(100vh - 320px);
  overflow: auto;
  padding-right: 4px;
}

.admin-side-item,
.department-tree-node {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.admin-side-item span,
.department-tree-node span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-side-item small,
.department-tree-node strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.admin-side-item:hover,
.department-tree-node:hover {
  background: #f6f9fc;
  border-color: var(--line);
}

.admin-side-item.active,
.department-tree-node.active {
  background: #eaf3ff;
  border-color: rgba(45, 111, 221, 0.18);
  color: var(--primary-deep);
}

.department-tree-node {
  padding-left: calc(12px + var(--dept-depth, 0) * 18px);
}

.admin-side-item-main {
  display: grid;
  gap: 4px;
  min-width: 0;
  text-align: left;
}

.admin-side-item-main strong {
  font-size: 13px;
  line-height: 1.3;
}

.admin-side-item-main small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  white-space: normal;
}

.admin-side-item-meta {
  display: grid;
  justify-items: end;
  gap: 4px;
  flex-shrink: 0;
}

.admin-side-item-meta small,
.admin-side-item-meta strong {
  font-size: 11px;
}

.department-tree-node .admin-side-item-main strong {
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 700;
}

.department-tree-node .admin-side-item-meta strong {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.admin-toolbar {
  flex-wrap: wrap;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.admin-toolbar-copy {
  display: grid;
  gap: 4px;
  min-width: 220px;
}

.admin-toolbar-copy strong {
  font-size: 14px;
}

.admin-toolbar-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.admin-toolbar-filters,
.admin-toolbar-actions,
.admin-toolbar-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-toolbar-filters input,
.admin-toolbar-filters select {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
}

.admin-toolbar-filters input {
  min-width: 180px;
}

.admin-tab-btn {
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
}

.admin-tab-btn.active {
  border-color: rgba(45, 111, 221, 0.2);
  background: #eaf3ff;
  color: var(--primary-deep);
}

.admin-tab-panel {
  display: none;
  gap: 14px;
  margin-top: 16px;
}

.admin-tab-panel.active {
  display: grid;
}

.admin-toolbar-sub {
  padding: 0;
  border: none;
  background: transparent;
}

.role-subtabbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.role-subtab-btn {
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
}

.role-subtab-btn.active {
  border-color: rgba(45, 111, 221, 0.2);
  background: #eaf3ff;
  color: var(--primary-deep);
}

.role-data-panel {
  display: none;
  gap: 14px;
}

.role-data-panel.active {
  display: grid;
}

.role-data-scope {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.role-data-scope select[multiple] {
  min-height: 92px;
  padding: 6px 8px;
}

.role-radio-table th,
.role-radio-table td {
  text-align: center;
}

.role-radio-table th:first-child,
.role-radio-table td:first-child,
.role-radio-table th:nth-child(2),
.role-radio-table td:nth-child(2) {
  text-align: left;
}

.role-radio-cell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 30px;
}

.role-radio-cell input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.role-radio-cell span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  min-width: 52px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.role-radio-cell input[type="radio"]:checked + span {
  border-color: rgba(45, 111, 221, 0.22);
  background: #eaf3ff;
  color: var(--primary-deep);
}

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

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

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

.admin-table-shell {
  padding: 12px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.form-modal[hidden] {
  display: none;
}

.form-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.form-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 30, 49, 0.38);
}

.form-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  margin: 24px auto;
  padding: 20px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(19, 31, 52, 0.18);
}

.form-modal-dialog-wide {
  width: min(1120px, calc(100vw - 48px));
}

body.modal-open {
  overflow: hidden;
}

.workspace-user-link {
  color: inherit;
  text-decoration: none;
}

.workspace-user-link:hover {
  color: var(--primary-deep);
}

.register-grid,
.account-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.register-grid .field-wide,
.account-form-grid .field-wide {
  grid-column: 1 / -1;
}

.register-form textarea {
  min-height: 120px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  resize: vertical;
  font: inherit;
  color: var(--text);
}

.account-panel {
  padding: 18px;
}

.account-panel-compact {
  padding: 14px 16px;
}

.account-center-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 14px;
}

.account-hero-card,
.account-side-card {
  padding: 16px;
}

.account-hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.account-access-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 14px;
}

.account-form-grid-compact {
  gap: 12px;
}

.account-form-grid-compact .settings-field input,
.account-form-grid-compact .settings-field select {
  min-height: 36px;
  font-size: 13px;
}

.account-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  gap: 16px;
  margin-bottom: 18px;
}

.account-profile-card,
.account-meta-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-alt);
}

.account-profile-card-compact {
  padding: 14px;
}

.account-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--primary), var(--primary-deep));
  color: #fff;
  font-size: 28px;
  font-weight: 700;
}

.account-profile-copy,
.account-meta-card {
  flex-direction: column;
  align-items: flex-start;
}

.account-profile-copy strong,
.account-meta-card strong {
  font-size: 18px;
}

.account-profile-copy span,
.account-profile-copy small,
.account-meta-card span,
.account-meta-card small {
  color: var(--muted);
}

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

.admin-table-wrap {
  max-height: calc(100vh - 340px);
  min-height: 220px;
  overflow: auto;
}

.admin-grid-table {
  width: max(100%, 1080px);
}

.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.admin-summary-grid-compact {
  margin-top: 0;
}

.admin-stat-card {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdff, #f5f9ff);
}

.admin-stat-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.admin-stat-card strong {
  font-size: 18px;
  line-height: 1.1;
  color: var(--text-strong);
}

.admin-stat-card small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.admin-info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 12px;
  margin-top: 14px;
}

.compact-info-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.compact-meta-list {
  display: grid;
  gap: 8px;
}

.compact-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(143, 160, 182, 0.22);
}

.compact-meta-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

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

.compact-meta-row strong {
  color: var(--text-strong);
  font-size: 12px;
  text-align: right;
}

.compact-empty-text {
  color: var(--muted);
  font-size: 12px;
}

.compact-hint-list {
  display: grid;
  gap: 8px;
}

.compact-hint-list span {
  padding: 9px 10px;
  border: 1px dashed rgba(143, 160, 182, 0.24);
  border-radius: 10px;
  background: #f8fbff;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.55;
}

.admin-pathline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbff;
}

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

.admin-pathline strong {
  font-size: 12px;
  color: var(--text-strong);
  text-align: right;
}

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

.permission-toggle {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  text-align: left;
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.permission-toggle:hover {
  border-color: rgba(45, 111, 221, 0.18);
  background: #fafcff;
}

.permission-toggle.active {
  border-color: rgba(45, 111, 221, 0.22);
  background: #eaf3ff;
  box-shadow: inset 0 0 0 1px rgba(45, 111, 221, 0.08);
}

.permission-toggle-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.permission-toggle-copy strong {
  font-size: 12px;
}

.permission-toggle-copy small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.permission-toggle-state {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(143, 160, 182, 0.12);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.permission-toggle.active .permission-toggle-state {
  background: rgba(45, 111, 221, 0.12);
  color: var(--primary-deep);
}

.table-actions-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.mini-btn {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.admin-console-shell .primary-btn,
.admin-console-shell .ghost-btn,
.admin-console-shell .danger-btn,
.form-modal .primary-btn,
.form-modal .ghost-btn,
.form-modal .danger-btn {
  min-height: 32px;
  padding: 0 12px;
  box-shadow: none;
}

.admin-console-shell .message-box,
.form-modal .message-box {
  min-height: 34px;
  padding: 8px 10px;
  font-size: 12px;
}

.admin-console-shell .settings-field > span,
.form-modal .settings-field > span {
  font-size: 12px;
}

.admin-console-shell .settings-field input,
.admin-console-shell .settings-field select,
.form-modal .settings-field input,
.form-modal .settings-field select {
  min-height: 36px;
  font-size: 13px;
}

.entity-tags-compact {
  gap: 6px;
}

.entity-tags-compact span {
  min-height: 22px;
  padding: 0 8px;
  font-size: 11px;
}

.empty-block {
  padding: 18px 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.selection-stage {
  display: grid;
  gap: 16px;
}

.selection-panel {
  display: grid;
  gap: 16px;
}

.selection-tabbar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.selection-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.selection-tab.active {
  border-color: rgba(213, 0, 43, 0.28);
  background: linear-gradient(180deg, #eaf3ff 0%, #fffafb 100%);
  color: var(--primary);
}

.selection-console .module-panel {
  display: none;
}

.selection-console .module-panel.active {
  display: grid;
  gap: 16px;
}

.status-pill.warning {
  background: rgba(255, 163, 26, 0.14);
  color: #2d6fdd;
}

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

.settings-admin-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 14px;
}

.settings-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-alt);
}

.settings-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.settings-card-head strong {
  display: block;
  font-size: 16px;
}

.settings-card-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.llm-compact-page {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.llm-compact-head {
  margin-bottom: 0;
  gap: 8px;
}

.llm-compact-head .section-tag {
  min-height: 22px;
  padding: 0 8px;
  font-size: 10.5px;
}

.llm-compact-head h3 {
  margin: 3px 0 0;
  font-size: 14px;
  line-height: 1.2;
}

.llm-compact-head p {
  font-size: 11px;
  line-height: 1.4;
}

.llm-settings-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-alt);
}

.llm-compact-page .settings-tab-btn {
  height: 26px;
  padding: 0 11px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted-strong);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.settings-tab-btn {
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-strong);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.settings-tab-btn.active {
  background: #fff;
  color: var(--primary-deep);
  box-shadow: 0 6px 14px rgba(31, 47, 70, 0.08);
}

.settings-tab-panel[hidden] {
  display: none !important;
}

.llm-compact-card {
  padding: 10px 12px;
  border-radius: 8px;
}

.llm-compact-card .settings-card-head {
  margin-bottom: 8px;
  gap: 8px;
}

.llm-compact-card .settings-card-head strong {
  font-size: 13px;
}

.llm-compact-card .settings-card-head p {
  margin: 2px 0 0;
  font-size: 11px;
  line-height: 1.4;
}

.llm-provider-inline-form {
  display: grid;
  grid-template-columns: minmax(120px, 1.1fr) 84px minmax(120px, 1fr) minmax(170px, 1.3fr) minmax(140px, 1.1fr) 64px auto;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}

.llm-provider-inline-form input,
.llm-provider-inline-form select {
  min-width: 0;
  height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  font: inherit;
  font-size: 11.5px;
}

.llm-provider-inline-form .primary-btn {
  height: 28px;
  padding: 0 12px;
  font-size: 11.5px;
}

.llm-inline-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  font-size: 11.5px;
  color: var(--muted-strong);
}

.llm-inline-check input[type="checkbox"] {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: #2d6fdd;
}

.llm-compact-page .message-box {
  padding: 6px 10px;
  font-size: 11.5px;
  line-height: 1.4;
}

.llm-table-host {
  min-width: 0;
}

.llm-table-wrap {
  border-radius: 8px;
}

.llm-provider-table,
.llm-binding-table {
  width: max(100%, 1120px);
}

.llm-provider-table {
  width: max(100%, 920px);
}

.llm-provider-table th,
.llm-provider-table td,
.llm-binding-table th,
.llm-binding-table td {
  padding: 5px 7px;
  font-size: 11.5px;
  line-height: 1.3;
  vertical-align: middle;
}

.llm-provider-table .table-input,
.llm-binding-table .table-input {
  min-height: 26px;
  padding: 3px 6px;
  border-radius: 5px;
  font-size: 11.5px;
}

.llm-compact-page .ghost-btn,
.llm-compact-page .primary-btn,
.llm-compact-page .secondary-btn {
  padding: 4px 10px;
  font-size: 11.5px;
  min-height: 26px;
}

.llm-prompt-input {
  width: 280px;
  min-height: 38px;
}

.llm-note-input {
  width: 180px;
  min-height: 32px;
}

.llm-table-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted-strong);
  font-size: 12px;
  white-space: nowrap;
}

.llm-provider-table .table-input.field-empty {
  border-color: #78b0ff;
  background: #fffbf4;
}

.llm-provider-table .table-input.field-empty::placeholder {
  color: #d38b2d;
  font-weight: 600;
  font-size: 11px;
}

.llm-provider-table .table-input.field-filled {
  border-color: #b8d8c0;
  background: #f6fdf7;
}

.llm-provider-table .table-input.field-filled::placeholder {
  color: #2f9e64;
  font-size: 11px;
}

.llm-binding-table td:first-child strong,
.llm-binding-table td:first-child small,
.llm-binding-table td:nth-child(4) small {
  display: block;
}

.llm-binding-table td:first-child small,
.llm-binding-table td:nth-child(4) small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.llm-provider-table .table-actions-cell,
.llm-binding-table .table-actions-cell {
  white-space: nowrap;
}

.llm-provider-table .table-actions-cell {
  min-width: 220px;
}

.llm-test-result {
  display: block;
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.45;
  white-space: normal;
  word-break: break-word;
  border: 1px solid transparent;
}
.llm-test-result--pending {
  background: #f5f5f5;
  color: #555;
  border-color: #e1e1e1;
}
.llm-test-result--ok {
  background: #ecfdf3;
  color: #137a4d;
  border-color: #b7eccd;
}
.llm-test-result--fail {
  background: #fef2f2;
  color: #b42318;
  border-color: #fecdca;
}
.llm-test-result .llm-test-line {
  display: block;
  font-weight: 600;
}
.llm-test-result .llm-test-detail {
  display: block;
  margin-top: 2px;
  opacity: 0.85;
}
.llm-test-result .llm-test-sample {
  display: block;
  margin-top: 2px;
  opacity: 0.7;
  font-style: italic;
}

.settings-card-actions {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
}

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

.settings-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.settings-option-rich {
  align-items: flex-start;
}

.important-reference-panel,
.important-reference-detail-panel {
  display: grid;
  gap: 14px;
}

.important-reference-tabbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.important-reference-tab-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.important-reference-tab-link:hover {
  border-color: rgba(45, 111, 221, 0.26);
  background: #f8fbff;
  color: var(--primary-deep);
}

.important-reference-tab-link.active {
  border-color: rgba(45, 111, 221, 0.3);
  background: #eaf3ff;
  color: var(--primary-deep);
  box-shadow: inset 0 0 0 1px rgba(45, 111, 221, 0.06);
}

.important-reference-stat-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.important-reference-stat-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.4;
}

.important-reference-table {
  width: max(100%, 1440px);
}

.important-reference-table th,
.important-reference-table td {
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
}

.important-reference-table-wrap {
  max-width: 100%;
}

.important-reference-wrap-cell {
  white-space: normal !important;
}

.important-reference-group-cell {
  min-width: 200px;
  background: #f9fbff;
}

.important-reference-cell-stack {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.important-reference-cell-stack strong,
.important-reference-cell-stack p,
.important-reference-cell-stack small {
  margin: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.important-reference-cell-stack strong {
  font-size: 13px;
  line-height: 1.5;
}

.important-reference-cell-stack p,
.important-reference-cell-stack small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.important-reference-wrap-cell code {
  display: block;
  padding: 0;
  background: transparent;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.55;
  white-space: normal;
  overflow-wrap: anywhere;
}

.important-reference-user-table,
.important-reference-asin-table {
  width: max(100%, 1560px);
}

.settings-option input {
  width: 16px;
  min-height: 16px;
  margin: 0;
}

.settings-option-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.settings-option-copy strong {
  font-size: 13px;
}

.settings-option-copy small {
  color: var(--muted);
  font-size: 12px;
}

.settings-form {
  display: grid;
  gap: 14px;
}

.settings-field {
  display: grid;
  gap: 8px;
}

.settings-field > span {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted-strong);
}

.settings-field input,
.settings-field select {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text-strong);
  font-size: 14px;
}

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

.settings-checkline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted-strong);
}

.settings-checkline input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--primary);
}

.settings-entity-list {
  display: grid;
  gap: 10px;
}

.entity-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.entity-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.entity-main p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.entity-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.entity-title-row strong {
  font-size: 15px;
}

.entity-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(213, 0, 43, 0.1);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.entity-badge.system {
  background: rgba(33, 160, 102, 0.12);
  color: #1f8c59;
}

.entity-badge.inactive {
  background: rgba(222, 90, 90, 0.12);
  color: #d14e4e;
}

.entity-badge.pending {
  background: rgba(217, 119, 6, 0.14);
  color: #b45309;
}

.entity-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.entity-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 600;
}

.entity-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.settings-field textarea,
.finance-builder-table input,
.finance-builder-table select,
.finance-builder-table textarea,
.finance-dynamic-table input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text-strong);
  font: inherit;
}

.settings-field textarea {
  resize: vertical;
}

.data-management-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.data-source-list-panel {
  display: grid;
  gap: 12px;
}

.data-source-list {
  max-height: 680px;
  overflow: auto;
}

.data-source-list-item {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.data-source-list-item:hover,
.data-source-list-item.active {
  border-color: var(--primary);
  background: rgba(213, 0, 43, 0.06);
}

.data-source-list-item span,
.data-source-list-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  word-break: break-word;
}

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

.data-source-form .field-wide {
  grid-column: 1 / -1;
}

.data-field-labels-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.data-field-labels-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.field-label-rows {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.field-header-import-panel {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.field-header-import-panel[hidden] {
  display: none;
}

.field-header-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.field-header-file-btn {
  cursor: pointer;
}

.field-label-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.field-label-row input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text-strong);
}

@media (max-width: 900px) {
  .data-management-layout,
  .data-source-form,
  .field-label-row {
    grid-template-columns: 1fr;
  }

  .data-source-list {
    max-height: 320px;
  }

  .data-field-labels-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

.finance-stage {
  display: grid;
  gap: 16px;
}

.finance-hero-panel,
.finance-workspace-panel {
  display: grid;
  gap: 16px;
}

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

.finance-console .module-panel.active {
  display: grid;
  gap: 16px;
}

.finance-request-form {
  gap: 16px;
}

.finance-core-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.finance-schema-card {
  gap: 12px;
}

.finance-dynamic-fields {
  display: grid;
  gap: 14px;
}

.finance-dynamic-section {
  gap: 12px;
}

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

.finance-dynamic-grid .field-wide,
.finance-dynamic-grid .finance-table-field {
  grid-column: 1 / -1;
}

.finance-table-field {
  display: grid;
  gap: 10px;
}

.finance-required {
  margin-left: 4px;
  color: #d14e4e;
  font-style: normal;
}

.finance-inner-table-wrap {
  padding-bottom: 4px;
}

.finance-dynamic-table {
  width: max(100%, 760px);
}

.finance-form-actions {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
}

.finance-config-shell {
  min-height: auto;
}

.finance-builder-table {
  width: max(100%, 1240px);
}

.finance-builder-table th,
.finance-builder-table td {
  vertical-align: top;
}

.finance-check-cell {
  text-align: center;
}

.finance-check-cell input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 12px;
}

.finance-static-approver {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
}

.finance-tabbar .selection-tab {
  cursor: pointer;
}

.finance-tabbar button.selection-tab {
  font: inherit;
}

.ghost-btn.danger {
  color: #c94f4f;
}

.sales-table {
  width: max(100%, 1220px);
}

.sales-table th:nth-child(8),
.sales-table td:nth-child(8),
.sales-table th:nth-child(9),
.sales-table td:nth-child(9),
.sales-table th:nth-child(10),
.sales-table td:nth-child(10) {
  min-width: 140px;
  white-space: normal;
}

.ranking-table-wrap {
  max-width: 100%;
}

.sales-query-panel,
.report-filter-panel,
.cockpit-filter-panel {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}

.sales-hero-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1.06fr) minmax(0, 0.94fr);
  gap: 16px;
}

.sales-amount-card {
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(45, 111, 221, 0.18);
  background:
    linear-gradient(135deg, rgba(45, 111, 221, 1) 0%, rgba(79, 146, 255, 1) 100%);
  color: #fff;
  box-shadow: 0 18px 32px rgba(47, 111, 221, 0.16);
}

.sales-amount-card .section-tag {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.sales-amount-main {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.sales-amount-card strong {
  display: block;
  margin: 0 0 8px;
  font-size: clamp(38px, 5vw, 58px);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.sales-amount-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 13px;
  line-height: 1.65;
}

.currency-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.sales-meta-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.empty-cell {
  text-align: center !important;
  color: var(--muted);
  padding: 24px !important;
}

.empty-block {
  padding: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

@media (max-width: 1420px) {
  .cockpit-kpi-grid,
  .dashboard-insight-grid,
  .report-summary-grid,
  .ai-scope-grid,
  .ai-summary-grid,
  .report-ai-diagnostics,
  .report-ai-rankings {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .trend-metric-grid,
  .sales-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .logistics-summary-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .logistics-search-field {
    grid-column: 1 / -1;
  }
}

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

  .toolbar-message {
    flex-basis: 100%;
    min-width: 100%;
    margin-left: 0;
  }

  .toolbar-inline-store,
  .date-range-picker,
  .toolbar-select-btn,
  .toolbar-inline-field input,
  .toolbar-inline-field select {
    min-width: 0;
  }

  .dimension-grid,
  .layout-two,
  .dashboard-hero-grid,
  .dashboard-insight-grid,
  .dashboard-main-grid,
  .dashboard-bottom-grid,
  .home-module-grid,
  .home-todo-grid,
  .sales-hero-grid,
  .two-col-grid,
  .ai-report-hero-grid,
  .settings-admin-grid,
  .settings-layout,
  .settings-option-grid,
  .admin-summary-grid,
  .account-center-grid,
  .account-access-grid,
  .admin-info-grid,
  .permission-toggle-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-hero-grid-single,
  .dashboard-bi-hero-grid,
  .dashboard-main-grid-single {
    grid-template-columns: 1fr;
  }

  .ai-report-layout {
    grid-template-columns: 1fr;
  }

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

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

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

  .page-toolbar,
  .section-head,
  .dashboard-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-description {
    white-space: normal;
  }
}

@media (max-width: 900px) {
  .report-ai-drawer {
    grid-template-columns: 1fr;
  }

  .store-company-principles,
  .stores-overview-grid {
    grid-template-columns: 1fr;
  }

  .brands-overview-grid,
  .brand-compliance-overview-grid {
    grid-template-columns: 1fr;
  }

  .report-ai-drawer-panel {
    padding: 18px 16px 28px;
  }

  .ai-summary-pending-top {
    align-items: flex-start;
  }

  .ai-summary-grid,
  .report-ai-diagnostics,
  .report-ai-rankings {
    grid-template-columns: 1fr;
  }

  .app-shell-erp {
    grid-template-columns: 60px minmax(0, 1fr);
  }

  .workspace-bar {
    padding: 0 12px;
  }

  .secondary-rail-overlay {
    inset: 0 auto 0 70px;
    width: 150px;
  }

  .secondary-rail {
    width: 142px;
  }

  .workspace-status-message {
    display: none;
  }

  .content-shell {
    padding: 12px;
  }

  .page-toolbar-copy {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-grid,
  .cockpit-kpi-grid,
  .report-summary-grid,
  .dashboard-hero-grid,
  .dashboard-insight-grid,
  .dashboard-main-grid,
  .dashboard-bottom-grid,
  .logistics-summary-row,
  .selection-summary-grid,
  .trend-metric-grid,
  .replenishment-content-grid,
  .replenishment-module-grid,
  .home-module-grid,
  .home-todo-grid,
  .dimension-grid,
  .layout-two,
  .sales-hero-grid,
  .ai-report-hero-grid,
  .ai-report-chip-grid,
  .sales-meta-grid,
  .two-col-grid,
  .finance-stat-grid,
  .finance-core-grid,
  .finance-dynamic-grid,
  .settings-admin-grid,
  .settings-layout,
  .admin-summary-grid,
  .admin-metric-strip,
  .account-center-grid,
  .account-access-grid,
  .admin-info-grid,
  .permission-toggle-grid,
  .settings-option-grid,
  .selection-toolbar,
  .selection-detail-layout,
  .selection-detail-grid,
  .field-filter-grid,
  .logistics-filter-grid {
    grid-template-columns: 1fr;
  }

  .settings-inline-fields,
  .entity-card {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .dashboard-summary-metrics,
  .dashboard-module-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-decision-item,
  .dashboard-ranked-item {
    grid-template-columns: 1fr;
  }

  .dashboard-ranked-metrics {
    justify-content: flex-start;
  }

  .chart-svg {
    height: 280px;
  }

  .chart-caption-row {
    grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  }

  .admin-side-item,
  .department-tree-node,
  .account-hero-head,
  .compact-meta-row,
  .admin-pathline,
  .dashboard-hero-head,
  .dashboard-action-box-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-side-item-meta {
    justify-items: start;
  }

  .entity-actions {
    justify-content: flex-start;
  }

  .toolbar-inline-field {
    width: 100%;
  }

  .report-stage {
    height: auto;
    grid-template-rows: auto auto auto;
  }

  .report-ai-summary-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .report-ai-drawer {
    grid-template-columns: 1fr;
  }

  .report-ai-drawer-backdrop {
    display: none;
  }

  .report-ai-drawer-panel {
    width: 100%;
    border-left: none;
    box-shadow: none;
  }

  .report-ai-summary-meta {
    justify-content: stretch;
  }

  .ai-summary-status {
    width: 100%;
  }

  .report-ai-summary-head p {
    max-width: none;
    text-align: left;
  }

  .logistics-filter-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .ai-report-action-row,
  .ai-report-output-block > header,
  .ai-report-action-head {
    flex-direction: column;
    align-items: stretch;
  }

  .report-table-wrap {
    height: auto;
    min-height: 420px;
  }

  .toolbar-inline-field input,
  .toolbar-inline-field select,
  .date-range-trigger,
  .toolbar-select-btn,
  .store-dropdown,
  .toolbar-inline-store {
    width: 100%;
  }

  .forecast-toolbar-actions {
    width: 100%;
    margin-left: 0;
  }

  .date-range-popover {
    grid-template-columns: 1fr;
    width: min(100vw - 110px, 420px);
  }

  .date-range-shortcuts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-right: none;
    border-bottom: 1px solid #e4edf7;
  }

  .store-dropdown-panel {
    width: min(100vw - 110px, 340px);
  }

  .login-stage {
    grid-template-columns: 1fr;
  }

  .login-stage-split {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .login-copy-split {
    min-height: 520px;
    padding: 26px 28px 30px;
  }

  .login-slogan-grid {
    margin-top: 40px;
  }

  .login-panel {
    min-height: auto;
    padding: 28px 24px 30px;
  }

}

@media (max-width: 720px) {
  .app-shell-erp {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
  }

  .side-rail {
    position: static;
    height: auto;
    grid-template-rows: none;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 10px 12px;
  }

  .side-menu {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0 8px;
    gap: 6px;
  }

  .side-menu::-webkit-scrollbar {
    display: none;
  }

  .side-link {
    min-width: 56px;
    min-height: 42px;
  }

  .secondary-rail-overlay {
    position: static;
    inset: auto;
    width: 100%;
    pointer-events: auto;
  }

  .secondary-rail {
    position: static;
    width: auto;
    max-height: none;
    margin: 0 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    transform: none;
    opacity: 1;
    box-shadow: var(--shadow);
  }

  .secondary-group + .secondary-group {
    margin-top: 18px;
  }

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

  .workspace-bar {
    flex-wrap: wrap;
    gap: 8px;
    min-height: auto;
    padding: 8px 12px;
  }

  .workspace-user {
    width: 100%;
    justify-content: flex-end;
  }

  .workspace-mini-link {
    margin-right: auto;
  }

  .page-toolbar-actions,
  .filter-actions,
  .connector-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .message-box {
    flex-basis: 100%;
  }

  .column-settings-panel {
    width: min(100vw - 120px, 420px);
  }

  .column-settings-list,
  .metric-settings-list {
    grid-template-columns: 1fr;
  }

  .login-shell {
    width: min(100%, calc(100% - 24px));
    padding: 20px 0;
  }

  .login-shell-split {
    width: 100%;
    padding: 0;
  }

  .login-stage-split {
    grid-template-columns: 1fr;
    max-width: 440px;
  }

  .login-copy-split {
    display: none;
  }

  .login-card-split {
    padding: 36px 28px;
    border-radius: 16px;
  }

  .login-card-head-split h2 {
    font-size: 24px;
  }
}

/* 首页极速加载骨架态 */
.dashboard-loading-block {
  position: relative;
  overflow: hidden;
}
.dashboard-loading-block::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  animation: dashboard-loading-shimmer 1.35s infinite;
  pointer-events: none;
}
@keyframes dashboard-loading-shimmer {
  100% { transform: translateX(100%); }
}

/* 20260426-lx-shell-final：按领星风格优化首页标签栏与一级栏目衔接 */
.erp-body {
  --erp-rail-width: 74px;
  --erp-topbar-height: 42px;
  background: #eef2f7;
}

.app-shell-erp {
  grid-template-columns: var(--erp-rail-width) minmax(0, 1fr);
  background: #eef2f7;
}

.side-rail {
  z-index: 35;
  padding: 8px 5px 12px;
  /* 20260502 紫色光晕 — 与登录页同色系 */
  background:
    radial-gradient(700px 500px at 100% 5%, rgba(140, 130, 240, 0.30), transparent 60%),
    radial-gradient(600px 500px at -10% 95%, rgba(94, 106, 210, 0.38), transparent 60%),
    linear-gradient(180deg, #0a0a14 0%, #1a1a2e 50%, #0a0a14 100%);
  border-right: none;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
}

/* 极细网格,仿登录页 */
.side-rail::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 0%, transparent 80%);
  z-index: 0;
}

/* 顶部右上角的圆形光晕 */
.side-rail::after {
  content: "";
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(140, 130, 240, 0.22) 0%, transparent 70%);
  filter: blur(36px);
  pointer-events: none;
  z-index: 0;
}

.side-rail > * {
  position: relative;
  z-index: 1;
}

.rail-brand {
  width: 64px;
  height: var(--erp-topbar-height);
}

.rail-brand-logo {
  width: 60px;
  max-height: 28px;
}

.side-menu {
  gap: 2px;
  padding-top: 4px;
}

.side-link {
  position: relative;
  min-height: 58px;
  border-radius: 10px;
  color: #b6bccd;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.side-link:hover {
  background: rgba(140, 130, 240, 0.10);
  color: #f3f1ff;
}

.side-link.active {
  background: rgba(94, 106, 210, 0.22);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(140, 130, 240, 0.32);
}

.side-link.active::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(180deg, #8c82f0 0%, #5e6ad2 100%);
  box-shadow: 0 0 10px rgba(140, 130, 240, 0.6);
}

.workspace-shell {
  background: #eef2f7;
}

.workspace-bar {
  position: relative;
  min-height: var(--erp-topbar-height);
  padding: 0 12px 0 0;
  /* 20260502 紫色毛玻璃 — 半透明深紫 + backdrop-filter blur */
  background:
    radial-gradient(420px 220px at 92% -40%, rgba(140, 130, 240, 0.28), transparent 70%),
    radial-gradient(380px 220px at 8% 140%, rgba(94, 106, 210, 0.26), transparent 70%),
    linear-gradient(135deg, rgba(20, 20, 35, 0.82) 0%, rgba(26, 26, 46, 0.82) 60%, rgba(20, 20, 35, 0.82) 100%);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(140, 130, 240, 0.14);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  overflow: hidden;
}

/* 顶部毛玻璃极细网格 */
.workspace-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 100%);
  z-index: 0;
}

.workspace-bar > * {
  position: relative;
  z-index: 1;
}

.workspace-tabbar {
  min-height: var(--erp-topbar-height);
  padding: 0 8px 0 12px;
}

.workspace-history-tab {
  min-height: 32px;
  margin-top: 6px;
  padding: 0 18px;
  border-radius: 8px 8px 0 0;
  color: rgba(238, 243, 250, 0.78);
  font-size: 12px;
  font-weight: 500;
}

.workspace-history-tab:not(.active):hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.workspace-history-tab.active {
  background: #eef2f7;
  color: #1f2937;
  font-weight: 700;
}

.workspace-history-tab.active::before,
.workspace-history-tab.active::after {
  content: none;
  display: none;
}

.workspace-history-tab.active::before {
  display: none;
}

.workspace-history-tab.active::after {
  display: none;
}

.workspace-history-close {
  color: #8d99aa;
}

.workspace-history-tab.active .workspace-history-close {
  color: #9aa5b6;
}

.workspace-tabbar-add {
  min-height: 32px;
  margin-top: 6px;
  color: rgba(238, 243, 250, 0.86);
}

.workspace-user {
  min-height: var(--erp-topbar-height);
  color: #d8e0ec;
}

.workspace-mini-link {
  color: #c6cfdd;
}

.workspace-mini-link:hover,
.workspace-mini-link.active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.workspace-user-avatar {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.workspace-user-copy small {
  color: #aeb8c8;
}

.workspace-user-link:hover {
  color: #ffffff;
}

.toolbar-logout {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e8edf5;
}

.toolbar-logout:hover {
  background: rgba(255, 255, 255, 0.13);
  color: #ffffff;
}

.content-shell {
  padding: 14px 18px 18px;
  background: #eef2f7;
}

.secondary-rail-overlay {
  inset: 0 auto 0 var(--erp-rail-width);
  width: 160px;
}

.secondary-rail {
  top: 0;
  width: 152px;
  height: 100vh;
  padding: 12px 0;
  background: #ffffff;
  border-right: 1px solid #e7edf5;
  box-shadow: 12px 0 24px rgba(31, 45, 66, 0.08);
}

.secondary-rail-scroll {
  padding: 6px 10px 18px;
}

.secondary-group h3 {
  margin-bottom: 8px;
  padding-left: 10px;
  color: #98a5b8;
  font-size: 11px;
}

.secondary-link {
  min-height: 32px;
  border-radius: 6px;
  color: #4b5565;
}

.secondary-link span {
  padding-left: 8px;
}

.secondary-link:hover,
.secondary-link.active {
  background: #eaf3ff;
  color: #1d63f0;
  font-weight: 700;
}

@media (max-width: 900px) {
  .erp-body { --erp-rail-width: 60px; }
  .workspace-bar { padding-right: 10px; }
  .content-shell { padding: 12px; }
  .secondary-rail-overlay { left: var(--erp-rail-width); }
}

@media (max-width: 720px) {
  .side-rail { border-right: none; }
  .workspace-bar { padding: 8px 12px; }
  .workspace-history-tab.active::before,
  .workspace-history-tab.active::after { display: none; }
  .content-shell { padding: 12px; }
  .secondary-rail-overlay { inset: auto; width: 100%; }
  .secondary-rail { height: auto; width: auto; }
}

/* Lingxing shell polish: top tabbar / first-level rail connection */
.erp-body {
  --erp-rail-width: 76px;
  background: #f3f5f8;
}

.erp-body .app-shell-erp {
  background: #f3f5f8;
}

.erp-body .side-rail,
.erp-body .workspace-bar {
  background: linear-gradient(135deg, #253149 0%, #1a2233 100%);
}

.erp-body .side-rail {
  z-index: 35;
  padding-top: 8px;
  border-right: none;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
}

.erp-body .rail-brand {
  height: 42px;
  margin-bottom: 4px;
}

.erp-body .side-menu {
  gap: 2px;
}

.erp-body .side-link {
  min-height: 58px;
  border-radius: 0;
  color: rgba(221, 228, 238, 0.72);
}

.erp-body .side-link:hover {
  background: rgba(255, 255, 255, 0.045);
  color: #ffffff;
}

.erp-body .side-link.active {
  position: relative;
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.erp-body .side-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: #4f92ff;
}

.erp-body .workspace-shell {
  background: #f7f9fc;
}

.erp-body .workspace-bar {
  min-height: 40px;
  padding-right: 12px;
  box-shadow: none;
}

.erp-body .workspace-tabbar {
  min-height: 40px;
  padding-left: 0;
  align-items: flex-end;
}

.erp-body .workspace-history-tab {
  min-height: 32px;
  margin-top: 8px;
  padding: 0 18px;
  border-radius: 8px 8px 0 0;
  color: rgba(255, 255, 255, 0.72);
}

.erp-body .workspace-history-tab:not(.active):hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.055);
}

.erp-body .workspace-history-tab.active {
  background: #f7f9fc;
  color: #1a2233;
  font-weight: 700;
}

.erp-body .workspace-history-tab.active::after {
  content: none;
  display: none;
}

.erp-body .workspace-tabbar-add {
  min-height: 32px;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.8);
}

.erp-body .content-shell {
  padding: 14px 18px 18px;
  background: #f7f9fc;
}

.erp-body .secondary-rail-overlay {
  inset: 0 auto 0 var(--erp-rail-width);
  z-index: 32;
}

.erp-body .secondary-rail {
  height: 100vh;
  max-height: 100vh;
  padding: 12px 0 18px;
  border-right: 1px solid #e4e9f1;
  border-radius: 0 0 12px 0;
  box-shadow: 10px 10px 26px rgba(17, 30, 53, 0.08);
}

.erp-body .secondary-rail-scroll {
  padding-top: 6px;
}

.erp-body .workspace-user,
.erp-body .workspace-user-copy strong,
.erp-body .workspace-user-copy small,
.erp-body .workspace-mini-link {
  color: rgba(255, 255, 255, 0.78);
}

.erp-body .workspace-mini-link:hover,
.erp-body .workspace-mini-link.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.erp-body .workspace-user-avatar {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.erp-body .toolbar-logout {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.86);
}

.erp-body .toolbar-logout:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}


/* ==============================================
   移动端响应式统一适配 (mobile-responsive-v1)
   ============================================== */

/* ----- 平板小屏 ≤1024px ----- */
@media (max-width: 1024px) {
  /* KPI 卡片 2 列 */
  .kpi-grid,
  .report-summary-grid,
  .dashboard-insight-grid,
  .dashboard-hero-grid,
  .dashboard-hero-grid-single,
  .dashboard-bi-hero-grid,
  .cockpit-kpi-grid,
  .trend-metric-grid,
  .sales-meta-grid,
  .selection-summary-grid,
  .logistics-summary-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  /* 筛选栏换行 */
  .toolbar-strip,
  .selection-toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }

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

  /* 内容区缩进 */
  .content-shell {
    padding: 16px 14px;
  }

  /* 双栏布局变单栏 */
  .layout-two,
  .detail-layout,
  .selection-detail-layout,
  .automation-history-layout,
  .automation-feedback-layout,
  .qa-layout,
  .automation-form,
  .automation-hero-cards,
  .qa-hero-cards {
    grid-template-columns: 1fr;
  }

  .automation-tabs {
    gap: 8px;
  }

  .automation-settings-help {
    grid-template-columns: 1fr;
  }

  .automation-inline-action {
    grid-template-columns: 1fr;
  }

  .automation-token-action {
    grid-template-columns: 1fr;
  }

  .automation-tab-btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .qa-answer-head {
    flex-direction: column;
  }

  .qa-chat-header {
    flex-direction: column;
  }

  .qa-message-bubble {
    max-width: 100%;
  }

  .dashboard-main-grid-scroll {
    grid-template-columns: 1fr;
  }

  /* 表格容器加滚动提示 */
  .data-table-wrap,
  .transit-table-wrap,
  .table-scroll-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ----- 手机横屏 / 小平板 ≤768px ----- */
@media (max-width: 768px) {
  /* 侧边栏缩小 */
  :root {
    --erp-rail-width: 56px;
  }

  .side-rail {
    width: var(--erp-rail-width);
  }

  .side-link {
    justify-content: center;
    padding: 10px 4px;
  }

  .side-link .side-label {
    display: none;
  }

  .side-link .side-icon {
    margin: 0;
  }

  .rail-brand {
    padding: 12px 10px;
    justify-content: center;
  }

  .rail-brand .rail-brand-logo {
    width: 28px;
    height: 28px;
  }

  .rail-brand .rail-brand-name {
    display: none;
  }

  /* KPI 卡片仍 2 列 */
  .kpi-grid,
  .report-summary-grid,
  .dashboard-insight-grid,
  .dashboard-hero-grid,
  .dashboard-bi-hero-grid,
  .cockpit-kpi-grid,
  .trend-metric-grid,
  .sales-meta-grid,
  .selection-summary-grid,
  .logistics-summary-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  /* 筛选栏紧凑 */
  .toolbar-strip,
  .selection-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .toolbar-strip > *,
  .selection-toolbar > * {
    width: 100%;
    max-width: 100%;
  }

  .filter-grid,
  .field-filter-grid,
  .logistics-filter-grid {
    grid-template-columns: 1fr;
  }

  /* 搜索框全宽 */
  .toolbar-search,
  .logistics-search-field,
  .selection-search {
    width: 100%;
    max-width: 100%;
  }

  /* 二级导航紧凑 */
  .secondary-rail-overlay {
    left: var(--erp-rail-width);
    width: 140px;
  }

  .secondary-rail {
    width: 132px;
    padding: 10px 8px;
  }

  .secondary-link {
    padding: 8px 10px;
    font-size: 13px;
  }

  /* 内容区内边距 */
  .content-shell {
    padding: 12px 10px;
  }

  /* 表格单元格缩小 */
  table.data-table th,
  table.data-table td,
  .transit-data-table th,
  .transit-data-table td {
    padding: 8px 10px;
    font-size: 12px;
  }

  /* 弹出层全屏 */
  .modal-overlay .modal-card {
    width: calc(100vw - 32px);
    max-width: 100%;
    margin: 16px;
    border-radius: 12px;
  }

  .modal-card {
    padding: 20px 16px;
  }

  /* 按钮缩小 */
  .btn,
  .toolbar-btn,
  .toolbar-select-btn {
    padding: 6px 12px;
    font-size: 13px;
    min-height: 34px;
  }

  .btn-icon {
    width: 32px;
    height: 32px;
  }
}

/* ----- 手机竖屏 ≤480px ----- */
@media (max-width: 480px) {
  /* 侧边栏极窄 */
  :root {
    --erp-rail-width: 48px;
  }

  .side-rail {
    width: var(--erp-rail-width);
  }

  .rail-brand {
    padding: 10px 8px;
  }

  .rail-brand .rail-brand-logo {
    width: 24px;
    height: 24px;
  }

  .side-link {
    padding: 10px 6px;
  }

  .side-link .side-icon {
    font-size: 18px;
  }

  /* KPI 卡片 1 列 */
  .kpi-grid,
  .report-summary-grid,
  .dashboard-insight-grid,
  .dashboard-hero-grid,
  .dashboard-hero-grid-single,
  .dashboard-bi-hero-grid,
  .cockpit-kpi-grid,
  .trend-metric-grid,
  .sales-meta-grid,
  .selection-summary-grid,
  .logistics-summary-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  /* 内容区最少内边距 */
  .content-shell {
    padding: 8px;
  }

  /* 表格适配 */
  table.data-table th,
  table.data-table td,
  .transit-data-table th,
  .transit-data-table td {
    padding: 6px 8px;
    font-size: 11px;
  }

  /* 弹出全屏 */
  .modal-overlay .modal-card {
    width: calc(100vw - 16px);
    margin: 8px;
    border-radius: 8px;
  }

  .modal-card {
    padding: 16px 12px;
  }

  /* workspace 标签栏滚动 */
  .workspace-tabbar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .workspace-tabbar::-webkit-scrollbar {
    display: none;
  }

  .workspace-tab {
    padding: 8px 12px;
    font-size: 12px;
    white-space: nowrap;
  }

  /* 二级导航隐藏（极小屏只用一级导航） */
  .secondary-rail-overlay {
    left: 0;
    width: 100%;
    max-width: 100vw;
  }

  .secondary-rail {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px;
    height: auto;
  }

  .secondary-link {
    flex: 0 0 auto;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
  }

  /* 按钮更小 */
  .btn,
  .toolbar-btn,
  .toolbar-select-btn {
    padding: 5px 10px;
    font-size: 12px;
    min-height: 30px;
  }

  /* 日期选择器 */
  .date-range-picker {
    flex-wrap: wrap;
  }

  .date-range-picker > * {
    flex: 1 1 auto;
    min-width: 100px;
  }

  /* 命令卡片单列 */
  .command-panel,
  .command-card-grid {
    grid-template-columns: 1fr;
  }

  /* 翻页器紧凑 */
  .pager,
  .report-pager {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
  }

  .pager-controls,
  .report-pager-controls {
    flex-wrap: wrap;
    gap: 4px;
  }

  .pager-btn {
    min-width: 32px;
    height: 32px;
    font-size: 12px;
  }
}


/* ==============================================
   全站页面级微调 (page-refinement-v2)
   ============================================== */

/* ----- 全局面板统一紧凑化 ----- */
.report-panel,
.compact-report-panel,
.admin-main-panel,
.dimension-panel,
.ranking-panel,
.filter-panel,
.report-filter-panel,
.finance-workspace-panel,
.admin-console-shell,
.admin-console-shell-wide {
  padding: 12px;
  border-radius: 10px;
}

/* 面板头部 */
.report-panel-head,
.admin-panel-head,
.section-head,
.toolbar-head {
  padding: 8px 0 10px;
  margin-bottom: 10px;
}

/* 内部卡片间距 */
.report-panel .kpi-card,
.report-filter-panel .kpi-card,
.dashboard-hero-card,
.dashboard-overview-card,
.dashboard-decision-card,
.module-snapshot-card {
  padding: 14px 16px;
  border-radius: 10px;
}

/* KPI 卡片内数值区 */
.kpi-card .kpi-value,
.dashboard-hero-card .dashboard-hero-value {
  font-size: 24px;
  line-height: 1.2;
}

.kpi-card .kpi-label,
.dashboard-hero-card .dashboard-hero-label {
  font-size: 12px;
}

/* ----- 统一筛选栏 ----- */
.report-toolbar-strip,
.selection-toolbar,
.admin-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  padding: 10px 0;
  min-height: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ----- 表格单元格垂直对齐居中 ----- */
.data-table td,
.transit-data-table td,
.report-table-wrap td {
  vertical-align: middle;
}

/* 表格行交错色（提升可读性） */
.data-table tbody tr:nth-child(even),
.transit-data-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.01);
}

/* ----- 滚动条美化（全站统一） ----- */
.table-wrap::-webkit-scrollbar,
.report-table-wrap::-webkit-scrollbar,
.transit-table-wrap::-webkit-scrollbar {
  height: 5px;
}

.table-wrap::-webkit-scrollbar-track,
.report-table-wrap::-webkit-scrollbar-track,
.transit-table-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.table-wrap::-webkit-scrollbar-thumb,
.report-table-wrap::-webkit-scrollbar-thumb,
.transit-table-wrap::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 99px;
}

/* ----- 移动端额外优化（叠加在之前基础上） ----- */

/* 平板 ≤1024px */
@media (max-width: 1024px) {
  /* 图表区柔性换行 */
  .dimension-grid,
  .chart-grid,
  .metric-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* 面板内边距收紧 */
  .report-panel,
  .compact-report-panel,
  .admin-main-panel {
    padding: 10px;
    border-radius: 8px;
  }

  /* 行政面板堆叠 */
  .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-toolbar-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* 手机 ≤768px */
@media (max-width: 768px) {
  /* 面板最小化 */
  .report-panel,
  .compact-report-panel,
  .admin-main-panel,
  .dimension-panel,
  .ranking-panel {
    padding: 8px;
    border-radius: 6px;
    min-width: 0;
  }

  /* 表格 wrapper 窄屏强制横滚 */
  .table-wrap,
  .report-table-wrap,
  .transit-table-wrap {
    border-radius: 8px;
  }

  /* KPI 卡片内容缩小 */
  .kpi-card,
  .dashboard-hero-card,
  .dashboard-overview-card,
  .dashboard-decision-card,
  .module-snapshot-card {
    padding: 10px 12px;
    border-radius: 8px;
  }

  .kpi-card .kpi-value,
  .dashboard-hero-card .dashboard-hero-value {
    font-size: 20px;
  }

  .kpi-card .kpi-label,
  .dashboard-hero-card .dashboard-hero-label {
    font-size: 11px;
  }

  /* overlay 弹窗响应式 */
  .secondary-rail-overlay {
    left: var(--erp-rail-width, 56px);
    width: 140px;
    border-radius: 0 10px 10px 0;
  }

  /* 长期趋势图之类自适应 */
  .chart-container canvas,
  .trend-chart canvas {
    max-width: 100%;
    height: auto !important;
  }

  /* 隐藏工作区消息提示（窄屏） */
  .workspace-status-message {
    display: none;
  }

  /* 设置卡片流式 */
  .settings-card,
  .finance-schema-card {
    padding: 12px;
  }
}

/* 手机竖屏 ≤480px */
@media (max-width: 480px) {
  /* 所有面板极简 */
  .report-panel,
  .compact-report-panel,
  .admin-main-panel,
  .dimension-panel,
  .ranking-panel,
  .filter-panel,
  .report-filter-panel {
    padding: 6px;
    border-radius: 4px;
  }

  /* KPI 值缩小 */
  .kpi-card,
  .dashboard-hero-card,
  .dashboard-overview-card {
    padding: 8px 10px;
  }

  .kpi-card .kpi-value,
  .dashboard-hero-card .dashboard-hero-value {
    font-size: 18px;
  }

  /* 操作栏按钮更紧凑 */
  .toolbar-inline-field {
    width: 100%;
  }

  .toolbar-inline-field select,
  .toolbar-inline-field input,
  .date-range-picker input {
    width: 100%;
    font-size: 13px;
    padding: 6px 10px;
  }

  /* 日期选择器全宽堆叠 */
  .date-range-picker {
    flex-direction: column;
    width: 100%;
  }

  .date-range-shortcuts {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  /* 设置面板 flex 转 grid */
  .settings-inline-fields,
  .admin-form-grid,
  .finance-core-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* 表头文字缩小 */
  th {
    font-size: 11px;
    padding: 6px 8px;
  }

  /* 行内表单元素缩小 */
  .transit-inline-input,
  .transit-inline-select {
    font-size: 11px;
    padding: 4px 6px;
  }
}

/* iOS Safari 弹性滚动兼容 */
@supports (-webkit-overflow-scrolling: touch) {
  .table-wrap,
  .report-table-wrap,
  .transit-table-wrap,
  .side-menu,
  .workspace-tabbar,
  .admin-toolbar-tabs {
    -webkit-overflow-scrolling: touch;
  }
}

/* ═══════════════════════════════════════════════
   Dashboard Enhancement — 2026-05
   ═══════════════════════════════════════════════ */

/* ── KPI card: keep overflow hidden for bottom bar ── */
.kpi-card {
  overflow: hidden;
}

/* ── Insight cards: tone borders + background tints ── */
.dashboard-insight-card {
  position: relative;
  border-top: 3px solid transparent;
  transition: box-shadow 0.15s ease;
}
.dashboard-insight-card:hover {
  box-shadow: 0 4px 16px rgba(15, 31, 58, 0.1);
}
.dashboard-insight-card.good {
  border-top-color: var(--success);
  background: linear-gradient(180deg, #f4fbf7 0%, #ffffff 60%);
}
.dashboard-insight-card.warn {
  border-top-color: var(--warning);
  background: linear-gradient(180deg, #fffaf2 0%, #ffffff 60%);
}
.dashboard-insight-card.danger {
  border-top-color: var(--danger);
  background: linear-gradient(180deg, #fff6f5 0%, #ffffff 60%);
}

/* ── Insight progress bar ── */
.insight-status-bar {
  height: 4px;
  margin: 6px 0 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.07);
  overflow: hidden;
}
.insight-status-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  min-width: 4px;
}
.dashboard-insight-card.good  .insight-status-fill { background: var(--success); }
.dashboard-insight-card.warn  .insight-status-fill { background: var(--warning); }
.dashboard-insight-card.danger .insight-status-fill { background: var(--danger); }

/* ── Dimension: margin bar ── */
.dimension-margin-bar {
  height: 4px;
  margin-top: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.07);
  overflow: hidden;
}
.dimension-margin-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--success);
  transition: width 0.5s ease;
}
.dimension-margin-fill.is-warn   { background: var(--warning); }
.dimension-margin-fill.is-danger { background: var(--danger); }

/* ── Ranking: mini inline bar ── */
.ranking-mini-bar {
  margin-top: 3px;
  height: 3px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  min-width: 32px;
}
.ranking-mini-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: #4f92ff;
  transition: width 0.5s ease;
}
.ranking-cell-val {
  font-variant-numeric: tabular-nums;
}

/* ── Trend chart: enforce display block on SVG ── */
.trend-chart-shell .chart-svg {
  display: block;
  width: 100%;
}

/* ============================================================
   首页 V3 - 简洁 / 数据化 / 图标化 / 关键指标化
   2026-05-01
   ============================================================ */

.home-stage-v3 {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ----- Toolbar (single-row, no-wrap) ----- */
.home-toolbar-v3 {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  padding: 8px 14px !important;
  border-radius: 14px;
  background: linear-gradient(120deg, #ffffff 0%, #f6f9fe 100%);
  box-shadow: 0 1px 0 rgba(36, 56, 95, 0.04);
  overflow: hidden;
  min-height: 48px;
}
.home-toolbar-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-right: 6px;
}
.home-toolbar-title strong {
  font-size: 14px;
  font-weight: 700;
  color: #1f2c46;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.home-toolbar-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #4f7bff, #6f5dfc);
  color: #fff;
  flex-shrink: 0;
}
.home-scope-chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 11px;
  background: rgba(79, 123, 255, 0.10);
  color: #3c5cff;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-store-pill {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  background: #eef3fb;
  color: #3a4d6c;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.home-mini-select {
  height: 28px;
  padding: 0 22px 0 8px;
  border-radius: 7px;
  border: 1px solid #dde5f1;
  background: #ffffff;
  color: #2c3a55;
  font-size: 12px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  max-width: 130px;
  flex-shrink: 1;
  min-width: 90px;
}
.home-mini-select:hover { border-color: #b8c6e0; }
.home-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.home-icon-btn svg { display: block; }
.home-icon-btn:hover { transform: translateY(-1px); }
.home-btn-primary {
  background: linear-gradient(135deg, #4f7bff, #4f60d6);
  color: #fff;
  box-shadow: 0 3px 10px rgba(79, 96, 214, 0.22);
}
.home-btn-primary:hover { box-shadow: 0 5px 14px rgba(79, 96, 214, 0.32); }
.home-btn-ghost {
  background: #ffffff;
  color: #4f6080;
  border-color: #dde5f1;
}
.home-btn-ghost:hover { color: #2940ad; border-color: #b3c0e0; }
.home-btn-ghost:disabled { opacity: 0.55; cursor: not-allowed; }
.home-date-field { flex-shrink: 0; }
.home-date-field .date-range-picker { min-width: 0; }
.home-toolbar-msg {
  flex: 1 1 0;
  min-width: 0;
  font-size: 11.5px;
  color: #6c7894;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 4px;
  margin: 0;
  background: transparent;
  border: 0;
}
.home-toolbar-msg[hidden] { display: none; }
/* When viewport is narrow, allow horizontal scroll instead of wrapping */
@media (max-width: 1100px) {
  .home-toolbar-v3 { overflow-x: auto; }
  .home-toolbar-msg { display: none; }
}

/* ----- KPI Grid ----- */
.home-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.home-kpi-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(36, 56, 95, 0.06);
  box-shadow: 0 1px 0 rgba(36, 56, 95, 0.03);
  overflow: hidden;
}
.home-kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 14px 0 0 14px;
}
.home-kpi-card.navy::before  { background: #4f7bff; }
.home-kpi-card.green::before { background: #2f9e64; }
.home-kpi-card.amber::before { background: #e0a32a; }
.home-kpi-card.rose::before  { background: #e3526b; }
.home-kpi-card.teal::before  { background: #29a6a6; }
.home-kpi-card.slate::before { background: #6c7894; }

.home-kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  margin-bottom: 2px;
}
.home-kpi-icon svg { width: 16px; height: 16px; }
.home-kpi-card.navy  .home-kpi-icon { background: rgba(79, 123, 255, 0.12); color: #4f7bff; }
.home-kpi-card.green .home-kpi-icon { background: rgba(47, 158, 100, 0.12); color: #2f9e64; }
.home-kpi-card.amber .home-kpi-icon { background: rgba(224, 163, 42, 0.14); color: #c2871d; }
.home-kpi-card.rose  .home-kpi-icon { background: rgba(227, 82, 107, 0.12); color: #e3526b; }
.home-kpi-card.teal  .home-kpi-icon { background: rgba(41, 166, 166, 0.12); color: #29a6a6; }
.home-kpi-card.slate .home-kpi-icon { background: rgba(108, 120, 148, 0.14); color: #5a6884; }

.home-kpi-label {
  font-size: 12px;
  color: #7c8aa6;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.home-kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: #1d2941;
  line-height: 1.15;
  letter-spacing: -0.2px;
}
.home-kpi-note {
  font-size: 11.5px;
  color: #94a1bd;
  font-weight: 500;
}

/* ----- Insight (health) cards ----- */
.home-insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}
.home-insight-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(36, 56, 95, 0.06);
}
.home-insight-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.home-insight-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
}
.home-insight-icon svg { width: 14px; height: 14px; }
.home-insight-label {
  font-size: 12px;
  color: #7c8aa6;
  font-weight: 600;
}
.home-insight-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.home-insight-value strong {
  font-size: 22px;
  font-weight: 700;
  color: #1d2941;
  letter-spacing: -0.2px;
}
.home-insight-value i {
  font-style: normal;
  font-size: 12.5px;
  color: #7c8aa6;
  font-weight: 600;
}
.home-insight-bar {
  height: 5px;
  border-radius: 4px;
  background: #eef2f8;
  overflow: hidden;
}
.home-insight-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.home-insight-note {
  font-size: 11.5px;
  color: #94a1bd;
  margin: 0;
}
.home-insight-card.good  .home-insight-icon { background: rgba(47, 158, 100, 0.14); color: #2f9e64; }
.home-insight-card.warn  .home-insight-icon { background: rgba(224, 163, 42, 0.16); color: #c2871d; }
.home-insight-card.danger .home-insight-icon { background: rgba(227, 82, 107, 0.14); color: #e3526b; }
.home-insight-card.good   .home-insight-bar-fill { background: linear-gradient(90deg, #4cc587, #2f9e64); }
.home-insight-card.warn   .home-insight-bar-fill { background: linear-gradient(90deg, #f3c55a, #d68a25); }
.home-insight-card.danger .home-insight-bar-fill { background: linear-gradient(90deg, #f48190, #d6485f); }

/* ----- 2-col grid ----- */
.home-grid-2col {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 14px;
}
@media (max-width: 1100px) {
  .home-grid-2col { grid-template-columns: 1fr; }
}

/* ----- Generic card head ----- */
.home-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.home-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.home-card-title strong {
  font-size: 14px;
  font-weight: 700;
  color: #1f2c46;
}
.home-card-sub {
  font-size: 12px;
  color: #94a1bd;
  font-weight: 500;
}
.home-card-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(79, 123, 255, 0.12);
  color: #4f7bff;
}
.home-card-ico.decision { background: rgba(111, 93, 252, 0.14); color: #6f5dfc; }
.home-card-ico.danger   { background: rgba(227, 82, 107, 0.14); color: #e3526b; }
.home-card-ico.warn     { background: rgba(224, 163, 42, 0.16); color: #c2871d; }
.home-card-ico.ok       { background: rgba(47, 158, 100, 0.14); color: #2f9e64; }

/* ----- Trend card ----- */
.home-card-trend { padding: 16px 18px; }
.home-trend-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
@media (max-width: 800px) {
  .home-trend-stats { grid-template-columns: repeat(2, 1fr); }
}
.home-trend-stat {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f7f9fd;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.home-trend-stat-label { font-size: 11.5px; color: #7c8aa6; font-weight: 600; }
.home-trend-stat-value { font-size: 15px; font-weight: 700; color: #1d2941; }
.home-trend-stat-caption { font-size: 11px; color: #94a1bd; margin: 0; }
.home-trend-chart { min-height: 320px; }

/* ----- Decision card ----- */
.home-card-decision { padding: 16px 18px; }
.home-decision-headline {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f4f6ff 0%, #f9f5ff 100%);
}
.home-decision-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #2940ad;
  line-height: 1.4;
}
.home-decision-meta {
  font-size: 11.5px;
  color: #7c8aa6;
  margin: 0;
}
.home-decision-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.home-decision-item {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fafbfd;
  border-left: 3px solid #cbd4e3;
}
.home-decision-item.danger { border-left-color: #e3526b; background: #fff6f7; }
.home-decision-item.warn   { border-left-color: #e0a32a; background: #fff9ed; }
.home-decision-item.good   { border-left-color: #2f9e64; background: #f1faf4; }
.home-decision-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
}
.home-decision-icon svg { width: 14px; height: 14px; }
.home-decision-item.danger .home-decision-icon { background: rgba(227, 82, 107, 0.14); color: #e3526b; }
.home-decision-item.warn   .home-decision-icon { background: rgba(224, 163, 42, 0.16); color: #c2871d; }
.home-decision-item.good   .home-decision-icon { background: rgba(47, 158, 100, 0.14); color: #2f9e64; }
.home-decision-copy strong { display: block; font-size: 13px; color: #1f2c46; font-weight: 700; }
.home-decision-copy p { margin: 2px 0 0; font-size: 11.5px; color: #6c7894; line-height: 1.45; }
.home-decision-metric {
  font-size: 13px;
  font-weight: 700;
  color: #2940ad;
  white-space: nowrap;
}
.home-decision-item.danger .home-decision-metric { color: #d6485f; }
.home-decision-item.warn   .home-decision-metric { color: #c2871d; }
.home-decision-item.good   .home-decision-metric { color: #2f9e64; }

/* ----- Dimension grid ----- */
.home-card-dim { padding: 16px 18px; }
.home-dim-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 1100px) { .home-dim-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  { .home-dim-grid { grid-template-columns: 1fr; } }
.home-dim-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: #fafbfd;
}
.home-dim-block > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.home-dim-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 11px;
  font-size: 11.5px;
  font-weight: 600;
}
.home-dim-tag.site   { background: rgba(79, 123, 255, 0.14); color: #2940ad; }
.home-dim-tag.dept   { background: rgba(111, 93, 252, 0.14); color: #4d3fdb; }
.home-dim-tag.brand  { background: rgba(41, 166, 166, 0.14); color: #1f7d7d; }
.home-dim-tag.profit { background: rgba(47, 158, 100, 0.14); color: #1f7848; }
.home-dim-meta { font-size: 11px; color: #94a1bd; font-weight: 500; }
.home-dim-list { display: flex; flex-direction: column; gap: 8px; }
.home-dim-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #ffffff;
}
.home-dim-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.home-dim-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: #eef3fb;
  color: #3a4d6c;
  font-size: 11px;
  font-weight: 700;
}
.home-dim-row-name {
  flex: 1;
  font-size: 12.5px;
  color: #1f2c46;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-dim-row-sales {
  font-size: 12.5px;
  font-weight: 700;
  color: #2940ad;
}
.home-dim-bar {
  height: 4px;
  border-radius: 3px;
  background: #eef2f8;
  overflow: hidden;
}
.home-dim-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6f8cff, #4f7bff);
  border-radius: 3px;
}
.home-dim-row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.home-dim-row-meta > span:first-child {
  font-size: 11px;
  color: #94a1bd;
  margin-right: auto;
}
.home-dim-pill {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 8px;
  border-radius: 9px;
  font-size: 10.5px;
  font-weight: 600;
}
.home-dim-pill.good   { background: rgba(47, 158, 100, 0.12); color: #1f7848; }
.home-dim-pill.warn   { background: rgba(224, 163, 42, 0.16); color: #a76e16; }
.home-dim-pill.danger { background: rgba(227, 82, 107, 0.13); color: #c43f53; }

/* ----- Ranking table ----- */
.home-card-rank { padding: 16px 18px; }
.home-rank-wrap { overflow-x: auto; }
.home-rank-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
}
.home-rank-table thead th {
  background: #f7f9fd;
  color: #7c8aa6;
  font-weight: 600;
  font-size: 11.5px;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #eef2f8;
}
.home-rank-table tbody td {
  padding: 12px 12px;
  border-bottom: 1px solid #f3f5fa;
  color: #2c3a55;
  vertical-align: middle;
}
.home-rank-table tbody tr:hover td { background: #fafbfd; }
.home-rank-cell { width: 50px; }
.home-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: #eef3fb;
  color: #3a4d6c;
  font-size: 11.5px;
  font-weight: 700;
}
.home-rank-badge.gold   { background: linear-gradient(135deg, #ffd562, #f6a623); color: #fff; box-shadow: 0 2px 6px rgba(246, 166, 35, 0.35); }
.home-rank-badge.silver { background: linear-gradient(135deg, #d6dde8, #9aa6bd); color: #fff; }
.home-rank-badge.bronze { background: linear-gradient(135deg, #e8b389, #b67340); color: #fff; }
.home-rank-asin { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11.5px; color: #4f6080; }
.home-rank-name {
  font-weight: 600;
  color: #1f2c46;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-rank-site { color: #6c7894; }
.home-rank-val { font-weight: 700; color: #1d2941; margin-bottom: 4px; }
.home-rank-bar {
  height: 4px;
  border-radius: 3px;
  background: #eef2f8;
  overflow: hidden;
  width: 100%;
  max-width: 140px;
}
.home-rank-bar-fill { height: 100%; border-radius: 3px; }
.home-rank-bar-fill.blue  { background: linear-gradient(90deg, #6f8cff, #4f7bff); }
.home-rank-bar-fill.green { background: linear-gradient(90deg, #4cc587, #2f9e64); }
.home-rank-units { color: #4f6080; font-weight: 600; }
.home-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 11px;
  font-size: 11.5px;
  font-weight: 700;
}
.home-pill.good   { background: rgba(47, 158, 100, 0.12); color: #1f7848; }
.home-pill.warn   { background: rgba(224, 163, 42, 0.16); color: #a76e16; }
.home-pill.danger { background: rgba(227, 82, 107, 0.13); color: #c43f53; }

/* ----- Risk + Action cards ----- */
.home-card-risk, .home-card-action { padding: 16px 18px; }
.home-risk-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (max-width: 700px) { .home-risk-list { grid-template-columns: 1fr; } }
.home-risk-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fafbfd;
  border-left: 3px solid #cbd4e3;
}
.home-risk-card.danger { border-left-color: #e3526b; background: #fff6f7; }
.home-risk-card.warn   { border-left-color: #e0a32a; background: #fff9ed; }
.home-risk-card.good   { border-left-color: #2f9e64; background: #f1faf4; }
.home-risk-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  flex-shrink: 0;
}
.home-risk-icon svg { width: 16px; height: 16px; }
.home-risk-card.danger .home-risk-icon { background: rgba(227, 82, 107, 0.14); color: #e3526b; }
.home-risk-card.warn   .home-risk-icon { background: rgba(224, 163, 42, 0.16); color: #c2871d; }
.home-risk-card.good   .home-risk-icon { background: rgba(47, 158, 100, 0.14); color: #2f9e64; }
.home-risk-body { flex: 1; min-width: 0; }
.home-risk-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.home-risk-line strong { font-size: 12.5px; font-weight: 700; color: #1f2c46; }
.home-risk-line b {
  font-size: 16px;
  font-weight: 700;
  color: #1d2941;
}
.home-risk-line b i {
  font-style: normal;
  font-size: 11px;
  color: #94a1bd;
  font-weight: 600;
  margin-left: 2px;
}
.home-risk-card.danger .home-risk-line b { color: #d6485f; }
.home-risk-card.warn   .home-risk-line b { color: #c2871d; }
.home-risk-card.good   .home-risk-line b { color: #2f9e64; }
.home-risk-body p {
  margin: 4px 0 0;
  font-size: 11.5px;
  color: #6c7894;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-action-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.home-action-item {
  display: grid;
  grid-template-columns: 24px 24px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f7f9fd;
}
.home-action-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: linear-gradient(135deg, #4f7bff, #6f5dfc);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
}
.home-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(47, 158, 100, 0.14);
  color: #2f9e64;
}
.home-action-icon svg { width: 14px; height: 14px; }
.home-action-text {
  margin: 0;
  font-size: 12.5px;
  color: #2c3a55;
  line-height: 1.45;
}

/* ----- Opportunity / Leakage list ----- */
.home-card-opp, .home-card-leak { padding: 16px 18px; }
.home-ranked-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.home-ranked-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fafbfd;
  border-left: 3px solid transparent;
}
.home-ranked-item.opp  { border-left-color: #2f9e64; }
.home-ranked-item.leak { border-left-color: #e3526b; }
.home-ranked-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: #eef3fb;
  color: #3a4d6c;
  font-size: 12px;
  font-weight: 700;
}
.home-ranked-item.opp  .home-ranked-index { background: rgba(47, 158, 100, 0.14); color: #1f7848; }
.home-ranked-item.leak .home-ranked-index { background: rgba(227, 82, 107, 0.13); color: #c43f53; }
.home-ranked-copy { min-width: 0; }
.home-ranked-copy strong {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #1f2c46;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-ranked-copy p {
  margin: 2px 0 0;
  font-size: 11px;
  color: #94a1bd;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-ranked-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  justify-content: flex-end;
}
.home-ranked-metric {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 7px;
  background: #ffffff;
  border: 1px solid #eef2f8;
}
.home-ranked-metric i {
  font-style: normal;
  font-size: 10.5px;
  color: #94a1bd;
  font-weight: 600;
}
.home-ranked-metric b {
  font-size: 12px;
  color: #1d2941;
  font-weight: 700;
}
.home-ranked-metric.primary { background: linear-gradient(135deg, #f4f6ff 0%, #ecf2fb 100%); border-color: #d8e1f3; }
.home-ranked-item.opp  .home-ranked-metric.primary b { color: #2f9e64; }
.home-ranked-item.leak .home-ranked-metric.primary b { color: #d6485f; }

/* ----- Empty / loading ----- */
.home-empty-block {
  text-align: center;
  padding: 16px;
  color: #94a1bd;
  font-size: 12px;
}
.home-loading {
  position: relative;
  overflow: hidden;
}
.home-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  animation: home-skel 1.4s ease-in-out infinite;
}
@keyframes home-skel {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ----- Compact panel reset for home ----- */
.home-stage-v3 .panel {
  border-radius: 16px;
  padding: 16px 18px;
}

/* ============================================================
   ▼▼▼ MOBILE REWRITE 2026-05-01 — 手机端响应式重构 ▼▼▼
   覆盖之前所有零散的移动端规则，提供统一一致的移动端体验
   断点策略:
     ≥1025px : 桌面端 (无变化)
     ≤1024px : 平板/小桌面
     ≤768px  : 手机端 (移动端 shell 启用)
     ≤480px  : 手机竖屏 (极致紧凑)
   ============================================================ */

/* === 移动端共享变量 === */
:root {
  --mobile-tabbar-height: 60px;
  --mobile-topbar-height: 52px;
  --mobile-drawer-width: 151px;
  --mobile-z-overlay: 1090;
  --mobile-z-drawer: 1100;
  --mobile-z-topbar: 1080;
  --mobile-z-tabbar: 1070;
}

/* 默认隐藏移动端构件 (桌面端不可见) */
.mobile-only,
.mobile-topbar,
.mobile-tabbar,
.mobile-drawer-overlay {
  display: none;
}

/* === 平板 769~1024px：紧凑化 === */
@media (max-width: 1024px) and (min-width: 769px) {
  body.erp-body .content-shell {
    padding: 14px;
  }
  body.erp-body .dimension-grid,
  body.erp-body .chart-grid,
  body.erp-body .metric-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* ============================================================
   手机端 ≤768px — 启用移动 shell
   ============================================================ */
@media (max-width: 768px) {

  /* --- 整体容器 --- */
  body.erp-body {
    overscroll-behavior-y: contain;
  }
  body.erp-body.is-mobile-drawer-open {
    overflow: hidden;
  }

  /* --- 移动端构件显示 --- */
  .mobile-only          { display: block !important; }
  .mobile-topbar        { display: flex  !important; }
  .mobile-tabbar        { display: flex  !important; }
  .mobile-drawer-overlay{ display: block !important; }

  /* --- App shell 单列 --- */
  body.erp-body .app-shell-erp {
    display: block !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
    min-height: 100vh;
  }

  /* --- 隐藏桌面侧边栏 (drawer 展开时由JS加 class) --- */
  body.erp-body .side-rail {
    display: none !important;
  }
  body.erp-body.is-mobile-drawer-open .side-rail {
    display: grid !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: var(--mobile-drawer-width) !important;
    height: 100vh !important;
    z-index: var(--mobile-z-drawer);
    grid-template-rows: auto 1fr !important;
    grid-template-columns: none !important;
    /* 抽屉里菜单必须从顶部往下排: 旧 720px 横排规则给 .side-rail 留了
       align-items:center, 在这个 auto/1fr 网格里会把菜单块垂直居中 (和 logo
       拉开大空档). 这里强制 start, 让品牌区贴顶、菜单紧随其后顺排下来. */
    align-items: start !important;
    align-content: start !important;
    padding: 14px 10px 18px !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    overflow-y: auto;
    animation: mobileDrawerIn 220ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  body.erp-body.is-mobile-drawer-open .rail-brand {
    width: auto;
    height: 48px;
    margin: 4px 6px 14px;
    justify-content: flex-start;
  }
  body.erp-body.is-mobile-drawer-open .rail-brand-logo {
    height: 30px;
    max-height: 30px;
    width: auto;
  }
  body.erp-body.is-mobile-drawer-open .side-menu {
    display: flex !important;
    flex-direction: column !important;
    overflow-x: visible !important;
    overflow-y: auto;
    padding: 0 !important;
    gap: 4px !important;
  }
  body.erp-body.is-mobile-drawer-open .side-link {
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 14px !important;
    min-width: 0 !important;
    min-height: 46px !important;
    padding: 10px 14px !important;
    text-align: left !important;
    border-radius: 10px !important;
    font-size: 14.5px !important;
    color: #d8e0ee !important;
  }
  body.erp-body.is-mobile-drawer-open .side-link.active {
    background: rgba(94, 106, 210, 0.22) !important;
    color: #ffffff !important;
    box-shadow: inset 0 0 0 1px rgba(140, 130, 240, 0.32) !important;
  }
  body.erp-body.is-mobile-drawer-open .side-link .side-label {
    display: inline-block !important;
    font-size: 14.5px !important;
    line-height: 1.2;
    /* 一级文字必须紧贴图标左对齐 (落在 46px, 与手风琴二级文字同一起点)。
       modern.css ≤900px 窄栏规则给 .side-label 钉了 text-align:center !important
       且基础样式 flex:1 撑满整行, 抽屉里文字会飘到行中间——这里强压回来。 */
    flex: 0 1 auto !important;
    text-align: left !important;
  }
  body.erp-body.is-mobile-drawer-open .side-link .side-icon {
    width: 18px !important;
    height: 18px !important;
    flex: 0 0 18px;
    opacity: 0.92;
  }

  /* --- Drawer 遮罩 --- */
  .mobile-drawer-overlay {
    position: fixed !important;
    inset: 0;
    background: rgba(15, 22, 40, 0.45);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    z-index: var(--mobile-z-overlay);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
  }
  body.erp-body.is-mobile-drawer-open .mobile-drawer-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  @keyframes mobileDrawerIn {
    from { transform: translateX(-100%); opacity: 0; }
    to   { transform: translateX(0);     opacity: 1; }
  }

  /* --- 移动端顶栏 --- */
  .mobile-topbar {
    position: sticky;
    top: 0;
    height: var(--mobile-topbar-height);
    padding: 0 12px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    /* 20260502 紫色毛玻璃 — 与桌面顶栏一致 */
    background:
      radial-gradient(280px 180px at 95% -30%, rgba(140, 130, 240, 0.30), transparent 70%),
      linear-gradient(135deg, rgba(20, 20, 35, 0.85) 0%, rgba(26, 26, 46, 0.85) 100%);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    color: #ffffff;
    z-index: var(--mobile-z-topbar);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    border-bottom: 1px solid rgba(140, 130, 240, 0.16);
  }
  .mobile-topbar-left,
  .mobile-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }
  .mobile-topbar-right { justify-content: flex-end; }
  .mobile-topbar-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 50vw;
    line-height: 1.2;
  }
  .mobile-hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-hamburger:active { background: rgba(255, 255, 255, 0.16); }
  .mobile-hamburger-icon {
    position: relative;
    display: block;
    width: 18px;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
  }
  .mobile-hamburger-icon::before,
  .mobile-hamburger-icon::after {
    content: "";
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
  }
  .mobile-hamburger-icon::before { top: -6px; }
  .mobile-hamburger-icon::after  { top:  6px; }

  /* 品牌区: 纯图标, 三端统一不带文字 (2026-07-11) */
  .mobile-topbar-logo {
    display: inline-flex;
    align-items: center;
    gap: 0;
    text-decoration: none;
    min-width: 0;
  }
  /* 文字字标 LOGO (透明底白字「九派AI」logo-wide.png) */
  .mobile-topbar-logo-mark {
    width: auto;
    max-width: 96px;
    height: 28px;
    border-radius: 0;
    display: block;
    flex: none;
    object-fit: contain;
    box-shadow: none;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
  }
  .mobile-topbar-logo-text {
    display: none;
  }
  .mobile-topbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    text-decoration: none;
    line-height: 1;
  }
  .mobile-topbar-logout {
    height: 32px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    background: transparent;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
  }

  /* --- 隐藏桌面 workspace-bar --- */
  body.erp-body .workspace-bar { display: none !important; }
  body.erp-body .workspace-tabbar { display: none !important; }

  /* --- workspace-shell --- */
  body.erp-body .workspace-shell {
    display: block !important;
    min-height: calc(100vh - var(--mobile-topbar-height));
  }
  body.erp-body .content-shell {
    padding: 12px !important;
    min-height: 0 !important;
  }
  body.erp-body .page-content {
    padding-bottom: calc(var(--mobile-tabbar-height) + 18px) !important;
  }

  /* --- 二级导航：水平滚动 chip --- */
  body.erp-body .secondary-rail-overlay {
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    background: transparent !important;
    pointer-events: auto !important;
    z-index: auto !important;
  }
  body.erp-body .secondary-rail {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 0 10px 0 !important;
    padding: 8px 12px !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    border: 1px solid var(--line) !important;
    box-shadow: var(--shadow);
    transform: none !important;
    opacity: 1 !important;
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    display: flex !important;
    align-items: center;
    gap: 6px !important;
  }
  body.erp-body .secondary-rail::-webkit-scrollbar { display: none; }
  body.erp-body .secondary-group {
    display: inline-flex !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px !important;
  }
  body.erp-body .secondary-group + .secondary-group { margin-left: 4px !important; }
  body.erp-body .secondary-group-title { display: none !important; }
  body.erp-body .secondary-links {
    display: inline-flex !important;
    grid-template-columns: none !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
    flex: 0 0 auto;
  }
  body.erp-body .secondary-link {
    flex: 0 0 auto !important;
    padding: 6px 12px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    background: #f4f7fb;
    color: var(--muted-strong);
    border: 1px solid var(--line);
    white-space: nowrap;
    line-height: 1.2;
    height: auto;
    min-height: 0;
  }
  body.erp-body .secondary-link.active {
    background: var(--primary-soft);
    color: var(--primary-deep);
    border-color: var(--primary);
  }

  /* --- 移动端底部 Tab 栏 --- */
  .mobile-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(var(--mobile-tabbar-height) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    align-items: stretch;
    justify-content: space-around;
    gap: 0;
    background: #ffffff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 18px rgba(15, 31, 58, 0.08);
    z-index: var(--mobile-z-tabbar);
  }
  .mobile-tabbar-link {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px 4px;
    text-decoration: none;
    color: #8d97a9;
    font-size: 11px;
    font-weight: 600;
    background: transparent;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-tabbar-link.active { color: var(--primary-deep); }
  .mobile-tabbar-link:active { background: rgba(79, 146, 255, 0.06); }
  .mobile-tabbar-link .mobile-tab-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .mobile-tabbar-link .mobile-tab-icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
  }
  .mobile-tabbar-link .mobile-tab-label {
    line-height: 1.1;
    font-size: 11px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* --- 表格容器：横向滚动 --- */
  body.erp-body .table-wrap,
  body.erp-body .report-table-wrap,
  body.erp-body .transit-table-wrap,
  body.erp-body .table-scroll-wrap,
  body.erp-body .compact-table-wrap,
  body.erp-body .data-table-wrap,
  body.erp-body .lx-role-data-table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    max-width: 100%;
  }
  body.erp-body .data-table,
  body.erp-body .compact-table,
  body.erp-body .transit-data-table,
  body.erp-body .report-table,
  body.erp-body .panel table {
    min-width: max-content;
  }
  body.erp-body .data-table th,
  body.erp-body .data-table td,
  body.erp-body .transit-data-table th,
  body.erp-body .transit-data-table td,
  body.erp-body .compact-table th,
  body.erp-body .compact-table td,
  body.erp-body .report-table th,
  body.erp-body .report-table td {
    padding: 8px 10px;
    font-size: 12px;
    white-space: nowrap;
  }

  /* --- 面板/卡片自适应 --- */
  body.erp-body .panel,
  body.erp-body .report-panel,
  body.erp-body .compact-report-panel,
  body.erp-body .admin-main-panel,
  body.erp-body .admin-console-shell,
  body.erp-body .admin-console-shell-wide,
  body.erp-body .dimension-panel,
  body.erp-body .ranking-panel,
  body.erp-body .filter-panel,
  body.erp-body .report-filter-panel,
  body.erp-body .finance-workspace-panel,
  body.erp-body .settings-card,
  body.erp-body .finance-schema-card,
  body.erp-body .lx-role-console,
  body.erp-body .lx-function-layout {
    padding: 12px !important;
    border-radius: 10px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  body.erp-body .lx-role-console,
  body.erp-body .lx-function-layout,
  body.erp-body .lx-role-transfer-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* --- KPI/Hero 网格：2列 --- */
  body.erp-body .kpi-grid,
  body.erp-body .report-summary-grid,
  body.erp-body .dashboard-insight-grid,
  body.erp-body .dashboard-hero-grid,
  body.erp-body .dashboard-hero-grid-single,
  body.erp-body .dashboard-bi-hero-grid,
  body.erp-body .cockpit-kpi-grid,
  body.erp-body .trend-metric-grid,
  body.erp-body .sales-meta-grid,
  body.erp-body .selection-summary-grid,
  body.erp-body .logistics-summary-row,
  body.erp-body .home-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  /* --- 单列布局的网格 --- */
  body.erp-body .dimension-grid,
  body.erp-body .chart-grid,
  body.erp-body .metric-grid,
  body.erp-body .home-stage-v3,
  body.erp-body .home-grid,
  body.erp-body .login-grid,
  body.erp-body .filter-grid,
  body.erp-body .field-filter-grid,
  body.erp-body .logistics-filter-grid,
  body.erp-body .settings-inline-fields,
  body.erp-body .admin-form-grid,
  body.erp-body .finance-core-grid,
  body.erp-body .command-panel,
  body.erp-body .command-card-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* --- 表单/工具栏：纵向堆叠 --- */
  body.erp-body .toolbar-strip,
  body.erp-body .selection-toolbar,
  body.erp-body .page-toolbar,
  body.erp-body .filter-bar,
  body.erp-body .admin-toolbar,
  body.erp-body .toolbar-head {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 10px !important;
  }
  body.erp-body .toolbar-strip > *,
  body.erp-body .selection-toolbar > *,
  body.erp-body .page-toolbar > *,
  body.erp-body .filter-bar > *,
  body.erp-body .admin-toolbar > * {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  /* --- 输入框/按钮：触摸友好 --- */
  body.erp-body input[type="text"],
  body.erp-body input[type="search"],
  body.erp-body input[type="number"],
  body.erp-body input[type="email"],
  body.erp-body input[type="password"],
  body.erp-body input[type="tel"],
  body.erp-body input[type="url"],
  body.erp-body input[type="date"],
  body.erp-body input[type="datetime-local"],
  body.erp-body input[type="month"],
  body.erp-body select,
  body.erp-body textarea {
    min-height: 38px;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 8px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
  }
  body.erp-body .toolbar-search,
  body.erp-body .logistics-search-field,
  body.erp-body .selection-search,
  body.erp-body .lx-search-field {
    width: 100% !important;
    max-width: 100% !important;
  }
  body.erp-body .btn,
  body.erp-body .toolbar-btn,
  body.erp-body .toolbar-select-btn,
  body.erp-body .primary-btn,
  body.erp-body .ghost-btn,
  body.erp-body .secondary-btn,
  body.erp-body .danger-btn {
    min-height: 38px;
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 8px;
  }
  body.erp-body .btn-icon { width: 38px; height: 38px; }

  /* --- Modal: 全屏化 --- */
  body.erp-body .modal-overlay {
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
  }
  body.erp-body .modal-overlay .modal-card,
  body.erp-body .modal-card {
    width: 100% !important;
    max-width: 100% !important;
    height: 100vh;
    max-height: 100vh;
    margin: 0 !important;
    border-radius: 0 !important;
    padding: 16px !important;
    overflow-y: auto;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
  }
  body.erp-body .modal-card-body,
  body.erp-body .modal-body { max-height: none; }
  body.erp-body .modal-card-actions,
  body.erp-body .modal-actions {
    flex-wrap: wrap;
    gap: 8px;
    position: sticky;
    bottom: 0;
    background: #ffffff;
    padding-top: 8px;
    border-top: 1px solid var(--line);
    margin-top: 12px;
  }

  /* --- 日期选择器 --- */
  body.erp-body .date-range-picker {
    flex-direction: column !important;
    width: 100% !important;
    gap: 6px !important;
  }
  body.erp-body .date-range-picker > * {
    width: 100% !important;
    flex: 1 1 100% !important;
  }
  body.erp-body .date-range-shortcuts {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
  }

  /* --- 翻页器 --- */
  body.erp-body .pager,
  body.erp-body .report-pager {
    flex-wrap: wrap !important;
    gap: 6px !important;
    padding: 8px !important;
    justify-content: center !important;
  }
  body.erp-body .pager-controls,
  body.erp-body .report-pager-controls {
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
  }
  body.erp-body .pager-btn,
  body.erp-body .report-pager-btn {
    min-width: 36px;
    min-height: 36px;
    font-size: 12px;
    padding: 0 8px;
  }

  /* --- 字体缩小 --- */
  body.erp-body h1 { font-size: 22px; line-height: 1.25; }
  body.erp-body h2 { font-size: 18px; line-height: 1.3; }
  body.erp-body h3 { font-size: 16px; line-height: 1.3; }
  body.erp-body .page-title,
  body.erp-body .section-title { font-size: 18px; }

  /* 隐藏桌面专用提示 */
  body.erp-body .workspace-status-message,
  body.erp-body .desktop-only { display: none !important; }

  /* --- 图表 --- */
  body.erp-body .chart-container,
  body.erp-body .trend-chart,
  body.erp-body .trend-chart-shell {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.erp-body .chart-container canvas,
  body.erp-body .trend-chart canvas,
  body.erp-body .chart-svg {
    max-width: 100%;
    height: auto !important;
  }

  /* --- 登录页：竖屏堆叠 --- */
  body.login-body .login-shell { padding: 16px 0; }
  body.login-body .login-shell-split { padding: 0 12px; }
  body.login-body .login-stage-split {
    grid-template-columns: 1fr !important;
    max-width: 100%;
  }
  body.login-body .login-copy-split { display: none !important; }
  body.login-body .login-card,
  body.login-body .login-card-split {
    padding: 24px 18px !important;
    border-radius: 14px !important;
  }
}

/* ============================================================
   手机竖屏 ≤480px：极致紧凑
   ============================================================ */
@media (max-width: 480px) {
  :root {
    --mobile-tabbar-height: 56px;
    --mobile-topbar-height: 50px;
    --mobile-drawer-width: min(46vw, 156px);
  }

  body.erp-body .content-shell { padding: 8px !important; }
  body.erp-body .panel,
  body.erp-body .report-panel,
  body.erp-body .compact-report-panel,
  body.erp-body .admin-main-panel,
  body.erp-body .dimension-panel,
  body.erp-body .ranking-panel,
  body.erp-body .filter-panel,
  body.erp-body .report-filter-panel,
  body.erp-body .settings-card,
  body.erp-body .finance-schema-card {
    padding: 10px !important;
    border-radius: 8px !important;
  }

  /* KPI 单列 */
  body.erp-body .kpi-grid,
  body.erp-body .report-summary-grid,
  body.erp-body .dashboard-insight-grid,
  body.erp-body .dashboard-hero-grid,
  body.erp-body .dashboard-bi-hero-grid,
  body.erp-body .cockpit-kpi-grid,
  body.erp-body .trend-metric-grid,
  body.erp-body .sales-meta-grid,
  body.erp-body .selection-summary-grid,
  body.erp-body .logistics-summary-row,
  body.erp-body .home-kpi-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  body.erp-body .kpi-card .kpi-value,
  body.erp-body .dashboard-hero-card .dashboard-hero-value { font-size: 18px; }
  body.erp-body .kpi-card,
  body.erp-body .dashboard-hero-card,
  body.erp-body .dashboard-overview-card,
  body.erp-body .dashboard-decision-card { padding: 10px !important; }

  body.erp-body .data-table th,
  body.erp-body .data-table td,
  body.erp-body .transit-data-table th,
  body.erp-body .transit-data-table td,
  body.erp-body .compact-table th,
  body.erp-body .compact-table td {
    padding: 6px 8px;
    font-size: 11px;
  }

  body.erp-body h1 { font-size: 20px; }
  body.erp-body h2 { font-size: 17px; }
  body.erp-body h3 { font-size: 15px; }

  .mobile-tabbar-link .mobile-tab-label { font-size: 10.5px; }
  .mobile-tabbar-link .mobile-tab-icon svg { width: 20px; height: 20px; }

  body.erp-body .modal-card { padding: 14px !important; }

  .mobile-topbar-title { font-size: 14px; max-width: 45vw; }
  .mobile-topbar-logout { font-size: 11px; padding: 0 8px; }
}

/* iOS Safari 弹性滚动兼容 */
@supports (-webkit-overflow-scrolling: touch) {
  body.erp-body .table-wrap,
  body.erp-body .report-table-wrap,
  body.erp-body .transit-table-wrap,
  body.erp-body .table-scroll-wrap,
  body.erp-body .secondary-rail,
  body.erp-body .modal-card,
  body.erp-body .side-rail {
    -webkit-overflow-scrolling: touch;
  }
}
/* ▲▲▲ MOBILE REWRITE END ▲▲▲ */

/* ==============================================
   在途货件页 — 紧凑化（筛选栏 / KPI）
   仅作用于 .logistics-stage 范围
   ============================================== */
.logistics-stage .compact-report-panel.report-filter-panel {
  padding: 6px 10px;
  border-radius: 8px;
  margin-bottom: 6px;
}

.logistics-stage .report-toolbar-strip {
  gap: 6px;
  padding: 4px 0;
}

.logistics-stage .report-toolbar-strip .toolbar-inline-field {
  padding: 2px 6px;
  border-radius: 8px;
  gap: 4px;
}

.logistics-stage .report-toolbar-strip .toolbar-inline-field input,
.logistics-stage .report-toolbar-strip .toolbar-inline-field select {
  min-height: 28px;
  min-width: 110px;
  padding: 0 8px;
  font-size: 12px;
  border-radius: 7px;
}

.logistics-stage .report-toolbar-strip .toolbar-inline-product input {
  min-width: 170px;
}

.logistics-stage .report-toolbar-strip .toolbar-action-btn {
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 7px;
}

.logistics-stage .report-toolbar-strip .icon-btn.toolbar-action-btn {
  padding: 0 6px;
}

.logistics-stage .report-toolbar-strip .date-range-picker {
  min-height: 28px;
  font-size: 12px;
}

/* KPI 卡片紧凑化 */
.logistics-stage .kpi-grid.report-summary-grid {
  gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  margin-bottom: 6px;
}

.logistics-stage .kpi-card {
  min-height: 0;
  padding: 8px 10px 8px 12px;
  border-radius: 8px;
}

.logistics-stage .kpi-card::before {
  width: 3px;
}

.logistics-stage .kpi-card span {
  font-size: 11px;
  line-height: 1.3;
}

.logistics-stage .kpi-card strong {
  margin: 3px 0 0;
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.1;
}

.logistics-stage .kpi-card small {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.3;
}

@media (max-width: 768px) {
  .logistics-stage .kpi-grid.report-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .logistics-stage .kpi-card {
    padding: 6px 8px 6px 10px !important;
  }
}

/* ===============================================================
   2026-05 领星视图层重写新增样式（产品/Listing/SC库存/报表/风控/首页）
   =============================================================== */
.kpi-card .kpi-tip,
.kpi-tip {
  color: #94a3b8;
  font-size: 11px;
  margin-top: 2px;
  line-height: 1.3;
}

.state-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
}
.state-pill.ok      { background: #dcfce7; color: #15803d; }
.state-pill.warn    { background: #fef3c7; color: #92400e; }
.state-pill.danger  { background: #fee2e2; color: #b91c1c; }
.state-pill.info    { background: #dbeafe; color: #1d4ed8; }
.state-pill.muted   { background: #f1f5f9; color: #64748b; }

.home-kpi-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  min-height: 70px;
}
.home-kpi-card.kpi-primary { border-color: #c7d2fe; background: #eef2ff; }
.home-kpi-card.kpi-ok      { border-color: #86efac; background: #f0fdf4; }
.home-kpi-card.kpi-warn    { border-color: #fde68a; background: #fffbeb; }
.home-kpi-card.kpi-danger  { border-color: #fecaca; background: #fef2f2; }
.home-kpi-card.kpi-muted   { border-color: #e2e8f0; background: #f8fafc; }
.home-kpi-card .home-kpi-label { font-size: 12px; color: #64748b; }
.home-kpi-card .home-kpi-value { font-size: 22px; font-weight: 700; color: #0f172a; line-height: 1.1; }
.home-kpi-card .home-kpi-sub   { font-size: 11px; color: #94a3b8; line-height: 1.3; }

.home-risk-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 4px;
}
.home-risk-item.home-risk-danger { background: #fef2f2; }
.home-risk-item.home-risk-warn   { background: #fffbeb; }
.home-risk-item.home-risk-ok     { background: #f0fdf4; }
.home-risk-item.home-risk-muted  { background: #f8fafc; }
.home-risk-tag {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: #fff;
  color: #475569;
  border: 1px solid #e2e8f0;
}
.home-risk-text { flex: 1; font-size: 13px; color: #0f172a; }

.home-dim-item {
  margin-bottom: 10px;
  font-size: 13px;
}
.home-dim-item .home-dim-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}
.home-dim-item .home-dim-name { font-weight: 500; color: #0f172a; }
.home-dim-item .home-dim-value { color: #2563eb; font-weight: 600; }
.home-dim-item .home-dim-bar {
  background: #f1f5f9;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 2px;
}
.home-dim-item .home-dim-bar-fill {
  background: linear-gradient(90deg, #6366f1, #2563eb);
  height: 100%;
}
.home-dim-item .home-dim-sub { font-size: 11px; color: #94a3b8; }

/* lx-tabs (库存风控 4 tab) */
.lx-tabs { display: flex; gap: 4px; padding: 8px 12px 0; border-bottom: 1px solid #e5e7eb; flex-wrap: wrap; }
.lx-tab-btn { background: transparent; border: none; padding: 8px 16px; cursor: pointer; color: #64748b; border-bottom: 2px solid transparent; font-size: 14px; }
.lx-tab-btn.active { color: #0f172a; border-bottom-color: #2563eb; font-weight: 600; }
.lx-tab-btn:hover { color: #0f172a; }

/* ===== 售后分析 (as-stage / as-tabbar) ===== */
.as-stage .as-tabbar {
  display: inline-flex;
  gap: 4px;
  background: var(--card-soft, #f3f4f6);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 999px;
  padding: 3px;
  margin-right: 12px;
}
.as-stage .as-tab {
  border: 0;
  background: transparent;
  color: #475569;
  padding: 5px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}
.as-stage .as-tab.active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15,23,42,0.08);
}
.as-stage .as-tab:hover:not(.active) { color: #0f172a; }
