/* Image picker on quotation line items. */

.img-picker { display: inline-block; vertical-align: middle; }

.img-current {
  position: relative; display: inline-block;
  border: 1px solid #E2E8F0; border-radius: 6px; overflow: hidden;
  background: white;
}
.img-current img { display: block; width: 56px; height: 56px; object-fit: cover; }
.img-remove {
  position: absolute; top: 2px; right: 2px;
  background: rgba(220,38,38,0.85); color: white; border: 0;
  width: 18px; height: 18px; border-radius: 50%; cursor: pointer;
  font-size: 12px; line-height: 1;
}

.img-pick-trigger {
  border: 1px dashed #94A3B8; background: #F8FAFC;
  padding: 8px 12px; border-radius: 6px; color: #475569;
  font-size: 12px; cursor: pointer; line-height: 1.3; text-align: center;
  min-width: 90px;
}
.img-pick-trigger small { display: block; color: #94A3B8; font-size: 10px; margin-top: 2px; }
.img-pick-trigger:hover { background: #F1F5F9; border-color: #64748B; }

/* 2026-05-15: drag-and-drop highlight — fires for any drop zone in the picker. */
.img-picker.dragover .img-pick-trigger,
.img-picker.dragover .img-current,
.img-picker.dragover .img-pick-drawer {
  background: #FFFBEB;
  border-color: #F59E0B;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}
.img-picker.dragover .img-pick-trigger small { color: #B45309; font-weight: 600; }

.img-pick-drawer {
  margin-top: 6px;
  background: #FFFBEB; border: 1px solid #FCD34D; border-radius: 8px;
  padding: 10px;
  max-width: 560px;
}
.img-pick-tabs { display: flex; gap: 6px; margin-bottom: 8px; border-bottom: 1px solid #FCD34D; }
.img-pick-tabs .tab {
  background: transparent; border: 0; padding: 6px 12px;
  font-size: 12px; cursor: pointer; color: #92400E;
  border-bottom: 2px solid transparent;
}
.img-pick-tabs .tab.active {
  font-weight: 700; border-bottom-color: #B45309;
}

.img-pick-pane { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.img-pick-pane input[type=text],
.img-pick-pane .img-q,
.img-pick-pane .img-url {
  flex: 1; min-width: 200px; padding: 6px 8px;
  border: 1px solid #E2E8F0; border-radius: 4px; font-size: 12px;
}

.img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 6px;
  width: 100%; margin-top: 8px;
}
.img-thumb {
  background: white; border: 1px solid #E2E8F0; border-radius: 4px;
  padding: 0; cursor: pointer; overflow: hidden; transition: border-color 80ms;
}
.img-thumb:hover { border-color: #B45309; }
.img-thumb img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; background: #F8FAFC; }
.img-thumb small { display: block; padding: 4px 6px; font-size: 9.5px; color: #64748B; truncate: ellipsis; white-space: nowrap; overflow: hidden; }

.btn-ghost {
  background: transparent; border: 1px solid #FCD34D; color: #92400E;
  padding: 6px 10px; border-radius: 4px; font-size: 12px; text-decoration: none;
}


.btn-ghost-orange {
  display: inline-block; background: #FB923C; color: white; border: 0;
  padding: 6px 12px; border-radius: 4px; font-size: 12px; font-weight: 600;
  text-decoration: none;
}
.btn-ghost-orange:hover { background: #EA580C; }
.img-help { font-size: 12px; color: #475569; margin: 0 0 8px; line-height: 1.6; }
.img-q-preview { font-weight: 700; color: #92400E; }

/* 2026-05-15: inline status line for the image picker (replaces alert()). */
.img-pick-status {
  margin-top: 8px; padding: 6px 10px; border-radius: 4px;
  font-size: 12px; line-height: 1.4;
}
.img-pick-status.status-info { background: #DBEAFE; color: #1E40AF; }
.img-pick-status.status-ok   { background: #DCFCE7; color: #166534; }
.img-pick-status.status-err  { background: #FEE2E2; color: #991B1B; }

/* Hint shown in place of the picker for line items that haven't been saved yet. */
.img-pick-hint {
  display: inline-block; padding: 6px 10px;
  font-size: 11px; line-height: 1.3; color: #92400E;
  background: #FFFBEB; border: 1px dashed #FCD34D; border-radius: 6px;
}
.img-pick-hint small { color: #B45309; }
