/* main.css — CDI Monitor global styles — Professional Legal Services Theme */

:root {
  --primary: #1E3A8A;
  --primary-light: #2563EB;
  --primary-dark: #1E3A5F;
  --accent: #B45309;
  --accent-light: #D97706;
  --bg: #F8FAFC;
  --card-bg: #FFFFFF;
  --text: #0F172A;
  --text-muted: #64748B;
  --border: #CBD5E1;
  --muted-bg: #E9EEF5;
  --success: #22C55E;
  --warning: #F59E0B;
  --error: #DC2626;
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'Fira Code', monospace;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 200ms ease;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
}

.font-mono, code, .cnj-number {
  font-family: var(--font-mono);
}

/* ---- Navbar ---- */
.navbar {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-bottom: none;
  box-shadow: var(--shadow-md);
}

.nav-pills-container {
  background: rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 4px;
}

.nav-item {
  cursor: pointer;
  color: rgba(255,255,255,0.75);
  padding: 6px 14px;
  border-radius: 6px;
  transition: all var(--transition);
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 13px;
}
.nav-item:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}
.nav-item.active {
  color: var(--primary);
  background: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* Worker indicator on navy navbar */
.worker-indicator-nav {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
}
.worker-indicator-nav .worker-status-label {
  color: rgba(255,255,255,0.8);
}
.worker-indicator-nav .pulse-dot {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
}

/* ---- View toggle button ---- */
.view-btn.active {
  background: var(--primary);
  color: white;
}

/* ---- Summary stat cards ---- */
.summary-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  text-align: center;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.summary-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}
.summary-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.summary-card .stat-number {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.875rem;
  line-height: 2.25rem;
}
.summary-card .stat-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
}
/* Accent borders per summary card */
.summary-card-total::before { background: var(--primary); }
.summary-card-coletados::before { background: var(--success); }
.summary-card-pendentes::before { background: var(--warning); }
.summary-card-anexos::before { background: var(--primary-light); }
.summary-card-rj::before { background: #7C3AED; }

/* ---- Process cards ---- */
.process-card,
.card-hover {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.process-card:hover,
.card-hover:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--primary-light);
}

