html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

nav {
  margin-bottom: 1rem;
}

#agenda {
  width: 100%;
  max-width: 100%;
}

#agenda article {
  min-height: 160px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  padding: 1rem;
}

#agenda footer button {
  line-height: 1;
  font-size: 0.85rem;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
}

#agenda p {
  display: flex;
  align-items: center;
  margin: 0.2rem 0;
  font-size: 0.9rem;
  color: #333;
}

#agenda svg {
  flex-shrink: 0;
  color: #0d6efd;
}

dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  width: min(95vw, 640px);
  max-width: 100%;
  max-height: 90dvh;
  overflow: auto;
  box-shadow: 0 8px 25px rgba(0,0,0,0.25);
}

dialog::backdrop {
  backdrop-filter: blur(2px);
}

dialog form article {
  margin: 0;
  padding: 1.25rem 1.5rem;
  box-sizing: border-box;
}

dialog form article header {
  font-weight: 800;
  font-size: 1.25rem;
  margin-bottom: 1rem;
  text-align: center;
  border-bottom: 1px solid #e7e7e7;
  padding-bottom: 0.6rem;
}

dialog fieldset.grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 0 0 1rem 0;
  padding: 0;
  border: 0;
}

dialog fieldset.grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
}

dialog input {
  width: 100%;
  box-sizing: border-box;
  font-size: 0.95rem;
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  border: 1px solid #cfcfcf;
}

dialog fieldset.grid:last-of-type {
  grid-template-columns: 1fr 1fr;
  align-items: center;
}

dialog button {
  border-radius: 8px;
  font-size: 0.95rem;
  padding: 0.6rem 0.8rem;
  width: 100%;
}

#aceptar {
  background: #0d6efd;
  color: #fff;
}

#cancelar {
  background: #6c757d;
  color: #fff;
}

@media (max-width: 640px) {
  dialog fieldset.grid {
    grid-template-columns: 1fr;
  }
  dialog {
    width: 96vw;
    max-width: 96vw;
  }
  #agenda {
    grid-template-columns: 1fr !important;
  }
}

nav ul:last-child {
  display: flex;
  align-items: center;
  gap: .75rem;
  justify-content: flex-end;
}

nav ul:last-child li:first-child {
  flex: 0 1 480px;
  max-width: 480px;
  min-width: 260px;
}

#buscar {
  width: 100% !important;
  max-width: 100%;
}

@media (max-width: 640px) {
  nav ul:last-child {
    gap: .5rem;
  }
  nav ul:last-child li:first-child {
    flex: 1 1 auto;
    max-width: none;
    min-width: 0;
  }
  #buscar {
    width: 100% !important;
  }
}

.titulo-pagina {
  text-align: center;
  margin: 0.5rem auto 1rem;
  font-weight: 800;
  font-size: clamp(1.4rem, 1.2rem + 1vw, 2rem);
  transform: translateX(1cm);
}

