.sales-filter-panel {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 22px 0;
}

.sales-filter-box {
  background: #fff;
  border: 1px solid #dedbd2;
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.sales-filter-box label {
  color: #667085;
  font-size: 13px;
  font-weight: 700;
}

.sales-filter-input {
  width: 100%;
  min-height: 40px;
  border: 1px solid #dedbd2;
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
}

.sales-copy-btn {
  background: #7c3aed;
  border-color: #7c3aed;
}

.sales-empty-state {
  display: none;
  max-width: 1280px;
  margin: 14px auto 0;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #7c2d12;
  padding: 12px;
}

.sales-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, .56);
  padding: 20px;
}

.sales-modal-backdrop.is-open {
  display: flex;
}

.sales-modal {
  width: min(920px, 100%);
  max-height: min(88vh, 920px);
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .24);
}

.sales-modal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #dedbd2;
  background: #fff;
  padding: 14px 16px;
}

.sales-modal-title {
  margin: 0;
  font-size: 20px;
}

.sales-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sales-modal-body {
  display: grid;
  gap: 12px;
  padding: 14px 16px 16px;
}

.sales-answer {
  border: 1px solid #dedbd2;
  border-radius: 8px;
  background: #fbfaf7;
  overflow: hidden;
}

.sales-answer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #dedbd2;
  background: #fff;
  padding: 10px 12px;
}

.sales-answer-title {
  margin: 0;
  font-size: 16px;
}

.sales-pancake-shortcut {
  margin-right: auto;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
  line-height: 1;
  padding: 6px 10px;
  white-space: nowrap;
}

.sales-pancake-shortcut:hover {
  background: #dbeafe;
}

.sales-pancake-shortcut-input {
  margin-right: auto;
  width: 86px;
  min-height: 30px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 10px;
}

.sales-pancake-shortcut-input:focus {
  outline: 2px solid #93c5fd;
  outline-offset: 1px;
  background: #fff;
}

.sales-answer-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.sales-answer-text {
  white-space: pre-wrap;
  margin: 0;
  padding: 12px;
  color: #1f2933;
  font-family: Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

.sales-answer-editor {
  display: block;
  width: 100%;
  min-height: 96px;
  border: 0;
  border-radius: 0;
  background: #fbfaf7;
  resize: vertical;
}

.sales-answer-editor.is-compact {
  min-height: 52px;
}

.sales-answer-editor:focus {
  outline: 2px solid rgba(124, 58, 237, .18);
  outline-offset: -2px;
}

.sales-file-input {
  display: none;
}

.sales-image-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  padding: 0 12px 12px;
  user-select: none;
}

.sales-image-list.is-dragging-images {
  outline: 2px dashed rgba(37, 99, 235, .28);
  outline-offset: 4px;
}

.sales-image-card {
  position: relative;
  overflow: hidden;
  border: 1px solid #dedbd2;
  border-radius: 8px;
  background: #fff;
  cursor: grab;
  user-select: none;
  transition: opacity .14s ease, outline-color .14s ease, transform .14s ease, border-color .14s ease;
}

.sales-image-card:active {
  cursor: grabbing;
}

.sales-image-card.is-dragging {
  opacity: .48;
  transform: scale(.98);
}

.sales-native-sortable-grid .sales-image-card.is-dragging {
  opacity: .54;
  outline: 2px dashed #facc15;
  outline-offset: -4px;
  transform: none;
}

.sales-image-card.is-drop-target {
  outline: 3px solid rgba(37, 99, 235, .45);
  outline-offset: 2px;
}

.sales-image-card img,
.sales-image-card video {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.sales-image-card video {
  background: #111827;
}

.sales-native-sortable-grid .sales-image-card img,
.sales-native-sortable-grid .sales-image-card video {
  cursor: grab;
  -webkit-user-drag: auto;
}

.sales-native-sortable-grid .sales-image-card:active img,
.sales-native-sortable-grid .sales-image-card:active video {
  cursor: grabbing;
}

.sales-image-card:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .32);
  outline-offset: 2px;
}

