:root {
  --bg: #f1f4f6;
  --panel: #ffffff;
  --panel-soft: #f7f9fa;
  --text: #18212a;
  --muted: #65717e;
  --line: #dce2e6;
  --line-strong: #c7d0d8;
  --nav: #111820;
  --nav-hover: #202b35;
  --blue: #2859d6;
  --blue-dark: #1f48b2;
  --green: #16805f;
  --red: #c43d35;
  --amber: #ad6b00;
  --cyan: #168e9b;
  --shadow: 0 1px 2px rgba(16, 24, 32, 0.035), 0 8px 24px rgba(16, 24, 32, 0.04);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  scrollbar-color: #a7b1c2 transparent;
}

.hidden {
  display: none !important;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #eef2f7;
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
}

.login-panel label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

.login-brand {
  padding: 0 0 16px;
  border-bottom-color: var(--line);
  color: var(--text);
}

.login-brand span {
  color: var(--muted);
}

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

.sidebar {
  background: var(--nav);
  color: #e6edf7;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 16px 12px 24px;
  border-right: 1px solid #282e34;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 8px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  overflow: hidden;
}

.brand-mark img {
  width: 38px;
  height: 38px;
  display: block;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: #9aa4b2;
  font-size: 12px;
  margin-top: 3px;
}

.mobile-nav-toggle {
  display: none;
}

nav {
  display: grid;
  gap: 3px;
  margin-top: 14px;
}

.nav-group-label {
  margin: 14px 10px 4px;
  color: #7f8b95;
  font-size: 11px;
  font-weight: 700;
}

.nav-group-label:first-child {
  margin-top: 0;
}

nav button {
  position: relative;
  border: 0;
  color: #d0d5dd;
  background: transparent;
  text-align: left;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
}

nav button.active,
nav button:hover {
  background: var(--nav-hover);
  color: #ffffff;
}

nav button:focus-visible {
  outline: 2px solid #6f9cff;
  outline-offset: 1px;
}

nav button::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: transparent;
  transform: translateY(-50%);
}

nav button.active::before {
  background: #48b9c7;
}

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

.topbar,
.section-row,
.top-actions,
.toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar,
.section-row {
  justify-content: space-between;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 70px;
  margin: 0 -22px 16px;
  padding: 11px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 246, 248, 0.96);
  backdrop-filter: blur(8px);
}

.section-row {
  margin-bottom: 14px;
}

.section-space {
  margin-top: 18px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 15px;
  margin-bottom: 8px;
}

.topbar p,
.section-row p,
.notice,
.process-grid p,
.empty {
  color: var(--muted);
}

.button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #ffffff;
  border-radius: 6px;
  padding: 9px 13px;
  line-height: 1;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.button:hover {
  background: var(--blue-dark);
}

.button:disabled {
  border-color: #d7dde6;
  background: #e9edf2;
  color: #8b95a5;
  cursor: not-allowed;
}

.button.ghost {
  background: #ffffff;
  color: var(--blue);
}

.button.ghost:hover {
  background: #eef4ff;
}

.button.danger {
  background: var(--red);
  border-color: var(--red);
}

.button.danger:hover {
  background: #9e1f16;
}

.button.danger-outline {
  border-color: #e2aaa6;
  background: #fff;
  color: var(--red);
}

.button.danger-outline:hover {
  border-color: var(--red);
  background: #fff1ef;
}

.global-search {
  position: relative;
  width: min(460px, 38vw);
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 38px;
  gap: 6px;
}

.global-search .input {
  min-height: 38px;
  padding-left: 38px;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.topbar-title {
  min-width: 220px;
}

.top-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}

.topbar-title p {
  margin-top: 3px;
  font-size: 13px;
}

.button.small {
  min-height: 30px;
  padding: 6px 9px;
  font-size: 13px;
}

.user-badge {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  white-space: nowrap;
}

.toolbar {
  flex-wrap: wrap;
  margin: 12px 0;
}

