:root {
  --fundo: #f5f6f8;
  --cartao: #ffffff;
  --borda: #d9dce1;
  --texto: #1c1f23;
  --suave: #6b7280;
  --acento: #0b6bcb;
  --erro: #b42318;
  --ok: #067647;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 24px 16px;
  background: var(--fundo);
  color: var(--texto);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

main { max-width: 720px; margin: 0 auto; }

.topo-app { display: flex; justify-content: flex-end; margin-bottom: 12px; }

h1 { font-size: 20px; margin: 0 0 16px; }

.cartao {
  background: var(--cartao);
  border: 1px solid var(--borda);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}

label { display: block; font-weight: 600; margin: 12px 0 4px; }

input[type="text"], input[type="password"], select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--borda);
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
}

.busca-paciente { display: flex; gap: 8px; align-items: stretch; }
.busca-paciente input { flex: 1; }
.busca-paciente button { white-space: nowrap; }

.sugestoes {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  border: 1px solid var(--borda);
  border-radius: 8px;
  overflow: hidden;
}

.sugestoes li {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--borda);
}

.sugestoes li:last-child { border-bottom: 0; }
.sugestoes li:hover { background: var(--fundo); }
.sugestoes li .nome { font-weight: 600; display: block; }
.sugestoes li .consulta { color: var(--suave); font-size: 13px; }

button {
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--acento);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

button:disabled { opacity: 0.5; cursor: not-allowed; }

button.secundario { background: transparent; color: var(--acento); border: 1px solid var(--borda); }

.opcoes { display: grid; gap: 8px; margin-top: 12px; }

.opcao {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--borda);
  border-radius: 8px;
  cursor: pointer;
}

.opcao[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }

.opcao.escolhida { border-color: var(--acento); box-shadow: 0 0 0 2px rgba(11, 107, 203, 0.15); }

.opcao .parcela { font-weight: 600; }

.opcao .total { color: var(--suave); font-size: 13px; }

textarea {
  width: 100%;
  min-height: 120px;
  padding: 10px 12px;
  border: 1px solid var(--borda);
  border-radius: 8px;
  font: 14px/1.5 system-ui, sans-serif;
  resize: vertical;
}

.erro { color: var(--erro); font-weight: 600; }
.sucesso { color: var(--ok); font-weight: 600; }
.suave { color: var(--suave); font-size: 13px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--borda); }
th { color: var(--suave); font-weight: 600; }

.oculto { display: none; }
