/* ===== Estrutura geral refinada ===== */
.ficha-paciente-refinada {
  font-family: Arial, sans-serif;
  padding: 20px;
  background: #fefefe;
  box-shadow: 0 0 10px rgba(0,0,0,0.08);
  border-radius: 10px;
  max-width: 1200px;
  margin: 30px auto;
}

/* ===== Cabeçalho ===== */
.cabecalho-ficha {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.foto-paciente img {
  max-width: 0px;
  border-radius: 0px;
  object-fit: cover;
}

.dados-basicos {
  flex: 1;
  margin-left: 20px;
}

.paciente-nome {
  white-space: normal;
  word-break: break-word;
  max-width: 100%;
  font-size: 1.5rem;
  margin: 0 0 10px;
  font-weight: bold;
}

/* ===== Botões ===== */
.acoes-header a,
.acoes-header button {
  font-size: 0.95rem;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  margin-right: 8px;
}

.btn-editar {
  background: #0d6efd;
  color: white;
}

.btn-apagar {
  background: #dc3545;
  color: white;
}

.btn-imprimir {
  background: #198754;
  color: white;
  border: none;
  cursor: pointer;
}

.btn-imprimir:hover {
  background: #157347;
}

/* ===== Abas ===== */
.abas-navegacao {
  list-style: none;
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding: 0;
}

.abas-navegacao li {
  background: #eee;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
}

.abas-navegacao li.ativa {
  background: #007BFF;
  color: white;
}

.conteudo-abas .aba {
  display: none;
  margin-top: 20px;
}

.conteudo-abas .aba.ativa {
  display: block;
}

/* ===== Grupos (fieldsets) ===== */
.field-group-details {
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  transition: box-shadow 0.3s;
}

.field-group-details:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.field-group-details summary {
  font-weight: bold;
  font-size: 1.05rem;
  color: #004080;
}

/* ===== Campos individuais ===== */
.field {
  background: #3389e5;
  border: 1px solid #494545;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 10px;
}

.field__label {
  font-weight: bold;
  font-size: 0.95rem;
  color: #333;
  display: block;
  margin-bottom: 4px;
}

/* ===== Imagens ===== */
.field img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 5px auto;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* ===== Galeria (radiografias e fotos clínicas) ===== */
.field-group-details .field {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.field-group-details .field img {
  max-width: 160px;
  flex: 1 1 150px;
}

/* Remove fundo branco das caixas principais */
.field-group-details,
.field,
.ficha-paciente-refinada,
.ficha-hoh-wrapper,
.node__content {
  background: transparent !important;
  box-shadow: none !important;
}

/* Estilo do botão Emitir NFS-e */
.botao-nfse {
  background: #34495e;
  color: white;
  font-size: 0.95rem;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  display: inline-block;
  transition: background 0.3s;
}

.botao-nfse:hover {
  background: #2c3e50;
}


body {
  font-family: 'Segoe UI', sans-serif;
  background: #f7f7f7;
  margin: 0;
}

h1, h2 {
  color: #333;
}

section {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
}

section:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

section h2 {
  margin-top: 0;
  font-size: 1.4rem;
}

.cabecalho-paciente h1 {
  margin: 0 0 10px 0;
}

.cabecalho-paciente .botoes-acoes a {
  display: inline-block;
  background: #4caf50;
  color: white;
  padding: 8px 14px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.3s;
}

.cabecalho-paciente .botoes-acoes a:hover {
  background: #388e3c;
}

.foto-paciente img {
  border-radius: 0px;
  max-width: 160px;
  height: auto;
}

.menu-abas-admin a {
  display: inline-block;
  background: #e0e0e0;
  color: #333;
  padding: 6px 12px;
  margin: 5px 5px 0 0;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.3s;
}

.menu-abas-admin a:hover {
  background: #cccccc;
}

.botao-imprimir {
  background: #4caf50;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
}

.botao-imprimir:hover {
  background: #388e3c;
}

/* Foto do paciente flutuando à esquerda */
.page-node-type-paciente .foto-paciente img {
  width: 200px;
  height: auto;
  float: right;
  margin: 0px 50px 20px 20px;
  border-radius: 0px;
  border: 0px solid white;
  box-shadow: 0 0px 0px rgba(0, 0, 0, 0);
  transition: transform 0s ease, box-shadow 0s ease;
  transform: scale(1.03);
}

.page-node-type-paciente .foto-paciente img:hover {
  transform: scale(1.00);
  box-shadow: 0 2px 85px rgba(0, 0, 0, 0.1);
  border-color: #ccc;
}

.page-node-type-paciente .foto-paciente {
  margin-top: 0;
  margin-bottom: 0;
}


body.path-node.type-paciente .contextual-region,
body.path-node.type-paciente .region-sidebar-first {
  display: none !important;
}

.btn-voltar-kiosk {
  margin: 40px auto 20px;
  background-color: #f1f1f1;
  border: 1px solid #ccc;
  padding: 10px 20px;
  font-size: 15px;
  border-radius: 6px;
  color: #333;
  cursor: pointer;
  display: block;
  transition: background 0.2s ease;
}

.btn-voltar-kiosk:hover {
  background-color: #e9e9e9;
}

/* Some o bloco "Status / Configurações do menu / Informações da revisão"
   na edição dos nodes */
form.node-form .form-item.js-form-type-vertical-tabs.form-item-js-form-item-form-no-label {
  display: none !important;
}


/* Esconde menus/atalhos quando NÃO está logado */
body.user-anonymous #abrirMenuAgenda,
body.user-anonymous #menuLateralAgenda,
body.user-anonymous .wd-prime-topicons {
  display: none !important;
}

.wd-html-form__intro {
  margin: 0 0 16px;
  color: #536274;
  font-size: 14px;
}

.wd-html-form {
  display: grid;
  gap: 14px;
}

.wd-html-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  padding: 16px;
  border: 1px solid #d9e0e7;
  border-radius: 14px;
  background: #fff;
}

.wd-html-row__heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #0b2748;
}

