/* ── MODULE TRANSITION POLISH (v2.76.142) ───────────────────────────────── */
/* Purpose: Smooth module switching with fade/slide animations */

.module-panel {
  opacity: 0;
  transform: scale(0.98);
  transition: opacity var(--motion-base) var(--ease-out-expo), transform var(--motion-base) var(--ease-out-expo);
}
.module-panel.active {
  opacity: 1;
  transform: scale(1);
}

/* Loading skeleton enhancements for all module panels */
.loading-state {
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 200px;
}
.loading-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  animation: fadeInOut 1.5s ease-in-out infinite alternate;
}
@keyframes fadeInOut {
  from { opacity: 0.5; }
  to { opacity: 1; }
}

/* Progress bar polish for async operations */
.progress-bar-container {
  background: var(--bg-tertiary);
  border-radius: 9999px;
  height: 6px;
  overflow: hidden;
  margin: 8px 0;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--cyan)));
  border-radius: 9999px;
  animation: progressMove 2s linear infinite;
  transform-origin: left;
}
@keyframes progressMove {
  0% { transform: scaleX(0); }
  50% { transform: scaleX(0.7); }
  100% { transform: scaleX(1); }
}

/* Toast notification animations */
.toast {
  animation: toastSlideIn 0.3s var(--ease-out-expo);
}
.toast.error {
  background: rgba(239,68,68,0.9);
  color: white;
}
.toast.warning {
  background: rgba(245,158,11,0.9);
  color: var(--text-primary);
}
.toast.success {
  background: rgba(16,185,129,0.9);
  color: white;
}
@keyframes toastSlideIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Filter/chip animations */
.filter-chip {
  border-radius: 16px;
  padding: 6px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s var(--ease-out-quart);
}
.filter-chip:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.filter-chip.selected {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* Table row entry animation */
.ledger-row, .doc-item, .risk-row {
  animation: rowEntry 0.3s var(--ease-out-expo);
  will-change: opacity, transform;
}
@keyframes rowEntry {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Empty state enhancements */
.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.6;
  animation: iconFloat 3s ease-in-out infinite;
}
@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Focus ring polish for accessibility */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Scrollbar polish */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Subtle gradient overlays for cards */
.gradient-overlay {
  position: relative;
  overflow: hidden;
}
.gradient-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(14,165,233,0.03) 0%, transparent 50%, rgba(139,92,246,0.03) 100%);
  pointer-events: none;
}
.kpi-snapshot-status{margin:10px 2px 0;color:var(--text-muted);font-size:.72rem}
.kpi-trend{display:flex;align-items:flex-end;justify-content:space-between;gap:8px;margin-top:10px;color:var(--text-muted);font-size:.64rem;text-transform:uppercase;letter-spacing:.04em}
.kpi-trend-bars{display:flex;align-items:flex-end;gap:3px;height:24px;min-width:46px;justify-content:flex-end}
.kpi-trend-bar{display:block;width:5px;min-height:2px;border-radius:3px 3px 1px 1px;background:var(--accent);opacity:.8}
.kpi-trend-empty{font-size:.63rem;text-transform:none;letter-spacing:0;white-space:nowrap}
