/* ============================================================
   BETA: Catalog JSON Importer — styles/catalog-importer.css
   Isolated styles. DO NOT modify styles.css.
   ============================================================ */

/* ── BETA Button in toolbar ── */
.ci-import-btn {
  display: none;
}
.ci-import-btn:hover {
  background: #2563eb;
  border-color: #2563eb;
}
.ci-beta-badge {
  display: inline-block;
  padding: 1px 5px;
  background: #f59e0b;
  color: #000;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: middle;
  line-height: 1.5;
}

/* ── Modal overlay ── */
.ci-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ci-overlay.on {
  display: flex;
}

/* ── Modal box ── */
.ci-modal {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.28);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  font-family: inherit;
}

/* ── Modal header ── */
.ci-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.ci-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ci-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #64748b;
  font-size: 20px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.12s;
}
.ci-close-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

/* ── Dropzone ── */
.ci-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  padding: 28px 20px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: #f8fafc;
  margin-bottom: 16px;
  position: relative;
}
.ci-dropzone:hover,
.ci-dropzone.drag-over {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}
.ci-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.ci-dropzone-icon {
  font-size: 28px;
  display: block;
  margin-bottom: 8px;
}
.ci-dropzone-hint {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

/* ── Status messages ── */
.ci-status {
  font-size: 12.5px;
  color: #475569;
  margin-bottom: 12px;
  min-height: 18px;
}
.ci-status.ok  { color: #16a34a; }
.ci-status.err { color: #dc2626; }
.ci-status.warn { color: #d97706; }

/* ── Summary section ── */
.ci-summary {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12.5px;
  color: #166534;
  margin-bottom: 14px;
  display: none;
}
.ci-summary.on { display: block; }
.ci-summary-headline {
  font-weight: 700;
  font-size: 13.5px;
  margin-bottom: 6px;
}
.ci-summary-meta {
  color: #15803d;
  font-size: 11.5px;
  margin-bottom: 8px;
}
.ci-summary-note {
  background: #fef9c3;
  border: 1px solid #fde047;
  border-radius: 5px;
  padding: 5px 8px;
  font-size: 11px;
  color: #854d0e;
  margin-bottom: 8px;
}

/* ── Category table ── */
.ci-cat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  color: #1e293b;
  margin-top: 4px;
}
.ci-cat-table th {
  text-align: left;
  padding: 4px 8px;
  background: #dcfce7;
  color: #166534;
  font-weight: 600;
  border-bottom: 1px solid #bbf7d0;
}
.ci-cat-table td {
  padding: 3px 8px;
  border-bottom: 1px solid #f0fdf4;
}
.ci-cat-table tr:last-child td {
  border-bottom: none;
}
.ci-cat-table .ci-ct-count {
  text-align: right;
  color: #16a34a;
  font-weight: 600;
}

/* ── GitHub upload section ── */
.ci-gh-section {
  display: none;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: #f8fafc;
}
.ci-gh-section.on { display: block; }
.ci-gh-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 10px;
}
.ci-gh-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.ci-gh-row-action {
  margin-top: 4px;
}
.ci-gh-label {
  font-size: 11.5px;
  color: #475569;
  font-weight: 600;
  min-width: 110px;
}
.ci-gh-token-wrap {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 4px;
  min-width: 0;
}
.ci-gh-input {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font-size: 12px;
  font-family: inherit;
  background: #fff;
  color: #0f172a;
}
.ci-gh-input:focus {
  outline: none;
  border-color: #2563eb;
}
.ci-gh-toggle-token {
  background: none;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  padding: 4px 7px;
  line-height: 1;
  color: #64748b;
}
.ci-gh-toggle-token:hover { background: #f1f5f9; }
.ci-gh-save-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
}
.ci-gh-status {
  font-size: 12px;
  color: #475569;
  flex: 1;
}
.ci-gh-status.ok  { color: #16a34a; }
.ci-gh-status.err { color: #dc2626; }

/* ── Upload button ── */
.ci-btn-upload {
  background: #0f172a;
  color: #fff;
  white-space: nowrap;
}
.ci-btn-upload:hover:not(:disabled) {
  background: #1e293b;
}

/* ── Action buttons ── */
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}
.ci-btn {
  padding: 8px 18px;
  border-radius: 7px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
  font-family: inherit;
}
.ci-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.ci-btn-cancel {
  background: #f1f5f9;
  color: #475569;
}
.ci-btn-cancel:hover:not(:disabled) {
  background: #e2e8f0;
}
.ci-btn-confirm {
  background: #2563eb;
  color: #fff;
}
.ci-btn-confirm:hover:not(:disabled) {
  background: #1d4ed8;
}
.ci-btn-confirm.done {
  background: #16a34a;
}

/* ── Download button ── */
.ci-btn-dl {
  background: #0369a1;
  color: #fff;
  white-space: nowrap;
}
.ci-btn-dl:hover:not(:disabled) {
  background: #075985;
}

/* ── Target selector row ── */
.ci-target-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0 4px;
  font-size: 13px;
}
.ci-target-label {
  font-weight: 600;
  color: #374151;
}
.ci-target-opt {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: #374151;
}
.ci-target-opt input[type="radio"] {
  cursor: pointer;
}
