.pigment-main {
  margin-left: 255px;
  padding: 30px;
}

.pigment-main.pigment-popup {
  margin-left: 0;
  padding: 20px;
}

.pigment-panel {
  background: #ffffff;
  border: 1px solid #d7dde5;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  margin-top: 22px;
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}

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

.pigment-toolbar h2 {
  margin: 0 0 8px;
}

.pigment-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.pigment-meta {
  display: flex;
  gap: 18px;
  margin: 0;
  font-size: 14px;
  color: #475569;
}

.upload-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

.pigment-keyword {
  width: 420px;
  max-width: 420px;
}

.pigment-search-grid {
  grid-template-columns: 180px minmax(0, 420px) max-content;
}

.pigment-main .detail-condition-primary-row .control-content,
.pigment-main .price-condition-row .control-content {
  min-height: 64px;
  box-sizing: border-box;
}

.pigment-main .detail-condition-primary-row .field-block,
.pigment-main .detail-condition-row .price-filter-block {
  gap: 6px;
}

.pigment-main .detail-condition-row .price-filter-block .control-input {
  height: 38px !important;
  min-height: 38px !important;
  line-height: 38px;
}

.incoming-stock-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  margin: 0;
  padding: 0;
  color: #111827;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.incoming-stock-checkbox {
  width: 13px;
  height: 13px;
  min-width: 0 !important;
  flex: 0 0 auto !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0;
  justify-self: start;
  align-self: center;
  accent-color: #2563eb;
  cursor: pointer;
}

.incoming-quantity-cell {
  font-weight: 700;
  color: #166534;
}

.price-filter-block {
  max-width: none !important;
}

.price-filter-control {
  display: inline-flex;
  align-items: center;
}

.detail-condition-row .price-condition-select {
  width: 78px;
  max-width: 78px;
  border-radius: 6px 0 0 6px;
}

.detail-condition-row .price-value-input {
  width: 140px;
  max-width: 140px;
  margin-left: -1px;
  border-radius: 0 6px 6px 0;
}

.control-row .pigment-search-grid .pigment-keyword {
  width: 100%;
  max-width: 420px;
}

.pigment-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.pigment-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.pigment-result-table {
  min-width: 1220px;
}

.pigment-table thead {
  background-color: #e5e7eb;
}

.pigment-table th,
.pigment-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #ddd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pigment-table th {
  text-align: center;
}

.pigment-table td.cell-center {
  text-align: center;
}

.pigment-table th:first-child,
.pigment-table td:first-child {
  width: 170px;
}

.pigment-table .col-image {
  width: 170px;
}

.pigment-table .col-code {
  width: 90px;
}

.pigment-table .col-name {
  width: 320px;
}

.pigment-table .col-model {
  width: 180px;
}

.pigment-table .col-category {
  width: 140px;
}

.pigment-table .col-status {
  width: 90px;
}

.pigment-table .col-major,
.pigment-table .col-middle {
  width: 90px;
}

.pigment-table .col-quantity {
  width: 100px;
}

.pigment-table .col-price {
  width: 100px;
}

.pigment-table .col-option {
  width: 80px;
}

.image-cell {
  text-align: center !important;
  vertical-align: middle;
}

.product-thumb {
  width: 150px;
  height: 150px;
  object-fit: cover;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  border: 1px solid #d7dde5;
  background: #f8fafc;
}

.status-dot {
  width: 12px;
  height: 12px;
  display: inline-block;
  border-radius: 999px;
}

.option-status-cell {
  text-align: center !important;
}

.status-dot.is-true {
  background: #16a34a;
}

.status-dot.is-false {
  background: #dc2626;
}

.pipeline-status-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
}

.pipeline-status-modal[hidden] {
  display: none;
}

.pipeline-status-dialog {
  width: min(760px, 100%);
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
}

.pipeline-status-header,
.pipeline-status-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pipeline-status-header h2,
.pipeline-log-section h3 {
  margin: 0;
}

.pipeline-status-meta {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 13px;
}

.pipeline-stage-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.pipeline-stage-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.pipeline-stage-item p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
}

