* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef1f5;
  color: #1f2937;
}

.site-legal-footer {
  padding: 10px 16px 18px;
  text-align: center;
  color: #64748b;
  font-size: 12px;
}

.site-legal-footer a {
  color: inherit;
  text-decoration: none;
}

.site-legal-footer a:hover {
  text-decoration: underline;
}
.auth-locked .shell {
  display: none;
}
.auth-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #eef1f5;
}
.auth-card {
  width: min(420px, 100%);
  padding: 22px;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 44px rgba(15, 23, 42, .10);
}
.auth-card h1 {
  margin-bottom: 8px;
}

.auth-gate-legal {
  margin: 14px 0 0;
  text-align: center;
  font-size: 12px;
}

.auth-gate-legal a {
  color: #64748b;
  text-decoration: none;
}

.auth-gate-legal a:hover {
  text-decoration: underline;
}

.auth-form {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.auth-form input,
.auth-form button {
  width: 100%;
  min-height: 42px;
}
#gateCompanyLoginStatus {
  margin-top: 12px;
  color: #64748b;
}
.shell {
  width: min(1880px, calc(100vw - 16px));
  margin: 8px auto 18px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,.88);
  border: 1px solid #d9dee7;
  border-radius: 8px;
}
.title-block { min-width: 260px; }
h1 { margin: 0 0 3px; font-size: 20px; }
h2 { margin: 0 0 12px; font-size: 18px; }
.section-title { margin-top: 22px; }
p { margin: 0; color: #64748b; word-break: break-all; }
.platform-scope {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  background: #eef2f7;
  border: 1px solid #d8e0ea;
  border-radius: 7px;
}
.platform-scope button {
  height: 28px;
  min-width: 72px;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}
.platform-scope button.active {
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 1px 4px rgba(15,23,42,.1);
}
.realtime-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid #cfe0d5;
  border-radius: 7px;
  background: #f4fbf6;
  color: #166534;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
#realtimeStatus {
  display: none;
}
.realtime-badge.offline {
  border-color: #f1c7c7;
  background: #fff5f5;
  color: #991b1b;
}
.realtime-badge.pending {
  border-color: #f0d799;
  background: #fffbeb;
  color: #92400e;
}
.realtime-badge strong {
  color: inherit;
}
.app-layout {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 280px;
  gap: 10px;
  align-items: start;
}
.primary-sidebar,
.insight-rail {
  position: sticky;
  top: 12px;
}
.primary-sidebar {
  min-height: auto;
  background: #f8fafc;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  padding: 8px 6px;
}
.workbench-stage {
  min-width: 0;
}
.tabs {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.tab {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0;
  background: transparent;
  color: #111827;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}
.tab.active {
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 1px 4px rgba(15,23,42,.08);
}
.subtabs {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 0;
  padding: 12px 8px;
  background: #fff;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  min-height: 0;
  position: fixed;
  top: 72px;
  left: calc((100vw - min(1880px, calc(100vw - 16px))) / 2 + 74px);
  width: 190px;
  max-height: calc(100vh - 96px);
  overflow: auto;
  z-index: 30;
  box-shadow: 0 14px 32px rgba(15,23,42,.16);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-8px);
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease, visibility .12s ease;
}
.view.active > .subtabs.flyout-open,
.view.active > .subtabs:hover {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
}
.subtab {
  background: #fff;
  color: #334155;
  border: 0;
  justify-content: flex-start;
  text-align: left;
  height: 32px;
  padding: 0 10px;
  font-size: 13px;
}
.subtab.active {
  background: #eef4ff;
  color: #1d4ed8;
  border-color: transparent;
}
.view { display: none; }
.view.active { display: block; }
.view.active:has(> .subtabs) { display: block; }
.view.active:has(> .subtabs) > :not(.subtabs) { min-width: 0; }
.subview { display: none; }
.subview.active { display: block; }
.panel {
  background: #fff;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 10px;
}
.compact-panel {
  padding: 12px;
}
.import-box {
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
  margin-bottom: 12px;
}
.import-box h3 {
  margin: 0 0 8px;
  font-size: 15px;
}
.inbound-action-row {
  margin-top: 8px;
  gap: 7px;
}
.inbound-action-row button {
  min-height: 36px;
  padding: 0 12px;
  white-space: nowrap;
}
.inbound-root-input {
  flex: 1 1 240px;
  max-width: 360px;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.grid.four {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}
.grid.five {
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
}
.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.row > input,
.row > select {
  flex: 1 1 150px;
  min-width: 120px;
  max-width: 280px;
}
.row > button {
  flex: 0 0 auto;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.action-toolbar {
  justify-content: flex-start;
  margin: 8px 0 12px;
  padding: 9px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.export-toolbar {
  margin-top: -4px;
}
.export-toolbar .muted,
.toolbar p {
  min-width: 180px;
  flex: 1;
}
.subtle-panel {
  padding: 12px;
  margin: 8px 0 12px;
  background: #fbfdff;
  border: 1px solid #e2e8f0;
}
.subtle-panel h3 {
  margin: 0 0 8px;
  font-size: 16px;
}
.workflow-section {
  margin: 10px 0 14px;
  padding: 14px;
  background: #fbfdff;
  border: 1px solid #dbe7df;
  border-radius: 8px;
}
.workflow-section h3 {
  margin: 0 0 6px;
  font-size: 17px;
}
.workflow-section h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #334155;
}
.section-heading-row,
.selection-template-details summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.section-heading-row > div:first-child,
.selection-template-details summary > div:first-child {
  min-width: 240px;
  flex: 1 1 auto;
}
.inline-actions {
  flex: 0 0 auto;
  margin: 0;
}
.selection-template-details {
  margin: 0;
}
.selection-template-details summary {
  cursor: pointer;
  list-style: none;
}
.selection-template-details summary::-webkit-details-marker {
  display: none;
}
.selection-template-details[open] summary {
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}
.workflow-block {
  margin-top: 12px;
}
.workflow-actions {
  margin-bottom: 0;
}
.labeled-grid {
  align-items: stretch;
}
.field-label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}
.field-label input,
.field-label select {
  width: 100%;
  color: #0f172a;
  font-size: 14px;
  font-weight: 500;
}
.knowledge-summary {
  display: grid;
  gap: 6px;
  font-size: 13px;
  line-height: 1.5;
}
.knowledge-line {
  padding: 7px 9px;
  background: #ffffff;
  border: 1px solid #edf2f7;
  border-radius: 6px;
}
.tag {
  display: inline-flex;
  align-items: center;
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3154c8;
  font-size: 12px;
  font-weight: 700;
}
.warn-text {
  color: #b45309;
  font-weight: 700;
}
.danger-text {
  color: #b91c1c;
  font-weight: 700;
}
.segmented-filter {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
  width: fit-content;
  max-width: 100%;
  padding: 3px;
  border: 1px solid #d7e1d9;
  border-radius: 8px;
  background: #f8fbf8;
}
.segmented-option {
  min-width: 72px;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #233044;
  box-shadow: none;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.segmented-option:hover {
  background: #eef6f1;
}
.segmented-option.active {
  background: #28714f;
  color: #fff;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.form-grid > button,
.form-grid > .checkline {
  min-width: 0;
}
.task-form {
  padding: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.market-simple-grid {
  display: grid;
  gap: 16px;
}
.simple-card {
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
}
.simple-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}
.simple-card p {
  margin-bottom: 14px;
  line-height: 1.7;
}
.simple-card.primary-action {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.simple-card.primary-action button {
  min-width: 180px;
  min-height: 36px;
  font-size: 14px;
}
.simple-form {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
}
.hidden-controls {
  display: none !important;
}
input, select {
  width: 100%;
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 9px;
  font-size: 13px;
  background: #fff;
  min-width: 0;
}
.big-textarea {
  width: 100%;
  min-height: 170px;
  margin: 10px 0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px;
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
  background: #fff;
}
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  padding: 0;
}
.checkline {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 9px;
  font-size: 13px;
}
.hint.compact {
  margin-bottom: 10px;
  padding: 8px 10px;
}
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  height: auto;
  border: 0;
  border-radius: 6px;
  padding: 7px 12px;
  background: #1d4ed8;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  white-space: normal;
  line-height: 1.25;
}
button:not(.tab):not(.subtab).mini,
button:not(.tab):not(.subtab) {
  box-shadow: 0 1px 2px rgba(15,23,42,.08);
}
button:disabled { opacity: .6; cursor: wait; }
button.mini {
  min-height: 26px;
  padding: 4px 8px;
  font-size: 12px;
  white-space: nowrap;
}
.segmented-filter .segmented-option {
  min-height: 34px;
  height: 34px;
  padding: 0 12px;
  background: transparent;
  color: #233044;
  box-shadow: none;
  white-space: nowrap;
}
.segmented-filter .segmented-option.active {
  background: #28714f;
  color: #fff;
}
.mini-input {
  min-height: 30px;
  width: 92px;
  padding: 4px 8px;
  font-size: 12px;
}
button.danger {
  background: #b91c1c;
}
button.warning {
  background: #8a5a12;
}
.voided-row {
  color: #94a3b8;
  background: #f8fafc;
}
.voided-row td {
  text-decoration: line-through;
}
.voided-row td:last-child {
  text-decoration: none;
}
.void-records {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}
.void-records h3 {
  margin: 0 0 10px;
  font-size: 15px;
}
.void-records h4 {
  margin: 14px 0 8px;
}
.metric {
  background: #fff;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  padding: 11px 12px;
}
.grid .metric {
  min-height: 68px;
}
.metric span {
  display: block;
  color: #64748b;
  margin-bottom: 4px;
  font-size: 12px;
}
.metric strong {
  font-size: 19px;
  line-height: 1.25;
}
.server-status-heading {
  margin: 20px 0 10px;
  font-size: 16px;
}
.server-status-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.server-status-detail {
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid #dbe2ea;
}
.server-status-detail-wide {
  grid-column: 1 / -1;
}
.server-status-detail h3 {
  margin: 0 0 8px;
  font-size: 14px;
}
.server-status-detail .table-wrap {
  max-height: 280px;
}
.server-status-metrics .metric.status-warning strong { color: #b45309; }
.server-status-metrics .metric.status-danger strong { color: #b91c1c; }
.issues {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}
.issue {
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
}
.issue.error { border-color: #fecaca; background: #fff1f2; }
.issue.warn { border-color: #fde68a; background: #fffbeb; }
.table-wrap {
  overflow: auto;
  max-height: 520px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  position: relative;
  background: #fff;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}
.mini-table-wrap {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}
.mini-table {
  font-size: 12px;
}
.mini-table th,
.mini-table td {
  padding: 6px 8px;
}
.category-table {
  margin-top: 14px;
}
.quota-table-wrap {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}
.quota-table {
  min-width: 760px;
  table-layout: fixed;
}
.quota-table th,
.quota-table td {
  padding: 7px 8px;
  vertical-align: middle;
  max-width: none;
}
.quota-table th:first-child {
  width: 130px;
}
.quota-table th:nth-child(5) {
  width: 140px;
}
.quota-table th:last-child,
.quota-table td:last-child {
  width: 64px;
  text-align: center;
}
.quota-table input,
.quota-table select {
  width: 100%;
  min-width: 0;
  height: 32px;
}
.quota-table input {
  text-align: center;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  border-bottom: 1px solid #e2e8f0;
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
  max-width: 360px;
}
td {
  overflow: hidden;
  text-overflow: ellipsis;
}
td:hover {
  overflow: visible;
  white-space: normal;
  word-break: break-word;
}
th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 3;
  box-shadow: 0 1px 0 #e2e8f0;
}
thead tr.filter-row th {
  top: 39px;
  background: #fff;
  z-index: 2;
}
.hint {
  color: #475569;
  line-height: 1.55;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px;
  font-size: 13px;
  word-break: break-word;
}
.knowledge-summary {
  margin: 14px 0;
  color: #475569;
}
.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.knowledge-card {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 8px;
  height: 205px;
  min-height: 0;
  border: 1px solid #dbe2ea;
  border-radius: 6px;
  padding: 7px;
  background: #fff;
}
.knowledge-body {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-gutter: stable;
}
.knowledge-image {
  aspect-ratio: 1 / 1;
  align-self: start;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  overflow: hidden;
}
.knowledge-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.knowledge-body h3 {
  margin: 0 0 5px;
  font-size: 14px;
  line-height: 1.25;
}
.product-intro {
  margin: 5px 0 6px;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  background: #f8fafc;
  padding: 6px 8px;
}
.product-intro strong {
  display: block;
  margin-bottom: 3px;
  font-size: 11px;
  color: #334155;
}
.product-intro p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.45;
  color: #475569;
  word-break: break-word;
}
.knowledge-body dl {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 5px 8px;
  margin: 10px 0;
  font-size: 13px;
}
.knowledge-body dt {
  color: #64748b;
}
.knowledge-body dd {
  margin: 0;
  color: #1f2937;
}
.knowledge-body p {
  font-size: 11px;
  line-height: 1.45;
}
.year-price-empty {
  margin: 8px 0 10px;
  color: #94a3b8;
  font-size: 13px;
}
.year-price-box {
  margin: 5px 0 6px;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  overflow: auto;
  max-width: 100%;
  max-height: 100px;
}
.year-price-box strong {
  display: block;
  padding: 4px 6px;
  background: #f8fafc;
  font-size: 11px;
}
.year-price-box table {
  font-size: 12px;
  min-width: 560px;
}
.year-price-box th,
.year-price-box td {
  padding: 7px 8px;
  white-space: nowrap;
}
.price-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(72px, 1fr));
  gap: 0;
  min-width: 340px;
  border-top: 1px solid #e2e8f0;
}
.year-price-list {
  display: grid;
  min-width: 420px;
}
.year-price-row {
  display: grid;
  grid-template-columns: 46px repeat(4, minmax(72px, 1fr));
  border-top: 1px solid #e2e8f0;
}
.year-label {
  display: flex;
  align-items: center;
  padding: 4px 6px;
  color: #334155;
  font-size: 10px;
  font-weight: 700;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
}
.price-cell {
  display: grid;
  gap: 1px;
  padding: 4px 6px;
  border-right: 1px solid #e2e8f0;
  background: #fff;
}
.price-cell:last-child {
  border-right: 0;
}
.price-cell span {
  color: #64748b;
  font-size: 10px;
}
.price-cell b {
  color: #0f172a;
  font-size: 12px;
  line-height: 1.25;
}
.price-cell em {
  color: #94a3b8;
  font-size: 9px;
  font-style: normal;
}
.catalog-actions,
.product-edit-form .row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.catalog-actions button,
.product-edit-form button {
  width: auto;
  padding: 5px 9px;
  font-size: 12px;
}
.product-edit-form {
  margin: 12px 0;
  padding: 10px;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  background: #f8fafc;
}
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pill-row span {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 2px 8px;
  color: #475569;
  font-size: 12px;
  background: #f8fafc;
}
.muted {
  color: #94a3b8;
}
.ok {
  color: #166534;
}
.warn {
  color: #92400e;
}
.filter-row input {
  width: 100%;
  min-width: 72px;
  padding: 5px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 12px;
  background: #fff;
}
.selected-row td {
  background: #eef6ff;
}
.active-soft {
  background: #e0f2fe;
  border-color: #38bdf8;
  color: #075985;
}
.hint.warning {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #92400e;
}
.session-edit-panel {
  margin: 14px 0;
  padding: 10px;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  background: #f8fafc;
}
.detail-panel {
  margin: 14px 0;
  padding: 10px;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  background: #f8fafc;
}
.detail-panel h3 {
  margin-top: 0;
}
.reason-panel {
  margin: 10px 0;
  padding: 10px;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  background: #fff;
  line-height: 1.8;
}
.selection-plan-items-wrap {
  max-height: 360px;
}
.selection-plan-items-wrap table {
  min-width: 1520px;
  table-layout: fixed;
}
.selection-plan-items-wrap th,
.selection-plan-items-wrap td {
  padding: 8px 9px;
  vertical-align: middle;
  max-width: none;
}
.selection-plan-items-wrap th:nth-child(1),
.selection-plan-items-wrap td:nth-child(1) {
  width: 48px;
  text-align: center;
}
.selection-plan-items-wrap th:nth-child(2),
.selection-plan-items-wrap td:nth-child(2) {
  width: 110px;
}
.selection-plan-items-wrap th:nth-child(3),
.selection-plan-items-wrap td:nth-child(3) {
  width: 110px;
}
.selection-plan-items-wrap th:nth-child(4),
.selection-plan-items-wrap td:nth-child(4) {
  width: 400px;
}
.selection-plan-items-wrap th:nth-child(5),
.selection-plan-items-wrap td:nth-child(5),
.selection-plan-items-wrap th:nth-child(6),
.selection-plan-items-wrap td:nth-child(6) {
  width: 94px;
}
.selection-plan-items-wrap th:nth-child(7),
.selection-plan-items-wrap td:nth-child(7),
.selection-plan-items-wrap th:nth-child(8),
.selection-plan-items-wrap td:nth-child(8),
.selection-plan-items-wrap th:nth-child(9),
.selection-plan-items-wrap td:nth-child(9),
.selection-plan-items-wrap th:nth-child(10),
.selection-plan-items-wrap td:nth-child(10) {
  width: 86px;
}
.selection-plan-items-wrap th:nth-child(11),
.selection-plan-items-wrap td:nth-child(11),
.selection-plan-items-wrap th:nth-child(12),
.selection-plan-items-wrap td:nth-child(12),
.selection-plan-items-wrap th:nth-child(13),
.selection-plan-items-wrap td:nth-child(13),
.selection-plan-items-wrap th:nth-child(14),
.selection-plan-items-wrap td:nth-child(14) {
  width: 90px;
}
.selection-plan-items-wrap td:hover {
  overflow: hidden;
  white-space: nowrap;
}
.selection-title-cell .link-button {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-edit-panel h3 {
  margin-top: 0;
}
.session-cover-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.session-cover-preview {
  width: 132px;
  aspect-ratio: 16 / 9;
  border: 1px solid #dbe2ea;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 13px;
}
.session-cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.session-edit-panel textarea {
  width: 100%;
  margin-top: 10px;
  resize: vertical;
}
.session-edit-panel .session-textarea {
  min-height: 74px;
  height: 74px;
}
.session-form {
  margin-bottom: 4px;
}
.link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: #1d4ed8;
  font-weight: 650;
  cursor: pointer;
  text-align: left;
}
.link-button:hover {
  text-decoration: underline;
}
.inventory-thumbs {
  display: grid;
  grid-template-columns: repeat(5, 30px);
  gap: 3px;
  align-items: center;
}
.inventory-thumbs a,
.inventory-thumbs span {
  width: 30px;
  height: 30px;
  border: 1px solid #dbe2ea;
  border-radius: 4px;
  overflow: hidden;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 11px;
  text-decoration: none;
}
.inventory-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.condition-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.condition-box input[type="text"],
.condition-box input:not([type]) {
  grid-column: auto;
}
.condition-weight-input {
  max-width: 170px;
}
.condition-note-input {
  grid-column: span 3 !important;
  min-width: min(420px, 100%);
}
.employee-service-section {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}
.library-form {
  margin-bottom: 12px;
}
.small-textarea {
  min-height: 105px;
}
.library-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.library-entry {
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}
.library-entry-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.library-entry-head span {
  color: #1d4ed8;
  font-size: 13px;
  white-space: nowrap;
}
.library-entry p {
  color: #334155;
  line-height: 1.7;
  word-break: break-word;
  white-space: pre-wrap;
}
.library-meta {
  margin-top: 10px;
  color: #64748b;
  font-size: 13px;
}
.library-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.library-actions button {
  width: auto;
  padding: 7px 12px;
  font-size: 13px;
}
.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid #dbe2ea;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  white-space: normal;
}
.check-inline input {
  width: auto;
  margin: 0;
}
.pill-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0 14px;
}
.uploader-program-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.uploader-local-source {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  background: #f8fafc;
}
.uploader-local-source h3 {
  margin: 0 0 6px;
  font-size: 16px;
}
.uploader-local-source p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}
.uploader-local-source select {
  max-width: 220px;
}
.uploader-local-source .row input {
  min-width: 320px;
}
.uploader-local-help {
  margin-top: 0;
}
.program-card {
  display: grid;
  align-content: space-between;
  gap: 12px;
  min-height: 178px;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  padding: 15px;
  background: #fff;
}
.program-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}
.program-card p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
}
.active-program {
  border-color: #bfdbfe;
  background: #f8fbff;
}
.pending-program {
  background: #f8fafc;
}
.insight-rail {
  display: grid;
  gap: 10px;
}
.rail-card {
  background: #fff;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  padding: 13px;
  min-width: 0;
}
.shop-card {
  display: flex;
  align-items: center;
  gap: 12px;
}
.rail-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #2563eb;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.rail-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
}
.rail-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.rail-list {
  display: grid;
  gap: 4px;
}
.rail-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid #eef2f7;
}
.rail-item:last-child {
  border-bottom: 0;
}
.rail-item span {
  color: #64748b;
  font-size: 13px;
}
.rail-item strong {
  color: #0f172a;
  font-size: 16px;
}
.rail-card p,
#railReportPath,
[data-business-report-path] {
  word-break: break-word;
  font-size: 12px;
  line-height: 1.55;
}
.template-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 10px;
}
.template-toolbar button,
.template-panel button {
  padding: 8px 12px;
}
.auction-session-actions {
  justify-content: flex-start;
  margin: 4px 0 10px;
}
.auction-session-actions select {
  max-width: 160px;
}
.template-panel {
  display: grid;
  gap: 10px;
  margin: 0 0 22px;
  padding: 12px;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  background: #f8fafc;
}
.template-panel h4 {
  margin: 2px 0 0;
  font-size: 14px;
}
.template-panel textarea {
  min-height: 74px;
}
.template-account-textarea {
  grid-column: span 2;
  min-height: 62px !important;
}
.template-tier-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 8px;
}
.template-flex-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}
.template-tier-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.template-flex-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.template-tier-grid span {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
}
.template-flex-grid span {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
}
.compact-grid {
  margin-top: 0;
}
.uploader-log {
  min-height: 180px;
  max-height: 360px;
  overflow: auto;
  padding: 12px;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
}
.money-strong {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
}
.picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
}
.picker-panel {
  width: min(1280px, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.22);
}
.picker-table-wrap {
  max-height: 60vh;
  overflow: auto;
}
@media (max-width: 1000px) {
  .app-layout { grid-template-columns: 1fr; }
  .primary-sidebar, .insight-rail, .subtabs { position: static; min-height: 0; }
  .tabs, .subtabs { flex-direction: row; overflow-x: auto; }
  .tab { min-width: 72px; }
  .view.active:has(> .subtabs) { display: block; }
  .grid, .grid.four, .form-grid { grid-template-columns: 1fr; }
  .server-status-detail-grid { grid-template-columns: 1fr; }
  .server-status-detail-wide { grid-column: auto; }
  .template-tier-grid { grid-template-columns: 1fr 1fr; }
  .template-flex-grid { grid-template-columns: 1fr 1fr; }
  .condition-box { grid-template-columns: 1fr; }
  .condition-box input[type="text"],
  .condition-box input:not([type]) { grid-column: auto; }
  .knowledge-grid { grid-template-columns: 1fr; }
  .uploader-program-grid { grid-template-columns: 1fr; }
  .knowledge-card {
    grid-template-columns: 64px minmax(0, 1fr);
    height: 230px;
  }
  header, .row, .toolbar { flex-direction: column; align-items: stretch; }
}