/* Card left border by tipo_rj */
.card-border-principal { border-left: 4px solid #7C3AED; }
.card-border-habilitacao { border-left: 4px solid #4F46E5; }
.card-border-impugnacao { border-left: 4px solid #EA580C; }
.card-border-falencia { border-left: 4px solid var(--error); }
.card-border-conflito { border-left: 4px solid var(--warning); }
.card-border-recurso { border-left: 4px solid #0891B2; }
.card-border-execucao { border-left: 4px solid #DB2777; }
.card-border-relacionado { border-left: 4px solid #6B7280; }
.card-border-nao_rj { border-left: 4px solid var(--border); }

/* Movement alert card overrides */
.card-alert-critico {
  border-left: 4px solid #D97706 !important;
  background: linear-gradient(135deg, #FFFBEB 0%, #FFFFFF 40%) !important;
  box-shadow: 0 0 0 1px rgba(217,119,6,0.3), 0 4px 12px rgba(217,119,6,0.15) !important;
}
.card-alert-critico:hover {
  box-shadow: 0 0 0 1px rgba(217,119,6,0.5), 0 8px 20px rgba(217,119,6,0.2) !important;
}
.card-alert-importante {
  border-left: 4px solid #F97316 !important;
  background: linear-gradient(135deg, #FFF7ED 0%, #FFFFFF 40%) !important;
}
.mov-banner-critico {
  background: linear-gradient(90deg, #92400E, #B45309);
  color: #FEF3C7;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mov-banner-critico .pulse-dot {
  width: 8px; height: 8px;
  background: #FCD34D;
  border-radius: 50%;
  animation: pulse-dot 1.5s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}
.mov-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
}
.mov-badge-critico { background: #FEF3C7; color: #92400E; }
.mov-badge-importante { background: #FFEDD5; color: #9A3412; }
.mov-badge-normal { background: #DBEAFE; color: #1E40AF; }
.btn-marcar-visto {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 4px;
  border: 1px solid #D1D5DB;
  background: white;
  color: #6B7280;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-marcar-visto:hover { background: #F3F4F6; border-color: #9CA3AF; }
.mov-recentes-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
}
.mov-recentes-header {
  padding: 10px 16px;
  background: #F9FAFB;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mov-recentes-body { max-height: 300px; overflow-y: auto; }
.mov-recentes-row {
  padding: 8px 16px;
  border-bottom: 1px solid #F3F4F6;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.mov-recentes-row:last-child { border-bottom: none; }
.mov-recentes-row:hover { background: #F9FAFB; }
.summary-card-alertas { border-color: #D97706; background: linear-gradient(135deg, #FFFBEB, #FFF); }

/* Worker sub-tabs */
.wk-tab { color: var(--muted-text); }
.wk-tab.active { background: white; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

/* Modal animation */
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Card footer */
.card-footer {
  background: var(--muted-bg);
  border-top: 1px solid var(--border);
}

/* ---- Progress bar ---- */
.progress-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--muted-bg);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  transition: width 500ms ease;
}

/* ---- Data tables ---- */
.data-table thead {
  background: var(--muted-bg);
}
.data-table th {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 10px 16px;
}
.data-table td {
  padding: 10px 16px;
  font-size: 13px;
}
.data-table tr:hover {
  background: #F1F5F9;
}
.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--muted-bg);
}

/* Table alternating rows */
.data-table tbody tr:nth-child(even) {
  background: #FAFBFD;
}
.data-table tbody tr:nth-child(even):hover {
  background: #F1F5F9;
}

/* Right-align number columns */
.text-right-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---- Log line styling ---- */
.log-line {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
}
.log-INFO  { color: #34D399; }
.log-WARN  { color: var(--warning); }
.log-ERROR { color: #F87171; }
.log-DEBUG { color: #94A3B8; }

/* ---- Tab active state ---- */
.tab-active {
  border-bottom: 2px solid var(--primary);
  color: var(--primary);
  font-weight: 600;
}

/* ---- Monitor tabs ---- */
.monitor-tab {
  color: var(--text-muted);
  font-family: var(--font-heading);
}
.monitor-tab.active {
  background: var(--card-bg);
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ---- Modal overlay ---- */
.modal-overlay {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}
.modal-content {
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

/* ---- Sidebar section ---- */
.sidebar-section {
  border-left: 3px solid var(--border);
  padding-left: 12px;
}
.sidebar-section:hover {
  border-left-color: var(--primary);
}

/* ---- Checkbox label highlight ---- */
.checkbox-cnj:checked + label {
  background: #EFF6FF;
  border-color: var(--primary-light);
}

/* ---- KPI Cards ---- */
.kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  transition: all var(--transition);
}
.kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.kpi-card .kpi-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-family: var(--font-heading);
}
.kpi-card .kpi-value {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.875rem;
}

/* ---- Chart containers ---- */
.chart-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}
.chart-card h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text);
  font-size: 0.875rem;
  margin-bottom: 16px;
}

/* ---- Buttons consistent styling ---- */
.btn-primary {
  background: var(--primary);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 500;
  border-radius: var(--radius);
  transition: all var(--transition);
}
.btn-primary:hover {
  background: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

/* ---- Form inputs focus state ---- */
input:focus, select:focus, textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1) !important;
}

/* ---- Budget bar ---- */
.budget-bar-container {
  background: var(--muted-bg);
  border-radius: 999px;
  overflow: hidden;
}

/* ---- Skeleton loader theming ---- */
.skeleton-loader .animate-pulse > div {
  background: var(--muted-bg);
}

/* ---- Scrollbar styling ---- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ---- Responsive navbar ---- */
@media (max-width: 1200px) {
  .nav-item { font-size: 12px; padding: 5px 10px; }
}
@media (max-width: 768px) {
  .nav-pills-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .nav-pills-container::-webkit-scrollbar { display: none; }
}

/* Hide scrollbar utility */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* Main content responsive padding */
@media (max-width: 640px) {
  .main-content { padding-left: 12px; padding-right: 12px; }
}

/* Modal responsive */
.modal-content { max-height: 90vh; }
@media (max-width: 640px) {
  .modal-content { margin: 8px; border-radius: 12px; }
}

/* ---- Selection/highlight ---- */
::selection {
  background: rgba(30, 58, 138, 0.15);
}