.wd-html-row__heading span {
  padding: 3px 9px;
  border-radius: 999px;
  background: #f7f1df;
  color: #806019;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.wd-html-row__fields {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(200px, .6fr) minmax(340px, 1.4fr);
  gap: 12px;
}

.wd-html-row__fields .form-item {
  margin: 0;
}

.wd-html-row__fields input {
  width: 100%;
}

.wd-html-row__open,
.wd-html-row__remove,
.wd-html-form__add,
.wd-html-form__save {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 9px 15px !important;
  border-radius: 999px !important;
  text-decoration: none !important;
  font-weight: 700;
  line-height: 1.2;
}

.wd-html-row__open,
.wd-html-form__add {
  border: 1px solid #c99a2e !important;
  background: #fff !important;
  color: #0b2748 !important;
}

.wd-html-row__remove {
  border: 1px solid #e2c3c3 !important;
  background: #fff !important;
  color: #9d2f2f !important;
}

.wd-html-form__save {
  border: 1px solid #0b2748 !important;
  background: #0b2748 !important;
  color: #fff !important;
}

.wd-html-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 !important;
}

@media (max-width: 820px) {
  .wd-html-row {
    grid-template-columns: 1fr 1fr;
  }

  .wd-html-row__fields {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
  }
}


/* WebDent: precedência sobre os botões globais do tema. */
#html-files-main .wd-html-form input.wd-html-form__add,
#html-files-main .wd-html-form a.wd-html-row__open {
  background: #fff !important;
  border: 1px solid #c99a2e !important;
  border-radius: 999px !important;
  color: #0b2748 !important;
}

#html-files-main .wd-html-form input.wd-html-row__remove {
  background: #fff !important;
  border: 1px solid #e2c3c3 !important;
  border-radius: 999px !important;
  color: #9d2f2f !important;
}

#html-files-main .wd-html-form input.wd-html-form__save {
  background: #0b2748 !important;
  border: 1px solid #0b2748 !important;
  border-radius: 999px !important;
  color: #fff !important;
}


body.wd-neutral-theme.page-node-type-paciente #content .wd-paciente-wrap #html-files-main input.wd-html-form__add {
  background: #fff !important;
  border: 1px solid #c99a2e !important;
  border-radius: 999px !important;
  color: #0b2748 !important;
}

body.wd-neutral-theme.page-node-type-paciente #content .wd-paciente-wrap #html-files-main input.wd-html-row__remove {
  background: #fff !important;
  border: 1px solid #e2c3c3 !important;
  border-radius: 999px !important;
  color: #9d2f2f !important;
}

body.wd-neutral-theme.page-node-type-paciente #content .wd-paciente-wrap #html-files-main input.wd-html-form__save {
  background: #0b2748 !important;
  border: 1px solid #0b2748 !important;
  border-radius: 999px !important;
  color: #fff !important;
}


body.wd-neutral-theme.page-node-type-paciente #content .wd-paciente-wrap #html-viewer-main button.wd-html-doc-button {
  background: #fff !important;
  border: 1px solid #c99a2e !important;
  border-radius: 999px !important;
  color: #0b2748 !important;
}

