*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
       font-size: 16px; line-height: 1.5; color: #1f2933; background: #f1f3f5; }
a { color: #1a5fb4; }
h1 { font-size: 1.4rem; margin: 0 0 .8rem; }
h2 { font-size: 1.1rem; margin: 1.6rem 0 .6rem; }

/* ---------- página do paciente ---------- */
.publico { padding: 16px; }
.cartao { max-width: 520px; margin: 0 auto; background: #fff; border-radius: 10px; padding: 24px 20px;
          border-top: 6px solid #1a73e8; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.marca { text-align: center; margin-bottom: 12px; }
.marca img { max-height: 80px; max-width: 100%; }
.nome-clinica { font-size: 1.2rem; font-weight: 700; margin: 0; }
.texto { white-space: pre-line; overflow-wrap: anywhere; }
.pequeno { font-size: .9rem; color: #52606d; }
.dados { margin: 16px 0; padding: 0; border: 1px solid #d9dee3; border-radius: 8px; }
.dados div { display: flex; gap: 12px; padding: 10px 14px; border-bottom: 1px solid #e6e9ec; }
.dados div:last-child { border-bottom: 0; }
.dados dt { flex: 0 0 84px; color: #52606d; }
.dados dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.acoes { margin: 12px 0; }
.botao { display: block; width: 100%; padding: 15px 18px; border: 0; border-radius: 8px; font-size: 1.05rem;
         font-weight: 700; text-align: center; text-decoration: none; cursor: pointer; font-family: inherit; }
.botao.primario { background: #1a73e8; color: #fff; }
.botao.secundario { background: #fff; color: #323f4b; border: 2px solid #9aa5b1; }
.botao.perigo { background: #b3261e; color: #fff; }
.botao:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, button:focus-visible { outline: 3px solid #f5a623; outline-offset: 2px; }
.aviso { padding: 12px 14px; border-radius: 8px; margin: 12px 0; white-space: pre-line; }
.aviso.sucesso { background: #e3f6e8; color: #14532d; }
.aviso.erro { background: #fde8e7; color: #7f1d1d; }
.aviso.neutro { background: #eef1f4; color: #323f4b; }
.publico footer { margin-top: 24px; padding-top: 12px; border-top: 1px solid #e6e9ec; font-size: .85rem;
                  color: #52606d; text-align: center; }
.publico footer p { margin: 4px 0; }

/* ---------- painéis ---------- */
.painel header.topo { background: #1f2933; color: #fff; padding: 10px 16px; display: flex; flex-wrap: wrap;
                      gap: 8px 18px; align-items: center; }
.painel header.topo a { color: #fff; text-decoration: none; }
.painel header.topo a:hover { text-decoration: underline; }
.painel header.topo .titulo { font-weight: 700; margin-right: auto; }
.painel header.topo form { margin: 0; }
.painel header.topo button { background: none; border: 1px solid #9aa5b1; color: #fff; border-radius: 6px;
                             padding: 4px 10px; cursor: pointer; font: inherit; }
.painel main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 48px; }
.painel main.estreito { max-width: 440px; }
.caixa { background: #fff; border-radius: 8px; padding: 16px; margin: 0 0 16px;
         box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.rolagem { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 7px 9px; border-bottom: 1px solid #e6e9ec; vertical-align: top; }
th { background: #f5f7fa; white-space: nowrap; }
td.num, th.num { text-align: right; }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
label.linha { font-weight: 400; display: flex; gap: 8px; align-items: center; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=tel],
input[type=url], select, textarea { width: 100%; padding: 9px 10px; border: 1px solid #9aa5b1;
  border-radius: 6px; font: inherit; background: #fff; }
textarea { min-height: 96px; }
.dica { font-size: .85rem; color: #52606d; margin: 4px 0 0; }
.grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 16px; }
.filtros { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 12px;
           align-items: end; }
.btn { display: inline-block; padding: 9px 16px; border: 0; border-radius: 6px; background: #1a5fb4;
       color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; margin-top: 14px; }
.btn.claro { background: #fff; color: #1f2933; border: 1px solid #9aa5b1; }
.btn.perigo { background: #b3261e; }
.btn.pequeno { padding: 4px 10px; margin: 0; font-size: .88rem; font-weight: 400; }
.em-linha { display: inline; }
.segredo { font-family: ui-monospace, Consolas, monospace; background: #fff8e1; border: 1px solid #f5c542;
           padding: 10px; border-radius: 6px; overflow-wrap: anywhere; user-select: all; }
.etiqueta { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: .82rem; background: #eef1f4; }
.etiqueta.confirmado, .etiqueta.enviado, .etiqueta.ok, .etiqueta.ativo { background: #e3f6e8; color: #14532d; }
.etiqueta.cancelado, .etiqueta.erro, .etiqueta.inativo { background: #fde8e7; color: #7f1d1d; }
.paginacao { margin-top: 12px; display: flex; gap: 12px; align-items: center; }
