body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #f4f7f9;
  color: #333;
  margin: 0;
  padding: 20px;
}
.container {
  max-width: 900px;
  margin: auto;
  background: #fff;
  padding: 20px 30px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
h1, h2 {
  color: #1a253c;
  border-bottom: 2px solid #eef2f5;
  padding-bottom: 10px;
}
.search-form {
  background: #f9fafb;
  padding: 20px;
  border-radius: 6px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  align-items: end;
}
.form-group {
  display: flex;
  flex-direction: column;
}
.form-group label {
  font-weight: 600;
  margin-bottom: 5px;
  font-size: 0.9em;
}
.form-group input, .form-group select {
  padding: 10px;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 1em;
}
.form-group select[multiple] {
  display: none;
}
.tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  padding: 5px;
  border: 1px solid #ddd;
  border-radius: 4px;
  min-height: 34px;
  background-color: #fff;
  cursor: pointer;
}
.tag {
  display: flex;
  align-items: center;
  background-color: #e0e0e0;
  color: #333;
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 0.9em;
}
.tag-remove {
  margin-left: 8px;
  cursor: pointer;
  font-weight: bold;
}
.tag-remove:hover {
  color: #d9534f;
}
.custom-select-panel {
  display: none;
  position: absolute;
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  width: 250px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.custom-select-option { padding: 8px 12px; cursor: pointer; }
.custom-select-option:hover { background-color: #f0f0f0; }
.custom-select-option.selected { background-color: #007bff; color: white; }

#search-button {
  padding: 10px 20px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1em;
  cursor: pointer;
  transition: background-color 0.2s;
}
#search-button:hover { background-color: #0056b3; }
#search-button:disabled { background-color: #aaa; cursor: not-allowed; }

.spinner-container { display: flex; justify-content: center; align-items: center; padding: 40px 0; }
.spinner { display: flex; gap: 10px; }
.spinner div { width: 15px; height: 15px; background-color: #007bff; border-radius: 50%; animation: bounce 1.4s infinite ease-in-out both; }
.spinner .bounce1 { animation-delay: -0.32s; }
.spinner .bounce2 { animation-delay: -0.16s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1.0); } }

.loader { text-align: center; padding: 20px; font-weight: bold; }
.conversation { border: 1px solid #eef2f5; border-radius: 6px; margin-bottom: 20px; overflow: hidden; }
.conversation-header { background-color: #f9fafb; padding: 10px 15px; font-weight: 600; border-bottom: 1px solid #eef2f5; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.header-meta { font-size: 0.85em; font-weight: normal; color: #555; display: flex; gap: 15px; }
.messages-container { padding: 15px; max-height: 400px; overflow-y: auto; }
.message { margin-bottom: 15px; display: flex; flex-direction: column; }
.message.user { align-items: flex-end; }
.message.assistant { align-items: flex-start; }
.message-bubble { max-width: 70%; padding: 10px 15px; border-radius: 18px; line-height: 1.5; }
.message.user .message-bubble { background-color: #007bff; color: white; border-bottom-right-radius: 4px; }
.message.assistant .message-bubble { background-color: #eef2f5; color: #333; border-bottom-left-radius: 4px; }
.message-meta { font-size: 0.8em; color: #777; margin-top: 5px; padding: 0 5px; }
.json-container { position: relative; margin-top: 10px; }
#json-output-area { width: 100%; height: 300px; padding: 10px; border: 1px solid #ccc; border-radius: 4px; font-family: monospace; font-size: 0.9em; white-space: pre; overflow-wrap: normal; overflow-x: scroll; background-color: #f9fafb; box-sizing: border-box; color: #333; }
#copy-json-button { position: absolute; top: 10px; right: 10px; padding: 5px 10px; background-color: #6c757d; color: white; border: none; border-radius: 4px; cursor: pointer; transition: background-color 0.2s; }
#copy-json-button:hover { background-color: #5a6268; }
.form-group.hidden { display: none; }


/* Cards resumen exportación */
.job-summary { margin: 10px 0 16px; color: #4b5563; font-size: 0.95em; }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.card {
  background: #fff;
  border: 1px solid #eef2f5;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(0,0,0,0.08); }
.card .title { font-weight: 700; color: #111827; margin-bottom: 6px; }
.card .meta { color: #6b7280; font-size: 0.9em; }
.card .badge { display: inline-block; background: #e5f2ff; color: #0b74da; padding: 2px 8px; border-radius: 999px; font-size: 0.8em; margin-right: 6px; }
.actions { margin-top: 16px; text-align: right; }
.actions button { padding: 12px 20px; background: #007bff; color: #fff; border: none; border-radius: 6px; cursor: pointer; font-weight: 600; box-shadow: 0 2px 6px rgba(0,123,255,0.3); transition: background 0.2s, transform 0.05s; }
.actions button:hover { background: #0056b3; }
.actions button:active { transform: translateY(1px); }
.actions button:disabled { background: #9ca3af; cursor: not-allowed; }