/* 07 layout preview: calmer operations layout, original controls retained. */
:root {
  --page-bg: #f3f5f2;
  --surface: #ffffff;
  --surface-soft: #f8faf7;
  --line: #d8ded6;
  --line-strong: #c4cdc3;
  --text-main: #1f2933;
  --text-muted: #667085;
  --accent: #28684f;
  --accent-soft: #eaf3ee;
  --accent-blue: #2563eb;
  --danger: #b42318;
}

body {
  background: var(--page-bg);
  color: var(--text-main);
  font-size: 14px;
}

.shell {
  width: min(1760px, calc(100vw - 32px));
  margin: 16px auto 28px;
}

header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, .96);
  border-color: var(--line);
  box-shadow: 0 8px 24px rgba(31, 41, 51, .06);
}

h1 {
  font-size: 24px;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
}

h3 {
  margin: 14px 0 9px;
  font-size: 15px;
  line-height: 1.3;
}

p,
.muted,
header p {
  color: var(--text-muted);
}

.platform-scope {
  background: var(--surface-soft);
  border-color: var(--line);
}

.platform-scope button.active {
  color: var(--accent);
}

.app-layout {
  grid-template-columns: 112px minmax(0, calc(100% - 378px)) 238px;
  gap: 14px;
}

.primary-sidebar {
  top: 92px;
  padding: 10px;
  background: var(--surface);
  border-color: var(--line);
  box-shadow: 0 10px 26px rgba(31, 41, 51, .05);
}