body.wd-neutral-theme.page-node-type-paciente #content .wd-paciente-wrap #html-viewer-main button.wd-html-doc-button.is-active {
  background: #0b2748 !important;
  border-color: #0b2748 !important;
  color: #fff !important;
}


/* Edição do paciente: visual LifeDent mais leve e atalhos discretos. */
body.wd-neutral-theme.page-node-type-paciente.path-node {
  --wd-primary: #0b2748;
  --wd-primary-600: #081d36;
  --wd-primary-700: #061426;
  --wd-accent: #c99a2e;
  --wd-glass-bg: rgba(255,255,255,.96);
  --wd-glass-border: rgba(11,39,72,.12);
}

body.wd-neutral-theme.page-node-type-paciente.path-node #pacienteMenuBtn {
  display: none !important;
}

body.wd-neutral-theme.page-node-type-paciente.path-node #wd-edbar {
  top: 72px !important;
  gap: 8px !important;
  margin: 12px auto 18px !important;
  padding: 9px !important;
  background: rgba(255,255,255,.96) !important;
  border: 1px solid #d8e0e8 !important;
  border-bottom: 3px solid #c99a2e !important;
  border-radius: 16px !important;
  box-shadow: 0 10px 28px rgba(11,39,72,.08) !important;
}

body.wd-neutral-theme.page-node-type-paciente.path-node #wd-edbar .pill {
  min-height: 38px !important;
  padding: 7px 11px !important;
  gap: 7px !important;
  background: #fff !important;
  color: #0b2748 !important;
  border: 1px solid #d8e0e8 !important;
  box-shadow: none !important;
}

body.wd-neutral-theme.page-node-type-paciente.path-node #wd-edbar .pill .ico {
  width: 20px !important;
  height: 20px !important;
  background: #f7f1df !important;
  color: #806019 !important;
  box-shadow: none !important;
}

body.wd-neutral-theme.page-node-type-paciente.path-node #wd-edbar .pill:hover,
body.wd-neutral-theme.page-node-type-paciente.path-node #wd-edbar .pill.active {
  background: #0b2748 !important;
  color: #fff !important;
  border-color: #0b2748 !important;
  transform: none !important;
}

body.wd-neutral-theme.page-node-type-paciente.path-node #wd-edbar .pill:hover .ico,
body.wd-neutral-theme.page-node-type-paciente.path-node #wd-edbar .pill.active .ico {
  background: #c99a2e !important;
  color: #0b2748 !important;
}

body.wd-neutral-theme.page-node-type-paciente.path-node #wd-quickbar {
  right: 18px !important;
  top: 88px !important;
  width: min(330px, calc(100vw - 36px)) !important;
  background: #0b2748 !important;
  border: 1px solid rgba(201,154,46,.7) !important;
  box-shadow: 0 18px 48px rgba(6,20,38,.28) !important;
}

body.wd-neutral-theme.page-node-type-paciente.path-node #wd-quickbar .hd,
body.wd-neutral-theme.page-node-type-paciente.path-node #wd-quickbar .ft {
  background: #0b2748 !important;
}

body.wd-neutral-theme.page-node-type-paciente.path-node #wd-quickbar .item {
  background: rgba(255,255,255,.09) !important;
  border: 1px solid rgba(255,255,255,.08);
}

body.wd-neutral-theme.page-node-type-paciente.path-node #wd-quickbar .item:hover {
  background: rgba(201,154,46,.2) !important;
}

body.wd-neutral-theme.page-node-type-paciente.path-node #wdq-toggle {
  right: 18px !important;
  top: 88px !important;
  width: 42px !important;
  height: 42px !important;
  padding: 0 !important;
  background: #fff !important;
  color: #0b2748 !important;
  border: 1px solid #c99a2e !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 22px rgba(11,39,72,.15) !important;
  font-size: 20px !important;
}

body.wd-neutral-theme.page-node-type-paciente.path-node .wd-fab-save {
  background: #0b2748 !important;
  color: #fff !important;
  border: 1px solid #c99a2e !important;
  border-radius: 999px !important;
  box-shadow: 0 8px 22px rgba(11,39,72,.18) !important;
}

body.wd-neutral-theme.page-node-type-paciente.path-node #content form.node-paciente-edit-form {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}

body.wd-neutral-theme.page-node-type-paciente.path-node #content form.node-paciente-edit-form > fieldset.field-group-fieldset {
  overflow: hidden;
  margin: 14px 0 !important;
  background: #fff !important;
  border: 1px solid #d8e0e8 !important;
  border-radius: 14px !important;
  box-shadow: 0 8px 24px rgba(11,39,72,.06) !important;
}

