/* ── Chat: bolle messaggi ──────────────────────────────────────────────── */

.bubble-user {
  background: #0d6efd;
  color: #fff;
  padding: 0.55rem 1rem;
  border-radius: 18px 18px 4px 18px;
  max-width: 75%;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

.bubble-claude {
  background: #fff;
  border: 1px solid #dee2e6;
  padding: 0.8rem 1.1rem;
  border-radius: 4px 18px 18px 18px;
  max-width: 85%;
  word-break: break-word;
  line-height: 1.6;
}

/* Rimuove il margin inferiore dall'ultimo paragrafo dentro la bolla */
.bubble-claude p:last-child { margin-bottom: 0; }
.bubble-claude ul, .bubble-claude ol { padding-left: 1.3rem; }
.bubble-claude pre {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 0.7rem 0.9rem;
  font-size: 0.85em;
  overflow-x: auto;
}
.bubble-claude code {
  background: #f8f9fa;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.88em;
}
.bubble-claude pre code { background: none; padding: 0; }

/* ── Indicatore digitazione (puntini animati) ──────────────────────────── */

.typing-wrap { display: flex; align-items: center; gap: 5px; padding: 0.5rem 0.8rem; }

.typing-dot {
  width: 8px;
  height: 8px;
  background: #adb5bd;
  border-radius: 50%;
  animation: typing-bounce 1.3s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0);   opacity: 0.4; }
  30%            { transform: translateY(-7px); opacity: 1;   }
}

/* ── Overlay modale custom (Vue-friendly, senza dipendenza da BS Modal JS) ── */

.rag-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
  padding: 1rem;
}

.rag-modal {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
}

/* ── Admin: layout e tabelle ───────────────────────────────────────────── */

.admin-page { min-height: 100vh; background: #f8f9fa; }
.admin-content { padding: 1.5rem; max-width: 1200px; margin: 0 auto; }

/* Badge aree: colori per area */
.badge-area { font-size: 0.7rem; font-weight: 500; }

/* Tronca testi lunghi nelle celle tabella */
.td-truncate { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Riga tabella disattiva */
tr.inattivo { opacity: 0.5; }

/* ── Navbar admin ──────────────────────────────────────────────────────── */

.admin-nav .nav-link { padding: 0.4rem 0.7rem; font-size: 0.9rem; }
.admin-nav .nav-link.active { background: rgba(255,255,255,.15); border-radius: 4px; }

/* ── Checkbox grid per selezione aree ─────────────────────────────────── */

.aree-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.4rem;
}
.aree-grid .form-check { margin: 0; }
