/* AML Compliance Platform - Custom CSS */
/* Inspired by PCE-digital-Twin design system */

/* ===== Status Badges ===== */
.status-pending {
  @apply bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-300;
}
.status-running {
  @apply bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-300;
}
.status-completed {
  @apply bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-300;
}
.status-failed {
  @apply bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-300;
}
.status-submitted {
  @apply bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-300;
}
.status-cancelled {
  @apply bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300;
}
.status-confirmed {
  @apply bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-300;
}
.status-false-positive {
  @apply bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-300;
}

/* ===== Card Hover ===== */
.card-hover {
  transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* ===== HTMX Indicator ===== */
.htmx-indicator {
  display: none;
}
.htmx-request .htmx-indicator {
  display: inline-flex;
}
.htmx-request.htmx-indicator {
  display: inline-flex;
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
.dark ::-webkit-scrollbar-thumb {
  background: #475569;
}
.dark ::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* ===== KPI Table ===== */
.kpi-table th {
  @apply px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider dark:text-gray-400;
}
.kpi-table td {
  @apply px-4 py-3 text-sm text-gray-900 dark:text-gray-200;
}
.kpi-table tr {
  @apply border-b border-gray-200 dark:border-gray-700;
}

/* ===== Sidebar ===== */
.sidebar-collapsed .sidebar-label {
  display: none;
}
.sidebar-collapsed .sidebar-section-title {
  display: none;
}

/* ===== Page transitions ===== */
.page-content {
  animation: fadeIn 0.15s ease-in;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== Risk Level Badges ===== */
.risk-unassigned {
  @apply bg-white text-slate-700 border border-slate-300 dark:bg-slate-800 dark:text-slate-200 dark:border-slate-600;
}
.risk-low {
  @apply bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-300;
}
.risk-medium {
  @apply bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-300;
}
.risk-medium-high {
  @apply bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-300;
}
.risk-severe {
  @apply bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-300;
}
.risk-extreme {
  @apply bg-neutral-900 text-white dark:bg-black dark:text-white font-bold;
}

/* ===== Badge Base ===== */
.badge {
  @apply inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium;
}

/* ===== Design system aml-* (UI/UX 10x · fire 1) — PURE CSS =====
   Tailwind CDN does NOT compile @apply (verified: .badge/.risk-severe render inert).
   Values below are browser-measured computed styles of the dominant inline utilities,
   so adopting these classes is pixel-equivalent / behavior-preserving. */
.aml-btn-primary{padding:8px 16px;font-size:14px;font-weight:500;line-height:20px;border-radius:8px;background-color:rgb(28,100,242);color:rgb(255,255,255)}
.aml-btn-primary:hover{background-color:rgb(26,86,219)}
.aml-title{font-size:24px;font-weight:700;line-height:32px;color:rgb(17,24,39)}
.dark .aml-title{color:rgb(255,255,255)}
.aml-heading{font-size:18px;font-weight:600;line-height:28px;color:rgb(17,24,39)}
.dark .aml-heading{color:rgb(255,255,255)}
.aml-muted{color:rgb(107,114,128)}
.dark .aml-muted{color:rgb(156,163,175)}

/* ===== #187 — UN COMANDO DISABILITATO DEVE SEMBRARE DISABILITATO =====
   Su un'operazione chiusa la guardia impediva la scrittura, ma i comandi
   restavano identici a quando erano azionabili: «Esegui controlli AML» era
   ancora un bottone verde grande, i «Salva …» scuri e pieni, i campi con lo
   stesso aspetto. Il notaio non poteva capire a colpo d'occhio che l'atto era
   chiuso — lo stato di sola lettura si APPLICAVA senza COMUNICARSI, e ogni
   click era un tentativo destinato a non succedere.
   La regola sta qui e non nei singoli bottoni: un controllo disabilitato è
   disabilitato ovunque, non solo nel cockpit. */
button[disabled],
input[disabled],
select[disabled],
textarea[disabled],
[aria-disabled="true"] {
  opacity: .45;
  cursor: not-allowed;
  filter: grayscale(100%);
}