body.wd-neutral-theme.page-node-type-paciente.path-node #content form.node-paciente-edit-form > fieldset.field-group-fieldset > legend {
  width: 100% !important;
  margin: 0 !important;
  padding: 12px 16px !important;
  background: #fff !important;
  color: #0b2748 !important;
  border: 0 !important;
  border-bottom: 2px solid #c99a2e !important;
}

body.wd-neutral-theme.page-node-type-paciente.path-node #content form.node-paciente-edit-form > fieldset.field-group-fieldset > .fieldset__wrapper {
  padding: 16px 18px 18px !important;
}

body.wd-neutral-theme.page-node-type-paciente.path-node #content form.node-paciente-edit-form #edit-actions {
  display: flex !important;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 0 6px !important;
}

body.wd-neutral-theme.page-node-type-paciente.path-node #content form.node-paciente-edit-form #edit-submit {
  background: #0b2748 !important;
  color: #fff !important;
  border: 1px solid #0b2748 !important;
  border-radius: 999px !important;
}

body.wd-neutral-theme.page-node-type-paciente.path-node #content form.node-paciente-edit-form #edit-submit-view {
  background: #fff !important;
  color: #0b2748 !important;
  border: 1px solid #c99a2e !important;
  border-radius: 999px !important;
}

body.wd-neutral-theme.page-node-type-paciente.path-node #content form.node-paciente-edit-form #edit-delete {
  background: #fff !important;
  color: #9d2f2f !important;
  border: 1px solid #e2c3c3 !important;
  border-radius: 999px !important;
}

/* Mantém os títulos das seções legíveis no formulário de edição. */
body.wd-neutral-theme.page-node-type-paciente.path-node #content form.node-paciente-edit-form > fieldset.field-group-fieldset > legend .fieldset__label {
  display: block !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  background: transparent !important;
  color: #0b2748 !important;
  font-size: 15px !important;
  font-weight: 750 !important;
  line-height: 1.35 !important;
  opacity: 1 !important;
  visibility: visible !important;
  text-indent: 0 !important;
}

/* Formulário do paciente: remove os antigos botões azul-vivo. */
body.wd-neutral-theme.page-node-type-paciente.path-node #content form.node-paciente-edit-form input.form-submit:not(#edit-submit):not(#edit-submit-view):not(#edit-delete),
body.wd-neutral-theme.page-node-type-paciente.path-node #content form.node-paciente-edit-form button.form-submit:not(#edit-submit):not(#edit-submit-view):not(#edit-delete) {
  min-height: 40px !important;
  padding: 8px 14px !important;
  background: #fff !important;
  color: #0b2748 !important;
  border: 1px solid #c99a2e !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  font-weight: 700 !important;
}

body.wd-neutral-theme.page-node-type-paciente.path-node #content form.node-paciente-edit-form input.form-submit:not(#edit-submit):not(#edit-submit-view):not(#edit-delete):hover,
body.wd-neutral-theme.page-node-type-paciente.path-node #content form.node-paciente-edit-form button.form-submit:not(#edit-submit):not(#edit-submit-view):not(#edit-delete):hover {
  background: #f7f1df !important;
  color: #0b2748 !important;
}

body.wd-neutral-theme.page-node-type-paciente.path-node #content form.node-paciente-edit-form input[id$="-remove-button"],
body.wd-neutral-theme.page-node-type-paciente.path-node #content form.node-paciente-edit-form input[id$="-actions-delete"],
body.wd-neutral-theme.page-node-type-paciente.path-node #content form.node-paciente-edit-form button[id$="-remove-button"],
body.wd-neutral-theme.page-node-type-paciente.path-node #content form.node-paciente-edit-form button[id$="-actions-delete"] {
  background: #fff !important;
  color: #9d2f2f !important;
  border-color: #e2bcbc !important;
}

body.wd-neutral-theme.page-node-type-paciente.path-node #content form.node-paciente-edit-form input[id$="-remove-button"]:hover,
body.wd-neutral-theme.page-node-type-paciente.path-node #content form.node-paciente-edit-form input[id$="-actions-delete"]:hover,
body.wd-neutral-theme.page-node-type-paciente.path-node #content form.node-paciente-edit-form button[id$="-remove-button"]:hover,
body.wd-neutral-theme.page-node-type-paciente.path-node #content form.node-paciente-edit-form button[id$="-actions-delete"]:hover {
  background: #fff4f4 !important;
  color: #842626 !important;
}
