/* Agenda Odontológica — visual inspirado em style.css */
:root {
  --bg: #f4f7f6;
  --panel: #ffffff;
  --text: #17211d;
  --muted: #64736d;
  --line: #d9e2de;
  --brand: #0b8f68;
  --brand-dark: #087051;
  --danger: #b42318;
  --soft: #eaf5f0;
  font-size-base: 120%;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; font-size: 100%; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.18), transparent 26%),
    linear-gradient(180deg, #eef8f4 0%, #c6e5da 100%);
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.container-400 {
  max-width: 400px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #d5ede5;
  box-shadow: 0 0 0 1px rgba(133, 183, 190, 0.34);
}

.topo {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.marca { font-weight: 700; color: var(--text); }
.topo-nav { display: flex; gap: 8px; font-size: 0.9rem; }
.topo-nav a { color: var(--text); }

.faixa-temp {
  background: #fff8e6; border-bottom: 1px solid #f0e2b6;
  padding: 6px 14px; font-size: 13px; color: #6b5a1e; text-align: center;
}
.faixa-temp a { color: var(--brand); }

.conteudo { flex: 1; padding: 14px; }
.conteudo.centro { display: flex; flex-direction: column; align-items: center; padding-top: 40px; }
.conteudo.centro .formulario { width: 100%; max-width: 400px; }

h1 { font-size: 1.55rem; margin: 4px 0 12px; }
.pagina-topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* Botões e campos */
.btn {
  display: inline-block; padding: 10px 14px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  font-size: 0.9rem; cursor: pointer; text-align: center; font-weight: 400;
  min-height: 42px;
}
.btn-primario {
  background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700;
}
.btn-primario:hover, .btn-primario:focus { background: var(--brand-dark); }
.btn-perigo { background: var(--panel); border-color: var(--danger); color: var(--danger); }
.btn-pequeno { padding: 6px 10px; font-size: 0.86rem; min-height: auto; }
.link-btn {
  background: none; border: none; color: var(--brand); font-size: 0.9rem;
  cursor: pointer; padding: 8px 4px; text-decoration: underline;
}
button.link-btn { font: inherit; }

.campo {
  width: 100%; padding: 10px; font-size: 0.9rem;
  border: 1px solid var(--line); border-radius: 7px; margin: 8px 0;
  background: var(--panel); color: var(--text);
  min-height: 42px;
}

/* Formulários */
.formulario label { display: block; margin: 12px 0; font-size: 0.82rem; font-weight: 700; color: var(--muted); }
.formulario input[type="text"],
.formulario input[type="password"],
.formulario input[type="date"],
.formulario textarea {
  display: block; width: 100%; margin-top: 4px; padding: 10px;
  font-size: 0.9rem; border: 1px solid var(--line); border-radius: 7px;
  font-family: inherit; background: var(--panel); color: var(--text);
  min-height: 42px;
}
.formulario small.dica { color: var(--muted); font-size: 0.82rem; }
.linha { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.linha label { grid-column: span 1; }
.form-acoes { display: flex; gap: 14px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.form-inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.separador { border: none; border-top: 1px solid var(--line); margin: 24px 0 16px; }

/* Flash / avisos */
.flash { padding: 10px 12px; border-radius: 7px; margin: 10px 0; font-size: 0.9rem; font-weight: 700; }
.flash-ok { background: #e8f6ed; color: #176439; }
.flash-aviso { background: #fff8e6; color: #6b5a1e; }
.flash-erro { background: #fdeceb; color: var(--danger); }

/* Lista da agenda */
.agenda-topo { margin-bottom: 8px; }
.agenda-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.agenda-item {
  display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center;
  padding: 13px; border: 1px solid var(--line); border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 18px rgba(24, 45, 36, 0.07);
  border-left-width: 5px;
}
.agenda-item[data-cor="vermelho"] { border-left-color: #b42318; }
.agenda-item[data-cor="laranja"] { border-left-color: #d97c20; }
.agenda-item[data-cor="amarelo"] { border-left-color: #d9a020; }
.agenda-item[data-cor="verde"] { border-left-color: var(--brand); }
.agenda-item[data-cor="azul"] { border-left-color: #2574d9; }
.agenda-item[data-cor="roxo"] { border-left-color: #6f5cc2; }
.agenda-item.excluido { opacity: .65; border-left-color: var(--muted); }
.agenda-item-content { display: flex; align-items: center; gap: 10px; }
.bolinha {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  border: 1px solid var(--line); background: #ccc; cursor: pointer; padding: 0;
}
.bolinha.tem-cor { border-color: transparent; }
.agenda-info {
  flex: 1; text-align: left; background: none; border: none; padding: 6px 0;
  font-size: 0.9rem; color: var(--text); cursor: pointer; font-family: inherit;
}
a.agenda-info { display: block; color: var(--text); }
.agenda-link:hover { text-decoration: none; }
.agenda-quando { color: var(--muted); font-size: 0.9rem; }
.agenda-nome { font-weight: 700; }
.agenda-wa, .agenda-dica { font-size: 0.82rem; color: var(--muted); margin-left: 8px; }
.agenda-wa-texto { font-size: 0.82rem; color: var(--muted); margin-top: 4px; }
.vazio { color: var(--muted); padding: 16px 4px; font-size: 0.9rem; }
.discreto { font-size: 0.82rem; color: var(--muted); margin-top: 20px; }
.dica { font-size: 0.82rem; color: var(--muted); margin-top: 14px; }
.agenda-rodape { display: flex; justify-content: space-between; margin-top: 14px; }

/* Lista de pacientes e agendamentos */
.lista-completa { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lista-completa .agenda-item {
  padding: 13px; border: 1px solid var(--line); border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 18px rgba(24, 45, 36, 0.07);
}
.lista-completa .agenda-item-content { display: flex; align-items: center; gap: 10px; }

/* Gaveta "Ver mais" */
.gaveta {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  display: flex; align-items: flex-end; justify-content: center; z-index: 40;
  padding: 0 14px;
}
.gaveta-caixa {
  background: var(--panel); width: 100%; max-width: 400px; max-height: 75vh;
  overflow-y: auto; border-radius: 14px 14px 0 0; padding: 14px;
}
.gaveta-topo { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.gaveta-nota { font-size: 13px; color: var(--muted); }

/* Modal de resumo */
.modal-fundo {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px 14px;
}
.modal-caixa {
  background: var(--panel); width: 100%; max-width: 400px; border-radius: 8px; padding: 14px;
  border: 1px solid var(--line);
}
.modal-titulo { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.modal-nome { font-size: 1.55rem; font-weight: 700; margin: 4px 0 10px; }
.modal-linha { font-size: 0.9rem; margin: 6px 0; }
.modal-obs { font-size: 0.9rem; color: var(--muted); background: var(--soft); border-radius: 8px; padding: 8px 10px; margin-top: 10px; white-space: pre-wrap; }
.modal-wa { margin-top: 12px; font-size: 0.9rem; }
.modal-wa a { color: var(--brand); }
.modal-acoes { display: flex; justify-content: space-between; margin-top: 16px; }

/* Menu de cores */
.menu-cores {
  position: fixed; z-index: 60; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px; display: flex; gap: 6px;
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
  max-width: calc(400px - 28px);
  left: 14px;
}
.menu-cores .cor-mini {
  width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line);
  cursor: pointer; padding: 0;
}
.menu-cores .cor-mini.neutro { background: var(--panel); }
.menu-cores .cor-mini.ativa { box-shadow: 0 0 0 2px var(--brand); }

/* Seletor de cor no formulário */
.cores-field { border: none; padding: 0; margin: 12px 0; }
.cores-field legend { font-size: 0.9rem; padding: 0; }
.cores-field legend small { color: var(--muted); }
.cores-opcoes { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.cor-opcao {
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line);
  cursor: pointer; padding: 0; position: relative;
}
.cor-opcao.ativa { border-color: var(--brand); box-shadow: 0 0 0 2px var(--soft) inset; }
.cor-opcao.sem-cor { background: var(--panel); font-size: 10px; color: var(--muted); }

.novo-paciente { margin: 8px 0 4px; font-size: 0.9rem; }
.novo-paciente summary { cursor: pointer; color: var(--brand); }
.novo-paciente label { margin-top: 8px; }

.rodape {
  padding: 12px 14px 30px;
  font-size: 0.82rem; color: var(--muted);
}

@media (min-width: 700px) {
  .gaveta { align-items: center; }
  .gaveta-caixa { border-radius: 14px; max-height: 80vh; }
}
