/* components.css — CDI Monitor component styles — Professional Theme */

/* Status badges */
.status-badge {
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
  font-family: var(--font-heading, 'Poppins', sans-serif);
}
.status-coletado         { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; }
.status-coletando        { background: #DBEAFE; color: #1E40AF; border: 1px solid #BFDBFE; }
.status-consulta_simples { background: #E0F2FE; color: #0C4A6E; border: 1px solid #BAE6FD; }
.status-pendente         { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.status-erro             { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }

/* RJ badge */
.rj-badge {
  background: #EDE9FE;
  color: #5B21B6;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
  border: 1px solid #DDD6FE;
  font-family: var(--font-heading, 'Poppins', sans-serif);
}

/* Tipo RJ badges — refined pill style */
.tipo-rj-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-heading, 'Poppins', sans-serif);
}
.tipo-rj-principal   { background: #EDE9FE; color: #5B21B6; border: 1px solid #DDD6FE; }
.tipo-rj-habilitacao { background: #E0E7FF; color: #3730A3; border: 1px solid #C7D2FE; }
.tipo-rj-impugnacao  { background: #FFF7ED; color: #9A3412; border: 1px solid #FED7AA; }
.tipo-rj-falencia    { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.tipo-rj-conflito    { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.tipo-rj-recurso     { background: #CFFAFE; color: #155E75; border: 1px solid #A5F3FC; }
.tipo-rj-execucao    { background: #FCE7F3; color: #9D174D; border: 1px solid #FBCFE8; }
.tipo-rj-relacionado { background: #F1F5F9; color: #475569; border: 1px solid #E2E8F0; }

/* Pulse dot animation */
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success, #22c55e);
  animation: pulse 1.5s infinite;
}

.pulse-dot.stopped {
  background: #9ca3af;
  animation: none;
}

/* Pulse dot on navy background */
.pulse-dot-nav {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.4);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: var(--radius, 8px);
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: opacity 0.3s, transform 0.3s;
  transform: translateY(0);
  font-family: var(--font-body, 'Inter', sans-serif);
}
.toast.success {
  background: #DCFCE7;
  color: #166534;
  border: 1px solid #BBF7D0;
}
.toast.error {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FECACA;
}
.toast.info {
  background: #DBEAFE;
  color: #1E40AF;
  border: 1px solid #BFDBFE;
}
.toast.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--text-muted, #9ca3af);
}
.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
}
.empty-state p {
  font-size: 0.875rem;
  font-family: var(--font-heading, 'Poppins', sans-serif);
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--muted-bg, #e5e7eb);
  border-top-color: var(--primary, #1E3A8A);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Dashboard map count labels */
.map-count-label {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--text, #1e293b);
  font-weight: 700;
  font-size: 11px;
  font-family: var(--font-body, 'Inter', system-ui, sans-serif);
  text-shadow: 0 0 3px #fff, 0 0 3px #fff;
}

/* Action button groups — uniform sizing */
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  transition: all var(--transition, 200ms ease);
  font-family: var(--font-heading, 'Poppins', sans-serif);
}
.action-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.05));
}

/* Budget alert badge on navbar */
.budget-alert-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #FCD34D;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Card info grid labels */
.info-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted, #64748B);
  font-weight: 500;
  font-family: var(--font-heading, 'Poppins', sans-serif);
}

/* CNJ number styling */
.cnj-display {
  font-family: var(--font-mono, 'Fira Code', monospace);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text, #0F172A);
}

/* Empresa name styling */
.empresa-name {
  font-family: var(--font-heading, 'Poppins', sans-serif);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text, #0F172A);
}

/* Category chip selector */
.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  background: white;
  color: var(--text-muted, #64748B);
  font-family: var(--font-body, 'Inter', sans-serif);
  user-select: none;
}
.category-chip:hover {
  border-color: var(--primary-light, #93C5FD);
  color: var(--text, #0F172A);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.category-chip.active {
  background: var(--primary, #1E3A8A);
  color: white;
  border-color: var(--primary, #1E3A8A);
  box-shadow: 0 1px 3px rgba(30, 58, 138, 0.3);
}
.category-chip.active .chip-dot {
  background: white !important;
}
.chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Value highlight */
.valor-highlight {
  font-family: var(--font-mono, 'Fira Code', monospace);
  font-weight: 600;
  color: var(--accent, #B45309);
}

/* =========================================================================
   Monitor Result Cards — Professional Layout
   ========================================================================= */

.monitor-card {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--border, #e2e8f0);
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.monitor-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}

.monitor-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
}
.monitor-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.monitor-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.monitor-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
}

.monitor-card-body {
  padding: 12px 16px;
}

.monitor-card-footer {
  padding: 0 16px 12px;
}

/* Monitor badges */
.monitor-fonte-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 700;
  font-family: var(--font-heading, 'Poppins', sans-serif);
  letter-spacing: 0.02em;
}
.fonte-dou         { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; }
.fonte-digesto     { background: #DBEAFE; color: #1E40AF; border: 1px solid #BFDBFE; }
.fonte-querodiario { background: #FFF7ED; color: #9A3412; border: 1px solid #FED7AA; }
.fonte-dje-tjsp    { background: #CCFBF1; color: #115E59; border: 1px solid #99F6E4; }
.fonte-dje-tjrj    { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }
.fonte-dje-tjpr    { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.fonte-dje-tjal    { background: #E0E7FF; color: #3730A3; border: 1px solid #C7D2FE; }
.fonte-dje-tjam    { background: #EDE9FE; color: #5B21B6; border: 1px solid #DDD6FE; }
.fonte-dje-tjms    { background: #F3E8FF; color: #7E22CE; border: 1px solid #E9D5FF; }
.fonte-djen        { background: #E0F2FE; color: #0C4A6E; border: 1px solid #BAE6FD; }
.fonte-dejesp      { background: #1E3A5F; color: #FFFFFF; border: 1px solid #152D4A; }
.fonte-outros      { background: #F1F5F9; color: #475569; border: 1px solid #E2E8F0; }

.monitor-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 700;
  font-family: var(--font-heading, 'Poppins', sans-serif);
  letter-spacing: 0.03em;
}
.type-rj         { background: #EDE9FE; color: #5B21B6; border: 1px solid #DDD6FE; }
.type-falencia   { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.type-edital     { background: #DBEAFE; color: #1E40AF; border: 1px solid #BFDBFE; }
.type-assembleia { background: #CCFBF1; color: #115E59; border: 1px solid #99F6E4; }
.type-convolacao { background: #FFF7ED; color: #9A3412; border: 1px solid #FED7AA; }
.type-outros     { background: #F1F5F9; color: #475569; border: 1px solid #E2E8F0; }

.monitor-badge-extra {
  font-size: 0.625rem;
  font-weight: 600;
  color: #EA580C;
  background: #FFF7ED;
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid #FED7AA;
}

/* Date and meta */
.monitor-date {
  font-family: var(--font-mono, 'Fira Code', monospace);
  font-size: 0.75rem;
  color: #64748B;
  background: #f8fafc;
  padding: 2px 8px;
  border-radius: 4px;
}
.monitor-meta-item {
  font-size: 0.6875rem;
  color: #64748B;
  background: #f8fafc;
  padding: 2px 8px;
  border-radius: 4px;
}

/* Action buttons */
.monitor-btn-open {
  font-size: 0.75rem;
  color: #2563EB;
  padding: 4px 10px;
  border: 1px solid #BFDBFE;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
  font-weight: 500;
}
.monitor-btn-open:hover {
  background: #EFF6FF;
  color: #1D4ED8;
}
.monitor-btn-save {
  font-size: 0.75rem;
  color: #059669;
  padding: 4px 10px;
  border: 1px solid #A7F3D0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 500;
}
.monitor-btn-save:hover {
  background: #ECFDF5;
  color: #047857;
}

/* CNJ number */
.monitor-cnj-row {
  margin-bottom: 6px;
}
.monitor-cnj {
  font-family: var(--font-mono, 'Fira Code', monospace);
  font-size: 0.8125rem;
  font-weight: 600;
  color: #1E3A8A;
  text-decoration: none;
  padding: 2px 8px;
  background: #EFF6FF;
  border-radius: 4px;
  border: 1px solid #BFDBFE;
  transition: all 0.15s ease;
}
.monitor-cnj:hover {
  background: #DBEAFE;
  color: #1E40AF;
}

/* Title */
.monitor-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text, #0F172A);
  line-height: 1.4;
  margin: 0 0 4px;
  font-family: var(--font-heading, 'Poppins', sans-serif);
}

/* Party tags */
.monitor-parties {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.monitor-party-tag {
  display: inline-block;
  padding: 2px 10px;
  background: #EFF6FF;
  color: #1E40AF;
  font-size: 0.6875rem;
  border-radius: 9999px;
  border: 1px solid #BFDBFE;
  font-weight: 500;
}

/* Excerpt */
.monitor-excerpt {
  font-size: 0.75rem;
  color: #64748B;
  line-height: 1.5;
}
.monitor-excerpt-toggle {
  display: inline;
  background: none;
  border: none;
  color: #2563EB;
  cursor: pointer;
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0;
  margin-left: 4px;
}
.monitor-excerpt-toggle:hover {
  color: #1D4ED8;
  text-decoration: underline;
}

/* Skeleton loading cards */
.skeleton-card {
  padding: 16px;
  opacity: 0.6;
}
.skeleton-line {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 4px;
  height: 14px;
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Loading progress items */
.monitor-progress-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #64748B;
  padding: 4px 12px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}
.spinner-sm {
  width: 12px;
  height: 12px;
  border: 2px solid #e2e8f0;
  border-top-color: #2563EB;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* DataJud table — resizable column handles */
.dj-resize-handle {
  position: absolute;
  right: -2px;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  background: transparent;
  z-index: 5;
}
.dj-resize-handle:hover {
  background: rgba(37, 99, 235, 0.3);
}
.dj-resize-handle:active {
  background: var(--primary-light, #2563EB);
}
.dj-th-resizable {
  position: relative;
  overflow: hidden;
}
/* Fixed table layout for column widths to take effect */
#dj-results-body td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
