/* ============================================================
   AI Assist Popup — Release 2
   Sprint 2.1 — Estilos do popup de AI Assist para cadastros
   ============================================================ */

/* ── Overlay backdrop ─────────────────────────────────────── */
#ai-assist-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* ── Popup container ──────────────────────────────────────── */
#ai-assist-popup {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 920px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: ai-popup-in 0.22s cubic-bezier(.4,0,.2,1);
}

@keyframes ai-popup-in {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Header ───────────────────────────────────────────────── */
.ai-popup-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid #E2E8F0;
  background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
  color: #fff;
  flex-shrink: 0;
}

.ai-popup-logo {
  font-size: 20px;
  line-height: 1;
}

.ai-popup-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  flex: 1;
}

.ai-popup-subtitle {
  font-size: 12px;
  opacity: 0.75;
}

.ai-popup-close {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.ai-popup-close:hover { background: rgba(255,255,255,0.3); }

/* ── Steps ────────────────────────────────────────────────── */
.ai-popup-step {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.ai-popup-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ── Intent section ───────────────────────────────────────── */
.ai-section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #6366F1;
  margin-bottom: 8px;
}

.ai-intent-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.ai-intent-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1.5px solid #E2E8F0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #374151;
  transition: all 0.15s;
  background: #F8FAFC;
}
.ai-intent-option:hover { border-color: #A5B4FC; background: #EEF2FF; }
.ai-intent-option.selected {
  border-color: #6366F1;
  background: #EEF2FF;
  color: #3730A3;
  font-weight: 500;
}
.ai-intent-option input[type="radio"] { display: none; }
.ai-intent-icon { font-size: 16px; }

/* ── Prompt textarea ──────────────────────────────────────── */
.ai-prompt-area {
  width: 100%;
  min-height: 90px;
  max-height: 160px;
  padding: 10px 12px;
  border: 1.5px solid #CBD5E1;
  border-radius: 8px;
  font-size: 13px;
  color: #1E293B;
  line-height: 1.5;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.ai-prompt-area:focus {
  outline: none;
  border-color: #6366F1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.ai-prompt-area::placeholder { color: #94A3B8; }

/* ── Block grid ───────────────────────────────────────────── */
.ai-blocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}

.ai-block-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid #E2E8F0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  background: #FAFAFA;
  user-select: none;
}
.ai-block-item:hover { border-color: #A5B4FC; background: #F0F0FF; }
.ai-block-item.selected {
  border-color: #6366F1;
  background: #EEF2FF;
}
.ai-block-item.blocked {
  border-color: #FCA5A5;
  background: #FFF5F5;
  opacity: 0.7;
  cursor: not-allowed;
}

.ai-block-checkbox {
  width: 16px;
  height: 16px;
  border: 2px solid #CBD5E1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all 0.15s;
  background: #fff;
}
.ai-block-item.selected .ai-block-checkbox {
  background: #6366F1;
  border-color: #6366F1;
  color: #fff;
}
.ai-block-checkbox::after {
  content: '';
  display: none;
  width: 4px;
  height: 7px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
  margin-top: -1px;
}
.ai-block-item.selected .ai-block-checkbox::after { display: block; }

.ai-block-info { flex: 1; min-width: 0; }
.ai-block-name {
  font-size: 13px;
  font-weight: 600;
  color: #1E293B;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 2px;
}
.ai-block-icon { font-size: 14px; }
.ai-block-desc {
  font-size: 11px;
  color: #64748B;
  line-height: 1.4;
}

/* ── Dependency alert ─────────────────────────────────────── */
.ai-dep-alert {
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
}
.ai-dep-alert.error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #DC2626;
}
.ai-dep-alert.warning {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
}
.ai-dep-alert.success {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  color: #166534;
}
.ai-dep-alert ul { margin: 6px 0 0 0; padding-left: 18px; }
.ai-dep-alert li { margin-bottom: 3px; }

/* ── Loading step ─────────────────────────────────────────── */
.ai-loading-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 40px 20px;
  color: #64748B;
}

.ai-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid #E2E8F0;
  border-top-color: #6366F1;
  border-radius: 50%;
  animation: ai-spin 0.8s linear infinite;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }

.ai-loading-label {
  font-size: 14px;
  font-weight: 500;
  color: #475569;
}

.ai-loading-phases {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.ai-phase {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid #E2E8F0;
  color: #94A3B8;
  background: #F8FAFC;
  transition: all 0.3s;
}
.ai-phase.active {
  border-color: #A5B4FC;
  color: #4338CA;
  background: #EEF2FF;
  font-weight: 500;
}
.ai-phase.done {
  border-color: #BBF7D0;
  color: #166534;
  background: #F0FDF4;
}

/* ── Results step ─────────────────────────────────────────── */
.ai-results-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ai-results-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-bottom: 1px solid #E2E8F0;
  background: #FAFAFA;
  flex-shrink: 0;
}

