:root {
  color-scheme: light;
  --bg: #f5f7f6;
  --surface: #ffffff;
  --line: #d7dfdc;
  --text: #16211e;
  --muted: #66736f;
  --brand: #0f7663;
  --brand-soft: #e8f5f1;
  --red: #b42318;
  --red-soft: #fff1f1;
  --amber: #915f00;
  --amber-soft: #fff7df;
  --blue: #2457a6;
  --blue-soft: #eef4ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 14px;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.eyebrow {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  line-height: 1.2;
}

h1 {
  margin-top: 4px;
  font-size: 24px;
}

h2 {
  font-size: 18px;
}

.data-status {
  color: var(--muted);
  white-space: nowrap;
}

.operator-login-badge {
  display: grid;
  gap: 2px;
  min-width: 150px;
  padding: 8px 12px;
  border: 1px solid #9acdbf;
  border-radius: 8px;
  background: var(--brand-soft);
  text-align: right;
}

.operator-login-badge span,
.operator-login-badge em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.1;
}

.operator-login-badge strong {
  color: var(--brand);
  font-size: 16px;
  line-height: 1.2;
}

.operator-login-badge.is-manual {
  border-color: var(--line);
  background: #fff;
}

.operator-login-badge.is-manual strong {
  color: var(--amber);
}

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

.role-entry-card {
  min-width: 0;
  min-height: 72px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.role-entry-card:hover {
  border-color: #7cbfac;
}

.role-entry-card.active {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.role-entry-card:disabled,
.role-entry-card.is-disabled {
  border-color: #d8dedb;
  background: #f5f7f6;
  color: #8a9691;
  cursor: not-allowed;
}

.role-entry-card:disabled .role-entry-icon,
.role-entry-card.is-disabled .role-entry-icon {
  background: #e7ecea;
  color: #8a9691;
}

.role-entry-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #edf4f2;
  color: var(--brand);
  font-size: 18px;
  font-weight: 900;
}

.role-entry-card.active .role-entry-icon {
  background: var(--brand);
  color: #fff;
}

.role-entry-card strong,
.role-entry-card em {
  display: block;
  min-width: 0;
}

.role-entry-card strong {
  font-size: 16px;
  line-height: 1.2;
}

.role-entry-card em {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.purchase-workspace[hidden] {
  display: none !important;
}

.app-shell.role-purchase > .store-selector,
.app-shell.role-purchase > .logic-panel,
.app-shell.role-purchase > .feedback-section,
.app-shell.role-purchase > .adjustment-section,
.app-shell.role-purchase > .store-summary,
.app-shell.role-purchase > .monitor-section,
.app-shell.role-purchase > .action-section,
.app-shell.role-purchase > .operator-record-entry,
.app-shell.role-purchase > .operator-records-section {
  display: none;
}

.purchase-workspace {
  margin-top: 12px;
}

.purchase-denied {
  border: 1px solid #ead0c6;
  border-radius: 8px;
  background: #fff7f4;
  padding: 18px;
  color: var(--text);
}

.purchase-denied strong,
.purchase-denied p {
  display: block;
  margin: 0;
}

.purchase-denied p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
}

.purchase-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 14px;
}

