/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

body {
  font-family: system-ui, sans-serif;
  margin: 2rem;
}

form {
  display: grid;
  gap: 0.75rem;
  max-width: 24rem;
}

label {
  font-weight: 600;
}

input[type="submit"],
button {
  width: fit-content;
}

.admin-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.admin-header h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
}

.admin-header form {
  display: block;
  max-width: none;
  margin-left: auto;
}

form.chat-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 16px;
  max-width: none;
  margin-bottom: 16px;
}

.chats-count {
  margin: 0 0 16px;
}

.chats-table {
  width: 100%;
  border-collapse: collapse;
}

.chats-table th,
.chats-table td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid #e4e4e7;
}

.chats-table tbody tr {
  cursor: pointer;
}

.chats-table tbody tr:hover,
.chats-table tbody tr:focus {
  background: #f4f4f5;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.badge-new {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-in_progress {
  background: #fef3c7;
  color: #92400e;
}

.badge-closed {
  background: #e5e7eb;
  color: #374151;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}

.empty {
  color: #3f3f46;
}

.error {
  color: #b91c1c;
}

.chat-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid #d4d4d8;
  border-radius: 8px;
  padding: 24px;
}

.chat-dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

.chat-dialog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.chat-dialog-toolbar h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
}

.chat-summary {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.chat-summary p {
  margin: 0;
}

.thread {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.message {
  padding: 8px 12px;
  border-radius: 8px;
  max-width: 36rem;
}

.message p {
  margin: 0;
}

.message-meta {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 4px;
}

.message-user {
  background: #dbeafe;
}

.message-assistant {
  background: #f4f4f5;
  margin-left: auto;
}

.message-system,
.message-unknown {
  background: #fef3c7;
}

pre.json {
  margin-top: 16px;
  padding: 16px;
  overflow: auto;
  border-radius: 8px;
  background: #f4f4f5;
  color: #18181b;
  white-space: pre-wrap;
}

.json-key {
  color: #1d4ed8;
}

.json-string {
  color: #047857;
}

.json-number {
  color: #b45309;
}

.json-literal {
  color: #7c3aed;
}