.tabs {
  gap: 6px;
}

.tab {
  min-height: 38px;
  height: auto;
  padding: 8px 10px;
  color: #344054;
  justify-content: flex-start;
  text-align: left;
}

.tab.active {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.workbench-stage {
  display: grid;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
}

.view,
.subview,
.panel {
  min-width: 0;
  max-width: 100%;
}

.subtabs {
  position: static;
  top: auto;
  left: auto;
  z-index: auto;
  width: auto;
  max-height: none;
  min-height: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  padding: 9px;
  overflow: visible;
  background: rgba(255, 255, 255, .96);
  border-color: var(--line);
  box-shadow: 0 8px 20px rgba(31, 41, 51, .06);
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
  transition: none;
}

.view.active > .subtabs.flyout-open,
.view.active > .subtabs:hover {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.subtab {
  width: auto;
  min-height: 32px;
  height: auto;
  padding: 7px 11px;
  background: transparent;
  border: 1px solid transparent;
  color: #475467;
  white-space: nowrap;
}

.subtab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 1px 4px rgba(40, 104, 79, .22);
}

.panel,
.import-box,
.task-form,
.session-edit-panel,
.detail-panel,
.template-panel,
.uploader-local-source,
.program-card,
.simple-card,
.void-records,
.product-edit-form,
.rail-card {
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(31, 41, 51, .04);
}

.panel {
  padding: 18px;
  margin-bottom: 12px;
}

.subtle-panel,
.task-form,
.action-toolbar,
.import-box,
.template-panel,
.uploader-local-source,
.detail-panel,
.session-edit-panel,
.product-edit-form {
  background: var(--surface-soft);
}

.warehouse-switcher {
  padding: 12px 14px;
  margin-top: 22px;
}

.view.active > .subtabs + .warehouse-switcher {
  margin-top: 22px !important;
}

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

.grid.four {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.grid.five {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.metric {
  background: var(--surface);
  border-color: var(--line);
  padding: 14px;
  min-height: 76px;
}

.metric span {
  color: var(--text-muted);
}

.metric strong {
  color: #111827;
  font-size: 22px;
}

.inline-metric {
  min-width: 220px;
  min-height: 54px;
}

.form-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
}

.simple-form {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.row,
.toolbar,
.action-toolbar {
  gap: 10px;
}

.action-toolbar {
  margin: 10px 0 14px;
  padding: 10px;
  border-color: var(--line);
}

.toolbar p,
.export-toolbar .muted {
  min-width: min(260px, 100%);
}

input,
select,
textarea,
.big-textarea,
.checkline,
.hint {
  border-color: var(--line-strong);
}

input,
select {
  height: 38px;
  font-size: 14px;
}

button {
  min-height: 38px;
  padding: 8px 13px;
  background: var(--accent);
  font-size: 14px;
  white-space: nowrap;
}

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

button.mini {
  min-height: 28px;
  padding: 5px 9px;
}

.hint {
  background: #fbfcfb;
  color: #536171;
}

.table-wrap {
  width: 100%;
  min-width: 0;
  max-height: min(58vh, 620px);
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(31, 41, 51, .03);
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.pagination-bar .pagination-note {
  margin-right: auto;
  color: var(--text);
}

.pagination-size {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pagination-size select {
  width: auto;
  min-width: 72px;
  min-height: 30px;
  padding: 4px 8px;
}

table {
  min-width: 980px;
  font-size: 13px;
}

th,
td {
  padding: 9px 10px;
  border-bottom-color: #e6ebe4;
}

th {
  background: #edf4ec;
  color: #344054;
}

td:hover {
  overflow: hidden;
  white-space: nowrap;
  word-break: normal;
}

.condition-box {
  grid-template-columns: repeat(auto-fit, minmax(156px, 1fr));
  gap: 10px;
}

.condition-note-input {
  grid-column: span 2 !important;
}

.uploader-program-grid {
  gap: 14px;
}

.program-card {
  min-height: 190px;
}

.insight-rail {
  grid-column: auto;
  position: sticky;
  top: 92px;
  grid-template-columns: 1fr;
  gap: 12px;
  min-width: 0;
}

.rail-card {
  padding: 12px;
}

.rail-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent);
}

.rail-item {
  gap: 8px;
  padding: 6px 0;
}

.rail-item strong {
  font-size: 15px;
}

.knowledge-grid {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.picker-panel {
  border-color: var(--line);
}

.boundary-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 12px;
  padding: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px;
}

.boundary-flow span,
.boundary-flow strong {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.boundary-flow strong {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

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

.title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.title-row h1 {
  margin: 0;
}

.global-refresh-btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  min-height: 28px;
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.core-data-safe-panel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.core-data-safe-panel h3 {
  margin: 0 0 8px;
}

.safe-path {
  margin: 8px 0 0;
  color: var(--muted);
  word-break: break-all;
}

.compact-login {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.compact-login input,
.compact-login button {
  width: 100%;
}

#inventoryTable th:nth-child(2),
#inventoryTable td:nth-child(2) {
  width: 118px;
  max-width: 128px;
}

#inventoryTable th:nth-child(9),
#inventoryTable td:nth-child(9) {
  width: 76px;
  max-width: 88px;
}

#inventoryTable th:last-child,
#inventoryTable td:last-child {
  min-width: 620px;
  max-width: none;
  white-space: nowrap;
  overflow: visible;
}

#inventoryTable td:last-child:hover {
  overflow: visible;
  white-space: nowrap;
}

.table-select-all {
  align-items: center;
  gap: 6px;
  margin: 0;
}

.inventory-action-group {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.inventory-condition-editor-row td {
  background: #fbfcfb;
  white-space: normal;
  overflow: visible;
}

.inventory-detail-editor-row td {
  background: #fbfcfb;
  white-space: normal;
  overflow: visible;
}

.inventory-detail-panel {
  display: grid;
  gap: 12px;
  max-height: 68vh;
  overflow-y: auto;
  border: 1px solid #c8d8cf;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.inventory-detail-head,
.inventory-detail-actions,
.inventory-image-viewer-head,
.inventory-image-viewer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.inventory-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

.inventory-detail-grid h4 {
  margin: 0 0 8px;
  font-size: 15px;
}

.inventory-info-card {
  max-width: 1120px;
  padding: 12px;
  border: 1px solid #dce7df;
  border-radius: 8px;
  background: #fbfdfb;
}

.inventory-image-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
}

.inventory-image-card[draggable="true"] {
  position: relative;
  display: grid;
  gap: 4px;
  width: 112px;
  flex: 0 0 112px;
  min-height: 132px;
  padding: 6px;
  border: 1px solid #d6e2da;
  border-radius: 8px;
  background: #f8fbf8;
  color: #1f2937;
  cursor: grab;
  box-shadow: none;
}

.inventory-empty-image-card {
  position: relative;
  display: grid;
  gap: 4px;
  width: 112px;
  flex: 0 0 112px;
  min-height: 132px;
  padding: 6px;
  border: 1px dashed #c9d7ce;
  border-radius: 8px;
  background: #fbfdfb;
  color: #64748b;
}

.empty-image-slot {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  background: #eef5ef;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.inventory-image-card.dragging {
  opacity: .55;
}

.inventory-image-card.drag-over {
  outline: 2px solid #2b6f50;
  outline-offset: 2px;
}

.inventory-image-grid.image-reordering {
  opacity: .72;
  pointer-events: none;
}

.inline-saving {
  opacity: .72;
}

.inventory-image-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  object-fit: cover;
  background: #eef2f7;
}

.image-slot,
.image-kind {
  font-size: 12px;
  font-weight: 800;
}

.image-kind {
  color: #64748b;
}

.empty-image-note {
  padding: 20px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #64748b;
  text-align: center;
}

.inventory-edit-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
  justify-content: start;
}

.inventory-edit-form label,
.inventory-edit-note {
  display: grid;
  gap: 4px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.inventory-edit-form label span,
.inventory-edit-note span {
  white-space: nowrap;
}

.inventory-edit-note {
  margin-top: 8px;
  grid-column: 1 / -1;
}

.inventory-price-card {
  background: #fffdf7;
}

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

.inventory-price-muted {
  min-height: 42px;
  padding: 11px 12px;
  border: 1px dashed #d8cdb7;
  border-radius: 6px;
  color: #8a6a2f;
  background: #fff9ea;
  font-size: 12px;
}

.inventory-condition-card {
  background: #fbfcff;
}

.inventory-detail-condition {
  margin-bottom: 8px;
}

.inventory-image-viewer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 28px;
}

.inventory-image-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .72);
}

