:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1f2933;
  --muted: #5b6877;
  --navy: #1f3a5f;
  --navy-hover: #2c5282;
  --success: #2f855a;
  --success-bg: #e6f4ea;
  --danger: #c53030;
  --danger-bg: #fdeaea;
  --warn-bg: #fdf3e2;
  --warn-text: #8a5a00;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
}

/* ---------- Agendamento do paciente (página progressiva) ---------- */
.hero-agendar { text-align: center; padding: 26px 24px 18px; }
.hero-agendar .foto {
  width: 64px; height: 64px; border-radius: 50%; background: #cdd7e1; color: var(--navy);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 22px;
  margin-bottom: 10px;
}
.hero-agendar .ola { font-size: 14px; color: var(--muted); }
.hero-agendar h1 { font-size: 23px; margin: 2px 0; }
.hero-agendar .esp-hero { color: var(--muted); font-size: 15px; }
.hero-agendar p.intro { color: var(--muted); margin: 12px 0 0; font-size: 14px; }

.passo { margin-bottom: 4px; }
.passo-divisor { border-top: 1px solid var(--border); margin-top: 22px; padding-top: 20px; }
.passo-titulo { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.passo-num {
  width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; flex: none;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
}
.passo-titulo h2 { font-size: 17px; margin: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  padding: 10px 16px; border: 1px solid var(--border); border-radius: 8px; background: #fff;
  font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; font-family: var(--font);
}
.chip:hover { border-color: var(--navy-hover); }
.chip:focus-visible { outline: 2px solid var(--navy-hover); outline-offset: 2px; }
.chip.selecionada { border-color: var(--navy); background: #eef3f9; color: var(--navy); }
.chip-modalidade { flex: 1; min-width: 140px; text-align: center; padding: 14px; }
.resumo-box {
  background: #eef3f9; border: 1px solid #d6e0ec; border-radius: 8px; padding: 12px 14px;
  font-size: 14px; margin-bottom: 16px;
}

/* ---------- Busca de pacientes (vincular) ---------- */
.busca-lista { margin-top: 12px; max-height: 280px; overflow-y: auto; }
.busca-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px;
  cursor: pointer; background: #fff;
}
.busca-item:hover { border-color: var(--navy); background: #eef3f9; }
.busca-item .b-nome { font-weight: 600; }
.busca-item .b-meta { font-size: 13px; color: var(--muted); }
.valor-input {
  width: 110px; padding: 6px 8px; font-size: 14px; font-family: var(--font);
  border: 1px solid var(--border); border-radius: 6px;
}
.ficha-linha { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.ficha-linha .rotulo { color: var(--muted); min-width: 150px; }

/* Nome do paciente clicável + botão de ícone (corrigir vínculo) */
.link-paciente { color: var(--navy); font-weight: 600; cursor: pointer; text-decoration: none; }
.link-paciente:hover { text-decoration: underline; }
.btn-icone {
  border: 1px solid var(--border); background: #fff; border-radius: 6px; padding: 4px 6px;
  cursor: pointer; color: var(--muted); vertical-align: middle; margin-left: 6px; line-height: 0;
}
.btn-icone:hover { border-color: var(--navy); color: var(--navy); }

/* ---------- Abas ---------- */
/* ---------- Layout: sidebar fixa, full-height (padrão) ---------- */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 240px; z-index: 100;
  background: var(--navy); color: #fff;
  display: flex; flex-direction: column; padding: 18px 14px;
}
.sidebar-marca { font-size: 18px; font-weight: 700; letter-spacing: .3px; padding: 4px 10px 16px; }
.sidebar-marca small { display: block; font-size: 11px; font-weight: 400; opacity: .65; margin-top: 2px; }
.conteudo-painel { margin-left: 240px; padding: 28px 32px; max-width: 1180px; }

.abas { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }
.aba {
  display: block; width: 100%; text-align: left;
  padding: 11px 14px; font-size: 14px; font-weight: 600;
  color: rgba(255,255,255,.78); background: none; border: none; border-radius: 8px;
  cursor: pointer; white-space: nowrap;
}
.aba:hover:not(:disabled):not(.ativa) { background: rgba(255,255,255,.10); color: #fff; }
.aba.ativa { background: rgba(255,255,255,.18); color: #fff; }
.aba:disabled { color: rgba(255,255,255,.35); cursor: default; }
.aba .em-breve {
  font-size: 10px; font-weight: 600; background: rgba(255,255,255,.18); color: #fff;
  padding: 1px 6px; border-radius: 999px; margin-left: 6px; text-transform: uppercase;
}
.sidebar-rodape { border-top: 1px solid rgba(255,255,255,.15); padding-top: 12px; margin-top: 8px; }
.sidebar-rodape .medico-info { color: #fff; }
.sidebar-rodape .medico-info .foto { background-color: rgba(255,255,255,.2); color: #fff; }

/* ---------- Menu mobile (botão hambúrguer + overlay) ---------- */
.menu-toggle { display: none; }
.menu-overlay { display: none; }

/* ---------- Filtros das listas de consulta (padrão) ---------- */
.filtros-consulta {
  display: flex; align-items: flex-end; gap: 10px; margin-bottom: 14px; flex-wrap: wrap;
}
.filtros-consulta .f-busca { flex: 1; min-width: 220px; margin-bottom: 0; }
.filtros-consulta .campo { margin: 0; }
.filtros-consulta .f-export { display: flex; gap: 8px; margin-left: auto; }

/* ---------- Foto do médico no topbar ---------- */
.medico-info { display: flex; align-items: center; gap: 10px; }
.medico-info .foto {
  width: 38px; height: 38px; border-radius: 50%; background: #cdd7e1;
  display: flex; align-items: center; justify-content: center; font-weight: 600; color: var(--navy);
  background-size: cover; background-position: center; flex: 0 0 auto;
}
.medico-info .nome { font-weight: 600; line-height: 1.2; }
.medico-info .esp { font-size: 12px; opacity: .85; }

/* ---------- Checkbox da tabela ---------- */
.col-check { width: 38px; text-align: center; }
table input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--navy);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar .marca { font-weight: 600; letter-spacing: .2px; }
.topbar .marca small { display: block; font-weight: 400; opacity: .8; font-size: 12px; }
.topbar .usuario { font-size: 13px; opacity: .9; margin-right: 12px; }

/* ---------- Layout ---------- */
.container { max-width: 1040px; margin: 0 auto; padding: 24px; }
.center-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.card.estreito { width: 100%; max-width: 400px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; gap: 12px; flex-wrap: wrap;
}
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 0; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 20px; }

/* ---------- Formulário ---------- */
.campo { margin-bottom: 14px; }
.campo label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.campo input, .campo select {
  width: 100%; padding: 9px 11px; font-size: 14px; font-family: var(--font);
  border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--text);
}
.campo input:focus, .campo select:focus {
  outline: 2px solid var(--navy-hover); outline-offset: 0; border-color: var(--navy-hover);
}
/* iOS/Safari: o input de data ignora a largura e fica grande; normalizamos aqui.
   height fixa evita que o campo vazio "encolha" e fique diferente do preenchido. */
input[type="date"] {
  -webkit-appearance: none; appearance: none;
  min-width: 0; box-sizing: border-box;
  height: 38px; line-height: 1.2;
}
.linha { display: flex; gap: 12px; }
.linha .campo { flex: 1; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  padding: 9px 16px; font-size: 14px; font-family: var(--font); font-weight: 600;
  border: 1px solid transparent; border-radius: 6px; cursor: pointer; background: #fff;
}
.btn:focus-visible { outline: 2px solid var(--navy-hover); outline-offset: 2px; }
.btn-primario { background: var(--navy); color: #fff; }
.btn-primario:hover { background: var(--navy-hover); }
.btn-primario:disabled { opacity: .6; cursor: default; }
.btn-secundario { background: #fff; color: var(--text); border-color: var(--border); }
.btn-secundario:hover { background: #f7f9fb; }
.btn-perigo { background: #fff; color: var(--danger); border-color: #e7b9b9; }
.btn-perigo:hover { background: var(--danger-bg); }
.btn-bloco { width: 100%; }
.btn-mini { padding: 5px 10px; font-size: 13px; }

/* ---------- Tabela ---------- */
.tabela-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
thead th {
  background: #f0f3f6; text-align: left; padding: 11px 14px;
  font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
.acoes-col { white-space: nowrap; display: flex; gap: 6px; }

/* ---------- Selo de status ---------- */
.selo { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.selo-ativo { background: var(--success-bg); color: var(--success); }
.selo-inativo { background: var(--danger-bg); color: var(--danger); }
.selo-pendente { background: var(--warn-bg); color: var(--warn-text); }

/* ---------- Mensagens ---------- */
.aviso { padding: 11px 14px; border-radius: 6px; font-size: 14px; margin-bottom: 14px; }
.aviso-erro { background: var(--danger-bg); color: var(--danger); }
.aviso-ok { background: var(--success-bg); color: var(--success); }
.aviso-neutro { background: #eef2f6; color: var(--text); }
.aviso ul { margin: 6px 0 0; padding-left: 18px; }
.escondido { display: none !important; }

/* ---------- Modal ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: 200;
  display: flex; align-items: flex-start; justify-content: center; padding: 32px 16px; overflow-y: auto;
}
.modal { background: #fff; border-radius: var(--radius); width: 100%; max-width: 540px; box-shadow: 0 10px 40px rgba(16,24,40,.2); }
.modal-head { padding: 18px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 24px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.x-fechar { background: none; border: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); }

/* ---------- Caixa de link copiável ---------- */
.caixa-link { display: flex; gap: 8px; margin-top: 8px; }
.caixa-link input { flex: 1; font-size: 13px; font-family: ui-monospace, monospace; }

/* ---------- Requisitos de senha ---------- */
.requisitos { list-style: none; padding: 0; margin: 6px 0 14px; font-size: 13px; }
.requisitos li { color: var(--muted); padding-left: 22px; position: relative; margin-bottom: 3px; }
.requisitos li::before { content: "○"; position: absolute; left: 4px; }
.requisitos li.ok { color: var(--success); }
.requisitos li.ok::before { content: "●"; }

/* ---------- Responsivo ---------- */
@media (max-width: 860px) {
  /* Botão hambúrguer fixo no canto superior esquerdo */
  .menu-toggle {
    display: flex; align-items: center; justify-content: center;
    position: fixed; top: 12px; left: 12px; z-index: 120;
    width: 44px; height: 44px; border-radius: 8px;
    background: var(--navy); color: #fff; border: none; cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.25); transition: left .25s ease;
  }
  /* com o menu aberto, o botão desliza para a direita da sidebar (260px) */
  .menu-toggle.deslocado { left: 272px; }
  /* A sidebar mantém o layout vertical do PC, mas fica fora da tela e desliza por cima */
  .sidebar {
    width: 260px; transform: translateX(-100%); z-index: 115;
    transition: transform .25s ease; box-shadow: 2px 0 18px rgba(0,0,0,.3);
  }
  .sidebar.aberto { transform: translateX(0); }
  /* mantém as abas na vertical (igual ao PC) */
  .abas { flex-direction: column; overflow-y: auto; flex: 1; gap: 3px; }
  .aba { width: 100%; flex: 0 0 auto; }
  /* fundo escurecido quando o menu está aberto */
  .menu-overlay.ativo {
    display: block; position: fixed; inset: 0; z-index: 110;
    background: rgba(0,0,0,.45);
  }
  /* conteúdo ocupa a largura toda; espaço no topo para o botão */
  .conteudo-painel { margin-left: 0; padding: 64px 16px 16px; max-width: none; }

  /* --- Filtros das listas: empilhados, De/Até lado a lado --- */
  .filtros-consulta { gap: 10px; }
  .filtros-consulta .f-busca { flex: 1 1 100%; min-width: 0; }
  .filtros-consulta .f-data { flex: 1 1 calc(50% - 5px); min-width: 0; }
  .filtros-consulta .f-data input { width: 100%; min-width: 0; }
  .filtros-consulta .f-limpar { flex: 1 1 100%; }
  .filtros-consulta .f-export { flex: 1 1 100%; margin-left: 0; }
  .filtros-consulta .f-export .btn { flex: 1; }

  /* --- Botões de ação (Cancelar / Marcar realizada): empilhados com espaço --- */
  .acoes-consulta { flex-direction: column; gap: 10px; }
  .acoes-consulta .btn { width: 100%; }
}
@media (max-width: 560px) {
  .linha { flex-direction: column; gap: 0; }
  .acoes-consulta { gap: 10px; }
}

/* =====================================================================
   Prontuário (F6b-1) — layout inspirado no modelo, em azul (--navy)
   ===================================================================== */
.pront-topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.9); backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.pront-topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 24px; height: 60px;
  display: flex; align-items: center; gap: 18px;
}
.pront-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--navy); white-space: nowrap; }
.pront-brand .dot { width: 26px; height: 26px; border-radius: 7px; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 14px; }
.pront-voltar {
  margin-left: auto; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.pront-voltar:hover { color: var(--navy); }
.pront-doctor { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.pront-doctor .nome { font-size: 13.5px; font-weight: 600; line-height: 1.1; }
.pront-doctor .role { font-size: 12px; color: var(--muted); }
.pront-doctor .ava { width: 34px; height: 34px; border-radius: 50%; background: #e6edf6; color: var(--navy); display: grid; place-items: center; font-weight: 700; font-size: 13px; }

.pront-wrap { max-width: 1180px; margin: 0 auto; padding: 24px; }

.pront-patient {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 24px;
  display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap;
}
.pront-patient .avatar {
  width: 64px; height: 64px; border-radius: 18px; flex: none;
  background: linear-gradient(135deg, var(--navy), var(--navy-hover));
  color: #fff; display: grid; place-items: center; font-size: 24px; font-weight: 700;
}
.pront-patient .who { flex: 1; min-width: 220px; }
.pront-patient .nome { font-size: 27px; font-weight: 700; line-height: 1.1; letter-spacing: -.01em; }
.pront-patient .meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 9px; color: var(--muted); font-size: 14px; }
.pront-patient .meta b { color: var(--text); font-weight: 600; }
.pront-patient .meta .sep { color: var(--border); }
.pront-patient .acoes { display: flex; align-items: flex-start; }

.pront-grid { display: grid; grid-template-columns: 1.65fr 1fr; gap: 22px; margin-top: 22px; align-items: start; }
.pront-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.pront-panel-head h2 { font-size: 17px; margin: 0; }
.eyebrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--navy); font-weight: 700; margin-bottom: 3px; }

.pront-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 16px;
}
.pront-card h3 { font-size: 15px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.pront-vazio {
  color: var(--muted); font-size: 14px; padding: 22px; text-align: center;
  border: 1px dashed var(--border); border-radius: var(--radius); background: var(--bg);
}
.pront-em-breve { font-size: 11px; font-weight: 600; color: var(--warn-text); background: var(--warn-bg); padding: 2px 8px; border-radius: 999px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px; white-space: nowrap;
}
.pill-crit { background: var(--danger-bg); color: var(--danger); }
.pill-chronic { background: var(--warn-bg); color: var(--warn-text); }

@media (max-width: 860px) {
  .pront-grid { grid-template-columns: 1fr; }
}

/* ---------- Linha do tempo (F6b-2) ---------- */
.tl-acoes { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tl-filtros { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 6px; }
.chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  font-size: 13px; font-weight: 600; padding: 6px 13px; border-radius: 999px; cursor: pointer;
}
.chip:hover { border-color: var(--navy); color: var(--navy); }
.chip[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }

.timeline { position: relative; padding-left: 26px; margin-top: 12px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-node { position: relative; margin-bottom: 14px; }
.tl-marker {
  position: absolute; left: -26px; top: 16px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--navy); z-index: 2;
}
.tl-node.exame .tl-marker { border-color: var(--warn-text); }
.tl-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.tl-card-head {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: 13px 16px; display: flex; gap: 12px; align-items: center;
}
.tl-tipo { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; }
.tl-tipo.consulta { background: #e6edf6; color: var(--navy); }
.tl-tipo.exame { background: var(--warn-bg); color: var(--warn-text); }
.tl-card-head .tl-body { flex: 1; min-width: 0; }
.tl-autor { font-size: 13px; color: var(--muted); margin-top: 4px; }
.tl-when { text-align: right; font-size: 13px; color: var(--muted); white-space: nowrap; }
.tl-chev { transition: transform .15s; color: var(--muted); }
.tl-card.aberto .tl-chev { transform: rotate(180deg); }
.tl-detail { display: none; padding: 0 16px 14px; border-top: 1px solid var(--border); }
.tl-card.aberto .tl-detail { display: block; }
.tl-field { margin-top: 12px; }
.tl-flabel { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; margin-bottom: 3px; }
.tl-fval { font-size: 14px; color: var(--text); white-space: pre-wrap; }
.tl-adendos { margin-top: 14px; }
.tl-adendo { border-left: 3px solid var(--navy); background: var(--bg); padding: 8px 12px; border-radius: 0 6px 6px 0; margin-top: 8px; }
.tl-adendo .cab { font-size: 11.5px; font-weight: 700; color: var(--navy); text-transform: uppercase; letter-spacing: .03em; }
.tl-adendo .txt { font-size: 14px; white-space: pre-wrap; margin-top: 2px; }
.tl-adendo .quem { font-size: 12px; color: var(--muted); margin-top: 3px; }
.tl-add-adendo { margin-top: 12px; }
.ta { width: 100%; padding: 9px 11px; font-size: 14px; font-family: var(--font); border: 1px solid var(--border); border-radius: 6px; resize: vertical; }

/* ---------- Cartões clínicos editáveis (F6b-3) ---------- */
.pront-alertas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cartao-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cartao-head h3 { margin: 0; font-size: 15px; }
.cartao-barra { display: flex; gap: 8px; margin-top: 12px; }
.taglist { display: flex; flex-wrap: wrap; gap: 7px; }
.taglist .pill { display: inline-flex; align-items: center; gap: 6px; }
.tag-x, .med-x { border: none; background: rgba(0,0,0,.08); color: inherit; border-radius: 50%; width: 17px; height: 17px; line-height: 1; cursor: pointer; font-size: 13px; padding: 0; }
.tag-x:hover, .med-x:hover { background: rgba(0,0,0,.18); }
.add-row { display: flex; gap: 8px; margin-top: 10px; }
.add-row .add-input { flex: 1; padding: 7px 10px; font-size: 14px; font-family: var(--font); border: 1px solid var(--border); border-radius: 6px; }
.med { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.med:last-child { border-bottom: none; }
.med .mname { font-weight: 600; font-size: 14px; }
.med .mdose { font-size: 13px; color: var(--muted); }
.med-edit { border: 1px solid var(--border); border-radius: 8px; padding: 8px; margin-bottom: 8px; }
.med-edit input { width: 100%; padding: 6px 9px; font-size: 14px; font-family: var(--font); border: 1px solid var(--border); border-radius: 6px; }
.med-edit .row2 { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.med-edit .row2 input { flex: 1; }

/* ---------- Cadastrar paciente: formulário + lista ---------- */
.cadastro-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 20px; align-items: start; }
.contador-pac {
  background: var(--navy); color: #fff; font-size: 13px; font-weight: 700;
  min-width: 26px; height: 26px; padding: 0 9px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
}
@media (max-width: 980px) {
  .cadastro-grid { grid-template-columns: 1fr; }
}

/* Tabela de pacientes (cadastro) é estreita: não força os 640px das demais */
.tabela-pac table { min-width: 0; }
.tabela-pac td, .tabela-pac th { padding-left: 10px; padding-right: 10px; }

/* ---------- Dashboards (Onda 2) ---------- */
.resumo-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.resumo-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px;
}
.resumo-card .rc-num { font-size: 24px; font-weight: 700; color: var(--navy); line-height: 1.1; }
.resumo-card .rc-lbl { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.dash-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.dash-card h3 { margin: 0 0 12px; font-size: 15px; }
.dash-canvas { position: relative; height: 260px; }
@media (max-width: 980px) {
  .resumo-cards { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
}

/* ---------- Tabela com rolagem (~10 linhas) e cabeçalho fixo ---------- */
.tabela-scroll { max-height: 460px; overflow-y: auto; }
.tabela-scroll thead th { position: sticky; top: 0; z-index: 2; }
/* campo de busca da lista de pacientes */
.busca-pac { position: relative; margin-bottom: 12px; }
.busca-pac input {
  width: 100%; padding: 9px 11px 9px 34px; font-size: 14px; font-family: var(--font);
  border: 1px solid var(--border); border-radius: 6px; box-sizing: border-box;
}
.busca-pac svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }

/* dia da semana ao lado da data (tabela de horários) */
.dia-sem { color: var(--muted); font-size: 13px; text-transform: capitalize; }

/* filtros das consultas realizadas */
.filtros-realizadas { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.filtros-realizadas .campo label { display: block; }

/* chip de dia (agendamento): data em cima, dia da semana embaixo */
.chip-dia { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 14px; border-radius: 12px; line-height: 1.15; }
.chip-dia .cd-data { font-size: 14px; font-weight: 700; color: inherit; }
.chip-dia .cd-dow { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: capitalize; }

/* campo somente-leitura (ex.: CPF na edição do médico) */
.campo-travado { background: #f1f3f5; color: var(--muted); cursor: not-allowed; }

/* botões de exportação: verde (Excel) e vermelho (PDF) */
.btn-excel { background: #1e7e45; border-color: #1e7e45; color: #fff; }
.btn-excel:hover { background: #196b3a; border-color: #196b3a; }
.btn-pdf { background: #c0392b; border-color: #c0392b; color: #fff; }
.btn-pdf:hover { background: #a93226; border-color: #a93226; }

/* configurações em 2 colunas (campos curtos) */
.config-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
@media (max-width: 640px) { .config-grid { grid-template-columns: 1fr; } }

/* abas do painel do super admin */
.abas-painel { display:flex; gap:6px; border-bottom:2px solid var(--border); margin-bottom:20px; }
.aba-painel { background:none; border:none; padding:12px 18px; font-size:15px; font-weight:600;
  color:var(--muted); cursor:pointer; border-bottom:3px solid transparent; margin-bottom:-2px; }
.aba-painel:hover { color:var(--navy); }
.aba-painel.ativa { color:var(--navy); border-bottom-color:var(--navy); }

/* selos de status de pagamento */
.selo-pag { display:inline-block; padding:3px 10px; border-radius:12px; font-size:12px; font-weight:600; white-space:nowrap; }
.selo-aguardando { background:#fff4d6; color:#8a6d0b; }
.selo-vencido { background:#fde2e0; color:#a93226; }
.selo-pago { background:#e2f5e9; color:#1e7e45; }
.selo-sem { background:#eef1f4; color:#5b6877; }

/* caixa do Pix copia e cola (visual moderno) */
.pix-box { background:#f2f6fb; border:1px solid #d6e0ee; border-radius:10px; padding:14px 16px; }
.pix-box .pix-rotulo { font-size:12px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.4px; margin-bottom:8px; }
.pix-codigo { font-family:"Consolas","Courier New",monospace; font-size:12.5px; color:#243244;
  word-break:break-all; line-height:1.5; background:#fff; border-radius:8px; padding:10px 12px; border:1px solid #e2e8f0; }
.pix-box .btn { margin-top:12px; }
.pag-atual-pago { display:flex; align-items:center; gap:10px; font-size:15px; }

/* Data de nascimento por listas (Dia / Mês / Ano) — tela de agendamento */
.data-nasc-selects { display: flex; gap: 8px; }
.data-nasc-selects select {
  flex: 1; min-width: 0; padding: 10px 8px; font-size: 15px;
  border: 1px solid var(--border); border-radius: var(--radius); background: #fff; color: inherit;
}
.data-nasc-selects select:focus { outline: none; border-color: var(--navy); }