.purchase-rail,
.purchase-surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.purchase-rail {
  min-height: 620px;
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.purchase-rail-head {
  display: grid;
  gap: 6px;
  padding-bottom: 14px;
  border-bottom: 1px solid #edf1ef;
}

.purchase-rail-head strong {
  font-size: 18px;
}

.purchase-rail-head span,
.purchase-rail-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.purchase-nav-list {
  display: grid;
  gap: 10px;
  padding: 14px 0;
}

.purchase-nav-item {
  min-height: 76px;
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.purchase-nav-item:hover {
  border-color: #7cbfac;
}

.purchase-nav-item.active {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.purchase-nav-item span {
  font-weight: 900;
}

.purchase-nav-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.4;
}

.purchase-rail-note {
  margin: auto 0 0;
  padding-top: 14px;
  border-top: 1px solid #edf1ef;
}

.purchase-content {
  min-width: 0;
}

.purchase-breadcrumb {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.purchase-breadcrumb strong {
  color: var(--text);
}

.purchase-crumb,
.purchase-text-button {
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.purchase-text-button.danger {
  color: #b42318;
}

.purchase-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.purchase-surface {
  min-height: 620px;
  padding: 20px;
}

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

.purchase-head h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.purchase-head p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.purchase-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.purchase-primary,
.purchase-secondary {
  min-height: 38px;
  border-radius: 8px;
  font: inherit;
  font-weight: 900;
  padding: 0 14px;
  white-space: nowrap;
  cursor: pointer;
}

.purchase-primary {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
}

.purchase-secondary {
  border: 1px solid #b8c4c0;
  background: #fff;
  color: var(--text);
}

.purchase-stat-grid,
.purchase-module-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

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

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

.purchase-sync-status {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 12px;
}

.purchase-stat,
.purchase-module,
.purchase-panel,
.purchase-form-panel,
.purchase-filter-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.purchase-stat {
  min-height: 100px;
  padding: 16px;
}

.purchase-stat span,
.purchase-stat small {
  display: block;
  color: var(--muted);
}

.purchase-stat span {
  font-size: 12px;
  font-weight: 900;
}

.purchase-stat strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 26px;
  line-height: 1;
}

.purchase-stat small {
  font-size: 12px;
}

.purchase-module {
  min-height: 178px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.purchase-module:hover {
  border-color: var(--brand);
  background: #fbfdfc;
}

.purchase-module-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 18px;
  font-weight: 900;
}

.purchase-module strong {
  font-size: 16px;
}

.purchase-module em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.55;
}

.purchase-module b {
  margin-top: auto;
  color: var(--brand);
}

.purchase-panel {
  margin-top: 16px;
  padding: 14px;
}

.purchase-quick-add-panel {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.purchase-quick-add-panel .purchase-panel-head {
  padding-bottom: 12px;
}

.purchase-quick-add-panel .purchase-panel-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.purchase-list-add-form {
  align-items: end;
}

.purchase-inline-submit {
  width: 100%;
  min-height: 38px;
}

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

.purchase-panel-head h3 {
  margin: 0;
  font-size: 17px;
}

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

.purchase-form-panel {
  padding: 18px;
  margin-bottom: 16px;
}

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

.purchase-field {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.purchase-field.full {
  grid-column: 1 / -1;
}

.purchase-field span,
.purchase-filter-panel span {
  color: #384742;
  font-size: 12px;
  font-weight: 900;
}

.purchase-field input,
.purchase-field select,
.purchase-field textarea,
.purchase-filter-panel input,
.purchase-filter-panel select {
  width: 100%;
  border: 1px solid #b8c4c0;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.purchase-field input,
.purchase-field select,
.purchase-filter-panel input,
.purchase-filter-panel select {
  height: 38px;
  padding: 0 10px;
}

.purchase-field textarea {
  min-height: 84px;
  padding: 10px;
  resize: vertical;
}

.purchase-operator-field strong,
.purchase-filter-person {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #dce7e3;
  border-radius: 8px;
  color: #263631;
  background: #f7fbf9;
  font-size: 13px;
  font-weight: 900;
}

.purchase-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 16px;
}

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

.purchase-filter-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 12px;
  padding: 14px;
  margin-bottom: 16px;
}

.purchase-filter-panel label {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.purchase-search-field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.purchase-search-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.purchase-search-field input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
}

.purchase-price-lookup-panel {
  margin-bottom: 16px;
}

.purchase-price-empty {
  padding: 14px;
  border: 1px dashed #c9d6d1;
  border-radius: 8px;
  color: var(--muted);
  background: #f8faf9;
  font-size: 13px;
}

.purchase-price-result {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.purchase-price-result > div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #dce7e3;
  border-radius: 8px;
  background: #fff;
}

.purchase-price-result span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.purchase-price-result b {
  overflow: hidden;
  color: #263631;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-price-main {
  background: #f7fbf9 !important;
}

.purchase-price-main strong {
  color: var(--brand);
  font-size: 26px;
  line-height: 1.1;
}

.purchase-table-wrap {
  overflow-x: auto;
}

.purchase-table-note {
  padding: 10px 2px 0;
  color: var(--muted);
  font-size: 12px;
}

.purchase-document-summary {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 12px 18px;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid #cfe1db;
  border-radius: 8px;
  background: #f7fbf9;
}

.purchase-document-summary-head {
  display: grid;
  gap: 4px;
}

.purchase-document-summary-head strong {
  font-size: 16px;
}

.purchase-document-summary-head span,
.purchase-document-total span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.purchase-document-total {
  text-align: right;
}

.purchase-document-total strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  line-height: 1.1;
}

.purchase-document-metrics {
  display: flex;
  grid-column: 1 / -1;
  gap: 8px;
  flex-wrap: wrap;
}

.purchase-document-metrics span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #dce7e3;
  border-radius: 6px;
  color: #46544f;
  background: #fff;
  font-size: 12px;
}

.purchase-document-metrics b {
  color: var(--text);
}

.purchase-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

.purchase-table th,
.purchase-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf1ef;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.purchase-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  background: #fbfcfb;
}