.inventory-image-viewer-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  width: min(1100px, 94vw);
  max-height: 92vh;
  padding: 14px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .35);
}

.inventory-image-viewer-body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.inventory-image-viewer-body img {
  max-width: 100%;
  max-height: 74vh;
  margin: 0 auto;
  border-radius: 8px;
  object-fit: contain;
  background: #f8fafc;
}

.inline-condition-editor {
  display: grid;
  gap: 10px;
  border: 1px solid #c8d8cf;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.inline-condition-title,
.inline-condition-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-condition-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px 12px;
}

.inline-condition-actions input {
  flex: 1 1 280px;
  min-width: 180px;
}

@media (max-width: 1440px) {
  .shell {
    width: min(1320px, calc(100vw - 28px));
  }

  .app-layout {
    grid-template-columns: 104px minmax(0, calc(100% - 352px)) 220px;
  }

  .insight-rail {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .shell {
    width: min(100vw - 18px, 760px);
    margin-top: 10px;
  }

  header {
    position: static;
    grid-template-columns: 1fr;
  }

  .primary-sidebar,
  .subtabs {
    position: static;
  }

  .app-layout {
    grid-template-columns: 1fr;
  }

  .app-layout > * {
    min-width: 0;
    max-width: 100%;
  }

  .primary-sidebar {
    padding: 8px;
  }

  .tabs,
  .subtabs {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .tab,
  .subtab {
    flex: 0 0 auto;
    justify-content: center;
  }

  .insight-rail {
    grid-column: auto;
    position: static;
    grid-template-columns: 1fr;
  }

  .condition-note-input {
    grid-column: auto !important;
  }
}

@media (max-width: 760px) {
  #systemStatusPanel .server-status-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #systemStatusPanel .server-status-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #systemStatusPanel .server-status-detail-wide {
    grid-column: auto;
  }

  #systemStatusPanel .table-wrap,
  #systemStatusBox {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
  }

  #serverBackupCountTable,
  #serverDeletedBackupTable {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  #serverBackupCountTable th,
  #serverBackupCountTable td,
  #serverDeletedBackupTable th,
  #serverDeletedBackupTable td {
    overflow-wrap: anywhere;
    white-space: normal;
  }

  #serverLargestBackupTable,
  #systemStatusBox table {
    min-width: 620px;
  }
}