.pipeline-status-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 999px;
}

.pipeline-status-dot.is-success {
  background: #16a34a;
}

.pipeline-status-dot.is-failed {
  background: #dc2626;
}

.pipeline-status-dot.is-running {
  background: #eab308;
}

.pipeline-log-section {
  margin-top: 18px;
}

.pipeline-error-log {
  max-height: 220px;
  overflow: auto;
  margin: 10px 0 0;
  padding: 12px;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.pipeline-status-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

.sheet-config-dialog {
  width: min(520px, 100%);
}

.sheet-config-field {
  margin-top: 18px;
}

.pigment-row {
  cursor: pointer;
}

.pigment-row:hover {
  background-color: #f8fafc;
}

.detail-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.detail-bottom-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.detail-summary {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.detail-card {
  background: #f8fafc;
  border: 1px solid #d7dde5;
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 18px;
}

.detail-card h3 {
  margin: 0 0 12px;
}

.detail-product-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-product-thumb {
  width: 100%;
  max-width: 320px;
  height: 320px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #d7dde5;
  background: #fff;
}

.detail-product-info {
  display: grid;
}

.detail-product-info p {
  margin: 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid #d7dde5;
}

.detail-product-info p:last-child {
  border-bottom: none;
}

.detail-table {
  background: #fff;
}

.detail-table th,
.detail-table td {
  text-align: center;
  font-size: 11px;
}

.detail-heading-note {
  margin-left: 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 400;
}

.price-change-cell {
  text-align: left !important;
}

.price-change-cell span {
  display: block;
}

.option-stock-row {
  cursor: pointer;
}

.option-stock-row:hover,
.option-stock-row[aria-expanded="true"] {
  background: #eef6ff;
}

.option-storage-detail-row td {
  padding: 12px;
  background: #f8fafc;
}

.option-storage-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(80px, 1fr));
  gap: 8px;
}

.option-storage-grid div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #d7dde5;
  border-radius: 6px;
  background: #fff;
}

.option-storage-grid span {
  color: #64748b;
}

.sales-chart-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
}

.sales-chart-canvas-wrap {
  position: relative;
  min-width: 0;
  padding-right: 72px;
  overflow-x: auto;
  border: 1px solid #d7dde5;
  border-radius: 8px;
  background: #fff;
}

.sales-chart-canvas {
  display: block;
  width: 100%;
  min-width: 640px;
}

.sales-chart-tooltip {
  position: absolute;
  z-index: 2;
  min-width: 220px;
  max-width: 360px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  pointer-events: none;
}

.sales-chart-legend {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: 390px;
  overflow-y: auto;
}

.sales-chart-legend-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) max-content;
  align-items: start;
  gap: 8px;
  width: 100%;
  min-height: 58px;
  padding: 10px 8px;
  border: 1px solid #d7dde5;
  border-radius: 8px;
  background: #f8fafc;
  color: #111827;
  text-align: left;
  cursor: pointer;
}

.sales-chart-legend-item:not(.is-active) {
  opacity: 0.45;
}

.sales-chart-swatch {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
}

.sales-chart-legend-text {
  min-width: 0;
}

.sales-chart-legend-text strong,
.sales-chart-legend-text small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.35;
}

.sales-chart-legend-text small {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}

.sales-chart-legend-total {
  padding-top: 2px;
  color: #166534;
  font-weight: 700;
}

@media (max-width: 768px) {
  .pigment-main {
    margin-left: 0;
    padding: 18px;
  }

  .pigment-toolbar {
    flex-direction: column;
  }

  .pigment-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .pigment-keyword {
    width: 100%;
    max-width: none;
  }

  .control-row .pigment-search-grid .pigment-keyword {
    max-width: none;
  }

  .pigment-search-grid {
    grid-template-columns: 1fr;
  }

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

  .option-storage-grid {
    grid-template-columns: repeat(2, minmax(80px, 1fr));
  }

  .sales-chart-board {
    grid-template-columns: 1fr;
  }

  .sales-chart-legend {
    max-height: none;
  }
}
