/* ============================================================
   COMPONENTES GLOBAIS – PRONTIO
   Reaproveitados em vários módulos (index, pacientes, prontuário, evolução…)
   ============================================================ */

/* ------------------------------
   Tipografia básica de página
------------------------------ */

.page-title {
  margin: 0 0 0.15rem;
  font-size: 1.4rem;
  font-weight: 600;
}

.page-subtitle {
  margin: 0 0 1.4rem;
  font-size: 0.9rem;
  color: #6b7280;
}

/* ------------------------------
   Botões padrão
------------------------------ */

button {
  font-family: inherit;
}

/* botão principal azul */
.btn-primario {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1rem;
  font-size: 0.86rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: 0.15s ease;
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}
.btn-primario:hover {
  background: #1e4fd7;
}

/* botão principal outlined */
.btn-primario-outlined {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1rem;
  font-size: 0.86rem;
  border-radius: 8px;
  border: 1px solid #2563eb;
  cursor: pointer;
  transition: 0.15s ease;
  background: #ffffff;
  color: #2563eb;
}
.btn-primario-outlined:hover {
  background: rgba(37, 99, 235, 0.08);
}

/* botão neutro/terciário */
.btn-terciario {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1rem;
  font-size: 0.86rem;
  border-radius: 8px;
  border: 1px solid #d4d7da;
  cursor: pointer;
  transition: 0.15s ease;
  background: #ffffff;
  color: #555;
}
.btn-terciario:hover {
  background: #f2f3f5;
}

/* botão cinza dentro de cards/tabelas */
.btn-tabela {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  border-radius: 8px;
  border: 1px solid #dfe2e5;
  cursor: pointer;
  transition: 0.15s ease;
  background: #f1f3f4;
  color: #333;
}
.btn-tabela:hover {
  background: #e7eaed;
}

/* ------------------------------
   Avatar / usuário no topo
------------------------------ */

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e0ebff;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  margin-left: 0.6rem;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-user-name {
  font-size: 0.85rem;
  color: #374151;
}

/* ------------------------------
   Tags / Pills (planos, status)
------------------------------ */

.tag-pill {
  padding: 0.2rem 0.6rem;
  border-radius: 30px;
  font-size: 0.75rem;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.tag-plano {
  background: #eef2ff;
  color: #4338ca;
  border-color: #c7d2fe;
}
.tag-ativo {
  background: #e5f7ef;
  color: #166534;
  border-color: #b0ebce;
}
.tag-inativo {
  background: #fdeaea;
  color: #b91c1c;
  border-color: #f7c2c2;
}

/* pontinho separador (•) */
.dot {
  margin: 0 0.3rem;
}

/* ------------------------------
   Status / mensagens
------------------------------ */

.mensagem-status {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  border-radius: 8px;
  border: 1px solid #dfe2e5;
  background: #f9fafb;
  padding: 0.5rem 0.8rem;
  color: #6b7280;
}

/* ------------------------------
   Grids auxiliares
------------------------------ */

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.8rem;
}

/* ------------------------------
   Chips (evolução, atalhos de texto)
------------------------------ */

.chip-button {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #f3f4f6;
  color: #374151;
  padding: 0.2rem 0.75rem;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease,
    transform 0.06s ease;
}
.chip-button:hover {
  background: #e5e7eb;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

/* ------------------------------
   Histórico (evolução, prontuário)
------------------------------ */

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.history-list-empty {
  color: #6b7280;
  font-size: 0.85rem;
}

.history-item {
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  padding: 0.55rem 0.7rem;
  background: #ffffff;
  box-shadow:
    0 1px 2px rgba(0,0,0,0.04),
    0 4px 6px rgba(0,0,0,0.04);
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #4b5563;
  margin-bottom: 0.25rem;
}

.history-item-header strong {
  font-size: 0.85rem;
  color: #111827;
}

.history-item-body {
  font-size: 0.85rem;
  color: #374151;
  white-space: pre-line;
}

/* ------------------------------
   Card genérico (se quiser usar)
------------------------------ */

.card {
  background: #ffffff;
  border-radius: 14px;
  padding: 1.4rem 1.6rem 1.6rem;
  border: 1px solid #e1e4e8;
  box-shadow:
    0 2px 4px rgba(0,0,0,0.04),
    0 8px 18px rgba(0,0,0,0.06);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.card-header-left h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.card-header-left small {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: #6b7280;
}

/* ------------------------------
   Select simples (evolução, filtros)
------------------------------ */

.select-simple {
  min-height: 32px;
  padding: 0.3rem 0.75rem;
  font-size: 0.85rem;
  border-radius: 8px;
  border: 1px solid #d3d6da;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
}
.select-simple:hover {
  border-color: #b8bcc1;
}
.select-simple:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ------------------------------
   Busca (topbar com ícone)
------------------------------ */

.search-box {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.75rem;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  transition: 0.15s ease;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.9rem;
  padding: 0.35rem 0;
}

.search-box:focus-within {
  background: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-icon {
  font-size: 0.9rem;
}

/* ------------------------------
   Timeline base (prontuário)
------------------------------ */

.timeline {
  position: relative;
  margin-left: 0.5rem;
  padding-left: 1.5rem;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0.2rem;
  bottom: 0.2rem;
  left: 0.5rem;
  width: 2px;
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.12),
    rgba(15, 23, 42, 0.04)
  );
}

.timeline-item {
  position: relative;
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.timeline-marker {
  position: absolute;
  left: -0.1rem;
  top: 0.75rem;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #0f766e;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.timeline-content {
  margin-left: 1rem;
  background: #ffffff;
  border-radius: 10px;
  padding: 0.7rem 0.85rem 0.8rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  width: 100%;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.3rem;
}

.timeline-type {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

/* badges por tipo (reutilizadas em prontuário e futuro) */
.badge-evolucao {
  background: #ecfdf3;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.badge-receita {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}
.badge-exame {
  background: #fefce8;
  color: #854d0e;
  border: 1px solid #fef3c7;
}
.badge-laudo {
  background: #f3e8ff;
  color: #6b21a8;
  border: 1px solid #e9d5ff;
}
.badge-atestado {
  background: #ecfeff;
  color: #155e75;
  border: 1px solid #a5f3fc;
}
.badge-comparecimento {
  background: #fdf2f8;
  color: #9d174d;
  border: 1px solid #f9a8d4;
}
.badge-encaminhamento {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.timeline-date {
  font-size: 0.75rem;
  color: #6b7280;
  white-space: nowrap;
}

.timeline-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.25rem;
}

.timeline-text {
  font-size: 0.85rem;
  color: #4b5563;
  white-space: pre-line;
}
