/* =====================================================
   Diário de Bordo Inteligente — prefixo .dj-
   ===================================================== */

/* --- Header --- */
.dj-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dj-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text, #0f172a);
  margin: 0 0 .25rem;
}

.dj-project-name {
  font-size: 1rem;
  color: var(--text-muted, #64748b);
  margin: 0;
}

/* --- Tabs --- */
.dj-tabs {
  display: flex;
  gap: .25rem;
  border-bottom: 2px solid var(--line, #e2e8f0);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.dj-tabs::-webkit-scrollbar {
  display: none;
}

.dj-tab {
  padding: .625rem 1.25rem;
  font-size: .9375rem;
  font-weight: 500;
  color: var(--text-muted, #64748b);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--t, .15s ease), border-color var(--t, .15s ease);
}

.dj-tab:hover {
  color: var(--text, #0f172a);
}

.dj-tab.active {
  color: var(--brand, #2563eb);
  border-bottom-color: var(--brand, #2563eb);
}

/* --- Tab Content --- */
.dj-tab-content {
  animation: dj-fadeIn .18s ease;
}

@keyframes dj-fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Placeholder --- */
.dj-placeholder {
  color: var(--text-muted, #64748b);
  font-size: 1rem;
  text-align: center;
  padding: 3rem 1rem;
  background: var(--bg, #f8fafc);
  border-radius: var(--radius, 8px);
}

/* --- Error --- */
.dj-error {
  background: var(--danger-soft, #fef2f2);
  color: var(--danger, #dc2626);
  border: 1px solid var(--danger-border, #fca5a5);
  border-radius: var(--radius, 8px);
  padding: 1rem;
  margin-top: 1.5rem;
  font-size: .9375rem;
}

/* --- Badges de tipo --- */
.dj-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.5;
  white-space: nowrap;
}

.dj-badge--decisao         { background: #2563eb; }
.dj-badge--premissa        { background: #f59e0b; }
.dj-badge--risco           { background: #dc2626; }
.dj-badge--pergunta_aberta { background: #6b7280; }
.dj-badge--mudanca_rumo    { background: #7c3aed; }
.dj-badge--insight_usuario { background: #10b981; }
.dj-badge--oportunidade    { background: #f97316; }
.dj-badge--proximo_passo   { background: #0ea5e9; }

/* --- Seção --- */
.dj-section-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 .75rem;
  color: var(--text, #0f172a);
}

/* --- Nova Fonte (textarea + botão) --- */
.dj-source {
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.dj-source-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: .75rem;
}

.dj-textarea {
  width: 100%;
  padding: .75rem;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: var(--radius, 8px);
  font-size: .9375rem;
  font-family: inherit;
  resize: vertical;
  background: var(--surface, #fff);
  color: var(--text, #0f172a);
  box-sizing: border-box;
  transition: border-color .15s ease;
}

.dj-textarea:focus {
  outline: none;
  border-color: var(--brand, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

/* --- Botão --- */
.dj-btn {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .5rem 1.25rem;
  font-size: .875rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius, 8px);
  cursor: pointer;
  transition: background .15s ease, opacity .15s ease;
}

.dj-btn--primary {
  background: var(--brand, #2563eb);
  color: #fff;
}

.dj-btn--primary:hover    { background: var(--brand-dark, #1d4ed8); }
.dj-btn--primary:disabled { opacity: .6; cursor: not-allowed; }

/* --- Status de loading --- */
.dj-status {
  font-size: .875rem;
  color: var(--text-muted, #64748b);
}

/* --- Preview de itens extraídos --- */
.dj-preview {
  margin-top: 2rem;
}

.dj-card-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dj-card {
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: var(--radius, 8px);
  padding: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: .5rem;
}

.dj-card__checkbox {
  margin-top: .375rem;
  accent-color: var(--brand, #2563eb);
}

.dj-card__content {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: .375rem;
}

.dj-card__title {
  width: 100%;
  font-size: .9375rem;
  font-weight: 600;
  padding: .25rem .5rem;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--text, #0f172a);
  font-family: inherit;
  transition: border-color .15s;
}

.dj-card__title:focus {
  outline: none;
  border-color: var(--brand, #2563eb);
  background: var(--bg, #f8fafc);
}

.dj-card__type {
  font-size: .8125rem;
  padding: .25rem .5rem;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 4px;
  background: var(--bg, #f8fafc);
  color: var(--text, #0f172a);
  font-family: inherit;
  cursor: pointer;
}

.dj-card__text {
  width: 100%;
  font-size: .875rem;
  color: var(--text-muted, #64748b);
  padding: .25rem .5rem;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  resize: vertical;
  font-family: inherit;
  transition: border-color .15s;
}

.dj-card__text:focus {
  outline: none;
  border-color: var(--brand, #2563eb);
  background: var(--bg, #f8fafc);
}

.dj-card__actions {
  display: flex;
  align-items: flex-start;
}

.dj-card__remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: .25rem .375rem;
  border-radius: 4px;
  font-size: .9375rem;
  color: var(--text-muted, #64748b);
  line-height: 1;
  transition: color .15s, background .15s;
}

.dj-card__remove-btn:hover {
  color: var(--danger, #dc2626);
  background: var(--danger-soft, #fef2f2);
}

/* --- Card similar (duplicata potencial) --- */
.dj-card--similar {
  border-color: var(--warning, #f59e0b);
  background: #fffbeb;
}

.dj-card--similar::before {
  content: "⚠️ Similar a um item existente";
  display: block;
  font-size: .75rem;
  font-weight: 600;
  color: #92400e;
  margin-bottom: .25rem;
  width: 100%;
}

/* --- Input de texto simples --- */
.dj-input {
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: var(--radius, 8px);
  font-size: .875rem;
  font-family: inherit;
  background: var(--surface, #fff);
  color: var(--text, #0f172a);
  box-sizing: border-box;
  transition: border-color .15s;
}

.dj-input:focus {
  outline: none;
  border-color: var(--brand, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

/* --- Fontes processadas --- */
.dj-sources {
  margin-top: 2rem;
}

.dj-sources-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.dj-sources-item {
  /* wrapper de cada fonte */
}

.dj-sources-entry {
  border: 1px solid var(--line, #e2e8f0);
  border-radius: var(--radius, 8px);
  background: var(--surface, #fff);
  overflow: hidden;
}

.dj-sources-entry__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1rem;
  cursor: pointer;
  list-style: none;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text, #0f172a);
  user-select: none;
}

.dj-sources-entry__header::-webkit-details-marker { display: none; }
.dj-sources-entry__header::marker { display: none; }

.dj-sources-entry[open] > .dj-sources-entry__header {
  border-bottom: 1px solid var(--line, #e2e8f0);
}

.dj-sources-entry__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dj-sources-entry__meta {
  display: flex;
  align-items: center;
  gap: .625rem;
  flex-shrink: 0;
  font-weight: 400;
  color: var(--text-muted, #64748b);
}

.dj-sources-entry__date {
  font-size: .8rem;
}

.dj-sources-entry__count {
  font-size: .75rem;
  background: var(--bg, #f8fafc);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 99px;
  padding: .15rem .625rem;
}

.dj-sources-entry__actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 1rem;
  background: var(--bg, #f8fafc);
  border-bottom: 1px solid var(--line, #e2e8f0);
}

/* Variantes de botão pequeno */
.dj-btn--sm {
  font-size: .8rem;
  padding: .25rem .625rem;
}

.dj-btn--ghost {
  background: transparent;
  color: var(--text-muted, #64748b);
  border: 1px solid var(--line, #e2e8f0);
}

.dj-btn--ghost:hover {
  background: var(--line, #e2e8f0);
  color: var(--text, #0f172a);
}

.dj-btn--danger {
  background: var(--danger, #dc2626);
  color: #fff;
  border: 1px solid transparent;
}

.dj-btn--danger:hover {
  background: #b91c1c;
}

.dj-btn--secondary {
  background: var(--bg, #f8fafc);
  color: var(--text, #0f172a);
  border: 1px solid var(--line, #e2e8f0);
}

.dj-btn--secondary:hover { background: var(--line, #e2e8f0); }

/* =====================================================
   Dia 4 — Toolbar, Busca, Exportar, Playbook
   ===================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dj-toolbar {
  display: flex;
  gap: .75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.dj-search-wrapper {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 200px;
  position: relative;
}

.dj-search-wrapper .dj-input {
  flex: 1;
  padding-right: 2.25rem;
}

.dj-search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text-muted, #64748b);
  line-height: 1;
  padding: 0;
}

.dj-search-clear:hover { color: var(--danger, #dc2626); }

/* Playbook */
.dj-playbook {
  margin-top: 2rem;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--radius, 8px);
  padding: .875rem 1rem;
  color: var(--text, #0f172a);
}

.dj-playbook summary {
  font-size: 1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.dj-playbook summary::-webkit-details-marker { display: none; }
.dj-playbook summary::marker { display: none; }

.dj-playbook-hint {
  font-size: .8125rem;
  color: var(--text-muted, #64748b);
  margin-left: auto;
}

.dj-playbook-steps {
  margin: .75rem 0 0;
  padding-left: 1.25rem;
  font-size: .9375rem;
  line-height: 1.6;
}

.dj-playbook-steps li { margin-bottom: .25rem; }

/* =====================================================
   Timeline — prefixo .dj-
   ===================================================== */

.dj-timeline-section {
  margin-top: 2.5rem;
}

.dj-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .375rem;
  margin-bottom: 1.25rem;
}

.dj-filter {
  padding: .3rem .75rem;
  font-size: .8125rem;
  font-weight: 500;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 999px;
  background: var(--surface, #fff);
  color: var(--text-muted, #64748b);
  cursor: pointer;
  transition: all .15s ease;
  line-height: 1.4;
}

.dj-filter:hover {
  border-color: var(--brand, #2563eb);
  color: var(--brand, #2563eb);
}

.dj-filter.active {
  background: var(--brand, #2563eb);
  color: #fff;
  border-color: var(--brand, #2563eb);
}

.dj-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}

.dj-timeline::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--line, #e2e8f0);
}

.dj-timeline-item {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 1rem;
}

.dj-timeline-item::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 18px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--brand, #2563eb);
  border: 3px solid var(--surface, #fff);
  box-shadow: 0 0 0 2px var(--line, #e2e8f0);
  z-index: 1;
}

.dj-timeline-item[data-type="risco"]::before          { background: #dc2626; }
.dj-timeline-item[data-type="pergunta_aberta"]::before { background: #6b7280; }
.dj-timeline-item[data-type="decisao"]::before        { background: #2563eb; }
.dj-timeline-item[data-type="premissa"]::before       { background: #f59e0b; }
.dj-timeline-item[data-type="mudanca_rumo"]::before   { background: #7c3aed; }
.dj-timeline-item[data-type="insight_usuario"]::before{ background: #10b981; }
.dj-timeline-item[data-type="oportunidade"]::before   { background: #f97316; }
.dj-timeline-item[data-type="proximo_passo"]::before  { background: #0ea5e9; }

.dj-timeline-item.reviewed { opacity: .72; }
.dj-timeline-item.resolved { opacity: .55; }
.dj-timeline-item.resolved::before { background: #9ca3af; }

.dj-card-memory {
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: var(--radius, 8px);
  padding: .875rem 1rem;
  box-shadow: var(--shadow-sm, 0 1px 4px rgba(0,0,0,.06));
  transition: box-shadow .15s ease;
}

.dj-card-memory:hover {
  box-shadow: var(--shadow, 0 4px 16px rgba(0,0,0,.08));
}

.dj-card-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .5rem;
}

.dj-card-title {
  font-size: .9375rem;
  font-weight: 600;
  margin: 0;
  color: var(--text, #0f172a);
  flex: 1;
}

.dj-card-excerpt {
  font-size: .875rem;
  color: var(--text-muted, #64748b);
  margin: 0 0 .625rem;
  line-height: 1.45;
}

.dj-expand-btn {
  font-size: .8125rem;
  color: var(--brand, #2563eb);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-weight: 500;
}

.dj-expand-btn:hover { text-decoration: underline; }

.dj-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
}

.dj-card-date {
  font-size: .75rem;
  color: var(--text-muted, #64748b);
}

.dj-card-actions {
  display: flex;
  gap: .25rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.dj-action-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm, 4px);
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-muted, #64748b);
  transition: all .15s ease;
}

.dj-action-btn:hover {
  background: var(--bg, #f8fafc);
  border-color: var(--line, #e2e8f0);
  color: var(--text, #0f172a);
}

.dj-action-btn--danger:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

.dj-action-btn--reviewed {
  color: #10b981;
  cursor: default;
}

.dj-action-btn--reviewed:hover {
  background: transparent;
  border-color: transparent;
  color: #10b981;
}

/* Diálogos */
dialog {
  border: none;
  border-radius: var(--radius, 8px);
  padding: 1.25rem;
  max-width: 480px;
  width: 90%;
  box-shadow: var(--shadow-lg, 0 8px 32px rgba(0,0,0,.12));
  background: var(--surface, #fff);
}

dialog::backdrop {
  background: rgba(0, 0, 0, .4);
}

dialog h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--text, #0f172a);
}

dialog label {
  display: block;
  font-size: .8125rem;
  font-weight: 500;
  margin-bottom: .25rem;
  color: var(--text-muted, #64748b);
}

dialog .dj-input,
dialog .dj-textarea {
  width: 100%;
  margin-bottom: .75rem;
}

.dj-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  margin-top: .5rem;
}

.dj-sources-entry__items {
  list-style: none;
  padding: .375rem 1rem .625rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.dj-sources-entry__item {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  font-size: .875rem;
  color: var(--text, #0f172a);
  padding: .25rem 0;
  border-bottom: 1px solid var(--line, #e2e8f0);
}

.dj-sources-entry__item:last-child {
  border-bottom: none;
}

/* =====================================================
   Dia 6 — Chat "Pergunte ao Produto"
   ===================================================== */

.dj-chat-header {
  margin-bottom: 1rem;
}

.dj-chat-subtitle {
  color: var(--text-muted, #64748b);
  font-size: .875rem;
  margin: .25rem 0 0;
}

.dj-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 400px;
  overflow-y: auto;
  padding: 1rem;
  background: var(--bg, #f8fafc);
  border-radius: var(--radius, 8px);
  margin-bottom: 1rem;
}

.dj-chat-message {
  max-width: 85%;
  padding: .75rem 1rem;
  border-radius: var(--radius, 8px);
  font-size: .9375rem;
  line-height: 1.45;
  animation: dj-fadeIn .2s ease;
}

.dj-chat-message p { margin: 0; }

.dj-chat-message--user {
  align-self: flex-end;
  background: var(--brand, #2563eb);
  color: #fff;
}

.dj-chat-message--assistant {
  align-self: flex-start;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e2e8f0);
  color: var(--text, #0f172a);
}

.dj-chat-message-sources {
  margin-top: .5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.dj-chat-source-card {
  display: inline-block;
  background: var(--bg, #f8fafc);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: var(--radius-sm, 4px);
  padding: .3rem .6rem;
  font-size: .75rem;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  transition: all .15s ease;
}

.dj-chat-source-card:hover {
  border-color: var(--brand, #2563eb);
  color: var(--brand, #2563eb);
}

.dj-chat-form {
  display: flex;
  gap: .5rem;
}

.dj-chat-form .dj-input {
  flex: 1;
}

/* Sugestões */
.dj-suggestions {
  margin-top: 1rem;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--radius, 8px);
  padding: .75rem 1rem;
}

.dj-suggestions > summary {
  cursor: pointer;
  font-size: .875rem;
  font-weight: 600;
  color: var(--brand, #2563eb);
  list-style: none;
}

.dj-suggestions > summary::-webkit-details-marker { display: none; }
.dj-suggestions > summary::marker { display: none; }

.dj-suggestions-list {
  margin: .5rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .375rem;
}

.dj-suggestion-btn {
  padding: .25rem .75rem;
  font-size: .8125rem;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 999px;
  background: var(--surface, #fff);
  color: var(--text, #0f172a);
  cursor: pointer;
  transition: all .15s ease;
}

.dj-suggestion-btn:hover {
  background: var(--brand, #2563eb);
  color: #fff;
  border-color: var(--brand, #2563eb);
}

.dj-suggestion-btn--key {
  border-color: var(--brand, #2563eb);
  color: var(--brand, #2563eb);
  font-weight: 600;
}

.dj-chat-loading {
  align-self: flex-start;
  color: var(--text-muted, #64748b);
  font-size: .875rem;
  padding: .5rem 1rem;
}

/* --- Saúde --- */
.dj-saude-header {
  margin-bottom: 1.5rem;
}

.dj-saude-sintese {
  font-size: .9375rem;
  color: var(--text, #0f172a);
  background: #f0f9ff;
  border-left: 3px solid var(--brand, #2563eb);
  padding: .75rem 1rem;
  border-radius: 0 var(--radius-sm, 4px) var(--radius-sm, 4px) 0;
  margin: .5rem 0 0;
  line-height: 1.5;
}

.dj-saude-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .75rem;
  margin-bottom: 2rem;
}

.dj-saude-card {
  background: var(--bg, #f8fafc);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: var(--radius, 8px);
  padding: .875rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.dj-saude-card:hover,
.dj-saude-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow, 0 4px 12px rgba(15,23,42,.1));
  outline: none;
}

.dj-saude-card dt {
  font-size: .8125rem;
  color: var(--text-muted, #64748b);
  margin-bottom: .25rem;
}

.dj-saude-card dd {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text, #0f172a);
  margin: 0;
}

.dj-saude-card--warning {
  background: #fef3c7;
  border-color: #fcd34d;
}

.dj-saude-card--warning dd {
  color: #92400e;
}

.dj-saude-alertas {
  margin-bottom: 1.5rem;
}

.dj-saude-alertas h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--danger, #dc2626);
  margin: 0 0 .5rem;
}

.dj-saude-alertas-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.dj-saude-alerta-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .625rem .875rem;
  background: var(--danger-soft, #fef2f2);
  border: 1px solid var(--danger-border, #fca5a5);
  border-radius: var(--radius, 8px);
  cursor: pointer;
  transition: box-shadow .15s ease;
  font-size: .875rem;
  color: var(--text, #0f172a);
}

.dj-saude-alerta-item:hover {
  box-shadow: var(--shadow-sm, 0 1px 4px rgba(0,0,0,.06));
}

.dj-saude-alerta-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.dj-saude-revisados {
  color: var(--text-muted, #64748b);
  font-size: .875rem;
}

/* --- Loading state --- */
.dj-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
}

/* --- Toast --- */
.dj-toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  padding: .625rem 1rem;
  border-radius: var(--radius, 8px);
  color: #fff;
  font-size: .875rem;
  z-index: 1000;
  animation: dj-fadeIn .2s ease;
  box-shadow: var(--shadow, 0 4px 16px rgba(0,0,0,.08));
  max-width: 320px;
  line-height: 1.4;
}
.dj-toast--info    { background: var(--brand, #2563eb); }
.dj-toast--success { background: #16a34a; }
.dj-toast--error   { background: var(--danger, #dc2626); }

/* ============================================================
   SÍNTESE ACIONÁVEL
   ============================================================ */
.dj-saude-sintese {
  font-size: .9rem;
  color: var(--text-muted, #64748b);
  margin: 0 0 1rem;
  line-height: 1.8;
}

.dj-sintese-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .875rem;
  color: var(--brand, #2563eb);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.dj-sintese-link:hover { color: var(--brand-dark, #1d4ed8); }
.dj-sintese-link--revisar { font-weight: 500; }
.dj-sintese-detail {
  font-size: .78rem;
  color: var(--text-muted, #64748b);
  font-weight: 400;
  text-decoration: none;
}

/* ============================================================
   COERÊNCIA ESTRATÉGICA
   ============================================================ */
.dj-saude-coerencia {
  margin-top: 2rem;
}
.dj-saude-coerencia h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text, #0f172a);
  margin: 0 0 .75rem;
}

.dj-coerencia-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: .75rem;
  margin: 0;
}

.dj-coerencia-card {
  background: var(--bg, #f8fafc);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: var(--radius, 8px);
  padding: .875rem 1rem;
  transition: transform .15s ease, box-shadow .15s ease;
}
.dj-coerencia-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow, 0 4px 12px rgba(15,23,42,.1));
}
.dj-coerencia-card dt {
  font-size: .8125rem;
  color: var(--text-muted, #64748b);
  margin-bottom: .25rem;
}
.dj-coerencia-card dd {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text, #0f172a);
  margin: 0;
}
.dj-coerencia-card--warning {
  background: #fef3c7;
  border-color: #fcd34d;
}
.dj-coerencia-card--warning dd {
  color: #92400e;
}

/* ============================================================
   FONTE DE ARTEFATO NO CHAT
   ============================================================ */
.dj-chat-source-card--artifact {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #0369a1;
}
.dj-chat-source-card--artifact:hover {
  background: #e0f2fe;
}

/* --- Responsivo --- */
@media (max-width: 600px) {
  .dj-tab                { padding: .5rem .875rem; font-size: .8125rem; }
  .dj-source-actions     { flex-direction: column; align-items: flex-start; }
  .dj-timeline-item      { padding-left: 1.5rem; }
  .dj-card-memory        { padding: .625rem .75rem; }
  .dj-card-title         { font-size: .875rem; }
  .dj-card-excerpt       { font-size: .8125rem; }
  .dj-filters            { gap: .25rem; }
  .dj-filter             { padding: .2rem .5rem; font-size: .7rem; }
  .dj-saude-grid         { grid-template-columns: 1fr; }
  .dj-chat-messages      { max-height: 300px; }
  .dj-card-actions       { gap: .125rem; }
  .dj-action-btn         { width: 28px; height: 28px; }
}
