/* AGRISUD AgroAI - Stili professionali */
.tab-btn.active {
  color: #166534;
  border-bottom-color: #166534;
}
.tab-content { animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform: translateY(0); } }

.product-card {
  transition: all 0.2s;
  border-left: 4px solid transparent;
}
.product-card:hover {
  border-left-color: #16a34a;
  transform: translateX(2px);
  box-shadow: 0 4px 12px rgba(22,163,74,0.1);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-bio { background:#dcfce7; color:#166534; }
.badge-revoked { background:#fee2e2; color:#991b1b; }
.badge-active { background:#d1fae5; color:#065f46; }
.badge-warn { background:#fef3c7; color:#92400e; }
.badge-info { background:#dbeafe; color:#1e40af; }

.risk-banner {
  padding: 16px 20px;
  border-radius: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
}
.risk-compatibile { background: linear-gradient(90deg,#dcfce7,#a7f3d0); color:#065f46; border-left: 6px solid #10b981;}
.risk-cautela { background: linear-gradient(90deg,#fef3c7,#fde68a); color:#78350f; border-left: 6px solid #f59e0b;}
.risk-sconsigliato { background: linear-gradient(90deg,#fee2e2,#fecaca); color:#7f1d1d; border-left: 6px solid #ef4444;}
.risk-incompatibile { background: linear-gradient(90deg,#7f1d1d,#b91c1c); color:#fff; border-left: 6px solid #450a0a;}

.warning-card {
  border-left: 4px solid;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 8px;
}
.warning-incompatibile { background:#fef2f2; border-color:#dc2626; }
.warning-sconsigliato { background:#fff7ed; border-color:#ea580c; }
.warning-attenzione { background:#fefce8; border-color:#ca8a04; }
.warning-info { background:#eff6ff; border-color:#2563eb; }

.score-circle {
  width: 80px; height: 80px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: bold;
  color: white;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.ai-message {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.ai-message h2 { font-size: 1.25rem; font-weight: 700; color:#166534; margin-top:1em; margin-bottom:0.5em; border-bottom:1px solid #d1fae5; padding-bottom:4px;}
.ai-message h3 { font-size: 1.05rem; font-weight: 600; color:#15803d; margin-top:0.8em; margin-bottom:0.4em;}
.ai-message ul, .ai-message ol { margin-left: 1.2em; margin-bottom: 0.6em; }
.ai-message ul li { list-style: disc; margin-bottom: 4px;}
.ai-message ol li { list-style: decimal; margin-bottom: 4px;}
.ai-message p { margin-bottom: 0.6em; line-height: 1.6;}
.ai-message strong { color:#14532d; }
.ai-message table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 0.9rem;}
.ai-message th, .ai-message td { border: 1px solid #d1d5db; padding: 6px 10px; text-align: left;}
.ai-message th { background:#f0fdf4; }
.ai-message code { background:#f3f4f6; padding:2px 5px; border-radius:4px; font-size:0.85em;}

.spinner {
  border: 3px solid #d1fae5;
  border-top: 3px solid #16a34a;
  border-radius: 50%;
  width: 32px; height: 32px;
  animation: spin 1s linear infinite;
}
@keyframes spin { 0%{ transform: rotate(0deg);} 100% { transform: rotate(360deg);} }

.autocomplete-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
}
.autocomplete-item:hover { background:#f0fdf4; }
.autocomplete-item:last-child { border-bottom: none; }

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s;
}
.modal-content {
  background: white;
  border-radius: 16px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
