/* POPLAB — Estilos Globais */
:root {
  --poplab-blue: #1e40af;
  --poplab-blue-light: #3b82f6;
  --poplab-teal: #0f766e;
  --poplab-green: #16a34a;
  --poplab-amber: #d97706;
  --poplab-red: #dc2626;
  --poplab-purple: #7c3aed;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar customizado */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* Sidebar */
#sidebar {
  transition: transform 0.25s ease;
  will-change: transform;
}

/* Kanban columns */
.kanban-col {
  min-height: 200px;
}

/* Badge de status */
.badge-coletado      { background:#dbeafe; color:#1e40af; }
.badge-enviado       { background:#fef9c3; color:#854d0e; }
.badge-em_analise    { background:#fce7f3; color:#9d174d; }
.badge-resultado     { background:#ede9fe; color:#5b21b6; }
.badge-laudo         { background:#dcfce7; color:#166534; }
.badge-entregue      { background:#f1f5f9; color:#475569; }

/* Animações */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.25s ease; }

@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 20px; height: 20px;
  border: 2px solid #e2e8f0;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

/* Modais */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; padding: 1rem;
  animation: fadeIn 0.15s ease;
}
.modal-box {
  background: white; border-radius: 12px;
  width: 100%; max-width: 600px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

/* Toast notifications */
#toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 100; display: flex; flex-direction: column; gap: 0.5rem;
}
.toast {
  padding: 0.75rem 1.25rem;
  border-radius: 8px; color: white; font-size: 0.875rem;
  font-weight: 500; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: fadeIn 0.2s ease;
  max-width: 360px;
}
.toast-success { background: #16a34a; }
.toast-error   { background: #dc2626; }
.toast-info    { background: #1e40af; }
.toast-warn    { background: #d97706; }

/* Botões */
.btn-primary {
  background: var(--poplab-blue); color: white;
  padding: 0.5rem 1.25rem; border-radius: 8px; font-weight: 600;
  border: none; cursor: pointer; transition: background 0.15s;
}
.btn-primary:hover { background: #1e3a8a; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: white; color: #374151;
  padding: 0.5rem 1.25rem; border-radius: 8px; font-weight: 500;
  border: 1px solid #d1d5db; cursor: pointer; transition: all 0.15s;
}
.btn-secondary:hover { background: #f9fafb; border-color: #9ca3af; }

.btn-danger {
  background: #dc2626; color: white;
  padding: 0.5rem 1.25rem; border-radius: 8px; font-weight: 600;
  border: none; cursor: pointer;
}
.btn-danger:hover { background: #b91c1c; }

/* Form inputs */
.form-input {
  width: 100%; padding: 0.5rem 0.75rem; border: 1px solid #d1d5db;
  border-radius: 8px; font-size: 0.875rem; transition: border-color 0.15s;
  outline: none;
}
.form-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
.form-label { display: block; font-size: 0.8rem; font-weight: 600; color: #374151; margin-bottom: 0.25rem; }

/* Cards */
.card {
  background: white; border-radius: 12px;
  border: 1px solid #e5e7eb; padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* Tabelas */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: #f8fafc; padding: 0.75rem 1rem;
  font-size: 0.75rem; font-weight: 700; color: #6b7280;
  text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 1px solid #e5e7eb; text-align: left;
}
.data-table td {
  padding: 0.85rem 1rem; font-size: 0.875rem; color: #374151;
  border-bottom: 1px solid #f1f5f9;
}
.data-table tr:hover td { background: #fafbff; }
.data-table tr:last-child td { border-bottom: none; }

/* Página de login */
.login-container {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #0f766e 100%);
}

/* Sidebar nav item */
.nav-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 1rem; border-radius: 8px; cursor: pointer;
  font-size: 0.875rem; font-weight: 500; color: #94a3b8;
  transition: all 0.15s; text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: #e2e8f0; }
.nav-item.active { background: rgba(59,130,246,0.2); color: #93c5fd; }
.nav-item i { width: 18px; text-align: center; }

/* Status pills */
.pill {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.65rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600;
}
.pill-green  { background: #dcfce7; color: #166534; }
.pill-blue   { background: #dbeafe; color: #1e40af; }
.pill-yellow { background: #fef9c3; color: #854d0e; }
.pill-red    { background: #fee2e2; color: #991b1b; }
.pill-purple { background: #ede9fe; color: #5b21b6; }
.pill-gray   { background: #f1f5f9; color: #475569; }

/* Responsive */
@media (max-width: 768px) {
  #sidebar { transform: translateX(-100%); position: fixed; z-index: 40; height: 100vh; }
  #sidebar.open { transform: translateX(0); }
  #main-content { margin-left: 0 !important; }
}

/* Print */
@media print {
  #sidebar, #topbar { display: none !important; }
  #main-content { margin: 0 !important; padding: 1rem !important; }
}

/* ── DASHBOARD — KPI Cards (estilo VIDA) ─────────────── */
.dash-kpi-card {
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.dash-kpi-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.75;
}
.dash-kpi-value {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
}
.dash-kpi-sub {
  font-size: 0.7rem;
  opacity: 0.65;
  margin-top: 0.15rem;
}
.dash-kpi-blue   { background: #dbeafe; color: #1e40af; }
.dash-kpi-purple { background: #ede9fe; color: #5b21b6; }
.dash-kpi-green  { background: #dcfce7; color: #166534; }
.dash-kpi-amber  { background: #fef3c7; color: #92400e; }

/* ── DASHBOARD — Botões Acesso Rápido ────────────────── */
.dash-quick-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: filter 0.15s;
  color: white;
  width: 100%;
}
.dash-quick-btn:hover { filter: brightness(0.9); }
.dash-quick-btn i { width: 18px; text-align: center; flex-shrink: 0; }
.dash-quick-blue   { background: #1e40af; }
.dash-quick-purple { background: #7c3aed; }
.dash-quick-green  { background: #16a34a; }
.dash-quick-amber  { background: #d97706; }
.dash-quick-red    { background: #dc2626; }

/* Badge contador dentro dos botões */
.dash-badge {
  margin-left: auto;
  background: rgba(255,255,255,0.25);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 22px;
  text-align: center;
  flex-shrink: 0;
}

/* ── DASHBOARD — Alertas ──────────────────────────────── */
.dash-alerta {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  font-weight: 500;
}
.dash-alerta i { font-size: 1.1rem; margin-top: 0.1rem; flex-shrink: 0; }
.dash-alerta-blue   { background: #dbeafe; color: #1e40af; }
.dash-alerta-amber  { background: #fef3c7; color: #92400e; }
.dash-alerta-red    { background: #fee2e2; color: #991b1b; }
.dash-alerta-green  { background: #dcfce7; color: #166534; }