.sales-image-card:hover::after,
.sales-image-card:focus-visible::after {
  content: "Keo anh";
  position: absolute;
  left: 8px;
  bottom: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .78);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 8px;
  pointer-events: none;
}

.sales-image-card.is-dragging::after {
  content: none;
}

.sales-image-list.is-dragging-images .sales-image-card.is-drop-target::after {
  content: "Tha vao day";
}

.sales-image-drag-handle {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(15, 23, 42, .22);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  color: #111827;
  font: inherit;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .14);
}

.sales-image-drag-handle:hover,
.sales-image-drag-handle:focus-visible {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  outline: 0;
}

.sales-image-drag-handle:active,
.sales-image-card.is-dragging .sales-image-drag-handle {
  cursor: grabbing;
}

.sales-image-placeholder {
  min-height: 96px;
  aspect-ratio: 1 / 1;
  border: 3px dashed #2563eb;
  border-radius: 8px;
  background: rgba(37, 99, 235, .08);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .72);
}

.sales-image-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  border: 1px solid #991b1b;
  border-radius: 999px;
  background: #fff;
  color: #991b1b;
  padding: 4px 7px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.sales-image-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, .78);
  padding: 24px;
}

.sales-image-preview-backdrop.is-open {
  display: flex;
}

.sales-image-preview {
  position: relative;
  display: grid;
  gap: 10px;
  width: min(92vw, 1040px);
  max-height: 92vh;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .35);
}

.sales-image-preview-media {
  display: grid;
  place-items: center;
  min-height: 0;
}

.sales-image-preview-media img,
.sales-image-preview-media video {
  display: block;
  max-width: 100%;
  max-height: min(78vh, 860px);
  border-radius: 6px;
  background: #f2f2ef;
  object-fit: contain;
}

.sales-image-preview-caption {
  min-height: 18px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-image-preview-close {
  position: absolute;
  top: 10px;
  right: 10px;
  min-height: 34px;
  border: 1px solid rgba(15, 23, 42, .22);
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: #111827;
  padding: 5px 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.sales-mini-btn {
  appearance: none;
  min-height: 34px;
  border: 1px solid #7c3aed;
  border-radius: 8px;
  background: #7c3aed;
  color: #fff;
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.sales-close-btn {
  border-color: #475569;
  background: #475569;
}

.sales-save-btn {
  border-color: #047857;
  background: #047857;
}

.sales-save-indicator {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 6px;
  padding: 5px 10px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.sales-save-indicator.is-reading {
  background: #fef3c7;
  color: #92400e;
}

.sales-save-indicator.is-saving {
  background: #dbeafe;
  color: #1e40af;
}

.sales-save-indicator.is-success {
  background: #d1fae5;
  color: #065f46;
}

.sales-save-indicator.is-error {
  background: #fee2e2;
  color: #991b1b;
}

.sales-pancake-btn {
  border-color: #2563eb;
  background: #2563eb;
}

.sales-mini-btn:disabled {
  cursor: wait;
  opacity: .62;
}

.sales-copy-status {
  min-height: 18px;
  color: #0f766e;
  font-size: 13px;
  padding: 0 16px 12px;
}

.sales-copy-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147483647;
  max-width: min(360px, calc(100vw - 32px));
  border: 1px solid #047857;
  border-radius: 8px;
  background: #ecfdf5;
  color: #064e3b;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 14px 36px rgba(15, 23, 42, .18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .16s ease, transform .16s ease;
}

.sales-copy-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.sales-copy-toast.is-save-error {
  border-color: #dc2626;
  background: #fef2f2;
  color: #991b1b;
}

.sales-modal.is-saving {
  opacity: 0.92;
}


@media (max-width: 640px) {
  .sales-filter-panel {
    padding: 12px 16px 0;
  }

  .sales-modal-backdrop {
    padding: 10px;
  }

  .sales-modal-header,
  .sales-answer-head {
    align-items: stretch;
    flex-direction: column;
  }

  .sales-answer-controls {
    justify-content: stretch;
  }

  .sales-modal-actions,
  .sales-mini-btn {
    width: 100%;
  }

  .sales-copy-toast {
    right: 12px;
    bottom: 12px;
  }
}