/* 2026-07-12 UI visual relief: CSS-only production override. */
:root {
  --surface-muted: #f7f9f6;
  --line-soft: #e3e8e1;
  --shadow-soft: 0 1px 3px rgba(31, 41, 51, .045);
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

header {
  border-color: var(--line-soft);
  box-shadow: 0 2px 8px rgba(31, 41, 51, .045);
}

.primary-sidebar,
.subtabs,
.panel,
.import-box,
.task-form,
.session-edit-panel,
.detail-panel,
.template-panel,
.uploader-local-source,
.program-card,
.simple-card,
.void-records,
.product-edit-form,
.rail-card {
  border-color: var(--line-soft);
  box-shadow: var(--shadow-soft);
}

.primary-sidebar,
.subtabs,
.panel,
.rail-card {
  background: var(--surface);
}

.subtle-panel,
.task-form,
.action-toolbar,
.import-box,
.template-panel,
.uploader-local-source,
.detail-panel,
.session-edit-panel,
.product-edit-form,
.workflow-section {
  background: var(--surface-muted);
  border-color: var(--line-soft);
}

.panel {
  padding: 16px;
}

.action-toolbar {
  padding: 9px;
  box-shadow: none;
}

.metric {
  min-height: 70px;
  padding: 12px 13px;
  border-color: var(--line-soft);
  box-shadow: none;
}

.metric span {
  margin-bottom: 3px;
  color: #697586;
}

.metric strong,
.money-strong,
th,
td {
  font-variant-numeric: tabular-nums;
}

button:not(.tab):not(.subtab),
button:not(.tab):not(.subtab).mini {
  box-shadow: none;
}

.subtab.active,
.segmented-filter .segmented-option.active {
  box-shadow: 0 1px 2px rgba(40, 104, 79, .16);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.hint {
  background: #fafbfa;
  border-color: var(--line-soft);
  color: #5f6b7a;
}

.table-wrap,
.mini-table-wrap,
.quota-table-wrap {
  border-color: var(--line-soft);
  box-shadow: none;
}

th,
td {
  border-bottom-color: var(--line-soft);
}

th {
  background: #eff4ee;
  color: #344054;
  box-shadow: 0 1px 0 var(--line-soft);
}

thead tr.filter-row th {
  background: #fbfcfb;
}

tbody tr:nth-child(even):not(.selected-row):not(.voided-row):not(.inventory-condition-editor-row):not(.inventory-detail-editor-row) > td {
  background: #fafbfa;
}

tbody tr:not(.selected-row):not(.voided-row):not(.inventory-condition-editor-row):not(.inventory-detail-editor-row):hover > td {
  background: #f2f6f2;
}

.selected-row td {
  background: #eaf3ee;
}

.rail-item {
  border-bottom-color: var(--line-soft);
}
/* 2026-07-12: first-pass layout relief for the global shell and inventory workflow. */
.workspace-header {
  align-items: center;
}

.workspace-layout {
  min-width: 0;
}

.workspace-primary-nav .tabs {
  gap: 4px;
}

.inventory-workspace {
  min-width: 0;
}

.inventory-subnav {
  align-items: center;
  gap: 4px;
}

.inventory-subnav [data-nav-group="management"] {
  background: #f7f8f7;
  color: #53625c;
}

.inventory-subnav [data-subtab="inventoryWarehouses"] {
  margin-left: 12px;
  border-left-color: #aebbb5;
}

.inventory-subnav [data-nav-group="management"].active {
  background: #dfeae4;
  color: #176445;
}

.inventory-context-bar {
  margin-bottom: 12px;
  padding: 10px 14px;
  background: #f8faf8;
}

.inventory-context-bar .row {
  align-items: center;
  gap: 12px;
}

.inventory-context-bar select {
  width: min(320px, 100%);
  flex: 0 1 320px;
}

.inventory-page,
.inventory-workspace > .subview {
  min-width: 0;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.page-heading h2,
.page-heading p {
  margin: 0;
}

.page-heading h2 {
  font-size: 20px;
  line-height: 1.35;
}

.page-heading p {
  margin-top: 3px;
  font-size: 13px;
}

.workflow-card {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid #d6dfda;
  border-radius: 8px;
  background: #fff;
}

.workflow-card > h3:first-child,
.workflow-card .section-heading-row h3 {
  margin-top: 0;
}

.inventory-primary-task,
.inventory-primary-task-card {
  border-left: 3px solid #277255;
  background: #fbfdfc;
}

.primary-action-row {
  justify-content: flex-end;
  margin-top: 12px;
}

.primary-action-row button {
  min-width: 150px;
}

.tool-drawer {
  margin-top: 12px;
  border: 1px solid #d6dfda;
  border-radius: 8px;
  background: #f8faf8;
}

.tool-drawer > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 10px 14px;
  color: #24352e;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

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

.tool-drawer > summary::after {
  content: "+";
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  border: 1px solid #c5d0ca;
  border-radius: 4px;
  background: #fff;
  color: #276b50;
  font-size: 18px;
  line-height: 1;
}

.tool-drawer[open] > summary::after {
  content: "−";
}

.tool-drawer > summary small {
  margin-left: auto;
  color: #75817c;
  font-size: 12px;
  font-weight: 400;
}

.tool-drawer[open] > summary {
  border-bottom: 1px solid #d6dfda;
  background: #f2f6f3;
}

.tool-drawer > :not(summary) {
  margin-right: 14px;
  margin-left: 14px;
}

.tool-drawer > :last-child {
  margin-bottom: 14px;
}

.tool-drawer .import-box {
  padding: 14px 0 0;
  border: 0;
  background: transparent;
}

.secondary-action-row button,
.date-filter-bar button:not(#downloadOutboundSheetBtn) {
  border-color: #bdc9c3;
  background: #fff;
  color: #35584a;
  box-shadow: none;
}

.date-filter-bar {
  padding: 10px;
  border: 1px solid #e0e5e2;
  border-radius: 8px;
  background: #fafbfa;
}

.inventory-query-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1.6fr);
  gap: 10px;
  margin-bottom: 10px;
}

.inventory-query-row > * {
  min-width: 0;
  width: 100%;
}

.danger-zone {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #e8c2bd;
  border-radius: 6px;
  background: #fff8f7;
}

.danger-zone > span {
  margin-right: auto;
  color: #8b3028;
  font-size: 13px;
  font-weight: 700;
}

.danger-zone button {
  border-color: #c8493f;
  background: #fff;
  color: #a52620;
  box-shadow: none;
}

.danger-zone button.danger {
  background: #b72b24;
  color: #fff;
}

.inventory-related-metric {
  background: #f7f8f7;
}

.inventory-related-metric strong {
  font-size: 22px;
  color: #526059;
}

.stocktake-primary-actions {
  border-left: 3px solid #277255;
  background: #fbfdfc;
}

@media (max-width: 980px) {
  .inventory-subnav [data-subtab="inventoryWarehouses"] {
    margin-left: 4px;
  }

  .inventory-query-row {
    grid-template-columns: minmax(160px, 0.8fr) minmax(220px, 1.2fr);
  }
}

@media (max-width: 680px) {
  .workspace-shell {
    width: calc(100% - 8px);
    margin-right: 4px;
    margin-left: 4px;
  }

  .workspace-header > *,
  .workspace-header .title-block {
    min-width: 0;
    max-width: 100%;
  }

  .workspace-header .platform-scope {
    width: 100%;
    overflow-x: auto;
  }

  .page-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .page-heading > button {
    width: 100%;
  }

  .inventory-context-bar .row,
  .tool-drawer > summary {
    align-items: flex-start;
  }

  .inventory-context-bar .row {
    flex-direction: column;
  }

  .inventory-context-bar select,
  .inventory-query-row {
    width: 100%;
  }

  .inventory-context-bar select {
    flex: 0 0 auto;
    min-height: 40px;
  }

  .inventory-query-row {
    grid-template-columns: 1fr;
  }

  .tool-drawer > summary {
    flex-wrap: wrap;
  }

  .tool-drawer > summary small {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .danger-zone {
    align-items: stretch;
    flex-direction: column;
  }

  .danger-zone > span,
  .danger-zone button,
  .primary-action-row button {
    width: 100%;
  }
}

/* 2026-07-12: third-pass layout relief for orders and finance. */
.orders-workspace,
.finance-workspace,
.order-page,
.finance-page {
  min-width: 0;
}

.orders-overview-metrics,
.finance-overview-metrics {
  margin-top: 4px;
}

.orders-date-summary,
.finance-date-summary {
  margin-top: 12px;
  border-left: 3px solid #436f8c;
  background: #fafcfd;
}

.orders-date-summary > .toolbar,
.finance-date-summary > .toolbar {
  display: block;
}

.orders-date-summary > .toolbar > .action-toolbar,
.finance-date-summary > .toolbar > .action-toolbar,
.won-collector-primary > .action-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  width: 100%;
  margin-top: 10px;
}

.orders-date-summary > .toolbar > .action-toolbar > *,
.finance-date-summary > .toolbar > .action-toolbar > *,
.won-collector-primary > .action-toolbar > * {
  width: 100%;
  min-width: 0;
}

.order-void-drawer,
.order-tools-drawer,
.won-manual-drawer,
.finance-formula-drawer,
.finance-detail-drawer,
.employee-service-maintenance,
.finance-expense-void-drawer,
.finance-core-safe-drawer {
  margin-top: 12px;
}

.won-collector-primary,
.order-delivery-primary,
.finance-expense-primary,
.department-handoff-primary,
.employee-service-settlement {
  border-left: 3px solid #277255;
  background: #fbfdfc;
}

.won-collector-primary h3,
.order-delivery-primary h3,
.employee-service-settlement h3,
.department-handoff-primary h3 {
  margin-top: 0;
}

.won-order-page > .subtle-panel {
  margin-top: 12px;
  border-left: 3px solid #436f8c;
}

.won-order-page .uploader-log {
  min-height: 150px;
  max-height: 260px;
}

.order-danger-zone button,
.finance-danger-zone button {
  border-color: #b72b24;
  background: #fff5f4;
  color: #a52620;
  box-shadow: none;
}

.order-page > .table-wrap,
.finance-expense-list-page > .table-wrap {
  margin-top: 12px;
}

.order-delivery-primary .task-form {
  margin: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.finance-formula-drawer {
  border-left: 3px solid #8a7447;
}

.finance-detail-drawer {
  border-left: 3px solid #436f8c;
}

.finance-detail-drawer > .grid,
.finance-detail-drawer > .hint,
.finance-detail-drawer > h3,
.finance-detail-drawer > .table-wrap,
.finance-detail-drawer > .owner-auth-only {
  margin-top: 12px;
}

.tool-drawer > .table-wrap {
  width: auto;
  max-width: calc(100% - 28px);
}

.employee-service-section {
  margin-top: 0;
  padding-top: 16px;
  border-top: 1px solid #e3e8e1;
}

.employee-service-filter {
  border-left: 3px solid #436f8c;
  background: #fafcfd;
}

.employee-service-section > .date-filter-bar,
.department-handoff-primary > .action-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  width: 100%;
}

.employee-service-section > .date-filter-bar > *,
.department-handoff-primary > .action-toolbar > * {
  width: 100%;
  min-width: 0;
}

.employee-service-maintenance {
  border-left: 3px solid #75817c;
}

.employee-service-settlement {
  margin-top: 14px;
}

.finance-expense-primary {
  max-width: 1100px;
}

.finance-expense-primary .form-grid {
  margin-top: 0;
}

.finance-expense-void-drawer {
  border-left: 3px solid #a8473f;
}

.department-handoff-primary {
  margin-top: 0;
}

.export-all-toolbar {
  margin-top: 12px;
  border: 1px solid #e0e5e2;
  background: #fafbfa;
}

.export-all-toolbar p {
  flex: 1 1 260px;
  margin: 0;
}

.finance-core-safe-drawer .core-data-safe-panel {
  margin: 12px 14px 14px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

@media (max-width: 1000px) {
  .orders-date-summary > .toolbar > .action-toolbar,
  .finance-date-summary > .toolbar > .action-toolbar,
  .won-collector-primary > .action-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .employee-service-section > .date-filter-bar,
  .department-handoff-primary > .action-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .won-collector-primary .toolbar button,
  .order-delivery-primary button,
  .employee-service-settlement button,
  .department-handoff-primary button {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .order-page .page-heading,
  .finance-page .page-heading {
    margin-bottom: 10px;
  }

  .orders-date-summary,
  .finance-date-summary,
  .won-collector-primary,
  .order-delivery-primary,
  .finance-expense-primary,
  .department-handoff-primary,
  .employee-service-settlement {
    padding: 12px;
  }

  .export-all-toolbar,
  .export-all-toolbar button,
  .finance-core-safe-drawer button {
    width: 100%;
  }

  .orders-date-summary > .toolbar > .action-toolbar,
  .finance-date-summary > .toolbar > .action-toolbar,
  .won-collector-primary > .action-toolbar {
    grid-template-columns: 1fr;
  }

  .employee-service-section > .date-filter-bar,
  .department-handoff-primary > .action-toolbar {
    grid-template-columns: 1fr;
  }
}

/* 2026-07-12: second-pass flow relief for selection, auction prep and uploader. */
.selection-workspace-page,
.auction-prep-workspace,
.uploader-workspace {
  min-width: 0;
}

.selection-workspace-page .flow-template-section,
.selection-workspace-page .flow-primary-section,
.selection-workspace-page .flow-action-section,
.selection-workspace-page .flow-review-section {
  margin-top: 12px;
}

.selection-workspace-page .flow-template-section {
  border-left: 3px solid #75817c;
}

.selection-workspace-page .flow-primary-section {
  border-left: 3px solid #277255;
  background: #fbfdfc;
}

.selection-workspace-page .flow-action-section {
  border-left: 3px solid #436f8c;
  background: #fafcfd;
}

.selection-workspace-page .flow-review-section {
  border-left: 3px solid #8a7447;
  background: #fdfcf9;
}

.flow-template-drawer {
  margin: 0;
}

.template-save-actions {
  margin: 12px 0 0;
}

#selectionKnowledgePanel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.selection-knowledge-drawer {
  margin-top: 0;
}

.selection-knowledge-drawer > summary h3 {
  margin: 0;
  font-size: 15px;
}

.selection-knowledge-drawer > textarea {
  width: calc(100% - 28px);
  margin-top: 12px;
}

.auction-prep-metrics {
  margin-top: 12px;
}

.auction-prep-primary-task {
  border-left: 3px solid #277255;
  background: #fbfdfc;
}

.auction-draft-review {
  margin-top: 12px;
  border-left: 3px solid #436f8c;
  background: #fafcfd;
}

.auction-draft-review .auction-session-actions {
  margin-bottom: 10px;
}

.uploader-main-panel {
  min-width: 0;
}

.uploader-source-bar {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.uploader-source-bar > .toolbar {
  padding: 12px 14px;
  border: 1px solid #d6dfda;
  border-radius: 8px;
  background: #f8faf8;
}

.uploader-local-tools {
  margin-top: 10px;
}

.uploader-program-grid {
  align-items: start;
  margin-top: 14px;
}

.uploader-platform-card {
  min-height: 0;
  align-content: start;
  border-top: 3px solid #277255;
  background: #fff;
}

.uploader-platform-card.pending-program {
  border-top-color: #436f8c;
}

.uploader-platform-card > div:first-child {
  min-height: 58px;
}

.uploader-primary-actions,
.uploader-control-actions {
  align-items: stretch;
  gap: 8px;
}

.uploader-primary-actions button,
.uploader-control-actions button {
  flex: 1 1 150px;
}

#openCommercialAuthBtn,
#commercialPreflightBtn,
#openZhengqiAuthBtn,
#zhengqiPreflightBtn,
.uploader-control-actions button:not(#stopUploaderBtn):not(#stopZhengqiUploaderBtn) {
  border-color: #bdc9c3;
  background: #fff;
  color: #35584a;
  box-shadow: none;
}

#stopUploaderBtn,
#stopZhengqiUploaderBtn {
  border-color: #b72b24;
  background: #fff5f4;
  color: #a52620;
  box-shadow: none;
}

.uploader-platform-card .uploader-log {
  min-height: 150px;
  max-height: 260px;
  margin-top: 2px;
}

.uploader-history-drawer,
.uploader-manual-platforms {
  margin-top: 14px;
}

.uploader-history-drawer .rail-card-head {
  margin-top: 12px;
}

.manual-platform-grid {
  margin-top: 14px;
}

@media (max-width: 1000px) {
  .uploader-source-bar > .toolbar,
  .uploader-source-bar select {
    width: 100%;
    max-width: 100%;
  }

  .uploader-primary-actions button,
  .uploader-control-actions button {
    width: 100%;
    flex: 0 0 auto;
  }
}

@media (max-width: 680px) {
  .selection-workspace-page .section-heading-row,
  .auction-draft-review .section-heading-row {
    align-items: stretch;
    flex-direction: column;
  }

  .selection-workspace-page .inline-actions,
  .auction-draft-review .inline-actions {
    width: 100%;
  }

  .selection-workspace-page .inline-actions button,
  .auction-draft-review .inline-actions button,
  .template-save-actions button {
    width: 100%;
  }

  .selection-knowledge-drawer > textarea {
    width: calc(100% - 28px);
  }
}

/* 2026-07-12: fourth-pass layout relief for knowledge and system management. */
.knowledge-workspace,
.system-workspace,
.knowledge-page,
.system-page {
  min-width: 0;
}

.knowledge-page .page-heading,
.system-page .page-heading {
  margin-bottom: 12px;
}

.knowledge-filter-primary,
.knowledge-entry-primary,
.market-update-primary,
.employee-maintenance-primary {
  border-left: 3px solid #277255;
  background: #fbfdfc;
}

.knowledge-filter-primary > .row {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1.3fr);
  gap: 10px;
  align-items: center;
}

.knowledge-filter-primary > .row > select,
.knowledge-filter-primary > .row > input {
  width: 100%;
  max-width: none;
}

.knowledge-filter-primary .product-edit-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #dce4df;
}