.purchase-table td {
  color: #2b3a36;
  font-size: 13px;
}

.purchase-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.purchase-status-pill.is-new-product {
  background: #fff3dc;
  color: #9a4f00;
}

.purchase-empty-cell {
  height: 76px;
  color: var(--muted) !important;
  text-align: center !important;
}

.purchase-sign-row {
  display: flex;
  justify-content: flex-end;
  gap: 80px;
  margin-top: 16px;
  font-weight: 900;
}

.store-selector,
.upload-test-section,
.operator-record-entry,
.feedback-section,
.adjustment-section,
.store-summary,
.monitor-section,
.action-section,
.operator-records-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.store-selector {
  display: grid;
  grid-template-columns: 72px minmax(180px, 280px) minmax(220px, 1fr) 82px minmax(180px, 240px) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.store-selector.operator-locked {
  grid-template-columns: 72px minmax(180px, 280px) minmax(220px, 1fr) auto;
}

.store-selector label {
  color: var(--muted);
  font-weight: 700;
}

select,
.store-search,
.operator-input {
  width: 100%;
  height: 42px;
  border: 1px solid #b8c4c0;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 0 12px;
}

.store-search,
.operator-input {
  appearance: none;
}

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

.operator-input.is-auto-operator {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: #9acdbf;
  font-weight: 800;
}

.operator-auto-status {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.operator-record-nav {
  height: 42px;
  border: 0;
  border-radius: 6px;
  background: var(--text);
  color: #fff;
  font: inherit;
  font-weight: 800;
  padding: 0 14px;
  white-space: nowrap;
  cursor: pointer;
}

.operator-record-nav:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.operator-record-entry {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
  padding: 12px 14px;
}

.upload-test-section {
  margin-top: 12px;
  overflow: hidden;
}

.upload-test-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.upload-test-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.upload-test-head span {
  flex: 0 0 auto;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.upload-test-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.upload-test-column {
  min-width: 0;
  padding: 12px 14px;
  background: #fbfcfb;
}

.upload-test-column strong {
  display: block;
  margin-bottom: 8px;
  color: var(--brand);
  font-size: 13px;
}

.upload-test-column ul {
  margin: 0;
  padding-left: 18px;
}

.upload-test-column li {
  margin: 5px 0;
  line-height: 1.45;
}

.upload-test-files {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.upload-test-files label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.upload-test-files input {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 1px solid #b8c4c0;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 8px 10px;
}

.upload-test-files button {
  align-self: end;
  height: 40px;
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 800;
  padding: 0 14px;
  cursor: pointer;
  white-space: nowrap;
}

.upload-test-result {
  margin: 0 14px 14px;
  padding: 10px 12px;
  border: 1px solid #c7d9d3;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.upload-test-summary-line,
.upload-test-note,
.upload-test-warning {
  margin-top: 8px;
  color: var(--muted);
}

.upload-test-warning {
  padding: 8px 10px;
  border: 1px solid #efd081;
  border-radius: 6px;
  background: var(--amber-soft);
  color: var(--amber);
}

.upload-test-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.upload-test-actions button {
  min-height: 36px;
  border: 1px solid #0f7a66;
  border-radius: 6px;
  background: #fff;
  color: var(--brand);
  font: inherit;
  font-weight: 800;
  padding: 0 12px;
  cursor: pointer;
}

.upload-test-actions button:disabled {
  border-color: #d7dfdc;
  color: var(--muted);
  cursor: not-allowed;
  opacity: .7;
}

.upload-test-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.upload-test-metric {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #d7dfdc;
  border-radius: 6px;
  background: #fff;
}

.upload-test-metric span,
.upload-test-metric em {
  display: block;
  color: var(--muted);
  font-style: normal;
}

.upload-test-metric strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 16px;
}

.upload-test-preview-title {
  margin-top: 12px;
  color: var(--brand);
  font-weight: 800;
}

.upload-test-preview-table {
  width: 100%;
  margin-top: 6px;
  border-collapse: collapse;
  background: #fff;
}

.upload-test-preview-table th,
.upload-test-preview-table td {
  padding: 7px 8px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.upload-test-preview-table th {
  color: var(--muted);
  font-weight: 800;
  background: #f4f6f5;
}

.operator-record-nav-wide {
  min-width: 190px;
}

.logic-panel {
  margin-top: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.logic-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

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

.logic-title span,
.logic-feedback {
  color: var(--muted);
  font-size: 12px;
}

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

.logic-item {
  min-width: 0;
  padding: 8px 0;
  border-top: 1px solid #edf1ef;
}

.logic-item b {
  display: block;
  margin-bottom: 4px;
  color: var(--brand);
  font-size: 13px;
}

.logic-item p {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
}

.logic-feedback {
  margin: 10px 0 0;
  line-height: 1.5;
}

.logic-suggestion {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 10px;
  margin-top: 10px;
}

.logic-suggestion input,
.logic-suggestion button {
  height: 38px;
  border-radius: 6px;
  font: inherit;
}

.logic-suggestion input {
  min-width: 0;
  border: 1px solid #b8c4c0;
  padding: 0 10px;
}

.logic-suggestion button {
  border: 0;
  background: var(--brand);
  color: #fff;
  padding: 0 14px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.feedback-section,
.adjustment-section {
  margin-top: 12px;
  overflow: hidden;
}

.feedback-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.feedback-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.feedback-head span {
  color: var(--muted);
  white-space: nowrap;
}

.feedback-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) minmax(160px, 0.6fr) minmax(160px, 0.7fr) auto;
  gap: 10px;
  padding: 14px;
}

.feedback-form input,
.feedback-form select,
.feedback-form textarea {
  width: 100%;
  border: 1px solid #b8c4c0;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.feedback-form input,
.feedback-form select,
.feedback-form button {
  height: 40px;
}

.feedback-form input,
.feedback-form select,
.feedback-form textarea {
  padding: 0 10px;
}

.feedback-form textarea {
  grid-column: 1 / -1;
  min-height: 64px;
  padding-top: 8px;
  padding-bottom: 8px;
  resize: vertical;
}

.feedback-form button,
.feedback-link,
.confirm-action,
.no-discount-action,
.one-price-action {
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.feedback-form button {
  padding: 0 16px;
  white-space: nowrap;
}

.feedback-rule {
  margin: 0;
  padding: 0 14px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.feedback-list {
  border-top: 1px solid var(--line);
}

.feedback-record {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(120px, 0.45fr) minmax(150px, 0.5fr);
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #edf1ef;
}

.feedback-record:last-child {
  border-bottom: 0;
}

.adjustment-record {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 0.8fr) minmax(130px, 0.35fr);
}

.feedback-record strong,
.feedback-record span,
.feedback-record em {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.adjustment-decision {
  display: inline-block;
  width: fit-content;
  padding: 3px 7px;
  border-radius: 6px;
  color: var(--brand) !important;
  background: var(--brand-soft);
  font-weight: 800;
}

.feedback-record strong {
  line-height: 1.35;
}

.feedback-record span,
.feedback-record em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.4;
}

.feedback-empty {
  padding: 12px 14px;
  color: var(--muted);
  font-size: 12px;
}

.operator-records-section {
  margin-top: 12px;
  overflow: hidden;
}

.operator-record-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.operator-store-chip {
  min-width: 0;
  padding: 10px 14px;
  background: #fbfcfb;
}

.operator-store-chip strong,
.operator-store-chip span {
  display: block;
  overflow-wrap: anywhere;
}

.operator-store-chip strong {
  font-size: 13px;
}

.operator-store-chip span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.operator-record-table {
  border-top: 0;
}

.operator-record-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(260px, 1.3fr) minmax(140px, 0.6fr) minmax(260px, 1.4fr);
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #edf1ef;
}

.operator-record-row:last-child {
  border-bottom: 0;
}

.operator-record-row strong,
.operator-record-row span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.operator-record-row span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.operator-store-card {
  min-width: 0;
  padding: 12px 14px;
  background: #fbfcfb;
}

.operator-store-main {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.operator-store-card strong,
.operator-store-card span {
  display: block;
  overflow-wrap: anywhere;
}

.operator-store-card strong {
  font-size: 13px;
}

.operator-store-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.operator-store-detail-button {
  flex: 0 0 auto;
  min-width: 72px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

.operator-store-detail-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.operator-store-detail-list {
  margin: 10px -14px -12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.store-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin-top: 12px;
  overflow: hidden;
  background: var(--line);
}

.summary-item {
  min-height: 78px;
  padding: 14px;
  background: var(--surface);
}

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

.summary-value {
  margin-top: 7px;
  font-size: 22px;
  font-weight: 850;
}

.summary-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.monitor-section {
  margin-top: 12px;
  overflow: hidden;
}

.monitor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.monitor-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.monitor-head span {
  color: var(--muted);
  white-space: nowrap;
}

.monitor-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.monitor-stat {
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid var(--line);
}

.monitor-stat:last-child {
  border-right: 0;
}

.monitor-stat span,
.monitor-stat em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

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

.monitor-stat em {
  margin-top: 4px;
}

.monitor-lists {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
}

.product-insight-lists {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.monitor-list {
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid var(--line);
}

.monitor-list:last-child {
  border-right: 0;
}

.monitor-list-title {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.monitor-product {
  padding: 8px 0;
  border-top: 1px solid #eef3f0;
}

.monitor-product div {
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.monitor-product span,
.monitor-empty {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.action-section {
  margin-top: 12px;
  overflow: hidden;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.section-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.dimension-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.dimension-jump {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 70px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #a9d4c7;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.dimension-jump strong {
  min-width: 18px;
  color: var(--text);
  font-size: 12px;
  text-align: center;
}

.dimension-jump[data-dimension-target="2"] {
  border-color: #efd081;
  background: var(--amber-soft);
  color: var(--amber);
}

.dimension-jump[data-dimension-target="3"] {
  border-color: #d8c8ff;
  background: #f1ebff;
  color: #7c3aed;
}

.dimension-jump[data-dimension-target="4"] {
  border-color: #b8d0e6;
  background: #eef6ff;
  color: #0b5cad;
}

.dimension-jump:disabled {
  border-color: var(--line);
  background: #f4f6f5;
  color: var(--muted);
  cursor: default;
  opacity: 0.58;
}

#itemCount {
  color: var(--muted);
  white-space: nowrap;
}

.action-list {
  overflow-x: hidden;
}

.action-feed {
  display: grid;
  gap: 0;
}

.load-more-actions-wrap {
  display: flex;
  justify-content: center;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.load-more-actions {
  min-width: 240px;
  height: 42px;
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.category-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  border-top: 1px solid #dfe8e4;
  border-bottom: 1px solid #dfe8e4;
  background: #f3f8f6;
  color: #183b32;
}

.category-group strong {
  font-size: 13px;
  line-height: 1.3;
}

.category-group span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
}

.action-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.15fr) minmax(360px, 1fr) minmax(300px, 1.2fr);
  gap: 14px;
  align-items: start;
  padding: 12px 14px;
  border-bottom: 1px solid #e5ebe8;
  background: var(--surface);
  scroll-margin-top: 16px;
}

.action-row:nth-of-type(even) {
  background: #fbfcfb;
}

.action-row.is-confirmed {
  border-left: 4px solid var(--brand);
}

.action-row.is-no-discount {
  border-left-color: #f59e0b;
}

.action-row.jump-highlight {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
  background: #f4fbf8;
}

.row-main,
.metric-grid,
.basis-text {
  min-width: 0;
}

.row-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.priority {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.priority.p0 {
  color: var(--red);
  background: var(--red-soft);
}

.priority.q0 {
  color: #ffffff;
  background: #9d174d;
}

.priority.p1 {
  color: var(--amber);
  background: var(--amber-soft);
}

.priority.p2 {
  color: #40504b;
  background: #edf2f0;
}

.action-type {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  font-weight: 800;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 12px;
}

.action-type.dimension-2 {
  color: var(--amber);
  background: var(--amber-soft);
}

.action-type.dimension-3 {
  color: #7c3aed;
  background: #f1ebff;
}

.action-type.dimension-4 {
  color: #0b5cad;
  background: #eef6ff;
}

.feedback-link {
  min-height: 28px;
  padding: 0 9px;
  background: #edf2f0;
  color: var(--brand);
  font-size: 12px;
}

.confirm-action,
.no-discount-action,
.one-price-action {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.confirm-action {
  background: var(--brand);
  color: #fff;
}

.no-discount-action {
  background: #fff4d6;
  color: #8a5a00;
}

.one-price-action {
  background: #eef6ff;
  color: #0b5cad;
}

.confirm-action.done,
.confirm-action:disabled,
.no-discount-action.done,
.no-discount-action:disabled,
.one-price-action.done,
.one-price-action:disabled {
  color: var(--brand);
  background: var(--brand-soft);
  cursor: default;
}

.product-name {
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.barcode {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

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

.metric {
  min-height: 46px;
  padding: 7px 8px;
  border: 1px solid #e2e9e6;
  border-radius: 6px;
  background: #fff;
}

.metric span,
.basis-text span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.basis-text {
  line-height: 1.45;
}

.basis-text p {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.discount-signal {
  padding: 8px 10px;
  border: 1px solid #d8eadf;
  border-radius: 6px;
  background: #f6fbf7;
}

.weekly-product-insight {
  grid-column: 1 / -1;
  padding-top: 10px;
  border-top: 1px solid #eef3f0;
}

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

.price {
  font-weight: 800;
}

.negative {
  color: var(--red);
}

.empty-state {
  padding: 34px 16px;
  text-align: center;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: none;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #16211e;
  color: #fff;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
}

.toast.show {
  display: block;
}

.admin-back {
  color: var(--brand);
  font-weight: 800;
  text-decoration: none;
}

.admin-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 160px 140px auto auto;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.admin-toolbar input,
.admin-toolbar select,
.admin-toolbar button,
.admin-empty button,
.admin-action {
  height: 38px;
  border-radius: 6px;
  font: inherit;
}

.admin-toolbar input,
.admin-toolbar select {
  min-width: 0;
  border: 1px solid #b8c4c0;
  padding: 0 10px;
}

.admin-toolbar button,
.admin-empty button,
.admin-action {
  border: 0;
  background: var(--brand);
  color: #fff;
  padding: 0 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.admin-status {
  padding: 10px 14px;
  color: var(--muted);
  font-size: 12px;
  border-bottom: 1px solid var(--line);
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf1ef;
  text-align: left;
  vertical-align: top;
  line-height: 1.45;
}

.admin-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  background: #fbfcfb;
}

.admin-table td {
  overflow-wrap: anywhere;
}

.admin-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 6px;
  color: var(--amber);
  background: var(--amber-soft);
  font-size: 12px;
  font-weight: 800;
}

.admin-status-pill.done {
  color: var(--brand);
  background: var(--brand-soft);
}

.admin-action {
  height: 30px;
  margin: 0 4px 4px 0;
  font-size: 12px;
}

.muted-action {
  color: #40504b;
  background: #edf2f0;
}

.admin-empty {
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .app-shell {
    padding: 12px;
  }

  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    align-items: stretch;
    width: 100%;
    flex-direction: column;
  }

  .operator-login-badge {
    width: 100%;
    text-align: left;
  }

  .role-entry,
  .purchase-layout,
  .purchase-stat-grid,
  .purchase-module-grid,
  .purchase-form-grid,
  .purchase-filter-panel {
    grid-template-columns: 1fr;
  }

  .purchase-rail {
    min-height: auto;
  }

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

  .purchase-surface {
    min-height: auto;
    padding: 14px;
  }

  .purchase-head,
  .purchase-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .purchase-head-actions,
  .purchase-primary,
  .purchase-secondary {
    width: 100%;
  }

  .purchase-sign-row {
    justify-content: flex-start;
    gap: 18px;
    flex-wrap: wrap;
  }

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

  .purchase-document-total {
    text-align: left;
  }

  .purchase-price-result {
    grid-template-columns: 1fr;
  }

  .purchase-price-result b {
    white-space: normal;
  }

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

  .operator-record-nav {
    width: 100%;
  }

  .operator-record-entry {
    justify-content: stretch;
  }

  .upload-test-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .upload-test-grid,
  .upload-test-files {
    grid-template-columns: 1fr;
  }

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

  .upload-test-preview-table {
    display: block;
    overflow-x: auto;
  }

  .logic-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

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

  .logic-suggestion {
    grid-template-columns: 1fr;
  }

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

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

  .feedback-record {
    grid-template-columns: 1fr;
  }

  .operator-record-summary,
  .operator-record-row {
    grid-template-columns: 1fr;
  }

  .operator-store-main {
    align-items: stretch;
    flex-direction: column;
  }

  .operator-store-detail-button {
    width: 100%;
  }

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

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

  .monitor-stat,
  .monitor-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .section-tools {
    width: 100%;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .dimension-nav {
    justify-content: flex-start;
  }

  .action-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  .category-group {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .category-group span {
    white-space: normal;
  }

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

  .admin-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 901px) and (max-width: 1180px) {
  .action-row {
    grid-template-columns: minmax(260px, 1fr) minmax(320px, 1fr);
  }

  .basis-text {
    grid-column: 1 / -1;
  }
}