.issue-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.permission-grid label {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.permission-tools {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.permission-groups {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.permission-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.permission-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.permission-group-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.permission-group-title strong {
  font-size: 15px;
}

.permission-group-title span {
  color: var(--muted);
  font-size: 12px;
}

.permission-site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px;
  padding: 10px;
}

.permission-site {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.permission-site.disabled {
  color: var(--muted);
  background: #f8fafc;
}

.permission-site small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.issue-tab {
  min-height: 36px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  border-radius: 7px;
  padding: 8px 11px;
  cursor: pointer;
  font: inherit;
}

.issue-tab.active {
  border-color: var(--blue);
  color: var(--blue);
  background: #eef4ff;
}

.issue-tab span {
  display: inline-flex;
  min-width: 22px;
  justify-content: center;
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #edf2f7;
  color: var(--muted);
  font-size: 12px;
}

.toolbar.inline {
  margin: 0;
}

.status {
  min-height: 40px;
  margin-bottom: 14px;
}

.status:empty {
  display: none;
}

.toast {
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 7px;
}

.toast.error {
  border-left-color: var(--red);
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(112px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric,
.surface,
.table-wrap,
.process-grid {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  min-height: 84px;
  padding: 14px 15px;
  border-top: 2px solid #d5dde4;
}

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

.metric strong {
  display: block;
  font-size: 24px;
  margin-top: 6px;
}

.workdesk {
  padding-bottom: 14px;
}

.workdesk-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(132px, 1fr));
  gap: 10px;
}

.workdesk-card {
  min-height: 104px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.workdesk-card:hover {
  background: #fbfdff;
  border-color: #b9c5d6;
}

.workdesk-card span,
.workdesk-card small {
  color: var(--muted);
}

.workdesk-card strong {
  font-size: 25px;
  line-height: 1;
}

.workdesk-card.ok {
  border-left-color: var(--green);
}

.workdesk-card.warn {
  border-left-color: var(--amber);
}

.workdesk-card.danger {
  border-left-color: var(--red);
}

.workdesk-card.info {
  border-left-color: var(--blue);
}

.surface {
  padding: 18px;
  margin-bottom: 16px;
}

.page-heading {
  padding: 4px 0 0;
}

.page-heading h2 {
  font-size: 21px;
}

.page-heading p {
  margin-top: 4px;
}

.compact-row {
  margin-bottom: 10px;
}

.compact-row h3 {
  margin-bottom: 3px;
}

.filter-surface {
  padding: 14px 16px;
  border-color: var(--line-strong);
}

.filter-surface .form-grid {
  gap: 10px;
}

.filter-surface .toolbar {
  margin-top: 12px;
  gap: 8px;
}

.sticky-tools {
  position: sticky;
  top: 84px;
  z-index: 9;
}

.result-count {
  min-width: 96px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

.product-table {
  max-height: 56vh;
  border-color: var(--line-strong);
}

.product-table th {
  background: #eef2f7;
}

.product-table tr.exact-match td {
  background: #eef5ff;
  box-shadow: inset 0 1px #cbdcff, inset 0 -1px #cbdcff;
}

.marker-stack {
  min-width: 150px;
  display: grid;
  justify-items: start;
  gap: 5px;
}

.marker-note {
  color: var(--muted);
  font-size: 12px;
  white-space: normal;
}

.disclosure {
  padding: 0;
  overflow: hidden;
}

.disclosure > summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  background: #ffffff;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.disclosure > summary::-webkit-details-marker {
  display: none;
}

.disclosure > summary::after {
  content: "展开";
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
}

.disclosure[open] > summary {
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.disclosure[open] > summary::after {
  content: "收起";
}

.disclosure-body {
  padding: 16px;
}

.compact-metrics {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

.segmented {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: #ffffff;
}

.segmented label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-right: 1px solid var(--line);
  cursor: pointer;
  white-space: nowrap;
}

.segmented label:last-child {
  border-right: 0;
}

.notice {
  margin-top: 10px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.88fr) minmax(420px, 1.12fr);
  gap: 16px;
}

.action-grid {
  display: grid;
  grid-template-columns: minmax(520px, 1.1fr) minmax(420px, 0.9fr);
  gap: 16px;
  margin-bottom: 16px;
}

.action-box {
  display: grid;
  align-content: start;
  gap: 12px;
  border-left: 4px solid var(--blue);
}

.action-box.manual {
  border-left-color: var(--amber);
}

.action-box.auto {
  border-left-color: var(--green);
}

.action-box p {
  color: var(--muted);
  margin-top: 4px;
}

.check-list {
  display: grid;
  gap: 10px;
}

.check-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.check-item > span {
  display: inline-flex;
  justify-content: center;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.check-item.ok > span {
  color: var(--green);
  background: #effaf3;
}

.check-item.warn > span {
  color: var(--amber);
  background: #fff8ea;
}

.check-item p,
.plan-card span {
  color: var(--muted);
}

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

.plan-card {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.plan-card strong,
.plan-card span {
  display: block;
}

.plan-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
}

.process-grid > div {
  padding: 18px;
  border-right: 1px solid var(--line);
}

.process-grid > div:last-child {
  border-right: 0;
}

.step {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #edf3ff;
  color: var(--blue);
  font-weight: 800;
  margin-bottom: 10px;
}

.table-wrap {
  overflow: auto;
  max-height: 64vh;
}

.table-wrap.short {
  max-height: 36vh;
}

.strategy-table {
  min-width: 2520px;
}

.strategy-table th {
  min-width: 112px;
  white-space: nowrap;
  vertical-align: bottom;
}

.strategy-table th:first-child,
.strategy-table td:first-child {
  min-width: 180px;
}

.strategy-table th:last-child,
.strategy-table td:last-child {
  min-width: 190px;
}

.strategy-table th:nth-child(3),
.strategy-table td:nth-child(3) {
  min-width: 190px;
}

.strategy-table th:nth-child(8),
.strategy-table td:nth-child(8) {
  min-width: 160px;
}

.strategy-table .strategy-rule-cell {
  min-width: 280px;
  line-height: 1.7;
  white-space: normal;
}

.strategy-table .strategy-rule-cell .number-input {
  width: 64px;
  min-width: 64px;
  padding-inline: 8px;
}

.strategy-table .strategy-rule-cell .inline-check {
  margin: 0 0 4px;
}

.strategy-table .strategy-rule-cell > span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.focus-control-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(580px, 2.2fr);
  gap: 12px;
}

.focus-runtime-surface,
.focus-strategy-surface,
.focus-current-section,
.focus-add-section {
  margin-top: 0;
}

.focus-runtime-surface {
  display: flex;
  min-height: 100%;
  flex-direction: column;
}

.focus-runtime-surface > .toolbar {
  margin-top: auto;
  padding-top: 18px;
}

.runtime-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.focus-strategy-grid {
  grid-template-columns: repeat(4, minmax(112px, 1fr));
}

.toggle-field {
  align-self: end;
  min-height: 38px;
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.toggle-field input {
  width: 16px;
  height: 16px;
}

.input-with-unit {
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

.input-with-unit:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(38, 103, 230, 0.1);
}

.input-with-unit .input {
  min-width: 0;
  border: 0;
  box-shadow: none;
}

.input-with-unit > span {
  flex: 0 0 auto;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.compact-note {
  margin: 10px 0 0;
}

.focus-current-section,
.focus-add-section {
  margin-top: 12px;
  padding: 0;
  overflow: hidden;
}

.focus-current-section > .section-row,
.focus-add-section > .section-row {
  padding: 16px 18px 12px;
}

.focus-current-section h3,
.focus-add-section h3,
.focus-control-grid h3 {
  margin: 2px 0 0;
}

.focus-current-section p,
.focus-add-section p {
  margin: 4px 0 0;
}

.focus-products-table {
  border-width: 1px 0 0;
  border-radius: 0;
}

.focus-search-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 150px auto;
  align-items: end;
  gap: 12px;
  padding: 0 18px 16px;
}

.focus-search-row > label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}

.focus-add-actions {
  min-height: 38px;
  align-items: center;
}

.search-guidance {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin: 0 18px 16px;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 13px;
}

.search-guidance svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.focus-candidate-results {
  border-width: 1px 0 0;
  border-radius: 0;
}

.focus-candidate-results[hidden] {
  display: none;
}

.account-table {
  max-height: 42vh;
}

table {
  width: 100%;
  min-width: 1060px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3f5f7;
  font-weight: 700;
}

tr:hover td {
  background: #f5f8fb;
}

.draft-group-row td,
.draft-group-row:hover td {
  background: #f6f8fb;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.draft-group-title {
  font-weight: 700;
}

.draft-group-count,
.draft-group-help {
  margin-left: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.actions {
  white-space: nowrap;
}

.table-wrap td.actions {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #ffffff;
  box-shadow: -8px 0 12px rgba(15, 23, 42, 0.06);
}

tr:hover td.actions {
  background: #fbfdff;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
  white-space: nowrap;
}

.pill.ok {
  color: var(--green);
  border-color: #9bd4b0;
  background: #effaf3;
}

.pill.bad {
  color: var(--red);
  border-color: #f0b8b2;
  background: #fff3f1;
}

.pill.warn {
  color: var(--amber);
  border-color: #f2c98c;
  background: #fff8ea;
}

.transfer-mark {
  display: grid;
  gap: 4px;
  min-width: 180px;
}

.transfer-mark-detail {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
}

textarea,
.input,
select.input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 38px;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--text);
  resize: vertical;
  font: inherit;
}

textarea:focus,
.input:focus,
select.input:focus {
  outline: 3px solid rgba(37, 99, 217, 0.14);
  border-color: var(--blue);
}

.compact-input {
  min-width: 150px;
}

.compact-select {
  min-width: 118px;
}

.time-input {
  width: 76px;
}

.number-input {
  width: 72px;
  padding: 8px;
}

.tiny-input {
  width: 78px;
}

.mono {
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
}

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

.form-grid.compact {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.form-grid label span {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

.wide-field {
  grid-column: span 3;
}

.inline-select {
  width: auto;
  min-width: 240px;
}

.plain-box {
  min-height: 40px;
  padding: 10px 0;
  color: var(--muted);
}

.tool-frame {
  width: 100%;
  min-height: 760px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.link-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 10px;
}

.wide-text {
  min-width: 280px;
  max-width: 520px;
}

.action-hint {
  margin-top: 6px;
  padding-left: 8px;
  border-left: 3px solid #c7d7fe;
  color: var(--blue);
  font-size: 12px;
  line-height: 1.45;
}

.summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.summary-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
  color: var(--text);
}

.summary-pill.muted {
  color: var(--muted);
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
}

.inline-check input {
  width: 16px;
  height: 16px;
}

.log-toggle {
  margin: 0 0 10px;
}

.section-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.health-panel {
  margin-top: 12px;
}

.health-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.health-card.ok {
  border-left: 4px solid var(--green);
}

.health-card.slow,
.health-card.warn {
  border-left: 4px solid var(--amber);
}

.health-card.error {
  border-left: 4px solid var(--red);
}

.health-card p {
  margin: 3px 0 0;
  color: var(--muted);
}

.health-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.health-actions {
  display: flex;
  justify-content: flex-start;
}

.health-item {
  display: grid;
  gap: 3px;
  min-width: 140px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

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

.health-item strong {
  font-size: 18px;
}

.health-item small {
  color: var(--muted);
}

.empty {
  padding: 18px;
  text-align: center;
}

details.surface {
  padding: 0;
}

details.surface summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 700;
}

details.surface[open] summary {
  border-bottom: 1px solid var(--line);
}

details.config-fold .form-grid {
  margin: 16px;
}

details.surface textarea,
details.surface .toolbar,
details.surface .notice,
details.surface .plain-box,
details.surface .button {
  margin-left: 16px;
  margin-right: 16px;
}

details.surface textarea {
  width: calc(100% - 32px);
}

details.surface .button {
  margin-bottom: 16px;
}

.selection-count {
  align-self: center;
  color: var(--muted);
  font-size: 13px;
  padding: 0 4px;
  white-space: nowrap;
}

@media (max-width: 1280px) {
  .topbar {
    flex-wrap: wrap;
  }

  .global-search {
    flex: 1 1 360px;
    width: auto;
  }

  .sticky-tools {
    position: static;
  }

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

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

@media (max-width: 1080px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 12px 16px;
  }

  .brand {
    padding: 0 0 10px;
  }

  nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    margin-top: 10px;
  }

  .nav-group-label {
    grid-column: 1 / -1;
    margin: 8px 4px 0;
  }

  nav button {
    padding: 8px 10px;
  }

  .main {
    padding: 0 18px 18px;
  }

  .topbar {
    position: static;
    margin: 0 -18px 16px;
    padding: 14px 18px;
  }

  .global-search {
    width: 100%;
  }

  .sticky-tools {
    position: static;
  }

  .dashboard-grid,
  .action-grid,
  .process-grid,
  .workdesk-grid,
  .permission-tools,
  .form-grid,
  .form-grid.compact {
    grid-template-columns: 1fr;
  }

  .process-grid > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .process-grid > div:last-child {
    border-bottom: 0;
  }

  .topbar,
  .section-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .global-search {
    grid-template-columns: minmax(0, 1fr) 38px;
  }

  .toolbar {
    align-items: stretch;
  }

  .toolbar .button {
    white-space: normal;
  }
}

/* 5.7 command-center visual system */
.shell {
  grid-template-columns: 216px minmax(0, 1fr);
}

.sidebar {
  padding: 14px 10px 22px;
  border-right-color: #25313b;
  background: var(--nav);
}

.brand {
  gap: 10px;
  min-height: 58px;
  padding: 5px 7px 15px;
}

.brand-mark,
.brand-mark img {
  width: 36px;
  height: 36px;
}

.brand-mark {
  flex: 0 0 36px;
  border-radius: 7px;
  background: #0d1319;
}

.brand strong {
  font-size: 14px;
  line-height: 1.25;
}

.brand span {
  margin-top: 2px;
  color: #8d9aa7;
  font-size: 11px;
}

nav {
  gap: 2px;
  margin-top: 10px;
}

.nav-group-label {
  margin: 15px 10px 5px;
  color: #647485;
  font-size: 10px;
  letter-spacing: 0;
}

nav button {
  min-height: 38px;
  gap: 9px;
  padding: 8px 10px;
  color: #bdc8d2;
  border-radius: 5px;
}

nav button svg {
  width: 17px;
  height: 17px;
  color: #91a0ad;
}

nav button.active {
  background: #24313b;
}

nav button.active svg {
  color: #6fd0ca;
}

nav button.active::before {
  height: 20px;
  background: #55c6bf;
}

.main {
  padding: 0 20px 28px;
}

.topbar {
  min-height: 66px;
  margin: 0 -20px 14px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom-color: #dfe4e8;
  box-shadow: 0 1px 4px rgba(17, 24, 32, 0.035);
}

.topbar-title {
  min-width: 210px;
}

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

.topbar-title p {
  color: #74808c;
  font-size: 12px;
}

.global-search {
  width: min(480px, 36vw);
}

.global-search .input {
  background: #f8fafb;
  border-color: #d5dde3;
  box-shadow: none;
}

.global-search .input:focus {
  background: #fff;
}

.system-health {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  white-space: nowrap;
}

.system-health > span {
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 50%;
  background: var(--green);
}

.system-health.attention > span {
  background: var(--amber);
}

.user-badge {
  min-height: 30px;
  border-radius: 6px;
  background: #f7f9fa;
  font-size: 12px;
}

.status {
  min-height: 0;
  margin-bottom: 12px;
}

.integration-alerts {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}

.integration-alerts[hidden] {
  display: none;
}

.integration-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid #efb8b2;
  border-left: 4px solid var(--red);
  border-radius: 7px;
  background: #fff5f4;
  color: #8f241b;
}

.integration-alert.warning {
  border-color: #e7c58a;
  border-left-color: var(--amber);
  background: #fff9ed;
  color: #805000;
}

.integration-alert svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.integration-alert div {
  display: grid;
  gap: 2px;
}

.integration-alert strong {
  font-size: 13px;
}

.integration-alert span {
  font-size: 12px;
  line-height: 1.5;
}

.toast {
  padding: 9px 11px;
  border-radius: 5px;
  box-shadow: none;
}

.metric-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.metric-primary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 10px;
}

.metric-secondary-strip {
  min-height: 52px;
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
}

.metric {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 7px;
  box-shadow: none;
}

.metric.primary {
  position: relative;
  min-height: 96px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr auto;
  align-items: start;
  padding: 15px 16px;
  border: 1px solid var(--line);
  background: #fff;
}

.metric.primary span {
  color: #5f6c78;
  font-size: 12px;
  font-weight: 600;
}

.metric.primary strong {
  align-self: end;
  margin: 8px 0 0;
  font-size: 27px;
  line-height: 1.15;
}

.metric.primary .metric-detail {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  margin-top: 5px;
}

.metric-icon {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--blue);
  background: #edf3ff;
}