.knowledge-filter-primary .product-edit-form > .row {
  margin-top: 10px;
}

.knowledge-products-page .knowledge-summary {
  margin-top: 12px;
}

.knowledge-entry-primary > textarea {
  width: 100%;
  margin: 10px 0;
}

.knowledge-entry-primary > button {
  min-width: 150px;
}

.knowledge-image-tools,
.market-schedule-tools,
.market-import-tools,
.company-audit-tools,
.server-backup-details {
  margin-top: 12px;
}

.knowledge-library-page > .section-title {
  margin: 18px 0 10px;
}

.market-update-primary > p {
  margin: 4px 0 12px;
  color: #66756e;
}

.market-update-primary > .row {
  align-items: center;
  gap: 12px;
}

.market-update-primary #marketAutoStatus {
  min-width: 0;
  margin: 0;
  color: #55655e;
}

.market-schedule-tools .simple-form,
.market-import-tools .simple-form {
  margin-top: 0;
}

.knowledge-market-page > .issues {
  margin-top: 12px;
}

.employee-maintenance-primary {
  margin-top: 12px;
}

.employee-maintenance-primary > h3:not(:first-child) {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #dce4df;
}

.employee-permissions-page > .table-wrap {
  margin-bottom: 12px;
}

.employee-danger-zone {
  margin-top: 12px;
}

.employee-danger-zone button {
  width: auto;
  min-width: 130px;
}

.sync-health-page > .action-toolbar,
.system-status-page > .action-toolbar {
  margin: 10px 0 12px;
}

.sync-health-page > .grid,
.system-status-page > .grid {
  margin-top: 12px;
}

.server-backup-details .server-status-detail-grid {
  margin: 0;
}

.server-backup-details .server-status-detail {
  min-width: 0;
}

.system-status-page #systemStatusBox {
  margin-top: 12px;
}

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

  .knowledge-filter-primary > .row {
    grid-template-columns: 1fr;
  }

  .market-update-primary > .row {
    align-items: stretch;
    flex-direction: column;
  }

  .market-update-primary > .row > button {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .knowledge-page .page-heading,
  .system-page .page-heading {
    align-items: stretch;
  }

  .knowledge-entry-primary > button,
  .employee-danger-zone button {
    width: 100%;
  }

  .employee-danger-zone {
    align-items: stretch;
  }

  .server-backup-details .server-status-detail-grid {
    grid-template-columns: 1fr;
  }
}