.ai-coverage-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.ai-coverage-badge.high   { background: #DCFCE7; color: #166534; }
.ai-coverage-badge.medium { background: #FEF3C7; color: #92400E; }
.ai-coverage-badge.low    { background: #FEE2E2; color: #DC2626; }
.ai-coverage-badge.none   { background: #F1F5F9; color: #64748B; }

.ai-results-panels {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.ai-results-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid #E2E8F0;
}

.ai-results-sidebar {
  width: 280px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #FAFAFA;
}

/* ── Result tabs ──────────────────────────────────────────── */
.ai-result-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #E2E8F0;
  padding: 0 16px;
  background: #fff;
  flex-shrink: 0;
  overflow-x: auto;
}

.ai-result-tab {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 500;
  color: #64748B;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all 0.15s;
}
.ai-result-tab:hover { color: #4F46E5; }
.ai-result-tab.active {
  color: #4F46E5;
  border-bottom-color: #4F46E5;
  font-weight: 600;
}

.ai-result-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* ── Editable tables ──────────────────────────────────────── */
.ai-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.ai-data-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #6B7280;
  padding: 6px 8px;
  border-bottom: 1px solid #E5E7EB;
  background: #F9FAFB;
  white-space: nowrap;
}
.ai-data-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #F3F4F6;
  vertical-align: top;
  color: #1F2937;
}
.ai-data-table tr:hover td { background: #F9FAFB; }
.ai-data-table input[type="text"],
.ai-data-table textarea,
.ai-data-table select {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 12.5px;
  color: #1F2937;
  background: transparent;
  font-family: inherit;
  resize: vertical;
  min-height: 28px;
  transition: border-color 0.15s, background 0.15s;
}
.ai-data-table input[type="text"]:focus,
.ai-data-table textarea:focus,
.ai-data-table select:focus {
  outline: none;
  border-color: #A5B4FC;
  background: #EEF2FF;
}
.ai-data-table .ai-conf-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.ai-conf-dot.high   { background: #22C55E; }
.ai-conf-dot.medium { background: #F59E0B; }
.ai-conf-dot.low    { background: #EF4444; }
.ai-conf-dot.none   { background: #9CA3AF; }

.ai-add-row-btn {
  margin-top: 8px;
  font-size: 12px;
  color: #6366F1;
  background: none;
  border: 1px dashed #A5B4FC;
  border-radius: 6px;
  padding: 5px 12px;
  cursor: pointer;
  width: 100%;
  transition: all 0.15s;
}
.ai-add-row-btn:hover { background: #EEF2FF; }

.ai-del-row-btn {
  background: none;
  border: none;
  color: #9CA3AF;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s;
}
.ai-del-row-btn:hover { color: #EF4444; }

/* ── WBS tree ─────────────────────────────────────────────── */
.ai-wbs-tree { font-size: 13px; }
.ai-wbs-node {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid #F1F5F9;
}
.ai-wbs-node-indent { flex-shrink: 0; }
.ai-wbs-code {
  font-size: 11px;
  font-weight: 600;
  color: #6366F1;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 50px;
}
.ai-wbs-name {
  flex: 1;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 12.5px;
  color: #1F2937;
  background: transparent;
  font-family: inherit;
  transition: all 0.15s;
}
.ai-wbs-name:focus {
  outline: none;
  border-color: #A5B4FC;
  background: #EEF2FF;
}

/* ── Evidence panel ───────────────────────────────────────── */
.ai-evidence-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6B7280;
  margin-bottom: 8px;
}

.ai-evidence-item {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 10px;
  font-size: 11.5px;
  margin-bottom: 8px;
}
.ai-evidence-source {
  font-weight: 600;
  color: #374151;
  margin-bottom: 3px;
}
.ai-evidence-text {
  color: #6B7280;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ai-evidence-meta {
  display: flex;
  gap: 6px;
  margin-top: 5px;
}
.ai-evidence-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 500;
}
.ai-evidence-tag.alta   { background: #DCFCE7; color: #166534; }
.ai-evidence-tag.media  { background: #FEF3C7; color: #92400E; }
.ai-evidence-tag.baixa  { background: #FEE2E2; color: #DC2626; }
.ai-evidence-tag.sem    { background: #F1F5F9; color: #64748B; }
.ai-evidence-tag.origin { background: #EEF2FF; color: #3730A3; }

.ai-no-evidence {
  font-size: 12px;
  color: #9CA3AF;
  text-align: center;
  padding: 20px 0;
}

/* ── Suggestions outside scope ────────────────────────────── */
.ai-suggestions-section {
  margin-top: 12px;
}
.ai-suggestions-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #6366F1;
  cursor: pointer;
  font-weight: 500;
  background: none;
  border: none;
  padding: 0;
}
.ai-suggestions-body {
  margin-top: 8px;
  padding: 10px;
  background: #F8FAFF;
  border: 1px solid #C7D2FE;
  border-radius: 8px;
  font-size: 12px;
  color: #3730A3;
  line-height: 1.5;
}

/* ── Popup footer / action buttons ───────────────────────── */
.ai-popup-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid #E2E8F0;
  background: #FAFAFA;
  flex-shrink: 0;
}

.ai-btn-primary {
  padding: 8px 20px;
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
}
.ai-btn-primary:hover { opacity: 0.9; }
.ai-btn-primary:active { transform: scale(0.98); }
.ai-btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.ai-btn-secondary {
  padding: 8px 16px;
  background: #fff;
  color: #374151;
  border: 1.5px solid #D1D5DB;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.ai-btn-secondary:hover { border-color: #A5B4FC; color: #4F46E5; background: #F5F3FF; }
.ai-btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }

.ai-btn-text {
  padding: 6px 10px;
  background: none;
  color: #6B7280;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.ai-btn-text:hover { background: #F1F5F9; color: #1F2937; }

.ai-btn-save-approved {
  padding: 8px 20px;
  background: #16A34A;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
  margin-left: auto;
}
.ai-btn-save-approved:hover { opacity: 0.9; }
.ai-btn-save-approved:disabled { opacity: 0.4; cursor: not-allowed; }

.ai-footer-spacer { flex: 1; }

/* ── AI Assist trigger button (in pages) ──────────────────── */
.btn-ai-assist {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn-ai-assist:hover { opacity: 0.9; }
.btn-ai-assist:active { transform: scale(0.98); }

/* ── Low coverage alert ───────────────────────────────────── */
.ai-low-coverage-bar {
  padding: 8px 12px;
  background: #FEF3C7;
  border-bottom: 1px solid #FDE68A;
  font-size: 12px;
  color: #92400E;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Info card ────────────────────────────────────────────── */
.ai-info-card {
  background: #EEF2FF;
  border: 1px solid #C7D2FE;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: #3730A3;
  line-height: 1.5;
}
.ai-info-card strong { font-weight: 600; }

/* ════════════════════════════════════════════════════════════
   Release 5 — UX avançada (Sprints 5.1–5.4)
   ════════════════════════════════════════════════════════════ */

/* ── 5.1: Editor tabular avançado ────────────────────────── */
.ai-editable-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.ai-editable-table thead th {
  background: #F8FAFC;
  font-weight: 600;
  padding: 6px 8px;
  border: 1px solid #E2E8F0;
  text-align: left;
  white-space: nowrap;
}
.ai-editable-table td {
  padding: 5px 8px;
  border: 1px solid #E2E8F0;
  vertical-align: top;
  min-width: 80px;
  max-width: 220px;
  white-space: pre-wrap;
  word-break: break-word;
}
.ai-editable-table td[contenteditable="true"]:focus {
  outline: 2px solid #6366F1;
  outline-offset: -2px;
  background: #EEF2FF;
}
/* Low-confidence row/cell highlighting */
.ai-row-low-conf { background: #FFFBEB; }
.ai-cell-low-conf {
  border-bottom: 2px solid #FCD34D !important;
  position: relative;
}
.ai-cell-low-conf::after {
  content: '⚡';
  position: absolute;
  top: 2px;
  right: 3px;
  font-size: 9px;
  opacity: 0.7;
}
/* Required-empty cells */
.ai-cell-required-empty {
  background: #FEF2F2 !important;
  border-color: #FCA5A5 !important;
  animation: ai-required-pulse 1.5s ease-in-out infinite alternate;
}
@keyframes ai-required-pulse {
  from { box-shadow: inset 0 0 0 1px #FCA5A5; }
  to   { box-shadow: inset 0 0 0 2px #EF4444; }
}
/* Manually edited cells */
.ai-cell-edited { background: #F0FDF4 !important; border-color: #86EFAC !important; }
.ai-row-edited { border-left: 3px solid #22C55E !important; }
.ai-row-new { border-left: 3px solid #6366F1 !important; background: #F5F3FF; }
/* Row selection */
.ai-select-col { width: 28px; min-width: 28px; max-width: 28px; text-align: center; padding: 4px !important; }
.ai-del-col { width: 28px; min-width: 28px; max-width: 28px; text-align: center; padding: 2px !important; }
.ai-row-selected { background: #EEF2FF !important; }
.ai-row-accepted { background: #F0FDF4 !important; opacity: 0.8; }
.ai-del-row-btn {
  background: none; border: none; color: #EF4444;
  font-size: 16px; cursor: pointer; padding: 0 4px; line-height: 1;
}
.ai-del-row-btn:hover { color: #B91C1C; }
/* Add-row button */
.ai-add-row-tr td { padding: 4px 0 !important; border: none !important; background: none; }
.ai-add-row-btn {
  background: none; border: 1px dashed #6366F1; color: #6366F1;
  border-radius: 6px; padding: 4px 12px; font-size: 12px; cursor: pointer;
  margin: 4px 0;
  transition: background 0.15s;
}
.ai-add-row-btn:hover { background: #EEF2FF; }
/* Bulk action bar */
.ai-bulk-bar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #EEF2FF;
  border: 1px solid #C7D2FE;
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 12px;
}
.ai-bulk-count { font-weight: 600; color: #4338CA; flex: 1; }
.ai-bulk-btn {
  padding: 4px 10px; border: 1px solid #C7D2FE; border-radius: 5px;
  background: #fff; font-size: 11px; cursor: pointer; color: #374151;
  transition: background 0.15s;
}
.ai-bulk-btn:hover { background: #EEF2FF; }
.ai-bulk-del { color: #EF4444 !important; border-color: #FCA5A5 !important; }

/* ── 5.2: Regeneração ─────────────────────────────────────── */
.ai-regen-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 12px;
  flex-wrap: wrap;
}
.ai-regen-label { color: #64748B; flex: 1; min-width: 80px; }
.ai-regen-label strong { color: #1E293B; }
.ai-regen-btn {
  padding: 4px 10px; border: 1px solid #C7D2FE; border-radius: 5px;
  background: #fff; font-size: 11px; font-weight: 500; cursor: pointer; color: #4338CA;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.ai-regen-btn:hover { background: #EEF2FF; border-color: #818CF8; }
.ai-compare-btn { color: #0369A1 !important; border-color: #BAE6FD !important; }
.ai-compare-btn:hover { background: #F0F9FF !important; }
/* Diff panel */
.ai-diff-panel {
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.ai-diff-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  font-size: 13px;
}
.ai-diff-header strong { flex: 1; }
.ai-diff-legend { display: flex; gap: 8px; font-size: 11px; }
.ai-diff-legend span { padding: 2px 7px; border-radius: 4px; }
.ai-diff-removed { background: #FEE2E2; color: #B91C1C; }
.ai-diff-added   { background: #DCFCE7; color: #15803D; }
.ai-diff-changed { background: #FEF3C7; color: #92400E; }
.ai-diff-close { background: none; border: none; cursor: pointer; font-size: 14px; color: #64748B; }
.ai-diff-body { display: flex; }
.ai-diff-col { flex: 1; min-width: 0; border-right: 1px solid #E2E8F0; }
.ai-diff-col:last-child { border-right: none; }
.ai-diff-col-header {
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  color: #64748B;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
}
.ai-diff-content { padding: 4px 0; max-height: 280px; overflow-y: auto; }
.ai-diff-row {
  padding: 5px 12px;
  font-size: 12px;
  border-bottom: 1px solid #F1F5F9;
  line-height: 1.5;
}
.ai-diff-row.ai-diff-same   { color: #374151; }
.ai-diff-row.ai-diff-removed { background: #FEE2E2; color: #B91C1C; text-decoration: line-through; }
.ai-diff-row.ai-diff-added   { background: #DCFCE7; color: #15803D; }
.ai-diff-row.ai-diff-changed { background: #FEF3C7; color: #78350F; }
.ai-diff-footer { padding: 8px 14px; border-top: 1px solid #E2E8F0; text-align: right; }
.ai-diff-restore-btn {
  padding: 6px 14px; background: #6366F1; color: #fff; border: none;
  border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.ai-diff-restore-btn:hover { background: #4F46E5; }
/* Results toolbar extra buttons */
.ai-toolbar-btn {
  padding: 4px 10px;
  background: none;
  border: 1px solid #E2E8F0;
  border-radius: 5px;
  font-size: 11px;
  cursor: pointer;
  color: #475569;
  white-space: nowrap;
  transition: background 0.15s;
}
.ai-toolbar-btn:hover { background: #F8FAFC; }

/* ── 5.3: Prompt builder ──────────────────────────────────── */
.ai-prompt-builder-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 5px 12px;
  background: none;
  border: 1px solid #C7D2FE;
  border-radius: 6px;
  font-size: 12px;
  color: #4338CA;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.ai-prompt-builder-toggle:hover,
.ai-prompt-builder-toggle.active { background: #EEF2FF; color: #312E81; }
.ai-prompt-builder {
  margin-top: 8px;
  border: 1px solid #E0E7FF;
  border-radius: 8px;
  background: #F5F3FF;
  overflow: hidden;
}
.ai-builder-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #EEF2FF;
  border-bottom: 1px solid #E0E7FF;
  font-size: 12px;
}
.ai-builder-header strong { color: #3730A3; }
.ai-builder-hint { font-size: 11px; color: #6366F1; margin-left: auto; }
.ai-builder-questions { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.ai-builder-question { display: flex; flex-direction: column; gap: 3px; }
.ai-builder-question label {
  font-size: 11px;
  font-weight: 600;
  color: #374151;
}
.ai-builder-input {
  padding: 5px 8px;
  border: 1px solid #C7D2FE;
  border-radius: 5px;
  font-size: 12px;
  background: #fff;
  resize: vertical;
}
.ai-builder-input:focus { outline: 2px solid #6366F1; border-color: #6366F1; }
.ai-builder-footer {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid #E0E7FF;
  background: #EEF2FF;
}
.ai-builder-detect-btn {
  padding: 5px 10px;
  background: none;
  border: 1px solid #A5B4FC;
  border-radius: 5px;
  font-size: 11px;
  color: #4338CA;
  cursor: pointer;
}
.ai-builder-detect-btn:hover { background: #DDD6FE; }
.ai-btn-primary-sm {
  padding: 5px 12px;
  background: #6366F1;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  margin-left: auto;
}
.ai-btn-primary-sm:hover { background: #4F46E5; }
/* Missing context hints */
.ai-builder-hints {
  margin: 6px 12px 8px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #E0E7FF;
  font-size: 11px;
}
.ai-builder-hints.ok {
  background: #DCFCE7;
  border-color: #86EFAC;
  padding: 6px 10px;
  color: #15803D;
  font-weight: 500;
}
.ai-builder-hint-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 6px 10px;
  background: #FFFBEB;
  border-bottom: 1px solid #FEF3C7;
  color: #78350F;
}
.ai-builder-hint-item:last-child { border-bottom: none; }
.ai-builder-hint-item.info { background: #EFF6FF; border-color: #BFDBFE; color: #1E40AF; }
.ai-hint-icon { flex-shrink: 0; }

/* ── 5.4: Versionamento ───────────────────────────────────── */
.ai-version-badge {
  display: inline-block;
  padding: 2px 7px;
  background: #EEF2FF;
  color: #4338CA;
  border: 1px solid #C7D2FE;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
  margin-left: 4px;
}
.ai-version-history {
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  margin-bottom: 10px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.ai-version-history-header {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  font-size: 12px;
}
.ai-version-history-header strong { flex: 1; }
.ai-version-close {
  background: none; border: none; cursor: pointer;
  font-size: 14px; color: #94A3B8;
}
.ai-version-list { padding: 4px 0; }
.ai-version-item {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  border-bottom: 1px solid #F1F5F9;
  gap: 8px;
  font-size: 11px;
}
.ai-version-item:last-child { border-bottom: none; }
.ai-version-item.active { background: #EEF2FF; }
.ai-version-meta { display: flex; align-items: center; gap: 8px; flex: 1; }
.ai-version-num { font-weight: 700; color: #4338CA; min-width: 22px; }
.ai-version-date { color: #64748B; }
.ai-version-conf { color: #94A3B8; margin-left: auto; }
.ai-version-actions { display: flex; gap: 5px; }
.ai-version-current { font-size: 10px; color: #22C55E; font-weight: 600; }
.ai-version-restore,
.ai-version-compare {
  padding: 2px 8px;
  border: 1px solid #E2E8F0;
  border-radius: 4px;
  background: none;
  font-size: 11px;
  cursor: pointer;
  color: #4338CA;
}
.ai-version-restore:hover { background: #EEF2FF; }
.ai-version-compare { color: #0369A1; border-color: #BAE6FD; }
.ai-version-compare:hover { background: #F0F9FF; }

/* ══════════════════════════════════════════════════════════════
   Release 6 · Sprint 6.1 — Validation Panel
   ══════════════════════════════════════════════════════════════ */

/* Panel container */
.ai-validation-panel {
  border-radius: 8px;
  border: 1.5px solid #FCA5A5;
  background: #FEF2F2;
  margin-bottom: 10px;
  overflow: hidden;
  font-size: 13px;
}
.ai-validation-panel.ai-val-warnings-only {
  border-color: #FCD34D;
  background: #FFFBEB;
}

/* Header */
.ai-val-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  cursor: default;
}
.ai-val-header-error   { background: #FEE2E2; }
.ai-val-header-warning { background: #FEF3C7; }

.ai-val-summary { font-weight: 600; color: #7F1D1D; }
.ai-val-warnings-only .ai-val-summary { color: #78350F; }

.ai-val-toggle {
  background: none; border: none; cursor: pointer;
  font-size: 11px; color: #6B7280; padding: 2px 4px;
  line-height: 1;
}

/* Body */
.ai-val-body { padding: 8px 12px 10px; }

/* Groups */
.ai-val-group        { margin-bottom: 8px; }
.ai-val-group-title  { font-weight: 600; font-size: 12px; color: #374151; margin-bottom: 4px; }

/* Issue list */
.ai-val-issue-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 3px;
}
.ai-val-issue {
  display: flex; align-items: baseline; gap: 6px;
  padding: 4px 8px; border-radius: 5px; background: #fff;
  border: 1px solid #E5E7EB;
  transition: background .15s;
}
.ai-val-issue:hover { background: #F9FAFB; }
.ai-val-msg  { color: #1F2937; flex: 1; line-height: 1.4; }
.ai-val-loc  { color: #9CA3AF; font-size: 11px; white-space: nowrap; }

/* Suppress button */
.ai-val-suppress-btn {
  margin-top: 8px; padding: 4px 10px;
  border: 1px solid #D1D5DB; border-radius: 5px;
  background: #F9FAFB; color: #6B7280;
  font-size: 12px; cursor: pointer;
}
.ai-val-suppress-btn:hover { background: #F3F4F6; }

/* Highlight row/cell jump */
.ai-val-highlight-row {
  outline: 2px solid #F59E0B;
  animation: ai-val-pulse-row .6s ease 3;
}
.ai-val-highlight-cell {
  outline: 2px solid #EF4444;
  animation: ai-val-pulse-cell .5s ease 3;
}
@keyframes ai-val-pulse-row  { 0%,100%{background:inherit} 50%{background:#FEF3C7} }
@keyframes ai-val-pulse-cell { 0%,100%{background:inherit} 50%{background:#FEE2E2} }

/* Toast notification */
.ai-val-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(60px);
  padding: 10px 20px; border-radius: 8px;
  font-size: 13px; font-weight: 500; z-index: 20000;
  opacity: 0; transition: transform .25s, opacity .25s;
  pointer-events: none; white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.ai-val-toast-show      { opacity: 1; transform: translateX(-50%) translateY(0); }
.ai-val-toast-error     { background: #FEE2E2; color: #7F1D1D; border: 1px solid #FCA5A5; }
.ai-val-toast-warning   { background: #FEF3C7; color: #78350F; border: 1px solid #FCD34D; }
.ai-val-toast-info      { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }

/* ══════════════════════════════════════════════════════════════
   Release 6 · Sprint 6.2 — Quality Rating Widget
   ══════════════════════════════════════════════════════════════ */

.ai-rating-widget {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  background: #FFFBEB;
  border-bottom: 1px solid #FDE68A;
  flex-wrap: wrap;
  animation: ai-rating-slide-in .2s ease;
}
@keyframes ai-rating-slide-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ai-rating-label {
  font-size: 12px;
  font-weight: 600;
  color: #78350F;
  white-space: nowrap;
}

.ai-stars {
  display: flex;
  gap: 3px;
}
.ai-star {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: #D1D5DB;
  padding: 0 2px;
  line-height: 1;
  transition: color .1s, transform .1s;
}
.ai-star:hover,
.ai-star.ai-star-hover  { color: #F59E0B; transform: scale(1.15); }
.ai-star.ai-star-active { color: #F59E0B; }

.ai-rating-comment {
  flex: 1;
  min-width: 160px;
  max-width: 280px;
  padding: 4px 8px;
  border: 1px solid #FCD34D;
  border-radius: 5px;
  font-size: 12px;
  color: #374151;
  outline: none;
  background: #fff;
}
.ai-rating-comment:focus { border-color: #F59E0B; box-shadow: 0 0 0 2px #FEF3C7; }

.ai-rating-submit {
  padding: 4px 12px;
  background: #F59E0B;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.ai-rating-submit:hover { background: #D97706; }

.ai-rating-dismiss {
  background: none;
  border: none;
  color: #9CA3AF;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
}
.ai-rating-dismiss:hover { color: #374151; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 700px) {
  #ai-assist-popup { max-height: 100vh; border-radius: 0; }
  .ai-results-panels { flex-direction: column; }
  .ai-results-sidebar { width: 100%; max-height: 200px; border-right: none; border-top: 1px solid #E2E8F0; }
  .ai-blocks-grid { grid-template-columns: 1fr; }
  .ai-intent-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════════════════════
   Sprint 7.1 — AI Project Draft Panel  (.aipd-*)
   ════════════════════════════════════════════════════════════════════════════ */

.aipd-container {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(15,23,42,.06);
  overflow: hidden;
}

/* Header */
.aipd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(135deg, #4F46E5, #6366F1);
  color: #fff;
}
.aipd-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .3px;
}
.aipd-refresh-btn {
  background: rgba(255,255,255,.18);
  border: none;
  color: #fff;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 16px;
  cursor: pointer;
  transition: background .2s;
  line-height: 1;
}
.aipd-refresh-btn:hover { background: rgba(255,255,255,.3); }

/* List area */
.aipd-list { padding: 16px; display: flex; flex-direction: column; gap: 12px; }

.aipd-empty,
.aipd-loading,
.aipd-error {
  text-align: center;
  padding: 24px;
  color: #9CA3AF;
  font-size: 14px;
}
.aipd-error { color: #B91C1C; background: #FEE2E2; border-radius: 10px; }

/* Draft card */
.aipd-card {
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  padding: 16px;
  background: #FAFAFA;
  transition: box-shadow .2s, border-color .2s;
}
.aipd-card:hover {
  box-shadow: 0 4px 14px rgba(79,70,229,.1);
  border-color: #A5B4FC;
}

.aipd-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.aipd-card-name {
  font-size: 15px;
  font-weight: 700;
  color: #1E1B4B;
  flex: 1;
}
.aipd-card-type {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.badge-capex { background: #DBEAFE; color: #1E40AF; }
.badge-opex  { background: #D1FAE5; color: #065F46; }

.aipd-card-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: #6B7280;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.aipd-card-scope {
  font-size: 12px;
  color: #4B5563;
  background: #F0F4FF;
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 10px;
  line-height: 1.5;
}

/* Action buttons */
.aipd-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.aipd-btn {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all .18s;
}
.aipd-btn-activate {
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #6EE7B7;
}
.aipd-btn-activate:hover { background: #A7F3D0; }

.aipd-btn-review {
  background: #EFF6FF;
  color: #1E40AF;
  border: 1px solid #BFDBFE;
}
.aipd-btn-review:hover { background: #DBEAFE; }

.aipd-btn-discard {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
}
.aipd-btn-discard:hover { background: #FEE2E2; }

@media (max-width: 640px) {
  .aipd-card-header { flex-wrap: wrap; }
  .aipd-card-actions { flex-direction: column; }
  .aipd-btn { width: 100%; text-align: center; }
}

/* ════════════════════════════════════════════════════════════════════════════
   Sprint 7.2 — AI Status Report Panel  (.aisr-*)
   ════════════════════════════════════════════════════════════════════════════ */

.aisr-panel {
  background: #fff;
  border: 2px solid #A5B4FC;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 24px rgba(79,70,229,.1);
  font-size: 14px;
}

.aisr-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.aisr-badge {
  background: linear-gradient(135deg,#4F46E5,#6366F1);
  color: #fff;
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 700;
}
.aisr-conf {
  font-size: 12px;
  color: #6B7280;
  margin-left: auto;
}
.aisr-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #9CA3AF;
  line-height: 1;
  padding: 2px 4px;
}
.aisr-close:hover { color: #374151; }

.aisr-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.aisr-status-label {
  font-weight: 700;
  color: #374151;
  font-size: 13px;
}
.aisr-status-chip {
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.aisr-sections {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}
.aisr-section {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 12px 16px;
}
.aisr-section-title {
  font-size: 12px;
  font-weight: 700;
  color: #4F46E5;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}
.aisr-section-body {
  font-size: 13px;
  color: #374151;
  line-height: 1.6;
}
.aisr-section-body p { margin: 0 0 8px; }
.aisr-section-body p:last-child { margin: 0; }

.aisr-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.aisr-btn {
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all .18s;
}
.aisr-btn-apply {
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #6EE7B7;
}
.aisr-btn-apply:hover { background: #A7F3D0; }
.aisr-btn-discard {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
}
.aisr-btn-discard:hover { background: #FEE2E2; }

.aisr-loading {
  text-align: center;
  padding: 24px;
  color: #6B7280;
  font-size: 14px;
}
.aisr-error {
  color: #B91C1C;
  background: #FEE2E2;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
}

/* ════════════════════════════════════════════════════════════════════════════
   Sprint 7.3 — AI Portfolio Analysis Panel  (.aipa-*)
   ════════════════════════════════════════════════════════════════════════════ */

.aipa-panel {
  background: #fff;
  border: 2px solid #86EFAC;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 24px rgba(16,185,129,.1);
  font-size: 14px;
}

.aipa-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.aipa-badge {
  background: linear-gradient(135deg,#059669,#10B981);
  color: #fff;
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 700;
}
.aipa-meta {
  font-size: 12px;
  color: #6B7280;
  margin-left: auto;
}
.aipa-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #9CA3AF;
  line-height: 1;
  padding: 2px 4px;
}
.aipa-close:hover { color: #374151; }

.aipa-summary {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: #374151;
  line-height: 1.6;
  margin-bottom: 18px;
}

.aipa-section {
  margin-bottom: 18px;
}
.aipa-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #059669;
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 8px;
}
.aipa-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.aipa-item {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.aipa-item-label {
  font-size: 13px;
  font-weight: 700;
  color: #1E293B;
}
.aipa-item-body {
  font-size: 12px;
  color: #4B5563;
  line-height: 1.5;
}
.aipa-item-meta {
  font-size: 11px;
  color: #9CA3AF;
}
.aipa-sev-high  { color: #B91C1C; }
.aipa-sev-med   { color: #92400E; }
.aipa-sev-low   { color: #065F46; }

.aipa-loading {
  text-align: center;
  padding: 24px;
  color: #6B7280;
  font-size: 14px;
}
.aipa-error {
  color: #B91C1C;
  background: #FEE2E2;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
}

/* ════════════════════════════════════════════════════════════════════════════
   Sprint 7.4 — AI Lessons Learned  (.ail-*)
   Shared classes for the embedded widget (full styles also in lessons-learned.html)
   ════════════════════════════════════════════════════════════════════════════ */

.ail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(135deg,#F59E0B,#FBBF24);
  border-radius: 18px 18px 0 0;
  color: #fff;
  flex-wrap: wrap;
  gap: 10px;
}
.ail-title { font-size: 15px; font-weight: 700; letter-spacing: .3px; }
.ail-header-actions { display: flex; gap: 8px; }

.ail-search-bar {
  display: flex;
  gap: 10px;
  padding: 14px 18px;
  background: #FFFBEB;
  border-left: 1px solid #E2E8F0;
  border-right: 1px solid #E2E8F0;
  flex-wrap: wrap;
}
.ail-search-input {
  flex: 1; min-width: 160px;
  padding: 10px 14px;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  font-size: 13px;
  background: #fff;
}
.ail-search-input:focus {
  outline: none;
  border-color: #F59E0B;
  box-shadow: 0 0 0 3px rgba(245,158,11,.1);
}
.ail-select {
  padding: 10px 14px;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  font-size: 13px;
  background: #fff;
  cursor: pointer;
}

.ail-btn {
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all .18s;
}
.ail-btn-suggest { background: #F59E0B; color: #fff; }
.ail-btn-suggest:hover { background: #D97706; }
.ail-btn-refresh {
  background: rgba(255,255,255,.25);
  color: #fff;
  width: 34px; height: 34px;
  font-size: 16px;
  border-radius: 8px;
  padding: 0;
}
.ail-btn-refresh:hover { background: rgba(255,255,255,.4); }
.ail-btn-search { background: #F59E0B; color: #fff; }
.ail-btn-search:hover { background: #D97706; }
.ail-btn-validate { background: #D1FAE5; color: #065F46; border: 1px solid #6EE7B7; }
.ail-btn-validate:hover { background: #A7F3D0; }
.ail-btn-apply { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }
.ail-btn-apply:hover { background: #DBEAFE; }
.ail-btn-archive { background: #F3F4F6; color: #374151; border: 1px solid #D1D5DB; }
.ail-btn-archive:hover { background: #E5E7EB; }

.ail-list {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid #E2E8F0;
  border-top: none;
  border-radius: 0 0 18px 18px;
  background: #fff;
}
.ail-loading, .ail-empty { text-align: center; padding: 32px; color: #9CA3AF; font-size: 14px; }
.ail-error { color: #B91C1C; background: #FEE2E2; border-radius: 10px; padding: 16px; text-align: center; }

.ail-card {
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  padding: 16px;
  background: #FFFBEB;
  transition: box-shadow .2s, border-color .2s;
}
.ail-card:hover { box-shadow: 0 4px 14px rgba(245,158,11,.12); border-color: #FCD34D; }

.ail-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.ail-card-title { font-size: 15px; font-weight: 700; color: #1E1B4B; flex: 1; }
.ail-card-badges { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }

.ail-status { padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.ail-status-ok    { background: #D1FAE5; color: #065F46; }
.ail-status-draft { background: #FEF3C7; color: #92400E; }
.ail-status-arch  { background: #F3F4F6; color: #374151; }

.ail-severity { padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.ail-sev-critical { background: #FEE2E2; color: #991B1B; }
.ail-sev-high     { background: #FEF3C7; color: #92400E; }
.ail-sev-med      { background: #E0E7FF; color: #3730A3; }
.ail-sev-low      { background: #F0FDF4; color: #166534; }

.ail-ai-badge { padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #EEF2FF; color: #4F46E5; }

.ail-card-category { font-size: 12px; color: #6B7280; margin-bottom: 8px; text-transform: capitalize; }
.ail-card-desc { font-size: 13px; color: #374151; line-height: 1.6; margin-bottom: 10px; }

.ail-card-keywords { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.ail-kw { background: #FEF3C7; color: #92400E; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }

.ail-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