.metric-icon svg {
  width: 17px;
  height: 17px;
}

.metric.secondary {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.metric.secondary:last-child {
  border-right: 0;
}

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

.metric.secondary strong {
  margin: 0;
  font-size: 18px;
}

.surface,
.table-wrap,
.process-grid {
  border-radius: 7px;
  box-shadow: none;
}

.surface {
  padding: 16px;
  margin-bottom: 14px;
}

.surface h2 {
  font-size: 16px;
}

.section-kicker {
  display: block;
  margin-bottom: 3px;
  color: #7b8792;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.section-heading {
  margin-bottom: 12px;
}

.workdesk {
  padding: 0;
  overflow: hidden;
}

.workdesk > .section-row {
  min-height: 52px;
  margin: 0;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.workdesk-grid {
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 0;
}

.workdesk-card {
  min-height: 84px;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: start;
  gap: 5px 10px;
  padding: 13px 14px;
  border: 0;
  border-right: 1px solid var(--line);
  border-left: 3px solid transparent;
  border-radius: 0;
  background: #fff;
}

.workdesk-card:last-child {
  border-right: 0;
}

.workdesk-card strong {
  grid-column: 2;
  grid-row: 1 / span 2;
  font-size: 22px;
}

.workdesk-card small {
  font-size: 11px;
}

.workdesk-card.ok {
  border-left-color: var(--green);
}

.workdesk-card.warn {
  border-left-color: var(--amber);
}

.workdesk-card.danger {
  border-left-color: var(--red);
}

.workdesk-card.info {
  border-left-color: var(--blue);
}

.command-surface {
  padding: 0;
  overflow: visible;
}

.command-surface > .section-row {
  min-height: 68px;
  margin: 0;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.command-bar {
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}

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

.primary-actions {
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.button {
  min-height: 34px;
  gap: 7px;
  padding: 8px 11px;
  border-radius: 5px;
  font-size: 13px;
}

.button svg,
.icon-button svg {
  width: 16px;
  height: 16px;
}

.danger-menu {
  position: relative;
  margin-left: auto;
}

.danger-menu > summary {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}

.danger-menu > summary::-webkit-details-marker {
  display: none;
}

.danger-menu > div {
  position: absolute;
  right: 0;
  z-index: 12;
  width: 270px;
  margin-top: 6px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(17, 24, 32, 0.14);
}

.danger-menu p {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.command-surface > .notice {
  margin: 0;
  padding: 0 16px 13px;
  font-size: 12px;
}

.dashboard-grid {
  grid-template-columns: minmax(330px, 0.78fr) minmax(520px, 1.22fr);
  gap: 14px;
}

.check-summary-ok {
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
}

.check-summary-ok > svg {
  width: 25px;
  height: 25px;
  color: var(--green);
}

.check-summary-ok p {
  color: var(--muted);
  font-size: 12px;
}

.check-item {
  border-radius: 5px;
  box-shadow: none;
}

.health-card {
  margin-top: 10px;
  padding: 12px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.health-card::before {
  display: none;
}

.health-grid {
  gap: 8px;
}

.health-item {
  border-radius: 5px;
  background: #f7f9fa;
}

.plan-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--line);
}

.plan-row {
  min-height: 64px;
  display: grid;
  grid-template-columns: 8px minmax(230px, 1.4fr) minmax(250px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
}

.plan-state {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9ba6af;
}

.plan-state.running {
  background: var(--green);
}

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

.plan-main strong,
.plan-main span {
  display: block;
}

.plan-main span {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: #4f5c68;
  font-size: 12px;
}

.filter-surface {
  border-color: var(--line);
  background: #fff;
}

.sticky-tools {
  top: 78px;
}

.table-wrap {
  border-color: #d6dde3;
}

table {
  font-size: 13px;
}

th {
  color: #4e5b67;
  background: #f4f7f9;
  font-size: 12px;
}

td {
  border-bottom-color: #e6eaed;
}

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

.issue-tab,
.store-tab {
  border-radius: 5px;
}

.issue-tab.active {
  background: #edf3ff;
}

.login-screen {
  background: #edf1f3;
}

.login-panel {
  border-radius: 7px;
  box-shadow: 0 18px 42px rgba(17, 24, 32, 0.12);
}

@media (max-width: 1440px) {
  .metric-primary-grid {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
  }

  .workdesk-grid {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

  .workdesk-card:nth-child(3n) {
    border-right: 0;
  }

  .workdesk-card:nth-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }
}

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

  .topbar {
    flex-wrap: wrap;
  }

  .topbar-title {
    min-width: 0;
  }

  .global-search {
    width: min(520px, 60vw);
  }

  .metric-primary-grid,
  .metric-secondary-strip {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .metric.secondary {
    border-bottom: 1px solid var(--line);
  }

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

@media (max-width: 720px) {
  .main {
    padding: 0 12px 22px;
  }

  .topbar {
    margin: 0 -12px 12px;
    padding: 10px 12px;
  }

  .topbar-title {
    order: 1;
  }

  .top-actions {
    order: 2;
    width: auto;
    margin-left: auto;
  }

  .global-search {
    order: 3;
    width: 100%;
  }

  .system-health,
  .user-badge {
    display: none;
  }

  .metric-primary-grid,
  .metric-secondary-strip,
  .workdesk-grid {
    grid-template-columns: 1fr 1fr;
  }

  .metric.primary {
    min-height: 88px;
  }

  .metric.secondary {
    border-right: 1px solid var(--line);
  }

  .workdesk-card,
  .workdesk-card:nth-child(3n) {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .command-surface > .section-row,
  .command-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-actions {
    padding: 10px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .danger-menu {
    margin-left: 0;
  }

  .danger-menu > div {
    right: auto;
    left: 0;
  }

  .plan-row {
    grid-template-columns: 8px minmax(0, 1fr) auto;
  }

  .plan-facts {
    grid-column: 2 / -1;
  }
}

/* 5.5 cloud console */
button,
input,
select,
textarea {
  letter-spacing: 0;
}

svg.lucide {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  stroke-width: 1.9;
}

.button svg {
  width: 16px;
  height: 16px;
  margin-right: 7px;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 38px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: #4f5d69;
  cursor: pointer;
}

.icon-button:hover {
  border-color: #9eabb6;
  background: #f7f9fb;
  color: var(--text);
}

.global-search > svg {
  position: absolute;
  z-index: 1;
  left: 13px;
  top: 11px;
  color: #7a8792;
  pointer-events: none;
}

.topbar .icon-button {
  box-shadow: 0 1px 2px rgba(20, 30, 40, 0.04);
}

.nav-badge {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 999px;
  background: #c23b32;
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

.eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
}

.metric.cloud {
  border-top-color: var(--cyan);
}

.metric.info {
  border-top-color: var(--blue);
}

.metric.ok {
  border-top-color: var(--green);
}

.metric.warn {
  border-top-color: var(--amber);
}

.metric.muted {
  border-top-color: #9aa4ad;
}

.store-metrics {
  grid-template-columns: repeat(5, minmax(140px, 1fr));
}

.store-sync-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px 24px;
  border-left: 4px solid var(--blue);
}

.store-sync-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
}

.store-sync-heading {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-width: 0;
}

.store-sync-heading > svg {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: var(--blue);
  flex: 0 0 auto;
}

.store-sync-heading h3,
.store-sync-heading p {
  margin: 0;
}

.store-sync-heading p {
  margin-top: 5px;
  color: var(--muted);
}

.store-sync-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.store-sync-panel > .notice {
  grid-column: 1 / -1;
  margin: 0;
}

.sync-state {
  min-width: 116px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 11px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

.sync-state.ready {
  background: #e9f7f0;
  color: #147a56;
}

.sync-state.busy {
  background: #e9f1ff;
  color: var(--blue);
}

.sync-state.cooldown {
  background: #fff4dd;
  color: #9a6300;
}

.sync-state-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.pending-store-panel {
  border-left: 4px solid var(--amber);
}

.pending-store-panel.all-clear {
  border-left-color: var(--green);
}

.bulk-store-setup {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto auto;
  align-items: end;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.bulk-store-setup label,
.store-group-fields label {
  display: grid;
  gap: 5px;
}

.bulk-store-setup label > span,
.store-group-fields label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.store-tabs {
  display: flex;
  gap: 2px;
  margin: 12px 0;
  padding: 3px;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f1f4f6;
}

.store-tab {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
}

.store-tab:hover {
  color: var(--text);
}

.store-tab.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(20, 30, 40, 0.1);
}

.store-tab span {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: #e5eaee;
  color: #5c6974;
  font-size: 11px;
}

.store-tab.active span {
  background: #e9f1ff;
  color: var(--blue);
}

.store-group-fields {
  grid-template-columns: minmax(180px, 0.8fr) minmax(180px, 1fr) minmax(220px, 1fr) minmax(260px, 1.25fr);
}

.pending-table {
  max-height: 30vh;
  box-shadow: none;
}

.store-directory .account-table {
  margin-top: 12px;
  box-shadow: none;
}

.store-control-table {
  min-width: 1120px;
}

.store-control-row > td {
  vertical-align: top;
  background: #fff;
}

.store-control-row.is-inactive > td {
  background: #fbfcfd;
}

.store-group-control-row > td {
  padding-top: 12px;
  padding-bottom: 12px;
  border-top: 2px solid #d7e0e8;
  background: #eef4fb;
  vertical-align: middle;
}

.store-group-control-row.is-inactive > td {
  background: #f4f6f8;
}

.store-group-control-main {
  display: grid;
  gap: 5px;
}

.store-group-control-main > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.store-group-control-main strong {
  font-size: 15px;
}

.store-group-control-main small {
  color: var(--muted);
}

.store-group-actions {
  display: grid;
  gap: 7px;
}

.store-group-control-row .sticky-action-cell {
  background: #eef4fb;
}

.store-group-control-row.is-inactive .sticky-action-cell {
  background: #f4f6f8;
}

.store-status-cell {
  min-width: 145px;
}

.store-status-stack {
  display: grid;
  justify-items: start;
  gap: 5px;
  margin-bottom: 9px;
}

.store-status-stack small,
.store-name-cell small,
.store-product-count small {
  color: var(--muted);
}

.store-toggle-button {
  min-width: 70px;
}

.store-name-cell {
  min-width: 190px;
}

.store-name-input {
  width: 100%;
  margin-bottom: 6px;
  font-weight: 650;
}

.store-identity-cell {
  min-width: 225px;
}

.store-identity-cell .site-select {
  width: 120px;
  margin-bottom: 6px;
}

.store-identity-cell label {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  margin-top: 5px;
}

.store-identity-cell label > span {
  color: var(--muted);
  font-size: 11px;
}

.store-product-count {
  min-width: 82px;
  text-align: center;
}

.store-product-count strong,
.store-product-count small {
  display: block;
}

.store-product-count strong {
  font-size: 20px;
}

.sticky-action-cell {
  position: sticky;
  right: 0;
  z-index: 3;
  min-width: 154px;
  background: #fff;
  box-shadow: -8px 0 12px -12px rgba(26, 39, 52, 0.55);
}

thead .sticky-action-cell {
  z-index: 5;
  background: #f5f7f9;
}

.store-control-row.is-inactive .sticky-action-cell {
  background: #fbfcfd;
}

.store-row-actions {
  display: grid;
  gap: 7px;
}

.store-more-actions summary {
  cursor: pointer;
  color: var(--blue);
  font-size: 12px;
  font-weight: 650;
  text-align: center;
  list-style: none;
}

.store-more-actions summary::-webkit-details-marker {
  display: none;
}

.store-more-actions > div {
  display: grid;
  gap: 6px;
  margin-top: 7px;
}

.button-spinner {
  width: 14px;
  height: 14px;
  display: inline-block;
  margin-right: 7px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: button-spin 0.7s linear infinite;
}

@keyframes button-spin {
  to {
    transform: rotate(360deg);
  }
}

.panel.active {
  animation: panel-in 0.16s ease-out;
}

@keyframes panel-in {
  from {
    opacity: 0.35;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.monitor-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.monitor-summary-item {
  display: grid;
  align-content: start;
  min-height: 84px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.monitor-summary-item span,
.monitor-summary-item small {
  color: var(--muted);
  font-size: 11px;
}

.monitor-summary-item strong {
  margin: 4px 0 2px;
  color: var(--text);
  font-size: 19px;
  line-height: 1.2;
}

.monitor-summary-item.attention {
  border-color: #efc7c3;
  background: #fff8f7;
}

.monitor-summary-item.attention strong {
  color: var(--danger);
}

.monitor-table {
  min-width: 1460px;
}

.monitor-table th:nth-child(1),
.monitor-table td:nth-child(1) {
  width: 126px;
  min-width: 126px;
}

.monitor-table th:nth-child(2),
.monitor-table td:nth-child(2) {
  width: 112px;
  min-width: 112px;
}

.monitor-table th:nth-child(11),
.monitor-table td:nth-child(11) {
  min-width: 320px;
}

.monitor-time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cell-stack {
  display: grid;
  gap: 3px;
  min-width: 120px;
}

.cell-stack strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.cell-stack small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.price-change-cell {
  min-width: 92px;
}

.price-change-cell small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.price-change {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-soft);
  font-weight: 700;
  white-space: nowrap;
}

.price-change.down {
  border-color: #efc7c3;
  background: #fff6f5;
  color: #b82d26;
}

.price-change.up {
  border-color: #b8dccd;
  background: #f2fbf7;
  color: #147a56;
}

.price-change.same,
.price-change.missing {
  color: var(--muted);
  font-weight: 600;
}

.competitor-details {
  margin-top: 7px;
  color: var(--muted);
}

.competitor-details summary {
  color: var(--blue);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.competitor-details div {
  margin-top: 5px;
  white-space: normal;
}

.duplicate-conflict {
  margin-top: 9px;
  padding: 9px;
  border: 1px solid #d7dee4;
  border-radius: 6px;
  background: #f8fafb;
}

.duplicate-conflict-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 9px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
}

.duplicate-conflict-title strong {
  color: var(--text);
  font-size: 12px;
}

.duplicate-conflict-stores {
  display: grid;
  gap: 5px;
}

.duplicate-store-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding-top: 5px;
  border-top: 1px solid #e5e9ed;
  color: #42505d;
  font-size: 11px;
  line-height: 1.4;
}

.duplicate-store-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.duplicate-role {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.duplicate-role.keep {
  background: #e9f7f0;
  color: #147a56;
}

.duplicate-role.paused {
  background: #fff1ef;
  color: #b82d26;
}

.duplicate-role.conflict {
  background: #fff7e8;
  color: #9a6300;
}

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

  .sidebar {
    padding-left: 10px;
    padding-right: 10px;
  }

  .store-metrics {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .bulk-store-setup {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

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

  .store-sync-actions {
    justify-content: flex-start;
  }

  .focus-control-grid {
    grid-template-columns: 1fr;
  }

  .focus-strategy-grid {
    grid-template-columns: repeat(4, minmax(110px, 1fr));
  }

  .monitor-summary {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: auto;
  }

  .sidebar .brand {
    padding: 0;
    border-bottom: 0;
  }

  .mobile-nav-toggle {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 38px;
    margin-left: auto;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.07);
    color: #f6f8fb;
    cursor: pointer;
  }

  .sidebar #nav {
    display: none;
  }

  .sidebar.nav-open #nav {
    display: grid;
  }

  .main {
    min-width: 0;
  }

  .global-search {
    flex: 0 0 auto;
  }

  .bulk-store-setup,
  .store-group-fields {
    grid-template-columns: 1fr;
  }

  .store-sync-copy {
    align-items: flex-start;
    flex-direction: column;
  }

  .store-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .store-tab {
    flex: 1 0 auto;
    justify-content: center;
  }

  .focus-strategy-grid,
  .focus-search-row {
    grid-template-columns: 1fr;
  }

  .focus-add-actions {
    min-height: 0;
  }

  .monitor-summary {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

@media (max-width: 720px) {
  .store-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .focus-current-section > .section-row,
  .focus-add-section > .section-row,
  .focus-search-row {
    padding-left: 12px;
    padding-right: 12px;
  }

  .search-guidance {
    margin-left: 12px;
    margin-right: 12px;
  }

  .monitor-summary {
    grid-template-columns: 1fr;
  }
}

/* 5.9.30 — information architecture and responsive consolidation */
:root {
  --bg: #f4f6f8;
  --panel-soft: #f8fafb;
  --line: #dbe2e8;
  --line-strong: #c5d0da;
  --blue: #3159c8;
  --blue-dark: #2447aa;
  --nav: #121a23;
  --nav-hover: #243240;
  --shadow: 0 1px 2px rgba(16, 24, 32, 0.04), 0 12px 34px rgba(27, 39, 51, 0.055);
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.shell,
.main,
.panel,
.surface,
.table-wrap {
  min-width: 0;
  max-width: 100%;
}

.main {
  overflow-x: clip;
}

.panel.active {
  display: grid;
  gap: 16px;
}

.panel.active > .section-row,
.surface > .section-row {
  margin-bottom: 0;
}

.surface,
.table-wrap,
.operation-drawer {
  border-radius: 10px;
}

.surface {
  box-shadow: var(--shadow);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(180px, auto) minmax(240px, 520px) auto;
  gap: 18px;
}

.topbar-title,
.global-search,
.top-actions {
  min-width: 0;
}

.global-search {
  width: 100%;
}

.top-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
}

#saveBtn[hidden] {
  display: none !important;
}

.issue-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(118px, 1fr));
  gap: 8px;
  overflow: visible;
}

.issue-tab {
  justify-content: space-between;
  min-width: 0;
  border-radius: 8px;
  white-space: normal;
}

.issue-primary-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.action-menu,
.danger-menu {
  position: relative;
}

.action-menu > summary,
.danger-menu > summary {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.action-menu > summary::-webkit-details-marker,
.danger-menu > summary::-webkit-details-marker {
  display: none;
}

.action-menu > div,
.danger-menu > div {
  position: absolute;
  right: 0;
  z-index: 35;
  width: min(310px, calc(100vw - 32px));
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(21, 31, 43, 0.18);
}

.action-menu > div .button,
.danger-menu > div .button {
  width: 100%;
  justify-content: flex-start;
}

.operation-drawer {
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
}

.operation-drawer > summary,
.strategy-section > summary,
.advanced-config > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 17px;
  cursor: pointer;
  font-weight: 750;
  list-style: none;
}

.operation-drawer > summary::-webkit-details-marker,
.strategy-section > summary::-webkit-details-marker,
.advanced-config > summary::-webkit-details-marker {
  display: none;
}

.operation-drawer > summary::after,
.strategy-section > summary::after,
.advanced-config > summary::after {
  content: "展开";
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.operation-drawer[open] > summary::after,
.strategy-section[open] > summary::after,
.advanced-config[open] > summary::after {
  content: "收起";
}

.operation-drawer > summary small,
.strategy-section > summary small {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.operation-drawer .action-grid {
  padding: 0 14px 14px;
}

.operation-drawer .action-box {
  margin: 0;
  box-shadow: none;
}

.advanced-config-body {
  padding: 0 17px 17px;
}

.strategy-surface {
  display: grid;
  gap: 14px;
}

.strategy-intro {
  margin-top: -7px;
}

.strategy-card-list {
  display: grid;
  gap: 16px;
}

.strategy-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.strategy-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #f8faff 0%, #f8fbfa 100%);
}

.strategy-card-header h3 {
  margin-top: 3px;
  font-size: 18px;
}

.strategy-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 13px;
  padding: 16px 18px 18px;
}

.strategy-card-grid.core-grid {
  border-bottom: 1px solid var(--line);
}

.strategy-section {
  border-bottom: 1px solid var(--line);
}

.strategy-section:last-child {
  border-bottom: 0;
}

.strategy-section > summary {
  padding: 13px 18px;
  background: var(--panel-soft);
}

.strategy-section[open] > summary {
  border-bottom: 1px solid var(--line);
}

.strategy-field {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 6px;
}

.strategy-field > span,
.strategy-toggle > span {
  color: #455260;
  font-size: 12px;
  font-weight: 700;
}

.strategy-field .input {
  width: 100%;
}

.field-with-suffix {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
}

.field-suffix {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.strategy-toggle {
  min-height: 39px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.strategy-toggle input {
  width: 17px;
  height: 17px;
}

@media (max-width: 1500px) {
  .topbar {
    grid-template-columns: minmax(170px, auto) minmax(210px, 1fr) auto;
  }

  .system-health,
  .user-badge {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .strategy-card-grid {
    grid-template-columns: repeat(3, minmax(145px, 1fr));
  }
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .global-search {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .issue-tabs {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .strategy-card-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

@media (max-width: 760px) {
  .main {
    padding-left: 12px;
    padding-right: 12px;
  }

  .topbar {
    margin-left: -12px;
    margin-right: -12px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .top-actions {
    width: auto;
  }

  .system-health,
  .user-badge {
    display: none;
  }

  .issue-tabs,
  .strategy-card-grid {
    grid-template-columns: 1fr;
  }

  .section-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .issue-primary-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .operation-drawer > summary small,
  .strategy-section > summary small {
    display: none;
  }
}
.product-delete-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  box-sizing: border-box;
  padding: 26px;
  border: 1px solid #d8e0e8;
  border-radius: 16px;
  color: #18283a;
  background: #fff;
  box-shadow: 0 24px 80px #18283a38;
  overflow-y: auto;
}
.product-delete-dialog::backdrop { background: #14243b80; }
.product-delete-dialog [hidden] { display: none !important; }
.product-delete-dialog h2 { margin: 0 0 16px; font-size: 21px; }
.product-delete-dialog p { line-height: 1.7; }
.product-delete-preview {
  max-height: 210px;
  overflow: auto;
  padding: 12px 12px 12px 30px;
  border-radius: 8px;
  background: #f3f6fa;
  overflow-wrap: anywhere;
  line-height: 1.8;
}
.product-delete-more { color: #576879; font-size: 13px; }
.product-delete-result:empty { display: none; }
.product-delete-result { padding: 12px; border-radius: 8px; background: #eef3ff; }
.product-delete-result[data-result="error"] { color: #a12626; background: #fff0f0; }
.product-delete-result[data-result="success"] { color: #176b42; background: #eaf8ef; }
.product-delete-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }
.product-delete-dialog button:disabled { opacity: .6; cursor: wait; }
